-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.php
More file actions
executable file
·46 lines (41 loc) · 1.39 KB
/
bootstrap.php
File metadata and controls
executable file
·46 lines (41 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
class ModulesBootstrap extends \Dsc\Bootstrap
{
protected $dir = __DIR__;
protected $namespace = 'Modules';
protected function preAdmin()
{
if (class_exists('\Search\Factory'))
{
\Search\Factory::registerSource(new \Search\Models\Source(array(
'id' => 'modules',
'title' => 'Modules',
'class' => '\Modules\Models\Modules',
'priority' => 40,
)));
}
$path = $this->app->hive()['PATH'];
if (strpos($path, '/admin/module/edit') !== false)
{
// Bootstrap the reports
\Modules\Models\Conditions::bootstrap();
}
$custom_nav_items = (new \Admin\Models\Navigation)->emptyState()
->setState('filter.root', false)
->setState('filter.published', true)
->setState('order_clause', array( 'tree'=> 1, 'lft' => 1 ))
->setCondition('details.type', 'module-custom')
->getList();
if ($custom_nav_items)
{
foreach ($custom_nav_items as $nav_item)
{
if ($position = $nav_item->{'details.module_position'})
{
\Modules\Factory::registerPositions(array($position));
}
}
}
}
}
$app = new ModulesBootstrap();