-
Notifications
You must be signed in to change notification settings - Fork 3
/
controller.php
119 lines (102 loc) · 4.62 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
<?php
namespace Concrete\Package\EasyImageSlider;
defined('C5_EXECUTE') or die('Access Denied.');
use Concrete\Core\Asset\Asset;
use Concrete\Core\Asset\AssetList;
use Concrete\Core\Backup\ContentImporter;
use Concrete\Core\Package\Package;
use Route;
class Controller extends Package
{
protected $pkgHandle = 'easy_image_slider';
/**
* {@inheritdoc}
*
* @see \Concrete\Core\Package\Package::$appVersionRequired
*/
protected $appVersionRequired = '5.7.5.2';
protected $pkgVersion = '1.4.5';
/**
* {@inheritdoc}
*
* @see \Concrete\Core\Package\Package::$pkgAutoloaderRegistries
*/
protected $pkgAutoloaderRegistries = array(
'src' => 'EasyImageSlider',
);
/**
* {@inheritdoc}
*
* @see \Concrete\Core\Package\Package::getPackageDescription()
*/
public function getPackageDescription()
{
return t('Responsive & Touch enabled Slider & Carousel made Easy');
}
/**
* {@inheritdoc}
*
* @see \Concrete\Core\Package\Package::getPackageName()
*/
public function getPackageName()
{
return t('Easy Image Slider');
}
public function on_start()
{
$this->registerRoutes();
$this->registerAssets();
}
/**
* {@inheritdoc}
*
* @see \Concrete\Core\Package\Package::install()
*/
public function install()
{
parent::install();
$this->installOrUpgrade();
}
/**
* {@inheritdoc}
*
* @see \Concrete\Core\Package\Package::upgrade()
*/
public function upgrade()
{
$this->installOrUpgrade();
parent::upgrade();
}
private function installOrUpgrade()
{
if (method_exists($this, 'installContentFile')) {
$this->installContentFile('config/install.xml');
} else {
$ci = new ContentImporter();
$ci->importContentFile($this->getPackagePath() . '/config/install.xml');
}
}
private function registerRoutes()
{
Route::register('/easyimageslider/tools/savefield', 'EasyImageSlider\Tools::save');
Route::register('/easyimageslider/tools/getfilesetimages', 'EasyImageSlider\Tools::getFileSetImages');
Route::register('/easyimageslider/tools/getfiledetails', 'EasyImageSlider\Tools::getFileDetails');
}
private function registerAssets()
{
$al = AssetList::getInstance();
$al->register('javascript', 'knob', 'js/jquery.knob.js', array('version' => '1.2.12', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => false, 'combine' => true), $this);
$al->register('javascript', 'easy-slider-edit', 'js/block-edit.js', array('version' => '1', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => false, 'combine' => true), $this);
$al->register('css', 'easy-slider-edit', 'css/block-edit.css', array('version' => '1', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this);
$al->register('css', 'easy-slider-view', 'css/block-view.css', array('version' => '1', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this);
$al->register('css', 'owl-carousel', 'css/owl.carousel.css', array('version' => '1.3.3', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this);
$al->register('css', 'owl-theme', 'css/owl.theme.css', array('version' => '1.3.3', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this);
$al->register('css', 'animate', 'css/animate.css', array('version' => '1.0', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => false, 'combine' => true), $this);
$al->register('javascript', 'owl-carousel', 'js/owl.carousel.js', array('version' => '1.3.3', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => false, 'combine' => true), $this);
$al->register('javascript', 'imagesloaded', 'js/imagesloaded.js', array('version' => '5.0.0', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => false, 'combine' => true), $this);
// View items
$al->register('javascript', 'intense', 'js/intense.js', array('version' => '1', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => false, 'combine' => true), $this);
$al->register('javascript', 'prettyPhoto', 'js/jquery.prettyPhoto.js', array('version' => '3.1.6', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => false, 'combine' => true), $this);
$al->register('css', 'prettyPhoto', 'css/prettyPhoto.css', array('version' => '3.1.6', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => true), $this);
}
}