b2evolution PHP Cross Reference Blogging Systems

Source: /inc/files/views/_file_copy_move.form.php - 95 lines - 3707 bytes - Text - Print

Description: This file implements the UI for file copy / move fplanque>> This whole thing is flawed: 1) only geeks can possibly like to use the same interface for renaming, moving and copying 2) even the geeky unix commands won't pretend copying and moving are the same thing. They are not! Only moving and renaming are similar, and again FOR GEEKS ONLY. 3) The way this works it breaks the File meta data (I'm working on it). 4) For Move and Copy, this should use a "destination directory tree" on the right (same as for upload) 5) Given all the reasons above copy, move and rename should be clearly separated into 3 different interfaces.

   1  <?php
   2  /**
   3   * This file implements the UI for file copy / move
   4   *
   5   * fplanque>> This whole thing is flawed:
   6   * 1) only geeks can possibly like to use the same interface for renaming, moving and copying
   7   * 2) even the geeky unix commands won't pretend copying and moving are the same thing. They are not!
   8   *    Only moving and renaming are similar, and again FOR GEEKS ONLY.
   9   * 3) The way this works it breaks the File meta data (I'm working on it).
  10   * 4) For Move and Copy, this should use a "destination directory tree" on the right (same as for upload)
  11   * 5) Given all the reasons above copy, move and rename should be clearly separated into 3 different interfaces.
  12   *
  13   * This file is part of the evoCore framework - {@link http://evocore.net/}
  14   * See also {@link http://sourceforge.net/projects/evocms/}.
  15   *
  16   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
  17   * Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.
  18   *
  19   * {@internal License choice
  20   * - If you have received this file as part of a package, please find the license.txt file in
  21   *   the same folder or the closest folder above for complete license terms.
  22   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  23   *   then you must choose one of the following licenses before using the file:
  24   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  25   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  26   * }}
  27   *
  28   * {@internal Open Source relicensing agreement:
  29   * Daniel HAHLER grants Francois PLANQUE the right to license
  30   * Daniel HAHLER's contributions to this file and the b2evolution project
  31   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  32   * }}
  33   *
  34   * @package admin
  35   *
  36   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  37   * @author blueyed: Daniel HAHLER.
  38   * @author fplanque: Francois PLANQUE.
  39   *
  40   * @version $Id: _file_copy_move.form.php 6136 2014-03-08 07:59:48Z manuel $
  41   */
  42  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  43  
  44  /**
  45   * @global string
  46   */
  47  global $fm_mode;
  48  
  49  /**
  50   * @global Filelist
  51   */
  52  global $fm_source_Filelist;
  53  
  54  /**
  55   * @global array
  56   */
  57  global $new_names;
  58  
  59  global $filename_max_length;
  60  
  61  
  62  $Form = new Form( NULL, 'fm_copymove_checkchanges' );
  63  
  64  $Form->global_icon( T_('Quit copy/move mode!'), 'close', regenerate_url('fm_sources,fm_mode') );
  65  
  66  $Form->begin_form( 'fform', $fm_mode == 'file_copy' ? T_('Copy') : T_('Move') );
  67  
  68      $Form->add_crumb( 'file' );
  69      $Form->hidden_ctrl();
  70      $Form->hiddens_by_key( get_memorized() );
  71      $Form->hidden( 'confirm', 1 );
  72  
  73      $fm_source_Filelist->restart();
  74      while( $loop_src_File = & $fm_source_Filelist->get_next() )
  75      {
  76          $Form->begin_fieldset( T_('Source').': '.$loop_src_File->get_rdfp_rel_path() );
  77  
  78          if( isset( $overwrite[$loop_src_File->get_md5_ID()] ) )
  79          {
  80              $Form->checkbox( 'overwrite['.$loop_src_File->get_md5_ID().']', $overwrite[$loop_src_File->get_md5_ID()], T_('Overwrite'), T_('Check to overwrite the existing file') );
  81          }
  82  
  83          $Form->text( 'new_names['.$loop_src_File->get_md5_ID().']', $new_names[$loop_src_File->get_md5_ID()], 32,
  84                                      T_('New name'), $loop_src_File->dget('title'), $filename_max_length );
  85  
  86          $Form->end_fieldset();
  87      }
  88  
  89  $Form->end_form( array( array( 'submit', 'submit', $fm_mode == 'file_copy' ? T_('Copy') : T_('Move'), 'SaveButton' ),
  90                                                  array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
  91  
  92  echo '<p class="notes"><strong>'.T_('You are in copy/move mode.')
  93                  .'</strong> '.T_('Please navigate to the desired target location.').'</p>';
  94  
  95  ?>

title

Description

title

Description

title

Description

title

title

Body