|
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | | -if (!EvolutionCMS()->hasPermission('file_manager')) { |
6 | | - EvolutionCMS()->webAlertAndQuit($_lang["error_no_privileges"]); |
| 5 | +if (!evo()->hasPermission('file_manager')) { |
| 6 | + evo()->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | $token_check = checkToken(); |
9 | 9 | $newToken = makeToken(); |
10 | 10 |
|
11 | 11 | // settings |
12 | | -$theme_image_path = MODX_MANAGER_URL . 'media/style/' . EvolutionCMS()->getConfig('manager_theme') . '/images/'; |
| 12 | +$theme_image_path = MODX_MANAGER_URL . 'media/style/' . evo()->getConfig('manager_theme') . '/images/'; |
13 | 13 | $excludes = array( |
14 | 14 | '.', |
15 | 15 | '..', |
|
35 | 35 | $protected_path[] = MODX_BASE_PATH . 'temp/backup'; |
36 | 36 | $protected_path[] = MODX_BASE_PATH . 'assets/backup'; |
37 | 37 |
|
38 | | -if (!EvolutionCMS()->hasPermission('save_plugin')) { |
| 38 | +if (!evo()->hasPermission('save_plugin')) { |
39 | 39 | $protected_path[] = MODX_BASE_PATH . 'assets/plugins'; |
40 | 40 | } |
41 | | -if (!EvolutionCMS()->hasPermission('save_snippet')) { |
| 41 | +if (!evo()->hasPermission('save_snippet')) { |
42 | 42 | $protected_path[] = MODX_BASE_PATH . 'assets/snippets'; |
43 | 43 | } |
44 | | -if (!EvolutionCMS()->hasPermission('save_template')) { |
| 44 | +if (!evo()->hasPermission('save_template')) { |
45 | 45 | $protected_path[] = MODX_BASE_PATH . 'assets/templates'; |
46 | 46 | } |
47 | | -if (!EvolutionCMS()->hasPermission('save_module')) { |
| 47 | +if (!evo()->hasPermission('save_module')) { |
48 | 48 | $protected_path[] = MODX_BASE_PATH . 'assets/modules'; |
49 | 49 | } |
50 | | -if (!EvolutionCMS()->hasPermission('empty_cache')) { |
| 50 | +if (!evo()->hasPermission('empty_cache')) { |
51 | 51 | $protected_path[] = MODX_BASE_PATH . 'assets/cache'; |
52 | 52 | } |
53 | | -if (!EvolutionCMS()->hasPermission('import_static')) { |
| 53 | +if (!evo()->hasPermission('import_static')) { |
54 | 54 | $protected_path[] = MODX_BASE_PATH . 'temp/import'; |
55 | 55 | $protected_path[] = MODX_BASE_PATH . 'assets/import'; |
56 | 56 | } |
57 | | -if (!EvolutionCMS()->hasPermission('export_static')) { |
| 57 | +if (!evo()->hasPermission('export_static')) { |
58 | 58 | $protected_path[] = MODX_BASE_PATH . 'temp/export'; |
59 | 59 | $protected_path[] = MODX_BASE_PATH . 'assets/export'; |
60 | 60 | } |
|
65 | 65 | // Mod added by Raymond |
66 | 66 | $enablefileunzip = true; |
67 | 67 | $enablefiledownload = true; |
68 | | -$newfolderaccessmode = octdec(evolutionCMS()->getConfig('new_folder_permissions', '0777')); |
69 | | -$new_file_permissions = octdec(evolutionCMS()->getConfig('new_file_permissions', '0666')); |
| 68 | +$newfolderaccessmode = octdec(evo()->getConfig('new_folder_permissions', '0777')); |
| 69 | +$new_file_permissions = octdec(evo()->getConfig('new_file_permissions', '0666')); |
70 | 70 | // End Mod - by Raymond |
71 | 71 | // make arrays from the file upload settings |
72 | | -$upload_files = explode(',', evolutionCMS()->getConfig('upload_files', '')); |
73 | | -$upload_images = explode(',', evolutionCMS()->getConfig('upload_images', '')); |
74 | | -$upload_media = explode(',', evolutionCMS()->getConfig('upload_media', '')); |
| 72 | +$upload_files = explode(',', evo()->getConfig('upload_files', '')); |
| 73 | +$upload_images = explode(',', evo()->getConfig('upload_images', '')); |
| 74 | +$upload_media = explode(',', evo()->getConfig('upload_media', '')); |
75 | 75 | // now merge them |
76 | 76 | $uploadablefiles = array_merge($upload_files, $upload_images, $upload_media); |
77 | 77 | $uploadablefiles = add_dot($uploadablefiles); |
78 | | -$filemanager_path = evolutionCMS()->getConfig('filemanager_path', MODX_BASE_PATH); |
| 78 | +$upload_maxsize = evo()->getConfig('upload_maxsize'); |
| 79 | +$filemanager_path = evo()->getConfig('filemanager_path', MODX_BASE_PATH); |
79 | 80 |
|
80 | 81 | // end settings |
81 | 82 |
|
|
89 | 90 | $startpath = rtrim($startpath, '/'); |
90 | 91 |
|
91 | 92 | if (!is_readable($startpath)) { |
92 | | - EvolutionCMS()->webAlertAndQuit($_lang["not_readable_dir"]); |
| 93 | + evo()->webAlertAndQuit($_lang["not_readable_dir"]); |
93 | 94 | } |
94 | 95 |
|
95 | 96 | // Raymond: get web start path for showing pictures |
@@ -240,7 +241,7 @@ function renameFile(file) { |
240 | 241 | } |
241 | 242 |
|
242 | 243 | if (in_array($startpath, $protected_path)) { |
243 | | - EvolutionCMS()->webAlertAndQuit($_lang["files.dynamic.php2"]); |
| 244 | + evo()->webAlertAndQuit($_lang["files.dynamic.php2"]); |
244 | 245 | } |
245 | 246 |
|
246 | 247 | $tpl = '<i class="[+image+] FilesTopFolder"></i>[+subject+]'; |
@@ -285,7 +286,7 @@ function renameFile(file) { |
285 | 286 | </div> |
286 | 287 | <?php // check to see user isn't trying to move below the document_root |
287 | 288 | if (substr(strtolower(str_replace('//', '/', $startpath . "/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path . '/'))) { |
288 | | - EvolutionCMS()->webAlertAndQuit($_lang["files_access_denied"]); |
| 289 | + evo()->webAlertAndQuit($_lang["files_access_denied"]); |
289 | 290 | } |
290 | 291 |
|
291 | 292 | // Unzip .zip files - by Raymond |
@@ -445,7 +446,7 @@ function renameFile(file) { |
445 | 446 | ?> |
446 | 447 |
|
447 | 448 | <form name="upload" enctype="multipart/form-data" action="index.php" method="post"> |
448 | | - <input type="hidden" name="MAX_FILE_SIZE" value="<?= isset($upload_maxsize) ? $upload_maxsize : 3145728 ?>"> |
| 449 | + <input type="hidden" name="MAX_FILE_SIZE" value="<?= $upload_maxsize ?? 5000000 ?>"> |
449 | 450 | <input type="hidden" name="a" value="31"> |
450 | 451 | <input type="hidden" name="path" value="<?= $startpath ?>"> |
451 | 452 |
|
@@ -480,7 +481,7 @@ function renameFile(file) { |
480 | 481 | // Log the change |
481 | 482 | logFileChange('view', $filename); |
482 | 483 | if ($buffer === false) { |
483 | | - EvolutionCMS()->webAlertAndQuit("Error opening file for reading."); |
| 484 | + evo()->webAlertAndQuit("Error opening file for reading."); |
484 | 485 | } |
485 | 486 | ?> |
486 | 487 | <form action="index.php" method="post" name="editFile"> |
@@ -514,7 +515,7 @@ function renameFile(file) { |
514 | 515 | default: |
515 | 516 | $contentType = 'htmlmixed'; |
516 | 517 | }; |
517 | | - $evtOut = EvolutionCMS()->invokeEvent('OnRichTextEditorInit', array( |
| 518 | + $evtOut = evo()->invokeEvent('OnRichTextEditorInit', array( |
518 | 519 | 'editor' => 'Codemirror', |
519 | 520 | 'elements' => array( |
520 | 521 | 'content', |
|
0 commit comments