Source for file _chapter.form.php
Documentation is available at _chapter.form.php
* This file implements the Chapter form
* This file is part of Quam Plures - {@link http://quamplures.net/}
* See also {@link https://launchpad.net/quam-plures}.
* @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
* @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
* {@internal License choice
* - If you have received this file as part of a package, please find the license.txt file in
* the same folder or the closest folder above for complete license terms.
* - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
* then you must choose one of the following licenses before using the file:
* - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
* - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
global $edited_GenericCategory;
$edited_Chapter = & $edited_GenericCategory;
* @var GenericCategoryCache
global $GenericCategoryCache;
global $Settings, $action, $subset_ID;
// Determine if we are creating or updating...
$Form = new Form( NULL, 'form' );
$Form->global_icon( T_('Cancel editing!'), 'close', regenerate_url( 'action' ) );
$Form->begin_form( 'fform', $creating ? T_('New category') : T_('Category') );
$Form->hidden( 'action', $creating ? 'create' : 'update' );
$Form->begin_fieldset( T_('Properties') );
// We're essentially double checking here...
$edited_Blog = & $edited_Chapter->get_Blog();
if( $Settings->get('allow_moving_chapters') )
{ // If moving cats between blogs is allowed:
$move = ' '. action_icon( T_('Move to a different blog...'), 'move', regenerate_url( 'action,cat_ID', 'cat_ID='. $edited_Chapter->ID. '&action=move' ), T_('Move') );
$Form->info( T_('Blog'), $edited_Blog->get_maxlen_name(). $move );
$Form->select_input_options( 'cat_parent_ID',
$GenericCategoryCache->recurse_select( $edited_Chapter->parent_ID, $subset_ID, true, NULL, 0, array($edited_Chapter->ID) ), T_('Parent category') );
$Form->text_input( 'cat_name', $edited_Chapter->name, 40, T_('Name'), '', array( 'required' => true, 'maxlength' => 255 ) );
$Form->text_input( 'cat_urlname', $edited_Chapter->urlname, 40, T_('URL "slug"'), T_('Used for clean URLs. Must be unique.'), array( 'maxlength' => 255 ) );
$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 ) );
if( $Settings->get('chapter_ordering') == 'manual' )
$Form->text_input( 'cat_order', $edited_Chapter->order, 5, T_('Order'), T_('For manual ordering of the categories'), array( 'maxlength' => 11 ) );
$Form->end_form( array( array( 'submit', 'submit', T_('Record'), 'SaveButton' ),
array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
$Form->end_form( array( array( 'submit', 'submit', T_('Update'), 'SaveButton' ),
array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
|