b2evolution PHP Cross Reference Blogging Systems

Source: /inc/collections/views/_coll_settings.form.php - 191 lines - 9236 bytes - Text - Print

Description: This file implements the Form for the all blogs settings. 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 Form for the all blogs settings.

   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: _coll_settings.form.php 849 2012-02-16 09:09:09Z attila $

  28   */
  29  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  30  
  31  /**

  32   * @var User

  33   */
  34  global $current_User;
  35  /**

  36   * @var GeneralSettings

  37   */
  38  global $Settings;
  39  
  40  global $dispatcher;
  41  
  42  global $collections_Module;
  43  
  44  $Form = new Form( NULL, 'settings_checkchanges' );
  45  $Form->begin_form( 'fform', '',
  46      // enable all form elements on submit (so values get sent):

  47      array( 'onsubmit'=>'var es=this.elements; for( var i=0; i < es.length; i++ ) { es[i].disabled=false; };' ) );
  48  
  49  $Form->add_crumb( 'collectionsettings' );
  50  $Form->hidden( 'ctrl', 'collections' );
  51  $Form->hidden( 'tab', 'settings' );
  52  $Form->hidden( 'action', 'update_settings' );
  53  
  54  // --------------------------------------------

  55  
  56  if( isset($collections_Module) )
  57  {
  58      $Form->begin_fieldset( T_('Display options').get_manual_link('collections-display-options') );
  59  
  60      $BlogCache = & get_BlogCache();
  61  
  62          $Form->select_input_object( 'default_blog_ID', $Settings->get('default_blog_ID'), $BlogCache, T_('Default blog to display'), array(
  63                  'note' => T_('This blog will be displayed on index.php.').' <a href="'.$dispatcher.'?ctrl=collections&action=new">'.T_('Create new blog').' &raquo;</a>',
  64                  'allow_none' => true,
  65                  'class' => '',
  66                  'loop_object_method' => 'get_maxlen_name',
  67                  'onchange' => '' )  );
  68  
  69          $Form->select_input_options( 'blogs_order_by', array_to_option_list( get_coll_sort_options(), $Settings->get('blogs_order_by') ), T_('Order blogs by'), T_('Select blog list order.') );
  70  
  71          $Form->select_input_options( 'blogs_order_dir', array_to_option_list(
  72                  array( 'ASC' => T_('Ascending'), 'DESC' => T_('Descending') ), $Settings->get('blogs_order_dir') ), T_('Order direction'), T_('Select default blog list order direction.') );
  73  
  74      $Form->end_fieldset();
  75  }
  76  
  77  // --------------------------------------------

  78  
  79  $Form->begin_fieldset( T_('Timeouts').get_manual_link('collections-timeouts') );
  80  
  81      $Form->duration_input( 'reloadpage_timeout', (int)$Settings->get('reloadpage_timeout'), T_('Reload-page timeout'), 'minutes', 'seconds', array( 'minutes_step' => 1, 'required' => true ) );
  82      // $Form->text_input( 'reloadpage_timeout', (int)$Settings->get('reloadpage_timeout'), 5,

  83      // T_('Reload-page timeout'), T_('Time (in seconds) that must pass before a request to the same URI from the same IP and useragent is considered as a new hit.'), array( 'maxlength'=>5, 'required'=>true ) );

  84  
  85      $Form->checkbox_input( 'smart_view_count', $Settings->get( 'smart_view_count' ), T_( 'Smart view counting' ), array( 'note' => T_( 'Check this to count post views only once per session and ignore reloads.' ).get_manual_link('post_views_counting') ) );
  86  
  87  $Form->end_fieldset();
  88  
  89  // --------------------------------------------

  90  
  91  $Form->begin_fieldset( T_('Caching').get_manual_link('collections-caching-settings') );
  92  
  93      $Form->checkbox_input( 'general_cache_enabled', $Settings->get('general_cache_enabled'), T_('Enable general cache'), array( 'note'=>T_('Cache rendered pages that are not controlled by a skin. See Blog Settings for skin output caching.') ) );
  94  
  95      $cache_note = '('.T_( 'See Blog Settings for existing' ).')';
  96      $Form->checklist( array(
  97              array( 'newblog_cache_enabled', 1, T_( 'Enable page cache for NEW blogs' ), $Settings->get('newblog_cache_enabled'), false, $cache_note ),
  98              array( 'newblog_cache_enabled_widget', 1, T_( 'Enable widget cache for NEW blogs' ), $Settings->get('newblog_cache_enabled_widget'), false, $cache_note )
  99              ), 'new_blogs_cahe', T_( 'Enable for new blogs' ) );
 100  
 101  $Form->end_fieldset();
 102  
 103  // --------------------------------------------

 104  
 105  $Form->begin_fieldset( T_('After each new post or comment...').get_manual_link('after_each_post_settings') );
 106      $Form->radio_input( 'outbound_notifications_mode', $Settings->get('outbound_notifications_mode'),
 107          array(
 108              array( 'value'=>'off', 'label'=>T_('Off'), 'note'=>T_('No notification about your new content will be sent out.') ),
 109              array( 'value'=>'immediate', 'label'=>T_('Immediate'), 'note'=>T_('This is guaranteed to work but may create an annoying delay after each post or comment publication.') ),
 110              array( 'value'=>'cron', 'label'=>T_('Asynchronous'), 'note'=>T_('Recommended if you have your scheduled jobs properly set up.') )
 111          ),
 112          T_('Outbound pings & email notifications'),
 113          array( 'lines' => true ) );
 114  $Form->end_fieldset();
 115  
 116  // --------------------------------------------

 117  
 118  $Form->begin_fieldset( T_('Categories').get_manual_link('categories_global_settings'), array( 'id'=>'categories') );
 119      $Form->checkbox_input( 'allow_moving_chapters', $Settings->get('allow_moving_chapters'), T_('Allow moving categories'), array( 'note' => T_('Check to allow moving categories accross blogs. (Caution: can break pre-existing permalinks!)' ) ) );
 120      $Form->radio_input( 'chapter_ordering', $Settings->get('chapter_ordering'), array(
 121                      array( 'value'=>'alpha', 'label'=>T_('Alphabetical') ),
 122                      array( 'value'=>'manual', 'label'=>T_('Manual ') ),
 123               ), T_('Ordering of categories') );
 124  $Form->end_fieldset();
 125  
 126  // --------------------------------------------

 127  
 128  $Form->begin_fieldset( T_('Cross posting').get_manual_link('collections-cross-posting-settings') );
 129      $Form->checklist( array(
 130          array( 'cross_posting', 1, T_('Allow cross-posting posts to several blogs'), $Settings->get('cross_posting'), false, T_('(Extra cats in different blogs)') ),
 131          array( 'cross_posting_blogs', 1, T_('Allow moving posts between different blogs'), $Settings->get('cross_posting_blogs'), false, T_('(Main cat can move to different blog)') ) ),
 132          'allow_cross_posting', T_('Cross Posting') );
 133  $Form->end_fieldset();
 134  
 135  // --------------------------------------------

 136  
 137  $Form->begin_fieldset( T_('Subscribing to new blogs').get_manual_link('collections-subscription-settings') );
 138      $Form->radio_input( 'subscribe_new_blogs', $Settings->get('subscribe_new_blogs'),
 139          array(
 140              array( 'value' => 'page', 'label' => T_('From blog page only') ),
 141              array( 'value' => 'public', 'label' => T_('Show a list of all <b>Public</b> blogs allowing subscriptions') ),
 142              array( 'value' => 'all', 'label' => T_('Show a list of <b>All</b> blogs allowing subsciptions') )
 143          ),
 144          T_('Subscribing to new blogs'),
 145          array( 'lines' => true ) );
 146  $Form->end_fieldset();
 147  
 148  // --------------------------------------------

 149  
 150  $Form->begin_fieldset( T_('Default skins').get_manual_link('collections-default-skins') );
 151      $normal_skins = array();
 152      $mobile_skins = array( 0 => T_('Same as normal skin') );
 153      $tablet_skins = array( 0 => T_('Same as normal skin') );
 154  
 155      $SkinCache = & get_SkinCache();
 156      $SkinCache->load_all();
 157      $SkinCache->rewind();
 158      while( ( $iterator_Skin = & $SkinCache->get_next() ) != NULL )
 159      {
 160          switch( $iterator_Skin->get( 'type' ) )
 161          {
 162              case 'normal':
 163                  $normal_skins[ $iterator_Skin->ID ] = $iterator_Skin->get( 'name' );
 164                  break;
 165  
 166              case 'mobile':
 167                  $mobile_skins[ $iterator_Skin->ID ] = $iterator_Skin->get( 'name' );
 168                  break;
 169  
 170              case 'tablet':
 171                  $tablet_skins[ $iterator_Skin->ID ] = $iterator_Skin->get( 'name' );
 172                  break;
 173  
 174              //default: It's not a skin whit a type what we should show in these select lists ( e.g. feed )

 175          }
 176      }
 177      $field_params = array( 'force_keys_as_values' => true );
 178      $Form->select_input_array( 'def_normal_skin_ID', $Settings->get( 'def_normal_skin_ID' ), $normal_skins, T_('Default normal skin'), NULL, $field_params );
 179      $Form->select_input_array( 'def_mobile_skin_ID', $Settings->get( 'def_mobile_skin_ID' ), $mobile_skins, T_('Default mobile phone skin'), NULL, $field_params );
 180      $Form->select_input_array( 'def_tablet_skin_ID', $Settings->get( 'def_tablet_skin_ID' ), $tablet_skins, T_('Default tablet skin'), NULL, $field_params );
 181  $Form->end_fieldset();
 182  
 183  // --------------------------------------------

 184  
 185  if( $current_User->check_perm( 'options', 'edit' ) )
 186  {
 187      $Form->end_form( array( array( 'submit', 'submit', T_('Save !'), 'SaveButton' ),
 188                                                      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
 189  }
 190  
 191  ?>

title

Description

title

Description

title

Description

title

title

Body