@@ -1,13 +1,13 @@ 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 | -if(!$modx->hasPermission('edit_module')) { |
|
| 6 | +if (!$modx->hasPermission('edit_module')) { |
|
| 7 | 7 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 10 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 11 | 11 | |
| 12 | 12 | // Get table names (alphabetical) |
| 13 | 13 | $tbl_active_users = $modx->getFullTableName('active_users'); |
@@ -24,41 +24,41 @@ discard block |
||
| 24 | 24 | $modx->getManagerApi()->initPageViewState(); |
| 25 | 25 | |
| 26 | 26 | // check to see the editor isn't locked |
| 27 | -$rs = $modx->getDatabase()->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
| 28 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
| 27 | +$rs = $modx->getDatabase()->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
| 28 | +if ($username = $modx->getDatabase()->getValue($rs)) { |
|
| 29 | 29 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); |
| 30 | 30 | } |
| 31 | 31 | // end check for lock |
| 32 | 32 | |
| 33 | 33 | // take action |
| 34 | -switch($_REQUEST['op']) { |
|
| 34 | +switch ($_REQUEST['op']) { |
|
| 35 | 35 | case 'add': |
| 36 | 36 | // convert ids to numbers |
| 37 | 37 | $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); |
| 38 | 38 | |
| 39 | - if(count($opids) > 0) { |
|
| 39 | + if (count($opids) > 0) { |
|
| 40 | 40 | // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs |
| 41 | 41 | $rt = strtolower($_REQUEST["rt"]); |
| 42 | - if($rt == 'chunk') { |
|
| 42 | + if ($rt == 'chunk') { |
|
| 43 | 43 | $type = 10; |
| 44 | 44 | } |
| 45 | - if($rt == 'doc') { |
|
| 45 | + if ($rt == 'doc') { |
|
| 46 | 46 | $type = 20; |
| 47 | 47 | } |
| 48 | - if($rt == 'plug') { |
|
| 48 | + if ($rt == 'plug') { |
|
| 49 | 49 | $type = 30; |
| 50 | 50 | } |
| 51 | - if($rt == 'snip') { |
|
| 51 | + if ($rt == 'snip') { |
|
| 52 | 52 | $type = 40; |
| 53 | 53 | } |
| 54 | - if($rt == 'tpl') { |
|
| 54 | + if ($rt == 'tpl') { |
|
| 55 | 55 | $type = 50; |
| 56 | 56 | } |
| 57 | - if($rt == 'tv') { |
|
| 57 | + if ($rt == 'tv') { |
|
| 58 | 58 | $type = 60; |
| 59 | 59 | } |
| 60 | - $modx->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); |
|
| 61 | - foreach($opids as $opid) { |
|
| 60 | + $modx->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (".implode(',', $opids).") AND type='{$type}'"); |
|
| 61 | + foreach ($opids as $opid) { |
|
| 62 | 62 | $modx->getDatabase()->insert(array( |
| 63 | 63 | 'module' => $id, |
| 64 | 64 | 'resource' => $opid, |
@@ -72,15 +72,15 @@ discard block |
||
| 72 | 72 | $opids = array_filter(array_map('intval', $_REQUEST['depid'])); |
| 73 | 73 | |
| 74 | 74 | // get resources that needs to be removed |
| 75 | - $ds = $modx->getDatabase()->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); |
|
| 75 | + $ds = $modx->getDatabase()->select('*', $tbl_site_module_depobj, "id IN (".implode(",", $opids).")"); |
|
| 76 | 76 | // loop through resources and look for plugins and snippets |
| 77 | 77 | $plids = array(); |
| 78 | 78 | $snid = array(); |
| 79 | - while($row = $modx->getDatabase()->getRow($ds)) { |
|
| 80 | - if($row['type'] == '30') { |
|
| 79 | + while ($row = $modx->getDatabase()->getRow($ds)) { |
|
| 80 | + if ($row['type'] == '30') { |
|
| 81 | 81 | $plids[$i] = $row['resource']; |
| 82 | 82 | } |
| 83 | - if($row['type'] == '40') { |
|
| 83 | + if ($row['type'] == '40') { |
|
| 84 | 84 | $snids[$i] = $row['resource']; |
| 85 | 85 | } |
| 86 | 86 | } |
@@ -88,28 +88,28 @@ discard block |
||
| 88 | 88 | $ds = $modx->getDatabase()->select('guid', $tbl_site_modules, "id='{$id}'"); |
| 89 | 89 | $guid = $modx->getDatabase()->getValue($ds); |
| 90 | 90 | // reset moduleguid for deleted resources |
| 91 | - if(($cp = count($plids)) || ($cs = count($snids))) { |
|
| 92 | - if($cp) { |
|
| 93 | - $modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); |
|
| 91 | + if (($cp = count($plids)) || ($cs = count($snids))) { |
|
| 92 | + if ($cp) { |
|
| 93 | + $modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $plids).") AND moduleguid='{$guid}'"); |
|
| 94 | 94 | } |
| 95 | - if($cs) { |
|
| 96 | - $modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); |
|
| 95 | + if ($cs) { |
|
| 96 | + $modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $snids).") AND moduleguid='{$guid}'"); |
|
| 97 | 97 | } |
| 98 | 98 | // reset cache |
| 99 | 99 | $modx->clearCache('full'); |
| 100 | 100 | } |
| 101 | - $modx->getDatabase()->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); |
|
| 101 | + $modx->getDatabase()->delete($tbl_site_module_depobj, "id IN (".implode(',', $opids).")"); |
|
| 102 | 102 | break; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | // load record |
| 106 | 106 | $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id = '{$id}'"); |
| 107 | 107 | $content = $modx->getDatabase()->getRow($rs); |
| 108 | -if(!$content) { |
|
| 108 | +if (!$content) { |
|
| 109 | 109 | $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
| 110 | 110 | } |
| 111 | 111 | $_SESSION['itemname'] = $content['name']; |
| 112 | -if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
| 112 | +if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
| 113 | 113 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -188,13 +188,13 @@ discard block |
||
| 188 | 188 | <input type="hidden" name="id" value="<?php echo $content['id']; ?>" /> |
| 189 | 189 | |
| 190 | 190 | <h1> |
| 191 | - <i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['module_resource_title']) ?> |
|
| 191 | + <i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['module_resource_title']) ?> |
|
| 192 | 192 | </h1> |
| 193 | 193 | |
| 194 | 194 | <?php echo $_style['actionbuttons']['dynamic']['close'] ?> |
| 195 | 195 | |
| 196 | 196 | <div class="section"> |
| 197 | - <div class="sectionHeader"><?php echo $content["name"] . " - " . $_lang['module_resource_title']; ?></div> |
|
| 197 | + <div class="sectionHeader"><?php echo $content["name"]." - ".$_lang['module_resource_title']; ?></div> |
|
| 198 | 198 | <div class="sectionBody"> |
| 199 | 199 | <p><?php echo $_lang['module_resource_msg']; ?></p> |
| 200 | 200 | <br /> |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $grd->columnHeaderClass = "gridHeader"; |
| 225 | 225 | $grd->itemClass = "gridItem"; |
| 226 | 226 | $grd->altItemClass = "gridAltItem"; |
| 227 | - $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; |
|
| 227 | + $grd->columns = $_lang["element_name"]." ,".$_lang["type"]; |
|
| 228 | 228 | $grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]"; |
| 229 | 229 | $grd->fields = "name,type"; |
| 230 | 230 | echo $grd->render(); |
@@ -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('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) {
|
@@ -107,22 +107,22 @@ discard block |
||
| 107 | 107 | <div class="table-responsive"> |
| 108 | 108 | <?php |
| 109 | 109 | if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
|
| 110 | - $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"' . $_lang['yes'] . '","-") as disabled, IF(sm.icon<>"",sm.icon,"' . $_style['icons_modules'] . '") as icon
|
|
| 111 | - FROM ' . $modx->getFullTableName('site_modules') . ' AS sm
|
|
| 112 | - LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id
|
|
| 113 | - LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group
|
|
| 114 | - WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
|
| 110 | + $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"'.$_lang['yes'].'","-") as disabled, IF(sm.icon<>"",sm.icon,"'.$_style['icons_modules'].'") as icon
|
|
| 111 | + FROM ' . $modx->getFullTableName('site_modules').' AS sm
|
|
| 112 | + LEFT JOIN ' . $modx->getFullTableName('site_module_access').' AS sma ON sma.module = sm.id
|
|
| 113 | + LEFT JOIN ' . $modx->getFullTableName('member_groups').' AS mg ON sma.usergroup = mg.user_group
|
|
| 114 | + WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID().') AND sm.disabled != 1 AND sm.locked != 1 |
|
| 115 | 115 | ORDER BY sm.name'); |
| 116 | 116 | if ($modx->hasPermission('edit_module')) {
|
| 117 | - $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
|
| 117 | + $title = "<a href='index.php?a=108&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>"; |
|
| 118 | 118 | } else if ($modx->hasPermission('exec_module')) {
|
| 119 | - $title = "<a href='index.php?a=112&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
|
| 119 | + $title = "<a href='index.php?a=112&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>"; |
|
| 120 | 120 | } else {
|
| 121 | 121 | $title = '[+value+]'; |
| 122 | 122 | } |
| 123 | 123 | } else {
|
| 124 | 124 | $rs = $modx->getDatabase()->select("id, name, description, IF(locked,'{$_lang['yes']}','-') as locked, IF(disabled,'{$_lang['yes']}','-') as disabled, IF(icon<>'',icon,'{$_style['icons_module']}') as icon", $modx->getFullTableName("site_modules"), (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "name");
|
| 125 | - $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
|
| 125 | + $title = "<a href='index.php?a=108&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>"; |
|
| 126 | 126 | } |
| 127 | 127 | $grd = new \EvolutionCMS\Support\DataGrid('', $rs, $number_of_results); // set page size to 0 t show all items
|
| 128 | 128 | $grd->noRecordMsg = $_lang["no_records_found"]; |
@@ -131,10 +131,10 @@ discard block |
||
| 131 | 131 | $grd->itemClass = "tableItem"; |
| 132 | 132 | $grd->altItemClass = "tableAltItem"; |
| 133 | 133 | $grd->fields = "icon,name,description,locked,disabled"; |
| 134 | - $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["description"] . " ," . $_lang["locked"] . " ," . $_lang["disabled"]; |
|
| 134 | + $grd->columns = $_lang["icon"]." ,".$_lang["name"]." ,".$_lang["description"]." ,".$_lang["locked"]." ,".$_lang["disabled"]; |
|
| 135 | 135 | $grd->colWidths = "34,,,60,60"; |
| 136 | 136 | $grd->colAligns = "center,,,center,center"; |
| 137 | - $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='[+value+]'></i></a>||template:" . $title; |
|
| 137 | + $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang["click_to_context"]."'><i class='[+value+]'></i></a>||template:".$title; |
|
| 138 | 138 | if ($listmode == '1') {
|
| 139 | 139 | $grd->pageSize = 0; |
| 140 | 140 | } |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) {
|
|
| 5 | +if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | $modx->getManagerApi()->initPageViewState(); |
| 11 | 11 | |
| 12 | 12 | // get and save search string |
| 13 | -if ($_REQUEST['op'] == 'reset') {
|
|
| 13 | +if ($_REQUEST['op'] == 'reset') { |
|
| 14 | 14 | $query = ''; |
| 15 | 15 | $_PAGE['vs']['search'] = ''; |
| 16 | -} else {
|
|
| 16 | +} else { |
|
| 17 | 17 | $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
| 18 | 18 | $sqlQuery = $modx->getDatabase()->escape($query); |
| 19 | 19 | $_PAGE['vs']['search'] = $query; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | // context menu |
| 28 | 28 | $cm = new \EvolutionCMS\Support\ContextMenu("cntxm", 150);
|
| 29 | 29 | $cm->addItem($_lang["run_module"], "js:menuAction(1)", $_style['actions_run'], (!$modx->hasPermission('exec_module') ? 1 : 0));
|
| 30 | -if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) {
|
|
| 30 | +if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) { |
|
| 31 | 31 | $cm->addSeparator(); |
| 32 | 32 | } |
| 33 | 33 | $cm->addItem($_lang["edit"], "js:menuAction(2)", $_style['actions_edit'], (!$modx->hasPermission('edit_module') ? 1 : 0));
|
@@ -106,21 +106,21 @@ discard block |
||
| 106 | 106 | <div class="tab-page"> |
| 107 | 107 | <div class="table-responsive"> |
| 108 | 108 | <?php |
| 109 | - if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
|
|
| 109 | + if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
| 110 | 110 | $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"' . $_lang['yes'] . '","-") as disabled, IF(sm.icon<>"",sm.icon,"' . $_style['icons_modules'] . '") as icon
|
| 111 | 111 | FROM ' . $modx->getFullTableName('site_modules') . ' AS sm
|
| 112 | 112 | LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id
|
| 113 | 113 | LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group
|
| 114 | 114 | WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
| 115 | 115 | ORDER BY sm.name'); |
| 116 | - if ($modx->hasPermission('edit_module')) {
|
|
| 116 | + if ($modx->hasPermission('edit_module')) { |
|
| 117 | 117 | $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
| 118 | - } else if ($modx->hasPermission('exec_module')) {
|
|
| 118 | + } else if ($modx->hasPermission('exec_module')) { |
|
| 119 | 119 | $title = "<a href='index.php?a=112&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
| 120 | - } else {
|
|
| 120 | + } else { |
|
| 121 | 121 | $title = '[+value+]'; |
| 122 | 122 | } |
| 123 | - } else {
|
|
| 123 | + } else { |
|
| 124 | 124 | $rs = $modx->getDatabase()->select("id, name, description, IF(locked,'{$_lang['yes']}','-') as locked, IF(disabled,'{$_lang['yes']}','-') as disabled, IF(icon<>'',icon,'{$_style['icons_module']}') as icon", $modx->getFullTableName("site_modules"), (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "name");
|
| 125 | 125 | $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
| 126 | 126 | } |
@@ -135,10 +135,10 @@ discard block |
||
| 135 | 135 | $grd->colWidths = "34,,,60,60"; |
| 136 | 136 | $grd->colAligns = "center,,,center,center"; |
| 137 | 137 | $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='[+value+]'></i></a>||template:" . $title; |
| 138 | - if ($listmode == '1') {
|
|
| 138 | + if ($listmode == '1') { |
|
| 139 | 139 | $grd->pageSize = 0; |
| 140 | 140 | } |
| 141 | - if ($_REQUEST['op'] == 'reset') {
|
|
| 141 | + if ($_REQUEST['op'] == 'reset') { |
|
| 142 | 142 | $grd->pageNumber = 1; |
| 143 | 143 | } |
| 144 | 144 | // render grid |
@@ -1,22 +1,22 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -switch($modx->getManagerApi()->action) {
|
|
| 5 | +switch ($modx->getManagerApi()->action) {
|
|
| 6 | 6 | case 107: |
| 7 | - if(!$modx->hasPermission('new_module')) {
|
|
| 7 | + if (!$modx->hasPermission('new_module')) {
|
|
| 8 | 8 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 9 | 9 | } |
| 10 | 10 | break; |
| 11 | 11 | case 108: |
| 12 | - if(!$modx->hasPermission('edit_module')) {
|
|
| 12 | + if (!$modx->hasPermission('edit_module')) {
|
|
| 13 | 13 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 14 | 14 | } |
| 15 | 15 | break; |
| 16 | 16 | default: |
| 17 | 17 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 18 | 18 | } |
| 19 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 19 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 20 | 20 | // Get table names (alphabetical) |
| 21 | 21 | $tbl_membergroup_names = $modx->getFullTableName('membergroup_names');
|
| 22 | 22 | $tbl_site_content = $modx->getFullTableName('site_content');
|
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | // check to see the module editor isn't locked |
| 34 | -if($lockedEl = $modx->elementIsLocked(6, $id)) {
|
|
| 34 | +if ($lockedEl = $modx->elementIsLocked(6, $id)) {
|
|
| 35 | 35 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
| 36 | 36 | } |
| 37 | 37 | // end check for lock |
@@ -39,29 +39,29 @@ discard block |
||
| 39 | 39 | // Lock snippet for other users to edit |
| 40 | 40 | $modx->lockElement(6, $id); |
| 41 | 41 | |
| 42 | -if(isset($_GET['id'])) {
|
|
| 42 | +if (isset($_GET['id'])) {
|
|
| 43 | 43 | $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'");
|
| 44 | 44 | $content = $modx->getDatabase()->getRow($rs); |
| 45 | - if(!$content) {
|
|
| 45 | + if (!$content) {
|
|
| 46 | 46 | $modx->webAlertAndQuit("Module not found for id '{$id}'.");
|
| 47 | 47 | } |
| 48 | 48 | $content['properties'] = str_replace("&", "&", $content['properties']);
|
| 49 | 49 | $_SESSION['itemname'] = $content['name']; |
| 50 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
|
|
| 50 | + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
|
|
| 51 | 51 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 52 | 52 | } |
| 53 | 53 | } else {
|
| 54 | 54 | $_SESSION['itemname'] = $_lang["new_module"]; |
| 55 | 55 | $content['wrap'] = '1'; |
| 56 | 56 | } |
| 57 | -if($modx->getManagerApi()->hasFormValues()) {
|
|
| 57 | +if ($modx->getManagerApi()->hasFormValues()) {
|
|
| 58 | 58 | $modx->getManagerApi()->loadFormValues(); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | // Add lock-element JS-Script |
| 62 | 62 | $lockElementId = $id; |
| 63 | 63 | $lockElementType = 6; |
| 64 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
| 64 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
| 65 | 65 | ?> |
| 66 | 66 | <script type="text/javascript"> |
| 67 | 67 | function loadDependencies() {
|
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | function BrowseServer() {
|
| 409 | 409 | var w = screen.width * 0.7; |
| 410 | 410 | var h = screen.height * 0.7; |
| 411 | - OpenServerBrowser("<?= MODX_MANAGER_URL;?>media/browser/<?= $which_browser;?>/browser.php?Type=images", w, h);
|
|
| 411 | + OpenServerBrowser("<?= MODX_MANAGER_URL; ?>media/browser/<?= $which_browser; ?>/browser.php?Type=images", w, h);
|
|
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | function SetUrl(url, width, height, alt) {
|
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | <?php |
| 429 | 429 | // invoke OnModFormPrerender event |
| 430 | 430 | $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
|
| 431 | - if(is_array($evtOut)) {
|
|
| 431 | + if (is_array($evtOut)) {
|
|
| 432 | 432 | echo implode('', $evtOut);
|
| 433 | 433 | } |
| 434 | 434 | |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | <input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>"> |
| 443 | 443 | |
| 444 | 444 | <h1> |
| 445 | - <i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i>
|
|
| 445 | + <i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i>
|
|
| 446 | 446 | </h1> |
| 447 | 447 | |
| 448 | 448 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -467,8 +467,8 @@ discard block |
||
| 467 | 467 | <div class="col-md-9 col-lg-10"> |
| 468 | 468 | <div class="form-control-name clearfix"> |
| 469 | 469 | <input name="name" type="text" maxlength="100" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
| 470 | - <?php if($modx->hasPermission('save_role')): ?>
|
|
| 471 | - <label class="custom-control" title="<?= $_lang['lock_module'] . "\n" . $_lang['lock_module_msg'] ?>" tooltip> |
|
| 470 | + <?php if ($modx->hasPermission('save_role')): ?>
|
|
| 471 | + <label class="custom-control" title="<?= $_lang['lock_module']."\n".$_lang['lock_module_msg'] ?>" tooltip> |
|
| 472 | 472 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
| 473 | 473 | <i class="fa fa-lock"></i> |
| 474 | 474 | </label> |
@@ -490,9 +490,9 @@ discard block |
||
| 490 | 490 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
| 491 | 491 | <option> </option> |
| 492 | 492 | <?php |
| 493 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 494 | - foreach(getCategories() as $n => $v) {
|
|
| 495 | - echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n"; |
|
| 493 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 494 | + foreach (getCategories() as $n => $v) {
|
|
| 495 | + echo "\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($v['category'])."</option>\n"; |
|
| 496 | 496 | } |
| 497 | 497 | ?> |
| 498 | 498 | </select> |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | <div class="form-group"> |
| 525 | 525 | <div class="form-row"> |
| 526 | 526 | <label for="disabled"><input name="disabled" id="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> |
| 527 | - <?= ($content['disabled'] == 1 ? '<span class="text-danger">' . $_lang['module_disabled'] . '</span>' : $_lang['module_disabled']) ?></label> |
|
| 527 | + <?= ($content['disabled'] == 1 ? '<span class="text-danger">'.$_lang['module_disabled'].'</span>' : $_lang['module_disabled']) ?></label> |
|
| 528 | 528 | </div> |
| 529 | 529 | <div class="form-row"> |
| 530 | 530 | <label for="parse_docblock"> |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | </div> |
| 590 | 590 | <!-- HTML text editor end --> |
| 591 | 591 | </div> |
| 592 | - <?php if($modx->getManagerApi()->action == '108'): ?> |
|
| 592 | + <?php if ($modx->getManagerApi()->action == '108'): ?> |
|
| 593 | 593 | <!-- Dependencies --> |
| 594 | 594 | <div class="tab-page" id="tabDepend"> |
| 595 | 595 | <h2 class="tab"><?= $_lang['settings_dependencies'] ?></h2> |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | $grd->columnHeaderClass = 'gridHeader'; |
| 624 | 624 | $grd->itemClass = 'gridItem'; |
| 625 | 625 | $grd->altItemClass = 'gridAltItem'; |
| 626 | - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
| 626 | + $grd->columns = $_lang['element_name']." ,".$_lang['type']; |
|
| 627 | 627 | $grd->fields = "name,type"; |
| 628 | 628 | echo $grd->render(); |
| 629 | 629 | ?> |
@@ -636,13 +636,13 @@ discard block |
||
| 636 | 636 | <h2 class="tab"><?= $_lang['access_permissions'] ?></h2> |
| 637 | 637 | <script type="text/javascript">tp.addTabPage(document.getElementById("tabPermissions"));</script>
|
| 638 | 638 | <div class="container container-body"> |
| 639 | - <?php if($use_udperms == 1) : ?> |
|
| 639 | + <?php if ($use_udperms == 1) : ?> |
|
| 640 | 640 | <?php |
| 641 | 641 | // fetch user access permissions for the module |
| 642 | 642 | $rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'");
|
| 643 | 643 | $groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs);
|
| 644 | 644 | |
| 645 | - if($modx->hasPermission('access_permissions')) {
|
|
| 645 | + if ($modx->hasPermission('access_permissions')) {
|
|
| 646 | 646 | ?> |
| 647 | 647 | <!-- User Group Access Permissions --> |
| 648 | 648 | <script type="text/javascript"> |
@@ -670,22 +670,22 @@ discard block |
||
| 670 | 670 | } |
| 671 | 671 | $chk = ''; |
| 672 | 672 | $rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name');
|
| 673 | - while($row = $modx->getDatabase()->getRow($rs)) {
|
|
| 673 | + while ($row = $modx->getDatabase()->getRow($rs)) {
|
|
| 674 | 674 | $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
| 675 | 675 | $checked = in_array($row['id'], $groupsarray); |
| 676 | - if($modx->hasPermission('access_permissions')) {
|
|
| 677 | - if($checked) {
|
|
| 676 | + if ($modx->hasPermission('access_permissions')) {
|
|
| 677 | + if ($checked) {
|
|
| 678 | 678 | $notPublic = true; |
| 679 | 679 | } |
| 680 | - $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
| 680 | + $chks .= '<label><input type="checkbox" name="usrgroups[]" value="'.$row['id'].'"'.($checked ? ' checked="checked"' : '').' onclick="makePublic(false)" /> '.$row['name']."</label><br />\n"; |
|
| 681 | 681 | } else {
|
| 682 | - if($checked) {
|
|
| 683 | - $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
| 682 | + if ($checked) {
|
|
| 683 | + $chks = '<input type="hidden" name="usrgroups[]" value="'.$row['id'].'" />'."\n".$chks; |
|
| 684 | 684 | } |
| 685 | 685 | } |
| 686 | 686 | } |
| 687 | - if($modx->hasPermission('access_permissions')) {
|
|
| 688 | - $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
|
| 687 | + if ($modx->hasPermission('access_permissions')) {
|
|
| 688 | + $chks = '<label><input type="checkbox" name="chkallgroups"'.(!$notPublic ? ' checked="checked"' : '').' onclick="makePublic(true)" /><span class="warning"> '.$_lang['all_usr_groups'].'</span></label><br />'."\n".$chks; |
|
| 689 | 689 | } |
| 690 | 690 | echo $chks; |
| 691 | 691 | ?> |
@@ -706,7 +706,7 @@ discard block |
||
| 706 | 706 | <?php |
| 707 | 707 | // invoke OnModFormRender event |
| 708 | 708 | $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
|
| 709 | - if(is_array($evtOut)) {
|
|
| 709 | + if (is_array($evtOut)) {
|
|
| 710 | 710 | echo implode('', $evtOut);
|
| 711 | 711 | } |
| 712 | 712 | ?> |
@@ -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('edit_module')) { |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | -include_once MODX_MANAGER_PATH . "includes/header.inc.php"; |
|
| 66 | +include_once MODX_MANAGER_PATH."includes/header.inc.php"; |
|
| 67 | 67 | ?> |
| 68 | 68 | <script language="JavaScript" type="text/javascript"> |
| 69 | 69 | function saveSelection() |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | </script> |
| 139 | 139 | |
| 140 | 140 | <h1> |
| 141 | - <?= $title . " - " . $_lang['element_selector_title'] ?><i class="fa fa-question-circle help"></i> |
|
| 141 | + <?= $title." - ".$_lang['element_selector_title'] ?><i class="fa fa-question-circle help"></i> |
|
| 142 | 142 | </h1> |
| 143 | 143 | |
| 144 | 144 | <div id="actions"> |
@@ -183,8 +183,8 @@ discard block |
||
| 183 | 183 | $grd->columnHeaderClass = "tableHeader"; |
| 184 | 184 | $grd->itemClass = "tableItem"; |
| 185 | 185 | $grd->altItemClass = "tableAltItem"; |
| 186 | - $grd->columns = $_lang["name"] . " ," . $_lang["description"]; |
|
| 187 | - $grd->colTypes = "template:<input type='" . ($sm == 'm' ? 'checkbox' : 'radio') . "' name='id[]' value='[+id+]' onclick='setCheckbox(this);'> [+value+]"; |
|
| 186 | + $grd->columns = $_lang["name"]." ,".$_lang["description"]; |
|
| 187 | + $grd->colTypes = "template:<input type='".($sm == 'm' ? 'checkbox' : 'radio')."' name='id[]' value='[+id+]' onclick='setCheckbox(this);'> [+value+]"; |
|
| 188 | 188 | $grd->colWidths = "45%"; |
| 189 | 189 | $grd->fields = "name,description"; |
| 190 | 190 | if ($_REQUEST['listmode'] == '1') { |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('edit_web_user')) { |
|
| 5 | +if (!$modx->hasPermission('edit_web_user')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | $modx->getManagerApi()->initPageViewState(); |
| 11 | 11 | |
| 12 | 12 | // get and save search string |
| 13 | -if($_REQUEST['op'] == 'reset') { |
|
| 13 | +if ($_REQUEST['op'] == 'reset') { |
|
| 14 | 14 | $query = ''; |
| 15 | 15 | $_PAGE['vs']['search'] = ''; |
| 16 | 16 | } else { |
@@ -119,8 +119,8 @@ discard block |
||
| 119 | 119 | <div class="row"> |
| 120 | 120 | <div class="table-responsive"> |
| 121 | 121 | <?php |
| 122 | - $ds = $modx->getDatabase()->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu |
|
| 123 | - INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username'); |
|
| 122 | + $ds = $modx->getDatabase()->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users")." wu |
|
| 123 | + INNER JOIN " . $modx->getFullTableName("web_user_attributes")." wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username'); |
|
| 124 | 124 | $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items |
| 125 | 125 | $grd->noRecordMsg = $_lang["no_records_found"]; |
| 126 | 126 | $grd->cssClass = "table data"; |
@@ -128,15 +128,15 @@ discard block |
||
| 128 | 128 | $grd->itemClass = "tableItem"; |
| 129 | 129 | $grd->altItemClass = "tableAltItem"; |
| 130 | 130 | $grd->fields = "id,username,fullname,email,lastlogin,logincount,blocked"; |
| 131 | - $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"]; |
|
| 131 | + $grd->columns = $_lang["icon"]." ,".$_lang["name"]." ,".$_lang["user_full_name"]." ,".$_lang["email"]." ,".$_lang["user_prevlogin"]." ,".$_lang["user_logincount"]." ,".$_lang["user_block"]; |
|
| 132 | 132 | $grd->colWidths = "1%,,,,1%,1%,1%"; |
| 133 | 133 | $grd->colAligns = "center,,,,right' nowrap='nowrap,right,center"; |
| 134 | - $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . |
|
| 134 | + $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang["click_to_context"]."'><i class='".$_style["icons_user"]."'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='".$_lang["click_to_edit_title"]."'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: ".$modx->toDateFormat('[+thislogin+]', 'formatOnly'). |
|
| 135 | 135 | " %H:%M"; |
| 136 | - if($listmode == '1') { |
|
| 136 | + if ($listmode == '1') { |
|
| 137 | 137 | $grd->pageSize = 0; |
| 138 | 138 | } |
| 139 | - if($_REQUEST['op'] == 'reset') { |
|
| 139 | + if ($_REQUEST['op'] == 'reset') { |
|
| 140 | 140 | $grd->pageNumber = 1; |
| 141 | 141 | } |
| 142 | 142 | // render grid |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('edit_user')) { |
|
| 5 | +if (!$modx->hasPermission('edit_user')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | $modx->getManagerApi()->initPageViewState(); |
| 11 | 11 | |
| 12 | 12 | // get and save search string |
| 13 | -if($_REQUEST['op'] == 'reset') { |
|
| 13 | +if ($_REQUEST['op'] == 'reset') { |
|
| 14 | 14 | $query = ''; |
| 15 | 15 | $_PAGE['vs']['search'] = ''; |
| 16 | 16 | } else { |
@@ -120,15 +120,15 @@ discard block |
||
| 120 | 120 | <div class="table-responsive"> |
| 121 | 121 | <?php |
| 122 | 122 | $where = ""; |
| 123 | - if(!$modx->hasPermission('save_role')) { |
|
| 124 | - $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; |
|
| 123 | + if (!$modx->hasPermission('save_role')) { |
|
| 124 | + $where .= (empty($where) ? "" : " AND ")."mua.role != 1"; |
|
| 125 | 125 | } |
| 126 | - if(!empty($sqlQuery)) { |
|
| 127 | - $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; |
|
| 126 | + if (!empty($sqlQuery)) { |
|
| 127 | + $where .= (empty($where) ? "" : " AND ")."((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; |
|
| 128 | 128 | } |
| 129 | - $ds = $modx->getDatabase()->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu |
|
| 130 | - INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id |
|
| 131 | - LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC'); |
|
| 129 | + $ds = $modx->getDatabase()->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users')." AS mu |
|
| 130 | + INNER JOIN " . $modx->getFullTableName('user_attributes')." AS mua ON mua.internalKey=mu.id |
|
| 131 | + LEFT JOIN " . $modx->getFullTableName('user_roles')." AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC'); |
|
| 132 | 132 | $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items |
| 133 | 133 | $grd->noRecordMsg = $_lang["no_records_found"]; |
| 134 | 134 | $grd->cssClass = "table data"; |
@@ -149,19 +149,19 @@ discard block |
||
| 149 | 149 | $grd->colWidths = "1%,,,,,1%,1%,1%"; |
| 150 | 150 | $grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center"; |
| 151 | 151 | $grd->colTypes = implode('||', array( |
| 152 | - 'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>', |
|
| 153 | - 'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>', |
|
| 152 | + 'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="'.$_lang['click_to_context'].'"><i class="'.$_style['icons_user'].'"></i></a>', |
|
| 153 | + 'template:<a href="index.php?a=12&id=[+id+]" title="'.$_lang['click_to_edit_title'].'">[+value+]</a>', |
|
| 154 | 154 | 'template:[+fullname+]', |
| 155 | 155 | 'template:[+role+]', |
| 156 | 156 | 'template:[+email+]', |
| 157 | - 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M', |
|
| 157 | + 'date: '.$modx->toDateFormat('[+thislogin+]', 'formatOnly').' %H:%M', |
|
| 158 | 158 | 'template:[+logincount+]', |
| 159 | 159 | 'template:[+blocked+]' |
| 160 | 160 | )); |
| 161 | - if($listmode == '1') { |
|
| 161 | + if ($listmode == '1') { |
|
| 162 | 162 | $grd->pageSize = 0; |
| 163 | 163 | } |
| 164 | - if($_REQUEST['op'] == 'reset') { |
|
| 164 | + if ($_REQUEST['op'] == 'reset') { |
|
| 165 | 165 | $grd->pageNumber = 1; |
| 166 | 166 | } |
| 167 | 167 | // render grid |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('view_eventlog')) {
|
|
| 5 | +if (!$modx->hasPermission('view_eventlog')) {
|
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -15,12 +15,12 @@ discard block |
||
| 15 | 15 | $modx->getManagerApi()->initPageViewState(); |
| 16 | 16 | |
| 17 | 17 | // get and save search string |
| 18 | -if($_REQUEST['op'] == 'reset') {
|
|
| 18 | +if ($_REQUEST['op'] == 'reset') {
|
|
| 19 | 19 | $sqlQuery = $query = ''; |
| 20 | 20 | $_PAGE['vs']['search'] = ''; |
| 21 | 21 | } else {
|
| 22 | 22 | $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
| 23 | - if(!is_numeric($sqlQuery)) {
|
|
| 23 | + if (!is_numeric($sqlQuery)) {
|
|
| 24 | 24 | $sqlQuery = $modx->getDatabase()->escape($query); |
| 25 | 25 | } |
| 26 | 26 | $_PAGE['vs']['search'] = $query; |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | <?php |
| 127 | 127 | $ds = $modx->getDatabase()->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el
|
| 128 | 128 | LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0
|
| 129 | - LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC");
|
|
| 129 | + LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "".(is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '')."(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC");
|
|
| 130 | 130 | $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
|
| 131 | 131 | $grd->pagerClass = ''; |
| 132 | 132 | $grd->pageClass = 'page-item'; |
@@ -137,14 +137,14 @@ discard block |
||
| 137 | 137 | $grd->itemClass = "tableItem"; |
| 138 | 138 | $grd->altItemClass = "tableAltItem"; |
| 139 | 139 | $grd->fields = "type,source,createdon,eventid,username"; |
| 140 | - $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; |
|
| 140 | + $grd->columns = $_lang['type']." ,".$_lang['source']." ,".$_lang['date']." ,".$_lang['event_id']." ,".$_lang['sysinfo_userid']; |
|
| 141 | 141 | $grd->colWidths = "1%,,1%,1%,1%"; |
| 142 | 142 | $grd->colAligns = "center,,,center,center"; |
| 143 | - $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
|
| 144 | - if($listmode == '1') {
|
|
| 143 | + $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang['click_to_context']."'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='".$_lang['click_to_view_details']."'>[+source+]</a>||date: ".$modx->toDateFormat(null, 'formatOnly').' %I:%M %p'; |
|
| 144 | + if ($listmode == '1') {
|
|
| 145 | 145 | $grd->pageSize = 0; |
| 146 | 146 | } |
| 147 | - if($_REQUEST['op'] == 'reset') {
|
|
| 147 | + if ($_REQUEST['op'] == 'reset') {
|
|
| 148 | 148 | $grd->pageNumber = 1; |
| 149 | 149 | } |
| 150 | 150 | // render grid |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! function_exists('ProcessTVCommand')) { |
|
| 3 | +if (!function_exists('ProcessTVCommand')) { |
|
| 4 | 4 | /** |
| 5 | 5 | * @param string $value |
| 6 | 6 | * @param string $name |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | function ProcessTVCommand($value, $name = '', $docid = '', $src = 'docform', $tvsArray = array()) |
| 13 | 13 | { |
| 14 | 14 | $modx = evolutionCMS(); |
| 15 | - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; |
|
| 15 | + $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier; |
|
| 16 | 16 | $nvalue = trim($value); |
| 17 | 17 | if (substr($nvalue, 0, 1) != '@') { |
| 18 | 18 | return $value; |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | // if an inherited value is found and if there is content following the @INHERIT binding |
| 78 | 78 | // remove @INHERIT and output that following content. This content could contain other |
| 79 | 79 | // @ bindings, that are processed in the next step |
| 80 | - if ((string)$tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) { |
|
| 81 | - $output = trim(str_replace('@INHERIT', '', (string)$tv['value'])); |
|
| 80 | + if ((string) $tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) { |
|
| 81 | + $output = trim(str_replace('@INHERIT', '', (string) $tv['value'])); |
|
| 82 | 82 | break 2; |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | case 'DIRECTORY' : |
| 88 | 88 | $files = array(); |
| 89 | - $path = $modx->config['base_path'] . $param; |
|
| 89 | + $path = $modx->config['base_path'].$param; |
|
| 90 | 90 | if (substr($path, -1, 1) != '/') { |
| 91 | 91 | $path .= '/'; |
| 92 | 92 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | -if (! function_exists('ProcessFile')) { |
|
| 120 | +if (!function_exists('ProcessFile')) { |
|
| 121 | 121 | /** |
| 122 | 122 | * @param $file |
| 123 | 123 | * @return string |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | -if (! function_exists('ParseCommand')) { |
|
| 137 | +if (!function_exists('ParseCommand')) { |
|
| 138 | 138 | /** |
| 139 | 139 | * ParseCommand - separate @ cmd from params |
| 140 | 140 | * |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | $binding_array = array(); |
| 157 | 157 | foreach ($BINDINGS as $cmd) { |
| 158 | - if (strpos($binding_string, '@' . $cmd) === 0) { |
|
| 158 | + if (strpos($binding_string, '@'.$cmd) === 0) { |
|
| 159 | 159 | $code = substr($binding_string, strlen($cmd) + 1); |
| 160 | 160 | $binding_array = array($cmd, trim($code)); |
| 161 | 161 | break; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | -if (! function_exists('parseTvValues')) { |
|
| 169 | +if (!function_exists('parseTvValues')) { |
|
| 170 | 170 | /** |
| 171 | 171 | * Parse MODX Template-Variables |
| 172 | 172 | * |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | -if (! function_exists('getTVDisplayFormat')) { |
|
| 200 | +if (!function_exists('getTVDisplayFormat')) { |
|
| 201 | 201 | /** |
| 202 | 202 | * @param string $name |
| 203 | 203 | * @param string $value |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $o = ''; |
| 216 | 216 | |
| 217 | 217 | // process any TV commands in value |
| 218 | - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; |
|
| 218 | + $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier; |
|
| 219 | 219 | $value = ProcessTVCommand($value, $name, $docid); |
| 220 | 220 | |
| 221 | 221 | $params = array(); |
@@ -254,12 +254,12 @@ discard block |
||
| 254 | 254 | $attr['align'] = $params['align']; |
| 255 | 255 | } |
| 256 | 256 | foreach ($attr as $k => $v) { |
| 257 | - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
| 257 | + $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
| 258 | 258 | } |
| 259 | - $attributes .= ' ' . $params['attrib']; |
|
| 259 | + $attributes .= ' '.$params['attrib']; |
|
| 260 | 260 | |
| 261 | 261 | // Output the image with attributes |
| 262 | - $o .= '<img' . rtrim($attributes) . ' />'; |
|
| 262 | + $o .= '<img'.rtrim($attributes).' />'; |
|
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | break; |
@@ -331,12 +331,12 @@ discard block |
||
| 331 | 331 | 'target' => $params['target'], |
| 332 | 332 | ); |
| 333 | 333 | foreach ($attr as $k => $v) { |
| 334 | - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
| 334 | + $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
| 335 | 335 | } |
| 336 | - $attributes .= ' ' . $params['attrib']; // add extra |
|
| 336 | + $attributes .= ' '.$params['attrib']; // add extra |
|
| 337 | 337 | |
| 338 | 338 | // Output the link |
| 339 | - $o .= '<a' . rtrim($attributes) . '>' . ($params['text'] ? $modx->getPhpCompat()->htmlspecialchars($params['text']) : $name) . '</a>'; |
|
| 339 | + $o .= '<a'.rtrim($attributes).'>'.($params['text'] ? $modx->getPhpCompat()->htmlspecialchars($params['text']) : $name).'</a>'; |
|
| 340 | 340 | } |
| 341 | 341 | } |
| 342 | 342 | break; |
@@ -362,12 +362,12 @@ discard block |
||
| 362 | 362 | 'style' => $params['style'], |
| 363 | 363 | ); |
| 364 | 364 | foreach ($attr as $k => $v) { |
| 365 | - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
| 365 | + $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
| 366 | 366 | } |
| 367 | - $attributes .= ' ' . $params['attrib']; // add extra |
|
| 367 | + $attributes .= ' '.$params['attrib']; // add extra |
|
| 368 | 368 | |
| 369 | 369 | // Output the HTML Tag |
| 370 | - $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . '</' . $tagname . '>'; |
|
| 370 | + $o .= '<'.$tagname.rtrim($attributes).'>'.$tagvalue.'</'.$tagname.'>'; |
|
| 371 | 371 | } |
| 372 | 372 | break; |
| 373 | 373 | |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | $w = $params['w'] ? $params['w'] : '100%'; |
| 377 | 377 | $h = $params['h'] ? $params['h'] : '400px'; |
| 378 | 378 | $richtexteditor = $params['edt'] ? $params['edt'] : ""; |
| 379 | - $o = '<div class="MODX_RichTextWidget"><textarea id="' . $id . '" name="' . $id . '" style="width:' . $w . '; height:' . $h . ';">'; |
|
| 379 | + $o = '<div class="MODX_RichTextWidget"><textarea id="'.$id.'" name="'.$id.'" style="width:'.$w.'; height:'.$h.';">'; |
|
| 380 | 380 | $o .= $modx->getPhpCompat()->htmlspecialchars($value); |
| 381 | 381 | $o .= '</textarea></div>'; |
| 382 | 382 | $replace_richtext = array($id); |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | case "viewport": |
| 405 | 405 | $value = parseInput($value); |
| 406 | - $id = '_' . time(); |
|
| 406 | + $id = '_'.time(); |
|
| 407 | 407 | if (!$params['vpid']) { |
| 408 | 408 | $params['vpid'] = $id; |
| 409 | 409 | } |
@@ -417,35 +417,35 @@ discard block |
||
| 417 | 417 | $h = "100%"; |
| 418 | 418 | } |
| 419 | 419 | if ($params['asize'] == 'Yes' || ($params['awidth'] == 'Yes' && $params['aheight'] == 'Yes')) { |
| 420 | - $autoMode = "3"; //both |
|
| 420 | + $autoMode = "3"; //both |
|
| 421 | 421 | } else { |
| 422 | 422 | if ($params['awidth'] == 'Yes') { |
| 423 | 423 | $autoMode = "1"; //width only |
| 424 | 424 | } else { |
| 425 | 425 | if ($params['aheight'] == 'Yes') { |
| 426 | - $autoMode = "2"; //height only |
|
| 426 | + $autoMode = "2"; //height only |
|
| 427 | 427 | } |
| 428 | 428 | } |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | - $modx->regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array( |
|
| 431 | + $modx->regClientStartupScript(MODX_MANAGER_URL."media/script/bin/viewport.js", array( |
|
| 432 | 432 | 'name' => 'viewport', |
| 433 | 433 | 'version' => '0', |
| 434 | 434 | 'plaintext' => false |
| 435 | 435 | )); |
| 436 | - $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' "; |
|
| 436 | + $o = $sTag." id='".$params['vpid']."' name='".$params['vpid']."' "; |
|
| 437 | 437 | if ($params['class']) { |
| 438 | - $o .= " class='" . $params['class'] . "' "; |
|
| 438 | + $o .= " class='".$params['class']."' "; |
|
| 439 | 439 | } |
| 440 | 440 | if ($params['style']) { |
| 441 | - $o .= " style='" . $params['style'] . "' "; |
|
| 441 | + $o .= " style='".$params['style']."' "; |
|
| 442 | 442 | } |
| 443 | 443 | if ($params['attrib']) { |
| 444 | - $o .= $params['attrib'] . " "; |
|
| 444 | + $o .= $params['attrib']." "; |
|
| 445 | 445 | } |
| 446 | - $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' "; |
|
| 447 | - $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' "; |
|
| 448 | - $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' "; |
|
| 446 | + $o .= "scrolling='".($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto"))."' "; |
|
| 447 | + $o .= "src='".$value."' frameborder='".$params['borsize']."' "; |
|
| 448 | + $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'".$params['vpid']."\\',".$autoMode.")',100);\" width='".$w."' height='".$h."' "; |
|
| 449 | 449 | $o .= ">"; |
| 450 | 450 | $o .= $eTag; |
| 451 | 451 | break; |
@@ -497,16 +497,16 @@ discard block |
||
| 497 | 497 | $o = ''; |
| 498 | 498 | /* If we are loading a file */ |
| 499 | 499 | if (substr($params['output'], 0, 5) == "@FILE") { |
| 500 | - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6)); |
|
| 500 | + $file_name = MODX_BASE_PATH.trim(substr($params['output'], 6)); |
|
| 501 | 501 | if (!file_exists($file_name)) { |
| 502 | - $widget_output = $file_name . ' does not exist'; |
|
| 502 | + $widget_output = $file_name.' does not exist'; |
|
| 503 | 503 | } else { |
| 504 | 504 | $widget_output = file_get_contents($file_name); |
| 505 | 505 | } |
| 506 | 506 | } elseif (substr($params['output'], 0, 8) == '@INCLUDE') { |
| 507 | - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9)); |
|
| 507 | + $file_name = MODX_BASE_PATH.trim(substr($params['output'], 9)); |
|
| 508 | 508 | if (!file_exists($file_name)) { |
| 509 | - $widget_output = $file_name . ' does not exist'; |
|
| 509 | + $widget_output = $file_name.' does not exist'; |
|
| 510 | 510 | } else { |
| 511 | 511 | /* The included file needs to set $widget_output. Can be string, array, object */ |
| 512 | 512 | include $file_name; |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | } |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | -if (! function_exists('decodeParamValue')) { |
|
| 551 | +if (!function_exists('decodeParamValue')) { |
|
| 552 | 552 | /** |
| 553 | 553 | * @param string $s |
| 554 | 554 | * @return string |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | } |
| 562 | 562 | } |
| 563 | 563 | |
| 564 | -if (! function_exists('parseInput')) { |
|
| 564 | +if (!function_exists('parseInput')) { |
|
| 565 | 565 | /** |
| 566 | 566 | * returns an array if a delimiter is present. returns array is a recordset is present |
| 567 | 567 | * |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | } |
| 594 | 594 | } |
| 595 | 595 | |
| 596 | -if (! function_exists('getUnixtimeFromDateString')) { |
|
| 596 | +if (!function_exists('getUnixtimeFromDateString')) { |
|
| 597 | 597 | /** |
| 598 | 598 | * @param string $value |
| 599 | 599 | * @return bool|false|int |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | } |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | -if (! function_exists('renderFormElement')) { |
|
| 624 | +if (!function_exists('renderFormElement')) { |
|
| 625 | 625 | /** |
| 626 | 626 | * DISPLAY FORM ELEMENTS |
| 627 | 627 | * |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | $field_style = '', |
| 645 | 645 | $row = array(), |
| 646 | 646 | $tvsArray = array() |
| 647 | - ) { |
|
| 647 | + ){ |
|
| 648 | 648 | $modx = evolutionCMS(); |
| 649 | 649 | global $_style; |
| 650 | 650 | global $_lang; |
@@ -664,22 +664,22 @@ discard block |
||
| 664 | 664 | |
| 665 | 665 | case "text": // handler for regular text boxes |
| 666 | 666 | case "rawtext"; // non-htmlentity converted text boxes |
| 667 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" />'; |
|
| 667 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" />'; |
|
| 668 | 668 | break; |
| 669 | 669 | case "email": // handles email input fields |
| 670 | - $field_html .= '<input type="email" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%"/>'; |
|
| 670 | + $field_html .= '<input type="email" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%"/>'; |
|
| 671 | 671 | break; |
| 672 | 672 | case "number": // handles the input of numbers |
| 673 | - $field_html .= '<input type="number" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>'; |
|
| 673 | + $field_html .= '<input type="number" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>'; |
|
| 674 | 674 | break; |
| 675 | 675 | case "textareamini": // handler for textarea mini boxes |
| 676 | - $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '</textarea>'; |
|
| 676 | + $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">'.$modx->getPhpCompat()->htmlspecialchars($field_value).'</textarea>'; |
|
| 677 | 677 | break; |
| 678 | 678 | case "textarea": // handler for textarea boxes |
| 679 | 679 | case "rawtextarea": // non-htmlentity convertex textarea boxes |
| 680 | 680 | case "htmlarea": // handler for textarea boxes (deprecated) |
| 681 | 681 | case "richtext": // handler for textarea boxes |
| 682 | - $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '</textarea>'; |
|
| 682 | + $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">'.$modx->getPhpCompat()->htmlspecialchars($field_value).'</textarea>'; |
|
| 683 | 683 | break; |
| 684 | 684 | case "date": |
| 685 | 685 | $field_id = str_replace(array( |
@@ -689,12 +689,12 @@ discard block |
||
| 689 | 689 | if ($field_value == '') { |
| 690 | 690 | $field_value = 0; |
| 691 | 691 | } |
| 692 | - $field_html .= '<input id="tv' . $field_id . '" name="tv' . $field_id . '" class="DatePicker" type="text" value="' . ($field_value == 0 || !isset($field_value) ? "" : $field_value) . '" onblur="documentDirty=true;" />'; |
|
| 693 | - $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].value=\'\';document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="' . $_style["actions_calendar_delete"] . '"></i></a>'; |
|
| 692 | + $field_html .= '<input id="tv'.$field_id.'" name="tv'.$field_id.'" class="DatePicker" type="text" value="'.($field_value == 0 || !isset($field_value) ? "" : $field_value).'" onblur="documentDirty=true;" />'; |
|
| 693 | + $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].value=\'\';document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="'.$_style["actions_calendar_delete"].'"></i></a>'; |
|
| 694 | 694 | |
| 695 | 695 | break; |
| 696 | 696 | case "dropdown": // handler for select boxes |
| 697 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" size="1" onchange="documentDirty=true;">'; |
|
| 697 | + $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" size="1" onchange="documentDirty=true;">'; |
|
| 698 | 698 | $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', |
| 699 | 699 | $tvsArray)); |
| 700 | 700 | while (list($item, $itemvalue) = each($index_list)) { |
@@ -702,12 +702,12 @@ discard block |
||
| 702 | 702 | if (strlen($itemvalue) == 0) { |
| 703 | 703 | $itemvalue = $item; |
| 704 | 704 | } |
| 705 | - $field_html .= '<option value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($item) . '</option>'; |
|
| 705 | + $field_html .= '<option value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($item).'</option>'; |
|
| 706 | 706 | } |
| 707 | 707 | $field_html .= "</select>"; |
| 708 | 708 | break; |
| 709 | 709 | case "listbox": // handler for select boxes |
| 710 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" onchange="documentDirty=true;" size="8">'; |
|
| 710 | + $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" onchange="documentDirty=true;" size="8">'; |
|
| 711 | 711 | $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', |
| 712 | 712 | $tvsArray)); |
| 713 | 713 | while (list($item, $itemvalue) = each($index_list)) { |
@@ -715,13 +715,13 @@ discard block |
||
| 715 | 715 | if (strlen($itemvalue) == 0) { |
| 716 | 716 | $itemvalue = $item; |
| 717 | 717 | } |
| 718 | - $field_html .= '<option value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($item) . '</option>'; |
|
| 718 | + $field_html .= '<option value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($item).'</option>'; |
|
| 719 | 719 | } |
| 720 | 720 | $field_html .= "</select>"; |
| 721 | 721 | break; |
| 722 | 722 | case "listbox-multiple": // handler for select boxes where you can choose multiple items |
| 723 | 723 | $field_value = explode("||", $field_value); |
| 724 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '[]" multiple="multiple" onchange="documentDirty=true;" size="8">'; |
|
| 724 | + $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'[]" multiple="multiple" onchange="documentDirty=true;" size="8">'; |
|
| 725 | 725 | $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', |
| 726 | 726 | $tvsArray)); |
| 727 | 727 | while (list($item, $itemvalue) = each($index_list)) { |
@@ -729,8 +729,8 @@ discard block |
||
| 729 | 729 | if (strlen($itemvalue) == 0) { |
| 730 | 730 | $itemvalue = $item; |
| 731 | 731 | } |
| 732 | - $field_html .= '<option value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '"' . (in_array($itemvalue, |
|
| 733 | - $field_value) ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($item) . '</option>'; |
|
| 732 | + $field_html .= '<option value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'"'.(in_array($itemvalue, |
|
| 733 | + $field_value) ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($item).'</option>'; |
|
| 734 | 734 | } |
| 735 | 735 | $field_html .= "</select>"; |
| 736 | 736 | break; |
@@ -742,17 +742,17 @@ discard block |
||
| 742 | 742 | 'ftp://' => 'ftp://', |
| 743 | 743 | 'mailto:' => 'mailto:' |
| 744 | 744 | ); |
| 745 | - $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv' . $field_id . '_prefix" name="tv' . $field_id . '_prefix" onchange="documentDirty=true;">'; |
|
| 745 | + $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv'.$field_id.'_prefix" name="tv'.$field_id.'_prefix" onchange="documentDirty=true;">'; |
|
| 746 | 746 | foreach ($urls as $k => $v) { |
| 747 | 747 | if (strpos($field_value, $v) === false) { |
| 748 | - $field_html .= '<option value="' . $v . '">' . $k . '</option>'; |
|
| 748 | + $field_html .= '<option value="'.$v.'">'.$k.'</option>'; |
|
| 749 | 749 | } else { |
| 750 | 750 | $field_value = str_replace($v, '', $field_value); |
| 751 | - $field_html .= '<option value="' . $v . '" selected="selected">' . $k . '</option>'; |
|
| 751 | + $field_html .= '<option value="'.$v.'" selected="selected">'.$k.'</option>'; |
|
| 752 | 752 | } |
| 753 | 753 | } |
| 754 | 754 | $field_html .= '</select></td><td>'; |
| 755 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" width="100" ' . $field_style . ' onchange="documentDirty=true;" /></td></tr></table>'; |
|
| 755 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" width="100" '.$field_style.' onchange="documentDirty=true;" /></td></tr></table>'; |
|
| 756 | 756 | break; |
| 757 | 757 | case 'checkbox': // handles check boxes |
| 758 | 758 | $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | if (strlen($itemvalue) == 0) { |
| 795 | 795 | $itemvalue = $item; |
| 796 | 796 | } |
| 797 | - $field_html .= '<input type="radio" value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '" id="tv_' . $i . '" name="tv' . $field_id . '" ' . ($itemvalue == $field_value ? 'checked="checked"' : '') . ' onchange="documentDirty=true;" /><label for="tv_' . $i . '" class="radio">' . $item . '</label><br />'; |
|
| 797 | + $field_html .= '<input type="radio" value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'" id="tv_'.$i.'" name="tv'.$field_id.'" '.($itemvalue == $field_value ? 'checked="checked"' : '').' onchange="documentDirty=true;" /><label for="tv_'.$i.'" class="radio">'.$item.'</label><br />'; |
|
| 798 | 798 | $i++; |
| 799 | 799 | } |
| 800 | 800 | break; |
@@ -824,13 +824,13 @@ discard block |
||
| 824 | 824 | lastImageCtrl = ctrl; |
| 825 | 825 | var w = screen.width * 0.5; |
| 826 | 826 | var h = screen.height * 0.5; |
| 827 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
| 827 | + OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
| 828 | 828 | } |
| 829 | 829 | function BrowseFileServer(ctrl) { |
| 830 | 830 | lastFileCtrl = ctrl; |
| 831 | 831 | var w = screen.width * 0.5; |
| 832 | 832 | var h = screen.height * 0.5; |
| 833 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
| 833 | + OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
| 834 | 834 | } |
| 835 | 835 | function SetUrlChange(el) { |
| 836 | 836 | if ('createEvent' in document) { |
@@ -864,7 +864,7 @@ discard block |
||
| 864 | 864 | </script>"; |
| 865 | 865 | $ResourceManagerLoaded = true; |
| 866 | 866 | } |
| 867 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseServer(\'tv' . $field_id . '\')" />'; |
|
| 867 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseServer(\'tv'.$field_id.'\')" />'; |
|
| 868 | 868 | break; |
| 869 | 869 | case "file": // handles the input of file uploads |
| 870 | 870 | /* Modified by Timon for use with resource browser */ |
@@ -894,13 +894,13 @@ discard block |
||
| 894 | 894 | lastImageCtrl = ctrl; |
| 895 | 895 | var w = screen.width * 0.5; |
| 896 | 896 | var h = screen.height * 0.5; |
| 897 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
| 897 | + OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
| 898 | 898 | } |
| 899 | 899 | function BrowseFileServer(ctrl) { |
| 900 | 900 | lastFileCtrl = ctrl; |
| 901 | 901 | var w = screen.width * 0.5; |
| 902 | 902 | var h = screen.height * 0.5; |
| 903 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
| 903 | + OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
| 904 | 904 | } |
| 905 | 905 | function SetUrlChange(el) { |
| 906 | 906 | if ('createEvent' in document) { |
@@ -934,7 +934,7 @@ discard block |
||
| 934 | 934 | </script>"; |
| 935 | 935 | $ResourceManagerLoaded = true; |
| 936 | 936 | } |
| 937 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseFileServer(\'tv' . $field_id . '\')" />'; |
|
| 937 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseFileServer(\'tv'.$field_id.'\')" />'; |
|
| 938 | 938 | |
| 939 | 939 | break; |
| 940 | 940 | |
@@ -942,16 +942,16 @@ discard block |
||
| 942 | 942 | $custom_output = ''; |
| 943 | 943 | /* If we are loading a file */ |
| 944 | 944 | if (substr($field_elements, 0, 5) == "@FILE") { |
| 945 | - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); |
|
| 945 | + $file_name = MODX_BASE_PATH.trim(substr($field_elements, 6)); |
|
| 946 | 946 | if (!file_exists($file_name)) { |
| 947 | - $custom_output = $file_name . ' does not exist'; |
|
| 947 | + $custom_output = $file_name.' does not exist'; |
|
| 948 | 948 | } else { |
| 949 | 949 | $custom_output = file_get_contents($file_name); |
| 950 | 950 | } |
| 951 | 951 | } elseif (substr($field_elements, 0, 8) == '@INCLUDE') { |
| 952 | - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); |
|
| 952 | + $file_name = MODX_BASE_PATH.trim(substr($field_elements, 9)); |
|
| 953 | 953 | if (!file_exists($file_name)) { |
| 954 | - $custom_output = $file_name . ' does not exist'; |
|
| 954 | + $custom_output = $file_name.' does not exist'; |
|
| 955 | 955 | } else { |
| 956 | 956 | ob_start(); |
| 957 | 957 | include $file_name; |
@@ -962,7 +962,7 @@ discard block |
||
| 962 | 962 | $chunk_name = trim(substr($field_elements, 7)); |
| 963 | 963 | $chunk_body = $modx->getChunk($chunk_name); |
| 964 | 964 | if ($chunk_body == false) { |
| 965 | - $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; |
|
| 965 | + $custom_output = $_lang['chunk_no_exist'].'('.$_lang['htmlsnippet_name'].':'.$chunk_name.')'; |
|
| 966 | 966 | } else { |
| 967 | 967 | $custom_output = $chunk_body; |
| 968 | 968 | } |
@@ -987,15 +987,15 @@ discard block |
||
| 987 | 987 | break; |
| 988 | 988 | |
| 989 | 989 | default: // the default handler -- for errors, mostly |
| 990 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' onchange="documentDirty=true;" />'; |
|
| 990 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' onchange="documentDirty=true;" />'; |
|
| 991 | 991 | |
| 992 | 992 | } // end switch statement |
| 993 | 993 | } else { |
| 994 | 994 | $custom = explode(":", $field_type); |
| 995 | 995 | $custom_output = ''; |
| 996 | - $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; |
|
| 996 | + $file_name = MODX_BASE_PATH.'assets/tvs/'.$custom['1'].'/'.$custom['1'].'.customtv.php'; |
|
| 997 | 997 | if (!file_exists($file_name)) { |
| 998 | - $custom_output = $file_name . ' does not exist'; |
|
| 998 | + $custom_output = $file_name.' does not exist'; |
|
| 999 | 999 | } else { |
| 1000 | 1000 | ob_start(); |
| 1001 | 1001 | include $file_name; |
@@ -1019,7 +1019,7 @@ discard block |
||
| 1019 | 1019 | } // end renderFormElement function |
| 1020 | 1020 | } |
| 1021 | 1021 | |
| 1022 | -if (! function_exists('ParseIntputOptions')) { |
|
| 1022 | +if (!function_exists('ParseIntputOptions')) { |
|
| 1023 | 1023 | /** |
| 1024 | 1024 | * @param string|array|mysqli_result $v |
| 1025 | 1025 | * @return array |