-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.php
47 lines (34 loc) · 983 Bytes
/
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
<?php
namespace Concrete\Package\AttributeMultiText;
use Concrete\Core\Backup\ContentImporter,
Package;
class Controller extends Package
{
protected $pkgHandle = 'attribute_multi_text';
protected $appVersionRequired = '5.7.4';
protected $pkgVersion = '1.0.0';
public function getPackageName()
{
return t('Multi text attribute');
}
public function getPackageDescription()
{
return t('Installs a multi text attribute where you can enter several lines in a single attribute');
}
protected function installXmlContent()
{
$pkg = Package::getByHandle($this->pkgHandle);
$ci = new ContentImporter();
$ci->importContentFile($pkg->getPackagePath() . '/install.xml');
}
public function install()
{
$pkg = parent::install();
$this->installXmlContent();
}
public function upgrade()
{
parent::upgrade();
$this->installXmlContent();
}
}