/
controller.php
50 lines (39 loc) · 1.36 KB
/
controller.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
<?php
namespace Concrete\Block\CoreBoardSlot;
use Concrete\Core\Block\BlockController;
use Concrete\Core\Board\Instance\Slot\Content\ContentRenderer;
use Concrete\Core\Entity\Board\SlotTemplate;
use Concrete\Core\Feature\Features;
use Concrete\Core\Feature\UsesFeatureInterface;
use Doctrine\ORM\EntityManager;
class Controller extends BlockController
{
protected $btTable = 'btCoreBoardSlot';
protected $btIsInternal = true;
protected $btIgnorePageThemeGridFrameworkContainer = true;
public $contentObjectCollection;
public $slotTemplateID;
public $instanceSlotID;
public function getBlockTypeDescription()
{
return t("Proxy block for board slots.");
}
public function getBlockTypeName()
{
return t("Board Slot");
}
public function getInstanceSlotID()
{
return $this->instanceSlotID;
}
public function view()
{
$entityManager = $this->app->make(EntityManager::class);
$renderer = $this->app->make(ContentRenderer::class);
$collection = $renderer->denormalizeIntoCollection(json_decode($this->contentObjectCollection, true));
$template = $entityManager->find(SlotTemplate::class, (int) $this->slotTemplateID);
$this->set('dataCollection', $collection);
$this->set('renderer', $renderer);
$this->set('template', $template);
}
}