-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.php
More file actions
49 lines (37 loc) · 1.48 KB
/
controller.php
File metadata and controls
49 lines (37 loc) · 1.48 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
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
class ProductFreeTrailPackage extends Package {
protected $pkgHandle = 'product_free_trail';
protected $appVersionRequired = '5.3.0';
protected $pkgVersion = '1.0';
public function getPackageDescription() {
return t("Install the Product Free Trail form block.");
}
public function getPackageName() {
return t("Product Trail Form");
}
public function install() {
$pkg = parent::install();
Loader::model('collection_types');
Loader::model('collection_attributes');
Loader::model('package');
// install block
BlockType::installBlockTypeFromPackage('trial_form', $pkg);
//add single page
Loader::model('single_page');
$fcPage=Page::getByPath('/dashboard/Product Form');
if( !intval($fcPage->cID) ){
$fcPage=SinglePage::add('/dashboard/Product Form', $pkg);
}
$fcPage->update(array('cName'=>t('Product Form'), 'cDescription'=>t('Product Form .')));
$fcSocialPage=Page::getByPath('/dashboard/Product Form/Trail Form Registration');
if( !intval($fcSocialPage->cID) ){
$fcSocialPage=SinglePage::add('/dashboard/Product Form/Trail Form Registration', $pkg);
}
$fcSocialPage->update(array('cName'=>t('Trail Form Registration'), 'cDescription'=>t('Trail Form Registration.')));
}
public function uninstall(){
parent::uninstall();
}
}
?>