-
Notifications
You must be signed in to change notification settings - Fork 452
/
DashboardPageController.php
54 lines (44 loc) · 1.44 KB
/
DashboardPageController.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace Concrete\Core\Page\Controller;
use Concrete\Core\Error\Error;
use Concrete\Core\Validation\CSRF\Token;
use Loader;
class DashboardPageController extends PageController
{
/** @var Error */
protected $error;
protected $restrictedMethods = array(
'enableNativeMobile'
);
/** @var Token */
public $token;
protected $helpers = array('form');
public function enableNativeMobile()
{
$md = new \Mobile_Detect();
if ($md->isMobile()) {
$this->addHeaderItem('<meta name="viewport" content="width=device-width,initial-scale=1"/>');
}
}
public function on_start()
{
$this->token = Loader::helper('validation/token');
$this->error = Loader::helper('validation/error');
$this->set('interface', Loader::helper('concrete/ui'));
$this->set('dashboard', Loader::helper('concrete/dashboard'));
$hideDashboardPanel = false;
if (\Cookie::has('dashboardPanelStatus') && \Cookie::get('dashboardPanelStatus') == 'closed') {
$hideDashboardPanel = true;
}
$this->set('hideDashboardPanel', $hideDashboardPanel);
}
public function on_before_render()
{
$pageTitle = $this->get('pageTitle');
if (!$pageTitle) {
$this->set('pageTitle', $this->c->getCollectionName());
}
$this->set('token', $this->token);
$this->set('error', $this->error);
}
}