/
controller.php
42 lines (31 loc) · 1.25 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
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
class EasyNewsPackage extends Package {
protected $pkgHandle = 'easy_news';
protected $appVersionRequired = '5.4.0';
protected $pkgVersion = '1.1';
function __construct(){
Loader::library('controller',$this->pkgHandle); //Used by controllers
Loader::library('dashboardcontroller',$this->pkgHandle); //Used by controllers
}
public function getPackageDescription() {
return t('Add multiple news area to your site.');
}
public function getPackageName() {
return t('Easy News');
}
public function install() {
$pkg = parent::install();
Loader::model('single_page');
Loader::model('attribute/categories/collection');
// install attributes
$cab1 = CollectionAttributeKey::add('BOOLEAN',array('akHandle' => 'easynews_section', 'akName' => t('NEWS Section'), 'akIsSearchable' => true), $pkg);
//install pages
$def = SinglePage::add('/dashboard/easy_news', $pkg);
$def->update(array('cName'=>'Easy News', 'cDescription'=>t('Manage site news.')));
$def = SinglePage::add('/dashboard/easy_news/help', $pkg);
$def->update(array('cName'=>'Easy News Help', 'cDescription'=>t('Easy News help.')));
//install block
BlockType::installBlockTypeFromPackage('easynews_list', $pkg);
}
}