[ 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/views/ -> _features.form.php (source)

   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-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   *

  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   * {@internal Open Source relicensing agreement:

  21   * Daniel HAHLER grants Francois PLANQUE the right to license

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

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

  24   *

  25   * Halton STEWART grants Francois PLANQUE the right to license

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

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

  28   * }}

  29   *

  30   * @package admin

  31   *

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

  33   * @author fplanque: Francois PLANQUE

  34   * @author halton: Halton STEWART

  35   * @author blueyed: Daniel HAHLER

  36   *

  37   * @version $Id: _features.form.php,v 1.2 2007/09/12 21:00:32 fplanque Exp $

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

  43   * @var User

  44   */
  45  global $current_User;
  46  /**

  47   * @var GeneralSettings

  48   */
  49  global $Settings;
  50  
  51  global $baseurl;
  52  
  53  
  54  $Form = & new Form( NULL, 'feats_checkchanges' );
  55  
  56  $Form->begin_form( 'fform', T_('Global Features') );
  57  
  58  $Form->hidden( 'ctrl', 'features' );
  59  $Form->hidden( 'action', 'update' );
  60  $Form->hidden( 'tab', 'features' );
  61  
  62  $Form->begin_fieldset( T_('Online Help').get_manual_link('online help'));
  63      $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.' ) ) );
  64  $Form->end_fieldset();
  65  
  66  
  67  $Form->begin_fieldset( T_('After each new post...').get_manual_link('after_each_post_settings') );
  68      $Form->radio_input( 'outbound_notifications_mode', $Settings->get('outbound_notifications_mode'), array(
  69              array( 'value'=>'off', 'label'=>T_('Off'), 'note'=>T_('No notification about your new content will be sent out.'), 'suffix' => '<br />' ),
  70              array( 'value'=>'immediate', 'label'=>T_('Immediate'), 'note'=>T_('This is guaranteed to work but may create an annoying delay after each post.'), 'suffix' => '<br />' ),
  71              array( 'value'=>'cron', 'label'=>T_('Asynchronous'), 'note'=>T_('Recommended if you have your scheduled jobs properly set up. You could notify news every minute.') ) ),
  72                                  T_('Outbound pings & email notifications') );
  73  $Form->end_fieldset();
  74  
  75  $Form->begin_fieldset( T_('Blog by email').get_manual_link('blog_by_email') );
  76  
  77      $Form->checkbox_input( 'eblog_enabled', $Settings->get('eblog_enabled'), T_('Enable Blog by email'),
  78          array( 'note' => T_('Check to enable the Blog by email feature.' ), 'onclick' =>
  79              'document.getElementById("eblog_section").style.display = (this.checked==true ? "" : "none") ;' ) );
  80  
  81      // fp> TODO: this is IMPOSSIBLE to turn back on when you have no javascript!!! :((

  82      echo '<div id="eblog_section" style="'.( $Settings->get('eblog_enabled') ? '' : 'display:none' ).'">';
  83  
  84          $Form->select_input_array( 'eblog_method', $Settings->get('eblog_method'), array( 'pop3'=>T_('POP3'), 'pop3a' => T_('POP3 through IMAP extension (experimental)') ), // TRANS: E-Mail retrieval method
  85              T_('Retrieval method'), T_('Choose a method to retrieve the emails.') );
  86  
  87          $Form->text_input( 'eblog_server_host', $Settings->get('eblog_server_host'), 40, T_('Mail Server'), T_('Hostname or IP address of your incoming mail server.'), array( 'maxlength' => 255 ) );
  88  
  89          $Form->text_input( 'eblog_server_port', $Settings->get('eblog_server_port'), 5, T_('Port Number'), T_('Port number of your incoming mail server (Defaults: pop3:110 imap:143).'), array( 'maxlength' => 6 ) );
  90  
  91          $Form->text_input( 'eblog_username', $Settings->get('eblog_username'), 15, T_('Account Name'), T_('User name for authenticating to your mail server.'), array( 'maxlength' => 255 ) );
  92  
  93          $Form->password_input( 'eblog_password', $Settings->get('eblog_password'),15,T_('Password'), array( 'maxlength' => 255, 'note' => T_('Password for authenticating to your mail server.') ) );
  94  
  95          //TODO: have a drop down list of available blogs and categories

  96          $Form->text_input( 'eblog_default_category', $Settings->get('eblog_default_category'), 5, T_('Default Category ID'), T_('By default emailed posts will have this category.'), array( 'maxlength' => 6 ) );
  97  
  98          $Form->text_input( 'eblog_subject_prefix', $Settings->get('eblog_subject_prefix'), 15, T_('Subject Prefix'), T_('Email subject must start with this prefix to be imported.'), array( 'maxlength' => 255 ) );
  99  
 100          // eblog test links

 101          // TODO: provide Non-JS functionality (open in a new window).

 102          // TODO: "cron/" is supposed to not reside in the server's DocumentRoot, therefor is not necessarily accessible

 103          $Form->info_field(
 104              T_('Perform Server Test'),
 105              ' <a id="eblog_test" href="#" onclick=\'return pop_up_window( "'.$baseurl.'cron/getmail.php?test=1", "getmail" )\'>[ ' . T_('connection') . ' ]</a>'
 106              .' <a id="eblog_test" href="#" onclick=\'return pop_up_window( "'.$baseurl.'cron/getmail.php?test=2", "getmail" )\'>[ ' . T_('messages') . ' ]</a>'
 107              .' <a id="eblog_test" href="#" onclick=\'return pop_up_window( "'.$baseurl.'cron/getmail.php?test=3", "getmail" )\'>[ ' . T_('verbose') . ' ]</a>',
 108              array() );
 109  
 110  //        $Form->info_field ('','<a id="eblog_test_email" href="#" onclick=\'return pop_up_window( "' . $htsrv_url . 'getmail.php?test=email", "getmail" )\'>' . T_('Test email') . '</a>',array());

 111          // special show / hide link

 112          $Form->info_field('', get_link_showhide( 'eblog_show_more','eblog_section_more', T_('Hide extra options'), T_('Show extra options...') ) );
 113  
 114  
 115          // TODO: provide Non-JS functionality

 116          echo '<div id="eblog_section_more" style="display:none">';
 117  
 118              $Form->checkbox( 'AutoBR', $Settings->get('AutoBR'), T_('Email/MMS Auto-BR'), T_('Add &lt;BR /&gt; tags to mail/MMS posts.') );
 119  
 120              $Form->text_input( 'eblog_body_terminator', $Settings->get('eblog_body_terminator'), 15, T_('Body Terminator'), T_('Starting from this string, everything will be ignored, including this string.'), array( 'maxlength' => 255 )  );
 121  
 122              $Form->checkbox_input( 'eblog_test_mode', $Settings->get('eblog_test_mode'), T_('Test Mode'), array( 'note' => T_('Check to run Blog by Email in test mode.' ) ) );
 123  
 124              $Form->checkbox_input( 'eblog_phonemail', $Settings->get('eblog_phonemail'), T_('Phone Email *'),
 125                  array( 'note' => 'Some mobile phone email services will send identical subject &amp; content on the same line. If you use such a service, check this option, and indicate a separator string when you compose your message, you\'ll type your subject then the separator string then you type your login:password, then the separator, then content.' ) );
 126  
 127              $Form->text_input( 'eblog_phonemail_separator', $Settings->get('eblog_phonemail_separator'), 15, T_('Phonemail Separator'), '',
 128                                                  array( 'maxlength' => 255 ) );
 129  
 130          echo '</div>';
 131  
 132      echo '</div>';
 133  $Form->end_fieldset();
 134  
 135  
 136  $Form->begin_fieldset( T_('Hit & session logging').get_manual_link('hit_logging') );
 137  
 138      $Form->checklist( array(
 139              array( 'log_public_hits', 1, T_('on every public page'), $Settings->get('log_public_hits') ),
 140              array( 'log_admin_hits', 1, T_('on every admin page'), $Settings->get('log_admin_hits') ) ),
 141          'log_hits', T_('Log hits') );
 142  
 143      // TODO: draw a warning sign if set to off

 144      $Form->radio_input( 'auto_prune_stats_mode', $Settings->get('auto_prune_stats_mode'), array(
 145              array(
 146                  'value'=>'off',
 147                  'label'=>T_('Off'),
 148                  'note'=>T_('Not recommended! Your database will grow very large!!'),
 149                  'suffix' => '<br />',
 150                  'onclick'=>'$("#auto_prune_stats_container").hide();' ),
 151              array(
 152                  'value'=>'page',
 153                  'label'=>T_('On every page'),
 154                  'note'=>T_('This is guaranteed to work but uses extra resources with every page displayed.'), 'suffix' => '<br />',
 155                  'onclick'=>'$("#auto_prune_stats_container").show();' ),
 156              array(
 157                  'value'=>'cron',
 158                  'label'=>T_('With a scheduled job'),
 159                  'note'=>T_('Recommended if you have your scheduled jobs properly set up.'), 'onclick'=>'$("#auto_prune_stats_container").show();' ) ),
 160          T_('Auto pruning'),
 161          array( 'note' => T_('Note: Even if you don\'t log hits, you still need to prune sessions!') ) );
 162  
 163      echo '<div id="auto_prune_stats_container">';
 164      $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?') );
 165      echo '</div>';
 166  
 167      if( $Settings->get('auto_prune_stats_mode') == 'off' )
 168      { // hide the "days" input field, if mode set to off:
 169          echo '<script type="text/javascript">$("#auto_prune_stats_container").hide();</script>';
 170      }
 171  
 172  $Form->end_fieldset();
 173  
 174  $Form->begin_fieldset( T_('Categories').get_manual_link('categories_global_settings'), array( 'id'=>'categories') );
 175      $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!)' ) ) );
 176  $Form->end_fieldset();
 177  
 178  
 179  if( $current_User->check_perm( 'options', 'edit' ) )
 180  {
 181      $Form->end_form( array(
 182          array( 'submit', 'submit', T_('Update'), 'SaveButton' ),
 183          array( 'reset', '', T_('Reset'), 'ResetButton' ),
 184          array( 'submit', 'submit[restore_defaults]', T_('Restore defaults'), 'ResetButton' ),
 185          ) );
 186  }
 187  
 188  
 189  /*

 190   * $Log: _features.form.php,v $

 191   * Revision 1.2  2007/09/12 21:00:32  fplanque

 192   * UI improvements

 193   *

 194   * Revision 1.1  2007/06/25 11:01:23  fplanque

 195   * MODULES (refactored MVC)

 196   *

 197   * Revision 1.27  2007/05/27 20:01:42  fplanque

 198   * keeping help string

 199   *

 200   * Revision 1.26  2007/05/15 20:46:36  blueyed

 201   * trans-fix: save an extra sentence by using the same phrase as below for note

 202   *

 203   * Revision 1.25  2007/05/15 20:42:00  blueyed

 204   * trans-todo

 205   *

 206   * Revision 1.24  2007/04/26 00:11:12  fplanque

 207   * (c) 2007

 208   *

 209   * Revision 1.23  2007/03/09 15:18:42  blueyed

 210   * Removed bloated "params" usage in Form::radio_input() for $field_options. Now the attribs/params for each radio input are directly in the $field_options entry instead.

 211   *

 212   * Revision 1.22  2007/01/26 02:12:09  fplanque

 213   * cleaner popup windows

 214   *

 215   * Revision 1.21  2007/01/23 08:57:36  fplanque

 216   * decrap!

 217   *

 218   * Revision 1.20  2006/12/12 20:41:41  blueyed

 219   * Whitespace

 220   *

 221   * Revision 1.19  2006/12/11 00:32:26  fplanque

 222   * allow_moving_chapters stting moved to UI

 223   * chapters are now called categories in the UI

 224   *

 225   * Revision 1.18  2006/12/09 01:55:36  fplanque

 226   * feel free to fill in some missing notes

 227   * hint: "login" does not need a note! :P

 228   *

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

 230   * reorganized some settings

 231   *

 232   * Revision 1.16  2006/12/06 18:06:18  fplanque

 233   * an experiment with JS hiding/showing form parts

 234   *

 235   * Revision 1.15  2006/12/03 01:25:49  blueyed

 236   * Use & instead of &amp; when it gets encoded for output

 237   *

 238   * Revision 1.14  2006/12/03 00:22:17  fplanque

 239   * doc

 240   *

 241   * Revision 1.13  2006/11/27 00:07:57  blueyed

 242   * Hide auto_prune_stats field, if ~_mode set to off

 243   *

 244   * Revision 1.12  2006/11/26 23:47:42  blueyed

 245   * Wording and "and" instead of "&amp;"

 246   *

 247   * Revision 1.11  2006/11/26 23:43:20  blueyed

 248   * whitespace

 249   *

 250   * Revision 1.10  2006/11/24 18:27:26  blueyed

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

 252   */
 253  ?>


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