-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.php
70 lines (58 loc) · 1.94 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
<?php
/**
* Enhanced Version List
* Author: Thomas Dausner (aka dausi)
* © 2017 (enhancements)
* based on
*
* Global Version List
* Author: Vladimir S. <guyasyou@gmail.com>
* www.SiteCreate54.ru
* © 2016
*/
namespace Concrete\Package\TdsEnhancedVersionList;
use \AssetList;
use Package;
use SinglePage;
defined('C5_EXECUTE') or die(_("Access Denied."));
class Controller extends Package {
protected $pkgHandle = 'tds_enhanced_version_list';
protected $appVersionRequired = '5.7.5.9';
protected $pkgVersion = '0.9.2';
public function getPackageName() {
return t('Enhanced Version List');
}
public function getPackageDescription() {
return t('List of all collection versions enhanced by table sorter and obsolete removal.');
}
public function on_start() {
$al = AssetList::getInstance();
$assets = [
's' => 'css/style.css',
't' => 'css/tablesorter/jquery.tablesorter.css',
'g' => 'js/enhanced_version_list.js',
'j' => 'js/tablesorter/jquery.tablesorter.js',
];
$assetTypes = [
'c' => 'css',
'j' => 'javascript',
];
$assetGroups = [];
foreach ($assets as $c => $asset)
{
$at = $assetTypes[substr($asset, 0, 1)];
$al->register($at, 'tds_enhanced_version_list/'.$c, $asset, [], 'tds_enhanced_version_list');
$assetGroups[] = [$at, 'tds_enhanced_version_list/'.$c];
}
$al->registerGroup('tds_enhanced_version_list', $assetGroups);
}
public function install() {
/** @var $pkg \Concrete\Core\Package\Package() */
$pkg = parent::install();
//install single pages
$single_page = SinglePage::add('/dashboard/sitemap/tds_enhanced_version_list', $pkg);
if ($single_page) {
$single_page->update(array('cName'=>t('Enhanced list of versions'), 'cDescription'=>t('List of all collection versions enhanced by table sorter and obsolete removal.')));
}
}
}