| @@ -43,10 +43,10 @@ | ||
| 43 | 43 | var chk = document.install.rminstaller; | 
| 44 | 44 |  	if(chk && chk.checked) { | 
| 45 | 45 | // remove install folder and files | 
| 46 | - window.location.href = "../<?php echo MGR_DIR;?>/processors/remove_installer.processor.php?rminstall=1"; | |
| 46 | + window.location.href = "../<?php echo MGR_DIR; ?>/processors/remove_installer.processor.php?rminstall=1"; | |
| 47 | 47 | } | 
| 48 | 48 |  	else { | 
| 49 | - window.location.href = "../<?php echo MGR_DIR;?>/"; | |
| 49 | + window.location.href = "../<?php echo MGR_DIR; ?>/"; | |
| 50 | 50 | } | 
| 51 | 51 | } | 
| 52 | 52 | /* ]]> */ | 
| @@ -6,12 +6,12 @@ discard block | ||
| 6 | 6 | $installMode = $_POST['installMode']; | 
| 7 | 7 | |
| 8 | 8 | $self = 'install/connection.databasetest.php'; | 
| 9 | -$base_path = str_replace($self,'',str_replace('\\','/', __FILE__)); | |
| 9 | +$base_path = str_replace($self, '', str_replace('\\', '/', __FILE__)); | |
| 10 | 10 |  if (is_file("{$base_path}assets/cache/siteManager.php")) { | 
| 11 | 11 |  	include_once("{$base_path}assets/cache/siteManager.php"); | 
| 12 | 12 | } | 
| 13 | -if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { | |
| 14 | -	define('MGR_DIR','manager'); | |
| 13 | +if (!defined('MGR_DIR') && is_dir("{$base_path}manager")) { | |
| 14 | +	define('MGR_DIR', 'manager'); | |
| 15 | 15 | } | 
| 16 | 16 |  require_once("lang.php"); | 
| 17 | 17 | |
| @@ -31,7 +31,7 @@ discard block | ||
| 31 | 31 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); | 
| 32 | 32 | $query = "CREATE DATABASE `".$database_name."` CHARACTER SET ".$database_charset." COLLATE ".$database_collation.";"; | 
| 33 | 33 | |
| 34 | -        if (! mysqli_query($conn, $query)){ | |
| 34 | +        if (!mysqli_query($conn, $query)) { | |
| 35 | 35 | $output .= '<span id="database_fail" style="color:#FF0000;">'.$_lang['status_failed_could_not_create_database'].'</span>'; | 
| 36 | 36 | } | 
| 37 | 37 |          else { | 
| @@ -9,7 +9,7 @@ discard block | ||
| 9 | 9 | } | 
| 10 | 10 | |
| 11 | 11 | $self = 'install/index.php'; | 
| 12 | -$base_path = str_replace($self,'',str_replace('\\','/', __FILE__)); | |
| 12 | +$base_path = str_replace($self, '', str_replace('\\', '/', __FILE__)); | |
| 13 | 13 |  require_once("{$base_path}install/functions.php"); | 
| 14 | 14 | |
| 15 | 15 | // set error reporting | 
| @@ -18,7 +18,7 @@ discard block | ||
| 18 | 18 |  if (is_file("{$base_path}assets/cache/siteManager.php")) { | 
| 19 | 19 |  	include_once("{$base_path}assets/cache/siteManager.php"); | 
| 20 | 20 | } | 
| 21 | -if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { | |
| 21 | +if (!defined('MGR_DIR') && is_dir("{$base_path}manager")) { | |
| 22 | 22 |  	define('MGR_DIR', 'manager'); | 
| 23 | 23 | } | 
| 24 | 24 | |
| @@ -38,26 +38,26 @@ discard block | ||
| 38 | 38 | $moduleSQLDataFile = "setup.data.sql"; | 
| 39 | 39 | $moduleSQLResetFile = "setup.data.reset.sql"; | 
| 40 | 40 | |
| 41 | -$moduleChunks = array (); // chunks - array : name, description, type - 0:file or 1:content, file or content | |
| 42 | -$moduleTemplates = array (); // templates - array : name, description, type - 0:file or 1:content, file or content | |
| 43 | -$moduleSnippets = array (); // snippets - array : name, description, type - 0:file or 1:content, file or content,properties | |
| 44 | -$modulePlugins = array (); // plugins - array : name, description, type - 0:file or 1:content, file or content,properties, events,guid | |
| 45 | -$moduleModules = array (); // modules - array : name, description, type - 0:file or 1:content, file or content,properties, guid | |
| 46 | -$moduleTemplates = array (); // templates - array : name, description, type - 0:file or 1:content, file or content,properties | |
| 47 | -$moduleTVs = array (); // template variables - array : name, description, type - 0:file or 1:content, file or content,properties | |
| 41 | +$moduleChunks = array(); // chunks - array : name, description, type - 0:file or 1:content, file or content | |
| 42 | +$moduleTemplates = array(); // templates - array : name, description, type - 0:file or 1:content, file or content | |
| 43 | +$moduleSnippets = array(); // snippets - array : name, description, type - 0:file or 1:content, file or content,properties | |
| 44 | +$modulePlugins = array(); // plugins - array : name, description, type - 0:file or 1:content, file or content,properties, events,guid | |
| 45 | +$moduleModules = array(); // modules - array : name, description, type - 0:file or 1:content, file or content,properties, guid | |
| 46 | +$moduleTemplates = array(); // templates - array : name, description, type - 0:file or 1:content, file or content,properties | |
| 47 | +$moduleTVs = array(); // template variables - array : name, description, type - 0:file or 1:content, file or content,properties | |
| 48 | 48 | $moduleDependencies = array(); // module depedencies - array : module, table, column, type, name | 
| 49 | 49 | |
| 50 | -$errors= 0; | |
| 50 | +$errors = 0; | |
| 51 | 51 | |
| 52 | 52 | // get post back status | 
| 53 | 53 | $isPostBack = (count($_POST)); | 
| 54 | 54 | |
| 55 | 55 | $ph = ph(); | 
| 56 | -$ph = array_merge($ph,$_lang); | |
| 56 | +$ph = array_merge($ph, $_lang); | |
| 57 | 57 | $ph['install_language'] = $install_language; | 
| 58 | 58 | |
| 59 | 59 | ob_start(); | 
| 60 | -$action= isset ($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'language'; | |
| 60 | +$action = isset ($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'language'; | |
| 61 | 61 |  if (!@include_once("actions/action_{$action}.php")) { | 
| 62 | 62 |      die ("Invalid install action attempted. [action={$action}]"); | 
| 63 | 63 | } | 
| @@ -65,5 +65,5 @@ discard block | ||
| 65 | 65 | ob_end_clean(); | 
| 66 | 66 | |
| 67 | 67 |  $tpl = file_get_contents("{$base_path}install/template.tpl"); | 
| 68 | -echo parse($tpl,$ph); | |
| 68 | +echo parse($tpl, $ph); | |
| 69 | 69 | |
| @@ -4,18 +4,18 @@ | ||
| 4 | 4 | } | 
| 5 | 5 | |
| 6 | 6 |  switch($modx->manager->action) {
 | 
| 7 | - case 12: | |
| 8 | -		if(!$modx->hasPermission('edit_user')) {
 | |
| 9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 10 | - } | |
| 11 | - break; | |
| 12 | - case 11: | |
| 13 | -		if(!$modx->hasPermission('new_user')) {
 | |
| 14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 15 | - } | |
| 16 | - break; | |
| 17 | - default: | |
| 18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 7 | + case 12: | |
| 8 | +		    if(!$modx->hasPermission('edit_user')) {
 | |
| 9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 10 | + } | |
| 11 | + break; | |
| 12 | + case 11: | |
| 13 | +		    if(!$modx->hasPermission('new_user')) {
 | |
| 14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 15 | + } | |
| 16 | + break; | |
| 17 | + default: | |
| 18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 19 | 19 | } | 
| 20 | 20 | |
| 21 | 21 | $user = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; | 
| @@ -1,16 +1,16 @@ 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 | -switch($modx->manager->action) {
 | |
| 6 | +switch ($modx->manager->action) {
 | |
| 7 | 7 | case 12: | 
| 8 | -		if(!$modx->hasPermission('edit_user')) {
 | |
| 8 | +		if (!$modx->hasPermission('edit_user')) {
 | |
| 9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); | 
| 10 | 10 | } | 
| 11 | 11 | break; | 
| 12 | 12 | case 11: | 
| 13 | -		if(!$modx->hasPermission('new_user')) {
 | |
| 13 | +		if (!$modx->hasPermission('new_user')) {
 | |
| 14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); | 
| 15 | 15 | } | 
| 16 | 16 | break; | 
| @@ -21,17 +21,17 @@ discard block | ||
| 21 | 21 | $user = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; | 
| 22 | 22 | |
| 23 | 23 | // check to see the snippet editor isn't locked | 
| 24 | -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
 | |
| 25 | -if($username = $modx->db->getValue($rs)) {
 | |
| 24 | +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'");
 | |
| 25 | +if ($username = $modx->db->getValue($rs)) {
 | |
| 26 | 26 | $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); | 
| 27 | 27 | } | 
| 28 | 28 | // end check for lock | 
| 29 | 29 | |
| 30 | -if($modx->manager->action == '12') {
 | |
| 30 | +if ($modx->manager->action == '12') {
 | |
| 31 | 31 | // get user attribute | 
| 32 | 32 |  	$rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'");
 | 
| 33 | 33 | $userdata = $modx->db->getRow($rs); | 
| 34 | -	if(!$userdata) {
 | |
| 34 | +	if (!$userdata) {
 | |
| 35 | 35 |  		$modx->webAlertAndQuit("No user returned!");
 | 
| 36 | 36 | } | 
| 37 | 37 | |
| @@ -39,10 +39,10 @@ discard block | ||
| 39 | 39 | // get user settings | 
| 40 | 40 |  	$rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
 | 
| 41 | 41 | $usersettings = array(); | 
| 42 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; | |
| 42 | + while ($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; | |
| 43 | 43 | // manually extract so that user display settings are not overwritten | 
| 44 | -	foreach($usersettings as $k => $v) {
 | |
| 45 | -		if($k != 'manager_language' && $k != 'manager_theme') {
 | |
| 44 | +	foreach ($usersettings as $k => $v) {
 | |
| 45 | +		if ($k != 'manager_language' && $k != 'manager_theme') {
 | |
| 46 | 46 |  			${$k} = $v;
 | 
| 47 | 47 | } | 
| 48 | 48 | } | 
| @@ -50,7 +50,7 @@ discard block | ||
| 50 | 50 | // get user name | 
| 51 | 51 |  	$rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
 | 
| 52 | 52 | $usernamedata = $modx->db->getRow($rs); | 
| 53 | -	if(!$usernamedata) {
 | |
| 53 | +	if (!$usernamedata) {
 | |
| 54 | 54 |  		$modx->webAlertAndQuit("No user returned while getting username!");
 | 
| 55 | 55 | } | 
| 56 | 56 | $_SESSION['itemname'] = $usernamedata['username']; | 
| @@ -62,14 +62,14 @@ discard block | ||
| 62 | 62 | } | 
| 63 | 63 | |
| 64 | 64 | // avoid doubling htmlspecialchars (already encoded in DB) | 
| 65 | -foreach($userdata as $key => $val) {
 | |
| 65 | +foreach ($userdata as $key => $val) {
 | |
| 66 | 66 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); | 
| 67 | 67 | }; | 
| 68 | 68 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); | 
| 69 | 69 | |
| 70 | 70 | // restore saved form | 
| 71 | 71 | $formRestored = false; | 
| 72 | -if($modx->manager->hasFormValues()) {
 | |
| 72 | +if ($modx->manager->hasFormValues()) {
 | |
| 73 | 73 | $modx->manager->loadFormValues(); | 
| 74 | 74 | // restore post values | 
| 75 | 75 | $userdata = array_merge($userdata, $_POST); | 
| @@ -84,13 +84,13 @@ discard block | ||
| 84 | 84 | // include the country list language file | 
| 85 | 85 | $_country_lang = array(); | 
| 86 | 86 | include_once "lang/country/english_country.inc.php"; | 
| 87 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
 | |
| 88 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; | |
| 87 | +if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) {
 | |
| 88 | + include_once "lang/country/".$manager_language."_country.inc.php"; | |
| 89 | 89 | } | 
| 90 | 90 | asort($_country_lang); | 
| 91 | 91 | |
| 92 | 92 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; | 
| 93 | -if($which_browser == 'default') {
 | |
| 93 | +if ($which_browser == 'default') {
 | |
| 94 | 94 | $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; | 
| 95 | 95 | } | 
| 96 | 96 | ?> | 
| @@ -182,7 +182,7 @@ discard block | ||
| 182 | 182 | document.userform.save.click(); | 
| 183 | 183 | }, | 
| 184 | 184 |  		delete: function() {
 | 
| 185 | -			<?php if($_GET['id'] == $modx->getLoginUserID()) { ?>
 | |
| 185 | +			<?php if ($_GET['id'] == $modx->getLoginUserID()) { ?>
 | |
| 186 | 186 |  			alert("<?php echo $_lang['alert_delete_self']; ?>");
 | 
| 187 | 187 |  			<?php } else { ?>
 | 
| 188 | 188 |  			if(confirm("<?php echo $_lang['confirm_delete_user']; ?>") === true) {
 | 
| @@ -205,7 +205,7 @@ discard block | ||
| 205 | 205 |  	$evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
 | 
| 206 | 206 | "id" => $user | 
| 207 | 207 | )); | 
| 208 | -	if(is_array($evtOut)) {
 | |
| 208 | +	if (is_array($evtOut)) {
 | |
| 209 | 209 |  		echo implode("", $evtOut);
 | 
| 210 | 210 | } | 
| 211 | 211 | ?> | 
| @@ -214,7 +214,7 @@ discard block | ||
| 214 | 214 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> | 
| 215 | 215 | |
| 216 | 216 | <h1> | 
| 217 | -        <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['user_title']) ?>
 | |
| 217 | +        <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['user_title']) ?>
 | |
| 218 | 218 | </h1> | 
| 219 | 219 | |
| 220 | 220 | <?php echo $_style['actionbuttons']['dynamic']['user'] ?> | 
| @@ -232,13 +232,13 @@ discard block | ||
| 232 | 232 | <table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser"> | 
| 233 | 233 | <tr> | 
| 234 | 234 | <td colspan="3"><span id="blocked" class="warning"> | 
| 235 | -							<?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?>
 | |
| 235 | +							<?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?>
 | |
| 236 | 236 | <?php echo $_lang['user_is_blocked']; ?> | 
| 237 | 237 | <?php } ?> | 
| 238 | 238 | </span> | 
| 239 | 239 | <br /></td> | 
| 240 | 240 | </tr> | 
| 241 | -					<?php if(!empty($userdata['id'])) { ?>
 | |
| 241 | +					<?php if (!empty($userdata['id'])) { ?>
 | |
| 242 | 242 | <tr id="showname" style="display: <?php echo ($modx->manager->action == '12' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> | 
| 243 | 243 | <td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i> <b><?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span> | 
| 244 | 244 | <input type="hidden" name="oldusername" value="<?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" /> | 
| @@ -251,7 +251,7 @@ discard block | ||
| 251 | 251 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->htmlspecialchars($usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> | 
| 252 | 252 | </tr> | 
| 253 | 253 | <tr> | 
| 254 | - <th><?php echo $modx->manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> | |
| 254 | + <th><?php echo $modx->manager->action == '11' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> | |
| 255 | 255 | <td> </td> | 
| 256 | 256 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->manager->action == "11" ? " checked disabled" : ""; ?>> | 
| 257 | 257 | <input type="hidden" name="newpassword" value="<?php echo $modx->manager->action == "11" ? 1 : 0; ?>" onChange="documentDirty=true;" /> | 
| @@ -305,8 +305,8 @@ discard block | ||
| 305 | 305 | ?> | 
| 306 | 306 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> | 
| 307 | 307 | <?php | 
| 308 | -								while($row = $modx->db->getRow($rs)) {
 | |
| 309 | -									if($modx->manager->action == '11') {
 | |
| 308 | +								while ($row = $modx->db->getRow($rs)) {
 | |
| 309 | +									if ($modx->manager->action == '11') {
 | |
| 310 | 310 | $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; | 
| 311 | 311 |  									} else {
 | 
| 312 | 312 | $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; | 
| @@ -360,8 +360,8 @@ discard block | ||
| 360 | 360 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> | 
| 361 | 361 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> | 
| 362 | 362 | <?php | 
| 363 | -								foreach($_country_lang as $key => $country) {
 | |
| 364 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; | |
| 363 | +								foreach ($_country_lang as $key => $country) {
 | |
| 364 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; | |
| 365 | 365 | } | 
| 366 | 366 | ?> | 
| 367 | 367 | </select></td> | 
| @@ -387,7 +387,7 @@ discard block | ||
| 387 | 387 | <td> </td> | 
| 388 | 388 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->htmlspecialchars($userdata['comment']); ?></textarea></td> | 
| 389 | 389 | </tr> | 
| 390 | -					<?php if($modx->manager->action == '12') { ?>
 | |
| 390 | +					<?php if ($modx->manager->action == '12') { ?>
 | |
| 391 | 391 | <tr> | 
| 392 | 392 | <th><?php echo $_lang['user_logincount']; ?>:</th> | 
| 393 | 393 | <td> </td> | 
| @@ -424,7 +424,7 @@ discard block | ||
| 424 | 424 | </tr> | 
| 425 | 425 | <?php } ?> | 
| 426 | 426 | </table> | 
| 427 | -				<?php if($_GET['id'] == $modx->getLoginUserID()) { ?>
 | |
| 427 | +				<?php if ($_GET['id'] == $modx->getLoginUserID()) { ?>
 | |
| 428 | 428 | <p><?php echo $_lang['user_edit_self_msg']; ?></p> | 
| 429 | 429 | <?php } ?> | 
| 430 | 430 | </div> | 
| @@ -441,8 +441,8 @@ discard block | ||
| 441 | 441 | <?php | 
| 442 | 442 | $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; | 
| 443 | 443 |  								$dir = dir("includes/lang");
 | 
| 444 | -								while($file = $dir->read()) {
 | |
| 445 | -									if(strpos($file, ".inc.php") > 0) {
 | |
| 444 | +								while ($file = $dir->read()) {
 | |
| 445 | +									if (strpos($file, ".inc.php") > 0) {
 | |
| 446 | 446 | $endpos = strpos($file, "."); | 
| 447 | 447 | $languagename = substr($file, 0, $endpos); | 
| 448 | 448 | $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; | 
| @@ -529,17 +529,17 @@ discard block | ||
| 529 | 529 | <option value=""></option> | 
| 530 | 530 | <?php | 
| 531 | 531 |  								$dir = dir("media/style/");
 | 
| 532 | -								while($file = $dir->read()) {
 | |
| 533 | -									if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
 | |
| 532 | +								while ($file = $dir->read()) {
 | |
| 533 | +									if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
 | |
| 534 | 534 | $themename = $file; | 
| 535 | -										if($themename === 'common') {
 | |
| 535 | +										if ($themename === 'common') {
 | |
| 536 | 536 | continue; | 
| 537 | 537 | } | 
| 538 | - $attr = 'value="' . $themename . '" '; | |
| 539 | -										if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
 | |
| 538 | + $attr = 'value="'.$themename.'" '; | |
| 539 | +										if (isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
 | |
| 540 | 540 | $attr .= 'selected="selected" '; | 
| 541 | 541 | } | 
| 542 | -										echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
 | |
| 542 | +										echo "\t\t<option ".rtrim($attr).'>'.ucwords(str_replace("_", " ", $themename))."</option>\n";
 | |
| 543 | 543 | } | 
| 544 | 544 | } | 
| 545 | 545 | $dir->close(); | 
| @@ -556,12 +556,12 @@ discard block | ||
| 556 | 556 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> | 
| 557 | 557 | <?php | 
| 558 | 558 | $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; | 
| 559 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; | |
| 560 | -								foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
 | |
| 559 | + echo '<option value="default"'.$selected.'>'.$_lang['option_default']."</option>\n"; | |
| 560 | +								foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
 | |
| 561 | 561 |  									$dir = str_replace('\\', '/', $dir);
 | 
| 562 | 562 | $browser_name = substr($dir, strrpos($dir, '/') + 1); | 
| 563 | 563 | $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; | 
| 564 | -									echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
 | |
| 564 | +									echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n";
 | |
| 565 | 565 | } | 
| 566 | 566 | ?> | 
| 567 | 567 | </select></td> | 
| @@ -588,7 +588,7 @@ discard block | ||
| 588 | 588 | </tr> | 
| 589 | 589 | <tr> | 
| 590 | 590 | <td> </td> | 
| 591 | - <td class='comment'><?php echo $_lang["uploadable_images_message"] . $_lang["user_upload_message"] ?></td> | |
| 591 | + <td class='comment'><?php echo $_lang["uploadable_images_message"].$_lang["user_upload_message"] ?></td> | |
| 592 | 592 | </tr> | 
| 593 | 593 | <tr> | 
| 594 | 594 | <th><?php echo $_lang["uploadable_media_title"] ?></th> | 
| @@ -600,7 +600,7 @@ discard block | ||
| 600 | 600 | </tr> | 
| 601 | 601 | <tr> | 
| 602 | 602 | <td> </td> | 
| 603 | - <td class='comment'><?php echo $_lang["uploadable_media_message"] . $_lang["user_upload_message"] ?></td> | |
| 603 | + <td class='comment'><?php echo $_lang["uploadable_media_message"].$_lang["user_upload_message"] ?></td> | |
| 604 | 604 | </tr> | 
| 605 | 605 | <tr> | 
| 606 | 606 | <th><?php echo $_lang["uploadable_flash_title"] ?></th> | 
| @@ -612,7 +612,7 @@ discard block | ||
| 612 | 612 | </tr> | 
| 613 | 613 | <tr> | 
| 614 | 614 | <td> </td> | 
| 615 | - <td class='comment'><?php echo $_lang["uploadable_flash_message"] . $_lang["user_upload_message"] ?></td> | |
| 615 | + <td class='comment'><?php echo $_lang["uploadable_flash_message"].$_lang["user_upload_message"] ?></td> | |
| 616 | 616 | </tr> | 
| 617 | 617 | <tr> | 
| 618 | 618 | <th><?php echo $_lang["uploadable_files_title"] ?></th> | 
| @@ -624,7 +624,7 @@ discard block | ||
| 624 | 624 | </tr> | 
| 625 | 625 | <tr> | 
| 626 | 626 | <td> </td> | 
| 627 | - <td class='comment'><?php echo $_lang["uploadable_files_message"] . $_lang["user_upload_message"] ?></td> | |
| 627 | + <td class='comment'><?php echo $_lang["uploadable_files_message"].$_lang["user_upload_message"] ?></td> | |
| 628 | 628 | </tr> | 
| 629 | 629 | <tr class='row2'> | 
| 630 | 630 | <th><?php echo $_lang["upload_maxsize_title"] ?></th> | 
| @@ -643,11 +643,11 @@ discard block | ||
| 643 | 643 | $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; | 
| 644 | 644 | // invoke OnRichTextEditorRegister event | 
| 645 | 645 |  								$evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
 | 
| 646 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; | |
| 647 | -								if(is_array($evtOut)) {
 | |
| 648 | -									for($i = 0; $i < count($evtOut); $i++) {
 | |
| 646 | + echo "<option value='none'".($edt == 'none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n"; | |
| 647 | +								if (is_array($evtOut)) {
 | |
| 648 | +									for ($i = 0; $i < count($evtOut); $i++) {
 | |
| 649 | 649 | $editor = $evtOut[$i]; | 
| 650 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; | |
| 650 | + echo "<option value='$editor'".($edt == $editor ? " selected='selected'" : "").">$editor</option>\n"; | |
| 651 | 651 | } | 
| 652 | 652 | } | 
| 653 | 653 | ?> | 
| @@ -685,7 +685,7 @@ discard block | ||
| 685 | 685 | <?php | 
| 686 | 686 | // invoke OnInterfaceSettingsRender event | 
| 687 | 687 |  				$evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
 | 
| 688 | -				if(is_array($evtOut)) {
 | |
| 688 | +				if (is_array($evtOut)) {
 | |
| 689 | 689 |  					echo implode("", $evtOut);
 | 
| 690 | 690 | } | 
| 691 | 691 | ?> | 
| @@ -712,7 +712,7 @@ discard block | ||
| 712 | 712 |  					function BrowseServer() {
 | 
| 713 | 713 | var w = screen.width * 0.7; | 
| 714 | 714 | var h = screen.height * 0.7; | 
| 715 | -						OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h);
 | |
| 715 | +						OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h);
 | |
| 716 | 716 | } | 
| 717 | 717 | |
| 718 | 718 |  					function SetUrl(url, width, height, alt) {
 | 
| @@ -735,17 +735,17 @@ discard block | ||
| 735 | 735 | </tr> | 
| 736 | 736 | </table> | 
| 737 | 737 | </div> | 
| 738 | -			<?php if($use_udperms == 1) {
 | |
| 738 | +			<?php if ($use_udperms == 1) {
 | |
| 739 | 739 | |
| 740 | 740 | $groupsarray = array(); | 
| 741 | 741 | |
| 742 | -			if($modx->manager->action == '12') { // only do this bit if the user is being edited
 | |
| 742 | +			if ($modx->manager->action == '12') { // only do this bit if the user is being edited
 | |
| 743 | 743 |  				$rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
 | 
| 744 | 744 |  				$groupsarray = $modx->db->getColumn('user_group', $rs);
 | 
| 745 | 745 | } | 
| 746 | 746 | // retain selected doc groups between post | 
| 747 | -			if(is_array($_POST['user_groups'])) {
 | |
| 748 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; | |
| 747 | +			if (is_array($_POST['user_groups'])) {
 | |
| 748 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; | |
| 749 | 749 | } | 
| 750 | 750 | ?> | 
| 751 | 751 | <div class="tab-page" id="tabAccess"> | 
| @@ -754,8 +754,8 @@ discard block | ||
| 754 | 754 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> | 
| 755 | 755 | <?php | 
| 756 | 756 |  				$rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
 | 
| 757 | -				while($row = $modx->db->getRow($rs)) {
 | |
| 758 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; | |
| 757 | +				while ($row = $modx->db->getRow($rs)) {
 | |
| 758 | + echo "<label><input type='checkbox' name='user_groups[]' value='".$row['id']."'".(in_array($row['id'], $groupsarray) ? " checked='checked'" : "")." />".$row['name']."</label><br />"; | |
| 759 | 759 | } | 
| 760 | 760 | } | 
| 761 | 761 | ?> | 
| @@ -768,7 +768,7 @@ discard block | ||
| 768 | 768 |  	$evtOut = $modx->invokeEvent("OnUserFormRender", array(
 | 
| 769 | 769 | "id" => $user | 
| 770 | 770 | )); | 
| 771 | -	if(is_array($evtOut)) {
 | |
| 771 | +	if (is_array($evtOut)) {
 | |
| 772 | 772 |  		echo implode("", $evtOut);
 | 
| 773 | 773 | } | 
| 774 | 774 | ?> | 
| @@ -4,18 +4,18 @@ | ||
| 4 | 4 | } | 
| 5 | 5 | |
| 6 | 6 |  switch($modx->manager->action) {
 | 
| 7 | - case 88: | |
| 8 | -		if(!$modx->hasPermission('edit_web_user')) {
 | |
| 9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 10 | - } | |
| 11 | - break; | |
| 12 | - case 87: | |
| 13 | -		if(!$modx->hasPermission('new_web_user')) {
 | |
| 14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 15 | - } | |
| 16 | - break; | |
| 17 | - default: | |
| 18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 7 | + case 88: | |
| 8 | +		    if(!$modx->hasPermission('edit_web_user')) {
 | |
| 9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 10 | + } | |
| 11 | + break; | |
| 12 | + case 87: | |
| 13 | +		    if(!$modx->hasPermission('new_web_user')) {
 | |
| 14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 15 | + } | |
| 16 | + break; | |
| 17 | + default: | |
| 18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 19 | 19 | } | 
| 20 | 20 | |
| 21 | 21 | $user = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; | 
| @@ -1,16 +1,16 @@ 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 | -switch($modx->manager->action) {
 | |
| 6 | +switch ($modx->manager->action) {
 | |
| 7 | 7 | case 88: | 
| 8 | -		if(!$modx->hasPermission('edit_web_user')) {
 | |
| 8 | +		if (!$modx->hasPermission('edit_web_user')) {
 | |
| 9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); | 
| 10 | 10 | } | 
| 11 | 11 | break; | 
| 12 | 12 | case 87: | 
| 13 | -		if(!$modx->hasPermission('new_web_user')) {
 | |
| 13 | +		if (!$modx->hasPermission('new_web_user')) {
 | |
| 14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); | 
| 15 | 15 | } | 
| 16 | 16 | break; | 
| @@ -22,30 +22,30 @@ discard block | ||
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | // check to see the snippet editor isn't locked | 
| 25 | -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
 | |
| 26 | -if($username = $modx->db->getValue($rs)) {
 | |
| 25 | +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'");
 | |
| 26 | +if ($username = $modx->db->getValue($rs)) {
 | |
| 27 | 27 | $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); | 
| 28 | 28 | } | 
| 29 | 29 | // end check for lock | 
| 30 | 30 | |
| 31 | -if($modx->manager->action == '88') {
 | |
| 31 | +if ($modx->manager->action == '88') {
 | |
| 32 | 32 | // get user attributes | 
| 33 | 33 |  	$rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'");
 | 
| 34 | 34 | $userdata = $modx->db->getRow($rs); | 
| 35 | -	if(!$userdata) {
 | |
| 35 | +	if (!$userdata) {
 | |
| 36 | 36 |  		$modx->webAlertAndQuit("No user returned!");
 | 
| 37 | 37 | } | 
| 38 | 38 | |
| 39 | 39 | // get user settings | 
| 40 | 40 |  	$rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'");
 | 
| 41 | 41 | $usersettings = array(); | 
| 42 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; | |
| 42 | + while ($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; | |
| 43 | 43 | extract($usersettings, EXTR_OVERWRITE); | 
| 44 | 44 | |
| 45 | 45 | // get user name | 
| 46 | 46 |  	$rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'");
 | 
| 47 | 47 | $usernamedata = $modx->db->getRow($rs); | 
| 48 | -	if(!$usernamedata) {
 | |
| 48 | +	if (!$usernamedata) {
 | |
| 49 | 49 |  		$modx->webAlertAndQuit("No user returned while getting username!");
 | 
| 50 | 50 | } | 
| 51 | 51 | $_SESSION['itemname'] = $usernamedata['username']; | 
| @@ -57,14 +57,14 @@ discard block | ||
| 57 | 57 | } | 
| 58 | 58 | |
| 59 | 59 | // avoid doubling htmlspecialchars (already encoded in DB) | 
| 60 | -foreach($userdata as $key => $val) {
 | |
| 60 | +foreach ($userdata as $key => $val) {
 | |
| 61 | 61 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); | 
| 62 | 62 | }; | 
| 63 | 63 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); | 
| 64 | 64 | |
| 65 | 65 | // restore saved form | 
| 66 | 66 | $formRestored = false; | 
| 67 | -if($modx->manager->hasFormValues()) {
 | |
| 67 | +if ($modx->manager->hasFormValues()) {
 | |
| 68 | 68 | $modx->manager->loadFormValues(); | 
| 69 | 69 | // restore post values | 
| 70 | 70 | $userdata = array_merge($userdata, $_POST); | 
| @@ -78,8 +78,8 @@ discard block | ||
| 78 | 78 | |
| 79 | 79 | // include the country list language file | 
| 80 | 80 | $_country_lang = array(); | 
| 81 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
 | |
| 82 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; | |
| 81 | +if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) {
 | |
| 82 | + include_once "lang/country/".$manager_language."_country.inc.php"; | |
| 83 | 83 |  } else {
 | 
| 84 | 84 | include_once "lang/country/english_country.inc.php"; | 
| 85 | 85 | } | 
| @@ -191,7 +191,7 @@ discard block | ||
| 191 | 191 | <?php | 
| 192 | 192 | // invoke OnWUsrFormPrerender event | 
| 193 | 193 |  	$evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user));
 | 
| 194 | -	if(is_array($evtOut)) {
 | |
| 194 | +	if (is_array($evtOut)) {
 | |
| 195 | 195 |  		echo implode("", $evtOut);
 | 
| 196 | 196 | } | 
| 197 | 197 | ?> | 
| @@ -200,7 +200,7 @@ discard block | ||
| 200 | 200 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> | 
| 201 | 201 | |
| 202 | 202 | <h1> | 
| 203 | -        <i class="fa fa fa-users"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['web_user_title']) ?>
 | |
| 203 | +        <i class="fa fa fa-users"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['web_user_title']) ?>
 | |
| 204 | 204 | </h1> | 
| 205 | 205 | |
| 206 | 206 | <?php echo $_style['actionbuttons']['dynamic']['user'] ?> | 
| @@ -218,13 +218,13 @@ discard block | ||
| 218 | 218 | <table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser"> | 
| 219 | 219 | <tr> | 
| 220 | 220 | <td colspan="3"><span id="blocked" class="warning"> | 
| 221 | -							<?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?>
 | |
| 221 | +							<?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?>
 | |
| 222 | 222 | <b><?php echo $_lang['user_is_blocked']; ?></b> | 
| 223 | 223 | <?php } ?> | 
| 224 | 224 | </span> | 
| 225 | 225 | <br /></td> | 
| 226 | 226 | </tr> | 
| 227 | -					<?php if(!empty($userdata['id'])) { ?>
 | |
| 227 | +					<?php if (!empty($userdata['id'])) { ?>
 | |
| 228 | 228 | <tr id="showname" style="display: <?php echo ($modx->manager->action == '88' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> | 
| 229 | 229 | <td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i> <b><?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span> | 
| 230 | 230 | <input type="hidden" name="oldusername" value="<?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" /> | 
| @@ -237,7 +237,7 @@ discard block | ||
| 237 | 237 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->htmlspecialchars(isset($_POST['newusername']) ? $_POST['newusername'] : $usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> | 
| 238 | 238 | </tr> | 
| 239 | 239 | <tr> | 
| 240 | - <th><?php echo $modx->manager->action == '87' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> | |
| 240 | + <th><?php echo $modx->manager->action == '87' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> | |
| 241 | 241 | <td> </td> | 
| 242 | 242 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->manager->action == "87" ? " checked disabled" : ""; ?>> | 
| 243 | 243 | <input type="hidden" name="newpassword" value="<?php echo $modx->manager->action == "87" ? 1 : 0; ?>" onChange="documentDirty=true;" /> | 
| @@ -324,8 +324,8 @@ discard block | ||
| 324 | 324 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> | 
| 325 | 325 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> | 
| 326 | 326 | <?php | 
| 327 | -								foreach($_country_lang as $key => $country) {
 | |
| 328 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; | |
| 327 | +								foreach ($_country_lang as $key => $country) {
 | |
| 328 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; | |
| 329 | 329 | } | 
| 330 | 330 | ?> | 
| 331 | 331 | </select></td> | 
| @@ -351,7 +351,7 @@ discard block | ||
| 351 | 351 | <td> </td> | 
| 352 | 352 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->htmlspecialchars(isset($_POST['comment']) ? $_POST['comment'] : $userdata['comment']); ?></textarea></td> | 
| 353 | 353 | </tr> | 
| 354 | -					<?php if($modx->manager->action == '88') { ?>
 | |
| 354 | +					<?php if ($modx->manager->action == '88') { ?>
 | |
| 355 | 355 | <tr> | 
| 356 | 356 | <th><?php echo $_lang['user_logincount']; ?>:</th> | 
| 357 | 357 | <td> </td> | 
| @@ -472,7 +472,7 @@ discard block | ||
| 472 | 472 |  					function BrowseServer() {
 | 
| 473 | 473 | var w = screen.width * 0.7; | 
| 474 | 474 | var h = screen.height * 0.7; | 
| 475 | -						OpenServerBrowser("<?php echo MODX_MANAGER_URL;?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h);
 | |
| 475 | +						OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h);
 | |
| 476 | 476 | } | 
| 477 | 477 | |
| 478 | 478 |  					function SetUrl(url, width, height, alt) {
 | 
| @@ -491,22 +491,22 @@ discard block | ||
| 491 | 491 | <td class='comment'><?php echo $_lang["user_photo_message"] ?></td> | 
| 492 | 492 | </tr> | 
| 493 | 493 | <tr> | 
| 494 | - <td colspan="2" align="center"><img name="iphoto" src="<?php echo isset($_POST['photo']) ? (strpos($_POST['photo'], "http://") === false ? MODX_SITE_URL : "") . $_POST['photo'] : !empty($userdata['photo']) ? (strpos($userdata['photo'], "http://") === false ? MODX_SITE_URL : "") . $userdata['photo'] : $_style["tx"]; ?>" /></td> | |
| 494 | + <td colspan="2" align="center"><img name="iphoto" src="<?php echo isset($_POST['photo']) ? (strpos($_POST['photo'], "http://") === false ? MODX_SITE_URL : "").$_POST['photo'] : !empty($userdata['photo']) ? (strpos($userdata['photo'], "http://") === false ? MODX_SITE_URL : "").$userdata['photo'] : $_style["tx"]; ?>" /></td> | |
| 495 | 495 | </tr> | 
| 496 | 496 | </table> | 
| 497 | 497 | </div> | 
| 498 | 498 | <?php | 
| 499 | -			if($use_udperms == 1) {
 | |
| 499 | +			if ($use_udperms == 1) {
 | |
| 500 | 500 | |
| 501 | 501 | $groupsarray = array(); | 
| 502 | 502 | |
| 503 | -			if($modx->manager->action == '88') { // only do this bit if the user is being edited
 | |
| 503 | +			if ($modx->manager->action == '88') { // only do this bit if the user is being edited
 | |
| 504 | 504 |  				$rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'");
 | 
| 505 | 505 |  				$groupsarray = $modx->db->getColumn('webgroup', $rs);
 | 
| 506 | 506 | } | 
| 507 | 507 | // retain selected user groups between post | 
| 508 | -			if(is_array($_POST['user_groups'])) {
 | |
| 509 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; | |
| 508 | +			if (is_array($_POST['user_groups'])) {
 | |
| 509 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; | |
| 510 | 510 | } | 
| 511 | 511 | ?> | 
| 512 | 512 | <div class="tab-page" id="tabPermissions"> | 
| @@ -515,8 +515,8 @@ discard block | ||
| 515 | 515 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> | 
| 516 | 516 | <?php | 
| 517 | 517 |  				$rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name');
 | 
| 518 | -				while($row = $modx->db->getRow($rs)) {
 | |
| 519 | - echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />'; | |
| 518 | +				while ($row = $modx->db->getRow($rs)) {
 | |
| 519 | + echo '<label><input type="checkbox" name="user_groups[]" value="'.$row['id'].'"'.(in_array($row['id'], $groupsarray) ? ' checked="checked"' : '').' />'.$row['name'].'</label><br />'; | |
| 520 | 520 | } | 
| 521 | 521 | } | 
| 522 | 522 | ?> | 
| @@ -526,7 +526,7 @@ discard block | ||
| 526 | 526 |  			$evtOut = $modx->invokeEvent("OnWUsrFormRender", array(
 | 
| 527 | 527 | "id" => $user | 
| 528 | 528 | )); | 
| 529 | -			if(is_array($evtOut)) {
 | |
| 529 | +			if (is_array($evtOut)) {
 | |
| 530 | 530 |  				echo implode("", $evtOut);
 | 
| 531 | 531 | } | 
| 532 | 532 | ?> | 
| @@ -3,18 +3,18 @@ | ||
| 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 |  switch($modx->manager->action) {
 | 
| 6 | - case 107: | |
| 7 | -		if(!$modx->hasPermission('new_module')) {
 | |
| 8 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 9 | - } | |
| 10 | - break; | |
| 11 | - case 108: | |
| 12 | -		if(!$modx->hasPermission('edit_module')) {
 | |
| 13 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 14 | - } | |
| 15 | - break; | |
| 16 | - default: | |
| 17 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 6 | + case 107: | |
| 7 | +		    if(!$modx->hasPermission('new_module')) {
 | |
| 8 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 9 | + } | |
| 10 | + break; | |
| 11 | + case 108: | |
| 12 | +		    if(!$modx->hasPermission('edit_module')) {
 | |
| 13 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 14 | + } | |
| 15 | + break; | |
| 16 | + default: | |
| 17 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 18 | 18 | } | 
| 19 | 19 | $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; | 
| 20 | 20 | // Get table names (alphabetical) | 
| @@ -1,15 +1,15 @@ discard block | ||
| 1 | 1 | <?php | 
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
 | |
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
 | |
| 3 | 3 |  	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
 | 
| 4 | 4 | } | 
| 5 | -switch($modx->manager->action) {
 | |
| 5 | +switch ($modx->manager->action) {
 | |
| 6 | 6 | case 107: | 
| 7 | -		if(!$modx->hasPermission('new_module')) {
 | |
| 7 | +		if (!$modx->hasPermission('new_module')) {
 | |
| 8 | 8 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); | 
| 9 | 9 | } | 
| 10 | 10 | break; | 
| 11 | 11 | case 108: | 
| 12 | -		if(!$modx->hasPermission('edit_module')) {
 | |
| 12 | +		if (!$modx->hasPermission('edit_module')) {
 | |
| 13 | 13 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); | 
| 14 | 14 | } | 
| 15 | 15 | break; | 
| @@ -29,16 +29,16 @@ discard block | ||
| 29 | 29 |  $tbl_site_templates = $modx->getFullTableName('site_templates');
 | 
| 30 | 30 |  $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
 | 
| 31 | 31 | // create globally unique identifiers (guid) | 
| 32 | -function createGUID() {
 | |
| 32 | +function createGUID(){
 | |
| 33 | 33 | srand((double) microtime() * 1000000); | 
| 34 | 34 | $r = rand(); | 
| 35 | - $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); | |
| 35 | + $u = uniqid(getmypid().$r.(double) microtime() * 1000000, 1); | |
| 36 | 36 | $m = md5($u); | 
| 37 | 37 | return $m; | 
| 38 | 38 | } | 
| 39 | 39 | |
| 40 | 40 | // check to see the module editor isn't locked | 
| 41 | -if($lockedEl = $modx->elementIsLocked(6, $id)) {
 | |
| 41 | +if ($lockedEl = $modx->elementIsLocked(6, $id)) {
 | |
| 42 | 42 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); | 
| 43 | 43 | } | 
| 44 | 44 | // end check for lock | 
| @@ -46,29 +46,29 @@ discard block | ||
| 46 | 46 | // Lock snippet for other users to edit | 
| 47 | 47 | $modx->lockElement(6, $id); | 
| 48 | 48 | |
| 49 | -if(isset($_GET['id'])) {
 | |
| 49 | +if (isset($_GET['id'])) {
 | |
| 50 | 50 |  	$rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
 | 
| 51 | 51 | $content = $modx->db->getRow($rs); | 
| 52 | -	if(!$content) {
 | |
| 52 | +	if (!$content) {
 | |
| 53 | 53 |  		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
 | 
| 54 | 54 | } | 
| 55 | 55 |  	$content['properties'] = str_replace("&", "&", $content['properties']);
 | 
| 56 | 56 | $_SESSION['itemname'] = $content['name']; | 
| 57 | -	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
 | |
| 57 | +	if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
 | |
| 58 | 58 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); | 
| 59 | 59 | } | 
| 60 | 60 |  } else {
 | 
| 61 | 61 | $_SESSION['itemname'] = $_lang["new_module"]; | 
| 62 | 62 | $content['wrap'] = '1'; | 
| 63 | 63 | } | 
| 64 | -if($modx->manager->hasFormValues()) {
 | |
| 64 | +if ($modx->manager->hasFormValues()) {
 | |
| 65 | 65 | $modx->manager->loadFormValues(); | 
| 66 | 66 | } | 
| 67 | 67 | |
| 68 | 68 | // Add lock-element JS-Script | 
| 69 | 69 | $lockElementId = $id; | 
| 70 | 70 | $lockElementType = 6; | 
| 71 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); | |
| 71 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); | |
| 72 | 72 | ?> | 
| 73 | 73 | <script type="text/javascript"> | 
| 74 | 74 |  	function loadDependencies() {
 | 
| @@ -415,7 +415,7 @@ discard block | ||
| 415 | 415 |  	function BrowseServer() {
 | 
| 416 | 416 | var w = screen.width * 0.7; | 
| 417 | 417 | var h = screen.height * 0.7; | 
| 418 | -		OpenServerBrowser("<?= MODX_MANAGER_URL;?>media/browser/<?= $which_browser;?>/browser.php?Type=images", w, h);
 | |
| 418 | +		OpenServerBrowser("<?= MODX_MANAGER_URL; ?>media/browser/<?= $which_browser; ?>/browser.php?Type=images", w, h);
 | |
| 419 | 419 | } | 
| 420 | 420 | |
| 421 | 421 |  	function SetUrl(url, width, height, alt) {
 | 
| @@ -435,7 +435,7 @@ discard block | ||
| 435 | 435 | <?php | 
| 436 | 436 | // invoke OnModFormPrerender event | 
| 437 | 437 |  	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
 | 
| 438 | -	if(is_array($evtOut)) {
 | |
| 438 | +	if (is_array($evtOut)) {
 | |
| 439 | 439 |  		echo implode('', $evtOut);
 | 
| 440 | 440 | } | 
| 441 | 441 | |
| @@ -449,7 +449,7 @@ discard block | ||
| 449 | 449 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> | 
| 450 | 450 | |
| 451 | 451 | <h1> | 
| 452 | -		<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>
 | |
| 452 | +		<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>
 | |
| 453 | 453 | </h1> | 
| 454 | 454 | |
| 455 | 455 | <?= $_style['actionbuttons']['dynamic']['element'] ?> | 
| @@ -474,8 +474,8 @@ discard block | ||
| 474 | 474 | <div class="col-md-9 col-lg-10"> | 
| 475 | 475 | <div class="form-control-name clearfix"> | 
| 476 | 476 | <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> | 
| 477 | -								<?php if($modx->hasPermission('save_role')): ?>
 | |
| 478 | - <label class="custom-control" title="<?= $_lang['lock_module'] . "\n" . $_lang['lock_module_msg'] ?>" tooltip> | |
| 477 | +								<?php if ($modx->hasPermission('save_role')): ?>
 | |
| 478 | + <label class="custom-control" title="<?= $_lang['lock_module']."\n".$_lang['lock_module_msg'] ?>" tooltip> | |
| 479 | 479 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> | 
| 480 | 480 | <i class="fa fa-lock"></i> | 
| 481 | 481 | </label> | 
| @@ -497,9 +497,9 @@ discard block | ||
| 497 | 497 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> | 
| 498 | 498 | <option> </option> | 
| 499 | 499 | <?php | 
| 500 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); | |
| 501 | -								foreach(getCategories() as $n => $v) {
 | |
| 502 | - echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; | |
| 500 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); | |
| 501 | +								foreach (getCategories() as $n => $v) {
 | |
| 502 | + echo "\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v['category'])."</option>\n"; | |
| 503 | 503 | } | 
| 504 | 504 | ?> | 
| 505 | 505 | </select> | 
| @@ -531,7 +531,7 @@ discard block | ||
| 531 | 531 | <div class="form-group"> | 
| 532 | 532 | <div class="form-row"> | 
| 533 | 533 | <label for="disabled"><input name="disabled" id="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> | 
| 534 | - <?= ($content['disabled'] == 1 ? '<span class="text-danger">' . $_lang['module_disabled'] . '</span>' : $_lang['module_disabled']) ?></label> | |
| 534 | + <?= ($content['disabled'] == 1 ? '<span class="text-danger">'.$_lang['module_disabled'].'</span>' : $_lang['module_disabled']) ?></label> | |
| 535 | 535 | </div> | 
| 536 | 536 | <div class="form-row"> | 
| 537 | 537 | <label for="parse_docblock"> | 
| @@ -596,7 +596,7 @@ discard block | ||
| 596 | 596 | </div> | 
| 597 | 597 | <!-- HTML text editor end --> | 
| 598 | 598 | </div> | 
| 599 | - <?php if($modx->manager->action == '108'): ?> | |
| 599 | + <?php if ($modx->manager->action == '108'): ?> | |
| 600 | 600 | <!-- Dependencies --> | 
| 601 | 601 | <div class="tab-page" id="tabDepend"> | 
| 602 | 602 | <h2 class="tab"><?= $_lang['settings_dependencies'] ?></h2> | 
| @@ -624,14 +624,14 @@ discard block | ||
| 624 | 624 |  						LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50
 | 
| 625 | 625 |  						LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name');
 | 
| 626 | 626 | |
| 627 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; | |
| 627 | + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; | |
| 628 | 628 |  					$grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
 | 
| 629 | 629 | $grd->noRecordMsg = $_lang['no_records_found']; | 
| 630 | 630 | $grd->cssClass = 'grid'; | 
| 631 | 631 | $grd->columnHeaderClass = 'gridHeader'; | 
| 632 | 632 | $grd->itemClass = 'gridItem'; | 
| 633 | 633 | $grd->altItemClass = 'gridAltItem'; | 
| 634 | - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; | |
| 634 | + $grd->columns = $_lang['element_name']." ,".$_lang['type']; | |
| 635 | 635 | $grd->fields = "name,type"; | 
| 636 | 636 | echo $grd->render(); | 
| 637 | 637 | ?> | 
| @@ -644,13 +644,13 @@ discard block | ||
| 644 | 644 | <h2 class="tab"><?= $_lang['access_permissions'] ?></h2> | 
| 645 | 645 |  			<script type="text/javascript">tp.addTabPage(document.getElementById("tabPermissions"));</script>
 | 
| 646 | 646 | <div class="container container-body"> | 
| 647 | - <?php if($use_udperms == 1) : ?> | |
| 647 | + <?php if ($use_udperms == 1) : ?> | |
| 648 | 648 | <?php | 
| 649 | 649 | // fetch user access permissions for the module | 
| 650 | 650 |  					$rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
 | 
| 651 | 651 |  					$groupsarray = $modx->db->getColumn('usergroup', $rs);
 | 
| 652 | 652 | |
| 653 | -					if($modx->hasPermission('access_permissions')) {
 | |
| 653 | +					if ($modx->hasPermission('access_permissions')) {
 | |
| 654 | 654 | ?> | 
| 655 | 655 | <!-- User Group Access Permissions --> | 
| 656 | 656 | <script type="text/javascript"> | 
| @@ -678,22 +678,22 @@ discard block | ||
| 678 | 678 | } | 
| 679 | 679 | $chk = ''; | 
| 680 | 680 |  					$rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
 | 
| 681 | -					while($row = $modx->db->getRow($rs)) {
 | |
| 681 | +					while ($row = $modx->db->getRow($rs)) {
 | |
| 682 | 682 | $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); | 
| 683 | 683 | $checked = in_array($row['id'], $groupsarray); | 
| 684 | -						if($modx->hasPermission('access_permissions')) {
 | |
| 685 | -							if($checked) {
 | |
| 684 | +						if ($modx->hasPermission('access_permissions')) {
 | |
| 685 | +							if ($checked) {
 | |
| 686 | 686 | $notPublic = true; | 
| 687 | 687 | } | 
| 688 | - $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; | |
| 688 | + $chks .= '<label><input type="checkbox" name="usrgroups[]" value="'.$row['id'].'"'.($checked ? ' checked="checked"' : '').' onclick="makePublic(false)" /> '.$row['name']."</label><br />\n"; | |
| 689 | 689 |  						} else {
 | 
| 690 | -							if($checked) {
 | |
| 691 | - $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; | |
| 690 | +							if ($checked) {
 | |
| 691 | + $chks = '<input type="hidden" name="usrgroups[]" value="'.$row['id'].'" />'."\n".$chks; | |
| 692 | 692 | } | 
| 693 | 693 | } | 
| 694 | 694 | } | 
| 695 | -					if($modx->hasPermission('access_permissions')) {
 | |
| 696 | - $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; | |
| 695 | +					if ($modx->hasPermission('access_permissions')) {
 | |
| 696 | + $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; | |
| 697 | 697 | } | 
| 698 | 698 | echo $chks; | 
| 699 | 699 | ?> | 
| @@ -714,7 +714,7 @@ discard block | ||
| 714 | 714 | <?php | 
| 715 | 715 | // invoke OnModFormRender event | 
| 716 | 716 |  		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
 | 
| 717 | -		if(is_array($evtOut)) {
 | |
| 717 | +		if (is_array($evtOut)) {
 | |
| 718 | 718 |  			echo implode('', $evtOut);
 | 
| 719 | 719 | } | 
| 720 | 720 | ?> | 
| @@ -4,18 +4,18 @@ | ||
| 4 | 4 | } | 
| 5 | 5 | |
| 6 | 6 |  switch ($modx->manager->action) { | 
| 7 | - case 102: | |
| 8 | -        if (!$modx->hasPermission('edit_plugin')) { | |
| 9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 10 | - } | |
| 11 | - break; | |
| 12 | - case 101: | |
| 13 | -        if (!$modx->hasPermission('new_plugin')) { | |
| 7 | + case 102: | |
| 8 | +            if (!$modx->hasPermission('edit_plugin')) { | |
| 9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 10 | + } | |
| 11 | + break; | |
| 12 | + case 101: | |
| 13 | +            if (!$modx->hasPermission('new_plugin')) { | |
| 14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 15 | + } | |
| 16 | + break; | |
| 17 | + default: | |
| 14 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); | 
| 15 | - } | |
| 16 | - break; | |
| 17 | - default: | |
| 18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 19 | 19 | } | 
| 20 | 20 | |
| 21 | 21 | $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; | 
| @@ -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 | |
| @@ -56,7 +56,7 @@ discard block | ||
| 56 | 56 | // Add lock-element JS-Script | 
| 57 | 57 | $lockElementId = $id; | 
| 58 | 58 | $lockElementType = 5; | 
| 59 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); | |
| 59 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); | |
| 60 | 60 | |
| 61 | 61 | function bold($cond = false) | 
| 62 | 62 |  { | 
| @@ -478,7 +478,7 @@ discard block | ||
| 478 | 478 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> | 
| 479 | 479 | |
| 480 | 480 | <h1> | 
| 481 | -        <i class="fa fa-plug"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_plugin']) ?><i class="fa fa-question-circle help"></i> | |
| 481 | +        <i class="fa fa-plug"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_plugin']) ?><i class="fa fa-question-circle help"></i> | |
| 482 | 482 | </h1> | 
| 483 | 483 | |
| 484 | 484 | <?= $_style['actionbuttons']['dynamic']['element'] ?> | 
| @@ -504,7 +504,7 @@ discard block | ||
| 504 | 504 | <div class="form-control-name clearfix"> | 
| 505 | 505 | <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> | 
| 506 | 506 |                                  <?php if ($modx->hasPermission('save_role')): ?> | 
| 507 | - <label class="custom-control" title="<?= $_lang['lock_plugin'] . "\n" . $_lang['lock_plugin_msg'] ?>" tooltip> | |
| 507 | + <label class="custom-control" title="<?= $_lang['lock_plugin']."\n".$_lang['lock_plugin_msg'] ?>" tooltip> | |
| 508 | 508 | <input name="locked" type="checkbox" value="on"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> | 
| 509 | 509 | <i class="fa fa-lock"></i> | 
| 510 | 510 | </label> | 
| @@ -528,9 +528,9 @@ discard block | ||
| 528 | 528 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> | 
| 529 | 529 | <option> </option> | 
| 530 | 530 | <?php | 
| 531 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); | |
| 531 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); | |
| 532 | 532 |                                  foreach (getCategories() as $n => $v) { | 
| 533 | - echo '<option value="' . $v['id'] . '"' . ($content["category"] == $v["id"] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v["category"]) . "</option>"; | |
| 533 | + echo '<option value="'.$v['id'].'"'.($content["category"] == $v["id"] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v["category"])."</option>"; | |
| 534 | 534 | } | 
| 535 | 535 | ?> | 
| 536 | 536 | </select> | 
| @@ -546,7 +546,7 @@ discard block | ||
| 546 | 546 |                  <?php if ($modx->hasPermission('save_role')): ?> | 
| 547 | 547 | <div class="form-group"> | 
| 548 | 548 | <div class="form-row"> | 
| 549 | - <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['plugin_disabled'] . "</span>" : $_lang['plugin_disabled']) ?></label> | |
| 549 | + <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['plugin_disabled']."</span>" : $_lang['plugin_disabled']) ?></label> | |
| 550 | 550 | </div> | 
| 551 | 551 | <div class="form-row"> | 
| 552 | 552 | <label> | 
| @@ -593,11 +593,11 @@ discard block | ||
| 593 | 593 | <select name="moduleguid" class="form-control" onchange="documentDirty=true;"> | 
| 594 | 594 | <option> </option> | 
| 595 | 595 | <?php | 
| 596 | -                                $ds = $modx->db->select('sm.id,sm.name,sm.guid', $modx->getFullTableName("site_modules") . " sm  | |
| 597 | -								INNER JOIN " . $modx->getFullTableName("site_module_depobj") . " smd ON smd.module=sm.id AND smd.type=30 | |
| 598 | -								INNER JOIN " . $modx->getFullTableName("site_plugins") . " sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name'); | |
| 596 | +                                $ds = $modx->db->select('sm.id,sm.name,sm.guid', $modx->getFullTableName("site_modules")." sm  | |
| 597 | +								INNER JOIN " . $modx->getFullTableName("site_module_depobj")." smd ON smd.module=sm.id AND smd.type=30 | |
| 598 | +								INNER JOIN " . $modx->getFullTableName("site_plugins")." sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name'); | |
| 599 | 599 |                                  while ($row = $modx->db->getRow($ds)) { | 
| 600 | - echo "<option value='" . $row['guid'] . "'" . ($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($row["name"]) . "</option>"; | |
| 600 | + echo "<option value='".$row['guid']."'".($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "").">".$modx->htmlspecialchars($row["name"])."</option>"; | |
| 601 | 601 | } | 
| 602 | 602 | ?> | 
| 603 | 603 | </select> | 
| @@ -658,7 +658,7 @@ discard block | ||
| 658 | 658 | echoEventRows($evtnames); | 
| 659 | 659 | } | 
| 660 | 660 | echo '<hr class="clear">'; | 
| 661 | - echo '<div class="form-group"><b>' . $services[$srv - 1] . '</b></div>'; | |
| 661 | + echo '<div class="form-group"><b>'.$services[$srv - 1].'</b></div>'; | |
| 662 | 662 | } | 
| 663 | 663 | // display group name | 
| 664 | 664 |                          if ($grp != $row['groupname']) { | 
| @@ -667,9 +667,9 @@ discard block | ||
| 667 | 667 | echoEventRows($evtnames); | 
| 668 | 668 | } | 
| 669 | 669 | echo '<hr class="clear">'; | 
| 670 | - echo '<div class="form-group"><b>' . $row['groupname'] . '</b></div>'; | |
| 670 | + echo '<div class="form-group"><b>'.$row['groupname'].'</b></div>'; | |
| 671 | 671 | } | 
| 672 | - $evtnames[] = '<input name="sysevents[]" id="' . $row['name'] . '" type="checkbox" ' . (in_array($row['id'], $evts) ? ' checked="checked" ' : '') . 'class="inputBox" value="' . $row['id'] . '" /> <label for="' . $row['name'] . '" ' . bold(in_array($row['id'], $evts)) . '> ' . $row['name'] . '</label>' . "\n"; | |
| 672 | + $evtnames[] = '<input name="sysevents[]" id="'.$row['name'].'" type="checkbox" '.(in_array($row['id'], $evts) ? ' checked="checked" ' : '').'class="inputBox" value="'.$row['id'].'" /> <label for="'.$row['name'].'" '.bold(in_array($row['id'], $evts)).'> '.$row['name'].'</label>'."\n"; | |
| 673 | 673 |                          if (count($evtnames) == 2) { | 
| 674 | 674 | echoEventRows($evtnames); | 
| 675 | 675 | } | 
| @@ -681,7 +681,7 @@ discard block | ||
| 681 | 681 | |
| 682 | 682 | function echoEventRows(&$evtnames) | 
| 683 | 683 |                  { | 
| 684 | -                    echo '<div class="row form-row"><div class="col-sm-6 col-md-4 col-lg-3">' . implode('</div><div class="col-sm-6 col-md-4 col-lg-3">', $evtnames) . '</div></div>'; | |
| 684 | +                    echo '<div class="row form-row"><div class="col-sm-6 col-md-4 col-lg-3">'.implode('</div><div class="col-sm-6 col-md-4 col-lg-3">', $evtnames).'</div></div>'; | |
| 685 | 685 | $evtnames = array(); | 
| 686 | 686 | } | 
| 687 | 687 | |
| @@ -4,18 +4,18 @@ | ||
| 4 | 4 | } | 
| 5 | 5 | |
| 6 | 6 |  switch($modx->manager->action) { | 
| 7 | - case 16: | |
| 8 | -		if(!$modx->hasPermission('edit_template')) { | |
| 9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 10 | - } | |
| 11 | - break; | |
| 12 | - case 19: | |
| 13 | -		if(!$modx->hasPermission('new_template')) { | |
| 14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 15 | - } | |
| 16 | - break; | |
| 17 | - default: | |
| 18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 7 | + case 16: | |
| 8 | +		    if(!$modx->hasPermission('edit_template')) { | |
| 9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 10 | + } | |
| 11 | + break; | |
| 12 | + case 19: | |
| 13 | +		    if(!$modx->hasPermission('new_template')) { | |
| 14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 15 | + } | |
| 16 | + break; | |
| 17 | + default: | |
| 18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); | |
| 19 | 19 | } | 
| 20 | 20 | |
| 21 | 21 | $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; | 
| @@ -1,16 +1,16 @@ 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 | -switch($modx->manager->action) { | |
| 6 | +switch ($modx->manager->action) { | |
| 7 | 7 | case 16: | 
| 8 | -		if(!$modx->hasPermission('edit_template')) { | |
| 8 | +		if (!$modx->hasPermission('edit_template')) { | |
| 9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); | 
| 10 | 10 | } | 
| 11 | 11 | break; | 
| 12 | 12 | case 19: | 
| 13 | -		if(!$modx->hasPermission('new_template')) { | |
| 13 | +		if (!$modx->hasPermission('new_template')) { | |
| 14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); | 
| 15 | 15 | } | 
| 16 | 16 | break; | 
| @@ -23,7 +23,7 @@ discard block | ||
| 23 | 23 |  $tbl_site_templates = $modx->getFullTableName('site_templates'); | 
| 24 | 24 | |
| 25 | 25 | // check to see the snippet editor isn't locked | 
| 26 | -if($lockedEl = $modx->elementIsLocked(1, $id)) { | |
| 26 | +if ($lockedEl = $modx->elementIsLocked(1, $id)) { | |
| 27 | 27 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); | 
| 28 | 28 | } | 
| 29 | 29 | // end check for lock | 
| @@ -32,15 +32,15 @@ discard block | ||
| 32 | 32 | $modx->lockElement(1, $id); | 
| 33 | 33 | |
| 34 | 34 | $content = array(); | 
| 35 | -if(!empty($id)) { | |
| 35 | +if (!empty($id)) { | |
| 36 | 36 |  	$rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); | 
| 37 | 37 | $content = $modx->db->getRow($rs); | 
| 38 | -	if(!$content) { | |
| 38 | +	if (!$content) { | |
| 39 | 39 |  		$modx->webAlertAndQuit("No database record has been found for this template."); | 
| 40 | 40 | } | 
| 41 | 41 | |
| 42 | 42 | $_SESSION['itemname'] = $content['templatename']; | 
| 43 | -	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { | |
| 43 | +	if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { | |
| 44 | 44 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); | 
| 45 | 45 | } | 
| 46 | 46 |  } else { | 
| @@ -48,7 +48,7 @@ discard block | ||
| 48 | 48 | $content['category'] = intval($_REQUEST['catid']); | 
| 49 | 49 | } | 
| 50 | 50 | |
| 51 | -if($modx->manager->hasFormValues()) { | |
| 51 | +if ($modx->manager->hasFormValues()) { | |
| 52 | 52 | $modx->manager->loadFormValues(); | 
| 53 | 53 | } | 
| 54 | 54 | |
| @@ -58,7 +58,7 @@ discard block | ||
| 58 | 58 | // Add lock-element JS-Script | 
| 59 | 59 | $lockElementId = $id; | 
| 60 | 60 | $lockElementType = 1; | 
| 61 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); | |
| 61 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); | |
| 62 | 62 | ?> | 
| 63 | 63 | <script type="text/javascript"> | 
| 64 | 64 | |
| @@ -100,7 +100,7 @@ discard block | ||
| 100 | 100 | <?php | 
| 101 | 101 | // invoke OnTempFormPrerender event | 
| 102 | 102 |  	$evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id)); | 
| 103 | -	if(is_array($evtOut)) { | |
| 103 | +	if (is_array($evtOut)) { | |
| 104 | 104 |  		echo implode("", $evtOut); | 
| 105 | 105 | } | 
| 106 | 106 | ?> | 
| @@ -109,7 +109,7 @@ discard block | ||
| 109 | 109 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> | 
| 110 | 110 | |
| 111 | 111 | <h1> | 
| 112 | -		<i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i> | |
| 112 | +		<i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'].'<small>('.$content['id'].')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i> | |
| 113 | 113 | </h1> | 
| 114 | 114 | |
| 115 | 115 | <?= $_style['actionbuttons']['dynamic']['element'] ?> | 
| @@ -132,15 +132,15 @@ discard block | ||
| 132 | 132 | <div class="row form-row"> | 
| 133 | 133 | <label class="col-md-3 col-lg-2"> | 
| 134 | 134 | <?= $_lang['template_name'] ?> | 
| 135 | -							<?php if($id == $modx->config['default_template']) { | |
| 136 | - echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>'; | |
| 135 | +							<?php if ($id == $modx->config['default_template']) { | |
| 136 | + echo '<small class="form-text text-danger">'.mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset).'</small>'; | |
| 137 | 137 | } ?> | 
| 138 | 138 | </label> | 
| 139 | 139 | <div class="col-md-9 col-lg-10"> | 
| 140 | 140 | <div class="form-control-name clearfix"> | 
| 141 | 141 | <input name="templatename" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['templatename']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;"> | 
| 142 | -								<?php if($modx->hasPermission('save_role')): ?> | |
| 143 | - <label class="custom-control" title="<?= $_lang['lock_template'] . "\n" . $_lang['lock_template_msg'] ?>" tooltip> | |
| 142 | +								<?php if ($modx->hasPermission('save_role')): ?> | |
| 143 | + <label class="custom-control" title="<?= $_lang['lock_template']."\n".$_lang['lock_template_msg'] ?>" tooltip> | |
| 144 | 144 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> | 
| 145 | 145 | <i class="fa fa-lock"></i> | 
| 146 | 146 | </label> | 
| @@ -162,9 +162,9 @@ discard block | ||
| 162 | 162 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> | 
| 163 | 163 | <option> </option> | 
| 164 | 164 | <?php | 
| 165 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); | |
| 166 | -								foreach(getCategories() as $n => $v) { | |
| 167 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>"; | |
| 165 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); | |
| 166 | +								foreach (getCategories() as $n => $v) { | |
| 167 | + echo "<option value='".$v['id']."'".($content["category"] == $v["id"] ? " selected='selected'" : "").">".$modx->htmlspecialchars($v["category"])."</option>"; | |
| 168 | 168 | } | 
| 169 | 169 | ?> | 
| 170 | 170 | </select> | 
| @@ -177,7 +177,7 @@ discard block | ||
| 177 | 177 | </div> | 
| 178 | 178 | </div> | 
| 179 | 179 | </div> | 
| 180 | -				<?php if($modx->hasPermission('save_role')): ?> | |
| 180 | +				<?php if ($modx->hasPermission('save_role')): ?> | |
| 181 | 181 | <div class="form-group"> | 
| 182 | 182 | <label> | 
| 183 | 183 | <input name="selectable" type="checkbox"<?= ($selectable == 1 ? ' checked="checked"' : '') ?> /> <?= $_lang['template_selectable'] ?></label> | 
| @@ -198,30 +198,30 @@ discard block | ||
| 198 | 198 | |
| 199 | 199 | <?php | 
| 200 | 200 | $selectedTvs = array(); | 
| 201 | -			if(!isset($_POST['assignedTv'])) { | |
| 201 | +			if (!isset($_POST['assignedTv'])) { | |
| 202 | 202 |  				$rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv | 
| 203 | 203 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid | 
| 204 | 204 |                  LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC"     // workaround for correct sort of none-existing ranks | 
| 205 | 205 | ); | 
| 206 | -				while($row = $modx->db->getRow($rs)) { | |
| 206 | +				while ($row = $modx->db->getRow($rs)) { | |
| 207 | 207 | $selectedTvs[$row['tvid']] = $row; | 
| 208 | 208 | } | 
| 209 | - $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC | |
| 209 | + $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC | |
| 210 | 210 | } | 
| 211 | 211 | |
| 212 | 212 | $unselectedTvs = array(); | 
| 213 | 213 |  			$rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv | 
| 214 | 214 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid | 
| 215 | 215 |  	    LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption"); | 
| 216 | -			while($row = $modx->db->getRow($rs)) { | |
| 216 | +			while ($row = $modx->db->getRow($rs)) { | |
| 217 | 217 | $unselectedTvs[$row['tvid']] = $row; | 
| 218 | 218 | } | 
| 219 | 219 | |
| 220 | 220 | // Catch checkboxes if form not validated | 
| 221 | -			if(isset($_POST['assignedTv'])) { | |
| 221 | +			if (isset($_POST['assignedTv'])) { | |
| 222 | 222 | $selectedTvs = array(); | 
| 223 | -				foreach($_POST['assignedTv'] as $tvid) { | |
| 224 | -					if(isset($unselectedTvs[$tvid])) { | |
| 223 | +				foreach ($_POST['assignedTv'] as $tvid) { | |
| 224 | +					if (isset($unselectedTvs[$tvid])) { | |
| 225 | 225 | $selectedTvs[$tvid] = $unselectedTvs[$tvid]; | 
| 226 | 226 | } | 
| 227 | 227 | }; | 
| @@ -238,20 +238,20 @@ discard block | ||
| 238 | 238 | |
| 239 | 239 | <div class="container container-body"> | 
| 240 | 240 | <?php | 
| 241 | -				if($total > 0) { | |
| 242 | - echo '<p>' . $_lang['template_tv_msg'] . '</p>'; | |
| 241 | +				if ($total > 0) { | |
| 242 | + echo '<p>'.$_lang['template_tv_msg'].'</p>'; | |
| 243 | 243 | } | 
| 244 | -				if($modx->hasPermission('save_template') && $total > 1 && $id) { | |
| 244 | +				if ($modx->hasPermission('save_template') && $total > 1 && $id) { | |
| 245 | 245 |  					echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&id=%s">%s</a></div>', $id, $_lang['template_tv_edit']); | 
| 246 | 246 | } | 
| 247 | 247 | |
| 248 | 248 | // Selected TVs | 
| 249 | 249 | $tvList = ''; | 
| 250 | -				if($total > 0) { | |
| 250 | +				if ($total > 0) { | |
| 251 | 251 | $tvList .= '<ul>'; | 
| 252 | -					foreach($selectedTvs as $row) { | |
| 253 | -						$desc = !empty($row['tvdescription']) ? '  <small>(' . $row['tvdescription'] . ')</small>' : ''; | |
| 254 | -						$locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; | |
| 252 | +					foreach ($selectedTvs as $row) { | |
| 253 | +						$desc = !empty($row['tvdescription']) ? '  <small>('.$row['tvdescription'].')</small>' : ''; | |
| 254 | +						$locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : ""; | |
| 255 | 255 |  						$tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); | 
| 256 | 256 | } | 
| 257 | 257 | $tvList .= '</ul>'; | 
| @@ -262,22 +262,22 @@ discard block | ||
| 262 | 262 | echo $tvList; | 
| 263 | 263 | |
| 264 | 264 | // Unselected TVs | 
| 265 | - $tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>'; | |
| 265 | + $tvList = '<hr/><p>'.$_lang['template_notassigned_tv'].'</p><ul>'; | |
| 266 | 266 | $preCat = ''; | 
| 267 | 267 | $insideUl = 0; | 
| 268 | -				while($row = array_shift($unselectedTvs)) { | |
| 269 | -					if(isset($selectedTvs[$row['tvid']])) { | |
| 268 | +				while ($row = array_shift($unselectedTvs)) { | |
| 269 | +					if (isset($selectedTvs[$row['tvid']])) { | |
| 270 | 270 | continue; | 
| 271 | 271 | } // Skip selected | 
| 272 | 272 | $row['category'] = stripslashes($row['category']); //pixelchutes | 
| 273 | -					if($preCat !== $row['category']) { | |
| 273 | +					if ($preCat !== $row['category']) { | |
| 274 | 274 | $tvList .= $insideUl ? '</ul>' : ''; | 
| 275 | -						$tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; | |
| 275 | +						$tvList .= '<li><strong>'.$row['category'].($row['catid'] != '' ? ' <small>('.$row['catid'].')</small>' : '').'</strong><ul>'; | |
| 276 | 276 | $insideUl = 1; | 
| 277 | 277 | } | 
| 278 | 278 | |
| 279 | -					$desc = !empty($row['tvdescription']) ? '  <small>(' . $row['tvdescription'] . ')</small>' : ''; | |
| 280 | -					$locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; | |
| 279 | +					$desc = !empty($row['tvdescription']) ? '  <small>('.$row['tvdescription'].')</small>' : ''; | |
| 280 | +					$locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : ""; | |
| 281 | 281 |  					$tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); | 
| 282 | 282 | $tvList .= '</li>'; | 
| 283 | 283 | |
| @@ -294,7 +294,7 @@ discard block | ||
| 294 | 294 | <?php | 
| 295 | 295 | // invoke OnTempFormRender event | 
| 296 | 296 |  		$evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id)); | 
| 297 | -		if(is_array($evtOut)) { | |
| 297 | +		if (is_array($evtOut)) { | |
| 298 | 298 |  			echo implode("", $evtOut); | 
| 299 | 299 | } | 
| 300 | 300 | ?> | 
| @@ -1,6 +1,6 @@ discard block | ||
| 1 | 1 | <?php | 
| 2 | 2 | $MODX_SITE_HOSTNAMES = MODX_SITE_HOSTNAMES; // Fix for PHP 5.4 | 
| 3 | - if(empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) $valid_hostnames = $_SERVER['HTTP_HOST']; | |
| 3 | + if (empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) $valid_hostnames = $_SERVER['HTTP_HOST']; | |
| 4 | 4 | ?> | 
| 5 | 5 | <!-- Interface & editor settings --> | 
| 6 | 6 | <div class="tab-page" id="tabPageSecurity"> | 
| @@ -11,10 +11,10 @@ discard block | ||
| 11 | 11 | <tr> | 
| 12 | 12 | <th><?php echo $_lang['allow_eval_title']; ?><br><small>[(allow_eval)]</small></th> | 
| 13 | 13 | <td> | 
| 14 | -<?php echo wrap_label($_lang['allow_eval_with_scan']         , form_radio('allow_eval','with_scan'));?><br />
 | |
| 15 | -<?php echo wrap_label($_lang['allow_eval_with_scan_at_post'] , form_radio('allow_eval','with_scan_at_post'));?><br />
 | |
| 16 | -<?php echo wrap_label($_lang['allow_eval_everytime_eval']    , form_radio('allow_eval','everytime_eval'));?><br />
 | |
| 17 | -<?php echo wrap_label($_lang['allow_eval_dont_eval']         , form_radio('allow_eval','dont_eval'));?>
 | |
| 14 | +<?php echo wrap_label($_lang['allow_eval_with_scan'], form_radio('allow_eval', 'with_scan')); ?><br />
 | |
| 15 | +<?php echo wrap_label($_lang['allow_eval_with_scan_at_post'], form_radio('allow_eval', 'with_scan_at_post')); ?><br />
 | |
| 16 | +<?php echo wrap_label($_lang['allow_eval_everytime_eval'], form_radio('allow_eval', 'everytime_eval')); ?><br />
 | |
| 17 | +<?php echo wrap_label($_lang['allow_eval_dont_eval'], form_radio('allow_eval', 'dont_eval')); ?>
 | |
| 18 | 18 | <div class="comment"> | 
| 19 | 19 | <?php echo $_lang['allow_eval_msg'] ?> | 
| 20 | 20 | </div> | 
| @@ -39,7 +39,7 @@ discard block | ||
| 39 | 39 | <tr> | 
| 40 | 40 | <th><?php echo $_lang['check_files_onlogin_title'] ?><br><small>[(check_files_onlogin)]</small></th> | 
| 41 | 41 | <td> | 
| 42 | - <textarea name="check_files_onlogin"><?php echo $check_files_onlogin;?></textarea><br /> | |
| 42 | + <textarea name="check_files_onlogin"><?php echo $check_files_onlogin; ?></textarea><br /> | |
| 43 | 43 | |
| 44 | 44 | </td> | 
| 45 | 45 | </tr> | 
| @@ -49,8 +49,8 @@ discard block | ||
| 49 | 49 | <tr> | 
| 50 | 50 | <td nowrap class="warning"><?php echo $_lang['validate_referer_title'] ?><br><small>[(validate_referer)]</small></td> | 
| 51 | 51 | <td> | 
| 52 | -        <?php echo wrap_label($_lang['yes'],form_radio('validate_referer', 1));?><br />
 | |
| 53 | -        <?php echo wrap_label($_lang['no'], form_radio('validate_referer', 0));?>
 | |
| 52 | +        <?php echo wrap_label($_lang['yes'], form_radio('validate_referer', 1)); ?><br />
 | |
| 53 | +        <?php echo wrap_label($_lang['no'], form_radio('validate_referer', 0)); ?>
 | |
| 54 | 54 | </td> | 
| 55 | 55 | </tr> | 
| 56 | 56 | <tr> | 
| @@ -85,25 +85,25 @@ discard block | ||
| 85 | 85 | <tr> | 
| 86 | 86 | <th><?php echo $_lang['a17_error_reporting_title']; ?><br><small>[(error_reporting)]</small></th> | 
| 87 | 87 | <td> | 
| 88 | -<?php echo wrap_label($_lang['a17_error_reporting_opt0'], form_radio('error_reporting','0'));?><br />
 | |
| 89 | -<?php echo wrap_label($_lang['a17_error_reporting_opt1'], form_radio('error_reporting','1'));?><br />
 | |
| 90 | -<?php echo wrap_label($_lang['a17_error_reporting_opt2'], form_radio('error_reporting','2'));?><br />
 | |
| 91 | -<?php echo wrap_label($_lang['a17_error_reporting_opt99'],form_radio('error_reporting','99'));?>
 | |
| 88 | +<?php echo wrap_label($_lang['a17_error_reporting_opt0'], form_radio('error_reporting', '0')); ?><br />
 | |
| 89 | +<?php echo wrap_label($_lang['a17_error_reporting_opt1'], form_radio('error_reporting', '1')); ?><br />
 | |
| 90 | +<?php echo wrap_label($_lang['a17_error_reporting_opt2'], form_radio('error_reporting', '2')); ?><br />
 | |
| 91 | +<?php echo wrap_label($_lang['a17_error_reporting_opt99'], form_radio('error_reporting', '99')); ?>
 | |
| 92 | 92 | </td> | 
| 93 | 93 | </tr> | 
| 94 | 94 | <tr> | 
| 95 | 95 | <td width="200"> </td> | 
| 96 | - <td class="comment"> <?php echo $_lang['a17_error_reporting_msg'];?></td> | |
| 96 | + <td class="comment"> <?php echo $_lang['a17_error_reporting_msg']; ?></td> | |
| 97 | 97 | </tr> | 
| 98 | 98 | <tr><td colspan="2"><div class="split"></div></td></tr> | 
| 99 | 99 | <tr> | 
| 100 | 100 | <th><?php echo $_lang['mutate_settings.dynamic.php6']; ?><br><small>[(send_errormail)]</small></th> | 
| 101 | 101 | <td> | 
| 102 | -<?php echo wrap_label($_lang['mutate_settings.dynamic.php7'],form_radio('send_errormail','0'));?><br />
 | |
| 103 | -<?php echo wrap_label('error',form_radio('send_errormail','3'));?><br />
 | |
| 104 | -<?php echo wrap_label('error + warning',form_radio('send_errormail','2'));?><br />
 | |
| 105 | -<?php echo wrap_label('error + warning + information',form_radio('send_errormail','1'));?><br />
 | |
| 106 | -<?php echo parseText($_lang['mutate_settings.dynamic.php8'],array('emailsender'=>$modx->config['emailsender']));?></td>
 | |
| 102 | +<?php echo wrap_label($_lang['mutate_settings.dynamic.php7'], form_radio('send_errormail', '0')); ?><br />
 | |
| 103 | +<?php echo wrap_label('error', form_radio('send_errormail', '3')); ?><br />
 | |
| 104 | +<?php echo wrap_label('error + warning', form_radio('send_errormail', '2')); ?><br />
 | |
| 105 | +<?php echo wrap_label('error + warning + information', form_radio('send_errormail', '1')); ?><br />
 | |
| 106 | +<?php echo parseText($_lang['mutate_settings.dynamic.php8'], array('emailsender'=>$modx->config['emailsender'])); ?></td>
 | |
| 107 | 107 | </tr> | 
| 108 | 108 | <tr> | 
| 109 | 109 | <td colspan="2"><div class="split"></div></td> | 
| @@ -111,8 +111,8 @@ discard block | ||
| 111 | 111 | <tr> | 
| 112 | 112 | <th><?php echo $_lang['enable_bindings_title'] ?><br><small>[(enable_bindings)]</small></th> | 
| 113 | 113 | <td> | 
| 114 | -<?php echo wrap_label($_lang['yes'],form_radio('enable_bindings','1'));?><br />
 | |
| 115 | -<?php echo wrap_label($_lang['no'], form_radio('enable_bindings','0'));?>
 | |
| 114 | +<?php echo wrap_label($_lang['yes'], form_radio('enable_bindings', '1')); ?><br />
 | |
| 115 | +<?php echo wrap_label($_lang['no'], form_radio('enable_bindings', '0')); ?>
 | |
| 116 | 116 | |
| 117 | 117 | </td> | 
| 118 | 118 | </tr> | 
| @@ -153,20 +153,20 @@ discard block | ||
| 153 | 153 | <th><?php echo $_lang['pwd_hash_algo_title'] ?><br><small>[(pwd_hash_algo)]</small></th> | 
| 154 | 154 | <td> | 
| 155 | 155 | <?php | 
| 156 | -if(empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1; | |
| 157 | -$phm['e']['BLOWFISH_Y'] = $modx->manager->checkHashAlgorithm('BLOWFISH_Y') ? 0:1;
 | |
| 158 | -$phm['e']['BLOWFISH_A'] = $modx->manager->checkHashAlgorithm('BLOWFISH_A') ? 0:1;
 | |
| 159 | -$phm['e']['SHA512']     = $modx->manager->checkHashAlgorithm('SHA512') ? 0:1;
 | |
| 160 | -$phm['e']['SHA256']     = $modx->manager->checkHashAlgorithm('SHA256') ? 0:1;
 | |
| 161 | -$phm['e']['MD5']        = $modx->manager->checkHashAlgorithm('MD5') ? 0:1;
 | |
| 162 | -$phm['e']['UNCRYPT']    = $modx->manager->checkHashAlgorithm('UNCRYPT') ? 0:1;
 | |
| 156 | +if (empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1; | |
| 157 | +$phm['e']['BLOWFISH_Y'] = $modx->manager->checkHashAlgorithm('BLOWFISH_Y') ? 0 : 1;
 | |
| 158 | +$phm['e']['BLOWFISH_A'] = $modx->manager->checkHashAlgorithm('BLOWFISH_A') ? 0 : 1;
 | |
| 159 | +$phm['e']['SHA512']     = $modx->manager->checkHashAlgorithm('SHA512') ? 0 : 1;
 | |
| 160 | +$phm['e']['SHA256']     = $modx->manager->checkHashAlgorithm('SHA256') ? 0 : 1;
 | |
| 161 | +$phm['e']['MD5']        = $modx->manager->checkHashAlgorithm('MD5') ? 0 : 1;
 | |
| 162 | +$phm['e']['UNCRYPT']    = $modx->manager->checkHashAlgorithm('UNCRYPT') ? 0 : 1;
 | |
| 163 | 163 | ?> | 
| 164 | -<?php echo wrap_label('CRYPT_BLOWFISH_Y (salt & stretch)',form_radio('pwd_hash_algo','BLOWFISH_Y', '', $phm['e']['BLOWFISH_Y']));?><br />
 | |
| 165 | -<?php echo wrap_label('CRYPT_BLOWFISH_A (salt & stretch)',form_radio('pwd_hash_algo','BLOWFISH_A', '', $phm['e']['BLOWFISH_A']));?><br />
 | |
| 166 | -<?php echo wrap_label('CRYPT_SHA512 (salt & stretch)'    ,form_radio('pwd_hash_algo','SHA512'    , '', $phm['e']['SHA512']));?><br />
 | |
| 167 | -<?php echo wrap_label('CRYPT_SHA256 (salt & stretch)'    ,form_radio('pwd_hash_algo','SHA256'    , '', $phm['e']['SHA256']));?><br />
 | |
| 168 | -<?php echo wrap_label('CRYPT_MD5 (salt & stretch)'       ,form_radio('pwd_hash_algo','MD5'       , '', $phm['e']['MD5']));?><br />
 | |
| 169 | -<?php echo wrap_label('UNCRYPT(32 chars salt + SHA-1 hash)'  ,form_radio('pwd_hash_algo','UNCRYPT'  , '', $phm['e']['UNCRYPT']));?>
 | |
| 164 | +<?php echo wrap_label('CRYPT_BLOWFISH_Y (salt & stretch)', form_radio('pwd_hash_algo', 'BLOWFISH_Y', '', $phm['e']['BLOWFISH_Y'])); ?><br />
 | |
| 165 | +<?php echo wrap_label('CRYPT_BLOWFISH_A (salt & stretch)', form_radio('pwd_hash_algo', 'BLOWFISH_A', '', $phm['e']['BLOWFISH_A'])); ?><br />
 | |
| 166 | +<?php echo wrap_label('CRYPT_SHA512 (salt & stretch)', form_radio('pwd_hash_algo', 'SHA512', '', $phm['e']['SHA512'])); ?><br />
 | |
| 167 | +<?php echo wrap_label('CRYPT_SHA256 (salt & stretch)', form_radio('pwd_hash_algo', 'SHA256', '', $phm['e']['SHA256'])); ?><br />
 | |
| 168 | +<?php echo wrap_label('CRYPT_MD5 (salt & stretch)', form_radio('pwd_hash_algo', 'MD5', '', $phm['e']['MD5'])); ?><br />
 | |
| 169 | +<?php echo wrap_label('UNCRYPT(32 chars salt + SHA-1 hash)', form_radio('pwd_hash_algo', 'UNCRYPT', '', $phm['e']['UNCRYPT'])); ?>
 | |
| 170 | 170 | </td> | 
| 171 | 171 | </tr> | 
| 172 | 172 | <tr> | 
| @@ -182,13 +182,13 @@ discard block | ||
| 182 | 182 | ?> | 
| 183 | 183 | <?php | 
| 184 | 184 |  $gdAvailable = extension_loaded('gd');
 | 
| 185 | -if(!$gdAvailable) $use_captcha = 0; | |
| 185 | +if (!$gdAvailable) $use_captcha = 0; | |
| 186 | 186 | ?> | 
| 187 | 187 | <tr> | 
| 188 | 188 | <td nowrap class="warning"><?php echo $_lang['captcha_title'] ?><br><small>[(use_captcha)]</small></td> | 
| 189 | - <td> <label><input type="radio" id="captchaOn" name="use_captcha" value="1" <?php echo ($use_captcha==1) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : ''; ?> /> | |
| 189 | + <td> <label><input type="radio" id="captchaOn" name="use_captcha" value="1" <?php echo ($use_captcha == 1) ? 'checked="checked"' : ""; echo (!$gdAvailable) ? ' readonly="readonly"' : ''; ?> /> | |
| 190 | 190 | <?php echo $_lang['yes']?></label><br /> | 
| 191 | - <label><input type="radio" id="captchaOff" name="use_captcha" value="0" <?php echo ($use_captcha==0) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : '';?> /> | |
| 191 | + <label><input type="radio" id="captchaOff" name="use_captcha" value="0" <?php echo ($use_captcha == 0) ? 'checked="checked"' : ""; echo (!$gdAvailable) ? ' readonly="readonly"' : ''; ?> /> | |
| 192 | 192 | <?php echo $_lang['no']?></label> </td> | 
| 193 | 193 | </tr> | 
| 194 | 194 | <tr> | 
| @@ -198,23 +198,23 @@ discard block | ||
| 198 | 198 | <tr> | 
| 199 | 199 | <td colspan="2"><div class="split"></div></td> | 
| 200 | 200 | </tr> | 
| 201 | - <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>> | |
| 201 | + <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>> | |
| 202 | 202 | <td nowrap class="warning"><?php echo $_lang['captcha_words_title'] ?><br><small>[(captcha_words)]</small> | 
| 203 | 203 | <br /> | 
| 204 | 204 | <p><?php echo $_lang['update_settings_from_language']; ?></p> | 
| 205 | 205 | <select name="reload_captcha_words" id="reload_captcha_words_select" onchange="confirmLangChange(this, 'captcha_words_default', 'captcha_words_input');"> | 
| 206 | -<?php echo get_lang_options('captcha_words_default');?>
 | |
| 206 | +<?php echo get_lang_options('captcha_words_default'); ?>
 | |
| 207 | 207 | </select> | 
| 208 | 208 | </td> | 
| 209 | 209 | <td><input type="text" id="captcha_words_input" name="captcha_words" style="width:250px" value="<?php echo $captcha_words; ?>" /> | 
| 210 | - <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang['captcha_words_default']);?>" /> | |
| 210 | + <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang['captcha_words_default']); ?>" /> | |
| 211 | 211 | </td> | 
| 212 | 212 | </tr> | 
| 213 | - <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>> | |
| 213 | + <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>> | |
| 214 | 214 | <td width="200"> </td> | 
| 215 | 215 | <td class="comment"><?php echo $_lang['captcha_words_message'] ?></td> | 
| 216 | 216 | </tr> | 
| 217 | - <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>> | |
| 217 | + <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>> | |
| 218 | 218 | <td colspan="2"><div class="split"></div></td> | 
| 219 | 219 | </tr> | 
| 220 | 220 | </table> |