b2evolution PHP Cross Reference Blogging Systems

Source: /inc/generic/views/_generic_category.form.php - 75 lines - 2674 bytes - Text - Print

Description: This file implements the generic category form 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 generic category form
   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   * @package admin
  20   *
  21   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  22   * @author fplanque: Francois PLANQUE.
  23   *
  24   * @version $Id: _generic_category.form.php 6136 2014-03-08 07:59:48Z manuel $
  25   */
  26  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  27  
  28  /**
  29   * @var GenericCategory
  30   */
  31  global $edited_GenericCategory;
  32  
  33  /**
  34   * @var GenericCategoryCache
  35   */
  36  global $GenericCategoryCache;
  37  
  38  global $action, $subset_ID, $edited_name_maxlen;
  39  
  40  // Determine if we are creating or updating...
  41  $creating = is_create_action( $action );
  42  
  43  $Form = new Form( NULL, 'form' );
  44  
  45  $Form->global_icon( T_('Cancel editing!'), 'close', regenerate_url( 'action' ) );
  46  
  47  $Form->begin_form( 'fform', $creating ?  T_('New category') : T_('Category') );
  48  
  49      $Form->add_crumb( 'element' );
  50      $Form->hidden( 'action', $creating ? 'create' : 'update' );
  51      $Form->hidden( 'ctrl', $ctrl );
  52      $Form->hiddens_by_key( get_memorized( 'action, ctrl' ) );
  53  
  54  $Form->begin_fieldset( T_('Properties') );
  55  
  56      $Form->select_input_options( $edited_GenericCategory->dbprefix.'parent_ID',
  57                  $GenericCategoryCache->recurse_select( $edited_GenericCategory->parent_ID, $subset_ID, true ), T_('Parent') );
  58  
  59      $Form->text_input( $edited_GenericCategory->dbprefix.'name', $edited_GenericCategory->name, $edited_name_maxlen, T_('name'), '', array( 'required' => true ) );
  60  
  61  $Form->end_fieldset();
  62  
  63  if( $creating )
  64  {
  65      $Form->end_form( array( array( 'submit', 'submit', T_('Record'), 'SaveButton' ),
  66                                                      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
  67  }
  68  else
  69  {
  70      $Form->hidden( $edited_GenericCategory->dbIDname, $edited_GenericCategory->ID );
  71      $Form->end_form( array( array( 'submit', 'submit', T_('Update'), 'SaveButton' ),
  72                                                      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
  73  }
  74  
  75  ?>

title

Description

title

Description

title

Description

title

title

Body