Ignore:
Timestamp:
07/10/05 05:44:48 (14 years ago)
Author:
gogo
Message:

Various updates to ImageManager?, see #343

File:
1 edited

Legend:

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

    r252 r256  
    5757        global $IMConfig; 
    5858 
    59         foreach($list as $entry => $file)  
    60         {  
     59        foreach($list as $entry => $file) 
     60        { 
    6161                ?> 
    62                 <td> 
    63  
    64                 <?php _ddt( __FILE__, __LINE__, "drawFiles(): relative is '" . $file['relative'] . "' thumbnail '" . $manager->getThumbnail($file['relative']) . "'" ); ?> 
    65  
    66                 <table width="100" cellpadding="0" cellspacing="0"><tr><td class="block"> 
    67         <table width="100" cellpadding="0" cellspacing="0"><tr><td class="block" style="cursor: pointer;" onclick="selectImage('<? echo $file['relative'];?>', '<? echo $entry; ?>', <? echo $file['image'][0];?>, <? echo $file['image'][1]; ?>);" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"> 
    68  
    69                 <img src="<?php print $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"/> 
    70                 </td></tr><tr><td class="edit"> 
    71                         <a href="<?php print $IMConfig['backend_url']; ?>__function=images&dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>" 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><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> 
    72                 <?php if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?> 
    73                 </td></tr></table></td>  
    74           <?php  
     62    <div class="thumb_holder" id="holder_<?php echo asc2hex($entry) ?>"> 
     63      <a href="#" class="thumb" style="cursor: pointer;" onclick="selectImage('<? echo $file['relative'];?>', '<? echo $entry; ?>', <? echo $file['image'][0];?>, <? echo $file['image'][1]; ?>);return false;" title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"> 
     64        <img src="<?php print $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"/> 
     65      </a> 
     66      <div class="edit"> 
     67        <a href="<?php print $IMConfig['backend_url']; ?>__function=images&dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>" 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> 
     68 
     69        <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> 
     70 
     71        <?php if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?> 
     72      </div> 
     73    </div> 
     74          <?php 
    7575        }//foreach 
    7676}//function drawFiles 
     
    8787        foreach($list as $path => $dir)  
    8888        { ?> 
    89                 <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block"> 
    90                 <a href="images.php?dir=<?php echo rawurlencode($path); ?>" 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> 
    91                 </td></tr><tr> 
    92                 <td class="edit"> 
    93                         <a href="images.php?dir=<?php echo $relative; ?>&amp;deld=<?php echo rawurlencode($path); ?>" 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> 
    94                         <?php echo $dir['entry']; ?> 
    95                 </td> 
    96                 </tr></table></td> 
     89    <div class="dir_holder"> 
     90      <a class="dir" href="<?php print $IMConfig['backend_url'];?>__function=images&dir=<?php echo rawurlencode($path); ?>" 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> 
     91 
     92      <div class="edit"> 
     93        <a href="<?php print $IMConfig['backend_url'];?>__function=images&dir=<?php echo $relative; ?>&amp;deld=<?php echo rawurlencode($path); ?>" 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> 
     94        <?php echo $dir['entry']; ?> 
     95      </div> 
     96    </div> 
    9797          <?php  
    9898        } //foreach 
     
    118118<div class="error"><span>Invalid base directory:</span> <?php echo $manager->config['images_dir']; ?></div> 
    119119<?       
     120} 
     121 
     122/** 
     123 * Utility to convert ascii string to hex 
     124 */ 
     125function asc2hex ($temp) 
     126{ 
     127  $len = strlen($temp); 
     128  for ($i=0; $i<$len; $i++) $data.=sprintf("%02x",ord(substr($temp,$i,1))); 
     129  return $data; 
    120130} 
    121131 
     
    182192                }                
    183193<?php } ?> 
     194    update_selected(); 
    184195        }        
    185196 
     
    207218<?php if ($manager->isValidBase() == false) { drawErrorBase($manager); }  
    208219        elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?> 
    209 <table> 
    210         <tr> 
     220 
    211221        <?php drawDirs($list[0], $manager); ?> 
    212222        <?php drawFiles($list[1], $manager); ?> 
    213         </tr> 
    214 </table> 
     223 
    215224<?php } else { drawNoResults(); } ?> 
    216225</body> 
Note: See TracChangeset for help on using the changeset viewer.