phpDocumentor pond
[ class tree: pond ] [ index: pond ] [ all elements ]

Source for file _chapter.form.php

Documentation is available at _chapter.form.php

  1. <?php
  2. /**
  3.  * This file implements the Chapter form
  4.  *
  5.  * This file is part of Quam Plures - {@link http://quamplures.net/}
  6.  * See also {@link https://launchpad.net/quam-plures}.
  7.  *
  8.  * @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
  9.  * @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
  10.  *
  11.  *  {@internal License choice
  12.  *  - If you have received this file as part of a package, please find the license.txt file in
  13.  *    the same folder or the closest folder above for complete license terms.
  14.  *  - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  15.  *    then you must choose one of the following licenses before using the file:
  16.  *    - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  17.  *    - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  18.  *  }}}
  19.  *
  20.  * @package pond
  21.  */
  22. if!defined('QP_MAIN_INIT') ) die'Please, do not access this page directly.' );
  23.  
  24. /**
  25.  * @var Chapter 
  26.  */
  27. global $edited_GenericCategory;
  28. /**
  29.  * @var Chapter 
  30.  */
  31. $edited_Chapter $edited_GenericCategory;
  32.  
  33. /**
  34.  * @var GenericCategoryCache 
  35.  */
  36. global $GenericCategoryCache;
  37.  
  38. global $Settings$action$subset_ID;
  39.  
  40. // Determine if we are creating or updating...
  41. $creating is_create_action$action );
  42.  
  43. $Form new FormNULL'form' );
  44.  
  45. $Form->global_iconT_('Cancel editing!')'close'regenerate_url'action' ) );
  46.  
  47. $Form->begin_form'fform'$creating ?  T_('New category'T_('Category') );
  48.  
  49. $Form->hidden'action'$creating 'create' 'update' );
  50. $Form->hiddens_by_keyget_memorized'action' ) );
  51.  
  52. $Form->begin_fieldsetT_('Properties') );
  53.  
  54.     // We're essentially double checking here...
  55.     $edited_Blog $edited_Chapter->get_Blog();
  56.     $move '';
  57.     if$Settings->get('allow_moving_chapters') )
  58.     // If moving cats between blogs is allowed:
  59.         $move ' '.action_iconT_('Move to a different blog...')'move'regenerate_url'action,cat_ID''cat_ID='.$edited_Chapter->ID.'&amp;action=move' )T_('Move') );
  60.     }
  61.     $Form->infoT_('Blog')$edited_Blog->get_maxlen_name().$move );
  62.  
  63.     $Form->select_input_options'cat_parent_ID',
  64.                 $GenericCategoryCache->recurse_select$edited_Chapter->parent_ID$subset_IDtrueNULL0array($edited_Chapter->ID) )T_('Parent category') );
  65.  
  66.     $Form->text_input'cat_name'$edited_Chapter->name40T_('Name')''array'required' => true'maxlength' => 255 ) );
  67.  
  68.     $Form->text_input'cat_urlname'$edited_Chapter->urlname40T_('URL "slug"')T_('Used for clean URLs. Must be unique.')array'maxlength' => 255 ) );
  69.  
  70.     $Form->text_input'cat_description'$edited_Chapter->description40T_('Description')T_('May be used as a title tag and/or meta description')array'maxlength' => 255 ) );
  71.  
  72.     if$Settings->get('chapter_ordering'== 'manual' )
  73.     {
  74.         $Form->text_input'cat_order'$edited_Chapter->order5T_('Order')T_('For manual ordering of the categories')array'maxlength' => 11 ) );
  75.     }
  76.  
  77. $Form->end_fieldset();
  78.  
  79. if$creating )
  80. {
  81.     $Form->end_formarrayarray'submit''submit'T_('Record')'SaveButton' ),
  82.                                                     array'reset'''T_('Reset')'ResetButton' ) ) );
  83. }
  84. else
  85. {
  86.     $Form->end_formarrayarray'submit''submit'T_('Update')'SaveButton' ),
  87.                                                     array'reset'''T_('Reset')'ResetButton' ) ) );
  88. }
  89.  
  90.  
  91. ?>