/
full.php
51 lines (42 loc) · 1.53 KB
/
full.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
<?php
namespace Concrete\Controller\SinglePage\Dashboard\Sitemap;
use Concrete\Core\Page\Controller\DashboardPageController;
defined('C5_EXECUTE') or die('Access Denied.');
class Full extends DashboardPageController
{
public function view()
{
$this->set('canRead', $this->canRead());
$session = $this->app->make('session');
$this->set('includeSystemPages', (bool) $session->get('ccm-sitemap-includeSystemPages'));
$this->set('displayDoubleSitemap', (bool) $session->get('ccm-sitemap-displayDoubleSitemap'));
}
public function include_system_pages($include = 0)
{
if ($this->canRead()) {
$session = $this->app->make('session');
if ($include) {
$session->set('ccm-sitemap-includeSystemPages', true);
} else {
$session->remove('ccm-sitemap-includeSystemPages');
}
}
return $this->buildRedirect('/dashboard/sitemap/full');
}
public function display_double_sitemap($display = 0)
{
if ($this->canRead()) {
$session = $this->app->make('session');
if ($display) {
$session->set('ccm-sitemap-displayDoubleSitemap', true);
} else {
$session->remove('ccm-sitemap-displayDoubleSitemap', true);
}
}
return $this->buildRedirect('/dashboard/sitemap/full');
}
protected function canRead(): bool
{
return $this->app->make('helper/concrete/dashboard/sitemap')->canRead();
}
}