@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('file_manager')) { |
@@ -9,15 +9,15 @@ discard block |
||
| 9 | 9 | $newToken = makeToken(); |
| 10 | 10 | |
| 11 | 11 | // settings |
| 12 | -$theme_image_path = $modx->config['site_manager_url'] . 'media/style/' . $modx->config['manager_theme'] . '/images/'; |
|
| 12 | +$theme_image_path = $modx->config['site_manager_url'].'media/style/'.$modx->config['manager_theme'].'/images/'; |
|
| 13 | 13 | $excludes = array( |
| 14 | 14 | '.', |
| 15 | 15 | '..', |
| 16 | 16 | '.svn' |
| 17 | 17 | ); |
| 18 | -$alias_suffix = (!empty($friendly_url_suffix)) ? ',' . ltrim($friendly_url_suffix, '.') : ''; |
|
| 19 | -$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess,json,ini' . $alias_suffix); |
|
| 20 | -$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json,ini' . $alias_suffix); |
|
| 18 | +$alias_suffix = (!empty($friendly_url_suffix)) ? ','.ltrim($friendly_url_suffix, '.') : ''; |
|
| 19 | +$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess,json,ini'.$alias_suffix); |
|
| 20 | +$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json,ini'.$alias_suffix); |
|
| 21 | 21 | $viewablefiles = explode(',', 'jpg,gif,png,ico'); |
| 22 | 22 | |
| 23 | 23 | $editablefiles = add_dot($editablefiles); |
@@ -30,31 +30,31 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | */ |
| 32 | 32 | $protected_path[] = $modx->config['site_manager_path']; |
| 33 | -$protected_path[] = $modx->config['base_path'] . 'temp/backup'; |
|
| 34 | -$protected_path[] = $modx->config['base_path'] . 'assets/backup'; |
|
| 33 | +$protected_path[] = $modx->config['base_path'].'temp/backup'; |
|
| 34 | +$protected_path[] = $modx->config['base_path'].'assets/backup'; |
|
| 35 | 35 | |
| 36 | 36 | if (!$modx->hasPermission('save_plugin')) { |
| 37 | - $protected_path[] = $modx->config['base_path'] . 'assets/plugins'; |
|
| 37 | + $protected_path[] = $modx->config['base_path'].'assets/plugins'; |
|
| 38 | 38 | } |
| 39 | 39 | if (!$modx->hasPermission('save_snippet')) { |
| 40 | - $protected_path[] = $modx->config['base_path'] . 'assets/snippets'; |
|
| 40 | + $protected_path[] = $modx->config['base_path'].'assets/snippets'; |
|
| 41 | 41 | } |
| 42 | 42 | if (!$modx->hasPermission('save_template')) { |
| 43 | - $protected_path[] = $modx->config['base_path'] . 'assets/templates'; |
|
| 43 | + $protected_path[] = $modx->config['base_path'].'assets/templates'; |
|
| 44 | 44 | } |
| 45 | 45 | if (!$modx->hasPermission('save_module')) { |
| 46 | - $protected_path[] = $modx->config['base_path'] . 'assets/modules'; |
|
| 46 | + $protected_path[] = $modx->config['base_path'].'assets/modules'; |
|
| 47 | 47 | } |
| 48 | 48 | if (!$modx->hasPermission('empty_cache')) { |
| 49 | - $protected_path[] = $modx->config['base_path'] . 'assets/cache'; |
|
| 49 | + $protected_path[] = $modx->config['base_path'].'assets/cache'; |
|
| 50 | 50 | } |
| 51 | 51 | if (!$modx->hasPermission('import_static')) { |
| 52 | - $protected_path[] = $modx->config['base_path'] . 'temp/import'; |
|
| 53 | - $protected_path[] = $modx->config['base_path'] . 'assets/import'; |
|
| 52 | + $protected_path[] = $modx->config['base_path'].'temp/import'; |
|
| 53 | + $protected_path[] = $modx->config['base_path'].'assets/import'; |
|
| 54 | 54 | } |
| 55 | 55 | if (!$modx->hasPermission('export_static')) { |
| 56 | - $protected_path[] = $modx->config['base_path'] . 'temp/export'; |
|
| 57 | - $protected_path[] = $modx->config['base_path'] . 'assets/export'; |
|
| 56 | + $protected_path[] = $modx->config['base_path'].'temp/export'; |
|
| 57 | + $protected_path[] = $modx->config['base_path'].'assets/export'; |
|
| 58 | 58 | } |
| 59 | 59 | /* |
| 60 | 60 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $uploadablefiles = array_merge($upload_files, $upload_images, $upload_media, $upload_flash); |
| 77 | 77 | $uploadablefiles = add_dot($uploadablefiles); |
| 78 | 78 | |
| 79 | -if(!function_exists('add_dot')) { |
|
| 79 | +if (!function_exists('add_dot')) { |
|
| 80 | 80 | /** |
| 81 | 81 | * @param array $array |
| 82 | 82 | * @return array |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | $count = count($array); |
| 87 | 87 | for ($i = 0; $i < $count; $i++) { |
| 88 | - $array[$i] = '.' . strtolower(trim($array[$i])); // add a dot :) |
|
| 88 | + $array[$i] = '.'.strtolower(trim($array[$i])); // add a dot :) |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | return $array; |
@@ -111,15 +111,15 @@ discard block |
||
| 111 | 111 | $rw = realpath('../'); |
| 112 | 112 | $webstart_path = str_replace('\\', '/', str_replace($rw, '', $rf)); |
| 113 | 113 | if (substr($webstart_path, 0, 1) == '/') { |
| 114 | - $webstart_path = '..' . $webstart_path; |
|
| 114 | + $webstart_path = '..'.$webstart_path; |
|
| 115 | 115 | } else { |
| 116 | - $webstart_path = '../' . $webstart_path; |
|
| 116 | + $webstart_path = '../'.$webstart_path; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | ?> |
| 120 | 120 | <script type="text/javascript"> |
| 121 | 121 | |
| 122 | - var current_path = '<?= $startpath;?>'; |
|
| 122 | + var current_path = '<?= $startpath; ?>'; |
|
| 123 | 123 | |
| 124 | 124 | function viewfile (url) |
| 125 | 125 | { |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | function unzipFile (file) |
| 156 | 156 | { |
| 157 | 157 | if (confirmUnzip()) { |
| 158 | - window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken;?>"; |
|
| 158 | + window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken; ?>"; |
|
| 159 | 159 | return false; |
| 160 | 160 | } |
| 161 | 161 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | function deleteFolder (folder, status) |
| 178 | 178 | { |
| 179 | 179 | if (confirmDeleteFolder(status)) { |
| 180 | - window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken;?>"; |
|
| 180 | + window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken; ?>"; |
|
| 181 | 181 | return false; |
| 182 | 182 | } |
| 183 | 183 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | function deleteFile (file) |
| 186 | 186 | { |
| 187 | 187 | if (confirmDelete()) { |
| 188 | - window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken;?>"; |
|
| 188 | + window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken; ?>"; |
|
| 189 | 189 | return false; |
| 190 | 190 | } |
| 191 | 191 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | { |
| 195 | 195 | var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file); |
| 196 | 196 | if (newFilename !== null && newFilename !== file) { |
| 197 | - window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>"; |
|
| 197 | + window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>"; |
|
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | { |
| 203 | 203 | var newDirname = prompt("<?= $_lang["files_dynamic_new_folder_name"] ?>", dir); |
| 204 | 204 | if (newDirname !== null && newDirname !== dir) { |
| 205 | - window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken;?>"; |
|
| 205 | + window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken; ?>"; |
|
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | { |
| 211 | 211 | var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file); |
| 212 | 212 | if (newFilename !== null && newFilename !== file) { |
| 213 | - window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>"; |
|
| 213 | + window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>"; |
|
| 214 | 214 | } |
| 215 | 215 | } |
| 216 | 216 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | <?php endif ?> |
| 230 | 230 | <?php |
| 231 | 231 | if (isset($_GET['mode']) && $_GET['mode'] !== 'drill') { |
| 232 | - $href = 'a=31&path=' . urlencode($_REQUEST['path']); |
|
| 232 | + $href = 'a=31&path='.urlencode($_REQUEST['path']); |
|
| 233 | 233 | } else { |
| 234 | 234 | $href = 'a=2'; |
| 235 | 235 | } |
@@ -239,12 +239,12 @@ discard block |
||
| 239 | 239 | $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFolderName(this);"><i class="[+image+]"></i><span>[+subject+]</span></a>'; |
| 240 | 240 | $ph['image'] = $_style['files_folder-open']; |
| 241 | 241 | $ph['subject'] = $_lang['add_folder']; |
| 242 | - $ph['href'] = 'index.php?a=31&mode=newfolder&path=' . urlencode($startpath) . '&name='; |
|
| 242 | + $ph['href'] = 'index.php?a=31&mode=newfolder&path='.urlencode($startpath).'&name='; |
|
| 243 | 243 | $_ = parsePlaceholder($tpl, $ph); |
| 244 | 244 | |
| 245 | - $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>' . $_lang['files.dynamic.php1'] . '</span></a>'; |
|
| 245 | + $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>'.$_lang['files.dynamic.php1'].'</span></a>'; |
|
| 246 | 246 | $ph['image'] = $_style['files_page_html']; |
| 247 | - $ph['href'] = 'index.php?a=31&mode=newfile&path=' . urlencode($startpath) . '&name='; |
|
| 247 | + $ph['href'] = 'index.php?a=31&mode=newfile&path='.urlencode($startpath).'&name='; |
|
| 248 | 248 | $_ .= parsePlaceholder($tpl, $ph); |
| 249 | 249 | echo $_; |
| 250 | 250 | } |
@@ -274,12 +274,12 @@ discard block |
||
| 274 | 274 | $ph = array(); |
| 275 | 275 | $ph['style_path'] = $theme_image_path; |
| 276 | 276 | // To Top Level with folder icon to the left |
| 277 | - if ($startpath == $filemanager_path || $startpath . '/' == $filemanager_path) { |
|
| 278 | - $ph['image'] = '' . $_style['files_top'] . ''; |
|
| 277 | + if ($startpath == $filemanager_path || $startpath.'/' == $filemanager_path) { |
|
| 278 | + $ph['image'] = ''.$_style['files_top'].''; |
|
| 279 | 279 | $ph['subject'] = '<span>Top</span>'; |
| 280 | 280 | } else { |
| 281 | - $ph['image'] = '' . $_style['files_top'] . ''; |
|
| 282 | - $ph['subject'] = '<a href="index.php?a=31&mode=drill&path=' . $filemanager_path . '">Top</a>/'; |
|
| 281 | + $ph['image'] = ''.$_style['files_top'].''; |
|
| 282 | + $ph['subject'] = '<a href="index.php?a=31&mode=drill&path='.$filemanager_path.'">Top</a>/'; |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | echo parsePlaceholder($tpl, $ph); |
@@ -296,12 +296,12 @@ discard block |
||
| 296 | 296 | if (empty($v)) { |
| 297 | 297 | continue; |
| 298 | 298 | } |
| 299 | - $path .= rtrim($v, '/') . '/'; |
|
| 299 | + $path .= rtrim($v, '/').'/'; |
|
| 300 | 300 | if (1 < $count) { |
| 301 | - $href = 'index.php?a=31&mode=drill&path=' . urlencode($filemanager_path . $path); |
|
| 302 | - $pieces[$i] = '<a href="' . $href . '">' . trim($v, '/') . '</a>'; |
|
| 301 | + $href = 'index.php?a=31&mode=drill&path='.urlencode($filemanager_path.$path); |
|
| 302 | + $pieces[$i] = '<a href="'.$href.'">'.trim($v, '/').'</a>'; |
|
| 303 | 303 | } else { |
| 304 | - $pieces[$i] = '<span>' . trim($v, '/') . '</span>'; |
|
| 304 | + $pieces[$i] = '<span>'.trim($v, '/').'</span>'; |
|
| 305 | 305 | } |
| 306 | 306 | $count--; |
| 307 | 307 | } |
@@ -314,16 +314,16 @@ discard block |
||
| 314 | 314 | </div> |
| 315 | 315 | <?php |
| 316 | 316 | // check to see user isn't trying to move below the document_root |
| 317 | - if (substr(strtolower(str_replace('//', '/', $startpath . "/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path . '/'))) { |
|
| 317 | + if (substr(strtolower(str_replace('//', '/', $startpath."/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path.'/'))) { |
|
| 318 | 318 | $modx->webAlertAndQuit($_lang["files_access_denied"]); |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | // Unzip .zip files - by Raymond |
| 322 | 322 | if ($enablefileunzip && $_REQUEST['mode'] == 'unzip' && is_writable($startpath)) { |
| 323 | - if (!$err = unzip(realpath("{$startpath}/" . $_REQUEST['file']), realpath($startpath))) { |
|
| 324 | - echo '<span class="warning"><b>' . $_lang['file_unzip_fail'] . ($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '') . '</b></span><br /><br />'; |
|
| 323 | + if (!$err = unzip(realpath("{$startpath}/".$_REQUEST['file']), realpath($startpath))) { |
|
| 324 | + echo '<span class="warning"><b>'.$_lang['file_unzip_fail'].($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '').'</b></span><br /><br />'; |
|
| 325 | 325 | } else { |
| 326 | - echo '<span class="success"><b>' . $_lang['file_unzip'] . '</b></span><br /><br />'; |
|
| 326 | + echo '<span class="success"><b>'.$_lang['file_unzip'].'</b></span><br /><br />'; |
|
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | // End Unzip - Raymond |
@@ -335,9 +335,9 @@ discard block |
||
| 335 | 335 | if ($_REQUEST['mode'] == 'deletefolder') { |
| 336 | 336 | $folder = $_REQUEST['folderpath']; |
| 337 | 337 | if (!$token_check || !@rrmdir($folder)) { |
| 338 | - echo '<span class="warning"><b>' . $_lang['file_folder_not_deleted'] . '</b></span><br /><br />'; |
|
| 338 | + echo '<span class="warning"><b>'.$_lang['file_folder_not_deleted'].'</b></span><br /><br />'; |
|
| 339 | 339 | } else { |
| 340 | - echo '<span class="success"><b>' . $_lang['file_folder_deleted'] . '</b></span><br /><br />'; |
|
| 340 | + echo '<span class="success"><b>'.$_lang['file_folder_deleted'].'</b></span><br /><br />'; |
|
| 341 | 341 | } |
| 342 | 342 | } |
| 343 | 343 | |
@@ -348,10 +348,10 @@ discard block |
||
| 348 | 348 | if (!mkdirs("{$startpath}/{$foldername}", 0777)) { |
| 349 | 349 | echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />'; |
| 350 | 350 | } else { |
| 351 | - if (!@chmod($startpath . '/' . $foldername, $newfolderaccessmode)) { |
|
| 352 | - echo '<span class="warning"><b>' . $_lang['file_folder_chmod_error'] . '</b></span><br /><br />'; |
|
| 351 | + if (!@chmod($startpath.'/'.$foldername, $newfolderaccessmode)) { |
|
| 352 | + echo '<span class="warning"><b>'.$_lang['file_folder_chmod_error'].'</b></span><br /><br />'; |
|
| 353 | 353 | } else { |
| 354 | - echo '<span class="success"><b>' . $_lang['file_folder_created'] . '</b></span><br /><br />'; |
|
| 354 | + echo '<span class="success"><b>'.$_lang['file_folder_created'].'</b></span><br /><br />'; |
|
| 355 | 355 | } |
| 356 | 356 | } |
| 357 | 357 | umask($old_umask); |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | $filename = $modx->db->escape($filename); |
| 364 | 364 | |
| 365 | 365 | if (!checkExtension($filename)) { |
| 366 | - echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />'; |
|
| 366 | + echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />'; |
|
| 367 | 367 | } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $filename) !== 0) { |
| 368 | 368 | echo $_lang['files.dynamic.php3']; |
| 369 | 369 | } else { |
@@ -385,11 +385,11 @@ discard block |
||
| 385 | 385 | $newFilename = $modx->db->escape($newFilename); |
| 386 | 386 | |
| 387 | 387 | if (!checkExtension($newFilename)) { |
| 388 | - echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />'; |
|
| 388 | + echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />'; |
|
| 389 | 389 | } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) { |
| 390 | 390 | echo $_lang['files.dynamic.php3']; |
| 391 | 391 | } else { |
| 392 | - if (!copy($filename, MODX_BASE_PATH . $newFilename)) { |
|
| 392 | + if (!copy($filename, MODX_BASE_PATH.$newFilename)) { |
|
| 393 | 393 | echo $_lang['files.dynamic.php5']; |
| 394 | 394 | } |
| 395 | 395 | umask($old_umask); |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | // Rename folder here |
| 399 | 399 | if ($_REQUEST['mode'] == 'renameFolder') { |
| 400 | 400 | $old_umask = umask(0); |
| 401 | - $dirname = $_REQUEST['path'] . '/' . $_REQUEST['dirname']; |
|
| 401 | + $dirname = $_REQUEST['path'].'/'.$_REQUEST['dirname']; |
|
| 402 | 402 | $dirname = $modx->db->escape($dirname); |
| 403 | 403 | $newDirname = str_replace(array( |
| 404 | 404 | '..\\', |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | |
| 411 | 411 | if (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newDirname) !== 0) { |
| 412 | 412 | echo $_lang['files.dynamic.php3']; |
| 413 | - } else if (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) { |
|
| 413 | + } else if (!rename($dirname, $_REQUEST['path'].'/'.$newDirname)) { |
|
| 414 | 414 | echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />'; |
| 415 | 415 | } |
| 416 | 416 | umask($old_umask); |
@@ -430,11 +430,11 @@ discard block |
||
| 430 | 430 | $newFilename = $modx->db->escape($newFilename); |
| 431 | 431 | |
| 432 | 432 | if (!checkExtension($newFilename)) { |
| 433 | - echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />'; |
|
| 433 | + echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />'; |
|
| 434 | 434 | } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) { |
| 435 | 435 | echo $_lang['files.dynamic.php3']; |
| 436 | 436 | } else { |
| 437 | - if (!rename($filename, $path . '/' . $newFilename)) { |
|
| 437 | + if (!rename($filename, $path.'/'.$newFilename)) { |
|
| 438 | 438 | echo $_lang['files.dynamic.php5']; |
| 439 | 439 | } |
| 440 | 440 | umask($old_umask); |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | ls($startpath); |
| 468 | 468 | echo "\n\n\n"; |
| 469 | 469 | if ($folders == 0 && $files == 0) { |
| 470 | - echo '<tr><td colspan="4"><i class="' . $_style['files_deleted_folder'] . ' FilesDeletedFolder"></i> <span style="color:#888;cursor:default;"> ' . $_lang['files_directory_is_empty'] . ' </span></td></tr>'; |
|
| 470 | + echo '<tr><td colspan="4"><i class="'.$_style['files_deleted_folder'].' FilesDeletedFolder"></i> <span style="color:#888;cursor:default;"> '.$_lang['files_directory_is_empty'].' </span></td></tr>'; |
|
| 471 | 471 | } |
| 472 | 472 | ?> |
| 473 | 473 | </table> |
@@ -476,10 +476,10 @@ discard block |
||
| 476 | 476 | <div class="container"> |
| 477 | 477 | <p> |
| 478 | 478 | <?php |
| 479 | - echo $_lang['files_directories'] . ': <b>' . $folders . '</b> '; |
|
| 480 | - echo $_lang['files_files'] . ': <b>' . $files . '</b> '; |
|
| 481 | - echo $_lang['files_data'] . ': <b><span dir="ltr">' . $modx->nicesize($filesizes) . '</span></b> '; |
|
| 482 | - echo $_lang['files_dirwritable'] . ' <b>' . (is_writable($startpath) == 1 ? $_lang['yes'] . '.' : $_lang['no']) . '.</b>' |
|
| 479 | + echo $_lang['files_directories'].': <b>'.$folders.'</b> '; |
|
| 480 | + echo $_lang['files_files'].': <b>'.$files.'</b> '; |
|
| 481 | + echo $_lang['files_data'].': <b><span dir="ltr">'.$modx->nicesize($filesizes).'</span></b> '; |
|
| 482 | + echo $_lang['files_dirwritable'].' <b>'.(is_writable($startpath) == 1 ? $_lang['yes'].'.' : $_lang['no']).'.</b>' |
|
| 483 | 483 | ?> |
| 484 | 484 | </p> |
| 485 | 485 | |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | </form> |
| 505 | 505 | <?php |
| 506 | 506 | } else { |
| 507 | - echo "<p>" . $_lang['files_upload_inhibited_msg'] . "</p>"; |
|
| 507 | + echo "<p>".$_lang['files_upload_inhibited_msg']."</p>"; |
|
| 508 | 508 | } |
| 509 | 509 | ?> |
| 510 | 510 | <div id="imageviewer"></div> |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | -if(!function_exists('determineIcon')) { |
|
| 575 | +if (!function_exists('determineIcon')) { |
|
| 576 | 576 | /** |
| 577 | 577 | * @param string $file |
| 578 | 578 | * @param string $selFile |
@@ -591,11 +591,11 @@ discard block |
||
| 591 | 591 | $icon = isset($icons[$mode]) ? $icons[$mode] : $icons['default']; |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | - return '<i class="' . $icon . ' FilesPage"></i>'; |
|
| 594 | + return '<i class="'.$icon.' FilesPage"></i>'; |
|
| 595 | 595 | } |
| 596 | 596 | } |
| 597 | 597 | |
| 598 | -if(!function_exists('markRow')) { |
|
| 598 | +if (!function_exists('markRow')) { |
|
| 599 | 599 | /** |
| 600 | 600 | * @param string $file |
| 601 | 601 | * @param string $selFile |
@@ -612,14 +612,14 @@ discard block |
||
| 612 | 612 | if ($file == $selFile) { |
| 613 | 613 | $class = isset($classNames[$mode]) ? $classNames[$mode] : $classNames['default']; |
| 614 | 614 | |
| 615 | - return ' class="' . $class . '"'; |
|
| 615 | + return ' class="'.$class.'"'; |
|
| 616 | 616 | } |
| 617 | 617 | |
| 618 | 618 | return ''; |
| 619 | 619 | } |
| 620 | 620 | } |
| 621 | 621 | |
| 622 | -if(!function_exists('ls')) { |
|
| 622 | +if (!function_exists('ls')) { |
|
| 623 | 623 | /** |
| 624 | 624 | * @param string $curpath |
| 625 | 625 | */ |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | global $excludes, $protected_path, $editablefiles, $inlineviewablefiles, $viewablefiles, $enablefileunzip, $enablefiledownload, $uploadablefiles, $folders, $files, $filesizes, $len, $dirs_array, $files_array, $webstart_path, $modx; |
| 630 | 630 | $dircounter = 0; |
| 631 | 631 | $filecounter = 0; |
| 632 | - $curpath = str_replace('//', '/', $curpath . '/'); |
|
| 632 | + $curpath = str_replace('//', '/', $curpath.'/'); |
|
| 633 | 633 | |
| 634 | 634 | if (!is_dir($curpath)) { |
| 635 | 635 | echo 'Invalid path "', $curpath, '"<br />'; |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | |
| 641 | 641 | // first, get info |
| 642 | 642 | foreach ($dir as $file) { |
| 643 | - $newpath = $curpath . $file; |
|
| 643 | + $newpath = $curpath.$file; |
|
| 644 | 644 | if ($file === '..' || $file === '.') { |
| 645 | 645 | continue; |
| 646 | 646 | } |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | if ($file === '..' || $file === '.') { |
| 651 | 651 | continue; |
| 652 | 652 | } elseif (!in_array($file, $excludes) && !in_array($newpath, $protected_path)) { |
| 653 | - $dirs_array[$dircounter]['text'] = '<i class="' . $_style['files_folder'] . ' FilesFolder"></i> <a href="index.php?a=31&mode=drill&path=' . urlencode($newpath) . '"><b>' . $file . '</b></a>'; |
|
| 653 | + $dirs_array[$dircounter]['text'] = '<i class="'.$_style['files_folder'].' FilesFolder"></i> <a href="index.php?a=31&mode=drill&path='.urlencode($newpath).'"><b>'.$file.'</b></a>'; |
|
| 654 | 654 | |
| 655 | 655 | $dfiles = scandir($newpath); |
| 656 | 656 | foreach ($dfiles as $i => $infile) { |
@@ -663,13 +663,13 @@ discard block |
||
| 663 | 663 | } |
| 664 | 664 | $file_exists = (0 < count($dfiles)) ? 'file_exists' : ''; |
| 665 | 665 | |
| 666 | - $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<a href="javascript: deleteFolder(\'' . urlencode($file) . '\',\'' . $file_exists . '\');"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_folder'] . '"></i></a>' : ''; |
|
| 666 | + $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<a href="javascript: deleteFolder(\''.urlencode($file).'\',\''.$file_exists.'\');"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_folder'].'"></i></a>' : ''; |
|
| 667 | 667 | } else { |
| 668 | - $dirs_array[$dircounter]['text'] = '<span><i class="' . $_style['files_deleted_folder'] . ' FilesDeletedFolder"></i> ' . $file . '</span>'; |
|
| 669 | - $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<span class="disabled"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_folder'] . '"></i></span>' : ''; |
|
| 668 | + $dirs_array[$dircounter]['text'] = '<span><i class="'.$_style['files_deleted_folder'].' FilesDeletedFolder"></i> '.$file.'</span>'; |
|
| 669 | + $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<span class="disabled"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_folder'].'"></i></span>' : ''; |
|
| 670 | 670 | } |
| 671 | 671 | |
| 672 | - $dirs_array[$dircounter]['rename'] = is_writable($curpath) ? '<a href="javascript:renameFolder(\'' . urlencode($file) . '\');"><i class="' . $_style['files_rename'] . '" title="' . $_lang['rename'] . '"></i></a> ' : ''; |
|
| 672 | + $dirs_array[$dircounter]['rename'] = is_writable($curpath) ? '<a href="javascript:renameFolder(\''.urlencode($file).'\');"><i class="'.$_style['files_rename'].'" title="'.$_lang['rename'].'"></i></a> ' : ''; |
|
| 673 | 673 | |
| 674 | 674 | // increment the counter |
| 675 | 675 | $dircounter++; |
@@ -678,24 +678,24 @@ discard block |
||
| 678 | 678 | $files_array[$filecounter]['file'] = $newpath; |
| 679 | 679 | $files_array[$filecounter]['stats'] = lstat($newpath); |
| 680 | 680 | $files_array[$filecounter]['text'] = determineIcon($newpath, $_REQUEST['path'], |
| 681 | - $_REQUEST['mode']) . ' ' . $file; |
|
| 681 | + $_REQUEST['mode']).' '.$file; |
|
| 682 | 682 | $files_array[$filecounter]['view'] = (in_array($type, |
| 683 | - $viewablefiles)) ? '<a href="javascript:;" onclick="viewfile(\'' . $webstart_path . substr($newpath, |
|
| 683 | + $viewablefiles)) ? '<a href="javascript:;" onclick="viewfile(\''.$webstart_path.substr($newpath, |
|
| 684 | 684 | $len, |
| 685 | - strlen($newpath)) . '\');"><i class="' . $_style['files_view'] . '" title="' . $_lang['files_viewfile'] . '"></i></a>' : (($enablefiledownload && in_array($type, |
|
| 686 | - $uploadablefiles)) ? '<a href="' . $webstart_path . implode('/', array_map('rawurlencode', |
|
| 685 | + strlen($newpath)).'\');"><i class="'.$_style['files_view'].'" title="'.$_lang['files_viewfile'].'"></i></a>' : (($enablefiledownload && in_array($type, |
|
| 686 | + $uploadablefiles)) ? '<a href="'.$webstart_path.implode('/', array_map('rawurlencode', |
|
| 687 | 687 | explode('/', substr($newpath, $len, |
| 688 | - strlen($newpath))))) . '" style="cursor:pointer;"><i class="' . $_style['files_download'] . '" title="' . $_lang['file_download_file'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_view'] . '" title="' . $_lang['files_viewfile'] . '"></i></span>'); |
|
| 688 | + strlen($newpath))))).'" style="cursor:pointer;"><i class="'.$_style['files_download'].'" title="'.$_lang['file_download_file'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_view'].'" title="'.$_lang['files_viewfile'].'"></i></span>'); |
|
| 689 | 689 | $files_array[$filecounter]['view'] = (in_array($type, |
| 690 | - $inlineviewablefiles)) ? '<a href="index.php?a=31&mode=view&path=' . urlencode($newpath) . '"><i class="' . $_style['files_view'] . '" title="' . $_lang['files_viewfile'] . '"></i></a>' : $files_array[$filecounter]['view']; |
|
| 691 | - $files_array[$filecounter]['unzip'] = ($enablefileunzip && $type == '.zip') ? '<a href="javascript:unzipFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_unzip'] . '" title="' . $_lang['file_download_unzip'] . '"></i></a>' : ''; |
|
| 690 | + $inlineviewablefiles)) ? '<a href="index.php?a=31&mode=view&path='.urlencode($newpath).'"><i class="'.$_style['files_view'].'" title="'.$_lang['files_viewfile'].'"></i></a>' : $files_array[$filecounter]['view']; |
|
| 691 | + $files_array[$filecounter]['unzip'] = ($enablefileunzip && $type == '.zip') ? '<a href="javascript:unzipFile(\''.urlencode($file).'\');"><i class="'.$_style['files_unzip'].'" title="'.$_lang['file_download_unzip'].'"></i></a>' : ''; |
|
| 692 | 692 | $files_array[$filecounter]['edit'] = (in_array($type, |
| 693 | - $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="index.php?a=31&mode=edit&path=' . urlencode($newpath) . '#file_editfile"><i class="' . $_style['files_edit'] . '" title="' . $_lang['files_editfile'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_edit'] . '" title="' . $_lang['files_editfile'] . '"></i></span>'; |
|
| 693 | + $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="index.php?a=31&mode=edit&path='.urlencode($newpath).'#file_editfile"><i class="'.$_style['files_edit'].'" title="'.$_lang['files_editfile'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_edit'].'" title="'.$_lang['files_editfile'].'"></i></span>'; |
|
| 694 | 694 | $files_array[$filecounter]['duplicate'] = (in_array($type, |
| 695 | - $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:duplicateFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_duplicate'] . '" title="' . $_lang['duplicate'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_duplicate'] . '" align="absmiddle" title="' . $_lang['duplicate'] . '"></i></span>'; |
|
| 695 | + $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:duplicateFile(\''.urlencode($file).'\');"><i class="'.$_style['files_duplicate'].'" title="'.$_lang['duplicate'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_duplicate'].'" align="absmiddle" title="'.$_lang['duplicate'].'"></i></span>'; |
|
| 696 | 696 | $files_array[$filecounter]['rename'] = (in_array($type, |
| 697 | - $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:renameFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_rename'] . '" align="absmiddle" title="' . $_lang['rename'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_rename'] . '" align="absmiddle" title="' . $_lang['rename'] . '"></i></span>'; |
|
| 698 | - $files_array[$filecounter]['delete'] = is_writable($curpath) && is_writable($newpath) ? '<a href="javascript:deleteFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_file'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_file'] . '"></i></span>'; |
|
| 697 | + $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:renameFile(\''.urlencode($file).'\');"><i class="'.$_style['files_rename'].'" align="absmiddle" title="'.$_lang['rename'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_rename'].'" align="absmiddle" title="'.$_lang['rename'].'"></i></span>'; |
|
| 698 | + $files_array[$filecounter]['delete'] = is_writable($curpath) && is_writable($newpath) ? '<a href="javascript:deleteFile(\''.urlencode($file).'\');"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_file'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_file'].'"></i></span>'; |
|
| 699 | 699 | |
| 700 | 700 | // increment the counter |
| 701 | 701 | $filecounter++; |
@@ -708,9 +708,9 @@ discard block |
||
| 708 | 708 | for ($i = 0; $i < $folders; $i++) { |
| 709 | 709 | $filesizes += $dirs_array[$i]['stats']['7']; |
| 710 | 710 | echo '<tr>'; |
| 711 | - echo '<td>' . $dirs_array[$i]['text'] . '</td>'; |
|
| 712 | - echo '<td class="text-nowrap">' . $modx->toDateFormat($dirs_array[$i]['stats']['9']) . '</td>'; |
|
| 713 | - echo '<td class="text-right">' . $modx->nicesize($dirs_array[$i]['stats']['7']) . '</td>'; |
|
| 711 | + echo '<td>'.$dirs_array[$i]['text'].'</td>'; |
|
| 712 | + echo '<td class="text-nowrap">'.$modx->toDateFormat($dirs_array[$i]['stats']['9']).'</td>'; |
|
| 713 | + echo '<td class="text-right">'.$modx->nicesize($dirs_array[$i]['stats']['7']).'</td>'; |
|
| 714 | 714 | echo '<td class="actions text-right">'; |
| 715 | 715 | echo $dirs_array[$i]['rename']; |
| 716 | 716 | echo $dirs_array[$i]['delete']; |
@@ -723,10 +723,10 @@ discard block |
||
| 723 | 723 | sort($files_array); // sorting the array alphabetically (Thanks pxl8r!) |
| 724 | 724 | for ($i = 0; $i < $files; $i++) { |
| 725 | 725 | $filesizes += $files_array[$i]['stats']['7']; |
| 726 | - echo '<tr ' . markRow($files_array[$i]['file'], $_REQUEST['path'], $_REQUEST['mode']) . '>'; |
|
| 727 | - echo '<td>' . $files_array[$i]['text'] . '</td>'; |
|
| 728 | - echo '<td class="text-nowrap">' . $modx->toDateFormat($files_array[$i]['stats']['9']) . '</td>'; |
|
| 729 | - echo '<td class="text-right">' . $modx->nicesize($files_array[$i]['stats']['7']) . '</td>'; |
|
| 726 | + echo '<tr '.markRow($files_array[$i]['file'], $_REQUEST['path'], $_REQUEST['mode']).'>'; |
|
| 727 | + echo '<td>'.$files_array[$i]['text'].'</td>'; |
|
| 728 | + echo '<td class="text-nowrap">'.$modx->toDateFormat($files_array[$i]['stats']['9']).'</td>'; |
|
| 729 | + echo '<td class="text-right">'.$modx->nicesize($files_array[$i]['stats']['7']).'</td>'; |
|
| 730 | 730 | echo '<td class="actions text-right">'; |
| 731 | 731 | echo $files_array[$i]['unzip']; |
| 732 | 732 | echo $files_array[$i]['view']; |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | } |
| 743 | 743 | } |
| 744 | 744 | |
| 745 | -if(!function_exists('removeLastPath')) { |
|
| 745 | +if (!function_exists('removeLastPath')) { |
|
| 746 | 746 | /** |
| 747 | 747 | * @param string $string |
| 748 | 748 | * @return bool|string |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | } |
| 761 | 761 | } |
| 762 | 762 | |
| 763 | -if(!function_exists('getExtension')) { |
|
| 763 | +if (!function_exists('getExtension')) { |
|
| 764 | 764 | /** |
| 765 | 765 | * @param string $string |
| 766 | 766 | * @return bool|string |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | } |
| 780 | 780 | } |
| 781 | 781 | |
| 782 | -if(!function_exists('checkExtension')) { |
|
| 782 | +if (!function_exists('checkExtension')) { |
|
| 783 | 783 | /** |
| 784 | 784 | * @param string $path |
| 785 | 785 | * @return bool |
@@ -796,7 +796,7 @@ discard block |
||
| 796 | 796 | } |
| 797 | 797 | } |
| 798 | 798 | |
| 799 | -if(!function_exists('mkdirs')) { |
|
| 799 | +if (!function_exists('mkdirs')) { |
|
| 800 | 800 | /** |
| 801 | 801 | * recursive mkdir function |
| 802 | 802 | * |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | } |
| 819 | 819 | } |
| 820 | 820 | |
| 821 | -if(!function_exists('logFileChange')) { |
|
| 821 | +if (!function_exists('logFileChange')) { |
|
| 822 | 822 | /** |
| 823 | 823 | * @param string $type |
| 824 | 824 | * @param string $filename |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | } |
| 855 | 855 | } |
| 856 | 856 | |
| 857 | -if(!function_exists('unzip')) { |
|
| 857 | +if (!function_exists('unzip')) { |
|
| 858 | 858 | /** |
| 859 | 859 | * by patrick_allaert - php user notes |
| 860 | 860 | * |
@@ -878,17 +878,17 @@ discard block |
||
| 878 | 878 | $zip = zip_open($file); |
| 879 | 879 | if ($zip) { |
| 880 | 880 | $old_umask = umask(0); |
| 881 | - $path = rtrim($path, '/') . '/'; |
|
| 881 | + $path = rtrim($path, '/').'/'; |
|
| 882 | 882 | while ($zip_entry = zip_read($zip)) { |
| 883 | 883 | if (zip_entry_filesize($zip_entry) > 0) { |
| 884 | 884 | // str_replace must be used under windows to convert "/" into "\" |
| 885 | 885 | $zip_entry_name = zip_entry_name($zip_entry); |
| 886 | - $complete_path = $path . str_replace('\\', '/', dirname($zip_entry_name)); |
|
| 887 | - $complete_name = $path . str_replace('\\', '/', $zip_entry_name); |
|
| 886 | + $complete_path = $path.str_replace('\\', '/', dirname($zip_entry_name)); |
|
| 887 | + $complete_name = $path.str_replace('\\', '/', $zip_entry_name); |
|
| 888 | 888 | if (!file_exists($complete_path)) { |
| 889 | 889 | $tmp = ''; |
| 890 | 890 | foreach (explode('/', $complete_path) AS $k) { |
| 891 | - $tmp .= $k . '/'; |
|
| 891 | + $tmp .= $k.'/'; |
|
| 892 | 892 | if (!is_dir($tmp)) { |
| 893 | 893 | mkdir($tmp, 0777); |
| 894 | 894 | } |
@@ -909,14 +909,14 @@ discard block |
||
| 909 | 909 | } |
| 910 | 910 | } |
| 911 | 911 | |
| 912 | -if(!function_exists('rrmdir')) { |
|
| 912 | +if (!function_exists('rrmdir')) { |
|
| 913 | 913 | /** |
| 914 | 914 | * @param string $dir |
| 915 | 915 | * @return bool |
| 916 | 916 | */ |
| 917 | 917 | function rrmdir($dir) |
| 918 | 918 | { |
| 919 | - foreach (glob($dir . '/*') as $file) { |
|
| 919 | + foreach (glob($dir.'/*') as $file) { |
|
| 920 | 920 | if (is_dir($file)) { |
| 921 | 921 | rrmdir($file); |
| 922 | 922 | } else { |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | } |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | -if(!function_exists('fileupload')) { |
|
| 931 | +if (!function_exists('fileupload')) { |
|
| 932 | 932 | /** |
| 933 | 933 | * @return string |
| 934 | 934 | */ |
@@ -958,13 +958,13 @@ discard block |
||
| 958 | 958 | $userfile['type'] = $_FILES['userfile']['type'][$i]; |
| 959 | 959 | |
| 960 | 960 | // this seems to be an upload action. |
| 961 | - $path = $modx->config['site_url'] . substr($startpath, strlen($filemanager_path), strlen($startpath)); |
|
| 962 | - $path = rtrim($path, '/') . '/' . $userfile['name']; |
|
| 961 | + $path = $modx->config['site_url'].substr($startpath, strlen($filemanager_path), strlen($startpath)); |
|
| 962 | + $path = rtrim($path, '/').'/'.$userfile['name']; |
|
| 963 | 963 | $msg .= $path; |
| 964 | 964 | if ($userfile['error'] == 0) { |
| 965 | 965 | $img = (strpos($userfile['type'], |
| 966 | - 'image') !== false) ? '<br /><img src="' . $path . '" height="75" />' : ''; |
|
| 967 | - $msg .= "<p>" . $_lang['files_file_type'] . $userfile['type'] . ", " . $modx->nicesize(filesize($userfile['tmp_name'])) . $img . '</p>'; |
|
| 966 | + 'image') !== false) ? '<br /><img src="'.$path.'" height="75" />' : ''; |
|
| 967 | + $msg .= "<p>".$_lang['files_file_type'].$userfile['type'].", ".$modx->nicesize(filesize($userfile['tmp_name'])).$img.'</p>'; |
|
| 968 | 968 | } |
| 969 | 969 | |
| 970 | 970 | $userfilename = $userfile['tmp_name']; |
@@ -972,15 +972,15 @@ discard block |
||
| 972 | 972 | if (is_uploaded_file($userfilename)) { |
| 973 | 973 | // file is uploaded file, process it! |
| 974 | 974 | if (!checkExtension($userfile['name'])) { |
| 975 | - $msg .= '<p><span class="warning">' . $_lang['files_filetype_notok'] . '</span></p>'; |
|
| 975 | + $msg .= '<p><span class="warning">'.$_lang['files_filetype_notok'].'</span></p>'; |
|
| 976 | 976 | } else { |
| 977 | - if (@move_uploaded_file($userfile['tmp_name'], $_POST['path'] . '/' . $userfile['name'])) { |
|
| 977 | + if (@move_uploaded_file($userfile['tmp_name'], $_POST['path'].'/'.$userfile['name'])) { |
|
| 978 | 978 | // Ryan: Repair broken permissions issue with file manager |
| 979 | 979 | if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { |
| 980 | - @chmod($_POST['path'] . "/" . $userfile['name'], $new_file_permissions); |
|
| 980 | + @chmod($_POST['path']."/".$userfile['name'], $new_file_permissions); |
|
| 981 | 981 | } |
| 982 | 982 | // Ryan: End |
| 983 | - $msg .= '<p><span class="success">' . $_lang['files_upload_ok'] . '</span></p><hr/>'; |
|
| 983 | + $msg .= '<p><span class="success">'.$_lang['files_upload_ok'].'</span></p><hr/>'; |
|
| 984 | 984 | |
| 985 | 985 | // invoke OnFileManagerUpload event |
| 986 | 986 | $modx->invokeEvent('OnFileManagerUpload', array( |
@@ -988,13 +988,13 @@ discard block |
||
| 988 | 988 | 'filename' => $userfile['name'] |
| 989 | 989 | )); |
| 990 | 990 | // Log the change |
| 991 | - logFileChange('upload', $_POST['path'] . '/' . $userfile['name']); |
|
| 991 | + logFileChange('upload', $_POST['path'].'/'.$userfile['name']); |
|
| 992 | 992 | } else { |
| 993 | - $msg .= '<p><span class="warning">' . $_lang['files_upload_copyfailed'] . '</span> ' . $_lang["files_upload_permissions_error"] . '</p>'; |
|
| 993 | + $msg .= '<p><span class="warning">'.$_lang['files_upload_copyfailed'].'</span> '.$_lang["files_upload_permissions_error"].'</p>'; |
|
| 994 | 994 | } |
| 995 | 995 | } |
| 996 | 996 | } else { |
| 997 | - $msg .= '<br /><span class="warning"><b>' . $_lang['files_upload_error'] . ':</b>'; |
|
| 997 | + $msg .= '<br /><span class="warning"><b>'.$_lang['files_upload_error'].':</b>'; |
|
| 998 | 998 | switch ($userfile['error']) { |
| 999 | 999 | case 0: //no error; possible file attack! |
| 1000 | 1000 | $msg .= $_lang['files_upload_error0']; |
@@ -1019,11 +1019,11 @@ discard block |
||
| 1019 | 1019 | } |
| 1020 | 1020 | } |
| 1021 | 1021 | |
| 1022 | - return $msg . '<br/>'; |
|
| 1022 | + return $msg.'<br/>'; |
|
| 1023 | 1023 | } |
| 1024 | 1024 | } |
| 1025 | 1025 | |
| 1026 | -if(!function_exists('textsave')) { |
|
| 1026 | +if (!function_exists('textsave')) { |
|
| 1027 | 1027 | /** |
| 1028 | 1028 | * @return string |
| 1029 | 1029 | */ |
@@ -1037,9 +1037,9 @@ discard block |
||
| 1037 | 1037 | |
| 1038 | 1038 | // Write $content to our opened file. |
| 1039 | 1039 | if (file_put_contents($filename, $content) === false) { |
| 1040 | - $msg .= '<span class="warning"><b>' . $_lang['file_not_saved'] . '</b></span><br /><br />'; |
|
| 1040 | + $msg .= '<span class="warning"><b>'.$_lang['file_not_saved'].'</b></span><br /><br />'; |
|
| 1041 | 1041 | } else { |
| 1042 | - $msg .= '<span class="success"><b>' . $_lang['file_saved'] . '</b></span><br /><br />'; |
|
| 1042 | + $msg .= '<span class="success"><b>'.$_lang['file_saved'].'</b></span><br /><br />'; |
|
| 1043 | 1043 | $_REQUEST['mode'] = 'edit'; |
| 1044 | 1044 | } |
| 1045 | 1045 | // Log the change |
@@ -1049,7 +1049,7 @@ discard block |
||
| 1049 | 1049 | } |
| 1050 | 1050 | } |
| 1051 | 1051 | |
| 1052 | -if(!function_exists('delete_file')) { |
|
| 1052 | +if (!function_exists('delete_file')) { |
|
| 1053 | 1053 | /** |
| 1054 | 1054 | * @return string |
| 1055 | 1055 | */ |
@@ -1061,9 +1061,9 @@ discard block |
||
| 1061 | 1061 | |
| 1062 | 1062 | $file = $_REQUEST['path']; |
| 1063 | 1063 | if (!$token_check || !@unlink($file)) { |
| 1064 | - $msg .= '<span class="warning"><b>' . $_lang['file_not_deleted'] . '</b></span><br /><br />'; |
|
| 1064 | + $msg .= '<span class="warning"><b>'.$_lang['file_not_deleted'].'</b></span><br /><br />'; |
|
| 1065 | 1065 | } else { |
| 1066 | - $msg .= '<span class="success"><b>' . $_lang['file_deleted'] . '</b></span><br /><br />'; |
|
| 1066 | + $msg .= '<span class="success"><b>'.$_lang['file_deleted'].'</b></span><br /><br />'; |
|
| 1067 | 1067 | } |
| 1068 | 1068 | |
| 1069 | 1069 | // Log the change |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | } |
| 1074 | 1074 | } |
| 1075 | 1075 | |
| 1076 | -if(!function_exists('parsePlaceholder')) { |
|
| 1076 | +if (!function_exists('parsePlaceholder')) { |
|
| 1077 | 1077 | /** |
| 1078 | 1078 | * @param string $tpl |
| 1079 | 1079 | * @param array $ph |
@@ -1090,7 +1090,7 @@ discard block |
||
| 1090 | 1090 | } |
| 1091 | 1091 | } |
| 1092 | 1092 | |
| 1093 | -if(!function_exists('checkToken')) { |
|
| 1093 | +if (!function_exists('checkToken')) { |
|
| 1094 | 1094 | /** |
| 1095 | 1095 | * @return bool |
| 1096 | 1096 | */ |
@@ -1115,7 +1115,7 @@ discard block |
||
| 1115 | 1115 | } |
| 1116 | 1116 | } |
| 1117 | 1117 | |
| 1118 | -if(!function_exists('makeToken')) { |
|
| 1118 | +if (!function_exists('makeToken')) { |
|
| 1119 | 1119 | /** |
| 1120 | 1120 | * @return string |
| 1121 | 1121 | */ |
@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('edit_document') || !$modx->hasPermission('save_document')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : null; |
|
| 9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : null; |
|
| 10 | 10 | $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; |
| 11 | 11 | $items = isset($_POST['list']) ? $_POST['list'] : ''; |
| 12 | 12 | $ressourcelist = ''; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | if (isset($_POST['listSubmitted'])) { |
| 26 | - $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>'; |
|
| 26 | + $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>'; |
|
| 27 | 27 | if (strlen($items) > 0) { |
| 28 | 28 | $items = explode(';', $items); |
| 29 | 29 | foreach ($items as $key => $value) { |
@@ -43,15 +43,15 @@ discard block |
||
| 43 | 43 | $tblsc = $modx->getFullTableName('site_content'); |
| 44 | 44 | $tbldg = $modx->getFullTableName('document_groups'); |
| 45 | 45 | |
| 46 | - $rs = $modx->db->select('pagetitle', $tblsc, 'id=' . $id . ''); |
|
| 46 | + $rs = $modx->db->select('pagetitle', $tblsc, 'id='.$id.''); |
|
| 47 | 47 | $pagetitle = $modx->db->getValue($rs); |
| 48 | 48 | |
| 49 | 49 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
| 50 | 50 | $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; |
| 51 | - $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
| 52 | - $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
| 51 | + $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
| 52 | + $access = " AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
| 53 | 53 | |
| 54 | - $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC'); |
|
| 54 | + $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc.'AS sc LEFT JOIN '.$tbldg.' dg ON dg.document=sc.id', 'sc.parent='.$id.$access.' GROUP BY sc.id', 'menuindex ASC'); |
|
| 55 | 55 | |
| 56 | 56 | if ($modx->db->getRecordCount($rs)) { |
| 57 | 57 | $ressourcelist .= '<div class="clearfix"><ul id="sortlist" class="sortableList">'; |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | $classes .= ($row['hidemenu']) ? ' notInMenuNode ' : ' inMenuNode'; |
| 61 | 61 | $classes .= ($row['published']) ? ' publishedNode ' : ' unpublishedNode '; |
| 62 | 62 | $classes = ($row['deleted']) ? ' deletedNode ' : $classes; |
| 63 | - $icon = $row['isfolder'] ? '<i class="' . $_style['files_folder'] . '"></i> ' : ' <i class="' . $_style['files_page_html'] . '"></i> '; |
|
| 64 | - $ressourcelist .= '<li id="item_' . $row['id'] . '" class="' . $classes . '">' . $icon . $row['pagetitle'] . ' <small>(' . $row['id'] . ')</small></li>'; |
|
| 63 | + $icon = $row['isfolder'] ? '<i class="'.$_style['files_folder'].'"></i> ' : ' <i class="'.$_style['files_page_html'].'"></i> '; |
|
| 64 | + $ressourcelist .= '<li id="item_'.$row['id'].'" class="'.$classes.'">'.$icon.$row['pagetitle'].' <small>('.$row['id'].')</small></li>'; |
|
| 65 | 65 | } |
| 66 | 66 | $ressourcelist .= '</ul></div>'; |
| 67 | 67 | } else { |
| 68 | - $updateMsg = '<p class="text-danger">' . $_lang['sort_nochildren'] . '</p>'; |
|
| 68 | + $updateMsg = '<p class="text-danger">'.$_lang['sort_nochildren'].'</p>'; |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | </script> |
| 149 | 149 | |
| 150 | 150 | <h1> |
| 151 | - <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $pagetitle . '<small>(' . $id . ')</small>' : $_lang['sort_menuindex']) ?> |
|
| 151 | + <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $pagetitle.'<small>('.$id.')</small>' : $_lang['sort_menuindex']) ?> |
|
| 152 | 152 | </h1> |
| 153 | 153 | |
| 154 | 154 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |
@@ -1,34 +1,34 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | /********************/ |
| 7 | -$sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; |
|
| 8 | -$sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; |
|
| 9 | -$pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; |
|
| 10 | -$add_path = $sd . $sb . $pg; |
|
| 7 | +$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC'; |
|
| 8 | +$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon'; |
|
| 9 | +$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : ''; |
|
| 10 | +$add_path = $sd.$sb.$pg; |
|
| 11 | 11 | /*******************/ |
| 12 | 12 | |
| 13 | 13 | // check permissions |
| 14 | -switch($modx->manager->action) { |
|
| 14 | +switch ($modx->manager->action) { |
|
| 15 | 15 | case 27: |
| 16 | - if(!$modx->hasPermission('edit_document')) { |
|
| 16 | + if (!$modx->hasPermission('edit_document')) { |
|
| 17 | 17 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 18 | 18 | } |
| 19 | 19 | break; |
| 20 | 20 | case 85: |
| 21 | 21 | case 72: |
| 22 | 22 | case 4: |
| 23 | - if(!$modx->hasPermission('new_document')) { |
|
| 23 | + if (!$modx->hasPermission('new_document')) { |
|
| 24 | 24 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 25 | - } elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { |
|
| 25 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { |
|
| 26 | 26 | // check user has permissions for parent |
| 27 | 27 | $udperms = new EvolutionCMS\Legacy\Permissions(); |
| 28 | 28 | $udperms->user = $modx->getLoginUserID(); |
| 29 | 29 | $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; |
| 30 | 30 | $udperms->role = $_SESSION['mgrRole']; |
| 31 | - if(!$udperms->checkPermissions()) { |
|
| 31 | + if (!$udperms->checkPermissions()) { |
|
| 32 | 32 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 40 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 41 | 41 | |
| 42 | 42 | // Get table names (alphabetical) |
| 43 | 43 | $tbl_categories = $modx->getFullTableName('categories'); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates'); |
| 53 | 53 | $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); |
| 54 | 54 | |
| 55 | -if($modx->manager->action == 27) { |
|
| 55 | +if ($modx->manager->action == 27) { |
|
| 56 | 56 | //editing an existing document |
| 57 | 57 | // check permissions on the document |
| 58 | 58 | $udperms = new EvolutionCMS\Legacy\Permissions(); |
@@ -60,13 +60,13 @@ discard block |
||
| 60 | 60 | $udperms->document = $id; |
| 61 | 61 | $udperms->role = $_SESSION['mgrRole']; |
| 62 | 62 | |
| 63 | - if(!$udperms->checkPermissions()) { |
|
| 63 | + if (!$udperms->checkPermissions()) { |
|
| 64 | 64 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // check to see if resource isn't locked |
| 69 | -if($lockedEl = $modx->elementIsLocked(7, $id)) { |
|
| 69 | +if ($lockedEl = $modx->elementIsLocked(7, $id)) { |
|
| 70 | 70 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); |
| 71 | 71 | } |
| 72 | 72 | // end check for lock |
@@ -75,27 +75,27 @@ discard block |
||
| 75 | 75 | $modx->lockElement(7, $id); |
| 76 | 76 | |
| 77 | 77 | // get document groups for current user |
| 78 | -if($_SESSION['mgrDocgroups']) { |
|
| 78 | +if ($_SESSION['mgrDocgroups']) { |
|
| 79 | 79 | $docgrp = implode(',', $_SESSION['mgrDocgroups']); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | -if(!empty ($id)) { |
|
| 82 | +if (!empty ($id)) { |
|
| 83 | 83 | $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); |
| 84 | - if($docgrp) { |
|
| 84 | + if ($docgrp) { |
|
| 85 | 85 | $access .= " OR dg.document_group IN ({$docgrp})"; |
| 86 | 86 | } |
| 87 | 87 | $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})"); |
| 88 | 88 | $content = array(); |
| 89 | 89 | $content = $modx->db->getRow($rs); |
| 90 | 90 | $modx->documentObject = &$content; |
| 91 | - if(!$content) { |
|
| 91 | + if (!$content) { |
|
| 92 | 92 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
| 93 | 93 | } |
| 94 | 94 | $_SESSION['itemname'] = $content['pagetitle']; |
| 95 | 95 | } else { |
| 96 | 96 | $content = array(); |
| 97 | 97 | |
| 98 | - if(isset($_REQUEST['newtemplate'])) { |
|
| 98 | + if (isset($_REQUEST['newtemplate'])) { |
|
| 99 | 99 | $content['template'] = $_REQUEST['newtemplate']; |
| 100 | 100 | } else { |
| 101 | 101 | $content['template'] = getDefaultTemplate(); |
@@ -106,22 +106,22 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | // restore saved form |
| 108 | 108 | $formRestored = $modx->manager->loadFormValues(); |
| 109 | -if(isset($_REQUEST['newtemplate'])) { |
|
| 109 | +if (isset($_REQUEST['newtemplate'])) { |
|
| 110 | 110 | $formRestored = true; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | // retain form values if template was changed |
| 114 | 114 | // edited to convert pub_date and unpub_date |
| 115 | 115 | // sottwell 02-09-2006 |
| 116 | -if($formRestored == true) { |
|
| 116 | +if ($formRestored == true) { |
|
| 117 | 117 | $content = array_merge($content, $_POST); |
| 118 | 118 | $content['content'] = $_POST['ta']; |
| 119 | - if(empty ($content['pub_date'])) { |
|
| 119 | + if (empty ($content['pub_date'])) { |
|
| 120 | 120 | unset ($content['pub_date']); |
| 121 | 121 | } else { |
| 122 | 122 | $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); |
| 123 | 123 | } |
| 124 | - if(empty ($content['unpub_date'])) { |
|
| 124 | + if (empty ($content['unpub_date'])) { |
|
| 125 | 125 | unset ($content['unpub_date']); |
| 126 | 126 | } else { |
| 127 | 127 | $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); |
@@ -129,12 +129,12 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | // increase menu index if this is a new document |
| 132 | -if(!isset ($_REQUEST['id'])) { |
|
| 133 | - if(!isset ($modx->config['auto_menuindex'])) { |
|
| 132 | +if (!isset ($_REQUEST['id'])) { |
|
| 133 | + if (!isset ($modx->config['auto_menuindex'])) { |
|
| 134 | 134 | $modx->config['auto_menuindex'] = 1; |
| 135 | 135 | } |
| 136 | - if($modx->config['auto_menuindex']) { |
|
| 137 | - $pid = (int)$_REQUEST['pid']; |
|
| 136 | + if ($modx->config['auto_menuindex']) { |
|
| 137 | + $pid = (int) $_REQUEST['pid']; |
|
| 138 | 138 | $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); |
| 139 | 139 | $content['menuindex'] = $modx->db->getValue($rs); |
| 140 | 140 | } else { |
@@ -142,14 +142,14 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | -if(isset ($_POST['which_editor'])) { |
|
| 145 | +if (isset ($_POST['which_editor'])) { |
|
| 146 | 146 | $modx->config['which_editor'] = $_POST['which_editor']; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | // Add lock-element JS-Script |
| 150 | 150 | $lockElementId = $id; |
| 151 | 151 | $lockElementType = 7; |
| 152 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
| 152 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
| 153 | 153 | ?> |
| 154 | 154 | <script type="text/javascript"> |
| 155 | 155 | /* <![CDATA[ */ |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | }, |
| 180 | 180 | cancel: function() { |
| 181 | 181 | documentDirty = false; |
| 182 | - document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id=' . $id . $add_path) ?>'; |
|
| 182 | + document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id='.$id.$add_path) ?>'; |
|
| 183 | 183 | }, |
| 184 | 184 | duplicate: function() { |
| 185 | 185 | if(confirm("<?= $_lang['confirm_resource_duplicate']?>") === true) { |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | }, |
| 189 | 189 | view: function() { |
| 190 | - window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'] . 'index.php?id=' . $id ?>', 'previeWin'); |
|
| 190 | + window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'].'index.php?id='.$id ?>', 'previeWin'); |
|
| 191 | 191 | } |
| 192 | 192 | }; |
| 193 | 193 | |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | 'template' => $content['template'] |
| 550 | 550 | )); |
| 551 | 551 | |
| 552 | - if(is_array($evtOut)) { |
|
| 552 | + if (is_array($evtOut)) { |
|
| 553 | 553 | echo implode('', $evtOut); |
| 554 | 554 | } |
| 555 | 555 | |
@@ -573,8 +573,8 @@ discard block |
||
| 573 | 573 | <fieldset id="create_edit"> |
| 574 | 574 | |
| 575 | 575 | <h1> |
| 576 | - <i class="fa fa-pencil-square-o"></i><?php if(isset($_REQUEST['id'])) { |
|
| 577 | - echo iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '<small>(' . $_REQUEST['id'] . ')</small>'; |
|
| 576 | + <i class="fa fa-pencil-square-o"></i><?php if (isset($_REQUEST['id'])) { |
|
| 577 | + echo iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']).(iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '').'<small>('.$_REQUEST['id'].')</small>'; |
|
| 578 | 578 | } else { |
| 579 | 579 | if ($modx->manager->action == '4') { |
| 580 | 580 | echo $_lang['add_resource']; |
@@ -590,36 +590,36 @@ discard block |
||
| 590 | 590 | |
| 591 | 591 | <?php |
| 592 | 592 | // breadcrumbs |
| 593 | - if($modx->config['use_breadcrumbs']) { |
|
| 593 | + if ($modx->config['use_breadcrumbs']) { |
|
| 594 | 594 | $temp = array(); |
| 595 | 595 | $title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title']; |
| 596 | 596 | |
| 597 | - if(isset($_REQUEST['id']) && $content['parent'] != 0) { |
|
| 597 | + if (isset($_REQUEST['id']) && $content['parent'] != 0) { |
|
| 598 | 598 | $bID = (int) $_REQUEST['id']; |
| 599 | 599 | $temp = $modx->getParentIds($bID); |
| 600 | - } else if(isset($_REQUEST['pid'])) { |
|
| 600 | + } else if (isset($_REQUEST['pid'])) { |
|
| 601 | 601 | $bID = (int) $_REQUEST['pid']; |
| 602 | 602 | $temp = $modx->getParentIds($bID); |
| 603 | 603 | array_unshift($temp, $bID); |
| 604 | 604 | } |
| 605 | 605 | |
| 606 | - if($temp) { |
|
| 606 | + if ($temp) { |
|
| 607 | 607 | $parents = implode(',', $temp); |
| 608 | 608 | |
| 609 | - if(!empty($parents)) { |
|
| 609 | + if (!empty($parents)) { |
|
| 610 | 610 | $where = "FIND_IN_SET(id,'{$parents}') DESC"; |
| 611 | 611 | $rs = $modx->db->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where); |
| 612 | - while($row = $modx->db->getRow($rs)) { |
|
| 612 | + while ($row = $modx->db->getRow($rs)) { |
|
| 613 | 613 | $out .= '<li class="breadcrumbs__li"> |
| 614 | - <a href="index.php?a=27&id=' . $row['id'] . '" class="breadcrumbs__a">' . htmlspecialchars($row['pagetitle'], ENT_QUOTES, $modx->config['modx_charset']) . '</a> |
|
| 614 | + <a href="index.php?a=27&id=' . $row['id'].'" class="breadcrumbs__a">'.htmlspecialchars($row['pagetitle'], ENT_QUOTES, $modx->config['modx_charset']).'</a> |
|
| 615 | 615 | <span class="breadcrumbs__sep">></span> |
| 616 | 616 | </li>'; |
| 617 | 617 | } |
| 618 | 618 | } |
| 619 | 619 | } |
| 620 | 620 | |
| 621 | - $out .= '<li class="breadcrumbs__li breadcrumbs__li_current">' . $title . '</li>'; |
|
| 622 | - echo '<ul class="breadcrumbs">' . $out . '</ul>'; |
|
| 621 | + $out .= '<li class="breadcrumbs__li breadcrumbs__li_current">'.$title.'</li>'; |
|
| 622 | + echo '<ul class="breadcrumbs">'.$out.'</ul>'; |
|
| 623 | 623 | } |
| 624 | 624 | ?> |
| 625 | 625 | |
@@ -636,7 +636,7 @@ discard block |
||
| 636 | 636 | $evtOut = $modx->invokeEvent('OnDocFormTemplateRender', array( |
| 637 | 637 | 'id' => $id |
| 638 | 638 | )); |
| 639 | - if(is_array($evtOut)) { |
|
| 639 | + if (is_array($evtOut)) { |
|
| 640 | 640 | echo implode('', $evtOut); |
| 641 | 641 | } else { |
| 642 | 642 | ?> |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | </td> |
| 693 | 693 | </tr> |
| 694 | 694 | |
| 695 | - <?php if($content['type'] == 'reference' || $modx->manager->action == '72') { // Web Link specific ?> |
|
| 695 | + <?php if ($content['type'] == 'reference' || $modx->manager->action == '72') { // Web Link specific ?> |
|
| 696 | 696 | |
| 697 | 697 | <tr> |
| 698 | 698 | <td><span class="warning"><?= $_lang['weblink'] ?></span> |
@@ -728,17 +728,17 @@ discard block |
||
| 728 | 728 | $from = "{$tbl_site_templates} AS t LEFT JOIN {$tbl_categories} AS c ON t.category = c.id"; |
| 729 | 729 | $rs = $modx->db->select($field, $from, '', 'c.category, t.templatename ASC'); |
| 730 | 730 | $currentCategory = ''; |
| 731 | - while($row = $modx->db->getRow($rs)) { |
|
| 732 | - if($row['selectable'] != 1 && $row['id'] != $content['template']) { |
|
| 731 | + while ($row = $modx->db->getRow($rs)) { |
|
| 732 | + if ($row['selectable'] != 1 && $row['id'] != $content['template']) { |
|
| 733 | 733 | continue; |
| 734 | 734 | }; |
| 735 | 735 | // Skip if not selectable but show if selected! |
| 736 | 736 | $thisCategory = $row['category']; |
| 737 | - if($thisCategory == null) { |
|
| 737 | + if ($thisCategory == null) { |
|
| 738 | 738 | $thisCategory = $_lang["no_category"]; |
| 739 | 739 | } |
| 740 | - if($thisCategory != $currentCategory) { |
|
| 741 | - if($closeOptGroup) { |
|
| 740 | + if ($thisCategory != $currentCategory) { |
|
| 741 | + if ($closeOptGroup) { |
|
| 742 | 742 | echo "\t\t\t\t\t</optgroup>\n"; |
| 743 | 743 | } |
| 744 | 744 | echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n"; |
@@ -747,10 +747,10 @@ discard block |
||
| 747 | 747 | |
| 748 | 748 | $selectedtext = ($row['id'] == $content['template']) ? ' selected="selected"' : ''; |
| 749 | 749 | |
| 750 | - echo "\t\t\t\t\t" . '<option value="' . $row['id'] . '"' . $selectedtext . '>' . $row['templatename'] . "</option>\n"; |
|
| 750 | + echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n"; |
|
| 751 | 751 | $currentCategory = $thisCategory; |
| 752 | 752 | } |
| 753 | - if($thisCategory != '') { |
|
| 753 | + if ($thisCategory != '') { |
|
| 754 | 754 | echo "\t\t\t\t\t</optgroup>\n"; |
| 755 | 755 | } |
| 756 | 756 | ?> |
@@ -794,20 +794,20 @@ discard block |
||
| 794 | 794 | <td valign="top"> |
| 795 | 795 | <?php |
| 796 | 796 | $parentlookup = false; |
| 797 | - if(isset ($_REQUEST['id'])) { |
|
| 798 | - if($content['parent'] == 0) { |
|
| 797 | + if (isset ($_REQUEST['id'])) { |
|
| 798 | + if ($content['parent'] == 0) { |
|
| 799 | 799 | $parentname = $site_name; |
| 800 | 800 | } else { |
| 801 | 801 | $parentlookup = $content['parent']; |
| 802 | 802 | } |
| 803 | - } elseif(isset ($_REQUEST['pid'])) { |
|
| 804 | - if($_REQUEST['pid'] == 0) { |
|
| 803 | + } elseif (isset ($_REQUEST['pid'])) { |
|
| 804 | + if ($_REQUEST['pid'] == 0) { |
|
| 805 | 805 | $parentname = $site_name; |
| 806 | 806 | } else { |
| 807 | 807 | $parentlookup = $_REQUEST['pid']; |
| 808 | 808 | } |
| 809 | - } elseif(isset($_POST['parent'])) { |
|
| 810 | - if($_POST['parent'] == 0) { |
|
| 809 | + } elseif (isset($_POST['parent'])) { |
|
| 810 | + if ($_POST['parent'] == 0) { |
|
| 811 | 811 | $parentname = $site_name; |
| 812 | 812 | } else { |
| 813 | 813 | $parentlookup = $_POST['parent']; |
@@ -816,10 +816,10 @@ discard block |
||
| 816 | 816 | $parentname = $site_name; |
| 817 | 817 | $content['parent'] = 0; |
| 818 | 818 | } |
| 819 | - if($parentlookup !== false && is_numeric($parentlookup)) { |
|
| 819 | + if ($parentlookup !== false && is_numeric($parentlookup)) { |
|
| 820 | 820 | $rs = $modx->db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); |
| 821 | 821 | $parentname = $modx->db->getValue($rs); |
| 822 | - if(!$parentname) { |
|
| 822 | + if (!$parentname) { |
|
| 823 | 823 | $modx->webAlertAndQuit($_lang["error_no_parent"]); |
| 824 | 824 | } |
| 825 | 825 | } |
@@ -861,7 +861,7 @@ discard block |
||
| 861 | 861 | }*/ |
| 862 | 862 | ?> |
| 863 | 863 | |
| 864 | - <?php if($content['type'] == 'document' || $modx->manager->action == '4') { ?> |
|
| 864 | + <?php if ($content['type'] == 'document' || $modx->manager->action == '4') { ?> |
|
| 865 | 865 | <tr> |
| 866 | 866 | <td colspan="2"> |
| 867 | 867 | <hr> |
@@ -874,8 +874,8 @@ discard block |
||
| 874 | 874 | <?php |
| 875 | 875 | // invoke OnRichTextEditorRegister event |
| 876 | 876 | $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
| 877 | - if(is_array($evtOut)) { |
|
| 878 | - for($i = 0; $i < count($evtOut); $i++) { |
|
| 877 | + if (is_array($evtOut)) { |
|
| 878 | + for ($i = 0; $i < count($evtOut); $i++) { |
|
| 879 | 879 | $editor = $evtOut[$i]; |
| 880 | 880 | echo "\t\t\t", '<option value="', $editor, '"', ($modx->config['which_editor'] == $editor ? ' selected="selected"' : ''), '>', $editor, "</option>\n"; |
| 881 | 881 | } |
@@ -886,7 +886,7 @@ discard block |
||
| 886 | 886 | </div> |
| 887 | 887 | <div id="content_body"> |
| 888 | 888 | <?php |
| 889 | - if(($content['richtext'] == 1 || $modx->manager->action == '4') && $use_editor == 1) { |
|
| 889 | + if (($content['richtext'] == 1 || $modx->manager->action == '4') && $use_editor == 1) { |
|
| 890 | 890 | $htmlContent = $content['content']; |
| 891 | 891 | ?> |
| 892 | 892 | <div class="section-editor clearfix"> |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | $richtexteditorIds[$modx->config['which_editor']][] = 'ta'; |
| 900 | 900 | $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; |
| 901 | 901 | } else { |
| 902 | - echo "\t" . '<div><textarea class="phptextarea" id="ta" name="ta" rows="20" wrap="soft" onchange="documentDirty=true;">', $modx->htmlspecialchars($content['content']), '</textarea></div>' . "\n"; |
|
| 902 | + echo "\t".'<div><textarea class="phptextarea" id="ta" name="ta" rows="20" wrap="soft" onchange="documentDirty=true;">', $modx->htmlspecialchars($content['content']), '</textarea></div>'."\n"; |
|
| 903 | 903 | } |
| 904 | 904 | ?> |
| 905 | 905 | </div> |
@@ -915,7 +915,7 @@ discard block |
||
| 915 | 915 | |
| 916 | 916 | if (($content['type'] == 'document' || $modx->manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) { |
| 917 | 917 | $template = $default_template; |
| 918 | - $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs']; |
|
| 918 | + $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int) $modx->config['group_tvs']; |
|
| 919 | 919 | if (isset ($_REQUEST['newtemplate'])) { |
| 920 | 920 | $template = $_REQUEST['newtemplate']; |
| 921 | 921 | } else { |
@@ -943,10 +943,10 @@ discard block |
||
| 943 | 943 | ); |
| 944 | 944 | $sort = 'tvtpl.rank,tv.rank, tv.id'; |
| 945 | 945 | if ($group_tvs) { |
| 946 | - $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"' . $_lang['no_category'] . '") AS category, IFNULL(cat.rank,0) AS category_rank'; |
|
| 946 | + $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"'.$_lang['no_category'].'") AS category, IFNULL(cat.rank,0) AS category_rank'; |
|
| 947 | 947 | $from .= ' |
| 948 | - LEFT JOIN ' . $tbl_categories . ' AS cat ON cat.id=tv.category'; |
|
| 949 | - $sort = 'cat.rank,cat.id,' . $sort; |
|
| 948 | + LEFT JOIN ' . $tbl_categories.' AS cat ON cat.id=tv.category'; |
|
| 949 | + $sort = 'cat.rank,cat.id,'.$sort; |
|
| 950 | 950 | } |
| 951 | 951 | $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); |
| 952 | 952 | $rs = $modx->db->select($field, $from, $where, $sort); |
@@ -964,8 +964,8 @@ discard block |
||
| 964 | 964 | if ($group_tvs == 1 || $group_tvs == 3) { |
| 965 | 965 | if ($i === 0) { |
| 966 | 966 | $templateVariablesOutput .= ' |
| 967 | - <div class="tab-section" id="tabTV_' . $row['category_id'] . '"> |
|
| 968 | - <div class="tab-header">' . $row['category'] . '</div> |
|
| 967 | + <div class="tab-section" id="tabTV_' . $row['category_id'].'"> |
|
| 968 | + <div class="tab-header">' . $row['category'].'</div> |
|
| 969 | 969 | <div class="tab-body tmplvars"> |
| 970 | 970 | <table>' . "\n"; |
| 971 | 971 | } else { |
@@ -974,17 +974,17 @@ discard block |
||
| 974 | 974 | </div> |
| 975 | 975 | </div> |
| 976 | 976 | |
| 977 | - <div class="tab-section" id="tabTV_' . $row['category_id'] . '"> |
|
| 978 | - <div class="tab-header">' . $row['category'] . '</div> |
|
| 977 | + <div class="tab-section" id="tabTV_' . $row['category_id'].'"> |
|
| 978 | + <div class="tab-header">' . $row['category'].'</div> |
|
| 979 | 979 | <div class="tab-body tmplvars"> |
| 980 | 980 | <table>'; |
| 981 | 981 | } |
| 982 | 982 | } else if ($group_tvs == 2 || $group_tvs == 4) { |
| 983 | 983 | if ($i === 0) { |
| 984 | 984 | $templateVariablesOutput .= ' |
| 985 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
| 986 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
| 987 | - <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
| 985 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
| 986 | + <h2 class="tab">' . $row['category'].'</h2> |
|
| 987 | + <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
| 988 | 988 | |
| 989 | 989 | <div class="tab-body tmplvars"> |
| 990 | 990 | <table>'; |
@@ -994,9 +994,9 @@ discard block |
||
| 994 | 994 | </div> |
| 995 | 995 | </div> |
| 996 | 996 | |
| 997 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
| 998 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
| 999 | - <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
| 997 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
| 998 | + <h2 class="tab">' . $row['category'].'</h2> |
|
| 999 | + <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
| 1000 | 1000 | |
| 1001 | 1001 | <div class="tab-body tmplvars"> |
| 1002 | 1002 | <table>'; |
@@ -1004,18 +1004,18 @@ discard block |
||
| 1004 | 1004 | } else if ($group_tvs == 5) { |
| 1005 | 1005 | if ($i === 0) { |
| 1006 | 1006 | $templateVariablesOutput .= ' |
| 1007 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
| 1008 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
| 1009 | - <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
| 1007 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
| 1008 | + <h2 class="tab">' . $row['category'].'</h2> |
|
| 1009 | + <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
| 1010 | 1010 | <table>'; |
| 1011 | 1011 | } else { |
| 1012 | 1012 | $templateVariablesOutput .= ' |
| 1013 | 1013 | </table> |
| 1014 | 1014 | </div> |
| 1015 | 1015 | |
| 1016 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
| 1017 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
| 1018 | - <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
| 1016 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
| 1017 | + <h2 class="tab">' . $row['category'].'</h2> |
|
| 1018 | + <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
| 1019 | 1019 | |
| 1020 | 1020 | <table>'; |
| 1021 | 1021 | } |
@@ -1035,8 +1035,8 @@ discard block |
||
| 1035 | 1035 | $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor']; |
| 1036 | 1036 | }; |
| 1037 | 1037 | // Add richtext editor to the list |
| 1038 | - $richtexteditorIds[$editor][] = "tv" . $row['id']; |
|
| 1039 | - $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; |
|
| 1038 | + $richtexteditorIds[$editor][] = "tv".$row['id']; |
|
| 1039 | + $richtexteditorOptions[$editor]["tv".$row['id']] = $tvOptions; |
|
| 1040 | 1040 | } |
| 1041 | 1041 | |
| 1042 | 1042 | $templateVariablesTmp = ''; |
@@ -1053,24 +1053,24 @@ discard block |
||
| 1053 | 1053 | } |
| 1054 | 1054 | |
| 1055 | 1055 | // post back value |
| 1056 | - if (array_key_exists('tv' . $row['id'], $_POST)) { |
|
| 1057 | - if (is_array($_POST['tv' . $row['id']])) { |
|
| 1058 | - $tvPBV = implode('||', $_POST['tv' . $row['id']]); |
|
| 1056 | + if (array_key_exists('tv'.$row['id'], $_POST)) { |
|
| 1057 | + if (is_array($_POST['tv'.$row['id']])) { |
|
| 1058 | + $tvPBV = implode('||', $_POST['tv'.$row['id']]); |
|
| 1059 | 1059 | } else { |
| 1060 | - $tvPBV = $_POST['tv' . $row['id']]; |
|
| 1060 | + $tvPBV = $_POST['tv'.$row['id']]; |
|
| 1061 | 1061 | } |
| 1062 | 1062 | } else { |
| 1063 | 1063 | $tvPBV = $row['value']; |
| 1064 | 1064 | } |
| 1065 | 1065 | |
| 1066 | - $tvDescription = (!empty($row['description'])) ? '<br /><span class="comment">' . $row['description'] . '</span>' : ''; |
|
| 1067 | - $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '<br /><span class="comment inherited">(' . $_lang['tmplvars_inherited'] . ')</span>' : ''; |
|
| 1068 | - $tvName = $modx->hasPermission('edit_template') ? '<br/><small class="protectedNode">[*' . $row['name'] . '*]</small>' : ''; |
|
| 1066 | + $tvDescription = (!empty($row['description'])) ? '<br /><span class="comment">'.$row['description'].'</span>' : ''; |
|
| 1067 | + $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '<br /><span class="comment inherited">('.$_lang['tmplvars_inherited'].')</span>' : ''; |
|
| 1068 | + $tvName = $modx->hasPermission('edit_template') ? '<br/><small class="protectedNode">[*'.$row['name'].'*]</small>' : ''; |
|
| 1069 | 1069 | |
| 1070 | 1070 | $templateVariablesTmp .= ' |
| 1071 | 1071 | <tr> |
| 1072 | - <td><span class="warning">' . $row['caption'] . $tvName . '</span>' . $tvDescription . $tvInherited . '</td> |
|
| 1073 | - <td><div style="position:relative;' . ($row['type'] == 'date' ? '' : '') . '">' . renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray) . '</div></td> |
|
| 1072 | + <td><span class="warning">' . $row['caption'].$tvName.'</span>'.$tvDescription.$tvInherited.'</td> |
|
| 1073 | + <td><div style="position:relative;' . ($row['type'] == 'date' ? '' : '').'">'.renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray).'</div></td> |
|
| 1074 | 1074 | </tr>'; |
| 1075 | 1075 | |
| 1076 | 1076 | if ($group_tvs && $row['category_id'] == 0) { |
@@ -1084,38 +1084,38 @@ discard block |
||
| 1084 | 1084 | } |
| 1085 | 1085 | |
| 1086 | 1086 | if ($templateVariablesGeneral) { |
| 1087 | - echo '<table id="tabTV_0" class="tmplvars"><tbody>' . $templateVariablesGeneral . '</tbody></table>'; |
|
| 1087 | + echo '<table id="tabTV_0" class="tmplvars"><tbody>'.$templateVariablesGeneral.'</tbody></table>'; |
|
| 1088 | 1088 | } |
| 1089 | 1089 | |
| 1090 | 1090 | $templateVariables .= ' |
| 1091 | 1091 | <!-- Template Variables -->' . "\n"; |
| 1092 | 1092 | if (!$group_tvs) { |
| 1093 | 1093 | $templateVariables .= ' |
| 1094 | - <div class="sectionHeader" id="tv_header">' . $_lang['settings_templvars'] . '</div> |
|
| 1094 | + <div class="sectionHeader" id="tv_header">' . $_lang['settings_templvars'].'</div> |
|
| 1095 | 1095 | <div class="sectionBody tmplvars"> |
| 1096 | 1096 | <table>'; |
| 1097 | 1097 | } else if ($group_tvs == 2) { |
| 1098 | 1098 | $templateVariables .= ' |
| 1099 | 1099 | <div class="tab-section"> |
| 1100 | - <div class="tab-header" id="tv_header">' . $_lang['settings_templvars'] . '</div> |
|
| 1100 | + <div class="tab-header" id="tv_header">' . $_lang['settings_templvars'].'</div> |
|
| 1101 | 1101 | <div class="tab-pane" id="paneTemplateVariables"> |
| 1102 | 1102 | <script type="text/javascript"> |
| 1103 | - tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
|
| 1103 | + tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').'); |
|
| 1104 | 1104 | </script>'; |
| 1105 | 1105 | } else if ($group_tvs == 3) { |
| 1106 | 1106 | $templateVariables .= ' |
| 1107 | 1107 | <div id="templateVariables" class="tab-page tmplvars"> |
| 1108 | - <h2 class="tab">' . $_lang['settings_templvars'] . '</h2> |
|
| 1108 | + <h2 class="tab">' . $_lang['settings_templvars'].'</h2> |
|
| 1109 | 1109 | <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'templateVariables\'));</script>'; |
| 1110 | 1110 | } else if ($group_tvs == 4) { |
| 1111 | 1111 | $templateVariables .= ' |
| 1112 | 1112 | <div id="templateVariables" class="tab-page tmplvars"> |
| 1113 | - <h2 class="tab">' . $_lang['settings_templvars'] . '</h2> |
|
| 1113 | + <h2 class="tab">' . $_lang['settings_templvars'].'</h2> |
|
| 1114 | 1114 | <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'templateVariables\'));</script> |
| 1115 | 1115 | |
| 1116 | 1116 | <div class="tab-pane" id="paneTemplateVariables"> |
| 1117 | 1117 | <script type="text/javascript"> |
| 1118 | - tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
|
| 1118 | + tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').'); |
|
| 1119 | 1119 | </script>'; |
| 1120 | 1120 | } |
| 1121 | 1121 | $templateVariables .= $templateVariablesOutput; |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | |
| 1208 | 1208 | <?php |
| 1209 | 1209 | |
| 1210 | - if($_SESSION['mgrRole'] == 1 || $modx->manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { |
|
| 1210 | + if ($_SESSION['mgrRole'] == 1 || $modx->manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { |
|
| 1211 | 1211 | ?> |
| 1212 | 1212 | <tr> |
| 1213 | 1213 | <td> |
@@ -1230,13 +1230,13 @@ discard block |
||
| 1230 | 1230 | <td> |
| 1231 | 1231 | <select name="contentType" class="inputBox" onchange="documentDirty=true;"> |
| 1232 | 1232 | <?php |
| 1233 | - if(!$content['contentType']) { |
|
| 1233 | + if (!$content['contentType']) { |
|
| 1234 | 1234 | $content['contentType'] = 'text/html'; |
| 1235 | 1235 | } |
| 1236 | 1236 | $custom_contenttype = (isset ($custom_contenttype) ? $custom_contenttype : "text/html,text/plain,text/xml"); |
| 1237 | 1237 | $ct = explode(",", $custom_contenttype); |
| 1238 | - for($i = 0; $i < count($ct); $i++) { |
|
| 1239 | - echo "\t\t\t\t\t" . '<option value="' . $ct[$i] . '"' . ($content['contentType'] == $ct[$i] ? ' selected="selected"' : '') . '>' . $ct[$i] . "</option>\n"; |
|
| 1238 | + for ($i = 0; $i < count($ct); $i++) { |
|
| 1239 | + echo "\t\t\t\t\t".'<option value="'.$ct[$i].'"'.($content['contentType'] == $ct[$i] ? ' selected="selected"' : '').'>'.$ct[$i]."</option>\n"; |
|
| 1240 | 1240 | } |
| 1241 | 1241 | ?> |
| 1242 | 1242 | </select> |
@@ -1262,7 +1262,7 @@ discard block |
||
| 1262 | 1262 | </tr> |
| 1263 | 1263 | <?php |
| 1264 | 1264 | } else { |
| 1265 | - if($content['type'] != 'reference' && $modx->manager->action != '72') { |
|
| 1265 | + if ($content['type'] != 'reference' && $modx->manager->action != '72') { |
|
| 1266 | 1266 | // non-admin managers creating or editing a document resource |
| 1267 | 1267 | ?> |
| 1268 | 1268 | <input type="hidden" name="contentType" value="<?= (isset($content['contentType']) ? $content['contentType'] : "text/html") ?>" /> |
@@ -1362,15 +1362,15 @@ discard block |
||
| 1362 | 1362 | <?php |
| 1363 | 1363 | /******************************* |
| 1364 | 1364 | * Document Access Permissions */ |
| 1365 | - if($use_udperms == 1) { |
|
| 1365 | + if ($use_udperms == 1) { |
|
| 1366 | 1366 | $groupsarray = array(); |
| 1367 | 1367 | $sql = ''; |
| 1368 | 1368 | |
| 1369 | 1369 | $documentId = ($modx->manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); |
| 1370 | - if($documentId > 0) { |
|
| 1370 | + if ($documentId > 0) { |
|
| 1371 | 1371 | // Load up, the permissions from the parent (if new document) or existing document |
| 1372 | 1372 | $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); |
| 1373 | - while($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; |
|
| 1373 | + while ($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'].','.$currentgroup['id']; |
|
| 1374 | 1374 | |
| 1375 | 1375 | // Load up the current permissions and names |
| 1376 | 1376 | $vs = array( |
@@ -1386,7 +1386,7 @@ discard block |
||
| 1386 | 1386 | } |
| 1387 | 1387 | |
| 1388 | 1388 | // retain selected doc groups between post |
| 1389 | - if(isset($_POST['docgroups'])) { |
|
| 1389 | + if (isset($_POST['docgroups'])) { |
|
| 1390 | 1390 | $groupsarray = array_merge($groupsarray, $_POST['docgroups']); |
| 1391 | 1391 | } |
| 1392 | 1392 | |
@@ -1405,26 +1405,26 @@ discard block |
||
| 1405 | 1405 | $permissions_no = 0; // count permissions the current mgr user doesn't have |
| 1406 | 1406 | |
| 1407 | 1407 | // Loop through the permissions list |
| 1408 | - while($row = $modx->db->getRow($rs)) { |
|
| 1408 | + while ($row = $modx->db->getRow($rs)) { |
|
| 1409 | 1409 | |
| 1410 | 1410 | // Create an inputValue pair (group ID and group link (if it exists)) |
| 1411 | - $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); |
|
| 1412 | - $inputId = 'group-' . $row['id']; |
|
| 1411 | + $inputValue = $row['id'].','.($row['link_id'] ? $row['link_id'] : 'new'); |
|
| 1412 | + $inputId = 'group-'.$row['id']; |
|
| 1413 | 1413 | |
| 1414 | 1414 | $checked = in_array($inputValue, $groupsarray); |
| 1415 | - if($checked) { |
|
| 1415 | + if ($checked) { |
|
| 1416 | 1416 | $notPublic = true; |
| 1417 | 1417 | } // Mark as private access (either web or manager) |
| 1418 | 1418 | |
| 1419 | 1419 | // Skip the access permission if the user doesn't have access... |
| 1420 | - if((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { |
|
| 1420 | + if ((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { |
|
| 1421 | 1421 | continue; |
| 1422 | 1422 | } |
| 1423 | 1423 | |
| 1424 | 1424 | // Setup attributes for this Input box |
| 1425 | 1425 | $inputAttributes['id'] = $inputId; |
| 1426 | 1426 | $inputAttributes['value'] = $inputValue; |
| 1427 | - if($checked) { |
|
| 1427 | + if ($checked) { |
|
| 1428 | 1428 | $inputAttributes['checked'] = 'checked'; |
| 1429 | 1429 | } else { |
| 1430 | 1430 | unset($inputAttributes['checked']); |
@@ -1432,10 +1432,10 @@ discard block |
||
| 1432 | 1432 | |
| 1433 | 1433 | // Create attribute string list |
| 1434 | 1434 | $inputString = array(); |
| 1435 | - foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"'; |
|
| 1435 | + foreach ($inputAttributes as $k => $v) $inputString[] = $k.'="'.$v.'"'; |
|
| 1436 | 1436 | |
| 1437 | 1437 | // Make the <input> HTML |
| 1438 | - $inputHTML = '<input ' . implode(' ', $inputString) . ' />'; |
|
| 1438 | + $inputHTML = '<input '.implode(' ', $inputString).' />'; |
|
| 1439 | 1439 | |
| 1440 | 1440 | // does user have this permission? |
| 1441 | 1441 | $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; |
@@ -1446,23 +1446,23 @@ discard block |
||
| 1446 | 1446 | $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); |
| 1447 | 1447 | $rsp = $modx->db->select('COUNT(mg.id)', $from, $where); |
| 1448 | 1448 | $count = $modx->db->getValue($rsp); |
| 1449 | - if($count > 0) { |
|
| 1449 | + if ($count > 0) { |
|
| 1450 | 1450 | ++$permissions_yes; |
| 1451 | 1451 | } else { |
| 1452 | 1452 | ++$permissions_no; |
| 1453 | 1453 | } |
| 1454 | - $permissions[] = "\t\t" . '<li>' . $inputHTML . '<label for="' . $inputId . '">' . $row['name'] . '</label></li>'; |
|
| 1454 | + $permissions[] = "\t\t".'<li>'.$inputHTML.'<label for="'.$inputId.'">'.$row['name'].'</label></li>'; |
|
| 1455 | 1455 | } |
| 1456 | 1456 | // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public |
| 1457 | - if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { |
|
| 1457 | + if ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { |
|
| 1458 | 1458 | $permissions = array(); |
| 1459 | 1459 | } |
| 1460 | 1460 | |
| 1461 | 1461 | // See if the Access Permissions section is worth displaying... |
| 1462 | - if(!empty($permissions)) { |
|
| 1462 | + if (!empty($permissions)) { |
|
| 1463 | 1463 | // Add the "All Document Groups" item if we have rights in both contexts |
| 1464 | - if($isManager && $isWeb) { |
|
| 1465 | - array_unshift($permissions, "\t\t" . '<li><input type="checkbox" class="checkbox" name="chkalldocs" id="groupall"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true);" /><label for="groupall" class="warning">' . $_lang['all_doc_groups'] . '</label></li>'); |
|
| 1464 | + if ($isManager && $isWeb) { |
|
| 1465 | + array_unshift($permissions, "\t\t".'<li><input type="checkbox" class="checkbox" name="chkalldocs" id="groupall"'.(!$notPublic ? ' checked="checked"' : '').' onclick="makePublic(true);" /><label for="groupall" class="warning">'.$_lang['all_doc_groups'].'</label></li>'); |
|
| 1466 | 1466 | } |
| 1467 | 1467 | // Output the permissions list... |
| 1468 | 1468 | ?> |
@@ -1495,12 +1495,12 @@ discard block |
||
| 1495 | 1495 | </script> |
| 1496 | 1496 | <p><?= $_lang['access_permissions_docs_message'] ?></p> |
| 1497 | 1497 | <ul> |
| 1498 | - <?= implode("\n", $permissions) . "\n" ?> |
|
| 1498 | + <?= implode("\n", $permissions)."\n" ?> |
|
| 1499 | 1499 | </ul> |
| 1500 | 1500 | </div><!--div class="tab-page" id="tabAccess"--> |
| 1501 | 1501 | <?php |
| 1502 | 1502 | } // !empty($permissions) |
| 1503 | - elseif($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { |
|
| 1503 | + elseif ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { |
|
| 1504 | 1504 | ?> |
| 1505 | 1505 | <p><?= $_lang["access_permissions_docs_collision"] ?></p> |
| 1506 | 1506 | <?php |
@@ -1520,7 +1520,7 @@ discard block |
||
| 1520 | 1520 | 'template' => $content['template'] |
| 1521 | 1521 | )); |
| 1522 | 1522 | |
| 1523 | - if(is_array($evtOut)) { |
|
| 1523 | + if (is_array($evtOut)) { |
|
| 1524 | 1524 | echo implode('', $evtOut); |
| 1525 | 1525 | } |
| 1526 | 1526 | ?> |
@@ -1533,23 +1533,23 @@ discard block |
||
| 1533 | 1533 | storeCurTemplate(); |
| 1534 | 1534 | </script> |
| 1535 | 1535 | <?php |
| 1536 | -if(($content['richtext'] == 1 || $modx->manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { |
|
| 1537 | - if(is_array($richtexteditorIds)) { |
|
| 1538 | - foreach($richtexteditorIds as $editor => $elements) { |
|
| 1536 | +if (($content['richtext'] == 1 || $modx->manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { |
|
| 1537 | + if (is_array($richtexteditorIds)) { |
|
| 1538 | + foreach ($richtexteditorIds as $editor => $elements) { |
|
| 1539 | 1539 | // invoke OnRichTextEditorInit event |
| 1540 | 1540 | $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( |
| 1541 | 1541 | 'editor' => $editor, |
| 1542 | 1542 | 'elements' => $elements, |
| 1543 | 1543 | 'options' => $richtexteditorOptions[$editor] |
| 1544 | 1544 | )); |
| 1545 | - if(is_array($evtOut)) { |
|
| 1545 | + if (is_array($evtOut)) { |
|
| 1546 | 1546 | echo implode('', $evtOut); |
| 1547 | 1547 | } |
| 1548 | 1548 | } |
| 1549 | 1549 | } |
| 1550 | 1550 | } |
| 1551 | 1551 | |
| 1552 | -if(!function_exists('getDefaultTemplate')) { |
|
| 1552 | +if (!function_exists('getDefaultTemplate')) { |
|
| 1553 | 1553 | /** |
| 1554 | 1554 | * @return string |
| 1555 | 1555 | */ |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 21 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 22 | 22 | |
| 23 | 23 | $tbl_site_plugins = $modx->getFullTableName('site_plugins'); |
| 24 | 24 | $tbl_site_plugin_events = $modx->getFullTableName('site_plugin_events'); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $content['properties'] = str_replace("&", "&", $content['properties']); |
| 47 | 47 | } else { |
| 48 | 48 | $_SESSION['itemname'] = $_lang["new_plugin"]; |
| 49 | - $content['category'] = (int)$_REQUEST['catid']; |
|
| 49 | + $content['category'] = (int) $_REQUEST['catid']; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if ($modx->manager->hasFormValues()) { |
@@ -56,9 +56,9 @@ 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 | -if(!function_exists('bold')) { |
|
| 61 | +if (!function_exists('bold')) { |
|
| 62 | 62 | /** |
| 63 | 63 | * @param bool $cond |
| 64 | 64 | * @return string |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> |
| 483 | 483 | |
| 484 | 484 | <h1> |
| 485 | - <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> |
|
| 485 | + <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> |
|
| 486 | 486 | </h1> |
| 487 | 487 | |
| 488 | 488 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | <div class="form-control-name clearfix"> |
| 509 | 509 | <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
| 510 | 510 | <?php if ($modx->hasPermission('save_role')): ?> |
| 511 | - <label class="custom-control" title="<?= $_lang['lock_plugin'] . "\n" . $_lang['lock_plugin_msg'] ?>" tooltip> |
|
| 511 | + <label class="custom-control" title="<?= $_lang['lock_plugin']."\n".$_lang['lock_plugin_msg'] ?>" tooltip> |
|
| 512 | 512 | <input name="locked" type="checkbox" value="on"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
| 513 | 513 | <i class="fa fa-lock"></i> |
| 514 | 514 | </label> |
@@ -532,9 +532,9 @@ discard block |
||
| 532 | 532 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
| 533 | 533 | <option> </option> |
| 534 | 534 | <?php |
| 535 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 535 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 536 | 536 | foreach (getCategories() as $n => $v) { |
| 537 | - echo '<option value="' . $v['id'] . '"' . ($content["category"] == $v["id"] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v["category"]) . "</option>"; |
|
| 537 | + echo '<option value="'.$v['id'].'"'.($content["category"] == $v["id"] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v["category"])."</option>"; |
|
| 538 | 538 | } |
| 539 | 539 | ?> |
| 540 | 540 | </select> |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | <?php if ($modx->hasPermission('save_role')): ?> |
| 551 | 551 | <div class="form-group"> |
| 552 | 552 | <div class="form-row"> |
| 553 | - <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> |
|
| 553 | + <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> |
|
| 554 | 554 | </div> |
| 555 | 555 | <div class="form-row"> |
| 556 | 556 | <label> |
@@ -597,11 +597,11 @@ discard block |
||
| 597 | 597 | <select name="moduleguid" class="form-control" onchange="documentDirty=true;"> |
| 598 | 598 | <option> </option> |
| 599 | 599 | <?php |
| 600 | - $ds = $modx->db->select('sm.id,sm.name,sm.guid', $modx->getFullTableName("site_modules") . " sm |
|
| 601 | - INNER JOIN " . $modx->getFullTableName("site_module_depobj") . " smd ON smd.module=sm.id AND smd.type=30 |
|
| 602 | - INNER JOIN " . $modx->getFullTableName("site_plugins") . " sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name'); |
|
| 600 | + $ds = $modx->db->select('sm.id,sm.name,sm.guid', $modx->getFullTableName("site_modules")." sm |
|
| 601 | + INNER JOIN " . $modx->getFullTableName("site_module_depobj")." smd ON smd.module=sm.id AND smd.type=30 |
|
| 602 | + INNER JOIN " . $modx->getFullTableName("site_plugins")." sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name'); |
|
| 603 | 603 | while ($row = $modx->db->getRow($ds)) { |
| 604 | - echo "<option value='" . $row['guid'] . "'" . ($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($row["name"]) . "</option>"; |
|
| 604 | + echo "<option value='".$row['guid']."'".($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "").">".$modx->htmlspecialchars($row["name"])."</option>"; |
|
| 605 | 605 | } |
| 606 | 606 | ?> |
| 607 | 607 | </select> |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | echoEventRows($evtnames); |
| 664 | 664 | } |
| 665 | 665 | echo '<hr class="clear">'; |
| 666 | - echo '<div class="form-group"><b>' . $services[$srv - 1] . '</b></div>'; |
|
| 666 | + echo '<div class="form-group"><b>'.$services[$srv - 1].'</b></div>'; |
|
| 667 | 667 | } |
| 668 | 668 | // display group name |
| 669 | 669 | if ($grp != $row['groupname']) { |
@@ -672,9 +672,9 @@ discard block |
||
| 672 | 672 | echoEventRows($evtnames); |
| 673 | 673 | } |
| 674 | 674 | echo '<hr class="clear">'; |
| 675 | - echo '<div class="form-group"><b>' . $row['groupname'] . '</b></div>'; |
|
| 675 | + echo '<div class="form-group"><b>'.$row['groupname'].'</b></div>'; |
|
| 676 | 676 | } |
| 677 | - $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"; |
|
| 677 | + $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"; |
|
| 678 | 678 | if (count($evtnames) == 2) { |
| 679 | 679 | echoEventRows($evtnames); |
| 680 | 680 | } |
@@ -684,11 +684,11 @@ discard block |
||
| 684 | 684 | echoEventRows($evtnames); |
| 685 | 685 | } |
| 686 | 686 | |
| 687 | - if(!function_exists('echoEventRows')) { |
|
| 687 | + if (!function_exists('echoEventRows')) { |
|
| 688 | 688 | function echoEventRows(&$evtnames) |
| 689 | 689 | { |
| 690 | - 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">', |
|
| 691 | - $evtnames) . '</div></div>'; |
|
| 690 | + 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">', |
|
| 691 | + $evtnames).'</div></div>'; |
|
| 692 | 692 | $evtnames = array(); |
| 693 | 693 | } |
| 694 | 694 | } |
@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -if(!$modx->hasPermission('category_manager')) { |
|
| 6 | +if (!$modx->hasPermission('category_manager')) { |
|
| 7 | 7 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 8 | 8 | } |
| 9 | 9 | |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | 'native_language' => 'de', |
| 16 | 16 | 'name' => 'Categories Manager', |
| 17 | 17 | 'dirname' => $site_manager_url, |
| 18 | - 'url' => 'index.php?a=120&id=' . $_GET['id'], |
|
| 19 | - 'path' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, |
|
| 20 | - 'inc_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, |
|
| 21 | - 'languages_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, |
|
| 22 | - 'views_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, |
|
| 18 | + 'url' => 'index.php?a=120&id='.$_GET['id'], |
|
| 19 | + 'path' => realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR, |
|
| 20 | + 'inc_dir' => realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR, |
|
| 21 | + 'languages_dir' => realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR, |
|
| 22 | + 'views_dir' => realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR.'skin'.DIRECTORY_SEPARATOR, |
|
| 23 | 23 | 'request_key' => 'module_categories_manager', |
| 24 | 24 | 'messages' => array() |
| 25 | 25 | ); |
@@ -27,19 +27,19 @@ discard block |
||
| 27 | 27 | $cm = new EvolutionCMS\Legacy\ModuleCategoriesManager(); |
| 28 | 28 | |
| 29 | 29 | // assign module_params to internal params |
| 30 | -foreach( $_module_params as $param => $value ) |
|
| 30 | +foreach ($_module_params as $param => $value) |
|
| 31 | 31 | { |
| 32 | - $cm->set( $param, $value ); |
|
| 32 | + $cm->set($param, $value); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | // catch the request actions |
| 36 | -include_once $cm->get('inc_dir') . 'request_trigger.inc.php'; |
|
| 36 | +include_once $cm->get('inc_dir').'request_trigger.inc.php'; |
|
| 37 | 37 | |
| 38 | -if( !$categories = $cm->getCategories() ) |
|
| 38 | +if (!$categories = $cm->getCategories()) |
|
| 39 | 39 | { |
| 40 | - setcookie('webfxtab_manage-categories-pane', 0 ); |
|
| 41 | - $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); |
|
| 40 | + setcookie('webfxtab_manage-categories-pane', 0); |
|
| 41 | + $cm->addMessage($cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global'); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | -$cm->renderView('main', $categories ); |
|
| 44 | +$cm->renderView('main', $categories); |
|
| 45 | 45 | return; |
@@ -1,5 +1,5 @@ |
||
| 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 | |
@@ -1,17 +1,17 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | $tpl = array( |
| 7 | - 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), |
|
| 8 | - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
| 9 | - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
| 10 | - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
| 11 | - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') |
|
| 7 | + 'viewForm' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_viewForm.tpl'), |
|
| 8 | + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelGroup.tpl'), |
|
| 9 | + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelHeading.tpl'), |
|
| 10 | + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelCollapse.tpl'), |
|
| 11 | + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_elementsRow.tpl') |
|
| 12 | 12 | ); |
| 13 | 13 | |
| 14 | -if(!function_exists('parsePh')) {
|
|
| 14 | +if (!function_exists('parsePh')) {
|
|
| 15 | 15 | /** |
| 16 | 16 | * @param string $tpl |
| 17 | 17 | * @param array $ph |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -if(!function_exists('renderViewSwitchButtons')) {
|
|
| 30 | +if (!function_exists('renderViewSwitchButtons')) {
|
|
| 31 | 31 | /** |
| 32 | 32 | * @param string|int $cssId |
| 33 | 33 | * @return string |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | -if(!function_exists('createResourceList')) {
|
|
| 46 | +if (!function_exists('createResourceList')) {
|
|
| 47 | 47 | /** |
| 48 | 48 | * @param string $resourceTable |
| 49 | 49 | * @param mgrResources $resources |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $panelGroup .= parsePh($tpl['panelHeading'], array( |
| 77 | 77 | 'tab' => $resourceTable, |
| 78 | 78 | 'category' => $categories[$catid]['name'], |
| 79 | - 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
|
|
| 79 | + 'categoryid' => $catid != '' ? ' <small>('.$catid.')</small>' : '',
|
|
| 80 | 80 | 'catid' => $catid, |
| 81 | 81 | )); |
| 82 | 82 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | -if(!function_exists('createCombinedView')) {
|
|
| 104 | +if (!function_exists('createCombinedView')) {
|
|
| 105 | 105 | /** |
| 106 | 106 | * @param mgrResources $resources |
| 107 | 107 | * @return string |
@@ -120,10 +120,10 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $tpl = array( |
| 123 | - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
| 124 | - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
| 125 | - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
| 126 | - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), |
|
| 123 | + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelGroup.tpl'), |
|
| 124 | + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelHeading.tpl'), |
|
| 125 | + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelCollapse.tpl'), |
|
| 126 | + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_elementsRow.tpl'), |
|
| 127 | 127 | ); |
| 128 | 128 | |
| 129 | 129 | // Easily loop through $itemsPerCategory-Array |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $panelGroup .= parsePh($tpl['panelHeading'], array( |
| 142 | 142 | 'tab' => 'categories_list', |
| 143 | 143 | 'category' => $categories[$catid], |
| 144 | - 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
|
|
| 144 | + 'categoryid' => $catid != '' ? ' <small>('.$catid.')</small>' : '',
|
|
| 145 | 145 | 'catid' => $catid, |
| 146 | 146 | )); |
| 147 | 147 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | -if(!function_exists('prepareElementRowPh')) {
|
|
| 163 | +if (!function_exists('prepareElementRowPh')) {
|
|
| 164 | 164 | /** |
| 165 | 165 | * @param array $row |
| 166 | 166 | * @param string $resourceTable |
@@ -216,32 +216,32 @@ discard block |
||
| 216 | 216 | if ($rowLock && $modx->hasPermission('display_locks')) {
|
| 217 | 217 | if ($rowLock['sid'] == $modx->sid) {
|
| 218 | 218 | $title = $modx->parseText($_lang["lock_element_editing"], array( |
| 219 | - 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
| 219 | + 'element_type' => $_lang["lock_element_type_".$lockElementType], |
|
| 220 | 220 | 'lasthit_df' => $rowLock['lasthit_df'] |
| 221 | 221 | )); |
| 222 | - $lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span> '; |
|
| 222 | + $lockedByUser = '<span title="'.$title.'" class="editResource" style="cursor:context-menu;">'.$_style['tree_preview_resource'].'</span> '; |
|
| 223 | 223 | } else {
|
| 224 | 224 | $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
| 225 | - 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
| 225 | + 'element_type' => $_lang["lock_element_type_".$lockElementType], |
|
| 226 | 226 | 'username' => $rowLock['username'], |
| 227 | 227 | 'lasthit_df' => $rowLock['lasthit_df'] |
| 228 | 228 | )); |
| 229 | 229 | if ($modx->hasPermission('remove_locks')) {
|
| 230 | - $lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>';
|
|
| 230 | + $lockedByUser = '<a href="javascript:;" onclick="unlockElement('.$lockElementType.', '.$row['id'].', this);return false;" title="'.$title.'" class="lockedResource"><i class="'.$_style['icons_secured'].'"></i></a>';
|
|
| 231 | 231 | } else {
|
| 232 | - $lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>'; |
|
| 232 | + $lockedByUser = '<span title="'.$title.'" class="lockedResource" style="cursor:context-menu;"><i class="'.$_style['icons_secured'].'"></i></span>'; |
|
| 233 | 233 | } |
| 234 | 234 | } |
| 235 | 235 | } |
| 236 | 236 | if ($lockedByUser) {
|
| 237 | - $lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>'; |
|
| 237 | + $lockedByUser = '<div class="lockCell">'.$lockedByUser.'</div>'; |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | // Caption |
| 241 | 241 | if ($resourceTable == 'site_tmplvars') {
|
| 242 | - $caption = !empty($row['description']) ? ' ' . $row['caption'] . ' <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption'];
|
|
| 242 | + $caption = !empty($row['description']) ? ' '.$row['caption'].' <small>('.$row['description'].')</small>' : ' '.$row['caption'];
|
|
| 243 | 243 | } else {
|
| 244 | - $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; |
|
| 244 | + $caption = !empty($row['description']) ? ' '.$row['description'] : ''; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | // Special marks |
@@ -252,26 +252,26 @@ discard block |
||
| 252 | 252 | if ($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
|
| 253 | 253 | $tplInfo[] = $_lang['defaulttemplate_title']; |
| 254 | 254 | } |
| 255 | - $marks = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : '';
|
|
| 255 | + $marks = !empty($tplInfo) ? ' <em>('.implode(', ', $tplInfo).')</em>' : '';
|
|
| 256 | 256 | |
| 257 | 257 | /* row buttons */ |
| 258 | 258 | $buttons = ''; |
| 259 | 259 | if ($modx->hasPermission($types['actions']['edit'][1])) {
|
| 260 | - $buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>'; |
|
| 260 | + $buttons .= '<li><a title="'.$_lang["edit_resource"].'" href="index.php?a='.$types['actions']['edit'][0].'&id='.$row['id'].'"><i class="fa fa-edit fa-fw"></i></a></li>'; |
|
| 261 | 261 | } |
| 262 | 262 | if ($modx->hasPermission($types['actions']['duplicate'][1])) {
|
| 263 | - $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>'; |
|
| 263 | + $buttons .= '<li><a onclick="return confirm(\''.$_lang["confirm_duplicate_record"].'\')" title="'.$_lang["resource_duplicate"].'" href="index.php?a='.$types['actions']['duplicate'][0].'&id='.$row['id'].'"><i class="fa fa-clone fa-fw"></i></a></li>'; |
|
| 264 | 264 | } |
| 265 | 265 | if ($modx->hasPermission($types['actions']['remove'][1])) {
|
| 266 | - $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>'; |
|
| 266 | + $buttons .= '<li><a onclick="return confirm(\''.$_lang["confirm_delete"].'\')" title="'.$_lang["delete"].'" href="index.php?a='.$types['actions']['remove'][0].'&id='.$row['id'].'"><i class="fa fa-trash fa-fw"></i></a></li>'; |
|
| 267 | 267 | } |
| 268 | - $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : ''; |
|
| 268 | + $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">'.$buttons.'</ul></div>' : ''; |
|
| 269 | 269 | |
| 270 | 270 | $catid = $row['catid'] ? $row['catid'] : 0; |
| 271 | 271 | |
| 272 | 272 | // Placeholders for elements-row |
| 273 | 273 | return array( |
| 274 | - 'class' => $class ? ' class="' . $class . '"' : '', |
|
| 274 | + 'class' => $class ? ' class="'.$class.'"' : '', |
|
| 275 | 275 | 'lockedByUser' => $lockedByUser, |
| 276 | 276 | 'name' => $row['name'], |
| 277 | 277 | 'caption' => $caption, |
@@ -1,24 +1,24 @@ 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 | -$logo= '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">'; |
|
| 5 | +$logo = '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">'; |
|
| 6 | 6 | $downloadLinks = array( |
| 7 | - 0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'), |
|
| 8 | - 1=>array('title'=>$_lang["download"],'link'=>'https://github.com/evolution-cms/evolution/releases'), |
|
| 9 | - 2=>array('title'=>$_lang["previous_releases"],'link'=>'https://modx.com/download/evolution/previous-releases.html'), |
|
| 10 | - 3=>array('title'=>$_lang["extras"],'link'=>array( |
|
| 7 | + 0=>array('title'=>$_lang["information"], 'link'=>'https://evo.im/'), |
|
| 8 | + 1=>array('title'=>$_lang["download"], 'link'=>'https://github.com/evolution-cms/evolution/releases'), |
|
| 9 | + 2=>array('title'=>$_lang["previous_releases"], 'link'=>'https://modx.com/download/evolution/previous-releases.html'), |
|
| 10 | + 3=>array('title'=>$_lang["extras"], 'link'=>array( |
|
| 11 | 11 | 'http://extras.evolution-cms.com/', |
| 12 | 12 | 'https://github.com/extras-evolution' |
| 13 | 13 | )), |
| 14 | 14 | ); |
| 15 | 15 | |
| 16 | 16 | $translationLinks = array( |
| 17 | - 0=>array('title'=>'Evolution CMS','link'=>'https://www.transifex.com/evolutioncms/evolution/'), |
|
| 18 | - 1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
|
| 17 | + 0=>array('title'=>'Evolution CMS', 'link'=>'https://www.transifex.com/evolutioncms/evolution/'), |
|
| 18 | + 1=>array('title'=>$_lang["extras"], 'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
|
| 19 | 19 | ); |
| 20 | 20 | |
| 21 | -if(!function_exists('createList')) { |
|
| 21 | +if (!function_exists('createList')) { |
|
| 22 | 22 | /** |
| 23 | 23 | * @param string $sectionHeader |
| 24 | 24 | * @param array $linkArr |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | function createList($sectionHeader, $linkArr) |
| 28 | 28 | { |
| 29 | - $output = '<div class="sectionHeader">' . $sectionHeader . '</div><div class="sectionBody">' . "\n"; |
|
| 30 | - $output .= '<table width="500" border="0" cellspacing="0" cellpadding="0">' . "\n"; |
|
| 29 | + $output = '<div class="sectionHeader">'.$sectionHeader.'</div><div class="sectionBody">'."\n"; |
|
| 30 | + $output .= '<table width="500" border="0" cellspacing="0" cellpadding="0">'."\n"; |
|
| 31 | 31 | $links = ''; |
| 32 | 32 | foreach ($linkArr as $row) { |
| 33 | 33 | if (!is_array($row['link'])) { |
@@ -35,16 +35,16 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | foreach ($row['link'] as $link) { |
| 37 | 37 | $links .= $links != '' ? '<br/>' : ''; |
| 38 | - $links .= '<a href="' . $link . '" target="_blank">' . $link . '</a>'; |
|
| 38 | + $links .= '<a href="'.$link.'" target="_blank">'.$link.'</a>'; |
|
| 39 | 39 | } |
| 40 | 40 | $output .= ' |
| 41 | 41 | <tr> |
| 42 | - <td align="left"><strong>' . $row["title"] . '</strong></td> |
|
| 43 | - <td align="left">' . $links . '</td> |
|
| 42 | + <td align="left"><strong>' . $row["title"].'</strong></td> |
|
| 43 | + <td align="left">' . $links.'</td> |
|
| 44 | 44 | </tr>'; |
| 45 | 45 | $links = ''; |
| 46 | 46 | } |
| 47 | - $output .= '</table></div>' . "\n"; |
|
| 47 | + $output .= '</table></div>'."\n"; |
|
| 48 | 48 | |
| 49 | 49 | return $output; |
| 50 | 50 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('bk_manager')) { |
@@ -9,10 +9,10 @@ discard block |
||
| 9 | 9 | $dbase = trim($dbase, '`'); |
| 10 | 10 | |
| 11 | 11 | if (!isset($modx->config['snapshot_path'])) { |
| 12 | - if (is_dir(MODX_BASE_PATH . 'temp/backup/')) { |
|
| 13 | - $modx->config['snapshot_path'] = MODX_BASE_PATH . 'temp/backup/'; |
|
| 12 | + if (is_dir(MODX_BASE_PATH.'temp/backup/')) { |
|
| 13 | + $modx->config['snapshot_path'] = MODX_BASE_PATH.'temp/backup/'; |
|
| 14 | 14 | } else { |
| 15 | - $modx->config['snapshot_path'] = MODX_BASE_PATH . 'assets/backup/'; |
|
| 15 | + $modx->config['snapshot_path'] = MODX_BASE_PATH.'assets/backup/'; |
|
| 16 | 16 | } |
| 17 | 17 | } |
| 18 | 18 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | if ($mode == 'restore1') { |
| 24 | 24 | if (isset($_POST['textarea']) && !empty($_POST['textarea'])) { |
| 25 | 25 | $source = trim($_POST['textarea']); |
| 26 | - $_SESSION['textarea'] = $source . "\n"; |
|
| 26 | + $_SESSION['textarea'] = $source."\n"; |
|
| 27 | 27 | } else { |
| 28 | 28 | $source = file_get_contents($_FILES['sqlfile']['tmp_name']); |
| 29 | 29 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | header('Location: index.php?r=9&a=93'); |
| 32 | 32 | exit; |
| 33 | 33 | } elseif ($mode == 'restore2') { |
| 34 | - $path = $modx->config['snapshot_path'] . $_POST['filename']; |
|
| 34 | + $path = $modx->config['snapshot_path'].$_POST['filename']; |
|
| 35 | 35 | if (file_exists($path)) { |
| 36 | 36 | $source = file_get_contents($path); |
| 37 | 37 | import_sql($source); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | if (!is_writable(rtrim($modx->config['snapshot_path'], '/'))) { |
| 78 | 78 | $modx->webAlertAndQuit(parsePlaceholder($_lang["bkmgr_alert_mkdir"], array('snapshot_path' => $modx->config['snapshot_path']))); |
| 79 | 79 | } |
| 80 | - $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%'"; |
|
| 80 | + $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->db->escape($modx->db->config['table_prefix'])."%'"; |
|
| 81 | 81 | $rs = $modx->db->query($sql); |
| 82 | 82 | $tables = $modx->db->getColumn('Name', $rs); |
| 83 | 83 | $today = date('Y-m-d_H-i-s'); |
@@ -109,18 +109,18 @@ discard block |
||
| 109 | 109 | $modx->webAlertAndQuit('Unable to Backup Database'); |
| 110 | 110 | } |
| 111 | 111 | } else { |
| 112 | - include_once MODX_MANAGER_PATH . "includes/header.inc.php"; // start normal header |
|
| 112 | + include_once MODX_MANAGER_PATH."includes/header.inc.php"; // start normal header |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | if (isset($_SESSION['result_msg']) && $_SESSION['result_msg'] != '') { |
| 116 | 116 | switch ($_SESSION['result_msg']) { |
| 117 | 117 | case 'import_ok': |
| 118 | - $ph['result_msg_import'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>'; |
|
| 119 | - $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>'; |
|
| 118 | + $ph['result_msg_import'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>'; |
|
| 119 | + $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>'; |
|
| 120 | 120 | break; |
| 121 | 121 | case 'snapshot_ok': |
| 122 | 122 | $ph['result_msg_import'] = ''; |
| 123 | - $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_snapshot_ok"] . '</div>'; |
|
| 123 | + $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_snapshot_ok"].'</div>'; |
|
| 124 | 124 | break; |
| 125 | 125 | } |
| 126 | 126 | $_SESSION['result_msg'] = ''; |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | f.style.display = 'none'; |
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | - <?= (isset($_REQUEST['r']) ? " doRefresh(" . $_REQUEST['r'] . ");" : "") ?> |
|
| 182 | + <?= (isset($_REQUEST['r']) ? " doRefresh(".$_REQUEST['r'].");" : "") ?> |
|
| 183 | 183 | |
| 184 | 184 | </script> |
| 185 | 185 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | </thead> |
| 224 | 224 | <tbody> |
| 225 | 225 | <?php |
| 226 | - $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%'"; |
|
| 226 | + $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->db->escape($modx->db->config['table_prefix'])."%'"; |
|
| 227 | 227 | $rs = $modx->db->query($sql); |
| 228 | 228 | $i = 0; |
| 229 | 229 | while ($db_status = $modx->db->getRow($rs)) { |
@@ -233,29 +233,29 @@ discard block |
||
| 233 | 233 | $table_string = ''; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - echo '<tr>' . "\n" . '<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="' . $db_status['Name'] . '"' . (strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"') . ' /><b class="text-primary">' . $db_status['Name'] . '</b></label></td>' . "\n"; |
|
| 237 | - echo '<td class="text-xs-center">' . (!empty($db_status['Comment']) ? '<i class="' . $_style['actions_help'] . '" data-tooltip="' . $db_status['Comment'] . '"></i>' : '') . '</td>' . "\n"; |
|
| 238 | - echo '<td class="text-xs-right">' . $db_status['Rows'] . '</td>' . "\n"; |
|
| 239 | - echo '<td class="text-xs-right">' . $db_status['Collation'] . '</td>' . "\n"; |
|
| 236 | + echo '<tr>'."\n".'<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="'.$db_status['Name'].'"'.(strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"').' /><b class="text-primary">'.$db_status['Name'].'</b></label></td>'."\n"; |
|
| 237 | + echo '<td class="text-xs-center">'.(!empty($db_status['Comment']) ? '<i class="'.$_style['actions_help'].'" data-tooltip="'.$db_status['Comment'].'"></i>' : '').'</td>'."\n"; |
|
| 238 | + echo '<td class="text-xs-right">'.$db_status['Rows'].'</td>'."\n"; |
|
| 239 | + echo '<td class="text-xs-right">'.$db_status['Collation'].'</td>'."\n"; |
|
| 240 | 240 | |
| 241 | 241 | // Enable record deletion for certain tables (TRUNCATE TABLE) if they're not already empty |
| 242 | 242 | $truncateable = array( |
| 243 | - $modx->db->config['table_prefix'] . 'event_log', |
|
| 244 | - $modx->db->config['table_prefix'] . 'manager_log', |
|
| 243 | + $modx->db->config['table_prefix'].'event_log', |
|
| 244 | + $modx->db->config['table_prefix'].'manager_log', |
|
| 245 | 245 | ); |
| 246 | 246 | if ($modx->hasPermission('settings') && in_array($db_status['Name'], $truncateable) && $db_status['Rows'] > 0) { |
| 247 | - echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode=' . $action . '&u=' . $db_status['Name'] . '" title="' . $_lang['truncate_table'] . '">' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</a>' . '</td>' . "\n"; |
|
| 247 | + echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode='.$action.'&u='.$db_status['Name'].'" title="'.$_lang['truncate_table'].'">'.$modx->nicesize($db_status['Data_length'] + $db_status['Data_free']).'</a>'.'</td>'."\n"; |
|
| 248 | 248 | } else { |
| 249 | - echo '<td class="text-xs-right">' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n"; |
|
| 249 | + echo '<td class="text-xs-right">'.$modx->nicesize($db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n"; |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | if ($modx->hasPermission('settings')) { |
| 253 | - echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode=' . $action . '&t=' . $db_status['Name'] . '" title="' . $_lang['optimize_table'] . '">' . $modx->nicesize($db_status['Data_free']) . '</a>' : '-') . '</td>' . "\n"; |
|
| 253 | + echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode='.$action.'&t='.$db_status['Name'].'" title="'.$_lang['optimize_table'].'">'.$modx->nicesize($db_status['Data_free']).'</a>' : '-').'</td>'."\n"; |
|
| 254 | 254 | } else { |
| 255 | - echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-') . '</td>' . "\n"; |
|
| 255 | + echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-').'</td>'."\n"; |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | - echo '<td class="text-xs-right">' . $modx->nicesize($db_status['Data_length'] - $db_status['Data_free']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n" . "</tr>"; |
|
| 258 | + echo '<td class="text-xs-right">'.$modx->nicesize($db_status['Data_length'] - $db_status['Data_free']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n"."</tr>"; |
|
| 259 | 259 | |
| 260 | 260 | $total = $total + $db_status['Index_length'] + $db_status['Data_length']; |
| 261 | 261 | $totaloverhead = $totaloverhead + $db_status['Data_free']; |
@@ -266,9 +266,9 @@ discard block |
||
| 266 | 266 | <tr> |
| 267 | 267 | <td class="text-xs-right"><?= $_lang['database_table_totals'] ?></td> |
| 268 | 268 | <td colspan="4"> </td> |
| 269 | - <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">' . $modx->nicesize($totaloverhead) . '</b><br />(' . number_format($totaloverhead) . ' B)' : '-' ?></td> |
|
| 269 | + <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">'.$modx->nicesize($totaloverhead).'</b><br />('.number_format($totaloverhead).' B)' : '-' ?></td> |
|
| 270 | 270 | <td colspan="2"> </td> |
| 271 | - <td class="text-xs-right"><?= "<b>" . $modx->nicesize($total) . "</b><br />(" . number_format($total) . " B)" ?></td> |
|
| 271 | + <td class="text-xs-right"><?= "<b>".$modx->nicesize($total)."</b><br />(".number_format($total)." B)" ?></td> |
|
| 272 | 272 | </tr> |
| 273 | 273 | </tfoot> |
| 274 | 274 | </table> |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | foreach ($last_result['0'] as $k => $v) { |
| 320 | 320 | $title[] = $k; |
| 321 | 321 | } |
| 322 | - $result = '<thead><tr><th>' . implode('</th><th>', $title) . '</th></tr></thead>'; |
|
| 322 | + $result = '<thead><tr><th>'.implode('</th><th>', $title).'</th></tr></thead>'; |
|
| 323 | 323 | $result .= '<tbody>'; |
| 324 | 324 | foreach ($last_result as $row) { |
| 325 | 325 | $result_value = array(); |
@@ -327,11 +327,11 @@ discard block |
||
| 327 | 327 | foreach ($row as $k => $v) { |
| 328 | 328 | $result_value[] = $v; |
| 329 | 329 | } |
| 330 | - $result .= '<tr><td>' . implode('</td><td>', $result_value) . '</td></tr>'; |
|
| 330 | + $result .= '<tr><td>'.implode('</td><td>', $result_value).'</td></tr>'; |
|
| 331 | 331 | } |
| 332 | 332 | } |
| 333 | 333 | $result .= '</tbody>'; |
| 334 | - $result = '<table class="table data">' . $result . '</table>'; |
|
| 334 | + $result = '<table class="table data">'.$result.'</table>'; |
|
| 335 | 335 | } |
| 336 | 336 | } |
| 337 | 337 | |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | while ($count < 11) { |
| 434 | 434 | $line = fgets($file); |
| 435 | 435 | foreach ($detailFields as $label) { |
| 436 | - $fileLabel = '# ' . $label; |
|
| 436 | + $fileLabel = '# '.$label; |
|
| 437 | 437 | if (strpos($line, $fileLabel) !== false) { |
| 438 | 438 | $details[$label] = htmlentities(trim(str_replace(array( |
| 439 | 439 | $fileLabel, |
@@ -446,10 +446,10 @@ discard block |
||
| 446 | 446 | }; |
| 447 | 447 | fclose($file); |
| 448 | 448 | |
| 449 | - $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; |
|
| 450 | - $tooltip .= "Server version: " . $details["Server version"] . "\n"; |
|
| 451 | - $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; |
|
| 452 | - $tooltip .= "Host: " . $details["Host"] . "\n"; |
|
| 449 | + $tooltip = "Generation Time: ".$details["Generation Time"]."\n"; |
|
| 450 | + $tooltip .= "Server version: ".$details["Server version"]."\n"; |
|
| 451 | + $tooltip .= "PHP Version: ".$details["PHP Version"]."\n"; |
|
| 452 | + $tooltip .= "Host: ".$details["Host"]."\n"; |
|
| 453 | 453 | ?> |
| 454 | 454 | <tr> |
| 455 | 455 | <td><?= $filename ?></td> |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | <?php |
| 482 | 482 | |
| 483 | 483 | if (is_numeric($_GET['tab'])) { |
| 484 | - echo '<script type="text/javascript">tpDBM.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
| 484 | + echo '<script type="text/javascript">tpDBM.setSelectedIndex( '.$_GET['tab'].' );</script>'; |
|
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | include_once "footer.inc.php"; // send footer |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | */ |
| 494 | 494 | class Mysqldumper extends EvolutionCMS\Support\MysqlDumper{} |
| 495 | 495 | |
| 496 | -if(!function_exists('import_sql')) { |
|
| 496 | +if (!function_exists('import_sql')) { |
|
| 497 | 497 | /** |
| 498 | 498 | * @param string $source |
| 499 | 499 | * @param string $result_code |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | } |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | -if(!function_exists('dumpSql')) { |
|
| 537 | +if (!function_exists('dumpSql')) { |
|
| 538 | 538 | /** |
| 539 | 539 | * @param string $dumpstring |
| 540 | 540 | * @return bool |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | } |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | -if(!function_exists('snapshot')) { |
|
| 563 | +if (!function_exists('snapshot')) { |
|
| 564 | 564 | /** |
| 565 | 565 | * @param string $dumpstring |
| 566 | 566 | * @return bool |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | } |
| 575 | 575 | } |
| 576 | 576 | |
| 577 | -if(!function_exists('getSettings')) { |
|
| 577 | +if (!function_exists('getSettings')) { |
|
| 578 | 578 | /** |
| 579 | 579 | * @return array |
| 580 | 580 | */ |
@@ -601,7 +601,7 @@ discard block |
||
| 601 | 601 | } |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | -if(!function_exists('restoreSettings')) { |
|
| 604 | +if (!function_exists('restoreSettings')) { |
|
| 605 | 605 | /** |
| 606 | 606 | * @param array $settings |
| 607 | 607 | */ |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | } |
| 617 | 617 | } |
| 618 | 618 | |
| 619 | -if(!function_exists('parsePlaceholder')) { |
|
| 619 | +if (!function_exists('parsePlaceholder')) { |
|
| 620 | 620 | /** |
| 621 | 621 | * @param string $tpl |
| 622 | 622 | * @param array $ph |