-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcontroller.php
33 lines (25 loc) · 1.05 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
<?php
// Author: Ryan Hewitt - http://www.mesuva.com.au
namespace Concrete\Package\MsvMultipleFileSelectorAttribute;
use Concrete\Core\Package\Package;
class Controller extends Package {
protected $pkgHandle = 'msv_multiple_file_selector_attribute';
protected $appVersionRequired = '8.0';
protected $pkgVersion = '1.0';
public function getPackageDescription() {
return t("Attribute that allows the selection of multiple files/images");
}
public function getPackageName() {
return t("Multiple File Selector Attribute");
}
public function install() {
$pkg = parent::install();
$factory = $this->app->make('Concrete\Core\Attribute\TypeFactory');
$type = $factory->getByHandle('multiple_file_selector');
if (!is_object($type)) {
$type = $factory->add('multiple_file_selector', t('Multiple Image/File'), $pkg);
}
$category = $this->app->make('Concrete\Core\Attribute\Category\CategoryService')->getByHandle('collection')->getController();
$category->associateAttributeKeyType($type);
}
}