b2evolution PHP Cross Reference Blogging Systems

Source: /inc/settings/views/_general.form.php - 125 lines - 5209 bytes - Text - Print

Description: This file implements the UI view for the general 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 UI view for the general 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   * @author blueyed: Daniel HAHLER.
  27   *
  28   * @version $Id: _general.form.php 6136 2014-03-08 07:59:48Z manuel $
  29   */
  30  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  31  
  32  /**
  33   * @var User
  34   */
  35  global $current_User;
  36  /**
  37   * @var GeneralSettings
  38   */
  39  global $Settings;
  40  
  41  global $dispatcher;
  42  
  43  global $collections_Module;
  44  
  45  $Form = new Form( NULL, 'settings_checkchanges' );
  46  $Form->begin_form( 'fform', '',
  47      // enable all form elements on submit (so values get sent):
  48      array( 'onsubmit'=>'var es=this.elements; for( var i=0; i < es.length; i++ ) { es[i].disabled=false; };' ) );
  49  
  50  $Form->add_crumb( 'globalsettings' );
  51  $Form->hidden( 'ctrl', 'gensettings' );
  52  $Form->hidden( 'action', 'update' );
  53  
  54  // --------------------------------------------
  55  
  56  if( $current_User->check_perm( 'users', 'edit' ) )
  57  {
  58      $Form->begin_fieldset( T_('Locking down b2evolution for maintenance, upgrade or server switching...') );
  59          $Form->checkbox_input( 'system_lock', $Settings->get('system_lock'), T_('Lock system'), array(
  60                  'note' => T_('check this to prevent login (except for admins) and sending comments/messages. This prevents the DB from receiving updates (other than logging)').'<br />'.
  61                            T_('Note: for a more complete lock down, rename the file /conf/_maintenance.html to /conf/maintenance.html (complete lock) or /conf/imaintenance.html (gives access to /install)') ) );
  62      $Form->end_fieldset();
  63  }
  64  
  65  // --------------------------------------------
  66  
  67  $Form->begin_fieldset( T_('Caching') );
  68  
  69      $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.') ) );
  70  
  71  $Form->end_fieldset();
  72  
  73  // --------------------------------------------
  74  
  75  $Form->begin_fieldset( T_('Online Help').get_manual_link('online help'));
  76      $Form->checkbox_input( 'webhelp_enabled', $Settings->get('webhelp_enabled'), T_('Online Help links'), array( 'note' => T_('Online help links provide context sensitive help to certain features.' ) ) );
  77  $Form->end_fieldset();
  78  
  79  // --------------------------------------------
  80  
  81  $Form->begin_fieldset( T_('Hit & session logging').get_manual_link('hit_logging') );
  82  
  83      $Form->checklist( array(
  84              array( 'log_public_hits', 1, T_('on every public page'), $Settings->get('log_public_hits') ),
  85              array( 'log_admin_hits', 1, T_('on every admin page'), $Settings->get('log_admin_hits') ) ),
  86          'log_hits', T_('Log hits') );
  87  
  88      // TODO: draw a warning sign if set to off
  89      $Form->radio_input( 'auto_prune_stats_mode', $Settings->get('auto_prune_stats_mode'), array(
  90              array(
  91                  'value'=>'off',
  92                  'label'=>T_('Off'),
  93                  'note'=>T_('Not recommended! Your database will grow very large!'),
  94                  'onclick'=>'jQuery("#auto_prune_stats_container").hide();' ),
  95              array(
  96                  'value'=>'page',
  97                  'label'=>T_('On every page'),
  98                  'note'=>T_('This is guaranteed to work but uses extra resources with every page displayed.'),
  99                  'onclick'=>'jQuery("#auto_prune_stats_container").show();' ),
 100              array(
 101                  'value'=>'cron',
 102                  'label'=>T_('With a scheduled job'),
 103                  'note'=>T_('Recommended if you have your scheduled jobs properly set up.'), 'onclick'=>'jQuery("#auto_prune_stats_container").show();' ) ),
 104          T_('Auto pruning'),
 105          array( 'note' => T_('Note: Even if you don\'t log hits, you still need to prune sessions!'),
 106          'lines' => true ) );
 107  
 108      echo '<div id="auto_prune_stats_container">';
 109      $Form->text_input( 'auto_prune_stats', $Settings->get('auto_prune_stats'), 5, T_('Prune after'), T_('days. How many days of hits & sessions do you want to keep in the database for stats?') );
 110      echo '</div>';
 111  
 112      if( $Settings->get('auto_prune_stats_mode') == 'off' )
 113      { // hide the "days" input field, if mode set to off:
 114          echo '<script type="text/javascript">jQuery("#auto_prune_stats_container").hide();</script>';
 115      }
 116  
 117  $Form->end_fieldset();
 118  
 119  if( $current_User->check_perm( 'options', 'edit' ) )
 120  {
 121      $Form->end_form( array( array( 'submit', 'submit', T_('Save !'), 'SaveButton' ),
 122                                                      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
 123  }
 124  
 125  ?>

title

Description

title

Description

title

Description

title

title

Body