@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])){ |
|
| 6 | +if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])) { |
|
| 7 | 7 | |
| 8 | 8 | $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start); |
| 9 | 9 | $logouturl = MODX_MANAGER_URL.'index.php?a=8'; |
@@ -35,8 +35,7 @@ discard block |
||
| 35 | 35 | if(substr($target,0,6)==='@CHUNK') { |
| 36 | 36 | $target = trim(substr($target,7)); |
| 37 | 37 | $lockout_tpl = $modx->getChunk($target); |
| 38 | - } |
|
| 39 | - elseif(substr($target,0,5)==='@FILE') { |
|
| 38 | + } elseif(substr($target,0,5)==='@FILE') { |
|
| 40 | 39 | $target = trim(substr($target,6)); |
| 41 | 40 | $lockout_tpl = file_get_contents($target); |
| 42 | 41 | } |
@@ -44,24 +43,20 @@ discard block |
||
| 44 | 43 | $chunk = $modx->getChunk($target); |
| 45 | 44 | if($chunk!==false && !empty($chunk)) { |
| 46 | 45 | $lockout_tpl = $chunk; |
| 47 | - } |
|
| 48 | - elseif(is_file(MODX_BASE_PATH . $target)) { |
|
| 46 | + } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
| 49 | 47 | $target = MODX_BASE_PATH . $target; |
| 50 | 48 | $lockout_tpl = file_get_contents($target); |
| 51 | - } |
|
| 52 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { |
|
| 49 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { |
|
| 53 | 50 | $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; |
| 54 | 51 | $lockout_tpl = file_get_contents($target); |
| 55 | - } |
|
| 56 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { |
|
| 52 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { |
|
| 57 | 53 | $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; |
| 58 | 54 | $login_tpl = file_get_contents($target); |
| 59 | - } |
|
| 60 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible |
|
| 55 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { |
|
| 56 | +// ClipperCMS compatible |
|
| 61 | 57 | $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; |
| 62 | 58 | $lockout_tpl = file_get_contents($target); |
| 63 | - } |
|
| 64 | - else { |
|
| 59 | + } else { |
|
| 65 | 60 | $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; |
| 66 | 61 | $lockout_tpl = file_get_contents($target); |
| 67 | 62 | } |
@@ -12,16 +12,20 @@ |
||
| 12 | 12 | $modx->loadExtension('EXPORT_SITE'); |
| 13 | 13 | |
| 14 | 14 | |
| 15 | -if(is_dir(MODX_BASE_PATH . 'temp')) $export_dir = MODX_BASE_PATH . 'temp/export'; |
|
| 16 | -elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export'; |
|
| 15 | +if(is_dir(MODX_BASE_PATH . 'temp')) { |
|
| 16 | + $export_dir = MODX_BASE_PATH . 'temp/export'; |
|
| 17 | +} elseif(is_dir(MODX_BASE_PATH . 'assets')) { |
|
| 18 | + $export_dir = MODX_BASE_PATH . 'assets/export'; |
|
| 19 | +} |
|
| 17 | 20 | $modx->export->targetDir = $export_dir; |
| 18 | 21 | |
| 19 | -if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) |
|
| 22 | +if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) { |
|
| 20 | 23 | return $_lang['export_site.static.php6']; |
| 21 | -elseif($modx->config['rb_base_dir'] === $export_dir . '/') |
|
| 24 | +} elseif($modx->config['rb_base_dir'] === $export_dir . '/') { |
|
| 22 | 25 | return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); |
| 23 | -elseif(!is_writable($export_dir)) |
|
| 26 | +} elseif(!is_writable($export_dir)) { |
|
| 24 | 27 | return $_lang['export_site_target_unwritable']; |
| 28 | +} |
|
| 25 | 29 | |
| 26 | 30 | $modx->export->generate_mode = $_POST['generate_mode']; |
| 27 | 31 | |
@@ -14,8 +14,11 @@ |
||
| 14 | 14 | // count duplicates |
| 15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$id}'")); |
| 16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_plugins'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 17 | -if($count>=1) $count = ' '.($count+1); |
|
| 18 | -else $count = ''; |
|
| 17 | +if($count>=1) { |
|
| 18 | + $count = ' '.($count+1); |
|
| 19 | +} else { |
|
| 20 | + $count = ''; |
|
| 21 | +} |
|
| 19 | 22 | |
| 20 | 23 | // duplicate Plugin |
| 21 | 24 | $newid = $modx->db->insert( |
@@ -14,8 +14,11 @@ |
||
| 14 | 14 | // count duplicates |
| 15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$id}'")); |
| 16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 17 | -if($count>=1) $count = ' '.($count+1); |
|
| 18 | -else $count = ''; |
|
| 17 | +if($count>=1) { |
|
| 18 | + $count = ' '.($count+1); |
|
| 19 | +} else { |
|
| 20 | + $count = ''; |
|
| 21 | +} |
|
| 19 | 22 | |
| 20 | 23 | // duplicate TV |
| 21 | 24 | $newid = $modx->db->insert( |
@@ -4,7 +4,9 @@ |
||
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | if(!isset($_GET['id'])) { |
| 7 | - if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | + if(!$modx->hasPermission('remove_locks')) { |
|
| 8 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 9 | + } |
|
| 8 | 10 | |
| 9 | 11 | // Remove all locks |
| 10 | 12 | $modx->db->truncate($modx->getFullTableName('active_user_locks')); |
@@ -117,7 +117,7 @@ |
||
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | // secure web documents - flag as private |
| 120 | -if($updategroupaccess==true){ |
|
| 120 | +if($updategroupaccess==true) { |
|
| 121 | 121 | include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
| 122 | 122 | secureWebDocument(); |
| 123 | 123 | |
@@ -14,8 +14,11 @@ |
||
| 14 | 14 | // count duplicates |
| 15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_snippets'), "id='{$id}'")); |
| 16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_snippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 17 | -if($count>=1) $count = ' '.($count+1); |
|
| 18 | -else $count = ''; |
|
| 17 | +if($count>=1) { |
|
| 18 | + $count = ' '.($count+1); |
|
| 19 | +} else { |
|
| 20 | + $count = ''; |
|
| 21 | +} |
|
| 19 | 22 | |
| 20 | 23 | // duplicate Snippet |
| 21 | 24 | $newid = $modx->db->insert( |
@@ -25,7 +25,10 @@ |
||
| 25 | 25 | |
| 26 | 26 | $id = $row['id']; |
| 27 | 27 | |
| 28 | - if(in_array($id,$latestIds)) continue; // Keep latest version of disabled plugins |
|
| 28 | + if(in_array($id,$latestIds)) { |
|
| 29 | + continue; |
|
| 30 | + } |
|
| 31 | + // Keep latest version of disabled plugins |
|
| 29 | 32 | |
| 30 | 33 | // invoke OnBeforePluginFormDelete event |
| 31 | 34 | $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id)); |
@@ -11,13 +11,13 @@ |
||
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | -if($id==1){ |
|
| 14 | +if($id==1) { |
|
| 15 | 15 | $modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!"); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_attributes'), "role='{$id}'"); |
| 19 | 19 | $count=$modx->db->getValue($rs); |
| 20 | -if($count>0){ |
|
| 20 | +if($count>0) { |
|
| 21 | 21 | $modx->webAlertAndQuit("There are users with this role. It can't be deleted."); |
| 22 | 22 | } |
| 23 | 23 | |