N2SmartsliderApplicationInfo.php
2.11 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
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
class N2SmartsliderApplicationInfo extends N2ApplicationInfo {
public function __construct() {
$this->path = dirname(__FILE__);
$this->assetPath = realpath(dirname(__FILE__) . "/../media");
parent::__construct();
}
public function isPublic() {
return true;
}
public function getName() {
return 'smartslider';
}
public function getLabel() {
return 'Smart Slider';
}
public function getInstance() {
require_once $this->path . NDS . "N2SmartsliderApplication.php";
return new N2SmartSliderApplication($this);
}
public function getPathKey() {
return '$ss$';
}
public function onNextendBaseReady() {
parent::onNextendBaseReady();
require_once dirname(__FILE__) . '/libraries/storage.php';
}
public function assetsBackend() {
static $once;
if ($once != null) {
return;
}
$once = true;
$path = $this->getAssetsPath();
N2CSS::addStaticGroup($path . '/admin/dist/smartslider-backend.min.css', 'smartslider-backend');
N2Localization::addJS(array(
'Insert',
'Insert variable',
'Choose the group',
'Choose the variable',
'Result',
'Filter',
'No',
'Clean HTML',
'Remove HTML',
'Split',
'Chars',
'Words',
'Start',
'Length',
'Find image',
'Index',
'Find link',
'Index'
));
N2JS::addStaticGroup($path . '/dist/smartslider-backend.min.js', 'smartslider-backend');
}
public function assetsFrontend() {
if (N2Platform::$isAdmin) {
N2JS::addInline('window.N2SSPRO=1;', true);
N2JS::addInline('window.N2SS3C="' . N2SS3::$campaign . '";', true);
}
$path = $this->getAssetsPath();
N2JS::addStaticGroup($path . '/dist/smartslider-frontend.min.js', 'smartslider-frontend');
}
}
return new N2SmartsliderApplicationInfo();