-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcontroller.php
More file actions
62 lines (53 loc) · 1.62 KB
/
controller.php
File metadata and controls
62 lines (53 loc) · 1.62 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
59
60
61
62
<?php
namespace Concrete\Package\MultipleExpressEntrySelector;
use Concrete\Core\Package\Package;
class Controller extends Package
{
/**
* @var string Package handle.
*/
protected $pkgHandle = 'multiple_express_entry_selector';
/**
* @var string Required concrete5 version.
*/
protected $appVersionRequired = '8.1.1';
/**
* @var string Package version.
*/
protected $pkgVersion = '0.1';
/**
* @var array Array of location -> namespace autoloader entries for the package.
*/
protected $pkgAutoloaderRegistries = [];
protected $pkgAutoloaderMapCoreExtensions = true;
/**
* Returns the translated name of the package.
*
* @return string
*/
public function getPackageName()
{
return t('Multiple Express Entry Selector');
}
/**
* Returns the translated package description.
*
* @return string
*/
public function getPackageDescription()
{
return t('Add a new attribute type to select one or more express entries');
}
public function install()
{
$pkg = parent::install();
$factory = $this->app->make('Concrete\Core\Attribute\TypeFactory');
$type = $factory->getByID('express_multiple');
if (!is_object($type)) {
$type = $factory->add('express_multiple', 'Express Multiple', $pkg);
$service = $this->app->make('Concrete\Core\Attribute\Category\CategoryService');
$category = $service->getByHandle('collection')->getController();
$category->associateAttributeKeyType($type);
}
}
}