@@ -177,9 +177,9 @@ |
||
| 177 | 177 | <td colspan="2"><div class="split"></div></td> |
| 178 | 178 | </tr> |
| 179 | 179 | <?php |
| 180 | - // Check for GD before allowing captcha to be enabled |
|
| 181 | - $gdAvailable = extension_loaded('gd');
|
|
| 182 | - ?> |
|
| 180 | + // Check for GD before allowing captcha to be enabled |
|
| 181 | + $gdAvailable = extension_loaded('gd');
|
|
| 182 | + ?> |
|
| 183 | 183 | <?php |
| 184 | 184 | $gdAvailable = extension_loaded('gd');
|
| 185 | 185 | if(!$gdAvailable) $use_captcha = 0; |
@@ -7,10 +7,10 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | // invoke OnBeforeManagerLogout event |
| 9 | 9 | $modx->invokeEvent("OnBeforeManagerLogout", |
| 10 | - array( |
|
| 11 | - "userid" => $internalKey, |
|
| 12 | - "username" => $username |
|
| 13 | - )); |
|
| 10 | + array( |
|
| 11 | + "userid" => $internalKey, |
|
| 12 | + "username" => $username |
|
| 13 | + )); |
|
| 14 | 14 | |
| 15 | 15 | //// Unset all of the session variables. |
| 16 | 16 | //$_SESSION = array(); |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | // invoke OnManagerLogout event |
| 35 | 35 | $modx->invokeEvent("OnManagerLogout", |
| 36 | - array( |
|
| 37 | - "userid" => $internalKey, |
|
| 38 | - "username" => $username |
|
| 39 | - )); |
|
| 36 | + array( |
|
| 37 | + "userid" => $internalKey, |
|
| 38 | + "username" => $username |
|
| 39 | + )); |
|
| 40 | 40 | |
| 41 | 41 | // show login screen |
| 42 | 42 | header('Location: ' . MODX_MANAGER_URL); |
@@ -66,111 +66,111 @@ |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | switch ($_POST['mode']) { |
| 69 | - case '23': // Save new snippet |
|
| 70 | - |
|
| 71 | - // invoke OnBeforeSnipFormSave event |
|
| 72 | - $modx->invokeEvent("OnBeforeSnipFormSave", array( |
|
| 73 | - "mode" => "new", |
|
| 74 | - "id" => $id |
|
| 75 | - )); |
|
| 76 | - |
|
| 77 | - // disallow duplicate names for new snippets |
|
| 78 | - $rs = $modx->db->select('COUNT(id)', $modx->getFullTableName('site_snippets'), "name='{$name}'"); |
|
| 79 | - $count = $modx->db->getValue($rs); |
|
| 80 | - if ($count > 0) { |
|
| 81 | - $modx->manager->saveFormValues(23); |
|
| 82 | - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['snippet'], $name), "index.php?a=23"); |
|
| 83 | - } |
|
| 84 | - |
|
| 85 | - //do stuff to save the new doc |
|
| 86 | - $newid = $modx->db->insert(array( |
|
| 87 | - 'name' => $name, |
|
| 88 | - 'description' => $description, |
|
| 89 | - 'snippet' => $snippet, |
|
| 90 | - 'moduleguid' => $moduleguid, |
|
| 91 | - 'locked' => $locked, |
|
| 92 | - 'properties' => $properties, |
|
| 93 | - 'category' => $categoryid, |
|
| 94 | - 'disabled' => $disabled, |
|
| 95 | - 'createdon' => $currentdate, |
|
| 96 | - 'editedon' => $currentdate |
|
| 97 | - ), $modx->getFullTableName('site_snippets')); |
|
| 98 | - |
|
| 99 | - // invoke OnSnipFormSave event |
|
| 100 | - $modx->invokeEvent("OnSnipFormSave", array( |
|
| 101 | - "mode" => "new", |
|
| 102 | - "id" => $newid |
|
| 103 | - )); |
|
| 104 | - |
|
| 105 | - // Set the item name for logger |
|
| 106 | - $_SESSION['itemname'] = $name; |
|
| 107 | - |
|
| 108 | - // empty cache |
|
| 109 | - $modx->clearCache('full'); |
|
| 110 | - |
|
| 111 | - // finished emptying cache - redirect |
|
| 112 | - if ($_POST['stay'] != '') { |
|
| 113 | - $a = ($_POST['stay'] == '2') ? "22&id=$newid" : "23"; |
|
| 114 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
| 115 | - header($header); |
|
| 116 | - } else { |
|
| 117 | - $header = "Location: index.php?a=76&r=2"; |
|
| 118 | - header($header); |
|
| 119 | - } |
|
| 120 | - break; |
|
| 121 | - case '22': // Save existing snippet |
|
| 122 | - // invoke OnBeforeSnipFormSave event |
|
| 123 | - $modx->invokeEvent("OnBeforeSnipFormSave", array( |
|
| 124 | - "mode" => "upd", |
|
| 125 | - "id" => $id |
|
| 126 | - )); |
|
| 127 | - |
|
| 128 | - // disallow duplicate names for snippets |
|
| 129 | - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_snippets'), "name='{$name}' AND id!='{$id}'"); |
|
| 130 | - if ($modx->db->getValue($rs) > 0) { |
|
| 131 | - $modx->manager->saveFormValues(22); |
|
| 132 | - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['snippet'], $name), "index.php?a=22&id={$id}"); |
|
| 133 | - } |
|
| 134 | - |
|
| 135 | - //do stuff to save the edited doc |
|
| 136 | - $modx->db->update(array( |
|
| 137 | - 'name' => $name, |
|
| 138 | - 'description' => $description, |
|
| 139 | - 'snippet' => $snippet, |
|
| 140 | - 'moduleguid' => $moduleguid, |
|
| 141 | - 'locked' => $locked, |
|
| 142 | - 'properties' => $properties, |
|
| 143 | - 'category' => $categoryid, |
|
| 144 | - 'disabled' => $disabled, |
|
| 145 | - 'editedon' => $currentdate |
|
| 146 | - ), $modx->getFullTableName('site_snippets'), "id='{$id}'"); |
|
| 147 | - |
|
| 148 | - // invoke OnSnipFormSave event |
|
| 149 | - $modx->invokeEvent("OnSnipFormSave", array( |
|
| 150 | - "mode" => "upd", |
|
| 151 | - "id" => $id |
|
| 152 | - )); |
|
| 153 | - |
|
| 154 | - // Set the item name for logger |
|
| 155 | - $_SESSION['itemname'] = $name; |
|
| 156 | - |
|
| 157 | - // empty cache |
|
| 158 | - $modx->clearCache('full'); |
|
| 159 | - |
|
| 160 | - if ($_POST['runsnippet']) { |
|
| 161 | - run_snippet($snippet); |
|
| 162 | - } |
|
| 163 | - // finished emptying cache - redirect |
|
| 164 | - if ($_POST['stay'] != '') { |
|
| 165 | - $a = ($_POST['stay'] == '2') ? "22&id=$id" : "23"; |
|
| 166 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
| 167 | - header($header); |
|
| 168 | - } else { |
|
| 169 | - $modx->unlockElement(4, $id); |
|
| 170 | - $header = "Location: index.php?a=76&r=2"; |
|
| 171 | - header($header); |
|
| 172 | - } |
|
| 173 | - break; |
|
| 174 | - default: |
|
| 175 | - $modx->webAlertAndQuit("No operation set in request."); |
|
| 69 | + case '23': // Save new snippet |
|
| 70 | + |
|
| 71 | + // invoke OnBeforeSnipFormSave event |
|
| 72 | + $modx->invokeEvent("OnBeforeSnipFormSave", array( |
|
| 73 | + "mode" => "new", |
|
| 74 | + "id" => $id |
|
| 75 | + )); |
|
| 76 | + |
|
| 77 | + // disallow duplicate names for new snippets |
|
| 78 | + $rs = $modx->db->select('COUNT(id)', $modx->getFullTableName('site_snippets'), "name='{$name}'"); |
|
| 79 | + $count = $modx->db->getValue($rs); |
|
| 80 | + if ($count > 0) { |
|
| 81 | + $modx->manager->saveFormValues(23); |
|
| 82 | + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['snippet'], $name), "index.php?a=23"); |
|
| 83 | + } |
|
| 84 | + |
|
| 85 | + //do stuff to save the new doc |
|
| 86 | + $newid = $modx->db->insert(array( |
|
| 87 | + 'name' => $name, |
|
| 88 | + 'description' => $description, |
|
| 89 | + 'snippet' => $snippet, |
|
| 90 | + 'moduleguid' => $moduleguid, |
|
| 91 | + 'locked' => $locked, |
|
| 92 | + 'properties' => $properties, |
|
| 93 | + 'category' => $categoryid, |
|
| 94 | + 'disabled' => $disabled, |
|
| 95 | + 'createdon' => $currentdate, |
|
| 96 | + 'editedon' => $currentdate |
|
| 97 | + ), $modx->getFullTableName('site_snippets')); |
|
| 98 | + |
|
| 99 | + // invoke OnSnipFormSave event |
|
| 100 | + $modx->invokeEvent("OnSnipFormSave", array( |
|
| 101 | + "mode" => "new", |
|
| 102 | + "id" => $newid |
|
| 103 | + )); |
|
| 104 | + |
|
| 105 | + // Set the item name for logger |
|
| 106 | + $_SESSION['itemname'] = $name; |
|
| 107 | + |
|
| 108 | + // empty cache |
|
| 109 | + $modx->clearCache('full'); |
|
| 110 | + |
|
| 111 | + // finished emptying cache - redirect |
|
| 112 | + if ($_POST['stay'] != '') { |
|
| 113 | + $a = ($_POST['stay'] == '2') ? "22&id=$newid" : "23"; |
|
| 114 | + $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
| 115 | + header($header); |
|
| 116 | + } else { |
|
| 117 | + $header = "Location: index.php?a=76&r=2"; |
|
| 118 | + header($header); |
|
| 119 | + } |
|
| 120 | + break; |
|
| 121 | + case '22': // Save existing snippet |
|
| 122 | + // invoke OnBeforeSnipFormSave event |
|
| 123 | + $modx->invokeEvent("OnBeforeSnipFormSave", array( |
|
| 124 | + "mode" => "upd", |
|
| 125 | + "id" => $id |
|
| 126 | + )); |
|
| 127 | + |
|
| 128 | + // disallow duplicate names for snippets |
|
| 129 | + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_snippets'), "name='{$name}' AND id!='{$id}'"); |
|
| 130 | + if ($modx->db->getValue($rs) > 0) { |
|
| 131 | + $modx->manager->saveFormValues(22); |
|
| 132 | + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['snippet'], $name), "index.php?a=22&id={$id}"); |
|
| 133 | + } |
|
| 134 | + |
|
| 135 | + //do stuff to save the edited doc |
|
| 136 | + $modx->db->update(array( |
|
| 137 | + 'name' => $name, |
|
| 138 | + 'description' => $description, |
|
| 139 | + 'snippet' => $snippet, |
|
| 140 | + 'moduleguid' => $moduleguid, |
|
| 141 | + 'locked' => $locked, |
|
| 142 | + 'properties' => $properties, |
|
| 143 | + 'category' => $categoryid, |
|
| 144 | + 'disabled' => $disabled, |
|
| 145 | + 'editedon' => $currentdate |
|
| 146 | + ), $modx->getFullTableName('site_snippets'), "id='{$id}'"); |
|
| 147 | + |
|
| 148 | + // invoke OnSnipFormSave event |
|
| 149 | + $modx->invokeEvent("OnSnipFormSave", array( |
|
| 150 | + "mode" => "upd", |
|
| 151 | + "id" => $id |
|
| 152 | + )); |
|
| 153 | + |
|
| 154 | + // Set the item name for logger |
|
| 155 | + $_SESSION['itemname'] = $name; |
|
| 156 | + |
|
| 157 | + // empty cache |
|
| 158 | + $modx->clearCache('full'); |
|
| 159 | + |
|
| 160 | + if ($_POST['runsnippet']) { |
|
| 161 | + run_snippet($snippet); |
|
| 162 | + } |
|
| 163 | + // finished emptying cache - redirect |
|
| 164 | + if ($_POST['stay'] != '') { |
|
| 165 | + $a = ($_POST['stay'] == '2') ? "22&id=$id" : "23"; |
|
| 166 | + $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
| 167 | + header($header); |
|
| 168 | + } else { |
|
| 169 | + $modx->unlockElement(4, $id); |
|
| 170 | + $header = "Location: index.php?a=76&r=2"; |
|
| 171 | + header($header); |
|
| 172 | + } |
|
| 173 | + break; |
|
| 174 | + default: |
|
| 175 | + $modx->webAlertAndQuit("No operation set in request."); |
|
| 176 | 176 | } |
@@ -236,9 +236,9 @@ |
||
| 236 | 236 | lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?> |
| 237 | 237 | }; |
| 238 | 238 | <?php |
| 239 | - $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray'])));
|
|
| 240 | - echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n modx.openedArray[", $opened) . '] = 1;') . "\n";
|
|
| 241 | - ?> |
|
| 239 | + $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray'])));
|
|
| 240 | + echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n modx.openedArray[", $opened) . '] = 1;') . "\n";
|
|
| 241 | + ?> |
|
| 242 | 242 | </script> |
| 243 | 243 | <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script> |
| 244 | 244 | <?php if ($modx->config['show_picker'] != "0") { ?>
|
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc Image detection class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc Image detection class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class type_img { |
| 16 | 16 | |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc MIME type detection class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc MIME type detection class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class type_mime { |
| 16 | 16 | |
@@ -1,24 +1,24 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc This file is included first, before each other |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - * |
|
| 14 | - * This file is the place you can put any code (at the end of the file), |
|
| 15 | - * which will be executed before any other. Suitable for: |
|
| 16 | - * 1. Set PHP ini settings using ini_set() |
|
| 17 | - * 2. Custom session save handler with session_set_save_handler() |
|
| 18 | - * 3. Any custom integration code. If you use any global variables |
|
| 19 | - * here, they can be accessed in config.php via $GLOBALS array. |
|
| 20 | - * It's recommended to use constants instead. |
|
| 21 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc This file is included first, before each other |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + * |
|
| 14 | + * This file is the place you can put any code (at the end of the file), |
|
| 15 | + * which will be executed before any other. Suitable for: |
|
| 16 | + * 1. Set PHP ini settings using ini_set() |
|
| 17 | + * 2. Custom session save handler with session_set_save_handler() |
|
| 18 | + * 3. Any custom integration code. If you use any global variables |
|
| 19 | + * here, they can be accessed in config.php via $GLOBALS array. |
|
| 20 | + * It's recommended to use constants instead. |
|
| 21 | + */ |
|
| 22 | 22 | include_once(dirname(__FILE__)."/../../../../../assets/cache/siteManager.php"); |
| 23 | 23 | require_once('../../../includes/protect.inc.php'); |
| 24 | 24 | include_once('../../../includes/config.inc.php'); |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc Browser actions class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc Browser actions class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class browser extends uploader { |
| 16 | 16 | protected $action; |
@@ -709,54 +709,54 @@ discard block |
||
| 709 | 709 | die; |
| 710 | 710 | } |
| 711 | 711 | |
| 712 | - protected function getFiles($dir) { |
|
| 713 | - $thumbDir = "{$this->config['uploadDir']}/{$this->config['thumbsDir']}/$dir"; |
|
| 714 | - $dir = "{$this->config['uploadDir']}/$dir"; |
|
| 715 | - $return = array(); |
|
| 716 | - $files = dir::content($dir, array('types' => "file")); |
|
| 717 | - if ($files === false) |
|
| 718 | - return $return; |
|
| 719 | - |
|
| 720 | - foreach ($files as $file) { |
|
| 721 | - $ext = file::getExtension($file); |
|
| 722 | - $smallThumb = false; |
|
| 723 | - if (in_array(strtolower($ext), array('png', 'jpg', 'gif', 'jpeg' )) ) { |
|
| 724 | - $size = @getimagesize($file); |
|
| 725 | - if (is_array($size) && count($size)) { |
|
| 726 | - $thumb_file = "$thumbDir/" . basename($file); |
|
| 727 | - if (!is_file($thumb_file) || filemtime($file) > filemtime($thumb_file)) |
|
| 728 | - $this->makeThumb($file); |
|
| 729 | - $smallThumb = |
|
| 730 | - ($size[0] <= $this->config['thumbWidth']) && |
|
| 731 | - ($size[1] <= $this->config['thumbHeight']) && |
|
| 732 | - in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_PNG, IMAGETYPE_JPEG)); |
|
| 733 | - } |
|
| 734 | - } |
|
| 735 | - $stat = stat($file); |
|
| 736 | - if ($stat === false) continue; |
|
| 737 | - $name = basename($file); |
|
| 738 | - $types = $this->config['types']; |
|
| 739 | - $types = explode(' ',$types['images'].' '.$types['image']); |
|
| 740 | - if (substr($name,0,1) == '.' && !$this->config['showHiddenFiles']) continue; |
|
| 741 | - if ($this->type == 'images' && !in_array(strtolower($ext),$types)) continue; |
|
| 742 | - $bigIcon = file_exists("themes/{$this->config['theme']}/img/files/big/$ext.png"); |
|
| 743 | - $smallIcon = file_exists("themes/{$this->config['theme']}/img/files/small/$ext.png"); |
|
| 744 | - $thumb = file_exists("$thumbDir/$name"); |
|
| 745 | - $return[] = array( |
|
| 746 | - 'name' => stripcslashes($name), |
|
| 747 | - 'size' => $stat['size'], |
|
| 748 | - 'mtime' => $stat['mtime'], |
|
| 749 | - 'date' => @strftime($this->dateTimeSmall, $stat['mtime']), |
|
| 750 | - 'readable' => is_readable($file), |
|
| 751 | - 'writable' => file::isWritable($file), |
|
| 752 | - 'bigIcon' => $bigIcon, |
|
| 753 | - 'smallIcon' => $smallIcon, |
|
| 754 | - 'thumb' => $thumb, |
|
| 755 | - 'smallThumb' => $smallThumb |
|
| 756 | - ); |
|
| 757 | - } |
|
| 758 | - return $return; |
|
| 759 | - } |
|
| 712 | + protected function getFiles($dir) { |
|
| 713 | + $thumbDir = "{$this->config['uploadDir']}/{$this->config['thumbsDir']}/$dir"; |
|
| 714 | + $dir = "{$this->config['uploadDir']}/$dir"; |
|
| 715 | + $return = array(); |
|
| 716 | + $files = dir::content($dir, array('types' => "file")); |
|
| 717 | + if ($files === false) |
|
| 718 | + return $return; |
|
| 719 | + |
|
| 720 | + foreach ($files as $file) { |
|
| 721 | + $ext = file::getExtension($file); |
|
| 722 | + $smallThumb = false; |
|
| 723 | + if (in_array(strtolower($ext), array('png', 'jpg', 'gif', 'jpeg' )) ) { |
|
| 724 | + $size = @getimagesize($file); |
|
| 725 | + if (is_array($size) && count($size)) { |
|
| 726 | + $thumb_file = "$thumbDir/" . basename($file); |
|
| 727 | + if (!is_file($thumb_file) || filemtime($file) > filemtime($thumb_file)) |
|
| 728 | + $this->makeThumb($file); |
|
| 729 | + $smallThumb = |
|
| 730 | + ($size[0] <= $this->config['thumbWidth']) && |
|
| 731 | + ($size[1] <= $this->config['thumbHeight']) && |
|
| 732 | + in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_PNG, IMAGETYPE_JPEG)); |
|
| 733 | + } |
|
| 734 | + } |
|
| 735 | + $stat = stat($file); |
|
| 736 | + if ($stat === false) continue; |
|
| 737 | + $name = basename($file); |
|
| 738 | + $types = $this->config['types']; |
|
| 739 | + $types = explode(' ',$types['images'].' '.$types['image']); |
|
| 740 | + if (substr($name,0,1) == '.' && !$this->config['showHiddenFiles']) continue; |
|
| 741 | + if ($this->type == 'images' && !in_array(strtolower($ext),$types)) continue; |
|
| 742 | + $bigIcon = file_exists("themes/{$this->config['theme']}/img/files/big/$ext.png"); |
|
| 743 | + $smallIcon = file_exists("themes/{$this->config['theme']}/img/files/small/$ext.png"); |
|
| 744 | + $thumb = file_exists("$thumbDir/$name"); |
|
| 745 | + $return[] = array( |
|
| 746 | + 'name' => stripcslashes($name), |
|
| 747 | + 'size' => $stat['size'], |
|
| 748 | + 'mtime' => $stat['mtime'], |
|
| 749 | + 'date' => @strftime($this->dateTimeSmall, $stat['mtime']), |
|
| 750 | + 'readable' => is_readable($file), |
|
| 751 | + 'writable' => file::isWritable($file), |
|
| 752 | + 'bigIcon' => $bigIcon, |
|
| 753 | + 'smallIcon' => $smallIcon, |
|
| 754 | + 'thumb' => $thumb, |
|
| 755 | + 'smallThumb' => $smallThumb |
|
| 756 | + ); |
|
| 757 | + } |
|
| 758 | + return $return; |
|
| 759 | + } |
|
| 760 | 760 | |
| 761 | 761 | protected function getTree($dir, $index=0) { |
| 762 | 762 | $path = explode("/", $dir); |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** Portugues Brasil localization file for KCFinder |
| 4 | - * author: Alexandre Benegas Ferreira |
|
| 5 | - * country: Brasil |
|
| 6 | - * company website: www.hostcataratas.com.br |
|
| 7 | - * e-mail: [email protected] |
|
| 8 | - */ |
|
| 4 | + * author: Alexandre Benegas Ferreira |
|
| 5 | + * country: Brasil |
|
| 6 | + * company website: www.hostcataratas.com.br |
|
| 7 | + * e-mail: [email protected] |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | $lang = array( |
| 11 | 11 | |