@@ -1,22 +1,22 @@ 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 | -switch($modx->manager->action) { |
|
5 | +switch ($modx->manager->action) { |
|
6 | 6 | case 107: |
7 | - if(!$modx->hasPermission('new_module')) { |
|
7 | + if (!$modx->hasPermission('new_module')) { |
|
8 | 8 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
9 | 9 | } |
10 | 10 | break; |
11 | 11 | case 108: |
12 | - if(!$modx->hasPermission('edit_module')) { |
|
12 | + if (!$modx->hasPermission('edit_module')) { |
|
13 | 13 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
14 | 14 | } |
15 | 15 | break; |
16 | 16 | default: |
17 | 17 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
18 | 18 | } |
19 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
19 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
20 | 20 | // Get table names (alphabetical) |
21 | 21 | $tbl_membergroup_names = $modx->getFullTableName('membergroup_names'); |
22 | 22 | $tbl_site_content = $modx->getFullTableName('site_content'); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | |
33 | 33 | // check to see the module editor isn't locked |
34 | -if($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
34 | +if ($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
35 | 35 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
36 | 36 | } |
37 | 37 | // end check for lock |
@@ -39,29 +39,29 @@ discard block |
||
39 | 39 | // Lock snippet for other users to edit |
40 | 40 | $modx->lockElement(6, $id); |
41 | 41 | |
42 | -if(isset($_GET['id'])) { |
|
42 | +if (isset($_GET['id'])) { |
|
43 | 43 | $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); |
44 | 44 | $content = $modx->db->getRow($rs); |
45 | - if(!$content) { |
|
45 | + if (!$content) { |
|
46 | 46 | $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
47 | 47 | } |
48 | 48 | $content['properties'] = str_replace("&", "&", $content['properties']); |
49 | 49 | $_SESSION['itemname'] = $content['name']; |
50 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
50 | + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
51 | 51 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
52 | 52 | } |
53 | 53 | } else { |
54 | 54 | $_SESSION['itemname'] = $_lang["new_module"]; |
55 | 55 | $content['wrap'] = '1'; |
56 | 56 | } |
57 | -if($modx->manager->hasFormValues()) { |
|
57 | +if ($modx->manager->hasFormValues()) { |
|
58 | 58 | $modx->manager->loadFormValues(); |
59 | 59 | } |
60 | 60 | |
61 | 61 | // Add lock-element JS-Script |
62 | 62 | $lockElementId = $id; |
63 | 63 | $lockElementType = 6; |
64 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
64 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
65 | 65 | ?> |
66 | 66 | <script type="text/javascript"> |
67 | 67 | function loadDependencies() { |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | function BrowseServer() { |
409 | 409 | var w = screen.width * 0.7; |
410 | 410 | var h = screen.height * 0.7; |
411 | - OpenServerBrowser("<?= MODX_MANAGER_URL;?>media/browser/<?= $which_browser;?>/browser.php?Type=images", w, h); |
|
411 | + OpenServerBrowser("<?= MODX_MANAGER_URL; ?>media/browser/<?= $which_browser; ?>/browser.php?Type=images", w, h); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | function SetUrl(url, width, height, alt) { |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | <?php |
429 | 429 | // invoke OnModFormPrerender event |
430 | 430 | $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
431 | - if(is_array($evtOut)) { |
|
431 | + if (is_array($evtOut)) { |
|
432 | 432 | echo implode('', $evtOut); |
433 | 433 | } |
434 | 434 | |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> |
443 | 443 | |
444 | 444 | <h1> |
445 | - <i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i> |
|
445 | + <i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i> |
|
446 | 446 | </h1> |
447 | 447 | |
448 | 448 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -467,8 +467,8 @@ discard block |
||
467 | 467 | <div class="col-md-9 col-lg-10"> |
468 | 468 | <div class="form-control-name clearfix"> |
469 | 469 | <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
470 | - <?php if($modx->hasPermission('save_role')): ?> |
|
471 | - <label class="custom-control" title="<?= $_lang['lock_module'] . "\n" . $_lang['lock_module_msg'] ?>" tooltip> |
|
470 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
471 | + <label class="custom-control" title="<?= $_lang['lock_module']."\n".$_lang['lock_module_msg'] ?>" tooltip> |
|
472 | 472 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
473 | 473 | <i class="fa fa-lock"></i> |
474 | 474 | </label> |
@@ -490,9 +490,9 @@ discard block |
||
490 | 490 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
491 | 491 | <option> </option> |
492 | 492 | <?php |
493 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
494 | - foreach(getCategories() as $n => $v) { |
|
495 | - echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
|
493 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
494 | + foreach (getCategories() as $n => $v) { |
|
495 | + echo "\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v['category'])."</option>\n"; |
|
496 | 496 | } |
497 | 497 | ?> |
498 | 498 | </select> |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | <div class="form-group"> |
525 | 525 | <div class="form-row"> |
526 | 526 | <label for="disabled"><input name="disabled" id="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> |
527 | - <?= ($content['disabled'] == 1 ? '<span class="text-danger">' . $_lang['module_disabled'] . '</span>' : $_lang['module_disabled']) ?></label> |
|
527 | + <?= ($content['disabled'] == 1 ? '<span class="text-danger">'.$_lang['module_disabled'].'</span>' : $_lang['module_disabled']) ?></label> |
|
528 | 528 | </div> |
529 | 529 | <div class="form-row"> |
530 | 530 | <label for="parse_docblock"> |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | </div> |
590 | 590 | <!-- HTML text editor end --> |
591 | 591 | </div> |
592 | - <?php if($modx->manager->action == '108'): ?> |
|
592 | + <?php if ($modx->manager->action == '108'): ?> |
|
593 | 593 | <!-- Dependencies --> |
594 | 594 | <div class="tab-page" id="tabDepend"> |
595 | 595 | <h2 class="tab"><?= $_lang['settings_dependencies'] ?></h2> |
@@ -617,14 +617,14 @@ discard block |
||
617 | 617 | LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 |
618 | 618 | LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name'); |
619 | 619 | |
620 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
620 | + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; |
|
621 | 621 | $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items |
622 | 622 | $grd->noRecordMsg = $_lang['no_records_found']; |
623 | 623 | $grd->cssClass = 'grid'; |
624 | 624 | $grd->columnHeaderClass = 'gridHeader'; |
625 | 625 | $grd->itemClass = 'gridItem'; |
626 | 626 | $grd->altItemClass = 'gridAltItem'; |
627 | - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
627 | + $grd->columns = $_lang['element_name']." ,".$_lang['type']; |
|
628 | 628 | $grd->fields = "name,type"; |
629 | 629 | echo $grd->render(); |
630 | 630 | ?> |
@@ -637,13 +637,13 @@ discard block |
||
637 | 637 | <h2 class="tab"><?= $_lang['access_permissions'] ?></h2> |
638 | 638 | <script type="text/javascript">tp.addTabPage(document.getElementById("tabPermissions"));</script> |
639 | 639 | <div class="container container-body"> |
640 | - <?php if($use_udperms == 1) : ?> |
|
640 | + <?php if ($use_udperms == 1) : ?> |
|
641 | 641 | <?php |
642 | 642 | // fetch user access permissions for the module |
643 | 643 | $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
644 | 644 | $groupsarray = $modx->db->getColumn('usergroup', $rs); |
645 | 645 | |
646 | - if($modx->hasPermission('access_permissions')) { |
|
646 | + if ($modx->hasPermission('access_permissions')) { |
|
647 | 647 | ?> |
648 | 648 | <!-- User Group Access Permissions --> |
649 | 649 | <script type="text/javascript"> |
@@ -671,22 +671,22 @@ discard block |
||
671 | 671 | } |
672 | 672 | $chk = ''; |
673 | 673 | $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name'); |
674 | - while($row = $modx->db->getRow($rs)) { |
|
674 | + while ($row = $modx->db->getRow($rs)) { |
|
675 | 675 | $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
676 | 676 | $checked = in_array($row['id'], $groupsarray); |
677 | - if($modx->hasPermission('access_permissions')) { |
|
678 | - if($checked) { |
|
677 | + if ($modx->hasPermission('access_permissions')) { |
|
678 | + if ($checked) { |
|
679 | 679 | $notPublic = true; |
680 | 680 | } |
681 | - $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
681 | + $chks .= '<label><input type="checkbox" name="usrgroups[]" value="'.$row['id'].'"'.($checked ? ' checked="checked"' : '').' onclick="makePublic(false)" /> '.$row['name']."</label><br />\n"; |
|
682 | 682 | } else { |
683 | - if($checked) { |
|
684 | - $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
683 | + if ($checked) { |
|
684 | + $chks = '<input type="hidden" name="usrgroups[]" value="'.$row['id'].'" />'."\n".$chks; |
|
685 | 685 | } |
686 | 686 | } |
687 | 687 | } |
688 | - if($modx->hasPermission('access_permissions')) { |
|
689 | - $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
|
688 | + if ($modx->hasPermission('access_permissions')) { |
|
689 | + $chks = '<label><input type="checkbox" name="chkallgroups"'.(!$notPublic ? ' checked="checked"' : '').' onclick="makePublic(true)" /><span class="warning"> '.$_lang['all_usr_groups'].'</span></label><br />'."\n".$chks; |
|
690 | 690 | } |
691 | 691 | echo $chks; |
692 | 692 | ?> |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | <?php |
708 | 708 | // invoke OnModFormRender event |
709 | 709 | $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
710 | - if(is_array($evtOut)) { |
|
710 | + if (is_array($evtOut)) { |
|
711 | 711 | echo implode('', $evtOut); |
712 | 712 | } |
713 | 713 | ?> |
@@ -1,5 +1,5 @@ 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 | 5 | if (!$modx->hasPermission('logs')) { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $logs_user = record_sort(array_unique_multi($logs, 'internalKey'), 'username'); |
29 | 29 | foreach ($logs_user as $row) { |
30 | 30 | $selectedtext = $row['internalKey'] == $_REQUEST['searchuser'] ? ' selected="selected"' : ''; |
31 | - echo "\t\t" . '<option value="' . $row['internalKey'] . '"' . $selectedtext . '>' . $row['username'] . "</option>\n"; |
|
31 | + echo "\t\t".'<option value="'.$row['internalKey'].'"'.$selectedtext.'>'.$row['username']."</option>\n"; |
|
32 | 32 | } |
33 | 33 | ?> |
34 | 34 | </select> |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | continue; |
50 | 50 | } |
51 | 51 | $selectedtext = $row['action'] == $_REQUEST['action'] ? ' selected="selected"' : ''; |
52 | - echo "\t\t" . '<option value="' . $row['action'] . '"' . $selectedtext . '>' . $row['action'] . ' - ' . $action . "</option>\n"; |
|
52 | + echo "\t\t".'<option value="'.$row['action'].'"'.$selectedtext.'>'.$row['action'].' - '.$action."</option>\n"; |
|
53 | 53 | } |
54 | 54 | ?> |
55 | 55 | </select> |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $logs_items = record_sort(array_unique_multi($logs, 'itemid'), 'itemid'); |
66 | 66 | foreach ($logs_items as $row) { |
67 | 67 | $selectedtext = $row['itemid'] == $_REQUEST['itemid'] ? ' selected="selected"' : ''; |
68 | - echo "\t\t" . '<option value="' . $row['itemid'] . '"' . $selectedtext . '>' . $row['itemid'] . "</option>\n"; |
|
68 | + echo "\t\t".'<option value="'.$row['itemid'].'"'.$selectedtext.'>'.$row['itemid']."</option>\n"; |
|
69 | 69 | } |
70 | 70 | ?> |
71 | 71 | </select> |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $logs_names = record_sort(array_unique_multi($logs, 'itemname'), 'itemname'); |
82 | 82 | foreach ($logs_names as $row) { |
83 | 83 | $selectedtext = $row['itemname'] == $_REQUEST['itemname'] ? ' selected="selected"' : ''; |
84 | - echo "\t\t" . '<option value="' . $row['itemname'] . '"' . $selectedtext . '>' . $row['itemname'] . "</option>\n"; |
|
84 | + echo "\t\t".'<option value="'.$row['itemname'].'"'.$selectedtext.'>'.$row['itemname']."</option>\n"; |
|
85 | 85 | } |
86 | 86 | ?> |
87 | 87 | </select> |
@@ -139,26 +139,26 @@ discard block |
||
139 | 139 | // get the selections the user made. |
140 | 140 | $sqladd = array(); |
141 | 141 | if ($_REQUEST['searchuser'] != 0) { |
142 | - $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'"; |
|
142 | + $sqladd[] = "internalKey='".(int) $_REQUEST['searchuser']."'"; |
|
143 | 143 | } |
144 | 144 | if ($_REQUEST['action'] != 0) { |
145 | - $sqladd[] = "action=" . (int)$_REQUEST['action']; |
|
145 | + $sqladd[] = "action=".(int) $_REQUEST['action']; |
|
146 | 146 | } |
147 | 147 | if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { |
148 | - $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'"; |
|
148 | + $sqladd[] = "itemid='".$_REQUEST['itemid']."'"; |
|
149 | 149 | } |
150 | 150 | if ($_REQUEST['itemname'] != '0') { |
151 | - $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'"; |
|
151 | + $sqladd[] = "itemname='".$modx->db->escape($_REQUEST['itemname'])."'"; |
|
152 | 152 | } |
153 | 153 | if ($_REQUEST['message'] != "") { |
154 | - $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; |
|
154 | + $sqladd[] = "message LIKE '%".$modx->db->escape($_REQUEST['message'])."%'"; |
|
155 | 155 | } |
156 | 156 | // date stuff |
157 | 157 | if ($_REQUEST['datefrom'] != "") { |
158 | - $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); |
|
158 | + $sqladd[] = "timestamp>".$modx->toTimeStamp($_REQUEST['datefrom']); |
|
159 | 159 | } |
160 | 160 | if ($_REQUEST['dateto'] != "") { |
161 | - $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); |
|
161 | + $sqladd[] = "timestamp<".$modx->toTimeStamp($_REQUEST['dateto']); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | // If current position is not set, set it to zero |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | // Number of result to display on the page, will be in the LIMIT of the sql query also |
172 | 172 | $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; |
173 | 173 | |
174 | - $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) |
|
174 | + $extargv = "&a=13&searchuser=".$_REQUEST['searchuser']."&action=".$_REQUEST['action']."&itemid=".$_REQUEST['itemid']."&itemname=".$_REQUEST['itemname']."&message=".$_REQUEST['message']."&dateto=".$_REQUEST['dateto']."&datefrom=".$_REQUEST['datefrom']."&nrresults=".$int_num_result."&log_submit=".$_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) |
|
175 | 175 | |
176 | 176 | // build the sql |
177 | 177 | $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); |
180 | 180 | |
181 | 181 | if ($limit < 1) { |
182 | - echo '<p>' . $_lang["mgrlog_emptysrch"] . '</p>'; |
|
182 | + echo '<p>'.$_lang["mgrlog_emptysrch"].'</p>'; |
|
183 | 183 | } else { |
184 | - echo '<p>' . $_lang["mgrlog_sortinst"] . '</p>'; |
|
184 | + echo '<p>'.$_lang["mgrlog_sortinst"].'</p>'; |
|
185 | 185 | |
186 | 186 | // New instance of the Paging class, you can modify the color and the width of the html table |
187 | 187 | $p = new EvolutionCMS\Support\Paginate($num_rows, $int_cur_position, $int_num_result, $extargv); |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | $current_row = $int_cur_position / $int_num_result; |
193 | 193 | |
194 | 194 | // Display the result as you like... |
195 | - print "<p>" . $_lang["paging_showing"] . " " . $array_paging['lower']; |
|
196 | - print " " . $_lang["paging_to"] . " " . $array_paging['upper']; |
|
197 | - print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")<br />"; |
|
198 | - $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "</a> " : " "); |
|
199 | - $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? "</a> " : " "); |
|
195 | + print "<p>".$_lang["paging_showing"]." ".$array_paging['lower']; |
|
196 | + print " ".$_lang["paging_to"]." ".$array_paging['upper']; |
|
197 | + print " (".$array_paging['total']." ".$_lang["paging_total"].")<br />"; |
|
198 | + $paging = $array_paging['first_link'].$_lang["paging_first"].(isset($array_paging['first_link']) ? "</a> " : " "); |
|
199 | + $paging .= $array_paging['previous_link'].$_lang["paging_prev"].(isset($array_paging['previous_link']) ? "</a> " : " "); |
|
200 | 200 | $pagesfound = sizeof($array_row_paging); |
201 | 201 | if ($pagesfound > 6) { |
202 | 202 | $paging .= $array_row_paging[$current_row - 2]; // ." "; |
@@ -206,11 +206,11 @@ discard block |
||
206 | 206 | $paging .= $array_row_paging[$current_row + 2]; // ." "; |
207 | 207 | } else { |
208 | 208 | for ($i = 0; $i < $pagesfound; $i++) { |
209 | - $paging .= $array_row_paging[$i] . " "; |
|
209 | + $paging .= $array_row_paging[$i]." "; |
|
210 | 210 | } |
211 | 211 | } |
212 | - $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? "</a> " : " ") . " "; |
|
213 | - $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? "</a> " : " ") . " "; |
|
212 | + $paging .= $array_paging['next_link'].$_lang["paging_next"].(isset($array_paging['next_link']) ? "</a> " : " ")." "; |
|
213 | + $paging .= $array_paging['last_link'].$_lang["paging_last"].(isset($array_paging['last_link']) ? "</a> " : " ")." "; |
|
214 | 214 | // The above exemple print somethings like: |
215 | 215 | // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> |
216 | 216 | // Of course you can now play with array_row_paging in order to print |
@@ -246,16 +246,16 @@ discard block |
||
246 | 246 | if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { |
247 | 247 | $item = '<div style="text-align:center;">-</div>'; |
248 | 248 | } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { |
249 | - $item = '<a href="index.php?a=3&id=' . $logentry['itemid'] . '">' . $logentry['itemname'] . '</a>'; |
|
249 | + $item = '<a href="index.php?a=3&id='.$logentry['itemid'].'">'.$logentry['itemname'].'</a>'; |
|
250 | 250 | } else { |
251 | 251 | $item = $logentry['itemname']; |
252 | 252 | } |
253 | 253 | //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' |
254 | - $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; |
|
254 | + $user_drill = 'index.php?a=13&searchuser='.$logentry['internalKey'].'&itemname=0&log_submit=true'; |
|
255 | 255 | ?> |
256 | 256 | <tr> |
257 | - <td><?= '<a href="' . $user_drill . '">' . $logentry['username'] . '</a>' ?></td> |
|
258 | - <td class="text-nowrap"><?= '[' . $logentry['action'] . '] ' . $logentry['message'] ?></td> |
|
257 | + <td><?= '<a href="'.$user_drill.'">'.$logentry['username'].'</a>' ?></td> |
|
258 | + <td class="text-nowrap"><?= '['.$logentry['action'].'] '.$logentry['message'] ?></td> |
|
259 | 259 | <td class="text-xs-right"><?= $logentry['itemid'] ?></td> |
260 | 260 | <td><?= $item ?></td> |
261 | 261 | <td class="text-nowrap"><?= $modx->toDateFormat($logentry['timestamp'] + $server_offset_time) ?></td> |
@@ -1,21 +1,21 @@ |
||
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 | -$logo= '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">'; |
|
5 | +$logo = '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">'; |
|
6 | 6 | $downloadLinks = array( |
7 | - 0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'), |
|
8 | - 1=>array('title'=>$_lang["download"],'link'=>'https://github.com/evolution-cms/evolution/releases'), |
|
9 | - 2=>array('title'=>$_lang["previous_releases"],'link'=>'https://modx.com/download/evolution/previous-releases.html'), |
|
10 | - 3=>array('title'=>$_lang["extras"],'link'=>array( |
|
7 | + 0=>array('title'=>$_lang["information"], 'link'=>'https://evo.im/'), |
|
8 | + 1=>array('title'=>$_lang["download"], 'link'=>'https://github.com/evolution-cms/evolution/releases'), |
|
9 | + 2=>array('title'=>$_lang["previous_releases"], 'link'=>'https://modx.com/download/evolution/previous-releases.html'), |
|
10 | + 3=>array('title'=>$_lang["extras"], 'link'=>array( |
|
11 | 11 | 'http://extras.evolution-cms.com/', |
12 | 12 | 'https://github.com/extras-evolution' |
13 | 13 | )), |
14 | 14 | ); |
15 | 15 | |
16 | 16 | $translationLinks = array( |
17 | - 0=>array('title'=>'Evolution CMS','link'=>'https://www.transifex.com/evolutioncms/evolution/'), |
|
18 | - 1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
|
17 | + 0=>array('title'=>'Evolution CMS', 'link'=>'https://www.transifex.com/evolutioncms/evolution/'), |
|
18 | + 1=>array('title'=>$_lang["extras"], 'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
|
19 | 19 | ); |
20 | 20 | |
21 | 21 |
@@ -44,7 +44,7 @@ |
||
44 | 44 | <div class="container container-body"> |
45 | 45 | <?php |
46 | 46 | if (!isset($_POST['import'])) { |
47 | - echo "<div class=\"element-edit-message\">" . $_lang['import_site_message'] . "</div>"; |
|
47 | + echo "<div class=\"element-edit-message\">".$_lang['import_site_message']."</div>"; |
|
48 | 48 | ?> |
49 | 49 | <form action="index.php" method="post" name="importFrm"> |
50 | 50 | <input type="hidden" name="import" value="import"/> |
@@ -1,5 +1,5 @@ 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 | 5 | if (!$modx->hasPermission('bk_manager')) { |
@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | $dbase = trim($dbase, '`'); |
10 | 10 | |
11 | 11 | if (!isset($modx->config['snapshot_path'])) { |
12 | - if (is_dir(MODX_BASE_PATH . 'temp/backup/')) { |
|
13 | - $modx->config['snapshot_path'] = MODX_BASE_PATH . 'temp/backup/'; |
|
12 | + if (is_dir(MODX_BASE_PATH.'temp/backup/')) { |
|
13 | + $modx->config['snapshot_path'] = MODX_BASE_PATH.'temp/backup/'; |
|
14 | 14 | } else { |
15 | - $modx->config['snapshot_path'] = MODX_BASE_PATH . 'assets/backup/'; |
|
15 | + $modx->config['snapshot_path'] = MODX_BASE_PATH.'assets/backup/'; |
|
16 | 16 | } |
17 | 17 | } |
18 | 18 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | if ($mode == 'restore1') { |
24 | 24 | if (isset($_POST['textarea']) && !empty($_POST['textarea'])) { |
25 | 25 | $source = trim($_POST['textarea']); |
26 | - $_SESSION['textarea'] = $source . "\n"; |
|
26 | + $_SESSION['textarea'] = $source."\n"; |
|
27 | 27 | } else { |
28 | 28 | $source = file_get_contents($_FILES['sqlfile']['tmp_name']); |
29 | 29 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | header('Location: index.php?r=9&a=93'); |
32 | 32 | exit; |
33 | 33 | } elseif ($mode == 'restore2') { |
34 | - $path = $modx->config['snapshot_path'] . $_POST['filename']; |
|
34 | + $path = $modx->config['snapshot_path'].$_POST['filename']; |
|
35 | 35 | if (file_exists($path)) { |
36 | 36 | $source = file_get_contents($path); |
37 | 37 | import_sql($source); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if (!is_writable(rtrim($modx->config['snapshot_path'], '/'))) { |
78 | 78 | $modx->webAlertAndQuit(parsePlaceholder($_lang["bkmgr_alert_mkdir"], array('snapshot_path' => $modx->config['snapshot_path']))); |
79 | 79 | } |
80 | - $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%'"; |
|
80 | + $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->db->escape($modx->db->config['table_prefix'])."%'"; |
|
81 | 81 | $rs = $modx->db->query($sql); |
82 | 82 | $tables = $modx->db->getColumn('Name', $rs); |
83 | 83 | $today = date('Y-m-d_H-i-s'); |
@@ -109,18 +109,18 @@ discard block |
||
109 | 109 | $modx->webAlertAndQuit('Unable to Backup Database'); |
110 | 110 | } |
111 | 111 | } else { |
112 | - include_once MODX_MANAGER_PATH . "includes/header.inc.php"; // start normal header |
|
112 | + include_once MODX_MANAGER_PATH."includes/header.inc.php"; // start normal header |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | if (isset($_SESSION['result_msg']) && $_SESSION['result_msg'] != '') { |
116 | 116 | switch ($_SESSION['result_msg']) { |
117 | 117 | case 'import_ok': |
118 | - $ph['result_msg_import'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>'; |
|
119 | - $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>'; |
|
118 | + $ph['result_msg_import'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>'; |
|
119 | + $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>'; |
|
120 | 120 | break; |
121 | 121 | case 'snapshot_ok': |
122 | 122 | $ph['result_msg_import'] = ''; |
123 | - $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_snapshot_ok"] . '</div>'; |
|
123 | + $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_snapshot_ok"].'</div>'; |
|
124 | 124 | break; |
125 | 125 | } |
126 | 126 | $_SESSION['result_msg'] = ''; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | f.style.display = 'none'; |
180 | 180 | } |
181 | 181 | } |
182 | - <?= (isset($_REQUEST['r']) ? " doRefresh(" . $_REQUEST['r'] . ");" : "") ?> |
|
182 | + <?= (isset($_REQUEST['r']) ? " doRefresh(".$_REQUEST['r'].");" : "") ?> |
|
183 | 183 | |
184 | 184 | </script> |
185 | 185 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | </thead> |
224 | 224 | <tbody> |
225 | 225 | <?php |
226 | - $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%'"; |
|
226 | + $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->db->escape($modx->db->config['table_prefix'])."%'"; |
|
227 | 227 | $rs = $modx->db->query($sql); |
228 | 228 | $i = 0; |
229 | 229 | while ($db_status = $modx->db->getRow($rs)) { |
@@ -233,29 +233,29 @@ discard block |
||
233 | 233 | $table_string = ''; |
234 | 234 | } |
235 | 235 | |
236 | - echo '<tr>' . "\n" . '<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="' . $db_status['Name'] . '"' . (strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"') . ' /><b class="text-primary">' . $db_status['Name'] . '</b></label></td>' . "\n"; |
|
237 | - echo '<td class="text-xs-center">' . (!empty($db_status['Comment']) ? '<i class="' . $_style['actions_help'] . '" data-tooltip="' . $db_status['Comment'] . '"></i>' : '') . '</td>' . "\n"; |
|
238 | - echo '<td class="text-xs-right">' . $db_status['Rows'] . '</td>' . "\n"; |
|
239 | - echo '<td class="text-xs-right">' . $db_status['Collation'] . '</td>' . "\n"; |
|
236 | + echo '<tr>'."\n".'<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="'.$db_status['Name'].'"'.(strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"').' /><b class="text-primary">'.$db_status['Name'].'</b></label></td>'."\n"; |
|
237 | + echo '<td class="text-xs-center">'.(!empty($db_status['Comment']) ? '<i class="'.$_style['actions_help'].'" data-tooltip="'.$db_status['Comment'].'"></i>' : '').'</td>'."\n"; |
|
238 | + echo '<td class="text-xs-right">'.$db_status['Rows'].'</td>'."\n"; |
|
239 | + echo '<td class="text-xs-right">'.$db_status['Collation'].'</td>'."\n"; |
|
240 | 240 | |
241 | 241 | // Enable record deletion for certain tables (TRUNCATE TABLE) if they're not already empty |
242 | 242 | $truncateable = array( |
243 | - $modx->db->config['table_prefix'] . 'event_log', |
|
244 | - $modx->db->config['table_prefix'] . 'manager_log', |
|
243 | + $modx->db->config['table_prefix'].'event_log', |
|
244 | + $modx->db->config['table_prefix'].'manager_log', |
|
245 | 245 | ); |
246 | 246 | if ($modx->hasPermission('settings') && in_array($db_status['Name'], $truncateable) && $db_status['Rows'] > 0) { |
247 | - echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode=' . $action . '&u=' . $db_status['Name'] . '" title="' . $_lang['truncate_table'] . '">' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</a>' . '</td>' . "\n"; |
|
247 | + echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode='.$action.'&u='.$db_status['Name'].'" title="'.$_lang['truncate_table'].'">'.$modx->nicesize($db_status['Data_length'] + $db_status['Data_free']).'</a>'.'</td>'."\n"; |
|
248 | 248 | } else { |
249 | - echo '<td class="text-xs-right">' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n"; |
|
249 | + echo '<td class="text-xs-right">'.$modx->nicesize($db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n"; |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | if ($modx->hasPermission('settings')) { |
253 | - echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode=' . $action . '&t=' . $db_status['Name'] . '" title="' . $_lang['optimize_table'] . '">' . $modx->nicesize($db_status['Data_free']) . '</a>' : '-') . '</td>' . "\n"; |
|
253 | + echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode='.$action.'&t='.$db_status['Name'].'" title="'.$_lang['optimize_table'].'">'.$modx->nicesize($db_status['Data_free']).'</a>' : '-').'</td>'."\n"; |
|
254 | 254 | } else { |
255 | - echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-') . '</td>' . "\n"; |
|
255 | + echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-').'</td>'."\n"; |
|
256 | 256 | } |
257 | 257 | |
258 | - echo '<td class="text-xs-right">' . $modx->nicesize($db_status['Data_length'] - $db_status['Data_free']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n" . "</tr>"; |
|
258 | + echo '<td class="text-xs-right">'.$modx->nicesize($db_status['Data_length'] - $db_status['Data_free']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n"."</tr>"; |
|
259 | 259 | |
260 | 260 | $total = $total + $db_status['Index_length'] + $db_status['Data_length']; |
261 | 261 | $totaloverhead = $totaloverhead + $db_status['Data_free']; |
@@ -266,9 +266,9 @@ discard block |
||
266 | 266 | <tr> |
267 | 267 | <td class="text-xs-right"><?= $_lang['database_table_totals'] ?></td> |
268 | 268 | <td colspan="4"> </td> |
269 | - <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">' . $modx->nicesize($totaloverhead) . '</b><br />(' . number_format($totaloverhead) . ' B)' : '-' ?></td> |
|
269 | + <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">'.$modx->nicesize($totaloverhead).'</b><br />('.number_format($totaloverhead).' B)' : '-' ?></td> |
|
270 | 270 | <td colspan="2"> </td> |
271 | - <td class="text-xs-right"><?= "<b>" . $modx->nicesize($total) . "</b><br />(" . number_format($total) . " B)" ?></td> |
|
271 | + <td class="text-xs-right"><?= "<b>".$modx->nicesize($total)."</b><br />(".number_format($total)." B)" ?></td> |
|
272 | 272 | </tr> |
273 | 273 | </tfoot> |
274 | 274 | </table> |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | foreach ($last_result['0'] as $k => $v) { |
320 | 320 | $title[] = $k; |
321 | 321 | } |
322 | - $result = '<thead><tr><th>' . implode('</th><th>', $title) . '</th></tr></thead>'; |
|
322 | + $result = '<thead><tr><th>'.implode('</th><th>', $title).'</th></tr></thead>'; |
|
323 | 323 | $result .= '<tbody>'; |
324 | 324 | foreach ($last_result as $row) { |
325 | 325 | $result_value = array(); |
@@ -327,11 +327,11 @@ discard block |
||
327 | 327 | foreach ($row as $k => $v) { |
328 | 328 | $result_value[] = $v; |
329 | 329 | } |
330 | - $result .= '<tr><td>' . implode('</td><td>', $result_value) . '</td></tr>'; |
|
330 | + $result .= '<tr><td>'.implode('</td><td>', $result_value).'</td></tr>'; |
|
331 | 331 | } |
332 | 332 | } |
333 | 333 | $result .= '</tbody>'; |
334 | - $result = '<table class="table data">' . $result . '</table>'; |
|
334 | + $result = '<table class="table data">'.$result.'</table>'; |
|
335 | 335 | } |
336 | 336 | } |
337 | 337 | |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | while ($count < 11) { |
434 | 434 | $line = fgets($file); |
435 | 435 | foreach ($detailFields as $label) { |
436 | - $fileLabel = '# ' . $label; |
|
436 | + $fileLabel = '# '.$label; |
|
437 | 437 | if (strpos($line, $fileLabel) !== false) { |
438 | 438 | $details[$label] = htmlentities(trim(str_replace(array( |
439 | 439 | $fileLabel, |
@@ -446,10 +446,10 @@ discard block |
||
446 | 446 | }; |
447 | 447 | fclose($file); |
448 | 448 | |
449 | - $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; |
|
450 | - $tooltip .= "Server version: " . $details["Server version"] . "\n"; |
|
451 | - $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; |
|
452 | - $tooltip .= "Host: " . $details["Host"] . "\n"; |
|
449 | + $tooltip = "Generation Time: ".$details["Generation Time"]."\n"; |
|
450 | + $tooltip .= "Server version: ".$details["Server version"]."\n"; |
|
451 | + $tooltip .= "PHP Version: ".$details["PHP Version"]."\n"; |
|
452 | + $tooltip .= "Host: ".$details["Host"]."\n"; |
|
453 | 453 | ?> |
454 | 454 | <tr> |
455 | 455 | <td><?= $filename ?></td> |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | <?php |
482 | 482 | |
483 | 483 | if (is_numeric($_GET['tab'])) { |
484 | - echo '<script type="text/javascript">tpDBM.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
484 | + echo '<script type="text/javascript">tpDBM.setSelectedIndex( '.$_GET['tab'].' );</script>'; |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | include_once "footer.inc.php"; // send footer |
@@ -1,14 +1,14 @@ 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 />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('settings')) { |
|
5 | +if (!$modx->hasPermission('settings')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
7 | 7 | } |
8 | 8 | |
9 | 9 | // check to see the edit settings page isn't locked |
10 | -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
11 | -if($username = $modx->db->getValue($rs)) { |
|
10 | +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='".$modx->getLoginUserID()."'"); |
|
11 | +if ($username = $modx->db->getValue($rs)) { |
|
12 | 12 | $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
13 | 13 | } |
14 | 14 | // end check for lock |
@@ -16,21 +16,21 @@ discard block |
||
16 | 16 | // reload system settings from the database. |
17 | 17 | // this will prevent user-defined settings from being saved as system setting |
18 | 18 | $settings = array(); |
19 | -include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
|
19 | +include_once(MODX_MANAGER_PATH.'includes/default_config.php'); |
|
20 | 20 | $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]system_settings'); |
21 | -while($row = $modx->db->getRow($rs)) { |
|
21 | +while ($row = $modx->db->getRow($rs)) { |
|
22 | 22 | $settings[$row['setting_name']] = $row['setting_value']; |
23 | 23 | } |
24 | -$settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']); |
|
25 | -$settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']); |
|
24 | +$settings['filemanager_path'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['filemanager_path']); |
|
25 | +$settings['rb_base_dir'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['rb_base_dir']); |
|
26 | 26 | |
27 | 27 | extract($settings, EXTR_OVERWRITE); |
28 | 28 | |
29 | 29 | // load languages and keys |
30 | 30 | $lang_keys = array(); |
31 | 31 | $dir = dir('includes/lang'); |
32 | -while($file = $dir->read()) { |
|
33 | - if(strpos($file, '.inc.php') > 0) { |
|
32 | +while ($file = $dir->read()) { |
|
33 | + if (strpos($file, '.inc.php') > 0) { |
|
34 | 34 | $endpos = strpos($file, '.'); |
35 | 35 | $languagename = substr($file, 0, $endpos); |
36 | 36 | $lang_keys[$languagename] = get_lang_keys($file); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | <input type="hidden" name="site_id" value="<?php echo $site_id; ?>" /> |
68 | 68 | <input type="hidden" name="settings_version" value="<?php echo $modx->getVersionData('version'); ?>" /> |
69 | 69 | <!-- this field is used to check site settings have been entered/ updated after install or upgrade --> |
70 | - <?php if(!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?> |
|
70 | + <?php if (!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?> |
|
71 | 71 | <div class='sectionBody'><p class='element-edit-message-tab alert alert-warning'><?php echo $_lang['settings_after_install']; ?></p></div> |
72 | 72 | <?php } ?> |
73 | 73 | <div class="tab-pane" id="settingsPane"> |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | </script> |
77 | 77 | |
78 | 78 | <?php |
79 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
80 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
81 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
82 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
83 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
84 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
85 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
79 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
80 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
81 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
82 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
83 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
84 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
85 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
86 | 86 | ?> |
87 | 87 | </div> |
88 | 88 | </div> |
@@ -129,6 +129,6 @@ discard block |
||
129 | 129 | }); |
130 | 130 | </script> |
131 | 131 | <?php |
132 | -if(is_numeric($_GET['tab'])) { |
|
133 | - echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
132 | +if (is_numeric($_GET['tab'])) { |
|
133 | + echo '<script type="text/javascript">tpSettings.setSelectedIndex( '.$_GET['tab'].' );</script>'; |
|
134 | 134 | } |
@@ -1,5 +1,5 @@ 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 | 5 | |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | $tbl_site_plugins = $modx->getFullTableName('site_plugins'); |
24 | 24 | $tbl_site_plugin_events = $modx->getFullTableName('site_plugin_events'); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $content['properties'] = str_replace("&", "&", $content['properties']); |
47 | 47 | } else { |
48 | 48 | $_SESSION['itemname'] = $_lang["new_plugin"]; |
49 | - $content['category'] = (int)$_REQUEST['catid']; |
|
49 | + $content['category'] = (int) $_REQUEST['catid']; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | if ($modx->manager->hasFormValues()) { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | // Add lock-element JS-Script |
57 | 57 | $lockElementId = $id; |
58 | 58 | $lockElementType = 5; |
59 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
59 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
60 | 60 | |
61 | 61 | |
62 | 62 | |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> |
474 | 474 | |
475 | 475 | <h1> |
476 | - <i class="fa fa-plug"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_plugin']) ?><i class="fa fa-question-circle help"></i> |
|
476 | + <i class="fa fa-plug"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_plugin']) ?><i class="fa fa-question-circle help"></i> |
|
477 | 477 | </h1> |
478 | 478 | |
479 | 479 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | <div class="form-control-name clearfix"> |
500 | 500 | <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
501 | 501 | <?php if ($modx->hasPermission('save_role')): ?> |
502 | - <label class="custom-control" title="<?= $_lang['lock_plugin'] . "\n" . $_lang['lock_plugin_msg'] ?>" tooltip> |
|
502 | + <label class="custom-control" title="<?= $_lang['lock_plugin']."\n".$_lang['lock_plugin_msg'] ?>" tooltip> |
|
503 | 503 | <input name="locked" type="checkbox" value="on"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
504 | 504 | <i class="fa fa-lock"></i> |
505 | 505 | </label> |
@@ -523,9 +523,9 @@ discard block |
||
523 | 523 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
524 | 524 | <option> </option> |
525 | 525 | <?php |
526 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
526 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
527 | 527 | foreach (getCategories() as $n => $v) { |
528 | - echo '<option value="' . $v['id'] . '"' . ($content["category"] == $v["id"] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v["category"]) . "</option>"; |
|
528 | + echo '<option value="'.$v['id'].'"'.($content["category"] == $v["id"] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v["category"])."</option>"; |
|
529 | 529 | } |
530 | 530 | ?> |
531 | 531 | </select> |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | <?php if ($modx->hasPermission('save_role')): ?> |
542 | 542 | <div class="form-group"> |
543 | 543 | <div class="form-row"> |
544 | - <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['plugin_disabled'] . "</span>" : $_lang['plugin_disabled']) ?></label> |
|
544 | + <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['plugin_disabled']."</span>" : $_lang['plugin_disabled']) ?></label> |
|
545 | 545 | </div> |
546 | 546 | <div class="form-row"> |
547 | 547 | <label> |
@@ -588,11 +588,11 @@ discard block |
||
588 | 588 | <select name="moduleguid" class="form-control" onchange="documentDirty=true;"> |
589 | 589 | <option> </option> |
590 | 590 | <?php |
591 | - $ds = $modx->db->select('sm.id,sm.name,sm.guid', $modx->getFullTableName("site_modules") . " sm |
|
592 | - INNER JOIN " . $modx->getFullTableName("site_module_depobj") . " smd ON smd.module=sm.id AND smd.type=30 |
|
593 | - INNER JOIN " . $modx->getFullTableName("site_plugins") . " sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name'); |
|
591 | + $ds = $modx->db->select('sm.id,sm.name,sm.guid', $modx->getFullTableName("site_modules")." sm |
|
592 | + INNER JOIN " . $modx->getFullTableName("site_module_depobj")." smd ON smd.module=sm.id AND smd.type=30 |
|
593 | + INNER JOIN " . $modx->getFullTableName("site_plugins")." sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name'); |
|
594 | 594 | while ($row = $modx->db->getRow($ds)) { |
595 | - echo "<option value='" . $row['guid'] . "'" . ($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($row["name"]) . "</option>"; |
|
595 | + echo "<option value='".$row['guid']."'".($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "").">".$modx->htmlspecialchars($row["name"])."</option>"; |
|
596 | 596 | } |
597 | 597 | ?> |
598 | 598 | </select> |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | echoEventRows($evtnames); |
655 | 655 | } |
656 | 656 | echo '<hr class="clear">'; |
657 | - echo '<div class="form-group"><b>' . $services[$srv - 1] . '</b></div>'; |
|
657 | + echo '<div class="form-group"><b>'.$services[$srv - 1].'</b></div>'; |
|
658 | 658 | } |
659 | 659 | // display group name |
660 | 660 | if ($grp != $row['groupname']) { |
@@ -663,9 +663,9 @@ discard block |
||
663 | 663 | echoEventRows($evtnames); |
664 | 664 | } |
665 | 665 | echo '<hr class="clear">'; |
666 | - echo '<div class="form-group"><b>' . $row['groupname'] . '</b></div>'; |
|
666 | + echo '<div class="form-group"><b>'.$row['groupname'].'</b></div>'; |
|
667 | 667 | } |
668 | - $evtnames[] = '<input name="sysevents[]" id="' . $row['name'] . '" type="checkbox" ' . (in_array($row['id'], $evts) ? ' checked="checked" ' : '') . 'class="inputBox" value="' . $row['id'] . '" /> <label for="' . $row['name'] . '" ' . bold(in_array($row['id'], $evts)) . '> ' . $row['name'] . '</label>' . "\n"; |
|
668 | + $evtnames[] = '<input name="sysevents[]" id="'.$row['name'].'" type="checkbox" '.(in_array($row['id'], $evts) ? ' checked="checked" ' : '').'class="inputBox" value="'.$row['id'].'" /> <label for="'.$row['name'].'" '.bold(in_array($row['id'], $evts)).'> '.$row['name'].'</label>'."\n"; |
|
669 | 669 | if (count($evtnames) == 2) { |
670 | 670 | echoEventRows($evtnames); |
671 | 671 | } |
@@ -3,7 +3,7 @@ discard block |
||
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 | |
6 | -switch ((int)$modx->manager->action) { |
|
6 | +switch ((int) $modx->manager->action) { |
|
7 | 7 | case 35: |
8 | 8 | if (!$modx->hasPermission('edit_role')) { |
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$role = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | $tbl_user_roles = $modx->getFullTableName('user_roles'); |
24 | 24 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | // Add lock-element JS-Script |
47 | 47 | $lockElementId = $role; |
48 | 48 | $lockElementType = 8; |
49 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
49 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
50 | 50 | ?> |
51 | 51 | <script type="text/javascript"> |
52 | 52 | function changestate(element) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | <input type="hidden" name="id" value="<?= $_GET['id'] ?>"> |
83 | 83 | |
84 | 84 | <h1> |
85 | - <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'] . '<small>(' . $roledata['id'] . ')</small>' : $_lang['role_title']) ?> |
|
85 | + <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'].'<small>('.$roledata['id'].')</small>' : $_lang['role_title']) ?> |
|
86 | 86 | </h1> |
87 | 87 | |
88 | 88 | <?= $_style['actionbuttons']['dynamic']['savedelete'] ?> |
@@ -1,5 +1,5 @@ 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 | 5 | |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | $tpl = array( |
12 | - 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), |
|
13 | - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
14 | - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
15 | - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
16 | - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') |
|
12 | + 'viewForm' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_viewForm.tpl'), |
|
13 | + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelGroup.tpl'), |
|
14 | + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelHeading.tpl'), |
|
15 | + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelCollapse.tpl'), |
|
16 | + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_elementsRow.tpl') |
|
17 | 17 | ); |
18 | 18 | |
19 | 19 | /** |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @param array $ph |
22 | 22 | * @return string |
23 | 23 | */ |
24 | -function parsePh($tpl, $ph) { |
|
24 | +function parsePh($tpl, $ph){ |
|
25 | 25 | $modx = evolutionCMS(); global $_lang; |
26 | 26 | $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); |
27 | 27 | return $modx->parseText($tpl, $ph); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param string|int $cssId |
32 | 32 | * @return string |
33 | 33 | */ |
34 | -function renderViewSwitchButtons($cssId) { |
|
34 | +function renderViewSwitchButtons($cssId){ |
|
35 | 35 | $modx = evolutionCMS(); global $_lang, $tpl; |
36 | 36 | |
37 | 37 | return parsePh($tpl['viewForm'], array( |
@@ -44,19 +44,19 @@ discard block |
||
44 | 44 | * @param mgrResources $resources |
45 | 45 | * @return string |
46 | 46 | */ |
47 | -function createResourceList($resourceTable, $resources) { |
|
47 | +function createResourceList($resourceTable, $resources){ |
|
48 | 48 | $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir, $tpl; |
49 | 49 | |
50 | 50 | $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; |
51 | 51 | |
52 | - if( ! is_array($items) || empty($items)) { |
|
52 | + if (!is_array($items) || empty($items)) { |
|
53 | 53 | return $_lang['no_results']; |
54 | 54 | } |
55 | 55 | |
56 | 56 | // Prepare elements- and categories-list |
57 | 57 | $elements = array(); |
58 | 58 | $categories = array(); |
59 | - foreach($items as $row) { |
|
59 | + foreach ($items as $row) { |
|
60 | 60 | $catid = $row['catid'] ? $row['catid'] : 0; |
61 | 61 | $categories[$catid] = array('name' => stripslashes($row['category'])); |
62 | 62 | $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); |
@@ -64,18 +64,18 @@ discard block |
||
64 | 64 | |
65 | 65 | // Now render categories / panel-collapse |
66 | 66 | $panelGroup = ''; |
67 | - foreach($elements as $catid => $elList) { |
|
67 | + foreach ($elements as $catid => $elList) { |
|
68 | 68 | // Add panel-heading / category-collapse to output |
69 | 69 | $panelGroup .= parsePh($tpl['panelHeading'], array( |
70 | 70 | 'tab' => $resourceTable, |
71 | 71 | 'category' => $categories[$catid]['name'], |
72 | - 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '', |
|
72 | + 'categoryid' => $catid != '' ? ' <small>('.$catid.')</small>' : '', |
|
73 | 73 | 'catid' => $catid, |
74 | 74 | )); |
75 | 75 | |
76 | 76 | // Prepare content for panel-collapse |
77 | 77 | $panelCollapse = ''; |
78 | - foreach($elList as $el) { |
|
78 | + foreach ($elList as $el) { |
|
79 | 79 | $panelCollapse .= parsePh($tpl['elementsRow'], $el); |
80 | 80 | } |
81 | 81 | |
@@ -97,30 +97,30 @@ discard block |
||
97 | 97 | * @param mgrResources $resources |
98 | 98 | * @return string |
99 | 99 | */ |
100 | -function createCombinedView($resources) { |
|
100 | +function createCombinedView($resources){ |
|
101 | 101 | $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir; |
102 | 102 | |
103 | 103 | $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; |
104 | 104 | $types = isset($resources->types) ? $resources->types : false; |
105 | 105 | $categories = isset($resources->categories) ? $resources->categories : false; |
106 | 106 | |
107 | - if(!$itemsPerCategory) { |
|
107 | + if (!$itemsPerCategory) { |
|
108 | 108 | return $_lang['no_results']; |
109 | 109 | } |
110 | 110 | |
111 | 111 | $tpl = array( |
112 | - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
113 | - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
114 | - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
115 | - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), |
|
112 | + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelGroup.tpl'), |
|
113 | + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelHeading.tpl'), |
|
114 | + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelCollapse.tpl'), |
|
115 | + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_elementsRow.tpl'), |
|
116 | 116 | ); |
117 | 117 | |
118 | 118 | // Easily loop through $itemsPerCategory-Array |
119 | 119 | $panelGroup = ''; |
120 | - foreach($categories as $catid => $category) { |
|
120 | + foreach ($categories as $catid => $category) { |
|
121 | 121 | // Prepare collapse content / elements-list |
122 | 122 | $panelCollapse = ''; |
123 | - foreach($itemsPerCategory[$catid] as $el) { |
|
123 | + foreach ($itemsPerCategory[$catid] as $el) { |
|
124 | 124 | $resourceTable = $el['type']; |
125 | 125 | $ph = prepareElementRowPh($el, $resourceTable, $resources); |
126 | 126 | $panelCollapse .= parsePh($tpl['elementsRow'], $ph); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $panelGroup .= parsePh($tpl['panelHeading'], array( |
131 | 131 | 'tab' => 'categories_list', |
132 | 132 | 'category' => $categories[$catid], |
133 | - 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '', |
|
133 | + 'categoryid' => $catid != '' ? ' <small>('.$catid.')</small>' : '', |
|
134 | 134 | 'catid' => $catid, |
135 | 135 | )); |
136 | 136 | |
@@ -154,14 +154,14 @@ discard block |
||
154 | 154 | * @param mgrResources $resources |
155 | 155 | * @return array |
156 | 156 | */ |
157 | -function prepareElementRowPh($row, $resourceTable, $resources) { |
|
157 | +function prepareElementRowPh($row, $resourceTable, $resources){ |
|
158 | 158 | $modx = evolutionCMS(); global $modx_textdir, $_style, $_lang; |
159 | 159 | |
160 | 160 | $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; |
161 | 161 | |
162 | 162 | $_lang["confirm_delete"] = $_lang["delete"]; |
163 | 163 | |
164 | - switch($resourceTable){ |
|
164 | + switch ($resourceTable) { |
|
165 | 165 | case 'site_templates': |
166 | 166 | $class = $row['selectable'] ? '' : 'disabledPlugin'; |
167 | 167 | $lockElementType = 1; |
@@ -198,65 +198,65 @@ discard block |
||
198 | 198 | // Prepare displaying user-locks |
199 | 199 | $lockedByUser = ''; |
200 | 200 | $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); |
201 | - if($rowLock && $modx->hasPermission('display_locks')) { |
|
202 | - if($rowLock['sid'] == $modx->sid) { |
|
201 | + if ($rowLock && $modx->hasPermission('display_locks')) { |
|
202 | + if ($rowLock['sid'] == $modx->sid) { |
|
203 | 203 | $title = $modx->parseText($_lang["lock_element_editing"], array( |
204 | - 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
204 | + 'element_type' => $_lang["lock_element_type_".$lockElementType], |
|
205 | 205 | 'lasthit_df' => $rowLock['lasthit_df'] |
206 | 206 | )); |
207 | - $lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span> '; |
|
207 | + $lockedByUser = '<span title="'.$title.'" class="editResource" style="cursor:context-menu;">'.$_style['tree_preview_resource'].'</span> '; |
|
208 | 208 | } else { |
209 | 209 | $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
210 | - 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
210 | + 'element_type' => $_lang["lock_element_type_".$lockElementType], |
|
211 | 211 | 'username' => $rowLock['username'], |
212 | 212 | 'lasthit_df' => $rowLock['lasthit_df'] |
213 | 213 | )); |
214 | - if($modx->hasPermission('remove_locks')) { |
|
215 | - $lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>'; |
|
214 | + if ($modx->hasPermission('remove_locks')) { |
|
215 | + $lockedByUser = '<a href="javascript:;" onclick="unlockElement('.$lockElementType.', '.$row['id'].', this);return false;" title="'.$title.'" class="lockedResource"><i class="'.$_style['icons_secured'].'"></i></a>'; |
|
216 | 216 | } else { |
217 | - $lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>'; |
|
217 | + $lockedByUser = '<span title="'.$title.'" class="lockedResource" style="cursor:context-menu;"><i class="'.$_style['icons_secured'].'"></i></span>'; |
|
218 | 218 | } |
219 | 219 | } |
220 | 220 | } |
221 | - if($lockedByUser) { |
|
222 | - $lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>'; |
|
221 | + if ($lockedByUser) { |
|
222 | + $lockedByUser = '<div class="lockCell">'.$lockedByUser.'</div>'; |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | // Caption |
226 | - if($resourceTable == 'site_tmplvars') { |
|
227 | - $caption = !empty($row['description']) ? ' ' . $row['caption'] . ' <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption']; |
|
226 | + if ($resourceTable == 'site_tmplvars') { |
|
227 | + $caption = !empty($row['description']) ? ' '.$row['caption'].' <small>('.$row['description'].')</small>' : ' '.$row['caption']; |
|
228 | 228 | } else { |
229 | - $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; |
|
229 | + $caption = !empty($row['description']) ? ' '.$row['description'] : ''; |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | // Special marks |
233 | 233 | $tplInfo = array(); |
234 | - if($row['locked']) { |
|
234 | + if ($row['locked']) { |
|
235 | 235 | $tplInfo[] = $_lang['locked']; |
236 | 236 | } |
237 | - if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { |
|
237 | + if ($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { |
|
238 | 238 | $tplInfo[] = $_lang['defaulttemplate_title']; |
239 | 239 | } |
240 | - $marks = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : ''; |
|
240 | + $marks = !empty($tplInfo) ? ' <em>('.implode(', ', $tplInfo).')</em>' : ''; |
|
241 | 241 | |
242 | 242 | /* row buttons */ |
243 | 243 | $buttons = ''; |
244 | - if($modx->hasPermission($types['actions']['edit'][1])) { |
|
245 | - $buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>'; |
|
244 | + if ($modx->hasPermission($types['actions']['edit'][1])) { |
|
245 | + $buttons .= '<li><a title="'.$_lang["edit_resource"].'" href="index.php?a='.$types['actions']['edit'][0].'&id='.$row['id'].'"><i class="fa fa-edit fa-fw"></i></a></li>'; |
|
246 | 246 | } |
247 | - if($modx->hasPermission($types['actions']['duplicate'][1])) { |
|
248 | - $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>'; |
|
247 | + if ($modx->hasPermission($types['actions']['duplicate'][1])) { |
|
248 | + $buttons .= '<li><a onclick="return confirm(\''.$_lang["confirm_duplicate_record"].'\')" title="'.$_lang["resource_duplicate"].'" href="index.php?a='.$types['actions']['duplicate'][0].'&id='.$row['id'].'"><i class="fa fa-clone fa-fw"></i></a></li>'; |
|
249 | 249 | } |
250 | - if($modx->hasPermission($types['actions']['remove'][1])) { |
|
251 | - $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>'; |
|
250 | + if ($modx->hasPermission($types['actions']['remove'][1])) { |
|
251 | + $buttons .= '<li><a onclick="return confirm(\''.$_lang["confirm_delete"].'\')" title="'.$_lang["delete"].'" href="index.php?a='.$types['actions']['remove'][0].'&id='.$row['id'].'"><i class="fa fa-trash fa-fw"></i></a></li>'; |
|
252 | 252 | } |
253 | - $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : ''; |
|
253 | + $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">'.$buttons.'</ul></div>' : ''; |
|
254 | 254 | |
255 | 255 | $catid = $row['catid'] ? $row['catid'] : 0; |
256 | 256 | |
257 | 257 | // Placeholders for elements-row |
258 | 258 | return array( |
259 | - 'class' => $class ? ' class="' . $class . '"' : '', |
|
259 | + 'class' => $class ? ' class="'.$class.'"' : '', |
|
260 | 260 | 'lockedByUser' => $lockedByUser, |
261 | 261 | 'name' => $row['name'], |
262 | 262 | 'caption' => $caption, |