Ignore:
Timestamp:
07/04/06 14:20:38 (13 years ago)
Author:
koto
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/ExtendedFileManager/images.php

    r521 r524  
    44 * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz 
    55 * Version: Updated on 08-01-2005 by Afru 
    6  * Version: Updated on 21-06-2006 by Krzysztof Kotowicz 
    7  * Package: ExtendedFileManager (EFM 1.1.1) 
     6 * Version: Updated on 04-07-2006 by Krzysztof Kotowicz 
     7 * Package: ExtendedFileManager (EFM 1.1.2) 
    88 * http://www.afrusoft.com/htmlarea 
    99 */ 
     
    2121//process any file uploads 
    2222$uploadStatus=$manager->processUploads(); 
     23 
     24//process any file renames 
     25$renameStatus=$manager->processRenames(); 
    2326 
    2427if ($manager->deleteFiles()) 
     
    105108                <tr> 
    106109                          <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> 
    107                   <th><a href="#" class="thumb" style="cursor: pointer;" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo $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 } ?> > 
     110                  <th><a href="#" class="thumb" style="cursor: pointer;" 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 } ?> > 
    108111                                <?php 
    109112                                if(strlen($entry)>$maxNameLength) echo substr($entry,0,$maxNameLength)."..."; else echo $entry; 
     
    115118                  <td class="actions"> 
    116119                    <a href="<?php print $IMConfig['backend_url']; ?>__function=images&dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>&amp;mode=<?php echo $insertMode;?>&amp;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> 
     120                                <?php if ($IMConfig['allow_rename']) { ?> 
     121                    <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> 
     122                    <?php }  ?> 
    117123                                <?php if($IMConfig['img_library'] && $IMConfig['allow_edit_image'] && $file['image'][0] > 0) { ?> 
    118124                    <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> 
     
    129135        case 'thumbview': // thumbview is default 
    130136        default: 
    131                 $maxFileNameLength=10; 
     137                $maxFileNameLength=11; 
    132138                $maxFolderNameLength=13; 
    133139                // start of foreach for draw thumbview folders. 
     
    153159                { 
    154160                        $afruimgdimensions=$manager->checkImageSize($file['relative']); 
     161                        $thisFileNameLength = $maxFileNameLength; 
    155162                        ?> 
    156163                <div class="thumb_holder" id="holder_<?php echo asc2hex($entry) ?>"> 
    157                   <a href="#" class="thumb" style="cursor: pointer;" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo $entry; ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);return false;" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"> 
     164                  <a href="#" class="thumb" style="cursor: pointer;" 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']); ?>"> 
    158165                    <img src="<?php print $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>" /> 
    159166                  </a> 
    160167                  <div class="edit"> 
    161168                    <a href="<?php print $IMConfig['backend_url']; ?>__function=images&amp;mode=<?php echo $insertMode;?>&amp;dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>&amp;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> 
    162  
     169                                <?php if ($IMConfig['allow_rename']) { ?> 
     170                    <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> 
     171                    <?php $thisFileNameLength -= 3; }  ?> 
    163172                        <?php if($IMConfig['img_library'] && $IMConfig['allow_edit_image'] && $file['image'][0] > 0 ) 
    164173                    { ?> 
    165174                    <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> 
    166                         <?php $maxFileName2=$maxFileNameLength-3;} 
    167                         else $maxFileName2=$maxFileNameLength; ?> 
     175                        <?php $thisFileNameLength -= 3; } ?> 
    168176 
    169177                        <?php 
    170                                 if(strlen($entry)>$maxFileName2) echo strtolower(substr($entry,0,$maxFileName2))."..."; else echo $entry; 
     178                                if(strlen($entry) > $thisFileNameLength + 3) echo strtolower(substr($entry,0,$thisFileNameLength))."..."; else echo $entry; 
    171179                        ?> 
    172180                  </div> 
     
    241249                <?php 
    242250                if(isset($uploadStatus) && !is_numeric($uploadStatus) && !is_bool($uploadStatus)) 
    243                 echo 'alert("'.$uploadStatus.'");'; 
     251                echo 'alert(i18n("'.$uploadStatus.'"));'; 
    244252                else if(isset($uploadStatus) && $uploadStatus==false) 
    245253                echo 'alert("Unable to upload File. \nEither Maximum file size ['.($insertMode == 'image' ? $IMConfig['max_filesize_kb_image'] : $IMConfig['max_filesize_kb_link'] ).'Kb] exceeded or\nFolder doesn\'t have write permission.");'; 
    246254                ?> 
    247                  
     255 
     256                <?php 
     257                if(isset($renameStatus) && !is_numeric($renameStatus) && !is_bool($renameStatus)) 
     258                echo 'alert(i18n("'.$renameStatus.'"));'; 
     259                else if(isset($renameStatus) && $renameStatus===false) 
     260                echo 'alert(i18n("Unable to rename file. File of the same name already exists or\nfolder doesn\'t have write permission."));'; 
     261                ?> 
    248262 
    249263                var topDoc = window.top.document; 
Note: See TracChangeset for help on using the changeset viewer.