@@ -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 | } |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if( ! defined('IN_MANAGER_MODE') || 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.');
|
|
| 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 | 6 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
| 7 | 7 | |
| 8 | 8 | if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
|
| 9 | - // seems to be a new install - send the user to the configuration page |
|
| 10 | - exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
|
|
| 9 | + // seems to be a new install - send the user to the configuration page |
|
| 10 | + exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
|
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | // set placeholders |
@@ -17,93 +17,93 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | // setup message info |
| 19 | 19 | if($modx->hasPermission('messages')) {
|
| 20 | - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
| 21 | - $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
|
| 22 | - $_SESSION['nrnewmessages'] = $nrnewmessages; |
|
| 23 | - |
|
| 24 | - $msg = array(); |
|
| 25 | - $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
|
|
| 26 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : ''; |
|
| 27 | - $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold"> <a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
|
|
| 28 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0'; |
|
| 29 | - $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
|
| 30 | - $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
|
|
| 31 | - $ph['MessageInfo'] = implode("\n", $msg);
|
|
| 20 | + include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
| 21 | + $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
|
| 22 | + $_SESSION['nrnewmessages'] = $nrnewmessages; |
|
| 23 | + |
|
| 24 | + $msg = array(); |
|
| 25 | + $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
|
|
| 26 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : ''; |
|
| 27 | + $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold"> <a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
|
|
| 28 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0'; |
|
| 29 | + $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
|
| 30 | + $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
|
|
| 31 | + $ph['MessageInfo'] = implode("\n", $msg);
|
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | $iconTpl = $managerTheme->getPartial('welcome/WrapIcon');
|
| 35 | 35 | // setup icons |
| 36 | 36 | if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
|
| 37 | - $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
|
| 38 | - $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75); |
|
| 37 | + $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
|
| 38 | + $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75); |
|
| 39 | 39 | } |
| 40 | 40 | if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
|
| 41 | - $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
|
| 42 | - $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99); |
|
| 41 | + $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
|
| 42 | + $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99); |
|
| 43 | 43 | } |
| 44 | 44 | if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
|
| 45 | - $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
|
| 46 | - $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106); |
|
| 45 | + $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
|
| 46 | + $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106); |
|
| 47 | 47 | } |
| 48 | 48 | if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
|
| 49 | - $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
|
| 50 | - $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76); |
|
| 49 | + $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
|
| 50 | + $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76); |
|
| 51 | 51 | } |
| 52 | 52 | if($modx->hasPermission('bk_manager')) {
|
| 53 | - $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
|
| 54 | - $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93); |
|
| 53 | + $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
|
| 54 | + $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93); |
|
| 55 | 55 | } |
| 56 | 56 | if($modx->hasPermission('help')) {
|
| 57 | - $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
|
| 58 | - $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9); |
|
| 57 | + $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
|
| 58 | + $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | if($modx->hasPermission('new_document')) {
|
| 62 | - $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
|
| 63 | - $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4); |
|
| 64 | - $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
|
| 65 | - $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72); |
|
| 62 | + $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
|
| 63 | + $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4); |
|
| 64 | + $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
|
| 65 | + $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72); |
|
| 66 | 66 | } |
| 67 | 67 | if($modx->hasPermission('assets_images')) {
|
| 68 | - $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
|
| 69 | - $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72); |
|
| 68 | + $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
|
| 69 | + $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72); |
|
| 70 | 70 | } |
| 71 | 71 | if($modx->hasPermission('assets_files')) {
|
| 72 | - $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
|
| 73 | - $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72); |
|
| 72 | + $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
|
| 73 | + $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72); |
|
| 74 | 74 | } |
| 75 | 75 | if($modx->hasPermission('change_password')) {
|
| 76 | - $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
|
| 77 | - $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28); |
|
| 76 | + $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
|
| 77 | + $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28); |
|
| 78 | 78 | } |
| 79 | 79 | $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]'; |
| 80 | 80 | $ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8); |
| 81 | 81 | |
| 82 | 82 | // do some config checks |
| 83 | 83 | if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
|
| 84 | - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
| 85 | - if($config_check_results != $_lang['configcheck_ok']) {
|
|
| 86 | - $ph['config_check_results'] = $config_check_results; |
|
| 87 | - $ph['config_display'] = 'block'; |
|
| 88 | - } else {
|
|
| 89 | - $ph['config_display'] = 'none'; |
|
| 90 | - } |
|
| 84 | + include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
| 85 | + if($config_check_results != $_lang['configcheck_ok']) {
|
|
| 86 | + $ph['config_check_results'] = $config_check_results; |
|
| 87 | + $ph['config_display'] = 'block'; |
|
| 88 | + } else {
|
|
| 89 | + $ph['config_display'] = 'none'; |
|
| 90 | + } |
|
| 91 | 91 | } else {
|
| 92 | - $ph['config_display'] = 'none'; |
|
| 92 | + $ph['config_display'] = 'none'; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Check logout-reminder |
| 96 | 96 | if(isset($_SESSION['show_logout_reminder'])) {
|
| 97 | - switch($_SESSION['show_logout_reminder']['type']) {
|
|
| 98 | - case 'logout_reminder': |
|
| 99 | - $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
|
| 100 | - $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
|
|
| 101 | - break; |
|
| 102 | - } |
|
| 103 | - $ph['show_logout_reminder'] = 'block'; |
|
| 104 | - unset($_SESSION['show_logout_reminder']); |
|
| 97 | + switch($_SESSION['show_logout_reminder']['type']) {
|
|
| 98 | + case 'logout_reminder': |
|
| 99 | + $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
|
| 100 | + $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
|
|
| 101 | + break; |
|
| 102 | + } |
|
| 103 | + $ph['show_logout_reminder'] = 'block'; |
|
| 104 | + unset($_SESSION['show_logout_reminder']); |
|
| 105 | 105 | } else {
|
| 106 | - $ph['show_logout_reminder'] = 'none'; |
|
| 106 | + $ph['show_logout_reminder'] = 'none'; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | // Check multiple sessions |
@@ -152,11 +152,11 @@ discard block |
||
| 152 | 152 | $nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>'; |
| 153 | 153 | |
| 154 | 154 | $ph['UserInfo'] = $modx->parseText($tpl, array( |
| 155 | - 'username' => $modx->getLoginUserName(), |
|
| 156 | - 'role' => $_SESSION['mgrPermissions']['name'], |
|
| 157 | - 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), |
|
| 158 | - 'logincount' => $_SESSION['mgrLogincount'] + 1, |
|
| 159 | - 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) |
|
| 155 | + 'username' => $modx->getLoginUserName(), |
|
| 156 | + 'role' => $_SESSION['mgrPermissions']['name'], |
|
| 157 | + 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), |
|
| 158 | + 'logincount' => $_SESSION['mgrLogincount'] + 1, |
|
| 159 | + 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) |
|
| 160 | 160 | )); |
| 161 | 161 | |
| 162 | 162 | $from = array(); |
@@ -165,13 +165,13 @@ discard block |
||
| 165 | 165 | $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
|
| 166 | 166 | |
| 167 | 167 | if($modx->db->getRecordCount($rs) < 1) {
|
| 168 | - $html = '<p>[%no_active_users_found%]</p>'; |
|
| 168 | + $html = '<p>[%no_active_users_found%]</p>'; |
|
| 169 | 169 | } else {
|
| 170 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
| 171 | - $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
|
| 172 | - $ph['now'] = strftime('%H:%M:%S', $now);
|
|
| 173 | - $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
|
| 174 | - $html = ' |
|
| 170 | + include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
| 171 | + $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
|
| 172 | + $ph['now'] = strftime('%H:%M:%S', $now);
|
|
| 173 | + $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
|
| 174 | + $html = ' |
|
| 175 | 175 | <div class="card-body"> |
| 176 | 176 | [%onlineusers_message%] |
| 177 | 177 | <b>[+now+]</b>): |
@@ -189,33 +189,33 @@ discard block |
||
| 189 | 189 | </thead> |
| 190 | 190 | <tbody>'; |
| 191 | 191 | |
| 192 | - $userList = array(); |
|
| 193 | - $userCount = array(); |
|
| 194 | - // Create userlist with session-count first before output |
|
| 195 | - while($activeusers = $modx->db->getRow($rs)) {
|
|
| 196 | - $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
|
| 197 | - |
|
| 198 | - $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
|
| 199 | - $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" /> ' : ''; |
|
| 200 | - $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; |
|
| 201 | - $currentaction = getAction($activeusers['action'], $activeusers['id']); |
|
| 202 | - $userList[] = array( |
|
| 203 | - $idle, |
|
| 204 | - '', |
|
| 205 | - $activeusers['username'], |
|
| 206 | - $webicon, |
|
| 207 | - abs($activeusers['internalKey']), |
|
| 208 | - $ip, |
|
| 209 | - strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time),
|
|
| 210 | - $currentaction |
|
| 211 | - ); |
|
| 212 | - } |
|
| 213 | - foreach($userList as $params) {
|
|
| 214 | - $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
|
| 215 | - $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
|
|
| 216 | - } |
|
| 217 | - |
|
| 218 | - $html .= ' |
|
| 192 | + $userList = array(); |
|
| 193 | + $userCount = array(); |
|
| 194 | + // Create userlist with session-count first before output |
|
| 195 | + while($activeusers = $modx->db->getRow($rs)) {
|
|
| 196 | + $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
|
| 197 | + |
|
| 198 | + $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
|
| 199 | + $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" /> ' : ''; |
|
| 200 | + $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; |
|
| 201 | + $currentaction = getAction($activeusers['action'], $activeusers['id']); |
|
| 202 | + $userList[] = array( |
|
| 203 | + $idle, |
|
| 204 | + '', |
|
| 205 | + $activeusers['username'], |
|
| 206 | + $webicon, |
|
| 207 | + abs($activeusers['internalKey']), |
|
| 208 | + $ip, |
|
| 209 | + strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time),
|
|
| 210 | + $currentaction |
|
| 211 | + ); |
|
| 212 | + } |
|
| 213 | + foreach($userList as $params) {
|
|
| 214 | + $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
|
| 215 | + $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
|
|
| 216 | + } |
|
| 217 | + |
|
| 218 | + $html .= ' |
|
| 219 | 219 | </tbody> |
| 220 | 220 | </table> |
| 221 | 221 | </div> |
@@ -256,17 +256,17 @@ discard block |
||
| 256 | 256 | // invoke event OnManagerWelcomePrerender |
| 257 | 257 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
|
| 258 | 258 | if(is_array($evtOut)) {
|
| 259 | - $output = implode('', $evtOut);
|
|
| 260 | - $ph['OnManagerWelcomePrerender'] = $output; |
|
| 259 | + $output = implode('', $evtOut);
|
|
| 260 | + $ph['OnManagerWelcomePrerender'] = $output; |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | $widgets['welcome'] = array( |
| 264 | - 'menuindex' => '10', |
|
| 265 | - 'id' => 'welcome', |
|
| 266 | - 'cols' => 'col-lg-6', |
|
| 267 | - 'icon' => 'fa-home', |
|
| 268 | - 'title' => '[%welcome_title%]', |
|
| 269 | - 'body' => ' |
|
| 264 | + 'menuindex' => '10', |
|
| 265 | + 'id' => 'welcome', |
|
| 266 | + 'cols' => 'col-lg-6', |
|
| 267 | + 'icon' => 'fa-home', |
|
| 268 | + 'title' => '[%welcome_title%]', |
|
| 269 | + 'body' => ' |
|
| 270 | 270 | <div class="wm_buttons card-body"> |
| 271 | 271 | <!--@IF:[[#hasPermission?key=new_document]]--> |
| 272 | 272 | <span class="wm_button"> |
@@ -340,25 +340,25 @@ discard block |
||
| 340 | 340 | </table> |
| 341 | 341 | </div> |
| 342 | 342 | ', |
| 343 | - 'hide'=>'0' |
|
| 343 | + 'hide'=>'0' |
|
| 344 | 344 | ); |
| 345 | 345 | $widgets['onlineinfo'] = array( |
| 346 | - 'menuindex' => '20', |
|
| 347 | - 'id' => 'onlineinfo', |
|
| 348 | - 'cols' => 'col-lg-6', |
|
| 349 | - 'icon' => 'fa-user', |
|
| 350 | - 'title' => '[%onlineusers_title%]', |
|
| 351 | - 'body' => '<div class="userstable">[+OnlineInfo+]</div>', |
|
| 352 | - 'hide'=>'0' |
|
| 346 | + 'menuindex' => '20', |
|
| 347 | + 'id' => 'onlineinfo', |
|
| 348 | + 'cols' => 'col-lg-6', |
|
| 349 | + 'icon' => 'fa-user', |
|
| 350 | + 'title' => '[%onlineusers_title%]', |
|
| 351 | + 'body' => '<div class="userstable">[+OnlineInfo+]</div>', |
|
| 352 | + 'hide'=>'0' |
|
| 353 | 353 | ); |
| 354 | 354 | $widgets['recentinfo'] = array( |
| 355 | - 'menuindex' => '30', |
|
| 356 | - 'id' => 'modxrecent_widget', |
|
| 357 | - 'cols' => 'col-sm-12', |
|
| 358 | - 'icon' => 'fa-pencil-square-o', |
|
| 359 | - 'title' => '[%activity_title%]', |
|
| 360 | - 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
|
| 361 | - 'hide'=>'0' |
|
| 355 | + 'menuindex' => '30', |
|
| 356 | + 'id' => 'modxrecent_widget', |
|
| 357 | + 'cols' => 'col-sm-12', |
|
| 358 | + 'icon' => 'fa-pencil-square-o', |
|
| 359 | + 'title' => '[%activity_title%]', |
|
| 360 | + 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
|
| 361 | + 'hide'=>'0' |
|
| 362 | 362 | ); |
| 363 | 363 | if ($modx->config['rss_url_news']) {
|
| 364 | 364 | $widgets['news'] = array( |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | // invoke OnManagerWelcomeHome event |
| 387 | 387 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
|
| 388 | 388 | if(is_array($sitewidgets)) {
|
| 389 | - $newwidgets = array(); |
|
| 389 | + $newwidgets = array(); |
|
| 390 | 390 | foreach($sitewidgets as $widget){
|
| 391 | 391 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
| 392 | 392 | } |
@@ -394,21 +394,21 @@ discard block |
||
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | usort($widgets, function ($a, $b) {
|
| 397 | - return $a['menuindex'] - $b['menuindex']; |
|
| 397 | + return $a['menuindex'] - $b['menuindex']; |
|
| 398 | 398 | }); |
| 399 | 399 | |
| 400 | 400 | $tpl = $managerTheme->getPartial('welcome/Widget');
|
| 401 | 401 | $output = ''; |
| 402 | 402 | foreach($widgets as $widget) {
|
| 403 | - if ($widget['hide'] != '1'){
|
|
| 404 | - $output .= $modx->parseText($tpl, $widget); |
|
| 405 | - } |
|
| 403 | + if ($widget['hide'] != '1'){
|
|
| 404 | + $output .= $modx->parseText($tpl, $widget); |
|
| 405 | + } |
|
| 406 | 406 | } |
| 407 | 407 | $ph['widgets'] = $output; |
| 408 | 408 | |
| 409 | 409 | // load template |
| 410 | 410 | if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
|
| 411 | - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
| 411 | + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | $target = $modx->config['manager_welcome_tpl']; |
@@ -416,27 +416,27 @@ discard block |
||
| 416 | 416 | $target = $modx->mergeSettingsContent($target); |
| 417 | 417 | |
| 418 | 418 | if(substr($target, 0, 1) === '@') {
|
| 419 | - if(substr($target, 0, 6) === '@CHUNK') {
|
|
| 420 | - $content = $modx->getChunk(trim(substr($target, 7))); |
|
| 421 | - } elseif(substr($target, 0, 5) === '@FILE') {
|
|
| 422 | - $content = file_get_contents(trim(substr($target, 6))); |
|
| 423 | - } else {
|
|
| 424 | - $content = ''; |
|
| 425 | - } |
|
| 419 | + if(substr($target, 0, 6) === '@CHUNK') {
|
|
| 420 | + $content = $modx->getChunk(trim(substr($target, 7))); |
|
| 421 | + } elseif(substr($target, 0, 5) === '@FILE') {
|
|
| 422 | + $content = file_get_contents(trim(substr($target, 6))); |
|
| 423 | + } else {
|
|
| 424 | + $content = ''; |
|
| 425 | + } |
|
| 426 | 426 | } else {
|
| 427 | - $chunk = $modx->getChunk($target); |
|
| 428 | - if($chunk !== false && !empty($chunk)) {
|
|
| 429 | - $content = $chunk; |
|
| 430 | - } elseif(is_file(MODX_BASE_PATH . $target)) {
|
|
| 431 | - $content = file_get_contents(MODX_BASE_PATH . $target); |
|
| 432 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
|
|
| 433 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
| 434 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
| 435 | - {
|
|
| 436 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
| 437 | - } else {
|
|
| 438 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
| 439 | - } |
|
| 427 | + $chunk = $modx->getChunk($target); |
|
| 428 | + if($chunk !== false && !empty($chunk)) {
|
|
| 429 | + $content = $chunk; |
|
| 430 | + } elseif(is_file(MODX_BASE_PATH . $target)) {
|
|
| 431 | + $content = file_get_contents(MODX_BASE_PATH . $target); |
|
| 432 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
|
|
| 433 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
| 434 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
| 435 | + {
|
|
| 436 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
| 437 | + } else {
|
|
| 438 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
| 439 | + } |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | // merge placeholders |
@@ -444,8 +444,8 @@ discard block |
||
| 444 | 444 | $content = $modx->mergeSettingsContent($content); |
| 445 | 445 | $content = $modx->parseText($content, $ph); |
| 446 | 446 | if(strpos($content, '[+') !== false) {
|
| 447 | - $modx->toPlaceholders($ph); |
|
| 448 | - $content = $modx->mergePlaceholderContent($content); |
|
| 447 | + $modx->toPlaceholders($ph); |
|
| 448 | + $content = $modx->mergePlaceholderContent($content); |
|
| 449 | 449 | } |
| 450 | 450 | $content = $modx->parseDocumentSource($content); |
| 451 | 451 | $content = $modx->parseText($content, $_lang, '[%', '%]'); |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | $content = $modx->cleanUpMODXTags($content); //cleanup |
| 454 | 454 | |
| 455 | 455 | if($js = $modx->getRegisteredClientScripts()) {
|
| 456 | - $content .= $js; |
|
| 456 | + $content .= $js; |
|
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | echo $content; |
@@ -1,11 +1,11 @@ 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 | |
| 6 | 6 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
| 7 | 7 | |
| 8 | -if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
|
|
| 8 | +if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
|
|
| 9 | 9 | // seems to be a new install - send the user to the configuration page |
| 10 | 10 | exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
|
| 11 | 11 | } |
@@ -16,16 +16,16 @@ discard block |
||
| 16 | 16 | $_SESSION['nrnewmessages'] = 0; |
| 17 | 17 | |
| 18 | 18 | // setup message info |
| 19 | -if($modx->hasPermission('messages')) {
|
|
| 20 | - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
| 19 | +if ($modx->hasPermission('messages')) {
|
|
| 20 | + include_once(MODX_MANAGER_PATH.'includes/messageCount.inc.php'); |
|
| 21 | 21 | $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
| 22 | 22 | $_SESSION['nrnewmessages'] = $nrnewmessages; |
| 23 | 23 | |
| 24 | 24 | $msg = array(); |
| 25 | 25 | $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
|
| 26 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : ''; |
|
| 26 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">'.$_SESSION['nrnewmessages'].'</span>)' : ''; |
|
| 27 | 27 | $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold"> <a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
|
| 28 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0'; |
|
| 28 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">'.$_SESSION['nrnewmessages'].'</span>' : '0'; |
|
| 29 | 29 | $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
| 30 | 30 | $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
|
| 31 | 31 | $ph['MessageInfo'] = implode("\n", $msg);
|
@@ -33,56 +33,56 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $iconTpl = $managerTheme->getPartial('welcome/WrapIcon');
|
| 35 | 35 | // setup icons |
| 36 | -if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
|
|
| 36 | +if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
|
|
| 37 | 37 | $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
| 38 | - $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75); |
|
| 38 | + $ph['SecurityIcon'] = sprintf($iconTpl, $icon, 75); |
|
| 39 | 39 | } |
| 40 | -if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
|
|
| 40 | +if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
|
|
| 41 | 41 | $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
| 42 | - $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99); |
|
| 42 | + $ph['WebUserIcon'] = sprintf($iconTpl, $icon, 99); |
|
| 43 | 43 | } |
| 44 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
|
|
| 44 | +if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
|
|
| 45 | 45 | $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
| 46 | - $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106); |
|
| 46 | + $ph['ModulesIcon'] = sprintf($iconTpl, $icon, 106); |
|
| 47 | 47 | } |
| 48 | -if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
|
|
| 48 | +if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
|
|
| 49 | 49 | $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
| 50 | - $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76); |
|
| 50 | + $ph['ResourcesIcon'] = sprintf($iconTpl, $icon, 76); |
|
| 51 | 51 | } |
| 52 | -if($modx->hasPermission('bk_manager')) {
|
|
| 52 | +if ($modx->hasPermission('bk_manager')) {
|
|
| 53 | 53 | $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
| 54 | - $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93); |
|
| 54 | + $ph['BackupIcon'] = sprintf($iconTpl, $icon, 93); |
|
| 55 | 55 | } |
| 56 | -if($modx->hasPermission('help')) {
|
|
| 56 | +if ($modx->hasPermission('help')) {
|
|
| 57 | 57 | $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
| 58 | - $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9); |
|
| 58 | + $ph['HelpIcon'] = sprintf($iconTpl, $icon, 9); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | -if($modx->hasPermission('new_document')) {
|
|
| 61 | +if ($modx->hasPermission('new_document')) {
|
|
| 62 | 62 | $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
| 63 | - $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4); |
|
| 63 | + $ph['ResourceIcon'] = sprintf($iconTpl, $icon, 4); |
|
| 64 | 64 | $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
| 65 | - $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72); |
|
| 65 | + $ph['WeblinkIcon'] = sprintf($iconTpl, $icon, 72); |
|
| 66 | 66 | } |
| 67 | -if($modx->hasPermission('assets_images')) {
|
|
| 67 | +if ($modx->hasPermission('assets_images')) {
|
|
| 68 | 68 | $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
| 69 | - $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72); |
|
| 69 | + $ph['ImagesIcon'] = sprintf($iconTpl, $icon, 72); |
|
| 70 | 70 | } |
| 71 | -if($modx->hasPermission('assets_files')) {
|
|
| 71 | +if ($modx->hasPermission('assets_files')) {
|
|
| 72 | 72 | $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
| 73 | - $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72); |
|
| 73 | + $ph['FilesIcon'] = sprintf($iconTpl, $icon, 72); |
|
| 74 | 74 | } |
| 75 | -if($modx->hasPermission('change_password')) {
|
|
| 75 | +if ($modx->hasPermission('change_password')) {
|
|
| 76 | 76 | $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
| 77 | - $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28); |
|
| 77 | + $ph['PasswordIcon'] = sprintf($iconTpl, $icon, 28); |
|
| 78 | 78 | } |
| 79 | 79 | $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]'; |
| 80 | -$ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8); |
|
| 80 | +$ph['LogoutIcon'] = sprintf($iconTpl, $icon, 8); |
|
| 81 | 81 | |
| 82 | 82 | // do some config checks |
| 83 | -if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
|
|
| 84 | - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
| 85 | - if($config_check_results != $_lang['configcheck_ok']) {
|
|
| 83 | +if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
|
|
| 84 | + include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php'); |
|
| 85 | + if ($config_check_results != $_lang['configcheck_ok']) {
|
|
| 86 | 86 | $ph['config_check_results'] = $config_check_results; |
| 87 | 87 | $ph['config_display'] = 'block'; |
| 88 | 88 | } else {
|
@@ -93,8 +93,8 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Check logout-reminder |
| 96 | -if(isset($_SESSION['show_logout_reminder'])) {
|
|
| 97 | - switch($_SESSION['show_logout_reminder']['type']) {
|
|
| 96 | +if (isset($_SESSION['show_logout_reminder'])) {
|
|
| 97 | + switch ($_SESSION['show_logout_reminder']['type']) {
|
|
| 98 | 98 | case 'logout_reminder': |
| 99 | 99 | $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
| 100 | 100 | $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
|
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | </tr> |
| 150 | 150 | </table>'; |
| 151 | 151 | |
| 152 | -$nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>'; |
|
| 152 | +$nrnewmessages = '<span class="text-danger">'.$_SESSION['nrnewmessages'].'</span>'; |
|
| 153 | 153 | |
| 154 | 154 | $ph['UserInfo'] = $modx->parseText($tpl, array( |
| 155 | 155 | 'username' => $modx->getLoginUserName(), |
@@ -164,10 +164,10 @@ discard block |
||
| 164 | 164 | $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'"; |
| 165 | 165 | $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
|
| 166 | 166 | |
| 167 | -if($modx->db->getRecordCount($rs) < 1) {
|
|
| 167 | +if ($modx->db->getRecordCount($rs) < 1) {
|
|
| 168 | 168 | $html = '<p>[%no_active_users_found%]</p>'; |
| 169 | 169 | } else {
|
| 170 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
| 170 | + include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php'); |
|
| 171 | 171 | $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
| 172 | 172 | $ph['now'] = strftime('%H:%M:%S', $now);
|
| 173 | 173 | $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $userList = array(); |
| 193 | 193 | $userCount = array(); |
| 194 | 194 | // Create userlist with session-count first before output |
| 195 | - while($activeusers = $modx->db->getRow($rs)) {
|
|
| 195 | + while ($activeusers = $modx->db->getRow($rs)) {
|
|
| 196 | 196 | $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
| 197 | 197 | |
| 198 | 198 | $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
@@ -210,9 +210,9 @@ discard block |
||
| 210 | 210 | $currentaction |
| 211 | 211 | ); |
| 212 | 212 | } |
| 213 | - foreach($userList as $params) {
|
|
| 213 | + foreach ($userList as $params) {
|
|
| 214 | 214 | $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
| 215 | - $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
|
|
| 215 | + $html .= "\n\t\t".vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
|
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | $html .= ' |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $ph['OnlineInfo'] = $html; |
| 225 | 225 | |
| 226 | 226 | // include rss feeds for important forum topics |
| 227 | -include_once(MODX_MANAGER_PATH . 'includes/rss.inc.php'); |
|
| 227 | +include_once(MODX_MANAGER_PATH.'includes/rss.inc.php'); |
|
| 228 | 228 | $ph['modx_security_notices_content'] = $feedData['modx_security_notices_content']; |
| 229 | 229 | $ph['modx_news_content'] = $feedData['modx_news_content']; |
| 230 | 230 | |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | // invoke event OnManagerWelcomePrerender |
| 257 | 257 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
|
| 258 | -if(is_array($evtOut)) {
|
|
| 258 | +if (is_array($evtOut)) {
|
|
| 259 | 259 | $output = implode('', $evtOut);
|
| 260 | 260 | $ph['OnManagerWelcomePrerender'] = $output; |
| 261 | 261 | } |
@@ -385,57 +385,57 @@ discard block |
||
| 385 | 385 | |
| 386 | 386 | // invoke OnManagerWelcomeHome event |
| 387 | 387 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
|
| 388 | -if(is_array($sitewidgets)) {
|
|
| 388 | +if (is_array($sitewidgets)) {
|
|
| 389 | 389 | $newwidgets = array(); |
| 390 | - foreach($sitewidgets as $widget){
|
|
| 390 | + foreach ($sitewidgets as $widget) {
|
|
| 391 | 391 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
| 392 | 392 | } |
| 393 | 393 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | -usort($widgets, function ($a, $b) {
|
|
| 396 | +usort($widgets, function($a, $b){
|
|
| 397 | 397 | return $a['menuindex'] - $b['menuindex']; |
| 398 | 398 | }); |
| 399 | 399 | |
| 400 | 400 | $tpl = $managerTheme->getPartial('welcome/Widget');
|
| 401 | 401 | $output = ''; |
| 402 | -foreach($widgets as $widget) {
|
|
| 403 | - if ($widget['hide'] != '1'){
|
|
| 402 | +foreach ($widgets as $widget) {
|
|
| 403 | + if ($widget['hide'] != '1') {
|
|
| 404 | 404 | $output .= $modx->parseText($tpl, $widget); |
| 405 | 405 | } |
| 406 | 406 | } |
| 407 | 407 | $ph['widgets'] = $output; |
| 408 | 408 | |
| 409 | 409 | // load template |
| 410 | -if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
|
|
| 411 | - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
| 410 | +if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
|
|
| 411 | + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH.'media/style/common/welcome.tpl'; |
|
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | $target = $modx->config['manager_welcome_tpl']; |
| 415 | 415 | $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
|
| 416 | 416 | $target = $modx->mergeSettingsContent($target); |
| 417 | 417 | |
| 418 | -if(substr($target, 0, 1) === '@') {
|
|
| 419 | - if(substr($target, 0, 6) === '@CHUNK') {
|
|
| 418 | +if (substr($target, 0, 1) === '@') {
|
|
| 419 | + if (substr($target, 0, 6) === '@CHUNK') {
|
|
| 420 | 420 | $content = $modx->getChunk(trim(substr($target, 7))); |
| 421 | - } elseif(substr($target, 0, 5) === '@FILE') {
|
|
| 421 | + } elseif (substr($target, 0, 5) === '@FILE') {
|
|
| 422 | 422 | $content = file_get_contents(trim(substr($target, 6))); |
| 423 | 423 | } else {
|
| 424 | 424 | $content = ''; |
| 425 | 425 | } |
| 426 | 426 | } else {
|
| 427 | 427 | $chunk = $modx->getChunk($target); |
| 428 | - if($chunk !== false && !empty($chunk)) {
|
|
| 428 | + if ($chunk !== false && !empty($chunk)) {
|
|
| 429 | 429 | $content = $chunk; |
| 430 | - } elseif(is_file(MODX_BASE_PATH . $target)) {
|
|
| 431 | - $content = file_get_contents(MODX_BASE_PATH . $target); |
|
| 432 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
|
|
| 433 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
| 434 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
| 430 | + } elseif (is_file(MODX_BASE_PATH.$target)) {
|
|
| 431 | + $content = file_get_contents(MODX_BASE_PATH.$target); |
|
| 432 | + } elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl')) {
|
|
| 433 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl'); |
|
| 434 | + } elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html')) // ClipperCMS compatible |
|
| 435 | 435 | {
|
| 436 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
| 436 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html'); |
|
| 437 | 437 | } else {
|
| 438 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
| 438 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/common/welcome.tpl'); |
|
| 439 | 439 | } |
| 440 | 440 | } |
| 441 | 441 | |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | $content = $modx->mergeConditionalTagsContent($content); |
| 444 | 444 | $content = $modx->mergeSettingsContent($content); |
| 445 | 445 | $content = $modx->parseText($content, $ph); |
| 446 | -if(strpos($content, '[+') !== false) {
|
|
| 446 | +if (strpos($content, '[+') !== false) {
|
|
| 447 | 447 | $modx->toPlaceholders($ph); |
| 448 | 448 | $content = $modx->mergePlaceholderContent($content); |
| 449 | 449 | } |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | $content = $modx->parseText($content, $_style, '[&', '&]'); |
| 453 | 453 | $content = $modx->cleanUpMODXTags($content); //cleanup |
| 454 | 454 | |
| 455 | -if($js = $modx->getRegisteredClientScripts()) {
|
|
| 455 | +if ($js = $modx->getRegisteredClientScripts()) {
|
|
| 456 | 456 | $content .= $js; |
| 457 | 457 | } |
| 458 | 458 | |
@@ -1,11 +1,11 @@ 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 | |
| 6 | 6 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
| 7 | 7 | |
| 8 | -if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
|
|
| 8 | +if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
|
| 9 | 9 | // seems to be a new install - send the user to the configuration page |
| 10 | 10 | exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
|
| 11 | 11 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | $_SESSION['nrnewmessages'] = 0; |
| 17 | 17 | |
| 18 | 18 | // setup message info |
| 19 | -if($modx->hasPermission('messages')) {
|
|
| 19 | +if($modx->hasPermission('messages')) { |
|
| 20 | 20 | include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
| 21 | 21 | $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
| 22 | 22 | $_SESSION['nrnewmessages'] = $nrnewmessages; |
@@ -33,46 +33,46 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $iconTpl = $managerTheme->getPartial('welcome/WrapIcon');
|
| 35 | 35 | // setup icons |
| 36 | -if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
|
|
| 36 | +if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
| 37 | 37 | $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
| 38 | 38 | $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75); |
| 39 | 39 | } |
| 40 | -if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
|
|
| 40 | +if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
| 41 | 41 | $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
| 42 | 42 | $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99); |
| 43 | 43 | } |
| 44 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
|
|
| 44 | +if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
| 45 | 45 | $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
| 46 | 46 | $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106); |
| 47 | 47 | } |
| 48 | -if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
|
|
| 48 | +if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { |
|
| 49 | 49 | $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
| 50 | 50 | $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76); |
| 51 | 51 | } |
| 52 | -if($modx->hasPermission('bk_manager')) {
|
|
| 52 | +if($modx->hasPermission('bk_manager')) { |
|
| 53 | 53 | $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
| 54 | 54 | $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93); |
| 55 | 55 | } |
| 56 | -if($modx->hasPermission('help')) {
|
|
| 56 | +if($modx->hasPermission('help')) { |
|
| 57 | 57 | $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
| 58 | 58 | $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | -if($modx->hasPermission('new_document')) {
|
|
| 61 | +if($modx->hasPermission('new_document')) { |
|
| 62 | 62 | $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
| 63 | 63 | $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4); |
| 64 | 64 | $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
| 65 | 65 | $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72); |
| 66 | 66 | } |
| 67 | -if($modx->hasPermission('assets_images')) {
|
|
| 67 | +if($modx->hasPermission('assets_images')) { |
|
| 68 | 68 | $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
| 69 | 69 | $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72); |
| 70 | 70 | } |
| 71 | -if($modx->hasPermission('assets_files')) {
|
|
| 71 | +if($modx->hasPermission('assets_files')) { |
|
| 72 | 72 | $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
| 73 | 73 | $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72); |
| 74 | 74 | } |
| 75 | -if($modx->hasPermission('change_password')) {
|
|
| 75 | +if($modx->hasPermission('change_password')) { |
|
| 76 | 76 | $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
| 77 | 77 | $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28); |
| 78 | 78 | } |
@@ -80,21 +80,21 @@ discard block |
||
| 80 | 80 | $ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8); |
| 81 | 81 | |
| 82 | 82 | // do some config checks |
| 83 | -if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
|
|
| 83 | +if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
| 84 | 84 | include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
| 85 | - if($config_check_results != $_lang['configcheck_ok']) {
|
|
| 85 | + if($config_check_results != $_lang['configcheck_ok']) { |
|
| 86 | 86 | $ph['config_check_results'] = $config_check_results; |
| 87 | 87 | $ph['config_display'] = 'block'; |
| 88 | - } else {
|
|
| 88 | + } else { |
|
| 89 | 89 | $ph['config_display'] = 'none'; |
| 90 | 90 | } |
| 91 | -} else {
|
|
| 91 | +} else { |
|
| 92 | 92 | $ph['config_display'] = 'none'; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Check logout-reminder |
| 96 | -if(isset($_SESSION['show_logout_reminder'])) {
|
|
| 97 | - switch($_SESSION['show_logout_reminder']['type']) {
|
|
| 96 | +if(isset($_SESSION['show_logout_reminder'])) { |
|
| 97 | + switch($_SESSION['show_logout_reminder']['type']) { |
|
| 98 | 98 | case 'logout_reminder': |
| 99 | 99 | $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
| 100 | 100 | $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
|
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | $ph['show_logout_reminder'] = 'block'; |
| 104 | 104 | unset($_SESSION['show_logout_reminder']); |
| 105 | -} else {
|
|
| 105 | +} else { |
|
| 106 | 106 | $ph['show_logout_reminder'] = 'none'; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -164,9 +164,9 @@ discard block |
||
| 164 | 164 | $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'"; |
| 165 | 165 | $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
|
| 166 | 166 | |
| 167 | -if($modx->db->getRecordCount($rs) < 1) {
|
|
| 167 | +if($modx->db->getRecordCount($rs) < 1) { |
|
| 168 | 168 | $html = '<p>[%no_active_users_found%]</p>'; |
| 169 | -} else {
|
|
| 169 | +} else { |
|
| 170 | 170 | include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
| 171 | 171 | $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
| 172 | 172 | $ph['now'] = strftime('%H:%M:%S', $now);
|
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $userList = array(); |
| 193 | 193 | $userCount = array(); |
| 194 | 194 | // Create userlist with session-count first before output |
| 195 | - while($activeusers = $modx->db->getRow($rs)) {
|
|
| 195 | + while($activeusers = $modx->db->getRow($rs)) { |
|
| 196 | 196 | $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
| 197 | 197 | |
| 198 | 198 | $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | $currentaction |
| 211 | 211 | ); |
| 212 | 212 | } |
| 213 | - foreach($userList as $params) {
|
|
| 213 | + foreach($userList as $params) { |
|
| 214 | 214 | $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
| 215 | 215 | $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
|
| 216 | 216 | } |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | // invoke event OnManagerWelcomePrerender |
| 257 | 257 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
|
| 258 | -if(is_array($evtOut)) {
|
|
| 258 | +if(is_array($evtOut)) { |
|
| 259 | 259 | $output = implode('', $evtOut);
|
| 260 | 260 | $ph['OnManagerWelcomePrerender'] = $output; |
| 261 | 261 | } |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
| 361 | 361 | 'hide'=>'0' |
| 362 | 362 | ); |
| 363 | -if ($modx->config['rss_url_news']) {
|
|
| 363 | +if ($modx->config['rss_url_news']) { |
|
| 364 | 364 | $widgets['news'] = array( |
| 365 | 365 | 'menuindex' => '40', |
| 366 | 366 | 'id' => 'news', |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | 'hide'=>'0' |
| 372 | 372 | ); |
| 373 | 373 | } |
| 374 | -if ($modx->config['rss_url_security']) {
|
|
| 374 | +if ($modx->config['rss_url_security']) { |
|
| 375 | 375 | $widgets['security'] = array( |
| 376 | 376 | 'menuindex' => '50', |
| 377 | 377 | 'id' => 'security', |
@@ -385,29 +385,29 @@ discard block |
||
| 385 | 385 | |
| 386 | 386 | // invoke OnManagerWelcomeHome event |
| 387 | 387 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
|
| 388 | -if(is_array($sitewidgets)) {
|
|
| 388 | +if(is_array($sitewidgets)) { |
|
| 389 | 389 | $newwidgets = array(); |
| 390 | - foreach($sitewidgets as $widget){
|
|
| 390 | + foreach($sitewidgets as $widget) { |
|
| 391 | 391 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
| 392 | 392 | } |
| 393 | 393 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | -usort($widgets, function ($a, $b) {
|
|
| 396 | +usort($widgets, function ($a, $b){ |
|
| 397 | 397 | return $a['menuindex'] - $b['menuindex']; |
| 398 | 398 | }); |
| 399 | 399 | |
| 400 | 400 | $tpl = $managerTheme->getPartial('welcome/Widget');
|
| 401 | 401 | $output = ''; |
| 402 | -foreach($widgets as $widget) {
|
|
| 403 | - if ($widget['hide'] != '1'){
|
|
| 402 | +foreach($widgets as $widget) { |
|
| 403 | + if ($widget['hide'] != '1') { |
|
| 404 | 404 | $output .= $modx->parseText($tpl, $widget); |
| 405 | 405 | } |
| 406 | 406 | } |
| 407 | 407 | $ph['widgets'] = $output; |
| 408 | 408 | |
| 409 | 409 | // load template |
| 410 | -if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
|
|
| 410 | +if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
| 411 | 411 | $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
| 412 | 412 | } |
| 413 | 413 | |
@@ -415,26 +415,28 @@ discard block |
||
| 415 | 415 | $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
|
| 416 | 416 | $target = $modx->mergeSettingsContent($target); |
| 417 | 417 | |
| 418 | -if(substr($target, 0, 1) === '@') {
|
|
| 419 | - if(substr($target, 0, 6) === '@CHUNK') {
|
|
| 418 | +if(substr($target, 0, 1) === '@') { |
|
| 419 | + if(substr($target, 0, 6) === '@CHUNK') { |
|
| 420 | 420 | $content = $modx->getChunk(trim(substr($target, 7))); |
| 421 | - } elseif(substr($target, 0, 5) === '@FILE') {
|
|
| 421 | + } elseif(substr($target, 0, 5) === '@FILE') { |
|
| 422 | 422 | $content = file_get_contents(trim(substr($target, 6))); |
| 423 | - } else {
|
|
| 423 | + } else { |
|
| 424 | 424 | $content = ''; |
| 425 | 425 | } |
| 426 | -} else {
|
|
| 426 | +} else { |
|
| 427 | 427 | $chunk = $modx->getChunk($target); |
| 428 | - if($chunk !== false && !empty($chunk)) {
|
|
| 428 | + if($chunk !== false && !empty($chunk)) { |
|
| 429 | 429 | $content = $chunk; |
| 430 | - } elseif(is_file(MODX_BASE_PATH . $target)) {
|
|
| 430 | + } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
| 431 | 431 | $content = file_get_contents(MODX_BASE_PATH . $target); |
| 432 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
|
|
| 432 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
| 433 | 433 | $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
| 434 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
| 434 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) { |
|
| 435 | + // ClipperCMS compatible |
|
| 435 | 436 | {
|
| 436 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
| 437 | - } else {
|
|
| 437 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
| 438 | + } |
|
| 439 | + } else { |
|
| 438 | 440 | $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
| 439 | 441 | } |
| 440 | 442 | } |
@@ -443,7 +445,7 @@ discard block |
||
| 443 | 445 | $content = $modx->mergeConditionalTagsContent($content); |
| 444 | 446 | $content = $modx->mergeSettingsContent($content); |
| 445 | 447 | $content = $modx->parseText($content, $ph); |
| 446 | -if(strpos($content, '[+') !== false) {
|
|
| 448 | +if(strpos($content, '[+') !== false) { |
|
| 447 | 449 | $modx->toPlaceholders($ph); |
| 448 | 450 | $content = $modx->mergePlaceholderContent($content); |
| 449 | 451 | } |
@@ -452,7 +454,7 @@ discard block |
||
| 452 | 454 | $content = $modx->parseText($content, $_style, '[&', '&]'); |
| 453 | 455 | $content = $modx->cleanUpMODXTags($content); //cleanup |
| 454 | 456 | |
| 455 | -if($js = $modx->getRegisteredClientScripts()) {
|
|
| 457 | +if($js = $modx->getRegisteredClientScripts()) { |
|
| 456 | 458 | $content .= $js; |
| 457 | 459 | } |
| 458 | 460 | |
@@ -4,18 +4,18 @@ |
||
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | switch ((int)$modx->manager->action) { |
| 7 | - case 35: |
|
| 8 | - if (!$modx->hasPermission('edit_role')) { |
|
| 9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | - } |
|
| 11 | - break; |
|
| 12 | - case 38: |
|
| 13 | - if (!$modx->hasPermission('new_role')) { |
|
| 7 | + case 35: |
|
| 8 | + if (!$modx->hasPermission('edit_role')) { |
|
| 9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | + } |
|
| 11 | + break; |
|
| 12 | + case 38: |
|
| 13 | + if (!$modx->hasPermission('new_role')) { |
|
| 14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | + } |
|
| 16 | + break; |
|
| 17 | + default: |
|
| 14 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 15 | - } |
|
| 16 | - break; |
|
| 17 | - default: |
|
| 18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -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, |
@@ -21,7 +21,8 @@ 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 | 26 | $modx = evolutionCMS(); global $_lang; |
| 26 | 27 | $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); |
| 27 | 28 | return $modx->parseText($tpl, $ph); |
@@ -31,7 +32,8 @@ discard block |
||
| 31 | 32 | * @param string|int $cssId |
| 32 | 33 | * @return string |
| 33 | 34 | */ |
| 34 | -function renderViewSwitchButtons($cssId) { |
|
| 35 | +function renderViewSwitchButtons($cssId) |
|
| 36 | +{ |
|
| 35 | 37 | $modx = evolutionCMS(); global $_lang, $tpl; |
| 36 | 38 | |
| 37 | 39 | return parsePh($tpl['viewForm'], array( |
@@ -44,7 +46,8 @@ discard block |
||
| 44 | 46 | * @param mgrResources $resources |
| 45 | 47 | * @return string |
| 46 | 48 | */ |
| 47 | -function createResourceList($resourceTable, $resources) { |
|
| 49 | +function createResourceList($resourceTable, $resources) |
|
| 50 | +{ |
|
| 48 | 51 | $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir, $tpl; |
| 49 | 52 | |
| 50 | 53 | $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; |
@@ -97,7 +100,8 @@ discard block |
||
| 97 | 100 | * @param mgrResources $resources |
| 98 | 101 | * @return string |
| 99 | 102 | */ |
| 100 | -function createCombinedView($resources) { |
|
| 103 | +function createCombinedView($resources) |
|
| 104 | +{ |
|
| 101 | 105 | $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir; |
| 102 | 106 | |
| 103 | 107 | $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; |
@@ -154,14 +158,15 @@ discard block |
||
| 154 | 158 | * @param mgrResources $resources |
| 155 | 159 | * @return array |
| 156 | 160 | */ |
| 157 | -function prepareElementRowPh($row, $resourceTable, $resources) { |
|
| 161 | +function prepareElementRowPh($row, $resourceTable, $resources) |
|
| 162 | +{ |
|
| 158 | 163 | $modx = evolutionCMS(); global $modx_textdir, $_style, $_lang; |
| 159 | 164 | |
| 160 | 165 | $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; |
| 161 | 166 | |
| 162 | 167 | $_lang["confirm_delete"] = $_lang["delete"]; |
| 163 | 168 | |
| 164 | - switch($resourceTable){ |
|
| 169 | + switch($resourceTable) { |
|
| 165 | 170 | case 'site_templates': |
| 166 | 171 | $class = $row['selectable'] ? '' : 'disabledPlugin'; |
| 167 | 172 | $lockElementType = 1; |
@@ -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('file_manager')) { |
@@ -9,15 +9,15 @@ discard block |
||
| 9 | 9 | $newToken = makeToken(); |
| 10 | 10 | |
| 11 | 11 | // settings |
| 12 | -$theme_image_path = $modx->config['site_manager_url'] . 'media/style/' . $modx->config['manager_theme'] . '/images/'; |
|
| 12 | +$theme_image_path = $modx->config['site_manager_url'].'media/style/'.$modx->config['manager_theme'].'/images/'; |
|
| 13 | 13 | $excludes = array( |
| 14 | 14 | '.', |
| 15 | 15 | '..', |
| 16 | 16 | '.svn' |
| 17 | 17 | ); |
| 18 | -$alias_suffix = (!empty($friendly_url_suffix)) ? ',' . ltrim($friendly_url_suffix, '.') : ''; |
|
| 19 | -$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess,json,ini' . $alias_suffix); |
|
| 20 | -$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json,ini' . $alias_suffix); |
|
| 18 | +$alias_suffix = (!empty($friendly_url_suffix)) ? ','.ltrim($friendly_url_suffix, '.') : ''; |
|
| 19 | +$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess,json,ini'.$alias_suffix); |
|
| 20 | +$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json,ini'.$alias_suffix); |
|
| 21 | 21 | $viewablefiles = explode(',', 'jpg,gif,png,ico'); |
| 22 | 22 | |
| 23 | 23 | $editablefiles = add_dot($editablefiles); |
@@ -30,31 +30,31 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | */ |
| 32 | 32 | $protected_path[] = $modx->config['site_manager_path']; |
| 33 | -$protected_path[] = $modx->config['base_path'] . 'temp/backup'; |
|
| 34 | -$protected_path[] = $modx->config['base_path'] . 'assets/backup'; |
|
| 33 | +$protected_path[] = $modx->config['base_path'].'temp/backup'; |
|
| 34 | +$protected_path[] = $modx->config['base_path'].'assets/backup'; |
|
| 35 | 35 | |
| 36 | 36 | if (!$modx->hasPermission('save_plugin')) { |
| 37 | - $protected_path[] = $modx->config['base_path'] . 'assets/plugins'; |
|
| 37 | + $protected_path[] = $modx->config['base_path'].'assets/plugins'; |
|
| 38 | 38 | } |
| 39 | 39 | if (!$modx->hasPermission('save_snippet')) { |
| 40 | - $protected_path[] = $modx->config['base_path'] . 'assets/snippets'; |
|
| 40 | + $protected_path[] = $modx->config['base_path'].'assets/snippets'; |
|
| 41 | 41 | } |
| 42 | 42 | if (!$modx->hasPermission('save_template')) { |
| 43 | - $protected_path[] = $modx->config['base_path'] . 'assets/templates'; |
|
| 43 | + $protected_path[] = $modx->config['base_path'].'assets/templates'; |
|
| 44 | 44 | } |
| 45 | 45 | if (!$modx->hasPermission('save_module')) { |
| 46 | - $protected_path[] = $modx->config['base_path'] . 'assets/modules'; |
|
| 46 | + $protected_path[] = $modx->config['base_path'].'assets/modules'; |
|
| 47 | 47 | } |
| 48 | 48 | if (!$modx->hasPermission('empty_cache')) { |
| 49 | - $protected_path[] = $modx->config['base_path'] . 'assets/cache'; |
|
| 49 | + $protected_path[] = $modx->config['base_path'].'assets/cache'; |
|
| 50 | 50 | } |
| 51 | 51 | if (!$modx->hasPermission('import_static')) { |
| 52 | - $protected_path[] = $modx->config['base_path'] . 'temp/import'; |
|
| 53 | - $protected_path[] = $modx->config['base_path'] . 'assets/import'; |
|
| 52 | + $protected_path[] = $modx->config['base_path'].'temp/import'; |
|
| 53 | + $protected_path[] = $modx->config['base_path'].'assets/import'; |
|
| 54 | 54 | } |
| 55 | 55 | if (!$modx->hasPermission('export_static')) { |
| 56 | - $protected_path[] = $modx->config['base_path'] . 'temp/export'; |
|
| 57 | - $protected_path[] = $modx->config['base_path'] . 'assets/export'; |
|
| 56 | + $protected_path[] = $modx->config['base_path'].'temp/export'; |
|
| 57 | + $protected_path[] = $modx->config['base_path'].'assets/export'; |
|
| 58 | 58 | } |
| 59 | 59 | /* |
| 60 | 60 | } |
@@ -96,15 +96,15 @@ discard block |
||
| 96 | 96 | $rw = realpath('../'); |
| 97 | 97 | $webstart_path = str_replace('\\', '/', str_replace($rw, '', $rf)); |
| 98 | 98 | if (substr($webstart_path, 0, 1) == '/') { |
| 99 | - $webstart_path = '..' . $webstart_path; |
|
| 99 | + $webstart_path = '..'.$webstart_path; |
|
| 100 | 100 | } else { |
| 101 | - $webstart_path = '../' . $webstart_path; |
|
| 101 | + $webstart_path = '../'.$webstart_path; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | ?> |
| 105 | 105 | <script type="text/javascript"> |
| 106 | 106 | |
| 107 | - var current_path = '<?= $startpath;?>'; |
|
| 107 | + var current_path = '<?= $startpath; ?>'; |
|
| 108 | 108 | |
| 109 | 109 | function viewfile (url) |
| 110 | 110 | { |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | function unzipFile (file) |
| 141 | 141 | { |
| 142 | 142 | if (confirmUnzip()) { |
| 143 | - window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken;?>"; |
|
| 143 | + window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken; ?>"; |
|
| 144 | 144 | return false; |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | function deleteFolder (folder, status) |
| 163 | 163 | { |
| 164 | 164 | if (confirmDeleteFolder(status)) { |
| 165 | - window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken;?>"; |
|
| 165 | + window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken; ?>"; |
|
| 166 | 166 | return false; |
| 167 | 167 | } |
| 168 | 168 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | function deleteFile (file) |
| 171 | 171 | { |
| 172 | 172 | if (confirmDelete()) { |
| 173 | - window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken;?>"; |
|
| 173 | + window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken; ?>"; |
|
| 174 | 174 | return false; |
| 175 | 175 | } |
| 176 | 176 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | { |
| 180 | 180 | var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file); |
| 181 | 181 | if (newFilename !== null && newFilename !== file) { |
| 182 | - window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>"; |
|
| 182 | + window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>"; |
|
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | { |
| 188 | 188 | var newDirname = prompt("<?= $_lang["files_dynamic_new_folder_name"] ?>", dir); |
| 189 | 189 | if (newDirname !== null && newDirname !== dir) { |
| 190 | - window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken;?>"; |
|
| 190 | + window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken; ?>"; |
|
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | { |
| 196 | 196 | var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file); |
| 197 | 197 | if (newFilename !== null && newFilename !== file) { |
| 198 | - window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>"; |
|
| 198 | + window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>"; |
|
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | <?php endif ?> |
| 215 | 215 | <?php |
| 216 | 216 | if (isset($_GET['mode']) && $_GET['mode'] !== 'drill') { |
| 217 | - $href = 'a=31&path=' . urlencode($_REQUEST['path']); |
|
| 217 | + $href = 'a=31&path='.urlencode($_REQUEST['path']); |
|
| 218 | 218 | } else { |
| 219 | 219 | $href = 'a=2'; |
| 220 | 220 | } |
@@ -224,12 +224,12 @@ discard block |
||
| 224 | 224 | $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFolderName(this);"><i class="[+image+]"></i><span>[+subject+]</span></a>'; |
| 225 | 225 | $ph['image'] = $_style['files_folder-open']; |
| 226 | 226 | $ph['subject'] = $_lang['add_folder']; |
| 227 | - $ph['href'] = 'index.php?a=31&mode=newfolder&path=' . urlencode($startpath) . '&name='; |
|
| 227 | + $ph['href'] = 'index.php?a=31&mode=newfolder&path='.urlencode($startpath).'&name='; |
|
| 228 | 228 | $_ = parsePlaceholder($tpl, $ph); |
| 229 | 229 | |
| 230 | - $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>' . $_lang['files.dynamic.php1'] . '</span></a>'; |
|
| 230 | + $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>'.$_lang['files.dynamic.php1'].'</span></a>'; |
|
| 231 | 231 | $ph['image'] = $_style['files_page_html']; |
| 232 | - $ph['href'] = 'index.php?a=31&mode=newfile&path=' . urlencode($startpath) . '&name='; |
|
| 232 | + $ph['href'] = 'index.php?a=31&mode=newfile&path='.urlencode($startpath).'&name='; |
|
| 233 | 233 | $_ .= parsePlaceholder($tpl, $ph); |
| 234 | 234 | echo $_; |
| 235 | 235 | } |
@@ -259,12 +259,12 @@ discard block |
||
| 259 | 259 | $ph = array(); |
| 260 | 260 | $ph['style_path'] = $theme_image_path; |
| 261 | 261 | // To Top Level with folder icon to the left |
| 262 | - if ($startpath == $filemanager_path || $startpath . '/' == $filemanager_path) { |
|
| 263 | - $ph['image'] = '' . $_style['files_top'] . ''; |
|
| 262 | + if ($startpath == $filemanager_path || $startpath.'/' == $filemanager_path) { |
|
| 263 | + $ph['image'] = ''.$_style['files_top'].''; |
|
| 264 | 264 | $ph['subject'] = '<span>Top</span>'; |
| 265 | 265 | } else { |
| 266 | - $ph['image'] = '' . $_style['files_top'] . ''; |
|
| 267 | - $ph['subject'] = '<a href="index.php?a=31&mode=drill&path=' . $filemanager_path . '">Top</a>/'; |
|
| 266 | + $ph['image'] = ''.$_style['files_top'].''; |
|
| 267 | + $ph['subject'] = '<a href="index.php?a=31&mode=drill&path='.$filemanager_path.'">Top</a>/'; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | echo parsePlaceholder($tpl, $ph); |
@@ -281,12 +281,12 @@ discard block |
||
| 281 | 281 | if (empty($v)) { |
| 282 | 282 | continue; |
| 283 | 283 | } |
| 284 | - $path .= rtrim($v, '/') . '/'; |
|
| 284 | + $path .= rtrim($v, '/').'/'; |
|
| 285 | 285 | if (1 < $count) { |
| 286 | - $href = 'index.php?a=31&mode=drill&path=' . urlencode($filemanager_path . $path); |
|
| 287 | - $pieces[$i] = '<a href="' . $href . '">' . trim($v, '/') . '</a>'; |
|
| 286 | + $href = 'index.php?a=31&mode=drill&path='.urlencode($filemanager_path.$path); |
|
| 287 | + $pieces[$i] = '<a href="'.$href.'">'.trim($v, '/').'</a>'; |
|
| 288 | 288 | } else { |
| 289 | - $pieces[$i] = '<span>' . trim($v, '/') . '</span>'; |
|
| 289 | + $pieces[$i] = '<span>'.trim($v, '/').'</span>'; |
|
| 290 | 290 | } |
| 291 | 291 | $count--; |
| 292 | 292 | } |
@@ -299,16 +299,16 @@ discard block |
||
| 299 | 299 | </div> |
| 300 | 300 | <?php |
| 301 | 301 | // check to see user isn't trying to move below the document_root |
| 302 | - if (substr(strtolower(str_replace('//', '/', $startpath . "/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path . '/'))) { |
|
| 302 | + if (substr(strtolower(str_replace('//', '/', $startpath."/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path.'/'))) { |
|
| 303 | 303 | $modx->webAlertAndQuit($_lang["files_access_denied"]); |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | // Unzip .zip files - by Raymond |
| 307 | 307 | if ($enablefileunzip && $_REQUEST['mode'] == 'unzip' && is_writable($startpath)) { |
| 308 | - if (!$err = unzip(realpath("{$startpath}/" . $_REQUEST['file']), realpath($startpath))) { |
|
| 309 | - echo '<span class="warning"><b>' . $_lang['file_unzip_fail'] . ($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '') . '</b></span><br /><br />'; |
|
| 308 | + if (!$err = unzip(realpath("{$startpath}/".$_REQUEST['file']), realpath($startpath))) { |
|
| 309 | + echo '<span class="warning"><b>'.$_lang['file_unzip_fail'].($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '').'</b></span><br /><br />'; |
|
| 310 | 310 | } else { |
| 311 | - echo '<span class="success"><b>' . $_lang['file_unzip'] . '</b></span><br /><br />'; |
|
| 311 | + echo '<span class="success"><b>'.$_lang['file_unzip'].'</b></span><br /><br />'; |
|
| 312 | 312 | } |
| 313 | 313 | } |
| 314 | 314 | // End Unzip - Raymond |
@@ -320,9 +320,9 @@ discard block |
||
| 320 | 320 | if ($_REQUEST['mode'] == 'deletefolder') { |
| 321 | 321 | $folder = $_REQUEST['folderpath']; |
| 322 | 322 | if (!$token_check || !@rrmdir($folder)) { |
| 323 | - echo '<span class="warning"><b>' . $_lang['file_folder_not_deleted'] . '</b></span><br /><br />'; |
|
| 323 | + echo '<span class="warning"><b>'.$_lang['file_folder_not_deleted'].'</b></span><br /><br />'; |
|
| 324 | 324 | } else { |
| 325 | - echo '<span class="success"><b>' . $_lang['file_folder_deleted'] . '</b></span><br /><br />'; |
|
| 325 | + echo '<span class="success"><b>'.$_lang['file_folder_deleted'].'</b></span><br /><br />'; |
|
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | |
@@ -333,10 +333,10 @@ discard block |
||
| 333 | 333 | if (!mkdirs("{$startpath}/{$foldername}", 0777)) { |
| 334 | 334 | echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />'; |
| 335 | 335 | } else { |
| 336 | - if (!@chmod($startpath . '/' . $foldername, $newfolderaccessmode)) { |
|
| 337 | - echo '<span class="warning"><b>' . $_lang['file_folder_chmod_error'] . '</b></span><br /><br />'; |
|
| 336 | + if (!@chmod($startpath.'/'.$foldername, $newfolderaccessmode)) { |
|
| 337 | + echo '<span class="warning"><b>'.$_lang['file_folder_chmod_error'].'</b></span><br /><br />'; |
|
| 338 | 338 | } else { |
| 339 | - echo '<span class="success"><b>' . $_lang['file_folder_created'] . '</b></span><br /><br />'; |
|
| 339 | + echo '<span class="success"><b>'.$_lang['file_folder_created'].'</b></span><br /><br />'; |
|
| 340 | 340 | } |
| 341 | 341 | } |
| 342 | 342 | umask($old_umask); |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | $filename = $modx->db->escape($filename); |
| 349 | 349 | |
| 350 | 350 | if (!checkExtension($filename)) { |
| 351 | - echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />'; |
|
| 351 | + echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />'; |
|
| 352 | 352 | } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $filename) !== 0) { |
| 353 | 353 | echo $_lang['files.dynamic.php3']; |
| 354 | 354 | } else { |
@@ -370,11 +370,11 @@ discard block |
||
| 370 | 370 | $newFilename = $modx->db->escape($newFilename); |
| 371 | 371 | |
| 372 | 372 | if (!checkExtension($newFilename)) { |
| 373 | - echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />'; |
|
| 373 | + echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />'; |
|
| 374 | 374 | } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) { |
| 375 | 375 | echo $_lang['files.dynamic.php3']; |
| 376 | 376 | } else { |
| 377 | - if (!copy($filename, MODX_BASE_PATH . $newFilename)) { |
|
| 377 | + if (!copy($filename, MODX_BASE_PATH.$newFilename)) { |
|
| 378 | 378 | echo $_lang['files.dynamic.php5']; |
| 379 | 379 | } |
| 380 | 380 | umask($old_umask); |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | // Rename folder here |
| 384 | 384 | if ($_REQUEST['mode'] == 'renameFolder') { |
| 385 | 385 | $old_umask = umask(0); |
| 386 | - $dirname = $_REQUEST['path'] . '/' . $_REQUEST['dirname']; |
|
| 386 | + $dirname = $_REQUEST['path'].'/'.$_REQUEST['dirname']; |
|
| 387 | 387 | $dirname = $modx->db->escape($dirname); |
| 388 | 388 | $newDirname = str_replace(array( |
| 389 | 389 | '..\\', |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | |
| 396 | 396 | if (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newDirname) !== 0) { |
| 397 | 397 | echo $_lang['files.dynamic.php3']; |
| 398 | - } else if (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) { |
|
| 398 | + } else if (!rename($dirname, $_REQUEST['path'].'/'.$newDirname)) { |
|
| 399 | 399 | echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />'; |
| 400 | 400 | } |
| 401 | 401 | umask($old_umask); |
@@ -415,11 +415,11 @@ discard block |
||
| 415 | 415 | $newFilename = $modx->db->escape($newFilename); |
| 416 | 416 | |
| 417 | 417 | if (!checkExtension($newFilename)) { |
| 418 | - echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />'; |
|
| 418 | + echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />'; |
|
| 419 | 419 | } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) { |
| 420 | 420 | echo $_lang['files.dynamic.php3']; |
| 421 | 421 | } else { |
| 422 | - if (!rename($filename, $path . '/' . $newFilename)) { |
|
| 422 | + if (!rename($filename, $path.'/'.$newFilename)) { |
|
| 423 | 423 | echo $_lang['files.dynamic.php5']; |
| 424 | 424 | } |
| 425 | 425 | umask($old_umask); |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | ls($startpath); |
| 453 | 453 | echo "\n\n\n"; |
| 454 | 454 | if ($folders == 0 && $files == 0) { |
| 455 | - echo '<tr><td colspan="4"><i class="' . $_style['files_deleted_folder'] . ' FilesDeletedFolder"></i> <span style="color:#888;cursor:default;"> ' . $_lang['files_directory_is_empty'] . ' </span></td></tr>'; |
|
| 455 | + echo '<tr><td colspan="4"><i class="'.$_style['files_deleted_folder'].' FilesDeletedFolder"></i> <span style="color:#888;cursor:default;"> '.$_lang['files_directory_is_empty'].' </span></td></tr>'; |
|
| 456 | 456 | } |
| 457 | 457 | ?> |
| 458 | 458 | </table> |
@@ -461,10 +461,10 @@ discard block |
||
| 461 | 461 | <div class="container"> |
| 462 | 462 | <p> |
| 463 | 463 | <?php |
| 464 | - echo $_lang['files_directories'] . ': <b>' . $folders . '</b> '; |
|
| 465 | - echo $_lang['files_files'] . ': <b>' . $files . '</b> '; |
|
| 466 | - echo $_lang['files_data'] . ': <b><span dir="ltr">' . $modx->nicesize($filesizes) . '</span></b> '; |
|
| 467 | - echo $_lang['files_dirwritable'] . ' <b>' . (is_writable($startpath) == 1 ? $_lang['yes'] . '.' : $_lang['no']) . '.</b>' |
|
| 464 | + echo $_lang['files_directories'].': <b>'.$folders.'</b> '; |
|
| 465 | + echo $_lang['files_files'].': <b>'.$files.'</b> '; |
|
| 466 | + echo $_lang['files_data'].': <b><span dir="ltr">'.$modx->nicesize($filesizes).'</span></b> '; |
|
| 467 | + echo $_lang['files_dirwritable'].' <b>'.(is_writable($startpath) == 1 ? $_lang['yes'].'.' : $_lang['no']).'.</b>' |
|
| 468 | 468 | ?> |
| 469 | 469 | </p> |
| 470 | 470 | |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | </form> |
| 490 | 490 | <?php |
| 491 | 491 | } else { |
| 492 | - echo "<p>" . $_lang['files_upload_inhibited_msg'] . "</p>"; |
|
| 492 | + echo "<p>".$_lang['files_upload_inhibited_msg']."</p>"; |
|
| 493 | 493 | } |
| 494 | 494 | ?> |
| 495 | 495 | <div id="imageviewer"></div> |
@@ -1,3 +1,5 @@ |
||
| 1 | 1 | <?php namespace EvolutionCMS\Interfaces; |
| 2 | 2 | |
| 3 | -interface ManagerThemeInterface{} |
|
| 3 | +interface ManagerThemeInterface |
|
| 4 | +{ |
|
| 5 | +} |
|
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function makePartial($name) |
| 30 | 30 | { |
| 31 | - return MODX_MANAGER_PATH . sprintf('media/style/%s/partials/%s.tpl', $this->theme, $name); |
|
| 31 | + return MODX_MANAGER_PATH.sprintf('media/style/%s/partials/%s.tpl', $this->theme, $name); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function getPartial($name) |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!function_exists('createList')) { |
|
| 2 | +if (!function_exists('createList')) { |
|
| 3 | 3 | /** |
| 4 | 4 | * @param string $sectionHeader |
| 5 | 5 | * @param array $linkArr |
@@ -7,8 +7,8 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | function createList($sectionHeader, $linkArr) |
| 9 | 9 | { |
| 10 | - $output = '<div class="sectionHeader">' . $sectionHeader . '</div><div class="sectionBody">' . "\n"; |
|
| 11 | - $output .= '<table width="500" border="0" cellspacing="0" cellpadding="0">' . "\n"; |
|
| 10 | + $output = '<div class="sectionHeader">'.$sectionHeader.'</div><div class="sectionBody">'."\n"; |
|
| 11 | + $output .= '<table width="500" border="0" cellspacing="0" cellpadding="0">'."\n"; |
|
| 12 | 12 | $links = ''; |
| 13 | 13 | foreach ($linkArr as $row) { |
| 14 | 14 | if (!is_array($row['link'])) { |
@@ -16,16 +16,16 @@ discard block |
||
| 16 | 16 | } |
| 17 | 17 | foreach ($row['link'] as $link) { |
| 18 | 18 | $links .= $links != '' ? '<br/>' : ''; |
| 19 | - $links .= '<a href="' . $link . '" target="_blank">' . $link . '</a>'; |
|
| 19 | + $links .= '<a href="'.$link.'" target="_blank">'.$link.'</a>'; |
|
| 20 | 20 | } |
| 21 | 21 | $output .= ' |
| 22 | 22 | <tr> |
| 23 | - <td align="left"><strong>' . $row["title"] . '</strong></td> |
|
| 24 | - <td align="left">' . $links . '</td> |
|
| 23 | + <td align="left"><strong>' . $row["title"].'</strong></td> |
|
| 24 | + <td align="left">' . $links.'</td> |
|
| 25 | 25 | </tr>'; |
| 26 | 26 | $links = ''; |
| 27 | 27 | } |
| 28 | - $output .= '</table></div>' . "\n"; |
|
| 28 | + $output .= '</table></div>'."\n"; |
|
| 29 | 29 | |
| 30 | 30 | return $output; |
| 31 | 31 | } |
@@ -16,8 +16,8 @@ |
||
| 16 | 16 | { |
| 17 | 17 | echo '<div class="row form-row"> |
| 18 | 18 | <div class="col-sm-6 col-md-4 col-lg-3">' . |
| 19 | - implode('</div><div class="col-sm-6 col-md-4 col-lg-3">', $evtnames) . |
|
| 20 | - '</div>' . |
|
| 19 | + implode('</div><div class="col-sm-6 col-md-4 col-lg-3">', $evtnames). |
|
| 20 | + '</div>'. |
|
| 21 | 21 | '</div>'; |
| 22 | 22 | |
| 23 | 23 | $evtnames = array(); |