/
top.php
36 lines (28 loc) · 908 Bytes
/
top.php
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
<?php
namespace Concrete\Controller\Element\Dashboard\Navigation\Panel;
use Concrete\Core\Application\UserInterface\Dashboard\Navigation\FullNavigationFactory;
use Concrete\Core\Controller\ElementController;
use Concrete\Core\Navigation\Modifier\TopLevelOnlyModifier;
use Concrete\Core\Navigation\NavigationModifier;
class Top extends ElementController
{
/**
* @var FullNavigationFactory
*/
protected $factory;
public function getElement()
{
return 'dashboard/navigation/nav';
}
public function __construct(FullNavigationFactory $factory)
{
$this->factory = $factory;
}
public function view()
{
$navigation = $this->factory->createNavigation();
$modifier = new NavigationModifier();
$modifier->addModifier(new TopLevelOnlyModifier());
$this->set('navigation', $modifier->process($navigation));
}
}