b2evolution PHP Cross Reference Blogging Systems

Source: /inc/collections/views/_coll_advanced.form.php - 232 lines - 11973 bytes - Text - Print

Description: This file implements the UI view for the Advanced blog properties. This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}. See also {@link http://sourceforge.net/projects/evocms/}.

   1  <?php
   2  /**
   3   * This file implements the UI view for the Advanced blog properties.
   4   *
   5   * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
   6   * See also {@link http://sourceforge.net/projects/evocms/}.
   7   *
   8   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}.
   9   * Parts of this file are copyright (c)2004-2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
  10   *
  11   * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)
  12   *
  13   * {@internal Open Source relicensing agreement:
  14   * Daniel HAHLER grants Francois PLANQUE the right to license
  15   * Daniel HAHLER's contributions to this file and the b2evolution project
  16   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  17   * }}
  18   *
  19   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  20   * @author gorgeb: Bertrand GORGE / EPISTEMA
  21   * @author blueyed: Daniel HAHLER
  22   *
  23   * @package admin
  24   *
  25   *
  26   * @version $Id: _coll_advanced.form.php 6136 2014-03-08 07:59:48Z manuel $
  27   */
  28  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  29  
  30  /**
  31   * @var Blog
  32   */
  33  global $edited_Blog;
  34  
  35  global $Plugins;
  36  
  37  global $basepath, $rsc_url, $dispatcher;
  38  
  39  $Form = new Form( NULL, 'blogadvanced_checkchanges' );
  40  
  41  $Form->begin_form( 'fform' );
  42  
  43  $Form->add_crumb( 'collection' );
  44  $Form->hidden_ctrl();
  45  $Form->hidden( 'action', 'update' );
  46  $Form->hidden( 'tab', 'advanced' );
  47  $Form->hidden( 'blog', $edited_Blog->ID );
  48  
  49  
  50  $Form->begin_fieldset( T_('Multiple authors').get_manual_link('multiple_author_settings') );
  51      $Form->checkbox( 'advanced_perms', $edited_Blog->get( 'advanced_perms' ), T_('Use advanced perms'), T_('This will turn on the advanced User and Group permissions tabs for this blog.') );
  52      $Form->checkbox( 'blog_use_workflow', $edited_Blog->get_setting( 'use_workflow' ), T_('Use workflow'), T_('This will notably turn on the Tracker tab in the Posts view.') );
  53  $Form->end_fieldset();
  54  
  55  
  56  $Form->begin_fieldset( T_('After each new post...').get_manual_link('after_each_new_post') );
  57      $ping_plugins = preg_split( '~\s*,\s*~', $edited_Blog->get_setting('ping_plugins'), -1, PREG_SPLIT_NO_EMPTY);
  58  
  59      $available_ping_plugins = $Plugins->get_list_by_event('ItemSendPing');
  60      $displayed_ping_plugin = false;
  61      if( $available_ping_plugins )
  62      {
  63          foreach( $available_ping_plugins as $loop_Plugin )
  64          {
  65              if( empty($loop_Plugin->code) )
  66              { // Ping plugin needs a code
  67                  continue;
  68              }
  69              $displayed_ping_plugin = true;
  70  
  71              $checked = in_array( $loop_Plugin->code, $ping_plugins );
  72              $Form->checkbox_input( 'blog_ping_plugins[]', $checked, /* TRANS: %s is a ping service name */ sprintf( T_('Ping %s'), $loop_Plugin->ping_service_name ), array('value'=>$loop_Plugin->code, 'note'=>$loop_Plugin->ping_service_note) );
  73  
  74              while( ($key = array_search($loop_Plugin->code, $ping_plugins)) !== false )
  75              {
  76                  unset($ping_plugins[$key]);
  77              }
  78          }
  79      }
  80      if( ! $displayed_ping_plugin )
  81      {
  82          echo '<p>'.T_('There are no ping plugins activated.').'</p>';
  83      }
  84  
  85      // Provide previous ping services as hidden fields, in case the plugin is temporarily disabled:
  86      foreach( $ping_plugins as $ping_plugin_code )
  87      {
  88          $Form->hidden( 'blog_ping_plugins[]', $ping_plugin_code );
  89      }
  90  $Form->end_fieldset();
  91  
  92  
  93  $Form->begin_fieldset( T_('External Feeds').get_manual_link('external_feeds') );
  94  
  95      $Form->text_input( 'atom_redirect', $edited_Blog->get_setting( 'atom_redirect' ), 50, T_('Atom Feed URL'),
  96      '<br />'.T_('Example: Your Feedburner Atom URL which should replace the original feed URL.').'<br />'
  97              .sprintf( T_( 'Note: the original URL was: %s' ), url_add_param( $edited_Blog->get_item_feed_url( '_atom' ), 'redir=no' ) ),
  98      array('maxlength'=>255, 'class'=>'large') );
  99  
 100      $Form->text_input( 'rss2_redirect', $edited_Blog->get_setting( 'rss2_redirect' ), 50, T_('RSS2 Feed URL'),
 101      '<br />'.T_('Example: Your Feedburner RSS2 URL which should replace the original feed URL.').'<br />'
 102              .sprintf( T_( 'Note: the original URL was: %s' ), url_add_param( $edited_Blog->get_item_feed_url( '_rss2' ), 'redir=no' ) ),
 103      array('maxlength'=>255, 'class'=>'large') );
 104  
 105  $Form->end_fieldset();
 106  
 107  
 108  if( $current_User->check_perm( 'blog_admin', 'edit', false, $edited_Blog->ID ) )
 109  {    // Permission to edit advanced admin settings
 110  
 111      $Form->begin_fieldset( T_('Aggregation').' ['.T_('Admin').']'.get_manual_link('collection_aggregation_settings') );
 112          $Form->text( 'aggregate_coll_IDs', $edited_Blog->get_setting( 'aggregate_coll_IDs' ), 30, T_('Blogs to aggregate'), T_('List blog IDs separated by , or use * for all blogs'), 255 );
 113      $Form->end_fieldset();
 114  
 115  
 116      $Form->begin_fieldset( T_('Caching').' ['.T_('Admin').']'.get_manual_link('collection_cache_settings') );
 117          $ajax_enabled = $edited_Blog->get_setting( 'ajax_form_enabled' );
 118          $ajax_loggedin_params = array( 'note' => T_('Also use JS forms for logged in users') );
 119          if( !$ajax_enabled )
 120          {
 121              $ajax_loggedin_params[ 'disabled' ] = 'disabled';
 122          }
 123          $Form->checkbox_input( 'ajax_form_enabled', $ajax_enabled, T_('Enable AJAX forms'), array( 'note'=>T_('Comment and contacts forms will be fetched by javascript') ) );
 124          $Form->checkbox_input( 'ajax_form_loggedin_enabled', $edited_Blog->get_setting('ajax_form_loggedin_enabled'), '', $ajax_loggedin_params );
 125          $Form->checkbox_input( 'cache_enabled', $edited_Blog->get_setting('cache_enabled'), T_('Enable page cache'), array( 'note'=>T_('Cache rendered blog pages') ) );
 126          $Form->checkbox_input( 'cache_enabled_widgets', $edited_Blog->get_setting('cache_enabled_widgets'), T_('Enable widget cache'), array( 'note'=>T_('Cache rendered widgets') ) );
 127      $Form->end_fieldset();
 128  
 129      $Form->begin_fieldset( T_('In-skin Actions').' ['.T_('Admin').']'.get_manual_link('in_skin_action_settings') );
 130          $Form->checkbox_input( 'in_skin_login', $edited_Blog->get_setting( 'in_skin_login' ), T_( 'In-skin login' ), array( 'note' => T_( 'Use in-skin login form every time it\'s possible' ) ) );
 131          $Form->checkbox_input( 'in_skin_editing', $edited_Blog->get_setting( 'in_skin_editing' ), T_( 'In-skin editing' ) );
 132      $Form->end_fieldset();
 133  
 134      $Form->begin_fieldset( T_('Media directory location').' ['.T_('Admin').']'.get_manual_link('media_directory_location') );
 135      global $media_path;
 136      $Form->radio( 'blog_media_location', $edited_Blog->get( 'media_location' ),
 137              array(
 138                  array( 'none', T_('None') ),
 139                  array( 'default', T_('Default'), $media_path.'blogs/'.$edited_Blog->urlname.'/' ),
 140                  array( 'subdir', T_('Subdirectory of media folder').':',
 141                      '',
 142                      ' <span class="nobr"><code>'.$media_path.'</code><input
 143                          type="text" name="blog_media_subdir" class="form_text_input" size="20" maxlength="255"
 144                          class="'.( param_has_error('blog_media_subdir') ? 'field_error' : '' ).'"
 145                          value="'.$edited_Blog->dget( 'media_subdir', 'formvalue' ).'" /></span>', '' ),
 146                  array( 'custom',
 147                      T_('Custom location').':',
 148                      '',
 149                      '<fieldset>'
 150                      .'<div class="label">'.T_('directory').':</div><div class="input"><input
 151                          type="text" class="form_text_input" name="blog_media_fullpath" size="50" maxlength="255"
 152                          class="'.( param_has_error('blog_media_fullpath') ? 'field_error' : '' ).'"
 153                          value="'.$edited_Blog->dget( 'media_fullpath', 'formvalue' ).'" /></div>'
 154                      .'<div class="label">'.T_('URL').':</div><div class="input"><input
 155                          type="text" class="form_text_input" name="blog_media_url" size="50" maxlength="255"
 156                          class="'.( param_has_error('blog_media_url') ? 'field_error' : '' ).'"
 157                          value="'.$edited_Blog->dget( 'media_url', 'formvalue' ).'" /></div></fieldset>' )
 158              ), T_('Media directory'), true
 159          );
 160      $Form->end_fieldset();
 161  
 162  }
 163  
 164  $Form->begin_fieldset( T_('Meta data').get_manual_link('blog_meta_data') );
 165      // TODO: move stuff to coll_settings
 166      $Form->text( 'blog_description', $edited_Blog->get( 'description' ), 60, T_('Short Description'), T_('This is is used in meta tag description and RSS feeds. NO HTML!'), 250, 'large' );
 167      $Form->text( 'blog_keywords', $edited_Blog->get( 'keywords' ), 60, T_('Keywords'), T_('This is is used in meta tag keywords. NO HTML!'), 250, 'large' );
 168      $Form->text( 'blog_footer_text', $edited_Blog->get_setting( 'blog_footer_text' ), 60, T_('Blog footer'), sprintf(
 169          T_('Use &lt;br /&gt; to insert a line break. You might want to put your copyright or <a href="%s" target="_blank">creative commons</a> notice here.'),
 170          'http://creativecommons.org/license/' ), 1000, 'large' );
 171      $Form->textarea( 'single_item_footer_text', $edited_Blog->get_setting( 'single_item_footer_text' ), 2, T_('Single post footer'),
 172          T_('This will be displayed after each post in single post view.').' '.sprintf( T_('Available variables: %s.'), '<b>$perm_url$</b>, <b>$title$</b>, <b>$excerpt$</b>, <b>$views$</b>, <b>$author$</b>, <b>$author_login$</b>' ), 50, 'large' );
 173      $Form->textarea( 'xml_item_footer_text', $edited_Blog->get_setting( 'xml_item_footer_text' ), 2, T_('Post footer in RSS/Atom'),
 174          T_('This will be appended to each post in your RSS/Atom feeds.').' '.sprintf( T_('Available variables: %s.'), T_('same as above') ), 50, 'large' );
 175      $Form->textarea( 'blog_notes', $edited_Blog->get( 'notes' ), 5, T_('Notes'),
 176          T_('Additional info. Appears in the backoffice.'), 50, 'large' );
 177  $Form->end_fieldset();
 178  
 179  $Form->begin_fieldset( T_('Software credits').get_manual_link('software_credits') );
 180      $max_credits = $edited_Blog->get_setting( 'max_footer_credits' );
 181      $note = T_('You get the b2evolution software for <strong>free</strong>. We do appreciate you giving us credit. <strong>Thank you for your support!</strong>');
 182      if( $max_credits < 1 )
 183      {
 184          $note = '<img src="'.$rsc_url.'smilies/icon_sad.gif" alt="" class="bottom"> '.$note;
 185      }
 186      $Form->text( 'max_footer_credits', $max_credits, 1, T_('Max footer credits'), $note, 1 );
 187  $Form->end_fieldset();
 188  
 189  
 190  if( $current_User->check_perm( 'blog_admin', 'edit', false, $edited_Blog->ID ) )
 191  {    // Permission to edit advanced admin settings
 192  
 193      $Form->begin_fieldset( T_('Skin and style').' ['.T_('Admin').']' );
 194          $Form->checkbox( 'blog_allowblogcss', $edited_Blog->get( 'allowblogcss' ), T_('Allow customized blog CSS file'), T_('You will be able to customize the blog\'s skin stylesheet with a file named style.css in the blog\'s media file folder.') );
 195          $Form->checkbox( 'blog_allowusercss', $edited_Blog->get( 'allowusercss' ), T_('Allow user customized CSS file for this blog'), T_('Users will be able to customize the blog and skin stylesheets with a file named style.css in their personal file folder.') );
 196          $Form->textarea( 'blog_head_includes', $edited_Blog->get_setting( 'head_includes' ), 5, T_('Custom meta tag/css section (before &lt;/head&gt;)'),
 197              T_('Add custom meta tags and/or css styles to the &lt;head&gt; section. Example use: website verification, Google+, favicon image...'), 50, 'large' );
 198          $Form->textarea( 'blog_footer_includes', $edited_Blog->get_setting( 'footer_includes' ), 5, T_('Custom javascript section (before &lt;/body&gt;)'),
 199              T_('Add custom javascript before the closing &lt;/body&gt; tag in order to avoid any issues with page loading delays for visitors with slow connection speeds.<br />Example use: tracking scripts, javascript libraries...'), 50, 'large' );
 200      $Form->end_fieldset();
 201  
 202  }
 203  
 204  
 205  $Form->end_form( array(
 206      array( 'submit', 'submit', T_('Save !'), 'SaveButton' ),
 207      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
 208  
 209  ?>
 210  
 211  <script type="text/javascript">
 212      jQuery( '#ajax_form_enabled' ).click( function()
 213      {
 214          if( jQuery( '#ajax_form_enabled' ).attr( "checked" ) )
 215          {
 216              jQuery( '#ajax_form_loggedin_enabled' ).attr( "disabled", false );
 217          }
 218          else
 219          {
 220              jQuery( '#cache_enabled' ).attr( "checked", false );
 221              jQuery( '#ajax_form_loggedin_enabled' ).attr( "disabled", true );
 222          }
 223      } );
 224      jQuery( '#cache_enabled' ).click( function()
 225      {
 226          if( jQuery( '#cache_enabled' ).attr( "checked" ) )
 227          {
 228              jQuery( '#ajax_form_enabled' ).attr( "checked", true );
 229              jQuery( '#ajax_form_loggedin_enabled' ).attr( "disabled", false );
 230          }
 231      } );
 232  </script>

title

Description

title

Description

title

Description

title

title

Body