@@ -1,12 +1,12 @@ 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('delete_template')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id']) ? (int)$_GET['id'] : 0; |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | 10 | if ($id == 0) { |
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | // check for relations |
| 17 | 17 | if (!$forced) { |
| 18 | - $drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content') . " AS sc |
|
| 19 | - INNER JOIN " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'"); |
|
| 18 | + $drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content')." AS sc |
|
| 19 | + INNER JOIN " . $modx->getFullTableName('site_tmplvar_contentvalues')." AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'"); |
|
| 20 | 20 | $count = $modx->db->getRecordCount($drs); |
| 21 | 21 | if ($count > 0) { |
| 22 | 22 | include_once "header.inc.php"; ?> |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | <ul> |
| 43 | 43 | <?php |
| 44 | 44 | while ($row = $modx->db->getRow($drs)) { |
| 45 | - echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '</li>'; |
|
| 45 | + echo '<li><span style="width: 200px"><a href="index.php?id='.$row['id'].'&a=27">'.$row['pagetitle'].'</a></span>'.($row['description'] != '' ? ' - '.$row['description'] : '').'</li>'; |
|
| 46 | 46 | } ?> |
| 47 | 47 | </ul> |
| 48 | 48 | </div> |
@@ -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 | if (!$modx->hasPermission('save_plugin') && !$modx->hasPermission('save_snippet') && !$modx->hasPermission('save_template') && !$modx->hasPermission('save_module')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['catId'])? (int)$_GET['catId'] : 0; |
|
| 10 | -if ($id==0) { |
|
| 9 | +$id = isset($_GET['catId']) ? (int) $_GET['catId'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
@@ -15,9 +15,9 @@ discard block |
||
| 15 | 15 | $name = $modx->db->getValue($modx->db->select('category', $modx->getFullTableName('categories'), "id='{$id}'")); |
| 16 | 16 | $_SESSION['itemname'] = $name; |
| 17 | 17 | |
| 18 | -include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 18 | +include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 19 | 19 | deleteCategory($id); |
| 20 | 20 | |
| 21 | 21 | // finished emptying cache - redirect |
| 22 | -$header="Location: index.php?a=76"; |
|
| 22 | +$header = "Location: index.php?a=76"; |
|
| 23 | 23 | header($header); |
@@ -1,12 +1,12 @@ 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('save_module')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = (int)$_POST['id']; |
|
| 9 | +$id = (int) $_POST['id']; |
|
| 10 | 10 | $name = $modx->db->escape(trim($_POST['name'])); |
| 11 | 11 | $description = $modx->db->escape($_POST['description']); |
| 12 | 12 | $resourcefile = $modx->db->escape($_POST['resourcefile']); |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | //Kyle Jaebker - added category support |
| 27 | 27 | if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) { |
| 28 | - $categoryid = (int)$_POST['categoryid']; |
|
| 28 | + $categoryid = (int) $_POST['categoryid']; |
|
| 29 | 29 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
| 30 | 30 | $categoryid = 0; |
| 31 | 31 | } else { |
| 32 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 32 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 33 | 33 | $categoryid = checkCategory($_POST['newcategory']); |
| 34 | 34 | if (!$categoryid) { |
| 35 | 35 | $categoryid = newCategory($_POST['newcategory']); |
@@ -45,15 +45,15 @@ discard block |
||
| 45 | 45 | $name = isset($parsed['name']) ? $parsed['name'] : $name; |
| 46 | 46 | $properties = isset($parsed['properties']) ? $parsed['properties'] : $properties; |
| 47 | 47 | $guid = isset($parsed['guid']) ? $parsed['guid'] : $guid; |
| 48 | - $enable_sharedparams = isset($parsed['shareparams']) ? (int)$parsed['shareparams'] : $enable_sharedparams; |
|
| 48 | + $enable_sharedparams = isset($parsed['shareparams']) ? (int) $parsed['shareparams'] : $enable_sharedparams; |
|
| 49 | 49 | |
| 50 | 50 | $description = isset($parsed['description']) ? $parsed['description'] : $description; |
| 51 | - $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : ''; |
|
| 51 | + $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : ''; |
|
| 52 | 52 | if ($version) { |
| 53 | - $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
| 53 | + $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
| 54 | 54 | } |
| 55 | 55 | if (isset($parsed['modx_category'])) { |
| 56 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 56 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 57 | 57 | $categoryid = getCategory($parsed['modx_category']); |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | // finished emptying cache - redirect |
| 112 | 112 | if ($_POST['stay'] != '') { |
| 113 | 113 | $a = ($_POST['stay'] == '2') ? "108&id=$newid" : "107"; |
| 114 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
| 114 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
| 115 | 115 | header($header); |
| 116 | 116 | } else { |
| 117 | 117 | $header = "Location: index.php?a=106&r=2"; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | // finished emptying cache - redirect |
| 169 | 169 | if ($_POST['stay'] != '') { |
| 170 | 170 | $a = ($_POST['stay'] == '2') ? "108&id=$id" : "107"; |
| 171 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
| 171 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
| 172 | 172 | header($header); |
| 173 | 173 | } else { |
| 174 | 174 | $modx->unlockElement(6, $id); |
@@ -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 | if (!$modx->hasPermission('delete_web_user')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 10 | -if ($id==0) { |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
@@ -43,5 +43,5 @@ discard block |
||
| 43 | 43 | "id" => $id |
| 44 | 44 | )); |
| 45 | 45 | |
| 46 | -$header="Location: index.php?a=99"; |
|
| 46 | +$header = "Location: index.php?a=99"; |
|
| 47 | 47 | header($header); |
@@ -1,12 +1,12 @@ 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('save_plugin')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = (int)$_POST['id']; |
|
| 9 | +$id = (int) $_POST['id']; |
|
| 10 | 10 | $name = $modx->db->escape(trim($_POST['name'])); |
| 11 | 11 | $description = $modx->db->escape($_POST['description']); |
| 12 | 12 | $locked = $_POST['locked'] == 'on' ? '1' : '0'; |
@@ -20,11 +20,11 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | //Kyle Jaebker - added category support |
| 22 | 22 | if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) { |
| 23 | - $categoryid = (int)$_POST['categoryid']; |
|
| 23 | + $categoryid = (int) $_POST['categoryid']; |
|
| 24 | 24 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
| 25 | 25 | $categoryid = 0; |
| 26 | 26 | } else { |
| 27 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 27 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 28 | 28 | $categoryid = getCategory($_POST['newcategory']); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -40,12 +40,12 @@ discard block |
||
| 40 | 40 | $moduleguid = isset($parsed['guid']) ? $parsed['guid'] : $moduleguid; |
| 41 | 41 | |
| 42 | 42 | $description = isset($parsed['description']) ? $parsed['description'] : $description; |
| 43 | - $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : ''; |
|
| 43 | + $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : ''; |
|
| 44 | 44 | if ($version) { |
| 45 | - $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
| 45 | + $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
| 46 | 46 | } |
| 47 | 47 | if (isset($parsed['modx_category'])) { |
| 48 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 48 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 49 | 49 | $categoryid = getCategory($parsed['modx_category']); |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | // finished emptying cache - redirect |
| 104 | 104 | if ($_POST['stay'] != '') { |
| 105 | 105 | $a = ($_POST['stay'] == '2') ? "102&id=$newid" : '101'; |
| 106 | - $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay']; |
|
| 106 | + $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay']; |
|
| 107 | 107 | header($header); |
| 108 | 108 | } else { |
| 109 | 109 | $header = 'Location: index.php?a=76&r=2'; |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | // finished emptying cache - redirect |
| 159 | 159 | if ($_POST['stay'] != '') { |
| 160 | 160 | $a = ($_POST['stay'] == '2') ? "102&id=$id" : '101'; |
| 161 | - $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay']; |
|
| 161 | + $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay']; |
|
| 162 | 162 | header($header); |
| 163 | 163 | } else { |
| 164 | 164 | $modx->unlockElement(5, $id); |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | function getEventIdByName($name) |
| 227 | 227 | { |
| 228 | 228 | $modx = evolutionCMS(); |
| 229 | - static $eventIds=array(); |
|
| 229 | + static $eventIds = array(); |
|
| 230 | 230 | |
| 231 | 231 | if (isset($eventIds[$name])) { |
| 232 | 232 | return $eventIds[$name]; |
@@ -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 | if (!$modx->hasPermission('new_module')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 10 | -if ($id==0) { |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
@@ -18,9 +18,9 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | function createGUID() |
| 20 | 20 | { |
| 21 | - srand((double)microtime()*1000000); |
|
| 22 | - $r = rand() ; |
|
| 23 | - $u = uniqid(getmypid() . $r . (double)microtime()*1000000, 1); |
|
| 21 | + srand((double) microtime() * 1000000); |
|
| 22 | + $r = rand(); |
|
| 23 | + $u = uniqid(getmypid().$r.(double) microtime() * 1000000, 1); |
|
| 24 | 24 | $m = md5($u); |
| 25 | 25 | return $m; |
| 26 | 26 | } |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | // count duplicates |
| 29 | 29 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_modules'), "id='{$id}'")); |
| 30 | 30 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_modules'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 31 | -if ($count>=1) { |
|
| 32 | - $count = ' ' . ($count+1); |
|
| 31 | +if ($count >= 1) { |
|
| 32 | + $count = ' '.($count + 1); |
|
| 33 | 33 | } else { |
| 34 | 34 | $count = ''; |
| 35 | 35 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | 'properties'=>'', |
| 53 | 53 | 'modulecode'=>'', |
| 54 | 54 | ), $modx->getFullTableName('site_modules'), // Insert into |
| 55 | - "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, '" . createGUID() . "' AS guid, enable_sharedparams, properties, modulecode", $modx->getFullTableName('site_modules'), "id='{$id}'"); // Copy from |
|
| 55 | + "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, '".createGUID()."' AS guid, enable_sharedparams, properties, modulecode", $modx->getFullTableName('site_modules'), "id='{$id}'"); // Copy from |
|
| 56 | 56 | |
| 57 | 57 | // duplicate module dependencies |
| 58 | 58 | $modx->db->insert( |
@@ -76,5 +76,5 @@ discard block |
||
| 76 | 76 | $_SESSION['itemname'] = $name; |
| 77 | 77 | |
| 78 | 78 | // finish duplicating - redirect to new module |
| 79 | -$header="Location: index.php?r=2&a=108&id=$newid"; |
|
| 79 | +$header = "Location: index.php?r=2&a=108&id=$newid"; |
|
| 80 | 80 | header($header); |
@@ -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('settings')) { |
@@ -9,13 +9,13 @@ discard block |
||
| 9 | 9 | // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972 |
| 10 | 10 | unset($_POST); |
| 11 | 11 | |
| 12 | -if ($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS')===false) { |
|
| 13 | - $htaccess = $modx->config['base_path'] . '.htaccess'; |
|
| 14 | - $sample_htaccess = $modx->config['base_path'] . 'ht.access'; |
|
| 15 | - $dir = '/' . trim($modx->config['base_url'], '/'); |
|
| 12 | +if ($data['friendly_urls'] === '1' && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS') === false) { |
|
| 13 | + $htaccess = $modx->config['base_path'].'.htaccess'; |
|
| 14 | + $sample_htaccess = $modx->config['base_path'].'ht.access'; |
|
| 15 | + $dir = '/'.trim($modx->config['base_url'], '/'); |
|
| 16 | 16 | if (is_file($htaccess)) { |
| 17 | 17 | $_ = file_get_contents($htaccess); |
| 18 | - if (strpos($_, 'RewriteBase')===false) { |
|
| 18 | + if (strpos($_, 'RewriteBase') === false) { |
|
| 19 | 19 | $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
| 20 | 20 | } elseif (is_writable($htaccess)) { |
| 21 | 21 | $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | } elseif (is_file($sample_htaccess)) { |
| 27 | 27 | if (!@rename($sample_htaccess, $htaccess)) { |
| 28 | 28 | $warnings[] = $_lang["settings_friendlyurls_alert"]; |
| 29 | - } elseif ($modx->config['base_url']!=='/') { |
|
| 29 | + } elseif ($modx->config['base_url'] !== '/') { |
|
| 30 | 30 | $_ = file_get_contents($htaccess); |
| 31 | 31 | $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); |
| 32 | 32 | if (!@file_put_contents($htaccess, $_)) { |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | -if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
| 40 | - unlink(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css'); |
|
| 39 | +if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) { |
|
| 40 | + unlink(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css'); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $data['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['filemanager_path']); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | if (isset($data) && count($data) > 0) { |
| 47 | 47 | if (isset($data['manager_language'])) { |
| 48 | - $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; |
|
| 48 | + $lang_path = MODX_MANAGER_PATH.'includes/lang/'.$data['manager_language'].'.inc.php'; |
|
| 49 | 49 | if (is_file($lang_path)) { |
| 50 | 50 | include($lang_path); |
| 51 | 51 | global $modx_lang_attribute; |
@@ -54,15 +54,15 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | $savethese = array(); |
| 56 | 56 | $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']); |
| 57 | - $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute |
|
| 57 | + $data['mail_check_timeperiod'] = (int) $data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute |
|
| 58 | 58 | foreach ($data as $k => $v) { |
| 59 | 59 | switch ($k) { |
| 60 | 60 | case 'site_name': |
| 61 | 61 | $v = htmlspecialchars($v); |
| 62 | 62 | break; |
| 63 | 63 | case 'settings_version':{ |
| 64 | - if ($modx->getVersionData('version')!=$data['settings_version']) { |
|
| 65 | - $modx->logEvent(17, 2, '<pre>' . var_export($data['settings_version'], true) . '</pre>', 'fake settings_version'); |
|
| 64 | + if ($modx->getVersionData('version') != $data['settings_version']) { |
|
| 65 | + $modx->logEvent(17, 2, '<pre>'.var_export($data['settings_version'], true).'</pre>', 'fake settings_version'); |
|
| 66 | 66 | $v = $modx->getVersionData('version'); |
| 67 | 67 | } |
| 68 | 68 | break; |
@@ -83,11 +83,11 @@ discard block |
||
| 83 | 83 | case 'rb_base_url': |
| 84 | 84 | case 'filemanager_path': |
| 85 | 85 | $v = trim($v); |
| 86 | - $v = rtrim($v, '/') . '/'; |
|
| 86 | + $v = rtrim($v, '/').'/'; |
|
| 87 | 87 | break; |
| 88 | 88 | case 'manager_language': |
| 89 | - $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang'); |
|
| 90 | - $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php'); |
|
| 89 | + $langDir = realpath(MODX_MANAGER_PATH.'includes/lang'); |
|
| 90 | + $langFile = realpath(MODX_MANAGER_PATH.'includes/lang/'.$v.'.inc.php'); |
|
| 91 | 91 | $langFileDir = dirname($langFile); |
| 92 | 92 | if ($langDir !== $langFileDir || !file_exists($langFile)) { |
| 93 | 93 | $v = 'english'; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | case 'smtppw': |
| 97 | 97 | if ($v !== '********************' && $v !== '') { |
| 98 | 98 | $v = trim($v); |
| 99 | - $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); |
|
| 99 | + $v = base64_encode($v).substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); |
|
| 100 | 100 | $v = str_replace('=', '%', $v); |
| 101 | 101 | } elseif ($v === '********************') { |
| 102 | 102 | $k = ''; |
@@ -106,14 +106,14 @@ discard block |
||
| 106 | 106 | $v = str_replace(array(' ,', ', '), ',', $v); |
| 107 | 107 | if ($v !== ',') { |
| 108 | 108 | $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : ''; |
| 109 | - $configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n"; |
|
| 110 | - @file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString); |
|
| 109 | + $configString = '<?php'."\n".'define(\'MODX_SITE_HOSTNAMES\', \''.$v.'\');'."\n"; |
|
| 110 | + @file_put_contents(MODX_BASE_PATH.'assets/cache/siteHostnames.php', $configString); |
|
| 111 | 111 | } |
| 112 | 112 | $k = ''; |
| 113 | 113 | break; |
| 114 | 114 | case 'session_timeout': |
| 115 | 115 | $mail_check_timeperiod = $data['mail_check_timeperiod']; |
| 116 | - $v = (int)$v < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum |
|
| 116 | + $v = (int) $v < ($data['mail_check_timeperiod'] / 60 + 1) ? ($data['mail_check_timeperiod'] / 60 + 1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum |
|
| 117 | 117 | break; |
| 118 | 118 | default: |
| 119 | 119 | break; |
@@ -123,24 +123,24 @@ discard block |
||
| 123 | 123 | $modx->config[$k] = $v; |
| 124 | 124 | |
| 125 | 125 | if (!empty($k)) { |
| 126 | - $savethese[] = '(\'' . $modx->db->escape($k) . '\', \'' . $modx->db->escape($v) . '\')'; |
|
| 126 | + $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')'; |
|
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | // Run a single query to save all the values |
| 131 | - $sql = "REPLACE INTO " . $modx->getFullTableName("system_settings") . " (setting_name, setting_value) |
|
| 131 | + $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value) |
|
| 132 | 132 | VALUES " . implode(', ', $savethese); |
| 133 | 133 | $modx->db->query($sql); |
| 134 | 134 | |
| 135 | 135 | // Reset Template Pages |
| 136 | 136 | if (isset($data['reset_template'])) { |
| 137 | - $newtemplate = (int)$data['default_template']; |
|
| 138 | - $oldtemplate = (int)$data['old_template']; |
|
| 137 | + $newtemplate = (int) $data['default_template']; |
|
| 138 | + $oldtemplate = (int) $data['old_template']; |
|
| 139 | 139 | $tbl = $modx->getFullTableName('site_content'); |
| 140 | 140 | $reset = $data['reset_template']; |
| 141 | - if ($reset==1) { |
|
| 141 | + if ($reset == 1) { |
|
| 142 | 142 | $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'"); |
| 143 | - } elseif ($reset==2) { |
|
| 143 | + } elseif ($reset == 2) { |
|
| 144 | 144 | $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -148,5 +148,5 @@ discard block |
||
| 148 | 148 | // empty cache |
| 149 | 149 | $modx->clearCache('full'); |
| 150 | 150 | } |
| 151 | -$header="Location: index.php?a=7&r=10"; |
|
| 151 | +$header = "Location: index.php?a=7&r=10"; |
|
| 152 | 152 | header($header); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | if (strpos($_, 'RewriteBase')===false) { |
| 19 | 19 | $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
| 20 | 20 | } elseif (is_writable($htaccess)) { |
| 21 | - $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); |
|
| 21 | + $_ = preg_replace('@RewriteBase.+@', "rewritebase {$dir}", $_); |
|
| 22 | 22 | if (!@file_put_contents($htaccess, $_)) { |
| 23 | 23 | $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
| 24 | 24 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $warnings[] = $_lang["settings_friendlyurls_alert"]; |
| 29 | 29 | } elseif ($modx->config['base_url']!=='/') { |
| 30 | 30 | $_ = file_get_contents($htaccess); |
| 31 | - $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); |
|
| 31 | + $_ = preg_replace('@RewriteBase.+@', "rewritebase {$dir}", $_); |
|
| 32 | 32 | if (!@file_put_contents($htaccess, $_)) { |
| 33 | 33 | $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
| 34 | 34 | } |
@@ -1,12 +1,12 @@ 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('delete_template')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id']) ? (int)$_GET['id'] : 0; |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | 10 | if ($id == 0) { |
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | <ul> |
| 29 | 29 | <?php |
| 30 | 30 | while ($row = $modx->db->getRow($rs)) { |
| 31 | - echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>'; |
|
| 31 | + echo '<li><span style="width: 200px"><a href="index.php?id='.$row['id'].'&a=27">'.$row['pagetitle'].'</a></span>'.($row['introtext'] != '' ? ' - '.$row['introtext'] : '').'</li>'; |
|
| 32 | 32 | } ?> |
| 33 | 33 | </ul> |
| 34 | 34 | </div> |
@@ -1,21 +1,21 @@ 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_plugin')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 10 | -if ($id==0) { |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | // count duplicates |
| 15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$id}'")); |
| 16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_plugins'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 17 | -if ($count>=1) { |
|
| 18 | - $count = ' ' . ($count+1); |
|
| 17 | +if ($count >= 1) { |
|
| 18 | + $count = ' '.($count + 1); |
|
| 19 | 19 | } else { |
| 20 | 20 | $count = ''; |
| 21 | 21 | } |
@@ -47,5 +47,5 @@ discard block |
||
| 47 | 47 | $_SESSION['itemname'] = $name; |
| 48 | 48 | |
| 49 | 49 | // finish duplicating - redirect to new plugin |
| 50 | -$header="Location: index.php?r=2&a=102&id=$newid"; |
|
| 50 | +$header = "Location: index.php?r=2&a=102&id=$newid"; |
|
| 51 | 51 | header($header); |