-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.php
More file actions
60 lines (48 loc) · 1.83 KB
/
Copy pathcontroller.php
File metadata and controls
60 lines (48 loc) · 1.83 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
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
class SadcRisdpCostingPackage extends Package {
protected $pkgHandle = 'sadc_risdp_costing';
protected $appVersionRequired = '5.6.0';
protected $pkgVersion = '1.4.0';
public function getPackageHandle() {
return t('sadc_risdp_costing');
}
public function getPackageName() {
return t('SADC RISDP Costing');
}
public function getPackageDescription() {
return t('Activity costing package for the revised RISDP.');
}
// automatically run by the package. Let's setup some events
public function on_start() {
$db = Loader::db();
}
public function install() {
$pkg = parent::install();
Loader::model('single_page');
$sp = SinglePage::add('/risdp/structure/sectors', $pkg);
$sp = SinglePage::add('/risdp/structure/implementing_agencies', $pkg);
$sp = SinglePage::add('/risdp/structure/planning_officers', $pkg);
$sp = SinglePage::add('/risdp/strategic_plan/immediate_outcomes', $pkg);
$sp = SinglePage::add('/risdp/strategic_plan/targeted_output', $pkg);
$sp = SinglePage::add('/risdp/strategic_plan/annual_output', $pkg);
$sp = SinglePage::add('/risdp/strategic_plan/main_activities', $pkg);
$sp = SinglePage::add('/risdp/strategic_plan/sub_activities', $pkg);
$sp = SinglePage::add('/risdp/strategic_plan/sub_activity_costs', $pkg);
$sp = SinglePage::add('/risdp/strategic_plan/reports', $pkg);
}
// update any existing installation
public function upgrade() {
parent::upgrade();
// add single pages for projects
$p = Page::getByPath('/risdp/projects');
if ($p->isError() || (!is_object($p))) {
SinglePage::add('/risdp/projects', $this);
}
$p = Page::getByPath('/risdp/projects/infrastructure');
if ($p->isError() || (!is_object($p))) {
SinglePage::add('/risdp/projects/infrastructure', $this);
}
}
}
?>