/
controller.php
34 lines (29 loc) · 1015 Bytes
/
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
<?php
namespace Concrete\Block\DesktopConcreteLatest;
use Concrete\Core\Block\BlockController;
use Concrete\Core\ConcreteCms\ActivityService;
class Controller extends BlockController
{
protected $btCacheBlockRecord = true;
protected $btCacheBlockOutput = true;
protected $btCacheBlockOutputOnPost = true;
protected $btCacheBlockOutputLifetime = 7200;
protected $btTable = 'btDesktopConcreteLatest';
protected $btCacheBlockOutputForRegisteredUsers = true;
protected $slot;
public function getBlockTypeDescription()
{
return t("Grabs the latest information about Concrete from concretecms.com.");
}
public function getBlockTypeName()
{
return t("Desktop Latest News");
}
public function view()
{
$service = $this->app->make(ActivityService::class);
$slots = $service->getSlotContents();
$this->set('slot', isset($slots[$this->slot]) ? $slots[$this->slot] : null);
$this->set('key', $this->slot);
}
}