@@ -299,7 +299,8 @@ |
||
299 | 299 | * @param string $status |
300 | 300 | * @return string |
301 | 301 | */ |
302 | -function render_form($name, $label, $status = '') { |
|
302 | +function render_form($name, $label, $status = '') |
|
303 | +{ |
|
303 | 304 | global $modx, $roledata; |
304 | 305 | |
305 | 306 | $tpl = '<label class="d-block" for="[+name+]check"> |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if( ! defined('IN_MANAGER_MODE') || 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 | -if (!$modx->hasPermission('logs')) { |
|
5 | +if (!$modx->hasPermission('logs')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -11,17 +11,17 @@ discard block |
||
11 | 11 | * @param string $checkKey |
12 | 12 | * @return array |
13 | 13 | */ |
14 | -function array_unique_multi($array, $checkKey) |
|
15 | -{ |
|
14 | +function array_unique_multi($array, $checkKey) |
|
15 | +{ |
|
16 | 16 | // Use the builtin if we're not a multi-dimensional array |
17 | - if (!is_array(current($array)) || empty($checkKey)) { |
|
17 | + if (!is_array(current($array)) || empty($checkKey)) { |
|
18 | 18 | return array_unique($array); |
19 | 19 | } |
20 | 20 | |
21 | 21 | $ret = array(); |
22 | 22 | $checkValues = array(); // contains the unique key Values |
23 | - foreach ($array as $key => $current) { |
|
24 | - if (in_array($current[$checkKey], $checkValues)) { |
|
23 | + foreach ($array as $key => $current) { |
|
24 | + if (in_array($current[$checkKey], $checkValues)) { |
|
25 | 25 | continue; |
26 | 26 | } // duplicate |
27 | 27 | |
@@ -36,17 +36,17 @@ discard block |
||
36 | 36 | * @param string $key |
37 | 37 | * @return array |
38 | 38 | */ |
39 | -function record_sort($array, $key) |
|
40 | -{ |
|
39 | +function record_sort($array, $key) |
|
40 | +{ |
|
41 | 41 | $hash = array(); |
42 | - foreach ($array as $k => $v) { |
|
42 | + foreach ($array as $k => $v) { |
|
43 | 43 | $hash[$k] = $v[$key]; |
44 | 44 | } |
45 | 45 | |
46 | 46 | natsort($hash); |
47 | 47 | |
48 | 48 | $records = array(); |
49 | - foreach ($hash as $k => $row) { |
|
49 | + foreach ($hash as $k => $row) { |
|
50 | 50 | $records[$k] = $array[$k]; |
51 | 51 | } |
52 | 52 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | <?php |
74 | 74 | // get all users currently in the log |
75 | 75 | $logs_user = record_sort(array_unique_multi($logs, 'internalKey'), 'username'); |
76 | - foreach ($logs_user as $row) { |
|
76 | + foreach ($logs_user as $row) { |
|
77 | 77 | $selectedtext = $row['internalKey'] == $_REQUEST['searchuser'] ? ' selected="selected"' : ''; |
78 | 78 | echo "\t\t" . '<option value="' . $row['internalKey'] . '"' . $selectedtext . '>' . $row['username'] . "</option>\n"; |
79 | 79 | } |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | // get all available actions in the log |
91 | 91 | include_once "actionlist.inc.php"; |
92 | 92 | $logs_actions = record_sort(array_unique_multi($logs, 'action'), 'action'); |
93 | - foreach ($logs_actions as $row) { |
|
93 | + foreach ($logs_actions as $row) { |
|
94 | 94 | $action = getAction($row['action']); |
95 | - if ($action == 'Idle') { |
|
95 | + if ($action == 'Idle') { |
|
96 | 96 | continue; |
97 | 97 | } |
98 | 98 | $selectedtext = $row['action'] == $_REQUEST['action'] ? ' selected="selected"' : ''; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | <?php |
111 | 111 | // get all itemid currently in logging |
112 | 112 | $logs_items = record_sort(array_unique_multi($logs, 'itemid'), 'itemid'); |
113 | - foreach ($logs_items as $row) { |
|
113 | + foreach ($logs_items as $row) { |
|
114 | 114 | $selectedtext = $row['itemid'] == $_REQUEST['itemid'] ? ' selected="selected"' : ''; |
115 | 115 | echo "\t\t" . '<option value="' . $row['itemid'] . '"' . $selectedtext . '>' . $row['itemid'] . "</option>\n"; |
116 | 116 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | <?php |
127 | 127 | // get all itemname currently in logging |
128 | 128 | $logs_names = record_sort(array_unique_multi($logs, 'itemname'), 'itemname'); |
129 | - foreach ($logs_names as $row) { |
|
129 | + foreach ($logs_names as $row) { |
|
130 | 130 | $selectedtext = $row['itemname'] == $_REQUEST['itemname'] ? ' selected="selected"' : ''; |
131 | 131 | echo "\t\t" . '<option value="' . $row['itemname'] . '"' . $selectedtext . '>' . $row['itemname'] . "</option>\n"; |
132 | 132 | } |
@@ -182,36 +182,36 @@ discard block |
||
182 | 182 | <div class="container container-body"> |
183 | 183 | |
184 | 184 | <?php |
185 | -if (isset($_REQUEST['log_submit'])) { |
|
185 | +if (isset($_REQUEST['log_submit'])) { |
|
186 | 186 | // get the selections the user made. |
187 | 187 | $sqladd = array(); |
188 | - if ($_REQUEST['searchuser'] != 0) { |
|
188 | + if ($_REQUEST['searchuser'] != 0) { |
|
189 | 189 | $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'"; |
190 | 190 | } |
191 | - if ($_REQUEST['action'] != 0) { |
|
191 | + if ($_REQUEST['action'] != 0) { |
|
192 | 192 | $sqladd[] = "action=" . (int)$_REQUEST['action']; |
193 | 193 | } |
194 | - if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { |
|
194 | + if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { |
|
195 | 195 | $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'"; |
196 | 196 | } |
197 | - if ($_REQUEST['itemname'] != '0') { |
|
197 | + if ($_REQUEST['itemname'] != '0') { |
|
198 | 198 | $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'"; |
199 | 199 | } |
200 | - if ($_REQUEST['message'] != "") { |
|
200 | + if ($_REQUEST['message'] != "") { |
|
201 | 201 | $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; |
202 | 202 | } |
203 | 203 | // date stuff |
204 | - if ($_REQUEST['datefrom'] != "") { |
|
204 | + if ($_REQUEST['datefrom'] != "") { |
|
205 | 205 | $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); |
206 | 206 | } |
207 | - if ($_REQUEST['dateto'] != "") { |
|
207 | + if ($_REQUEST['dateto'] != "") { |
|
208 | 208 | $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); |
209 | 209 | } |
210 | 210 | |
211 | 211 | // If current position is not set, set it to zero |
212 | - if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { |
|
212 | + if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { |
|
213 | 213 | $int_cur_position = 0; |
214 | - } else { |
|
214 | + } else { |
|
215 | 215 | $int_cur_position = $_REQUEST['int_cur_position']; |
216 | 216 | } |
217 | 217 | |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | |
226 | 226 | $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); |
227 | 227 | |
228 | -if ($limit < 1) { |
|
228 | +if ($limit < 1) { |
|
229 | 229 | echo '<p>' . $_lang["mgrlog_emptysrch"] . '</p>'; |
230 | -} else { |
|
230 | +} else { |
|
231 | 231 | echo '<p>' . $_lang["mgrlog_sortinst"] . '</p>'; |
232 | 232 | |
233 | 233 | include_once "paginate.inc.php"; |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "</a> " : " "); |
247 | 247 | $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? "</a> " : " "); |
248 | 248 | $pagesfound = sizeof($array_row_paging); |
249 | - if ($pagesfound > 6) { |
|
249 | + if ($pagesfound > 6) { |
|
250 | 250 | $paging .= $array_row_paging[$current_row - 2]; // ." "; |
251 | 251 | $paging .= $array_row_paging[$current_row - 1]; // ." "; |
252 | 252 | $paging .= $array_row_paging[$current_row]; // ." "; |
253 | 253 | $paging .= $array_row_paging[$current_row + 1]; // ." "; |
254 | 254 | $paging .= $array_row_paging[$current_row + 2]; // ." "; |
255 | - } else { |
|
256 | - for ($i = 0; $i < $pagesfound; $i++) { |
|
255 | + } else { |
|
256 | + for ($i = 0; $i < $pagesfound; $i++) { |
|
257 | 257 | $paging .= $array_row_paging[$i] . " "; |
258 | 258 | } |
259 | 259 | } |
@@ -288,12 +288,12 @@ discard block |
||
288 | 288 | // grab the entire log file... |
289 | 289 | $logentries = array(); |
290 | 290 | $i = 0; |
291 | - while ($logentry = $modx->db->getRow($rs)) { |
|
292 | - if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { |
|
291 | + while ($logentry = $modx->db->getRow($rs)) { |
|
292 | + if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { |
|
293 | 293 | $item = '<div style="text-align:center;">-</div>'; |
294 | - } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { |
|
294 | + } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { |
|
295 | 295 | $item = '<a href="index.php?a=3&id=' . $logentry['itemid'] . '">' . $logentry['itemname'] . '</a>'; |
296 | - } else { |
|
296 | + } else { |
|
297 | 297 | $item = $logentry['itemname']; |
298 | 298 | } |
299 | 299 | //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' |
@@ -328,6 +328,6 @@ discard block |
||
328 | 328 | // @see index.php @ 915 |
329 | 329 | global $action; |
330 | 330 | $action = 1; |
331 | -} else { |
|
331 | +} else { |
|
332 | 332 | echo $_lang["mgrlog_noquery"]; |
333 | 333 | } |
@@ -23,12 +23,15 @@ |
||
23 | 23 | * @param array $linkArr |
24 | 24 | * @return string |
25 | 25 | */ |
26 | -function createList($sectionHeader, $linkArr) { |
|
26 | +function createList($sectionHeader, $linkArr) |
|
27 | +{ |
|
27 | 28 | $output = '<div class="sectionHeader">'.$sectionHeader.'</div><div class="sectionBody">'."\n"; |
28 | 29 | $output .= '<table width="500" border="0" cellspacing="0" cellpadding="0">'."\n"; |
29 | 30 | $links = ''; |
30 | 31 | foreach($linkArr as $row) { |
31 | - if (!is_array($row['link'])) $row['link'] = array($row['link']); |
|
32 | + if (!is_array($row['link'])) { |
|
33 | + $row['link'] = array($row['link']); |
|
34 | + } |
|
32 | 35 | foreach ($row['link'] as $link) { |
33 | 36 | $links .= $links != '' ? '<br/>' : ''; |
34 | 37 | $links .= '<a href="' . $link . '" target="_blank">' . $link . '</a>'; |
@@ -12,7 +12,8 @@ discard block |
||
12 | 12 | * @param array $tvsArray |
13 | 13 | * @return string |
14 | 14 | */ |
15 | -function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) { |
|
15 | +function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) |
|
16 | +{ |
|
16 | 17 | global $modx; |
17 | 18 | global $_style; |
18 | 19 | global $_lang; |
@@ -384,13 +385,16 @@ discard block |
||
384 | 385 | * @param string|array|mysqli_result $v |
385 | 386 | * @return array |
386 | 387 | */ |
387 | -function ParseIntputOptions($v) { |
|
388 | +function ParseIntputOptions($v) |
|
389 | +{ |
|
388 | 390 | global $modx; |
389 | 391 | $a = array(); |
390 | 392 | if(is_array($v)) { |
391 | 393 | return $v; |
392 | 394 | } else if($modx->db->isResult($v)) { |
393 | - while($cols = $modx->db->getRow($v, 'num')) $a[] = $cols; |
|
395 | + while($cols = $modx->db->getRow($v, 'num')) { |
|
396 | + $a[] = $cols; |
|
397 | + } |
|
394 | 398 | } else { |
395 | 399 | $a = explode("||", $v); |
396 | 400 | } |
@@ -7,53 +7,55 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -Class TemplateParser { |
|
10 | +Class TemplateParser |
|
11 | +{ |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * @param array $config [action, tabs, toArray] |
14 | 15 | * @param array $data |
15 | 16 | * @return string |
16 | 17 | */ |
17 | - public function output($config = array(), $data = array()) { |
|
18 | + public function output($config = array(), $data = array()) |
|
19 | + { |
|
18 | 20 | global $modx; |
19 | 21 | |
20 | 22 | $output = ''; |
21 | 23 | $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); |
22 | 24 | $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; |
23 | 25 | |
24 | - if($action) { |
|
26 | + if($action) { |
|
25 | 27 | $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name |
26 | 28 | FROM ' . $modx->getFullTableName('system_templates') . ' AS t1 |
27 | 29 | INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category |
28 | 30 | WHERE t1.action IN(' . $action . ') ' . $tab . ' |
29 | 31 | ORDER BY t1.tab ASC, t1.rank ASC'); |
30 | 32 | |
31 | - if($modx->db->getRecordCount($sql)) { |
|
33 | + if($modx->db->getRecordCount($sql)) { |
|
32 | 34 | $tabs = array(); |
33 | - while($row = $modx->db->getRow($sql)) { |
|
34 | - if(!$row['value'] && !empty($data[$row['name']])) { |
|
35 | + while($row = $modx->db->getRow($sql)) { |
|
36 | + if(!$row['value'] && !empty($data[$row['name']])) { |
|
35 | 37 | $row['value'] = $data[$row['name']]; |
36 | 38 | } |
37 | 39 | $tabs[$row['tab']]['category_name'] = $row['category_name']; |
38 | 40 | $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); |
39 | 41 | } |
40 | 42 | |
41 | - if(!empty($config['toArray'])) { |
|
43 | + if(!empty($config['toArray'])) { |
|
42 | 44 | $output = $tabs; |
43 | - } else { |
|
45 | + } else { |
|
44 | 46 | $output .= '<div class="tab-pane" id="pane_' . $action . '">'; |
45 | 47 | $output .= ' |
46 | 48 | <script type="text/javascript"> |
47 | 49 | var pane_' . $action . ' = new WebFXTabPane(document.getElementById("pane_' . $action . '"), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
48 | 50 | </script>'; |
49 | 51 | |
50 | - foreach($tabs as $idTab => $tab) { |
|
52 | + foreach($tabs as $idTab => $tab) { |
|
51 | 53 | $output .= '<div class="tab-page" id="tab_' . $action . '_' . $idTab . '">'; |
52 | 54 | $output .= ' |
53 | 55 | <h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '</h2> |
54 | 56 | <script type="text/javascript">pane_' . $action . '.addTabPage(document.getElementById("tab_' . $action . '_' . $idTab . '"));</script>'; |
55 | 57 | unset($tab['category_name']); |
56 | - foreach($tab as $item) { |
|
58 | + foreach($tab as $item) { |
|
57 | 59 | $output .= $item; |
58 | 60 | } |
59 | 61 | $output .= '</div>'; |
@@ -70,7 +72,8 @@ discard block |
||
70 | 72 | * @param array $data |
71 | 73 | * @return string |
72 | 74 | */ |
73 | - private function render($data) { |
|
75 | + private function render($data) |
|
76 | + { |
|
74 | 77 | global $modx, $_lang, $_country_lang; |
75 | 78 | |
76 | 79 | $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); |
@@ -80,7 +83,7 @@ discard block |
||
80 | 83 | $output = ''; |
81 | 84 | $output .= '<div class="form-group row">'; |
82 | 85 | |
83 | - switch($data['type']) { |
|
86 | + switch($data['type']) { |
|
84 | 87 | |
85 | 88 | case 'text': |
86 | 89 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label> |
@@ -114,16 +117,16 @@ discard block |
||
114 | 117 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
115 | 118 | $output .= '<div class="col-sm-7">'; |
116 | 119 | $output .= '<select name="[+name+]" class="form-control" id="[+name+]" onChange="documentDirty=true;">'; |
117 | - if($data['name'] == 'country' && isset($_country_lang)) { |
|
120 | + if($data['name'] == 'country' && isset($_country_lang)) { |
|
118 | 121 | $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $data['country']; |
119 | 122 | $output .= '<option value=""' . (!isset($chosenCountry) ? ' selected' : '') . '> </option>'; |
120 | - foreach($_country_lang as $key => $value) { |
|
123 | + foreach($_country_lang as $key => $value) { |
|
121 | 124 | $output .= '<option value="' . $key . '"' . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . '>' . $value . '</option>'; |
122 | 125 | } |
123 | - } else { |
|
124 | - if($data['elements']) { |
|
126 | + } else { |
|
127 | + if($data['elements']) { |
|
125 | 128 | $elements = explode('||', $data['elements']); |
126 | - foreach($elements as $key => $value) { |
|
129 | + foreach($elements as $key => $value) { |
|
127 | 130 | $value = explode('==', $value); |
128 | 131 | $output .= '<option value="' . $value[1] . '">' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]) . '</option>'; |
129 | 132 | } |
@@ -139,9 +142,9 @@ discard block |
||
139 | 142 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
140 | 143 | $output .= '<div class="col-sm-7">'; |
141 | 144 | $output .= '<input type="checkbox" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
142 | - if($data['elements']) { |
|
145 | + if($data['elements']) { |
|
143 | 146 | $elements = explode('||', $data['elements']); |
144 | - foreach($elements as $key => $value) { |
|
147 | + foreach($elements as $key => $value) { |
|
145 | 148 | $value = explode('==', $value); |
146 | 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]); |
147 | 150 | } |
@@ -155,9 +158,9 @@ discard block |
||
155 | 158 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
156 | 159 | $output .= '<div class="col-sm-7">'; |
157 | 160 | $output .= '<input type="radio" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
158 | - if($data['elements']) { |
|
161 | + if($data['elements']) { |
|
159 | 162 | $elements = explode('||', $data['elements']); |
160 | - foreach($elements as $key => $value) { |
|
163 | + foreach($elements as $key => $value) { |
|
161 | 164 | $value = explode('==', $value); |
162 | 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]); |
163 | 166 | } |
@@ -139,11 +139,14 @@ |
||
139 | 139 | * @param string $itemid |
140 | 140 | * @return string |
141 | 141 | */ |
142 | -function getAction($actionId, $itemid='') { |
|
142 | +function getAction($actionId, $itemid='') |
|
143 | +{ |
|
143 | 144 | global $action_list; |
144 | 145 | |
145 | 146 | $ret = sprintf($action_list[$actionId], $itemid); |
146 | - if (!$ret) $ret = "Idle (unknown)"; |
|
147 | + if (!$ret) { |
|
148 | + $ret = "Idle (unknown)"; |
|
149 | + } |
|
147 | 150 | |
148 | 151 | return $ret; |
149 | 152 | } |
@@ -7,15 +7,17 @@ |
||
7 | 7 | |
8 | 8 | global $database_type; |
9 | 9 | |
10 | -if (empty($database_type)) $database_type = 'mysql'; |
|
10 | +if (empty($database_type)) { |
|
11 | + $database_type = 'mysql'; |
|
12 | +} |
|
11 | 13 | |
12 | 14 | $out = false; |
13 | 15 | $class = 'DBAPI'; |
14 | -if( ! class_exists($class)){ |
|
16 | +if( ! class_exists($class)) { |
|
15 | 17 | include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php'; |
16 | 18 | } |
17 | 19 | |
18 | -if(class_exists($class)){ |
|
20 | +if(class_exists($class)) { |
|
19 | 21 | $this->db= new $class; |
20 | 22 | $out = true; |
21 | 23 | } |
@@ -116,7 +116,8 @@ discard block |
||
116 | 116 | * @return string |
117 | 117 | */ |
118 | 118 | public function getHashType($db_value = '') |
119 | - { // md5 | v1 | phpass |
|
119 | + { |
|
120 | +// md5 | v1 | phpass |
|
120 | 121 | $c = substr($db_value, 0, 1); |
121 | 122 | if ($c === '$') { |
122 | 123 | return 'phpass'; |
@@ -135,7 +136,8 @@ discard block |
||
135 | 136 | * @return string |
136 | 137 | */ |
137 | 138 | public function genV1Hash($password, $seed = '1') |
138 | - { // $seed is user_id basically |
|
139 | + { |
|
140 | +// $seed is user_id basically |
|
139 | 141 | global $modx; |
140 | 142 | |
141 | 143 | if (isset($modx->config['pwd_hash_algo']) && !empty($modx->config['pwd_hash_algo'])) { |
@@ -279,7 +279,8 @@ discard block |
||
279 | 279 | $row['count'] = $this->count; |
280 | 280 | $row['url'] = $modx->makeUrl($row['id']); |
281 | 281 | |
282 | - if (!$row['wasNull']) { // needs writing a document |
|
282 | + if (!$row['wasNull']) { |
|
283 | +// needs writing a document |
|
283 | 284 | $docname = $this->getFileName($row['id'], $row['alias'], $prefix, $suffix); |
284 | 285 | $filename = $dirpath . $docname; |
285 | 286 | if (!is_file($filename)) { |
@@ -307,7 +308,8 @@ discard block |
||
307 | 308 | $this->output[] = $this->parsePlaceholder($_lang['export_site_exporting_document'], $row); |
308 | 309 | } |
309 | 310 | if ($row['isfolder'] === '1' && ($modx->config['suffix_mode'] !== '1' || strpos($row['alias'], |
310 | - '.') === false)) { // needs making a folder |
|
311 | + '.') === false)) { |
|
312 | +// needs making a folder |
|
311 | 313 | $end_dir = ($row['alias'] !== '') ? $row['alias'] : $row['id']; |
312 | 314 | $dir_path = $dirpath . $end_dir; |
313 | 315 | if (strpos($dir_path, MODX_BASE_PATH) === false) { |