[ Index ]
 

Code source de b2evolution 2.1.0-beta

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/blogs/inc/settings/ -> features.ctrl.php (source)

   1  <?php
   2  /**

   3   * This file implements the UI controller for Global Features.

   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-2007 by Francois PLANQUE - {@link http://fplanque.net/}

   9   * Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.

  10   * Parts of this file are copyright (c)2005 by Halton STEWART - {@link http://hstewart.net/}.

  11   *

  12   * {@internal License choice

  13   * - If you have received this file as part of a package, please find the license.txt file in

  14   *   the same folder or the closest folder above for complete license terms.

  15   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)

  16   *   then you must choose one of the following licenses before using the file:

  17   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php

  18   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php

  19   * }}

  20   *

  21   * {@internal Open Source relicensing agreement:

  22   * Daniel HAHLER grants Francois PLANQUE the right to license

  23   * Daniel HAHLER's contributions to this file and the b2evolution project

  24   * under any OSI approved OSS license (http://www.opensource.org/licenses/).

  25   *

  26   * Halton STEWART grants Francois PLANQUE the right to license

  27   * Halton STEWART's contributions to this file and the b2evolution project

  28   * under any OSI approved OSS license (http://www.opensource.org/licenses/).

  29   * }}

  30   *

  31   * @package admin

  32   *

  33   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}

  34   * @author halton: Halton STEWART.

  35   * @author fplanque: Francois PLANQUE.

  36   * @author blueyed: Daniel HAHLER.

  37   *

  38   * @version $Id: features.ctrl.php,v 1.1 2007/06/25 11:01:12 fplanque Exp $

  39   */
  40  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  41  
  42  
  43  // Check minimum permission:

  44  $current_User->check_perm( 'options', 'view', true );
  45  
  46  
  47  $AdminUI->set_path( 'options', 'features' );
  48  
  49  param( 'action', 'string' );
  50  
  51  switch( $action )
  52  {
  53      case 'update':
  54          // Check permission:

  55          $current_User->check_perm( 'options', 'edit', true );
  56  
  57          param( 'submit', 'array', array() );
  58          if( isset($submit['restore_defaults']) )
  59          {
  60              /*

  61              // TODO: insert some default settings rather than just delete them all, as per original configuration in the _advanced.php file:

  62  

  63              fp>> Isn't this done in $Settings anyway?

  64  

  65              # mailserver settings

  66              $mailserver_url = 'mail.example.com';

  67              $mailserver_login = 'login@example.com';

  68              $mailserver_pass = 'password';

  69              $mailserver_port = 110;

  70              # by default posts will have this category

  71              $default_category = 1;

  72              # subject prefix

  73              $subjectprefix = 'blog:';

  74              # body terminator string (starting from this string, everything will be ignored, including this string)

  75              $bodyterminator = "___";

  76              # set this to 1 to run in test mode

  77              $thisisforfunonly = 0;

  78              ### Special Configuration for some phone email services

  79              # some mobile phone email services will send identical subject & content on the same line

  80              # if you use such a service, set $use_phoneemail to 1, and indicate a separator string

  81              # when you compose your message, you'll type your subject then the separator string

  82              # then you type your login:password, then the separator, then content

  83              $use_phoneemail = 0;

  84              $phoneemail_separator = ':::';

  85              */
  86  
  87              $Settings->delete_array( array(
  88                  'eblog_enabled', 'eblog_method', 'eblog_server_host', 'eblog_server_port', 'eblog_username',
  89                  'eblog_password', 'eblog_default_category', 'eblog_subject_prefix', 'AutoBR',
  90                  'log_public_hits', 'log_admin_hits', 'auto_prune_stats_mode', 'auto_prune_stats',
  91                  'outbound_notifications_mode', 'webhelp_enabled' ) );
  92  
  93              if( $Settings->dbupdate() )
  94              {
  95                  $Messages->add( T_('Restored default values.'), 'success' );
  96              }
  97              else
  98              {
  99                  $Messages->add( T_('Settings have not changed.'), 'note' );
 100              }
 101          }
 102          else
 103          {
 104              // Online help

 105              param( 'webhelp_enabled', 'integer', 0 );
 106              $Settings->set( 'webhelp_enabled', $webhelp_enabled );
 107  
 108              // Outbound pinging:

 109               param( 'outbound_notifications_mode', 'string', true );
 110              $Settings->set( 'outbound_notifications_mode',  get_param('outbound_notifications_mode') );
 111  
 112              // Blog by email

 113              param( 'eblog_enabled', 'integer', 0 );
 114              $Settings->set( 'eblog_enabled', $eblog_enabled );
 115  
 116              param( 'eblog_method', 'string', true );
 117              $Settings->set( 'eblog_method', strtolower(trim($eblog_method)));
 118  
 119              param( 'eblog_server_host', 'string', true );
 120              $Settings->set( 'eblog_server_host', strtolower(trim($eblog_server_host)));
 121  
 122              param( 'eblog_server_port', 'integer', 0 );
 123              $Settings->set( 'eblog_server_port', $eblog_server_port );
 124  
 125              param( 'eblog_username', 'string', true );
 126              $Settings->set( 'eblog_username', trim($eblog_username));
 127  
 128              param( 'eblog_password', 'string', true );
 129              $Settings->set( 'eblog_password', trim($eblog_password));
 130  
 131              param( 'eblog_default_category', 'integer', 0 );
 132              $Settings->set( 'eblog_default_category', $eblog_default_category );
 133  
 134              param( 'eblog_subject_prefix', 'string', true );
 135              $Settings->set( 'eblog_subject_prefix', trim($eblog_subject_prefix) );
 136  
 137              param( 'AutoBR', 'integer', 0 );
 138              $Settings->set( 'AutoBR', $AutoBR );
 139  
 140              param( 'eblog_body_terminator', 'string', true );
 141              $Settings->set( 'eblog_body_terminator', trim($eblog_body_terminator) );
 142  
 143              param( 'eblog_test_mode', 'integer', 0 );
 144              $Settings->set( 'eblog_test_mode', $eblog_test_mode );
 145  
 146              param( 'eblog_phonemail', 'integer', 0 );
 147              $Settings->set( 'eblog_phonemail', $eblog_phonemail );
 148  
 149              param( 'eblog_phonemail_separator', 'string', true );
 150              $Settings->set( 'eblog_phonemail_separator', trim($eblog_phonemail_separator) );
 151  
 152  
 153              // Hit & Session logs

 154              $Settings->set( 'log_public_hits', param( 'log_public_hits', 'integer', 0 ) );
 155              $Settings->set( 'log_admin_hits', param( 'log_admin_hits', 'integer', 0 ) );
 156  
 157              param( 'auto_prune_stats_mode', 'string', true );
 158              $Settings->set( 'auto_prune_stats_mode',  get_param('auto_prune_stats_mode') );
 159  
 160              // TODO: offer to set-up cron job if mode == 'cron' and to remove cron job if mode != 'cron'

 161  
 162              param( 'auto_prune_stats', 'integer', $Settings->get_default('auto_prune_stats'), false, false, true, false );
 163              $Settings->set( 'auto_prune_stats', get_param('auto_prune_stats') );
 164  
 165  
 166              // Categories:

 167              $Settings->set( 'allow_moving_chapters', param( 'allow_moving_chapters', 'integer', 0 ) );
 168  
 169  
 170              if( ! $Messages->count('error') )
 171              {
 172                  if( $Settings->dbupdate() )
 173                  {
 174                      $Messages->add( T_('Settings updated.'), 'success' );
 175                  }
 176                  else
 177                  {
 178                      $Messages->add( T_('Settings have not changed.'), 'note' );
 179                  }
 180              }
 181          }
 182          break;
 183  }
 184  
 185  
 186  // Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)

 187  $AdminUI->disp_html_head();
 188  
 189  // Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)

 190  $AdminUI->disp_body_top();
 191  
 192  // Begin payload block:

 193  $AdminUI->disp_payload_begin();
 194  
 195  // Display VIEW:

 196  $AdminUI->disp_view( 'settings/views/_features.form.php' );
 197  
 198  // End payload block:

 199  $AdminUI->disp_payload_end();
 200  
 201  // Display body bottom, debug info and close </html>:

 202  $AdminUI->disp_global_footer();
 203  
 204  /*

 205   * $Log: features.ctrl.php,v $

 206   * Revision 1.1  2007/06/25 11:01:12  fplanque

 207   * MODULES (refactored MVC)

 208   *

 209   * Revision 1.19  2007/04/26 00:11:14  fplanque

 210   * (c) 2007

 211   *

 212   * Revision 1.18  2006/12/11 00:32:26  fplanque

 213   * allow_moving_chapters stting moved to UI

 214   * chapters are now called categories in the UI

 215   *

 216   * Revision 1.17  2006/12/07 00:55:52  fplanque

 217   * reorganized some settings

 218   *

 219   * Revision 1.16  2006/11/24 18:27:23  blueyed

 220   * Fixed link to b2evo CVS browsing interface in file docblocks

 221   */
 222  ?>


Généré le : Thu Nov 29 23:58:50 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics