~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to lib/Middleware/Actions.php

  • Committer: Dan Garner
  • Date: 2016-03-09 13:21:23 UTC
  • mto: This revision was merged to the branch mainline in revision 486.
  • Revision ID: git-v1:0239ef66bdce8b493972c57100700616e6365ef6
Working install/update

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
 
26
26
use Slim\Middleware;
27
 
use Xibo\Controller\Library;
28
 
use Xibo\Factory\LayoutFactory;
29
27
use Xibo\Helper\Translate;
30
28
 
 
29
/**
 
30
 * Class Actions
 
31
 * @package Xibo\Middleware
 
32
 */
31
33
class Actions extends Middleware
32
34
{
33
35
    public function call()
45
47
 
46
48
                foreach (array_diff(scandir($folder), array('..', '.')) as $file) {
47
49
                    if (stripos($file, '.zip')) {
48
 
                        $layout = (new LayoutFactory($app->container))->createFromZip($folder . '/' . $file, null, 1, false, false, true);
 
50
                        $layout = $app->layoutFactory->createFromZip($folder . '/' . $file, null, 1, false, false, true);
49
51
                        $layout->save([
50
52
                            'audit' => false
51
53
                        ]);
53
55
                }
54
56
 
55
57
                // Install files
56
 
                (new Library())->setApp($app)->installAllModuleFiles();
 
58
                $app->container->get('\Xibo\Controller\Library')->installAllModuleFiles();
57
59
 
58
60
                $app->configService->ChangeSetting('DEFAULTS_IMPORTED', 1);
59
61
            }