/
controller.php
68 lines (57 loc) · 1.32 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
namespace Concrete\Block\DesktopConcreteLatest;
use Concrete\Core\Block\BlockController;
use Concrete\Core\ConcreteCms\ActivityService;
class Controller extends BlockController
{
/**
* @var bool
*/
protected $btCacheBlockOutput = true;
/**
* @var bool
*/
protected $btCacheBlockOutputOnPost = true;
/**
* @var int
*/
protected $btCacheBlockOutputLifetime = 7200;
/**
* @var string
*/
protected $btTable = 'btDesktopConcreteLatest';
/**
* @var bool
*/
protected $btCacheBlockOutputForRegisteredUsers = true;
/**
* @var string|null
*/
protected $slot;
/**
* @return string
*/
public function getBlockTypeDescription()
{
return t('Grabs the latest information about Concrete from concretecms.com.');
}
/**
* @return string
*/
public function getBlockTypeName()
{
return t('Desktop Latest News');
}
/**
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*
* @return void
*/
public function view()
{
$service = $this->app->make(ActivityService::class);
$slots = $service->getSlotContents();
$this->set('slot', $slots[$this->slot] ?? null);
$this->set('key', $this->slot);
}
}