-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
controller.php
92 lines (82 loc) · 1.93 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
namespace Concrete\Package\Redirect;
use Concrete\Core\Block\BlockType\BlockType;
use Concrete\Core\Block\BlockType\Set as BlockTypeSet;
use Concrete\Core\Database\EntityManager\Provider\ProviderInterface;
use Concrete\Core\Package\Package;
defined('C5_EXECUTE') or die('Access denied.');
class Controller extends Package implements ProviderInterface
{
/**
* The package handle.
*
* @var string
*/
protected $pkgHandle = 'redirect';
/**
* The package version.
*
* @var string
*/
protected $pkgVersion = '2.4.3';
/**
* The minimum concrete5/ConcreteCMS version.
*
* @var string
*/
protected $appVersionRequired = '8.2.0';
/**
* {@inheritdoc}
*
* @see \Concrete\Core\Package\Package::$pkgAutoloaderRegistries
*/
protected $pkgAutoloaderRegistries = [
'src' => 'MLRedirect',
];
/**
* {@inheritdoc}
*
* @see Package::getPackageName()
*/
public function getPackageName()
{
return t('Redirect');
}
/**
* {@inheritdoc}
*
* @see Package::getPackageDescription()
*/
public function getPackageDescription()
{
return t('This package offers a block to redirect users.');
}
/**
* {@inheritdoc}
*
* @see Package::install()
*/
public function install()
{
$pkg = parent::install();
$bt = BlockType::getByHandle('redirect');
if (!is_object($bt)) {
$bt = BlockType::installBlockType('redirect', $pkg);
}
$bts = BlockTypeSet::getByHandle('navigation');
if ($bts) {
if (!$bts->contains($bt)) {
$bts->addBlockType($bt);
}
}
}
/**
* {@inheritdoc}
*
* @see \Concrete\Core\Database\EntityManager\Provider\ProviderInterface::getDrivers()
*/
public function getDrivers()
{
return [];
}
}