@@ -9,178 +9,178 @@ |
||
9 | 9 | |
10 | 10 | Class TemplateParser { |
11 | 11 | |
12 | - function __construct() { |
|
13 | - } |
|
14 | - |
|
15 | - /** |
|
16 | - * @param array $config [action, tabs, toArray] |
|
17 | - * @param array $data |
|
18 | - * @return string |
|
19 | - */ |
|
20 | - public function output($config = array(), $data = array()) { |
|
21 | - global $modx; |
|
22 | - |
|
23 | - $output = ''; |
|
24 | - $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); |
|
25 | - $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; |
|
26 | - |
|
27 | - if($action) { |
|
28 | - $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name |
|
12 | + function __construct() { |
|
13 | + } |
|
14 | + |
|
15 | + /** |
|
16 | + * @param array $config [action, tabs, toArray] |
|
17 | + * @param array $data |
|
18 | + * @return string |
|
19 | + */ |
|
20 | + public function output($config = array(), $data = array()) { |
|
21 | + global $modx; |
|
22 | + |
|
23 | + $output = ''; |
|
24 | + $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); |
|
25 | + $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; |
|
26 | + |
|
27 | + if($action) { |
|
28 | + $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name |
|
29 | 29 | FROM ' . $modx->getFullTableName('system_templates') . ' AS t1 |
30 | 30 | INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category |
31 | 31 | WHERE t1.action IN(' . $action . ') ' . $tab . ' |
32 | 32 | ORDER BY t1.tab ASC, t1.rank ASC'); |
33 | 33 | |
34 | - if($modx->db->getRecordCount($sql)) { |
|
35 | - $tabs = array(); |
|
36 | - while($row = $modx->db->getRow($sql)) { |
|
37 | - if(!$row['value'] && !empty($data[$row['name']])) { |
|
38 | - $row['value'] = $data[$row['name']]; |
|
39 | - } |
|
40 | - $tabs[$row['tab']]['category_name'] = $row['category_name']; |
|
41 | - $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); |
|
42 | - } |
|
43 | - |
|
44 | - if(!empty($config['toArray'])) { |
|
45 | - $output = $tabs; |
|
46 | - } else { |
|
47 | - $output .= '<div class="tab-pane" id="pane_' . $action . '">'; |
|
48 | - $output .= ' |
|
34 | + if($modx->db->getRecordCount($sql)) { |
|
35 | + $tabs = array(); |
|
36 | + while($row = $modx->db->getRow($sql)) { |
|
37 | + if(!$row['value'] && !empty($data[$row['name']])) { |
|
38 | + $row['value'] = $data[$row['name']]; |
|
39 | + } |
|
40 | + $tabs[$row['tab']]['category_name'] = $row['category_name']; |
|
41 | + $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); |
|
42 | + } |
|
43 | + |
|
44 | + if(!empty($config['toArray'])) { |
|
45 | + $output = $tabs; |
|
46 | + } else { |
|
47 | + $output .= '<div class="tab-pane" id="pane_' . $action . '">'; |
|
48 | + $output .= ' |
|
49 | 49 | <script type="text/javascript"> |
50 | 50 | var pane_' . $action . ' = new WebFXTabPane(document.getElementById("pane_' . $action . '"), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
51 | 51 | </script>'; |
52 | 52 | |
53 | - foreach($tabs as $idTab => $tab) { |
|
54 | - $output .= '<div class="tab-page" id="tab_' . $action . '_' . $idTab . '">'; |
|
55 | - $output .= ' |
|
53 | + foreach($tabs as $idTab => $tab) { |
|
54 | + $output .= '<div class="tab-page" id="tab_' . $action . '_' . $idTab . '">'; |
|
55 | + $output .= ' |
|
56 | 56 | <h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '</h2> |
57 | 57 | <script type="text/javascript">pane_' . $action . '.addTabPage(document.getElementById("tab_' . $action . '_' . $idTab . '"));</script>'; |
58 | - unset($tab['category_name']); |
|
59 | - foreach($tab as $item) { |
|
60 | - $output .= $item; |
|
61 | - } |
|
62 | - $output .= '</div>'; |
|
63 | - } |
|
64 | - $output .= '</div>'; |
|
65 | - } |
|
66 | - } |
|
67 | - } |
|
68 | - |
|
69 | - return $output; |
|
70 | - } |
|
71 | - |
|
72 | - private function render($data) { |
|
73 | - global $modx, $_lang, $_country_lang; |
|
74 | - |
|
75 | - $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); |
|
76 | - $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $_POST[$data['name']][$data['value']] : (isset($data['value']) ? $modx->htmlspecialchars($data['value']) : '')); |
|
77 | - $data['readonly'] = ($data['readonly'] ? ' readonly' : ''); |
|
78 | - |
|
79 | - $output = ''; |
|
80 | - $output .= '<div class="form-group row">'; |
|
81 | - |
|
82 | - switch($data['type']) { |
|
83 | - |
|
84 | - case 'text': |
|
85 | - $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label> |
|
58 | + unset($tab['category_name']); |
|
59 | + foreach($tab as $item) { |
|
60 | + $output .= $item; |
|
61 | + } |
|
62 | + $output .= '</div>'; |
|
63 | + } |
|
64 | + $output .= '</div>'; |
|
65 | + } |
|
66 | + } |
|
67 | + } |
|
68 | + |
|
69 | + return $output; |
|
70 | + } |
|
71 | + |
|
72 | + private function render($data) { |
|
73 | + global $modx, $_lang, $_country_lang; |
|
74 | + |
|
75 | + $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); |
|
76 | + $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $_POST[$data['name']][$data['value']] : (isset($data['value']) ? $modx->htmlspecialchars($data['value']) : '')); |
|
77 | + $data['readonly'] = ($data['readonly'] ? ' readonly' : ''); |
|
78 | + |
|
79 | + $output = ''; |
|
80 | + $output .= '<div class="form-group row">'; |
|
81 | + |
|
82 | + switch($data['type']) { |
|
83 | + |
|
84 | + case 'text': |
|
85 | + $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label> |
|
86 | 86 | <div class="col-sm-7"> |
87 | 87 | <input type="text" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
88 | - $output .= $data['content']; |
|
89 | - $output .= '</div>'; |
|
88 | + $output .= $data['content']; |
|
89 | + $output .= '</div>'; |
|
90 | 90 | |
91 | - break; |
|
91 | + break; |
|
92 | 92 | |
93 | - case 'textarea': |
|
94 | - $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label> |
|
93 | + case 'textarea': |
|
94 | + $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label> |
|
95 | 95 | <div class="col-sm-7"> |
96 | 96 | <textarea name="[+name+]" class="form-control" id="[+name+]" onChange="documentDirty=true;"[+readonly+]>[+value+]</textarea>'; |
97 | - $output .= $data['content']; |
|
98 | - $output .= '</div>'; |
|
97 | + $output .= $data['content']; |
|
98 | + $output .= '</div>'; |
|
99 | 99 | |
100 | - break; |
|
100 | + break; |
|
101 | 101 | |
102 | - case 'date': |
|
103 | - $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $modx->toDateFormat($_POST[$data['name']][$data['value']]) : (isset($data['value']) ? $modx->toDateFormat($data['value']) : '')); |
|
104 | - $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label> |
|
102 | + case 'date': |
|
103 | + $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $modx->toDateFormat($_POST[$data['name']][$data['value']]) : (isset($data['value']) ? $modx->toDateFormat($data['value']) : '')); |
|
104 | + $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label> |
|
105 | 105 | <div class="col-sm-7"> |
106 | 106 | <input type="text" name="[+name+]" class="form-control DatePicker" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
107 | - $output .= $data['content']; |
|
108 | - $output .= '</div>'; |
|
109 | - |
|
110 | - break; |
|
111 | - |
|
112 | - case 'select': |
|
113 | - $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
|
114 | - $output .= '<div class="col-sm-7">'; |
|
115 | - $output .= '<select name="[+name+]" class="form-control" id="[+name+]" onChange="documentDirty=true;">'; |
|
116 | - if($data['name'] == 'country' && isset($_country_lang)) { |
|
117 | - $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $data['country']; |
|
118 | - $output .= '<option value=""' . (!isset($chosenCountry) ? ' selected' : '') . '> </option>'; |
|
119 | - foreach($_country_lang as $key => $value) { |
|
120 | - $output .= '<option value="' . $key . '"' . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . '>' . $value . '</option>'; |
|
121 | - } |
|
122 | - } else { |
|
123 | - if($data['elements']) { |
|
124 | - $elements = explode('||', $data['elements']); |
|
125 | - foreach($elements as $key => $value) { |
|
126 | - $value = explode('==', $value); |
|
127 | - $output .= '<option value="' . $value[1] . '">' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]) . '</option>'; |
|
128 | - } |
|
129 | - } |
|
130 | - } |
|
131 | - $output .= '</select>'; |
|
132 | - $output .= $data['content']; |
|
133 | - $output .= '</div>'; |
|
134 | - |
|
135 | - break; |
|
136 | - |
|
137 | - case 'checkbox': |
|
138 | - $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
|
139 | - $output .= '<div class="col-sm-7">'; |
|
140 | - $output .= '<input type="checkbox" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
|
141 | - if($data['elements']) { |
|
142 | - $elements = explode('||', $data['elements']); |
|
143 | - foreach($elements as $key => $value) { |
|
144 | - $value = explode('==', $value); |
|
145 | - $output .= '<br /><input type="checkbox" name="' . $value[0] . '" class="form-control" id="' . $value[0] . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
146 | - } |
|
147 | - } |
|
148 | - $output .= $data['content']; |
|
149 | - $output .= '</div>'; |
|
150 | - |
|
151 | - break; |
|
152 | - |
|
153 | - case 'radio': |
|
154 | - $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
|
155 | - $output .= '<div class="col-sm-7">'; |
|
156 | - $output .= '<input type="radio" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
|
157 | - if($data['elements']) { |
|
158 | - $elements = explode('||', $data['elements']); |
|
159 | - foreach($elements as $key => $value) { |
|
160 | - $value = explode('==', $value); |
|
161 | - $output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_' . $key . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
162 | - } |
|
163 | - } |
|
164 | - $output .= $data['content']; |
|
165 | - $output .= '</div>'; |
|
166 | - |
|
167 | - break; |
|
168 | - |
|
169 | - case 'custom': |
|
170 | - $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
|
171 | - $output .= '<div class="col-sm-7">'; |
|
172 | - $output .= $data['content']; |
|
173 | - $output .= '</div>'; |
|
174 | - |
|
175 | - break; |
|
176 | - } |
|
177 | - |
|
178 | - $output .= '</div>'; |
|
179 | - |
|
180 | - $output = $modx->parseText($output, $data); |
|
181 | - |
|
182 | - return $output; |
|
183 | - } |
|
107 | + $output .= $data['content']; |
|
108 | + $output .= '</div>'; |
|
109 | + |
|
110 | + break; |
|
111 | + |
|
112 | + case 'select': |
|
113 | + $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
|
114 | + $output .= '<div class="col-sm-7">'; |
|
115 | + $output .= '<select name="[+name+]" class="form-control" id="[+name+]" onChange="documentDirty=true;">'; |
|
116 | + if($data['name'] == 'country' && isset($_country_lang)) { |
|
117 | + $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $data['country']; |
|
118 | + $output .= '<option value=""' . (!isset($chosenCountry) ? ' selected' : '') . '> </option>'; |
|
119 | + foreach($_country_lang as $key => $value) { |
|
120 | + $output .= '<option value="' . $key . '"' . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . '>' . $value . '</option>'; |
|
121 | + } |
|
122 | + } else { |
|
123 | + if($data['elements']) { |
|
124 | + $elements = explode('||', $data['elements']); |
|
125 | + foreach($elements as $key => $value) { |
|
126 | + $value = explode('==', $value); |
|
127 | + $output .= '<option value="' . $value[1] . '">' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]) . '</option>'; |
|
128 | + } |
|
129 | + } |
|
130 | + } |
|
131 | + $output .= '</select>'; |
|
132 | + $output .= $data['content']; |
|
133 | + $output .= '</div>'; |
|
134 | + |
|
135 | + break; |
|
136 | + |
|
137 | + case 'checkbox': |
|
138 | + $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
|
139 | + $output .= '<div class="col-sm-7">'; |
|
140 | + $output .= '<input type="checkbox" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
|
141 | + if($data['elements']) { |
|
142 | + $elements = explode('||', $data['elements']); |
|
143 | + foreach($elements as $key => $value) { |
|
144 | + $value = explode('==', $value); |
|
145 | + $output .= '<br /><input type="checkbox" name="' . $value[0] . '" class="form-control" id="' . $value[0] . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
146 | + } |
|
147 | + } |
|
148 | + $output .= $data['content']; |
|
149 | + $output .= '</div>'; |
|
150 | + |
|
151 | + break; |
|
152 | + |
|
153 | + case 'radio': |
|
154 | + $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
|
155 | + $output .= '<div class="col-sm-7">'; |
|
156 | + $output .= '<input type="radio" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
|
157 | + if($data['elements']) { |
|
158 | + $elements = explode('||', $data['elements']); |
|
159 | + foreach($elements as $key => $value) { |
|
160 | + $value = explode('==', $value); |
|
161 | + $output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_' . $key . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
162 | + } |
|
163 | + } |
|
164 | + $output .= $data['content']; |
|
165 | + $output .= '</div>'; |
|
166 | + |
|
167 | + break; |
|
168 | + |
|
169 | + case 'custom': |
|
170 | + $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
|
171 | + $output .= '<div class="col-sm-7">'; |
|
172 | + $output .= $data['content']; |
|
173 | + $output .= '</div>'; |
|
174 | + |
|
175 | + break; |
|
176 | + } |
|
177 | + |
|
178 | + $output .= '</div>'; |
|
179 | + |
|
180 | + $output = $modx->parseText($output, $data); |
|
181 | + |
|
182 | + return $output; |
|
183 | + } |
|
184 | 184 | |
185 | 185 | } |
186 | 186 |
@@ -7,9 +7,9 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -Class TemplateParser { |
|
10 | +Class TemplateParser{ |
|
11 | 11 | |
12 | - function __construct() { |
|
12 | + function __construct(){ |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | /** |
@@ -17,46 +17,46 @@ discard block |
||
17 | 17 | * @param array $data |
18 | 18 | * @return string |
19 | 19 | */ |
20 | - public function output($config = array(), $data = array()) { |
|
20 | + public function output($config = array(), $data = array()){ |
|
21 | 21 | global $modx; |
22 | 22 | |
23 | 23 | $output = ''; |
24 | 24 | $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); |
25 | - $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; |
|
25 | + $tab = isset($config['tab']) ? ' AND tab IN('.$config['tab'].')' : ''; |
|
26 | 26 | |
27 | - if($action) { |
|
27 | + if ($action) { |
|
28 | 28 | $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name |
29 | - FROM ' . $modx->getFullTableName('system_templates') . ' AS t1 |
|
30 | - INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category |
|
31 | - WHERE t1.action IN(' . $action . ') ' . $tab . ' |
|
29 | + FROM ' . $modx->getFullTableName('system_templates').' AS t1 |
|
30 | + INNER JOIN ' . $modx->getFullTableName('categories').' AS t2 ON t2.id=t1.category |
|
31 | + WHERE t1.action IN(' . $action.') '.$tab.' |
|
32 | 32 | ORDER BY t1.tab ASC, t1.rank ASC'); |
33 | 33 | |
34 | - if($modx->db->getRecordCount($sql)) { |
|
34 | + if ($modx->db->getRecordCount($sql)) { |
|
35 | 35 | $tabs = array(); |
36 | - while($row = $modx->db->getRow($sql)) { |
|
37 | - if(!$row['value'] && !empty($data[$row['name']])) { |
|
36 | + while ($row = $modx->db->getRow($sql)) { |
|
37 | + if (!$row['value'] && !empty($data[$row['name']])) { |
|
38 | 38 | $row['value'] = $data[$row['name']]; |
39 | 39 | } |
40 | 40 | $tabs[$row['tab']]['category_name'] = $row['category_name']; |
41 | 41 | $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); |
42 | 42 | } |
43 | 43 | |
44 | - if(!empty($config['toArray'])) { |
|
44 | + if (!empty($config['toArray'])) { |
|
45 | 45 | $output = $tabs; |
46 | 46 | } else { |
47 | - $output .= '<div class="tab-pane" id="pane_' . $action . '">'; |
|
47 | + $output .= '<div class="tab-pane" id="pane_'.$action.'">'; |
|
48 | 48 | $output .= ' |
49 | 49 | <script type="text/javascript"> |
50 | - var pane_' . $action . ' = new WebFXTabPane(document.getElementById("pane_' . $action . '"), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
|
50 | + var pane_' . $action.' = new WebFXTabPane(document.getElementById("pane_'.$action.'"), '.($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').'); |
|
51 | 51 | </script>'; |
52 | 52 | |
53 | - foreach($tabs as $idTab => $tab) { |
|
54 | - $output .= '<div class="tab-page" id="tab_' . $action . '_' . $idTab . '">'; |
|
53 | + foreach ($tabs as $idTab => $tab) { |
|
54 | + $output .= '<div class="tab-page" id="tab_'.$action.'_'.$idTab.'">'; |
|
55 | 55 | $output .= ' |
56 | - <h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '</h2> |
|
57 | - <script type="text/javascript">pane_' . $action . '.addTabPage(document.getElementById("tab_' . $action . '_' . $idTab . '"));</script>'; |
|
56 | + <h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']).'</h2> |
|
57 | + <script type="text/javascript">pane_' . $action.'.addTabPage(document.getElementById("tab_'.$action.'_'.$idTab.'"));</script>'; |
|
58 | 58 | unset($tab['category_name']); |
59 | - foreach($tab as $item) { |
|
59 | + foreach ($tab as $item) { |
|
60 | 60 | $output .= $item; |
61 | 61 | } |
62 | 62 | $output .= '</div>'; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | return $output; |
70 | 70 | } |
71 | 71 | |
72 | - private function render($data) { |
|
72 | + private function render($data){ |
|
73 | 73 | global $modx, $_lang, $_country_lang; |
74 | 74 | |
75 | 75 | $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $output = ''; |
80 | 80 | $output .= '<div class="form-group row">'; |
81 | 81 | |
82 | - switch($data['type']) { |
|
82 | + switch ($data['type']) { |
|
83 | 83 | |
84 | 84 | case 'text': |
85 | 85 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label> |
@@ -113,18 +113,18 @@ discard block |
||
113 | 113 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
114 | 114 | $output .= '<div class="col-sm-7">'; |
115 | 115 | $output .= '<select name="[+name+]" class="form-control" id="[+name+]" onChange="documentDirty=true;">'; |
116 | - if($data['name'] == 'country' && isset($_country_lang)) { |
|
116 | + if ($data['name'] == 'country' && isset($_country_lang)) { |
|
117 | 117 | $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $data['country']; |
118 | - $output .= '<option value=""' . (!isset($chosenCountry) ? ' selected' : '') . '> </option>'; |
|
119 | - foreach($_country_lang as $key => $value) { |
|
120 | - $output .= '<option value="' . $key . '"' . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . '>' . $value . '</option>'; |
|
118 | + $output .= '<option value=""'.(!isset($chosenCountry) ? ' selected' : '').'> </option>'; |
|
119 | + foreach ($_country_lang as $key => $value) { |
|
120 | + $output .= '<option value="'.$key.'"'.(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').'>'.$value.'</option>'; |
|
121 | 121 | } |
122 | 122 | } else { |
123 | - if($data['elements']) { |
|
123 | + if ($data['elements']) { |
|
124 | 124 | $elements = explode('||', $data['elements']); |
125 | - foreach($elements as $key => $value) { |
|
125 | + foreach ($elements as $key => $value) { |
|
126 | 126 | $value = explode('==', $value); |
127 | - $output .= '<option value="' . $value[1] . '">' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]) . '</option>'; |
|
127 | + $output .= '<option value="'.$value[1].'">'.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]).'</option>'; |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | } |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
139 | 139 | $output .= '<div class="col-sm-7">'; |
140 | 140 | $output .= '<input type="checkbox" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
141 | - if($data['elements']) { |
|
141 | + if ($data['elements']) { |
|
142 | 142 | $elements = explode('||', $data['elements']); |
143 | - foreach($elements as $key => $value) { |
|
143 | + foreach ($elements as $key => $value) { |
|
144 | 144 | $value = explode('==', $value); |
145 | - $output .= '<br /><input type="checkbox" name="' . $value[0] . '" class="form-control" id="' . $value[0] . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
145 | + $output .= '<br /><input type="checkbox" name="'.$value[0].'" class="form-control" id="'.$value[0].'" value="'.$value[1].'" onChange="documentDirty=true;"[+readonly+] /> '.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | $output .= $data['content']; |
@@ -154,11 +154,11 @@ discard block |
||
154 | 154 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
155 | 155 | $output .= '<div class="col-sm-7">'; |
156 | 156 | $output .= '<input type="radio" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
157 | - if($data['elements']) { |
|
157 | + if ($data['elements']) { |
|
158 | 158 | $elements = explode('||', $data['elements']); |
159 | - foreach($elements as $key => $value) { |
|
159 | + foreach ($elements as $key => $value) { |
|
160 | 160 | $value = explode('==', $value); |
161 | - $output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_' . $key . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
161 | + $output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_'.$key.'" value="'.$value[1].'" onChange="documentDirty=true;"[+readonly+] /> '.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
162 | 162 | } |
163 | 163 | } |
164 | 164 | $output .= $data['content']; |
@@ -7,9 +7,11 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -Class TemplateParser { |
|
10 | +Class TemplateParser |
|
11 | +{ |
|
11 | 12 | |
12 | - function __construct() { |
|
13 | + function __construct() |
|
14 | + { |
|
13 | 15 | } |
14 | 16 | |
15 | 17 | /** |
@@ -17,46 +19,47 @@ discard block |
||
17 | 19 | * @param array $data |
18 | 20 | * @return string |
19 | 21 | */ |
20 | - public function output($config = array(), $data = array()) { |
|
22 | + public function output($config = array(), $data = array()) |
|
23 | + { |
|
21 | 24 | global $modx; |
22 | 25 | |
23 | 26 | $output = ''; |
24 | 27 | $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); |
25 | 28 | $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; |
26 | 29 | |
27 | - if($action) { |
|
30 | + if($action) { |
|
28 | 31 | $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name |
29 | 32 | FROM ' . $modx->getFullTableName('system_templates') . ' AS t1 |
30 | 33 | INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category |
31 | 34 | WHERE t1.action IN(' . $action . ') ' . $tab . ' |
32 | 35 | ORDER BY t1.tab ASC, t1.rank ASC'); |
33 | 36 | |
34 | - if($modx->db->getRecordCount($sql)) { |
|
37 | + if($modx->db->getRecordCount($sql)) { |
|
35 | 38 | $tabs = array(); |
36 | - while($row = $modx->db->getRow($sql)) { |
|
37 | - if(!$row['value'] && !empty($data[$row['name']])) { |
|
39 | + while($row = $modx->db->getRow($sql)) { |
|
40 | + if(!$row['value'] && !empty($data[$row['name']])) { |
|
38 | 41 | $row['value'] = $data[$row['name']]; |
39 | 42 | } |
40 | 43 | $tabs[$row['tab']]['category_name'] = $row['category_name']; |
41 | 44 | $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); |
42 | 45 | } |
43 | 46 | |
44 | - if(!empty($config['toArray'])) { |
|
47 | + if(!empty($config['toArray'])) { |
|
45 | 48 | $output = $tabs; |
46 | - } else { |
|
49 | + } else { |
|
47 | 50 | $output .= '<div class="tab-pane" id="pane_' . $action . '">'; |
48 | 51 | $output .= ' |
49 | 52 | <script type="text/javascript"> |
50 | 53 | var pane_' . $action . ' = new WebFXTabPane(document.getElementById("pane_' . $action . '"), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
51 | 54 | </script>'; |
52 | 55 | |
53 | - foreach($tabs as $idTab => $tab) { |
|
56 | + foreach($tabs as $idTab => $tab) { |
|
54 | 57 | $output .= '<div class="tab-page" id="tab_' . $action . '_' . $idTab . '">'; |
55 | 58 | $output .= ' |
56 | 59 | <h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '</h2> |
57 | 60 | <script type="text/javascript">pane_' . $action . '.addTabPage(document.getElementById("tab_' . $action . '_' . $idTab . '"));</script>'; |
58 | 61 | unset($tab['category_name']); |
59 | - foreach($tab as $item) { |
|
62 | + foreach($tab as $item) { |
|
60 | 63 | $output .= $item; |
61 | 64 | } |
62 | 65 | $output .= '</div>'; |
@@ -69,7 +72,8 @@ discard block |
||
69 | 72 | return $output; |
70 | 73 | } |
71 | 74 | |
72 | - private function render($data) { |
|
75 | + private function render($data) |
|
76 | + { |
|
73 | 77 | global $modx, $_lang, $_country_lang; |
74 | 78 | |
75 | 79 | $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); |
@@ -79,7 +83,7 @@ discard block |
||
79 | 83 | $output = ''; |
80 | 84 | $output .= '<div class="form-group row">'; |
81 | 85 | |
82 | - switch($data['type']) { |
|
86 | + switch($data['type']) { |
|
83 | 87 | |
84 | 88 | case 'text': |
85 | 89 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label> |
@@ -113,16 +117,16 @@ discard block |
||
113 | 117 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
114 | 118 | $output .= '<div class="col-sm-7">'; |
115 | 119 | $output .= '<select name="[+name+]" class="form-control" id="[+name+]" onChange="documentDirty=true;">'; |
116 | - if($data['name'] == 'country' && isset($_country_lang)) { |
|
120 | + if($data['name'] == 'country' && isset($_country_lang)) { |
|
117 | 121 | $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $data['country']; |
118 | 122 | $output .= '<option value=""' . (!isset($chosenCountry) ? ' selected' : '') . '> </option>'; |
119 | - foreach($_country_lang as $key => $value) { |
|
123 | + foreach($_country_lang as $key => $value) { |
|
120 | 124 | $output .= '<option value="' . $key . '"' . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . '>' . $value . '</option>'; |
121 | 125 | } |
122 | - } else { |
|
123 | - if($data['elements']) { |
|
126 | + } else { |
|
127 | + if($data['elements']) { |
|
124 | 128 | $elements = explode('||', $data['elements']); |
125 | - foreach($elements as $key => $value) { |
|
129 | + foreach($elements as $key => $value) { |
|
126 | 130 | $value = explode('==', $value); |
127 | 131 | $output .= '<option value="' . $value[1] . '">' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]) . '</option>'; |
128 | 132 | } |
@@ -138,9 +142,9 @@ discard block |
||
138 | 142 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
139 | 143 | $output .= '<div class="col-sm-7">'; |
140 | 144 | $output .= '<input type="checkbox" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
141 | - if($data['elements']) { |
|
145 | + if($data['elements']) { |
|
142 | 146 | $elements = explode('||', $data['elements']); |
143 | - foreach($elements as $key => $value) { |
|
147 | + foreach($elements as $key => $value) { |
|
144 | 148 | $value = explode('==', $value); |
145 | 149 | $output .= '<br /><input type="checkbox" name="' . $value[0] . '" class="form-control" id="' . $value[0] . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
146 | 150 | } |
@@ -154,9 +158,9 @@ discard block |
||
154 | 158 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
155 | 159 | $output .= '<div class="col-sm-7">'; |
156 | 160 | $output .= '<input type="radio" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
157 | - if($data['elements']) { |
|
161 | + if($data['elements']) { |
|
158 | 162 | $elements = explode('||', $data['elements']); |
159 | - foreach($elements as $key => $value) { |
|
163 | + foreach($elements as $key => $value) { |
|
160 | 164 | $value = explode('==', $value); |
161 | 165 | $output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_' . $key . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
162 | 166 | } |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -Class TemplateParser { |
|
10 | +class TemplateParser { |
|
11 | 11 | |
12 | 12 | function __construct() { |
13 | 13 | } |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | // show debug information |
5 | 5 | if(isset($enable_debug) && $enable_debug==true) { |
6 | - ?> |
|
6 | + ?> |
|
7 | 7 | <script language="javascript"> |
8 | 8 | //document.onload = removeDebug(); |
9 | 9 | |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | } |
34 | 34 | </style> |
35 | 35 | <?php |
36 | - $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart); |
|
37 | - ?> |
|
36 | + $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart); |
|
37 | + ?> |
|
38 | 38 | <div class='debug' id='debug' name='debug' onClick="removeDebugDiv();"> |
39 | 39 | <table border="0" cellspacing="0" cellpadding="0"> |
40 | 40 | <tr> |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | 3 | |
4 | 4 | // show debug information |
5 | -if(isset($enable_debug) && $enable_debug==true) { |
|
5 | +if (isset($enable_debug) && $enable_debug == true) { |
|
6 | 6 | ?> |
7 | 7 | <script language="javascript"> |
8 | 8 | //document.onload = removeDebug(); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } |
34 | 34 | </style> |
35 | 35 | <?php |
36 | - $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart); |
|
36 | + $mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart); |
|
37 | 37 | ?> |
38 | 38 | <div class='debug' id='debug' name='debug' onClick="removeDebugDiv();"> |
39 | 39 | <table border="0" cellspacing="0" cellpadding="0"> |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | </tr> |
43 | 43 | <tr> |
44 | 44 | <td width="70">Time taken</td> |
45 | - <td width="80"><?php echo printf ("%6.5f s", $totaltime); ?></td> |
|
45 | + <td width="80"><?php echo printf("%6.5f s", $totaltime); ?></td> |
|
46 | 46 | </tr> |
47 | 47 | </table> |
48 | 48 | </div> |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if(IN_MANAGER_MODE!="true") { |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | // show debug information |
5 | 7 | if(isset($enable_debug) && $enable_debug==true) { |
@@ -4,59 +4,59 @@ |
||
4 | 4 | $ContextMenuCnt = 0; |
5 | 5 | |
6 | 6 | class ContextMenu { |
7 | - var $id; |
|
7 | + var $id; |
|
8 | 8 | |
9 | - function __construct($id = '', $width = 120, $visible = false) { |
|
10 | - global $ContextMenuCnt; |
|
11 | - $ContextMenuCnt++; |
|
12 | - $this->html = ""; |
|
13 | - $this->visible = $visible ? $visible : false; |
|
14 | - $this->width = is_numeric($width) ? intval($width) : 120; |
|
15 | - $this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt; // set id |
|
16 | - } |
|
9 | + function __construct($id = '', $width = 120, $visible = false) { |
|
10 | + global $ContextMenuCnt; |
|
11 | + $ContextMenuCnt++; |
|
12 | + $this->html = ""; |
|
13 | + $this->visible = $visible ? $visible : false; |
|
14 | + $this->width = is_numeric($width) ? intval($width) : 120; |
|
15 | + $this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt; // set id |
|
16 | + } |
|
17 | 17 | |
18 | - function addItem($text, $action = "", $img = "", $disabled = 0) { |
|
19 | - global $base_url, $_style; |
|
18 | + function addItem($text, $action = "", $img = "", $disabled = 0) { |
|
19 | + global $base_url, $_style; |
|
20 | 20 | if($disabled) { |
21 | 21 | return; |
22 | 22 | } |
23 | - if(!$img) { |
|
24 | - $img = $base_url . $_style['tx']; |
|
25 | - } |
|
26 | - if(substr($action, 0, 3) == "js:") { |
|
27 | - $action = substr($action, 3); |
|
28 | - } else if(substr($action, 0, 3) == "hl:") { |
|
29 | - $action = "window.location.href='" . substr($action, 3) . "'"; |
|
30 | - } else { |
|
31 | - $action = "window.location.href='" . $action . "'"; |
|
32 | - } |
|
33 | - $action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('" . $this->id . "');\""; |
|
34 | - $this->html .= "<div class='" . ($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem") . "' $action>"; |
|
23 | + if(!$img) { |
|
24 | + $img = $base_url . $_style['tx']; |
|
25 | + } |
|
26 | + if(substr($action, 0, 3) == "js:") { |
|
27 | + $action = substr($action, 3); |
|
28 | + } else if(substr($action, 0, 3) == "hl:") { |
|
29 | + $action = "window.location.href='" . substr($action, 3) . "'"; |
|
30 | + } else { |
|
31 | + $action = "window.location.href='" . $action . "'"; |
|
32 | + } |
|
33 | + $action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('" . $this->id . "');\""; |
|
34 | + $this->html .= "<div class='" . ($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem") . "' $action>"; |
|
35 | 35 | if(substr($img, 0, 5) == 'fa fa') { |
36 | 36 | $img = '<i class="' . $img . '"></i>'; |
37 | 37 | } else if(substr($img, 0, 1) != '<') { |
38 | 38 | $img = '<img src="' . $img . '" />'; |
39 | 39 | } |
40 | - $this->html .= $img . ' ' . $text . '</div>'; |
|
41 | - } |
|
40 | + $this->html .= $img . ' ' . $text . '</div>'; |
|
41 | + } |
|
42 | 42 | |
43 | - function addSeparator() { |
|
44 | - $this->html .= " |
|
43 | + function addSeparator() { |
|
44 | + $this->html .= " |
|
45 | 45 | <div class='cntxMnuSeparator'></div> |
46 | 46 | "; |
47 | - } |
|
47 | + } |
|
48 | 48 | |
49 | - function render() { |
|
50 | - global $ContextMenuScript; |
|
49 | + function render() { |
|
50 | + global $ContextMenuScript; |
|
51 | 51 | |
52 | - $html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>"; |
|
53 | - $ContextMenuScript = ""; // reset css |
|
54 | - return $html; |
|
55 | - } |
|
52 | + $html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>"; |
|
53 | + $ContextMenuScript = ""; // reset css |
|
54 | + return $html; |
|
55 | + } |
|
56 | 56 | |
57 | - function getClientScriptObject() { |
|
58 | - return "getCntxMenu('" . $this->id . "')"; |
|
59 | - } |
|
57 | + function getClientScriptObject() { |
|
58 | + return "getCntxMenu('" . $this->id . "')"; |
|
59 | + } |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $ContextMenuScript = <<<BLOCK |
@@ -3,59 +3,59 @@ |
||
3 | 3 | global $ContextMenuCnt; |
4 | 4 | $ContextMenuCnt = 0; |
5 | 5 | |
6 | -class ContextMenu { |
|
6 | +class ContextMenu{ |
|
7 | 7 | var $id; |
8 | 8 | |
9 | - function __construct($id = '', $width = 120, $visible = false) { |
|
9 | + function __construct($id = '', $width = 120, $visible = false){ |
|
10 | 10 | global $ContextMenuCnt; |
11 | 11 | $ContextMenuCnt++; |
12 | 12 | $this->html = ""; |
13 | 13 | $this->visible = $visible ? $visible : false; |
14 | 14 | $this->width = is_numeric($width) ? intval($width) : 120; |
15 | - $this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt; // set id |
|
15 | + $this->id = $id ? $id : "cntxMnu".$ContextMenuCnt; // set id |
|
16 | 16 | } |
17 | 17 | |
18 | - function addItem($text, $action = "", $img = "", $disabled = 0) { |
|
18 | + function addItem($text, $action = "", $img = "", $disabled = 0){ |
|
19 | 19 | global $base_url, $_style; |
20 | - if($disabled) { |
|
20 | + if ($disabled) { |
|
21 | 21 | return; |
22 | 22 | } |
23 | - if(!$img) { |
|
24 | - $img = $base_url . $_style['tx']; |
|
23 | + if (!$img) { |
|
24 | + $img = $base_url.$_style['tx']; |
|
25 | 25 | } |
26 | - if(substr($action, 0, 3) == "js:") { |
|
26 | + if (substr($action, 0, 3) == "js:") { |
|
27 | 27 | $action = substr($action, 3); |
28 | - } else if(substr($action, 0, 3) == "hl:") { |
|
29 | - $action = "window.location.href='" . substr($action, 3) . "'"; |
|
28 | + } else if (substr($action, 0, 3) == "hl:") { |
|
29 | + $action = "window.location.href='".substr($action, 3)."'"; |
|
30 | 30 | } else { |
31 | - $action = "window.location.href='" . $action . "'"; |
|
31 | + $action = "window.location.href='".$action."'"; |
|
32 | 32 | } |
33 | - $action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('" . $this->id . "');\""; |
|
34 | - $this->html .= "<div class='" . ($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem") . "' $action>"; |
|
35 | - if(substr($img, 0, 5) == 'fa fa') { |
|
36 | - $img = '<i class="' . $img . '"></i>'; |
|
37 | - } else if(substr($img, 0, 1) != '<') { |
|
38 | - $img = '<img src="' . $img . '" />'; |
|
33 | + $action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('".$this->id."');\""; |
|
34 | + $this->html .= "<div class='".($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem")."' $action>"; |
|
35 | + if (substr($img, 0, 5) == 'fa fa') { |
|
36 | + $img = '<i class="'.$img.'"></i>'; |
|
37 | + } else if (substr($img, 0, 1) != '<') { |
|
38 | + $img = '<img src="'.$img.'" />'; |
|
39 | 39 | } |
40 | - $this->html .= $img . ' ' . $text . '</div>'; |
|
40 | + $this->html .= $img.' '.$text.'</div>'; |
|
41 | 41 | } |
42 | 42 | |
43 | - function addSeparator() { |
|
43 | + function addSeparator(){ |
|
44 | 44 | $this->html .= " |
45 | 45 | <div class='cntxMnuSeparator'></div> |
46 | 46 | "; |
47 | 47 | } |
48 | 48 | |
49 | - function render() { |
|
49 | + function render(){ |
|
50 | 50 | global $ContextMenuScript; |
51 | 51 | |
52 | - $html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>"; |
|
52 | + $html = $ContextMenuScript."<div id='".$this->id."' class='contextMenu' style='width:".$this->width."px; visibility:".($this->visible ? 'visible' : 'hidden')."'>".$this->html."</div>"; |
|
53 | 53 | $ContextMenuScript = ""; // reset css |
54 | 54 | return $html; |
55 | 55 | } |
56 | 56 | |
57 | - function getClientScriptObject() { |
|
58 | - return "getCntxMenu('" . $this->id . "')"; |
|
57 | + function getClientScriptObject(){ |
|
58 | + return "getCntxMenu('".$this->id."')"; |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 |
@@ -3,10 +3,12 @@ discard block |
||
3 | 3 | global $ContextMenuCnt; |
4 | 4 | $ContextMenuCnt = 0; |
5 | 5 | |
6 | -class ContextMenu { |
|
6 | +class ContextMenu |
|
7 | +{ |
|
7 | 8 | var $id; |
8 | 9 | |
9 | - function __construct($id = '', $width = 120, $visible = false) { |
|
10 | + function __construct($id = '', $width = 120, $visible = false) |
|
11 | + { |
|
10 | 12 | global $ContextMenuCnt; |
11 | 13 | $ContextMenuCnt++; |
12 | 14 | $this->html = ""; |
@@ -15,7 +17,8 @@ discard block |
||
15 | 17 | $this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt; // set id |
16 | 18 | } |
17 | 19 | |
18 | - function addItem($text, $action = "", $img = "", $disabled = 0) { |
|
20 | + function addItem($text, $action = "", $img = "", $disabled = 0) |
|
21 | + { |
|
19 | 22 | global $base_url, $_style; |
20 | 23 | if($disabled) { |
21 | 24 | return; |
@@ -40,13 +43,15 @@ discard block |
||
40 | 43 | $this->html .= $img . ' ' . $text . '</div>'; |
41 | 44 | } |
42 | 45 | |
43 | - function addSeparator() { |
|
46 | + function addSeparator() |
|
47 | + { |
|
44 | 48 | $this->html .= " |
45 | 49 | <div class='cntxMnuSeparator'></div> |
46 | 50 | "; |
47 | 51 | } |
48 | 52 | |
49 | - function render() { |
|
53 | + function render() |
|
54 | + { |
|
50 | 55 | global $ContextMenuScript; |
51 | 56 | |
52 | 57 | $html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>"; |
@@ -54,7 +59,8 @@ discard block |
||
54 | 59 | return $html; |
55 | 60 | } |
56 | 61 | |
57 | - function getClientScriptObject() { |
|
62 | + function getClientScriptObject() |
|
63 | + { |
|
58 | 64 | return "getCntxMenu('" . $this->id . "')"; |
59 | 65 | } |
60 | 66 | } |
@@ -69,4 +69,4 @@ |
||
69 | 69 | cm.style.visibility = 'hidden'; |
70 | 70 | } |
71 | 71 | </script> |
72 | -BLOCK; |
|
72 | +block; |
@@ -128,10 +128,10 @@ |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | return base64_encode( |
131 | - 'user=' . |
|
132 | - $this->oauthUserEmail . |
|
133 | - "\001auth=Bearer " . |
|
134 | - $this->oauthToken . |
|
131 | + 'user='. |
|
132 | + $this->oauthUserEmail. |
|
133 | + "\001auth=Bearer ". |
|
134 | + $this->oauthToken. |
|
135 | 135 | "\001\001" |
136 | 136 | ); |
137 | 137 | } |
@@ -34,6 +34,6 @@ |
||
34 | 34 | */ |
35 | 35 | public function errorMessage() |
36 | 36 | { |
37 | - return '<strong>' . htmlspecialchars($this->getMessage()) . "</strong><br />\n"; |
|
37 | + return '<strong>'.htmlspecialchars($this->getMessage())."</strong><br />\n"; |
|
38 | 38 | } |
39 | 39 | } |
@@ -3,140 +3,140 @@ |
||
3 | 3 | |
4 | 4 | // action list |
5 | 5 | $GLOBALS['action_list'] = array( |
6 | - '1' => 'Loading a frame(set)', |
|
7 | - '2' => 'Viewing home page/ online users', |
|
8 | - '3' => 'Viewing data for resource', |
|
9 | - '4' => 'Creating a resource', |
|
10 | - '5' => 'Saving resource', |
|
11 | - '6' => 'Deleting resource', |
|
12 | - '7' => 'Waiting while MODX cleans up', |
|
13 | - '8' => 'Logged out', |
|
14 | - '9' => 'Viewing help', |
|
15 | - '10' => 'Viewing/ composing messages', |
|
16 | - '11' => 'Creating a user', |
|
17 | - '12' => 'Editing user', |
|
18 | - '13' => 'Viewing logging', |
|
19 | - '14' => 'Editing a parser', |
|
20 | - '15' => 'Saving a parser', |
|
21 | - '16' => 'Editing template', |
|
22 | - '17' => 'Editing settings', |
|
23 | - '18' => 'Viewing Credits :)', |
|
24 | - '19' => 'Creating a new template', |
|
25 | - '20' => 'Saving template', |
|
26 | - '21' => 'Deleting template', |
|
27 | - '22' => 'Editing Snippet', |
|
28 | - '23' => 'Creating a new Snippet', |
|
29 | - '24' => 'Saving Snippet', |
|
30 | - '25' => 'Deleting Snippet', |
|
31 | - '26' => 'Refreshing site', |
|
32 | - '27' => 'Editing resource', |
|
33 | - '28' => 'Changing password', |
|
34 | - '29' => 'Error', |
|
35 | - '30' => 'Saving settings', |
|
36 | - '31' => 'Using file manager', |
|
37 | - '32' => 'Saving user', |
|
38 | - '33' => 'Deleting user', |
|
39 | - '34' => 'Saving new password', |
|
40 | - '35' => 'Editing role', |
|
41 | - '36' => 'Saving role', |
|
42 | - '37' => 'Deleting role', |
|
43 | - '38' => 'Creating new role', |
|
44 | - '40' => 'Editing Access Permissions', |
|
45 | - '41' => 'Editing Access Permissions', |
|
46 | - '42' => 'Editing Access Permissions', |
|
47 | - '43' => 'Editing Access Permissions', |
|
48 | - '44' => 'Editing Access Permissions', |
|
49 | - '45' => 'Idle', |
|
50 | - '46' => 'Editing Access Permissions', |
|
51 | - '47' => 'Editing Access Permissions', |
|
52 | - '48' => 'Editing Access Permissions', |
|
53 | - '49' => 'Editing Access Permissions', |
|
54 | - '50' => 'Editing Access Permissions', |
|
55 | - '51' => 'Moving resource', |
|
56 | - '52' => 'Moved resource', |
|
57 | - '53' => 'Viewing system info', |
|
58 | - '54' => 'Optimizing a table', |
|
59 | - '55' => 'Empty logs', |
|
60 | - '56' => 'Refresh resource tree', |
|
61 | - '57' => 'Refresh menu', |
|
62 | - '58' => 'Logged in', |
|
63 | - '59' => 'About MODX', |
|
64 | - '60' => 'Emptying Recycle Bin', |
|
65 | - '61' => 'Publishing a resource', |
|
66 | - '62' => 'Un-publishing a resource', |
|
67 | - '63' => 'Un-deleting a resource', |
|
68 | - '64' => 'Removing deleted content', |
|
69 | - '65' => 'Deleting a message', |
|
70 | - '66' => 'Sending a message', |
|
71 | - '67' => 'Removing locks', |
|
72 | - '68' => 'Viewing site logging', |
|
73 | - '69' => 'Viewing online visitors', |
|
74 | - '70' => 'Viewing site schedule', |
|
75 | - '71' => 'Searching', |
|
76 | - '72' => 'Adding a weblink', |
|
77 | - '73' => 'Editing a weblink', |
|
78 | - //case "74" : return "Changing personal preferences"; break; |
|
79 | - '75' => 'User/ role management', |
|
80 | - '76' => 'Element management', |
|
81 | - '77' => 'Creating a new Chunk (HTML Snippet)', |
|
82 | - '78' => 'Editing Chunk (HTML Snippet)', |
|
83 | - '79' => 'Saving Chunk (HTML Snippet)', |
|
84 | - '80' => 'Deleting Chunk (HTML Snippet)', |
|
85 | - '83' => 'Exporting a resource to HTML', |
|
86 | - '84' => 'Load Element Selector', |
|
87 | - '85' => 'Create Folder', |
|
88 | - '86' => 'Role management', |
|
89 | - '87' => 'Create new web user', |
|
90 | - '88' => 'Editing web user', |
|
91 | - '89' => 'Saving web user', |
|
92 | - '90' => 'Deleting web user', |
|
93 | - '91' => 'Editing Web Access Permissions', |
|
94 | - '92' => 'Editing Access Permissions', |
|
95 | - '93' => 'Backup Manager', |
|
96 | - '94' => 'Duplicate resource', |
|
97 | - '95' => 'Importing resources from HTML', |
|
98 | - '96' => 'Duplicate Template', |
|
99 | - '97' => 'Duplicate Chunk (HTML Snippet)', |
|
100 | - '98' => 'Duplicate Snippet', |
|
101 | - '99' => 'Manage Web Users', |
|
102 | - '100' => 'Previewing resource', |
|
103 | - '101' => 'Create new plugin', |
|
104 | - '102' => 'Edit plugin', |
|
105 | - '103' => 'Saving plugin', |
|
106 | - '104' => 'Delete plugin', |
|
107 | - '105' => 'Duplicate plugin', |
|
108 | - '106' => 'Viewing Modules', |
|
109 | - '107' => 'Create new module', |
|
110 | - '108' => 'Edit module', |
|
111 | - '109' => 'Saving module', |
|
112 | - '110' => 'Delete module', |
|
113 | - '111' => 'Duplicate module', |
|
114 | - '112' => 'Execute module', |
|
115 | - '113' => 'Manage module dependencies', |
|
116 | - '114' => 'View event log', |
|
117 | - '115' => 'View event log details', |
|
118 | - '116' => 'Delete event log', |
|
119 | - '117' => 'Editing tv rank', |
|
120 | - '118' => 'Call settings ajax include', |
|
121 | - '119' => 'Login Fail (Temporary Block)', |
|
6 | + '1' => 'Loading a frame(set)', |
|
7 | + '2' => 'Viewing home page/ online users', |
|
8 | + '3' => 'Viewing data for resource', |
|
9 | + '4' => 'Creating a resource', |
|
10 | + '5' => 'Saving resource', |
|
11 | + '6' => 'Deleting resource', |
|
12 | + '7' => 'Waiting while MODX cleans up', |
|
13 | + '8' => 'Logged out', |
|
14 | + '9' => 'Viewing help', |
|
15 | + '10' => 'Viewing/ composing messages', |
|
16 | + '11' => 'Creating a user', |
|
17 | + '12' => 'Editing user', |
|
18 | + '13' => 'Viewing logging', |
|
19 | + '14' => 'Editing a parser', |
|
20 | + '15' => 'Saving a parser', |
|
21 | + '16' => 'Editing template', |
|
22 | + '17' => 'Editing settings', |
|
23 | + '18' => 'Viewing Credits :)', |
|
24 | + '19' => 'Creating a new template', |
|
25 | + '20' => 'Saving template', |
|
26 | + '21' => 'Deleting template', |
|
27 | + '22' => 'Editing Snippet', |
|
28 | + '23' => 'Creating a new Snippet', |
|
29 | + '24' => 'Saving Snippet', |
|
30 | + '25' => 'Deleting Snippet', |
|
31 | + '26' => 'Refreshing site', |
|
32 | + '27' => 'Editing resource', |
|
33 | + '28' => 'Changing password', |
|
34 | + '29' => 'Error', |
|
35 | + '30' => 'Saving settings', |
|
36 | + '31' => 'Using file manager', |
|
37 | + '32' => 'Saving user', |
|
38 | + '33' => 'Deleting user', |
|
39 | + '34' => 'Saving new password', |
|
40 | + '35' => 'Editing role', |
|
41 | + '36' => 'Saving role', |
|
42 | + '37' => 'Deleting role', |
|
43 | + '38' => 'Creating new role', |
|
44 | + '40' => 'Editing Access Permissions', |
|
45 | + '41' => 'Editing Access Permissions', |
|
46 | + '42' => 'Editing Access Permissions', |
|
47 | + '43' => 'Editing Access Permissions', |
|
48 | + '44' => 'Editing Access Permissions', |
|
49 | + '45' => 'Idle', |
|
50 | + '46' => 'Editing Access Permissions', |
|
51 | + '47' => 'Editing Access Permissions', |
|
52 | + '48' => 'Editing Access Permissions', |
|
53 | + '49' => 'Editing Access Permissions', |
|
54 | + '50' => 'Editing Access Permissions', |
|
55 | + '51' => 'Moving resource', |
|
56 | + '52' => 'Moved resource', |
|
57 | + '53' => 'Viewing system info', |
|
58 | + '54' => 'Optimizing a table', |
|
59 | + '55' => 'Empty logs', |
|
60 | + '56' => 'Refresh resource tree', |
|
61 | + '57' => 'Refresh menu', |
|
62 | + '58' => 'Logged in', |
|
63 | + '59' => 'About MODX', |
|
64 | + '60' => 'Emptying Recycle Bin', |
|
65 | + '61' => 'Publishing a resource', |
|
66 | + '62' => 'Un-publishing a resource', |
|
67 | + '63' => 'Un-deleting a resource', |
|
68 | + '64' => 'Removing deleted content', |
|
69 | + '65' => 'Deleting a message', |
|
70 | + '66' => 'Sending a message', |
|
71 | + '67' => 'Removing locks', |
|
72 | + '68' => 'Viewing site logging', |
|
73 | + '69' => 'Viewing online visitors', |
|
74 | + '70' => 'Viewing site schedule', |
|
75 | + '71' => 'Searching', |
|
76 | + '72' => 'Adding a weblink', |
|
77 | + '73' => 'Editing a weblink', |
|
78 | + //case "74" : return "Changing personal preferences"; break; |
|
79 | + '75' => 'User/ role management', |
|
80 | + '76' => 'Element management', |
|
81 | + '77' => 'Creating a new Chunk (HTML Snippet)', |
|
82 | + '78' => 'Editing Chunk (HTML Snippet)', |
|
83 | + '79' => 'Saving Chunk (HTML Snippet)', |
|
84 | + '80' => 'Deleting Chunk (HTML Snippet)', |
|
85 | + '83' => 'Exporting a resource to HTML', |
|
86 | + '84' => 'Load Element Selector', |
|
87 | + '85' => 'Create Folder', |
|
88 | + '86' => 'Role management', |
|
89 | + '87' => 'Create new web user', |
|
90 | + '88' => 'Editing web user', |
|
91 | + '89' => 'Saving web user', |
|
92 | + '90' => 'Deleting web user', |
|
93 | + '91' => 'Editing Web Access Permissions', |
|
94 | + '92' => 'Editing Access Permissions', |
|
95 | + '93' => 'Backup Manager', |
|
96 | + '94' => 'Duplicate resource', |
|
97 | + '95' => 'Importing resources from HTML', |
|
98 | + '96' => 'Duplicate Template', |
|
99 | + '97' => 'Duplicate Chunk (HTML Snippet)', |
|
100 | + '98' => 'Duplicate Snippet', |
|
101 | + '99' => 'Manage Web Users', |
|
102 | + '100' => 'Previewing resource', |
|
103 | + '101' => 'Create new plugin', |
|
104 | + '102' => 'Edit plugin', |
|
105 | + '103' => 'Saving plugin', |
|
106 | + '104' => 'Delete plugin', |
|
107 | + '105' => 'Duplicate plugin', |
|
108 | + '106' => 'Viewing Modules', |
|
109 | + '107' => 'Create new module', |
|
110 | + '108' => 'Edit module', |
|
111 | + '109' => 'Saving module', |
|
112 | + '110' => 'Delete module', |
|
113 | + '111' => 'Duplicate module', |
|
114 | + '112' => 'Execute module', |
|
115 | + '113' => 'Manage module dependencies', |
|
116 | + '114' => 'View event log', |
|
117 | + '115' => 'View event log details', |
|
118 | + '116' => 'Delete event log', |
|
119 | + '117' => 'Editing tv rank', |
|
120 | + '118' => 'Call settings ajax include', |
|
121 | + '119' => 'Login Fail (Temporary Block)', |
|
122 | 122 | |
123 | - '300' => 'Create Template Variable', |
|
124 | - '301' => 'Edit Template Variable', |
|
125 | - '302' => 'Save Template Variable', |
|
126 | - '303' => 'Delete Template Variable', |
|
127 | - '304' => 'Duplicate Template Variable', |
|
123 | + '300' => 'Create Template Variable', |
|
124 | + '301' => 'Edit Template Variable', |
|
125 | + '302' => 'Save Template Variable', |
|
126 | + '303' => 'Delete Template Variable', |
|
127 | + '304' => 'Duplicate Template Variable', |
|
128 | 128 | |
129 | - '200' => 'Viewing phpInfo()', |
|
130 | - '501' => 'Delete category', |
|
131 | - '998' => 'Viewing web page', |
|
132 | - '999' => 'Viewing test page', |
|
129 | + '200' => 'Viewing phpInfo()', |
|
130 | + '501' => 'Delete category', |
|
131 | + '998' => 'Viewing web page', |
|
132 | + '999' => 'Viewing test page', |
|
133 | 133 | ); |
134 | 134 | |
135 | 135 | function getAction($actionId, $itemid='') { |
136 | - global $action_list; |
|
136 | + global $action_list; |
|
137 | 137 | |
138 | - $ret = sprintf($action_list[$actionId], $itemid); |
|
139 | - if (!$ret) $ret = "Idle (unknown)"; |
|
138 | + $ret = sprintf($action_list[$actionId], $itemid); |
|
139 | + if (!$ret) $ret = "Idle (unknown)"; |
|
140 | 140 | |
141 | - return $ret; |
|
141 | + return $ret; |
|
142 | 142 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | 3 | |
4 | 4 | // action list |
5 | 5 | $GLOBALS['action_list'] = array( |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | '999' => 'Viewing test page', |
133 | 133 | ); |
134 | 134 | |
135 | -function getAction($actionId, $itemid='') { |
|
135 | +function getAction($actionId, $itemid = ''){ |
|
136 | 136 | global $action_list; |
137 | 137 | |
138 | 138 | $ret = sprintf($action_list[$actionId], $itemid); |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if(IN_MANAGER_MODE!="true") { |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | // action list |
5 | 7 | $GLOBALS['action_list'] = array( |
@@ -132,11 +134,14 @@ discard block |
||
132 | 134 | '999' => 'Viewing test page', |
133 | 135 | ); |
134 | 136 | |
135 | -function getAction($actionId, $itemid='') { |
|
137 | +function getAction($actionId, $itemid='') |
|
138 | +{ |
|
136 | 139 | global $action_list; |
137 | 140 | |
138 | 141 | $ret = sprintf($action_list[$actionId], $itemid); |
139 | - if (!$ret) $ret = "Idle (unknown)"; |
|
142 | + if (!$ret) { |
|
143 | + $ret = "Idle (unknown)"; |
|
144 | + } |
|
140 | 145 | |
141 | 146 | return $ret; |
142 | 147 | } |
@@ -5,10 +5,10 @@ |
||
5 | 5 | $settings = array(); |
6 | 6 | if ($modx && count($modx->config)>0) $settings = $modx->config; |
7 | 7 | else{ |
8 | - $rs = $modx->db->select('setting_name, setting_value', $modx->getFullTableName('system_settings')); |
|
9 | - while ($row = $modx->db->getRow($rs)) { |
|
10 | - $settings[$row['setting_name']] = $row['setting_value']; |
|
11 | - } |
|
8 | + $rs = $modx->db->select('setting_name, setting_value', $modx->getFullTableName('system_settings')); |
|
9 | + while ($row = $modx->db->getRow($rs)) { |
|
10 | + $settings[$row['setting_name']] = $row['setting_value']; |
|
11 | + } |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | extract($settings, EXTR_OVERWRITE); |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | 3 | |
4 | 4 | // get the settings from the database. |
5 | 5 | $settings = array(); |
6 | -if ($modx && count($modx->config)>0) $settings = $modx->config; |
|
7 | -else{ |
|
6 | +if ($modx && count($modx->config) > 0) $settings = $modx->config; |
|
7 | +else { |
|
8 | 8 | $rs = $modx->db->select('setting_name, setting_value', $modx->getFullTableName('system_settings')); |
9 | 9 | while ($row = $modx->db->getRow($rs)) { |
10 | 10 | $settings[$row['setting_name']] = $row['setting_value']; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | extract($settings, EXTR_OVERWRITE); |
15 | 15 | |
16 | 16 | // setup default site id - new installation should generate a unique id for the site. |
17 | -if(!isset($site_id)) $site_id = "MzGeQ2faT4Dw06+U49x3"; |
|
17 | +if (!isset($site_id)) $site_id = "MzGeQ2faT4Dw06+U49x3"; |
|
18 | 18 | |
19 | 19 | |
20 | 20 | ?> |
21 | 21 | \ No newline at end of file |
@@ -1,10 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if(IN_MANAGER_MODE!="true") { |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | // get the settings from the database. |
5 | 7 | $settings = array(); |
6 | -if ($modx && count($modx->config)>0) $settings = $modx->config; |
|
7 | -else{ |
|
8 | +if ($modx && count($modx->config)>0) { |
|
9 | + $settings = $modx->config; |
|
10 | +} else { |
|
8 | 11 | $rs = $modx->db->select('setting_name, setting_value', $modx->getFullTableName('system_settings')); |
9 | 12 | while ($row = $modx->db->getRow($rs)) { |
10 | 13 | $settings[$row['setting_name']] = $row['setting_value']; |
@@ -14,7 +17,9 @@ discard block |
||
14 | 17 | extract($settings, EXTR_OVERWRITE); |
15 | 18 | |
16 | 19 | // setup default site id - new installation should generate a unique id for the site. |
17 | -if(!isset($site_id)) $site_id = "MzGeQ2faT4Dw06+U49x3"; |
|
20 | +if(!isset($site_id)) { |
|
21 | + $site_id = "MzGeQ2faT4Dw06+U49x3"; |
|
22 | +} |
|
18 | 23 | |
19 | 24 | |
20 | 25 | ?> |
21 | 26 | \ No newline at end of file |
@@ -12,13 +12,13 @@ |
||
12 | 12 | $modx->invokeEvent('OnManagerPageInit'); |
13 | 13 | $ok = false; |
14 | 14 | if(isset($_SESSION['mgrToken']) && $_GET['tok'] == $_SESSION['mgrToken']) { |
15 | - $ok = true; |
|
16 | - $modx->updateValidatedUserSession(); |
|
15 | + $ok = true; |
|
16 | + $modx->updateValidatedUserSession(); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | header('Content-type: application/json'); |
20 | 20 | if($ok) { |
21 | 21 | echo '{"status":"ok"}'; |
22 | 22 | } else { |
23 | - echo '{"status":"null"}'; |
|
23 | + echo '{"status":"null"}'; |
|
24 | 24 | } |
@@ -11,13 +11,13 @@ |
||
11 | 11 | $modx->getSettings(); |
12 | 12 | $modx->invokeEvent('OnManagerPageInit'); |
13 | 13 | $ok = false; |
14 | -if(isset($_SESSION['mgrToken']) && $_GET['tok'] == $_SESSION['mgrToken']) { |
|
14 | +if (isset($_SESSION['mgrToken']) && $_GET['tok'] == $_SESSION['mgrToken']) { |
|
15 | 15 | $ok = true; |
16 | 16 | $modx->updateValidatedUserSession(); |
17 | 17 | } |
18 | 18 | |
19 | 19 | header('Content-type: application/json'); |
20 | -if($ok) { |
|
20 | +if ($ok) { |
|
21 | 21 | echo '{"status":"ok"}'; |
22 | 22 | } else { |
23 | 23 | echo '{"status":"null"}'; |
@@ -363,10 +363,10 @@ |
||
363 | 363 | stopWorker(); |
364 | 364 | |
365 | 365 | <?php |
366 | - if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
|
367 | - echo 'doRefresh(' . $_REQUEST['r'] . ");\n"; |
|
368 | - } |
|
369 | - ?> |
|
366 | + if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
|
367 | + echo 'doRefresh(' . $_REQUEST['r'] . ");\n"; |
|
368 | + } |
|
369 | + ?> |
|
370 | 370 | |
371 | 371 | var actionButtons = document.getElementById('actions'), actionSelect = document.getElementById('stay'); |
372 | 372 | if (actionButtons !== null && actionSelect !== null) { |
@@ -17,31 +17,31 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | if (!empty($_COOKIE['MODX_themeColor'])) { |
20 | - $body_class .= ' ' . $_COOKIE['MODX_themeColor']; |
|
20 | + $body_class .= ' '.$_COOKIE['MODX_themeColor']; |
|
21 | 21 | } |
22 | 22 | |
23 | -$css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime; |
|
23 | +$css = 'media/style/'.$modx->config['manager_theme'].'/style.css?v='.$lastInstallTime; |
|
24 | 24 | |
25 | 25 | if ($modx->config['manager_theme'] == 'default') { |
26 | - if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { |
|
27 | - require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
|
26 | + if (!file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css') && is_writable(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css')) { |
|
27 | + require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php'; |
|
28 | 28 | $minifier = new Formatter\CSSMinify(); |
29 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
30 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
31 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css'); |
|
32 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css'); |
|
33 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css'); |
|
34 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css'); |
|
35 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css'); |
|
36 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css'); |
|
37 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css'); |
|
38 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css'); |
|
39 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'); |
|
29 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
30 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
31 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css'); |
|
32 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css'); |
|
33 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css'); |
|
34 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css'); |
|
35 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css'); |
|
36 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css'); |
|
37 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css'); |
|
38 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css'); |
|
39 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css'); |
|
40 | 40 | $css = $minifier->minify(); |
41 | - file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); |
|
41 | + file_put_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css', $css); |
|
42 | 42 | } |
43 | - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
44 | - $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
|
43 | + if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) { |
|
44 | + $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime; |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
57 | 57 | <link rel="stylesheet" type="text/css" href="<?= $css ?>" /> |
58 | 58 | <script type="text/javascript" src="media/script/tabpane.js"></script> |
59 | - <?= sprintf('<script type="text/javascript" src="%s"></script>' . "\n", $modx->config['mgr_jquery_path']) ?> |
|
59 | + <?= sprintf('<script type="text/javascript" src="%s"></script>'."\n", $modx->config['mgr_jquery_path']) ?> |
|
60 | 60 | <?php if ($modx->config['show_picker'] != "0") { ?> |
61 | 61 | <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/color.switcher.js" type="text/javascript"></script> |
62 | 62 | <?php } ?> |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | <?php } ?> |
69 | 69 | |
70 | 70 | <!-- OnManagerMainFrameHeaderHTMLBlock --> |
71 | - <?= $onManagerMainFrameHeaderHTMLBlock . "\n" ?> |
|
71 | + <?= $onManagerMainFrameHeaderHTMLBlock."\n" ?> |
|
72 | 72 | |
73 | 73 | <script type="text/javascript"> |
74 | 74 | /* <![CDATA[ */ |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | |
365 | 365 | <?php |
366 | 366 | if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
367 | - echo 'doRefresh(' . $_REQUEST['r'] . ");\n"; |
|
367 | + echo 'doRefresh('.$_REQUEST['r'].");\n"; |
|
368 | 368 | } |
369 | 369 | ?> |
370 | 370 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (IN_MANAGER_MODE != "true") { |
|
2 | +if (IN_MANAGER_MODE != "true") { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; |
@@ -9,21 +9,21 @@ discard block |
||
9 | 9 | $modx_textdir = isset($modx_textdir) ? $modx_textdir : null; |
10 | 10 | $onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : ''; |
11 | 11 | $textdir = $modx_textdir === 'rtl' ? 'rtl' : 'ltr'; |
12 | -if (!isset($modx->config['mgr_jquery_path'])) { |
|
12 | +if (!isset($modx->config['mgr_jquery_path'])) { |
|
13 | 13 | $modx->config['mgr_jquery_path'] = 'media/script/jquery/jquery.min.js'; |
14 | 14 | } |
15 | -if (!isset($modx->config['mgr_date_picker_path'])) { |
|
15 | +if (!isset($modx->config['mgr_date_picker_path'])) { |
|
16 | 16 | $modx->config['mgr_date_picker_path'] = 'media/script/air-datepicker/datepicker.inc.php'; |
17 | 17 | } |
18 | 18 | |
19 | -if (!empty($_COOKIE['MODX_themeColor'])) { |
|
19 | +if (!empty($_COOKIE['MODX_themeColor'])) { |
|
20 | 20 | $body_class .= ' ' . $_COOKIE['MODX_themeColor']; |
21 | 21 | } |
22 | 22 | |
23 | 23 | $css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime; |
24 | 24 | |
25 | -if ($modx->config['manager_theme'] == 'default') { |
|
26 | - if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { |
|
25 | +if ($modx->config['manager_theme'] == 'default') { |
|
26 | + if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { |
|
27 | 27 | require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
28 | 28 | $minifier = new Formatter\CSSMinify(); |
29 | 29 | $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $css = $minifier->minify(); |
41 | 41 | file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); |
42 | 42 | } |
43 | - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
43 | + if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
44 | 44 | $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
45 | 45 | } |
46 | 46 | } |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | stopWorker(); |
364 | 364 | |
365 | 365 | <?php |
366 | - if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
|
366 | + if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
|
367 | 367 | echo 'doRefresh(' . $_REQUEST['r'] . ");\n"; |
368 | 368 | } |
369 | 369 | ?> |