-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.admin_domaintenance.php
67 lines (53 loc) · 1.79 KB
/
action.admin_domaintenance.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
<?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;
$parms = array('active_tab' => 'maintenancetab');
#---------------------
# Fix fielddef tables
#---------------------
if(isset($params['fix_fielddefs'])) {
$type_map = array(
'textbox' => 'TextInput',
'dropdown' => 'Dropdown',
'hierarchy' => 'ContentPages',
'checkbox' => 'Checkbox',
'textarea' => 'TextArea',
'gallery' => 'GalleryDropdown',
'select_date' => 'SelectDate',
'upload_file' => 'GBFilePicker',
'select_file' => 'SelectFile'
);
$modules = $this->ListModules();
foreach($modules as $module) {
$mod = cmsms()->GetModuleInstance($module->module_name);
if(is_object($mod)) {
foreach($type_map as $old_type=>$new_type) {
$query = 'UPDATE ' . cms_db_prefix() . 'module_' . $mod->_GetModuleAlias() . '_fielddef SET type = ? WHERE type = ?';
$result = $db->Execute($query, array($new_type, $old_type));
}
}
}
$parms['message'] = 'message_fielddefs_fixed';
}
#---------------------
# Redirect
#---------------------
$this->Redirect($id, 'defaultadmin', $returnid, $parms);
?>