b2evolution PHP Cross Reference Blogging Systems

Source: /inc/files/views/_file_properties.form.php - 86 lines - 3348 bytes - Text - Print

Description: This file implements the UI controller for file upload. This file is part of the evoCore framework - {@link http://evocore.net/} See also {@link http://sourceforge.net/projects/evocms/}.

   1  <?php
   2  /**
   3   * This file implements the UI controller for file upload.
   4   *
   5   * This file is part of the evoCore framework - {@link http://evocore.net/}
   6   * See also {@link http://sourceforge.net/projects/evocms/}.
   7   *
   8   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
   9   *
  10   * {@internal License choice
  11   * - If you have received this file as part of a package, please find the license.txt file in
  12   *   the same folder or the closest folder above for complete license terms.
  13   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  14   *   then you must choose one of the following licenses before using the file:
  15   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  16   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  17   * }}
  18   *
  19   * {@internal Open Source relicensing agreement:
  20   * }}
  21   *
  22   * @package admin
  23   *
  24   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  25   * @author fplanque: Francois PLANQUE
  26   *
  27   * @version $Id: _file_properties.form.php 6136 2014-03-08 07:59:48Z manuel $
  28   */
  29  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  30  
  31  /**
  32   * @global File
  33   */
  34  global $edited_File;
  35  
  36  global $blog, $filename_max_length;
  37  
  38  $Form = new Form( NULL, 'fm_properties_checkchanges' );
  39  
  40  $Form->global_icon( T_('Close properties!'), 'close', regenerate_url() );
  41  
  42  $Form->begin_form( 'fform', T_('File properties') );
  43  
  44      $Form->add_crumb( 'file' );
  45      $Form->hidden_ctrl();
  46      $Form->hidden( 'action', 'update_properties' );
  47      $Form->hiddens_by_key( get_memorized() );
  48  
  49      $Form->begin_fieldset( T_('Properties') );
  50          if( $current_User->check_perm( 'files', 'edit', false, $blog ? $blog : NULL ) )
  51          { // User can edit: 
  52              $Form->text( 'name', $edited_File->dget('name'), 32, T_('Filename'), T_('This is the name of the file on the server hard drive.'), $filename_max_length );
  53          }
  54          else
  55          { // User can view only:
  56              $Form->info( T_('Filename'), $edited_File->dget('name'), T_('This is the name of the file on the server hard drive.') );    
  57          }
  58          $Form->info( T_('Type'), $edited_File->get_icon().' '.$edited_File->get_type() );
  59      $Form->end_fieldset();
  60  
  61      $Form->begin_fieldset( T_('Meta data') );
  62          if( $current_User->check_perm( 'files', 'edit', false, $blog ? $blog : NULL ) )
  63          { // User can edit:
  64              $Form->text( 'title', $edited_File->title, 50, T_('Long title'), T_('This is a longer descriptive title'), 255 );
  65              $Form->text( 'alt', $edited_File->alt, 50, T_('Alternative text'), T_('This is useful for images'), 255 );
  66              $Form->textarea( 'desc', $edited_File->desc, 10, T_('Caption/Description') );
  67          }
  68          else
  69          { // User can view only:
  70              $Form->info( T_('Long title'), $edited_File->dget('title'), T_('This is a longer descriptive title') );
  71              $Form->info( T_('Alternative text'), $edited_File->dget('alt'), T_('This is useful for images') );
  72              $Form->info( T_('Caption/Description'), $edited_File->dget('desc') );
  73          }
  74      $Form->end_fieldset();
  75  
  76  if( $current_User->check_perm( 'files', 'edit', false, $blog ? $blog : NULL ) )
  77  { // User can edit:
  78      $Form->end_form( array( array( 'submit', '', T_('Update'), 'SaveButton' ),
  79                                                      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
  80  }
  81  else
  82  { // User can view only:
  83      $Form->end_form();
  84  }
  85  
  86  ?>

title

Description

title

Description

title

Description

title

title

Body