Ignore:
Timestamp:
11/15/09 23:51:19 (10 years ago)
Author:
gogo
Message:

Ticket #1205

Add allow_delete and allow_edit to ImageManager?
Add allow_delete to ExtendedFileManager?

Location:
trunk/plugins/ExtendedFileManager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/ExtendedFileManager/config.inc.php

    r1210 r1231  
    222222*/ 
    223223$IMConfig['allow_cut_copy_paste'] = true; 
     224 
     225/* 
     226  Possible values: true, false 
     227 
     228 TRUE -  Allow the user to delete files and folders. 
     229 
     230 FALSE - No delete icon will be displayed. 
     231 
     232*/ 
     233$IMConfig['allow_delete'] = true; 
    224234 
    225235/* 
  • trunk/plugins/ExtendedFileManager/images.php

    r1214 r1231  
    3030$pasteStatus = (isset($_GET['paste'])) ?        $manager->processPaste() : false; 
    3131 
    32 $refreshFile = ($manager->deleteFiles()) ? true : false; 
     32$refreshFile = ($IMConfig['allow_delete'] && $manager->deleteFiles()) ? true : false; 
    3333 
    3434$refreshDir = false; 
    3535//process any directory functions 
    36 if($manager->deleteDirs() || $manager->processNewDir() || $pasteStatus || $renameStatus ) 
     36if(($IMConfig['allow_delete'] && $manager->deleteDirs()) || $manager->processNewDir() || $pasteStatus || $renameStatus ) 
    3737        $refreshDir = true; 
    3838 
     
    9494 
    9595                        <td class="actions" > 
     96            <?php 
     97              if($IMConfig['allow_delete']) 
     98              { 
     99                ?> 
    96100                                <a href="<?php print $backend_url_enc; ?>__function=images&amp;mode=<?php echo $insertMode;?>&amp;dir=<?php echo $relative; ?>&amp;deld=<?php echo rawurlencode($path); ?>&amp;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> 
     101                <?php 
     102              } 
     103            ?> 
    97104                                <?php if ($IMConfig['allow_rename']) { ?> 
    98105                                            <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> 
     
    128135                    <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> 
    129136                    <?php }  ?>   
     137             <?php 
     138              if($IMConfig['allow_delete']) 
     139              { 
     140                ?> 
    130141                    <a href="<?php print $backend_url_enc; ?>__function=images&amp;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> 
     142                 <?php 
     143               } 
     144             ?> 
    131145                                <?php if ($IMConfig['allow_rename']) { ?> 
    132146                    <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> 
     
    162176      </div> 
    163177      <div class="edit"> 
     178      <?php 
     179        if($IMConfig['allow_delete']) 
     180        { 
     181          ?> 
    164182        <a href="<?php print $backend_url_enc;?>__function=images&amp;mode=<?php echo $insertMode;?>&amp;dir=<?php echo $relative; ?>&amp;deld=<?php echo rawurlencode($path); ?>&amp;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> 
     183          <?php 
     184        } 
     185      ?> 
    165186        <?php if ($IMConfig['allow_rename']) { ?> 
    166187                    <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> 
     
    196217                    <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> 
    197218                        <?php $thisFileNameLength -= 3; } ?> 
     219                <?php 
     220                  if($IMConfig['allow_delete']) 
     221                  { 
     222                    ?> 
    198223                    <a href="<?php print $backend_url_enc; ?>__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> 
     224                    <?php 
     225                  } 
     226                ?> 
    199227                                <?php if ($IMConfig['allow_rename']) { ?> 
    200228                    <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> 
Note: See TracChangeset for help on using the changeset viewer.