-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.admin_togglefielddef.php
59 lines (47 loc) · 1.97 KB
/
action.admin_togglefielddef.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
<?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
#
#-------------------------------------------------------------------------
# ListIt2 become EasyList due to the departure of the wackos in summer 2014.
#
# Jean-Christophe ghio <[email protected]>
#
#-------------------------------------------------------------------------
# EasyList 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;
if (!isset($params['type']))
throw new EasyListException('Missing parameter, this should not happen!');
$type = (string)$params['type'];
$status = EasyListFielddefOperations::ToggleActive($params['type']);
$handlers = ob_list_handlers();
for ($cnt = 0; $cnt < sizeof($handlers); $cnt++) { ob_end_clean(); }
$admintheme = cms_utils::get_theme_object();
$json = new stdClass;
if ($status) {
$json->image = $admintheme->DisplayImage('icons/system/true.gif', $this->ModLang('revert'), '', '', 'systemicon');
}
else {
$json->image = $admintheme->DisplayImage('icons/system/false.gif', $this->ModLang('approve'), '', '', 'systemicon');
}
$json->href = $this->CreateLink($id, 'admin_togglefielddef', $returnid, '', array('type' => $type), '', true);
// Fix URL for JSON output
$json->href = html_entity_decode($json->href);
header("Content-type:application/json; charset=utf-8");
$handlers = ob_list_handlers();
for ($cnt = 0; $cnt < sizeof($handlers); $cnt++) { ob_end_clean(); }
echo json_encode($json);
exit();
?>