/
details.php
34 lines (30 loc) · 1.03 KB
/
details.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
<?php
namespace Concrete\Controller\SinglePage\Dashboard\Boards;
use Concrete\Core\Entity\Board\Board;
use Concrete\Core\Page\Controller\DashboardSitePageController;
use Concrete\Core\Permission\Checker;
use Concrete\Core\Utility\Service\Validation\Strings;
use Concrete\Core\Validation\SanitizeService;
class Details extends DashboardSitePageController
{
public function view($id = null)
{
$r = $this->entityManager->getRepository(Board::class);
$board = $r->findOneByBoardID($id);
if ($board) {
$permissions = new Checker($board);
if (!$permissions->canViewBoard()) {
unset($board);
}
}
if ($board) {
$template = $board->getTemplate();
$templateDriver = $template->getDriver();
$this->set('template', $template);
$this->set('templateDriver', $templateDriver);
$this->set('board', $board);
} else {
return $this->redirect('/dashboard/boards/boards');
}
}
}