-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.php
More file actions
47 lines (34 loc) · 1.2 KB
/
controller.php
File metadata and controls
47 lines (34 loc) · 1.2 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
<?php defined('C5_EXECUTE') or die("Access Denied.");
class ApiBaseUpdatesPackage extends Package {
protected $pkgHandle = 'api_base_updates';
protected $appVersionRequired = '5.6.0';
protected $pkgVersion = '0.94';
public function getPackageName() {
return t("Api:Base:Updates");
}
public function getPackageDescription() {
return t("Check for updates for base addons");
}
public function on_start() {
define('C5_API_UPDATE_URL', 'http://c5api.com/index.php/tools/updates');
}
public function install() {
$this->on_start();
$installed = Package::getByHandle('api');
if(!is_object($installed)) {
throw new Exception(t('Please install the "API" package before installing %s', $this->getPackageName()));
}
parent::install();
$pkg = Package::getByHandle($this->pkgHandle);
$p = SinglePage::add('/dashboard/api/core/updates',$pkg);
$p->update(array('cName'=> t('Updates')));
$p->setAttribute('icon_dashboard', 'icon-refresh');
}
public function upgrade() {
$p = Page::getByPath('/dashboard/api/core/updates');
$p->setAttribute('icon_dashboard', 'icon-refresh');
}
public function uninstall() {
parent::uninstall();
}
}