/
menu.php
36 lines (30 loc) · 929 Bytes
/
menu.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\Express;
use Concrete\Core\Controller\ElementController;
use Concrete\Core\Entity\Express\Entity;
class Menu extends ElementController
{
protected $currentEntity;
protected $entityAction = 'admin';
public function __construct(Entity $entity)
{
parent::__construct();
$this->currentEntity = $entity;
}
public function enableViewEntityAction()
{
$this->entityAction = 'view';
}
public function getElement()
{
return 'dashboard/express/menu';
}
public function view()
{
$r = \ORM::entityManager()->getRepository('\Concrete\Core\Entity\Express\Entity');
$entities = $r->findBy(array(), array('name' => 'asc'));
$this->set('types', $entities);
$this->set('currentType', $this->currentEntity);
$this->set('entityAction', $this->entityAction);
}
}