-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontroller.php
More file actions
58 lines (49 loc) · 1.5 KB
/
controller.php
File metadata and controls
58 lines (49 loc) · 1.5 KB
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
<?php
/**
* Pure/CookiesNotice
* Author: Vladimir S. <guyasyou@gmail.com>
* www.pure-web.ru
* © 2017.
*/
namespace Concrete\Package\PureCookiesNotice;
use Concrete\Core\Block\BlockType\BlockType;
use Concrete\Core\Package\Package as PackageInstaller;
defined('C5_EXECUTE') or die('Access Denied.');
class Controller extends PackageInstaller
{
protected $pkgHandle = 'pure_cookies_notice';
protected $appVersionRequired = '8.1';
protected $pkgVersion = '1.3.4';
public function getPackageName()
{
return t('Cookies Notice');
}
public function getPackageDescription()
{
return t('Customizable notifications of users for anything, including the use of cookies (The Cookie Law Explained).');
}
public function on_start()
{
//*******************************************
//Assets
$al = \Concrete\Core\Asset\AssetList::getInstance();
//CSS
$al->register(
'css', //asset type
'pure_cookies_notice/edit', //asset name
'blocks/pure_cookies_notice/form.css', //path
[],
'pure_cookies_notice' //from package
);
//********************
}
public function install()
{
/** @var $pkg \Concrete\Core\Entity\Package() */
$pkg = parent::install();
$blockType = BlockType::getByHandle($this->pkgHandle);
if (!is_object($blockType)) {
BlockType::installBlockType($this->pkgHandle, $pkg);
}
}
}