-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.php
131 lines (112 loc) · 3.19 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
namespace Concrete\Package\FotoramaBlock;
use Core;
use AssetList;
use Asset;
use Package;
use BlockType;
use Database;
defined('C5_EXECUTE') or die('Access Denied.');
class Controller extends Package
{
protected $pkgHandle = 'fotorama-block';
protected $appVersionRequired = '5.7.1';
protected $pkgVersion = '0.11.2';
public function getPackageName()
{
return t("Fotorama Block");
}
public function getPackageDescription()
{
return t("Installs a fotorama block type capable of creating galleries from filesets.");
}
public function install()
{
$pkg = parent::install();
// Install Block
if(!BlockType::getByHandle('fotorama')) {
BlockType::installBlockTypeFromPackage('fotorama', $pkg);
}
}
public function uninstall()
{
parent::uninstall();
$db = Database::get();
$db->exec('DROP TABLE btFotorama;');
$db->exec('DROP TABLE btFotoramaEntries;');
}
public function upgrade()
{
$pkg = $this;
parent::upgrade();
}
public function on_start()
{
$this->registerAssets();
}
protected function registerAssets()
{
$al = AssetList::getInstance();
// Fotorama
$al->register(
'css', 'fotorama/css', 'assets/fotorama-4.6.4/fotorama.css',
array('version' => '4.6.4', 'position' => Asset::ASSET_POSITION_HEADER, 'minify' => true, 'combine' => false), $this
);
$al->register(
'javascript', 'fotorama/js', 'assets/fotorama-4.6.4/fotorama.js',
array('version' => '4.6.4', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => false), $this
);
$al->registerGroup(
'fotorama',
array(
array('css', 'fotorama/css'),
array('javascript', 'fotorama/js')
)
);
// Bootstrap Tabs
$al->register(
'javascript',
'bootstrap/tab',
'assets/bootstrap.tab.js',
array(
'version' => '3.3.1',
'position' => Asset::ASSET_POSITION_FOOTER,
'minify' => true,
'combine' => true
),
$this
);
// Switchery
$al->register(
'javascript',
'switchery/js',
'assets/switchery.js',
array(
'version' => '0.7.0',
'position' => Asset::ASSET_POSITION_FOOTER,
'minify' => true,
'combine' => true
),
$this
);
$al->register(
'css',
'switchery/css',
'assets/switchery.css',
array(
'version' => '0.7.0',
'position' => Asset::ASSET_POSITION_HEADER,
'minify' => true,
'combine' => true
),
$this
);
$al->registerGroup(
'switchery',
array(
array('css', 'switchery/css'),
array('javascript', 'switchery/js')
)
);
}
}