b2evolution PHP Cross Reference Blogging Systems

Source: /inc/chapters/views/_chapter.form.php - 97 lines - 3993 bytes - Text - Print

Description: This file implements the Chapter 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 Chapter 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   * @version $Id: _chapter.form.php 6136 2014-03-08 07:59:48Z manuel $
  22   */
  23  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  24  
  25  /**
  26   * @var Chapter
  27   */
  28  global $edited_GenericCategory;
  29  /**
  30   * @var Chapter
  31   */
  32  $edited_Chapter = & $edited_GenericCategory;
  33  
  34  /**
  35   * @var GenericCategoryCache
  36   */
  37  global $GenericCategoryCache;
  38  
  39  global $Settings, $action, $subset_ID;
  40  
  41  // Determine if we are creating or updating...
  42  $creating = is_create_action( $action );
  43  
  44  $Form = new Form( NULL, 'form' );
  45  
  46  $close_url = get_chapter_redirect_url( get_param( 'redirect_page' ), $edited_Chapter->parent_ID, $edited_Chapter->ID );
  47  $Form->global_icon( T_('Cancel editing!'), 'close', $close_url );
  48  
  49  $Form->begin_form( 'fform', $creating ?  T_('New category') : T_('Category') );
  50  
  51  $Form->add_crumb( 'element' );
  52  $Form->hidden( 'action', $creating ? 'create' : 'update' );
  53  $Form->hiddens_by_key( get_memorized( 'action' ) );
  54  
  55  $Form->begin_fieldset( T_('Properties') );
  56  
  57      // We're essentially double checking here...
  58      $edited_Blog = & $edited_Chapter->get_Blog();
  59      $move = '';
  60      if( $Settings->get('allow_moving_chapters') && ( ! $creating ) )
  61      { // If moving cats between blogs is allowed:
  62          $move = ' '.action_icon( T_('Move to a different blog...'), 'file_move', regenerate_url( 'action,cat_ID', 'cat_ID='.$edited_Chapter->ID.'&amp;action=move' ), T_('Move') );
  63      }
  64      $Form->info( T_('Blog'), $edited_Blog->get_maxlen_name().$move );
  65  
  66      $Form->select_input_options( 'cat_parent_ID',
  67                  $GenericCategoryCache->recurse_select( $edited_Chapter->parent_ID, $subset_ID, true, NULL, 0, array($edited_Chapter->ID) ), T_('Parent category') );
  68  
  69      $Form->text_input( 'cat_name', $edited_Chapter->name, 40, T_('Name'), '', array( 'required' => true, 'maxlength' => 255 ) );
  70  
  71      $Form->text_input( 'cat_urlname', $edited_Chapter->urlname, 40, T_('URL "slug"'), T_('Used for clean URLs. Must be unique.'), array( 'maxlength' => 255 ) );
  72  
  73      $Form->text_input( 'cat_description', $edited_Chapter->description, 40, T_('Description'), T_('May be used as a title tag and/or meta description.'), array( 'maxlength' => 255 ) );
  74  
  75      if( $Settings->get('chapter_ordering') == 'manual' )
  76      {
  77          $Form->text_input( 'cat_order', $edited_Chapter->order, 5, T_('Order'), T_('For manual ordering of the categories.'), array( 'maxlength' => 11 ) );
  78      }
  79  
  80      $Form->checkbox_input( 'cat_meta', $edited_Chapter->meta, T_('Meta category'), array( 'note' => T_('If you check this box you will not be able to put any posts into this category.') ) );
  81  
  82      $Form->checkbox_input( 'cat_lock', $edited_Chapter->lock, T_('Locked category'), array( 'note' => T_('Check this to lock all posts under this category. (Note: for posts with multiple categories, the post is only locked if *all* its categories are locked.)') ) );
  83  
  84  $Form->end_fieldset();
  85  
  86  if( $creating )
  87  {
  88      $Form->end_form( array( array( 'submit', 'submit', T_('Record'), 'SaveButton' ),
  89                                                      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
  90  }
  91  else
  92  {
  93      $Form->end_form( array( array( 'submit', 'submit', T_('Update'), 'SaveButton' ),
  94                                                      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
  95  }
  96  
  97  ?>

title

Description

title

Description

title

Description

title

title

Body