-
Notifications
You must be signed in to change notification settings - Fork 4
/
tabcontent.admin_instancestab.php
executable file
·80 lines (61 loc) · 2.52 KB
/
tabcontent.admin_instancestab.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
<?php
#-------------------------------------------------------------------------
#
# Author: Ben Malen, <[email protected]>
# Co-Maintainer: Simon Radford, <[email protected]>
# Web: www.conceptfactory.com.au
#
#-------------------------------------------------------------------------
#
# Maintainer since 2011: Jonathan Schmid, <[email protected]>
# Web: www.jonathanschmid.de
#
#-------------------------------------------------------------------------
#
# ListIt is a CMS Made Simple module that enables the web developer to create
# multiple lists throughout a site. It can be duplicated and given friendly
# names for easier client maintenance.
#
#-------------------------------------------------------------------------
if (!is_object(cmsms())) exit;
$GLOBALS['CMS_FORCE_MODULE_LOAD'] = 1;
$themeObject = cms_utils::get_theme_object();
#---------------------
# Load modules
#---------------------
$modops = cmsms()->GetModuleOperations();
$allmodules = $modops->GetAllModuleNames();
if (count($allmodules) > 0) {
$query = "SELECT * FROM ".cms_db_prefix()."modules ORDER BY module_name";
$result = $db->Execute($query);
while ($result && $row = $result->FetchRow()) {
$dbm[$row['module_name']]['Status'] = $row['status'];
$dbm[$row['module_name']]['Version'] = $row['version'];
$dbm[$row['module_name']]['Active'] = ($row['active'] == 1?true:false);
}
}
$modules = $this->ListModules();
foreach($modules as $module) {
$mod = $modops->get_module_instance($module->module_name,'',true);
if(is_object($mod)) {
$module->friendlyname = $mod->GetFriendlyName();
$module->version = $dbm[$module->module_name]['Version'];
if (version_compare($mod->GetVersion(), $dbm[$module->module_name]['Version']) > 0) {
$module->upgradelink = $this->CreateLink($id, 'admin_upgrademodule', $returnid, $themeObject->DisplayImage('icons/system/false.gif', $this->ModLang('instance_upgrade'), '', '', 'systemicon'), array(
'module_id' => $module->module_id
));
}
else {
$module->upgradelink = $themeObject->DisplayImage('icons/system/true.gif', $this->ModLang('instance_uptodate'), '', '', 'systemicon');
}
}
}
#---------------------
# Smarty processing
#---------------------
$smarty->assign('modules', $modules);
$smarty->assign('startform', $this->CreateFormStart($id, 'admin_copymodule', $returnid));
$smarty->assign('endform', $this->CreateFormEnd());
$smarty->assign('duplicate', $this->CreateInputSubmit($id, 'duplicate', $this->ModLang('duplicate')));
echo $this->ProcessTemplate('instancestab.tpl');
?>