| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; |
|---|
| 13 | if(!isset($insertMode)) $insertMode="image"; |
|---|
| 14 | |
|---|
| 15 | require_once('config.inc.php'); |
|---|
| 16 | require_once('Classes/ExtendedFileManager.php'); |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | $relative = '/'; |
|---|
| 20 | $manager = new ExtendedFileManager($IMConfig, $insertMode); |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | $uploadStatus=$manager->processUploads(); |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | $renameStatus=$manager->processRenames(); |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | $pasteStatus = (isset($_GET['paste'])) ? $manager->processPaste() : false; |
|---|
| 30 | |
|---|
| 31 | $refreshFile = ($manager->deleteFiles()) ? true : false; |
|---|
| 32 | |
|---|
| 33 | $refreshDir = false; |
|---|
| 34 | |
|---|
| 35 | if($manager->deleteDirs() || $manager->processNewDir() || $pasteStatus || $renameStatus ) |
|---|
| 36 | $refreshDir = true; |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | $diskInfo=$manager->getDiskInfo(); |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | if(isset($_REQUEST['dir'])) |
|---|
| 45 | { |
|---|
| 46 | $path = rawurldecode($_REQUEST['dir']); |
|---|
| 47 | if($manager->validRelativePath($path)) |
|---|
| 48 | $relative = $path; |
|---|
| 49 | } |
|---|
| 50 | |
|---|
| 51 | $afruViewType = (isset($_REQUEST['viewtype'])) ? $afruViewType=$_REQUEST['viewtype'] : ''; |
|---|
| 52 | |
|---|
| 53 | if($afruViewType!="thumbview" && $afruViewType!="listview") |
|---|
| 54 | { |
|---|
| 55 | $afruViewType=$IMConfig['view_type']; |
|---|
| 56 | } |
|---|
| 57 | |
|---|
| 58 | $list = $manager->getFiles($relative); |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | function drawDirs_Files($list, &$manager) |
|---|
| 68 | { |
|---|
| 69 | global $relative, $afruViewType, $IMConfig, $insertMode; |
|---|
| 70 | |
|---|
| 71 | switch ($afruViewType) { |
|---|
| 72 | case 'listview': |
|---|
| 73 | $maxNameLength = 30; |
|---|
| 74 | ?> |
|---|
| 75 | <table class="listview"> |
|---|
| 76 | <thead> |
|---|
| 77 | <tr><th colspan="2">Name</th><th>Size</th><th>Image Size</th><th>Date Modified</th><th> </th></tr></thead> |
|---|
| 78 | <tbody> |
|---|
| 79 | <?php |
|---|
| 80 | |
|---|
| 81 | foreach($list[0] as $path => $dir) |
|---|
| 82 | { ?> |
|---|
| 83 | <tr> |
|---|
| 84 | <td><img src="<?php print $IMConfig['base_url'];?>icons/folder_small.gif" alt="" /></td> |
|---|
| 85 | <th nowrap="nowrap"><a href="<?php print $IMConfig['backend_url']; ?>__function=images&mode=<?php echo $insertMode;?>&dir=<?php echo rawurlencode($path); ?>&viewtype=<?php echo $afruViewType; ?>" onclick="updateDir('<?php echo $path; ?>')" title="<?php echo $dir['entry']; ?>"> |
|---|
| 86 | <?php |
|---|
| 87 | if(strlen($dir['entry'])>$maxNameLength) echo substr($dir['entry'],0,$maxNameLength)."..."; else echo $dir['entry']; |
|---|
| 88 | ?> |
|---|
| 89 | </a></th> |
|---|
| 90 | <td colspan="2" nowrap="nowrap">Folder</td> |
|---|
| 91 | |
|---|
| 92 | <td nowrap="nowrap"><?php echo date("d.m.y H:i",$dir['stat']['mtime']); ?></td> |
|---|
| 93 | |
|---|
| 94 | <td class="actions" nowrap="nowrap"> |
|---|
| 95 | <a href="<?php print $IMConfig['backend_url']; ?>__function=images&mode=<?php echo $insertMode;?>&dir=<?php echo $relative; ?>&deld=<?php echo rawurlencode($path); ?>&viewtype=<?php echo $afruViewType; ?>" title="Trash" onclick="return confirmDeleteDir('<?php echo $dir['entry']; ?>', <?php echo $dir['count']; ?>);" style="border:0px;"><img src="<?php print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash" border="0" /></a> |
|---|
| 96 | <?php if ($IMConfig['allow_rename']) { ?> |
|---|
| 97 | <a href="#" title="Rename" onclick="renameDir('<?php echo rawurlencode($dir['entry']);?>'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_rename.gif" height="15" width="15" alt="Rename" border="0" /></a> |
|---|
| 98 | <?php } ?> |
|---|
| 99 | <?php if ($IMConfig['allow_cut_copy_paste']) { ?> |
|---|
| 100 | <a href="#" title="Cut" onclick="copyDir('<?php echo rawurlencode($dir['entry']);?>','move'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_cut.gif" height="15" width="15" alt="Cut" /></a> |
|---|
| 101 | <a href="#" title="Copy" onclick="copyDir('<?php echo rawurlencode($dir['entry']);?>','copy'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_copy.gif" height="15" width="15" alt="Copy" /></a> |
|---|
| 102 | <?php } ?> |
|---|
| 103 | </td> |
|---|
| 104 | </tr> |
|---|
| 105 | <?php |
|---|
| 106 | } |
|---|
| 107 | |
|---|
| 108 | clearstatcache(); |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | foreach($list[1] as $entry => $file) |
|---|
| 112 | { |
|---|
| 113 | ?> |
|---|
| 114 | <tr> |
|---|
| 115 | <td><img src="<?php print $IMConfig['base_url']; if(is_file('icons/'.$file['ext'].'_small.gif')) echo "icons/".$file['ext']."_small.gif"; else echo $IMConfig['default_listicon']; ?>" alt="" /></td> |
|---|
| 116 | <th><a href="#" class="thumb" style="cursor: pointer;" ondblclick="this.onclick();window.top.onOK();" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo preg_replace('#\..{3,4}$#', '', $entry); ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);return false;" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>" <?php if ($insertMode == 'image') { ?> onmouseover="showPreview('<?php echo $file['relative'];?>')" onmouseout="showPreview(window.parent.document.getElementById('f_url').value)" <?php } ?> > |
|---|
| 117 | <?php |
|---|
| 118 | if(strlen($entry)>$maxNameLength) echo substr($entry,0,$maxNameLength)."..."; else echo $entry; |
|---|
| 119 | ?> |
|---|
| 120 | </a></th> |
|---|
| 121 | <td><?php echo Files::formatSize($file['stat']['size']); ?></td> |
|---|
| 122 | <td><?php if($file['image'][0] > 0){ echo $file['image'][0].'x'.$file['image'][1]; } ?></td> |
|---|
| 123 | <td nowrap="nowrap"><?php echo date("d.m.y H:i",$file['stat']['mtime']); ?></td> |
|---|
| 124 | <td class="actions"> |
|---|
| 125 | <?php if($IMConfig['img_library'] && $IMConfig['allow_edit_image'] && $file['image'][0] > 0) { ?> |
|---|
| 126 | <a href="javascript:;" title="Edit" onclick="editImage('<?php echo rawurlencode($file['relative']);?>');"><img src="<?php print $IMConfig['base_url'];?>img/edit_pencil.gif" height="15" width="15" alt="Edit" border="0" /></a> |
|---|
| 127 | <?php } ?> |
|---|
| 128 | <a href="<?php print $IMConfig['backend_url']; ?>__function=images&dir=<?php echo $relative; ?>&delf=<?php echo rawurlencode($file['relative']);?>&mode=<?php echo $insertMode;?>&viewtype=<?php echo $afruViewType; ?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="<?php print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash" border="0" /></a> |
|---|
| 129 | <?php if ($IMConfig['allow_rename']) { ?> |
|---|
| 130 | <a href="#" title="Rename" onclick="renameFile('<?php echo rawurlencode($file['relative']);?>'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_rename.gif" height="15" width="15" alt="Rename" border="0" /></a> |
|---|
| 131 | <?php } ?> |
|---|
| 132 | <?php if ($IMConfig['allow_cut_copy_paste']) { ?> |
|---|
| 133 | <a href="#" title="Cut" onclick="copyFile('<?php echo rawurlencode($entry);?>','move'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_cut.gif" height="15" width="15" alt="Cut" /></a> |
|---|
| 134 | <a href="#" title="Copy" onclick="copyFile('<?php echo rawurlencode($entry);?>','copy'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_copy.gif" height="15" width="15" alt="Copy" /></a> |
|---|
| 135 | <?php } ?> |
|---|
| 136 | </td> |
|---|
| 137 | </tr> |
|---|
| 138 | <?php |
|---|
| 139 | } |
|---|
| 140 | ?> |
|---|
| 141 | </tbody> |
|---|
| 142 | </table> |
|---|
| 143 | <?php |
|---|
| 144 | break; |
|---|
| 145 | case 'thumbview': |
|---|
| 146 | default: |
|---|
| 147 | $maxFileNameLength=16; |
|---|
| 148 | $maxFolderNameLength=16; |
|---|
| 149 | |
|---|
| 150 | foreach($list[0] as $path => $dir) |
|---|
| 151 | { ?> |
|---|
| 152 | <div class="dir_holder"> |
|---|
| 153 | <a class="dir" href="<?php print $IMConfig['backend_url'];?>__function=images&mode=<?php echo $insertMode;?>&dir=<?php echo rawurlencode($path); ?>&viewtype=<?php echo $afruViewType; ?>" onclick="updateDir('<?php echo $path; ?>')" title="<?php echo $dir['entry']; ?>"><img src="<?php print $IMConfig['base_url'];?>img/folder.gif" height="80" width="80" alt="<?php echo $dir['entry']; ?>" /></a> |
|---|
| 154 | |
|---|
| 155 | <div class="fileName"> |
|---|
| 156 | <?php if(strlen($dir['entry']) > $maxFolderNameLength) |
|---|
| 157 | echo substr($dir['entry'], 0, $maxFolderNameLength) . "..."; |
|---|
| 158 | else |
|---|
| 159 | echo $dir['entry']; ?> |
|---|
| 160 | </div> |
|---|
| 161 | <div class="edit"> |
|---|
| 162 | <a href="<?php print $IMConfig['backend_url'];?>__function=images&mode=<?php echo $insertMode;?>&dir=<?php echo $relative; ?>&deld=<?php echo rawurlencode($path); ?>&viewtype=<?php echo $afruViewType; ?>" title="Trash" onclick="return confirmDeleteDir('<?php echo $dir['entry']; ?>', <?php echo $dir['count']; ?>);"><img src="<?php print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash" /></a> |
|---|
| 163 | <?php if ($IMConfig['allow_rename']) { ?> |
|---|
| 164 | <a href="#" title="Rename" onclick="renameDir('<?php echo rawurlencode($dir['entry']);?>'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_rename.gif" height="15" width="15" alt="Rename" border="0" /></a> |
|---|
| 165 | <?php } ?> |
|---|
| 166 | <?php if ($IMConfig['allow_cut_copy_paste']) { ?> |
|---|
| 167 | <a href="#" title="Cut" onclick="copyDir('<?php echo rawurlencode($dir['entry']);?>','move'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_cut.gif" height="15" width="15" alt="Cut" /></a> |
|---|
| 168 | <a href="#" title="Copy" onclick="copyDir('<?php echo rawurlencode($dir['entry']);?>','copy'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_copy.gif" height="15" width="15" alt="Copy" /></a> |
|---|
| 169 | <?php } ?> |
|---|
| 170 | </div> |
|---|
| 171 | </div> |
|---|
| 172 | <?php |
|---|
| 173 | } |
|---|
| 174 | |
|---|
| 175 | |
|---|
| 176 | |
|---|
| 177 | foreach($list[1] as $entry => $file) |
|---|
| 178 | { |
|---|
| 179 | $afruimgdimensions=$manager->checkImageSize($file['relative']); |
|---|
| 180 | $thisFileNameLength = $maxFileNameLength; |
|---|
| 181 | ?> |
|---|
| 182 | <div class="thumb_holder" id="holder_<?php echo asc2hex($entry) ?>"> |
|---|
| 183 | <a href="#" class="thumb" style="cursor: pointer;" ondblclick="this.onclick();window.top.onOK();" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo preg_replace('#\..{3,4}$#', '', $entry); ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);return false;" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"> |
|---|
| 184 | <img src="<?php print $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>" /> |
|---|
| 185 | </a> |
|---|
| 186 | <div class="fileName"> |
|---|
| 187 | <?php |
|---|
| 188 | if(strlen($entry) > $thisFileNameLength + 3) echo strtolower(substr($entry,0,$thisFileNameLength))."..."; else echo $entry; |
|---|
| 189 | ?> |
|---|
| 190 | </div> |
|---|
| 191 | <div class="edit"> |
|---|
| 192 | <?php if($IMConfig['img_library'] && $IMConfig['allow_edit_image'] && $file['image'][0] > 0 ) |
|---|
| 193 | { ?> |
|---|
| 194 | <a href="javascript:;" title="Edit" onclick="editImage('<?php echo rawurlencode($file['relative']);?>');"><img src="<?php print $IMConfig['base_url'];?>img/edit_pencil.gif" height="15" width="15" alt="Edit" /></a> |
|---|
| 195 | <?php $thisFileNameLength -= 3; } ?> |
|---|
| 196 | <a href="<?php print $IMConfig['backend_url']; ?>__function=images&mode=<?php echo $insertMode;?>&dir=<?php echo $relative; ?>&delf=<?php echo rawurlencode($file['relative']);?>&viewtype=<?php echo $afruViewType; ?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="<?php print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash" /></a> |
|---|
| 197 | <?php if ($IMConfig['allow_rename']) { ?> |
|---|
| 198 | <a href="#" title="Rename" onclick="renameFile('<?php echo rawurlencode($file['relative']);?>'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_rename.gif" height="15" width="15" alt="Rename" /></a> |
|---|
| 199 | <?php $thisFileNameLength -= 3; } ?> |
|---|
| 200 | <?php if ($IMConfig['allow_cut_copy_paste']) { ?> |
|---|
| 201 | <a href="#" title="Cut" onclick="copyFile('<?php echo rawurlencode($entry);?>','move'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_cut.gif" height="15" width="15" alt="Cut" /></a> |
|---|
| 202 | <a href="#" title="Copy" onclick="copyFile('<?php echo rawurlencode($entry);?>','copy'); return false;"><img src="<?php print $IMConfig['base_url'];?>img/edit_copy.gif" height="15" width="15" alt="Copy" /></a> |
|---|
| 203 | <?php $thisFileNameLength -= 6; } ?> |
|---|
| 204 | |
|---|
| 205 | </div> |
|---|
| 206 | </div> |
|---|
| 207 | <?php |
|---|
| 208 | } |
|---|
| 209 | |
|---|
| 210 | } |
|---|
| 211 | } |
|---|
| 212 | |
|---|
| 213 | |
|---|
| 214 | |
|---|
| 215 | |
|---|
| 216 | |
|---|
| 217 | function drawNoResults() |
|---|
| 218 | { |
|---|
| 219 | ?> |
|---|
| 220 | <div class="noResult">No Files Found</div> |
|---|
| 221 | <?php |
|---|
| 222 | } |
|---|
| 223 | |
|---|
| 224 | |
|---|
| 225 | |
|---|
| 226 | |
|---|
| 227 | function drawErrorBase(&$manager) |
|---|
| 228 | { |
|---|
| 229 | ?> |
|---|
| 230 | <div class="error"><span>Invalid base directory:</span> <?php echo $manager->getImagesDir(); ?></div> |
|---|
| 231 | <?php |
|---|
| 232 | } |
|---|
| 233 | |
|---|
| 234 | |
|---|
| 235 | |
|---|
| 236 | |
|---|
| 237 | function asc2hex ($temp) |
|---|
| 238 | { |
|---|
| 239 | $data = ''; |
|---|
| 240 | $len = strlen($temp); |
|---|
| 241 | for ($i=0; $i<$len; $i++) $data.=sprintf("%02x",ord(substr($temp,$i,1))); |
|---|
| 242 | return $data; |
|---|
| 243 | } |
|---|
| 244 | |
|---|
| 245 | ?> |
|---|
| 246 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
|---|
| 247 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 248 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 249 | <head> |
|---|
| 250 | <title>File List</title> |
|---|
| 251 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|---|
| 252 | <link href="<?php print $IMConfig['base_url'];?>assets/imagelist.css" rel="stylesheet" type="text/css" /> |
|---|
| 253 | <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/dialog.js"></script> |
|---|
| 254 | <script type="text/javascript"> |
|---|
| 255 | /*<![CDATA[*/ |
|---|
| 256 | |
|---|
| 257 | var _backend_url = "<?php print $IMConfig['backend_url']; ?>"; |
|---|
| 258 | |
|---|
| 259 | if(window.top) |
|---|
| 260 | Xinha = window.top.Xinha; |
|---|
| 261 | |
|---|
| 262 | function hideMessage() |
|---|
| 263 | { |
|---|
| 264 | var topDoc = window.top.document; |
|---|
| 265 | var messages = topDoc.getElementById('messages'); |
|---|
| 266 | if(messages) |
|---|
| 267 | messages.style.display = "none"; |
|---|
| 268 | } |
|---|
| 269 | |
|---|
| 270 | init = function() |
|---|
| 271 | { |
|---|
| 272 | __dlg_translate('ExtendedFileManager'); |
|---|
| 273 | |
|---|
| 274 | hideMessage(); |
|---|
| 275 | |
|---|
| 276 | <?php |
|---|
| 277 | if(isset($uploadStatus) && !is_numeric($uploadStatus) && !is_bool($uploadStatus)) |
|---|
| 278 | echo "alert(i18n('$uploadStatus'));"; |
|---|
| 279 | else if(isset($uploadStatus) && $uploadStatus==false) |
|---|
| 280 | echo 'alert(i18n("Unable to upload File. \nEither Maximum file size [$max_size='.($insertMode == 'image' ? $IMConfig['max_filesize_kb_image'] : $IMConfig['max_filesize_kb_link'] ).'$ KB] exceeded or\nFolder doesn\'t have write permission."));'; |
|---|
| 281 | ?> |
|---|
| 282 | |
|---|
| 283 | <?php |
|---|
| 284 | if(isset($renameStatus) && !is_numeric($renameStatus) && !is_bool($renameStatus)) |
|---|
| 285 | echo 'alert(i18n("'.$renameStatus.'"));'; |
|---|
| 286 | else if(isset($renameStatus) && $renameStatus===false) |
|---|
| 287 | echo 'alert(i18n("Unable to rename file. File of the same name already exists or\nfolder doesn\'t have write permission."));'; |
|---|
| 288 | ?> |
|---|
| 289 | |
|---|
| 290 | <?php |
|---|
| 291 | if (isset($pasteStatus) && is_numeric($pasteStatus)) |
|---|
| 292 | { |
|---|
| 293 | switch ($pasteStatus) |
|---|
| 294 | { |
|---|
| 295 | case 100 : |
|---|
| 296 | $pasteStatus = 'Source file/folder not found.'; |
|---|
| 297 | break; |
|---|
| 298 | case 101 : |
|---|
| 299 | $pasteStatus = 'Copy failed.\nMaybe folder doesn\'t have write permission.'; |
|---|
| 300 | break; |
|---|
| 301 | case 102 : |
|---|
| 302 | $pasteStatus = 'Could not create destination folder.'; |
|---|
| 303 | break; |
|---|
| 304 | case 103 : |
|---|
| 305 | $pasteStatus = 'File pasted OK.'; |
|---|
| 306 | break; |
|---|
| 307 | case 104 : |
|---|
| 308 | $pasteStatus = 'Destination file/folder already exists.'; |
|---|
| 309 | break; |
|---|
| 310 | } |
|---|
| 311 | } |
|---|
| 312 | if(isset($pasteStatus) && !is_bool($pasteStatus)) |
|---|
| 313 | { |
|---|
| 314 | echo 'alert(i18n("'.$pasteStatus.'"));'; |
|---|
| 315 | } |
|---|
| 316 | ?> |
|---|
| 317 | |
|---|
| 318 | var topDoc = window.top.document; |
|---|
| 319 | |
|---|
| 320 | <?php |
|---|
| 321 | |
|---|
| 322 | |
|---|
| 323 | |
|---|
| 324 | if($refreshDir) |
|---|
| 325 | { |
|---|
| 326 | $dirs = $manager->getDirs(); |
|---|
| 327 | ?> |
|---|
| 328 | var selection = topDoc.getElementById('dirPath'); |
|---|
| 329 | var currentDir = selection.options[selection.selectedIndex].text; |
|---|
| 330 | |
|---|
| 331 | while(selection.length > 0) |
|---|
| 332 | { selection.remove(0); } |
|---|
| 333 | |
|---|
| 334 | selection.options[selection.length] = new Option("/","<?php echo rawurlencode('/'); ?>"); |
|---|
| 335 | <?php foreach($dirs as $relative=>$fullpath) { ?> |
|---|
| 336 | selection.options[selection.length] = new Option("<?php echo $relative; ?>","<?php echo rawurlencode($relative); ?>"); |
|---|
| 337 | <?php } ?> |
|---|
| 338 | |
|---|
| 339 | for(var i = 0; i < selection.length; i++) |
|---|
| 340 | { |
|---|
| 341 | var thisDir = selection.options[i].text; |
|---|
| 342 | if(thisDir == currentDir) |
|---|
| 343 | { |
|---|
| 344 | selection.selectedIndex = i; |
|---|
| 345 | break; |
|---|
| 346 | } |
|---|
| 347 | } |
|---|
| 348 | <?php } ?> |
|---|
| 349 | } |
|---|
| 350 | |
|---|
| 351 | function editImage(image) |
|---|
| 352 | { |
|---|
| 353 | var url = "<?php print $IMConfig['backend_url']; ?>__function=editor&img="+image+"&mode=<?php print $insertMode ?>"; |
|---|
| 354 | Dialog(url, function(param) |
|---|
| 355 | { |
|---|
| 356 | if (!param) { // user must have pressed Cancel |
|---|
| 357 | return false; |
|---|
| 358 | } else |
|---|
| 359 | { |
|---|
| 360 | return true; |
|---|
| 361 | } |
|---|
| 362 | }, null); |
|---|
| 363 | } |
|---|
| 364 | |
|---|
| 365 | /*]]>*/ |
|---|
| 366 | </script> |
|---|
| 367 | <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/images.js"></script> |
|---|
| 368 | <script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/popup.js"></script> |
|---|
| 369 | <script type="text/javascript"> |
|---|
| 370 | <!-- |
|---|
| 371 | // Koto: why emptying? commented out |
|---|
| 372 | //if(window.top.document.getElementById('manager_mode').value=="image") |
|---|
| 373 | //emptyProperties(); |
|---|
| 374 | <?php if(isset($diskInfo)) echo 'updateDiskMesg(i18n(\''.$diskInfo.'\'));'; ?> |
|---|
| 375 | //--> |
|---|
| 376 | </script> |
|---|
| 377 | |
|---|
| 378 | </head> |
|---|
| 379 | |
|---|
| 380 | <body> |
|---|
| 381 | <?php if ($manager->isValidBase() == false) { drawErrorBase($manager); } |
|---|
| 382 | elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?> |
|---|
| 383 | <?php drawDirs_Files($list, $manager); ?> |
|---|
| 384 | <?php } else { drawNoResults(); } ?> |
|---|
| 385 | </body> |
|---|
| 386 | </html> |
|---|