-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcontroller.php
88 lines (64 loc) · 4.48 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
<?php
namespace Concrete\Package\EasyImageGallery;
defined('C5_EXECUTE') or die('Access Denied.');
use \Concrete\Core\Block\BlockType\BlockType;
use Concrete\Core\Asset\Asset;
use Concrete\Core\Asset\AssetList;
use Route;
use Events;
use Loader;
use Concrete\Package\EasyImageGallery\Src\Helper\MclInstaller;
class Controller extends \Concrete\Core\Package\Package {
protected $pkgHandle = 'easy_image_gallery';
protected $appVersionRequired = '5.7.5.2';
protected $pkgVersion = '1.3.2';
protected $pkg;
public function getPackageDescription() {
return t("Easy Image made gallery easy for your client");
}
public function getPackageName() {
return t("Easy Image Gallery");
}
public function on_start() {
$this->registerRoutes();
$this->registerAssets();
}
public function registerAssets()
{
$al = AssetList::getInstance();
$al->register( 'javascript', 'knob', 'blocks/easy_image_gallery/javascript/build/jquery.knob.js', array('version' => '1.2.11', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this );
$al->register( 'javascript', 'easy-gallery-edit', 'blocks/easy_image_gallery/javascript/build/block-edit.js', array('version' => '1', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this );
$al->register( 'css', 'easy-gallery-edit', 'blocks/easy_image_gallery/stylesheet/block-edit.css', array('version' => '1', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this );
$al->register( 'css', 'easy-gallery-view', 'blocks/easy_image_gallery/stylesheet/block-view.css', array('version' => '1', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this );
// View items
$al->register( 'javascript', 'intense', 'blocks/easy_image_gallery/javascript/build/intense.js', array('version' => '1', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this );
$al->register( 'javascript', 'fancybox', 'blocks/easy_image_gallery/javascript/build/jquery.fancybox.pack.js', array('version' => '2.1.5', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this );
$al->register( 'javascript', 'masonry', 'blocks/easy_image_gallery/javascript/build/masonry.pkgd.min.js', array('version' => '3.1.4', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this );
$al->register( 'javascript', 'imagesloaded', 'blocks/easy_image_gallery/javascript/build/imagesloaded.pkgd.min.js', array('version' => '3.1.4', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this );
$al->register( 'javascript', 'isotope', 'blocks/easy_image_gallery/javascript/build/isotope.pkgd.min.js', array('version' => '3.1.4', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this );
$al->register( 'javascript', 'lazyload', 'blocks/easy_image_gallery/javascript/build/jquery.lazyload.min.js', array('version' => '1.9.1', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this );
$al->register( 'css', 'fancybox', 'blocks/easy_image_gallery/stylesheet/jquery.fancybox.css', array('version' => '2.1.5', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this );
}
public function registerRoutes()
{
Route::register('/easyimagegallery/tools/savefield','\Concrete\Package\EasyImageGallery\Controller\Tools\EasyImageGalleryTools::save');
Route::register('/easyimagegallery/tools/getfilesetimages','\Concrete\Package\EasyImageGallery\Controller\Tools\EasyImageGalleryTools::getFileSetImage');
Route::register('/easyimagegallery/tools/getfiledetailsjson','\Concrete\Package\EasyImageGallery\Controller\Tools\EasyImageGalleryTools::getFileDetailsJson');
}
public function install() {
// Get the package object
$this->pkg = parent::install();
// Installing
$this->installOrUpgrade();
}
private function installOrUpgrade() {
$ci = new MclInstaller($this->pkg);
$ci->importContentFile($this->getPackagePath() . '/config/install/base/blocktypes.xml');
$ci->importContentFile($this->getPackagePath() . '/config/install/base/attributes.xml');
}
public function upgrade () {
$this->pkg = $this;
$this->installOrUpgrade();
parent::upgrade();
}
}