b2evolution PHP Cross Reference Blogging Systems

Source: /skins_adm/_html_header.inc.php - 286 lines - 9833 bytes - Summary - Text - Print

Description: This file displays the first part of the page menu (before the page title). 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 displays the first part of the page menu (before the page title).
   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   * Parts of this file are copyright (c)2005-2006 by PROGIDISTRI - {@link http://progidistri.com/}.
  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   * PROGIDISTRI S.A.S. grants Francois PLANQUE the right to license
  22   * PROGIDISTRI S.A.S.'s contributions to this file and the b2evolution project
  23   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  24   * }}
  25   *
  26   * @package admin
  27   *
  28   * @author blueyed
  29   * @author fplanque
  30   * @author mbruneau: Marc BRUNEAU / PROGIDISTRI
  31   *
  32   * @version $Id: _html_header.inc.php 6136 2014-03-08 07:59:48Z manuel $
  33   */
  34  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  35  
  36  global $io_charset, $rsc_url, $UserSettings, $Debuglog, $Plugins;
  37  global $month, $month_abbrev, $weekday, $weekday_abbrev; /* for localized calendar */
  38  global $debug, $Hit;
  39  
  40  headers_content_mightcache( 'text/html', 0 );        // Make extra sure we don't cache the admin pages!
  41  require_js( 'functions.js' ); // General functions
  42  require_js( 'ajax.js' ); // Functions to work with AJAX response data
  43  ?>
  44  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  45  <html xml:lang="<?php locale_lang() ?>" lang="<?php locale_lang() ?>">
  46  <head>
  47      <title><?php echo $this->get_html_title(); ?></title>
  48      <?php
  49      global $robots_index, $robots_follow;
  50      $robots_index = false;
  51      $robots_follow = false;
  52      robots_tag();
  53  
  54      global $rsc_path, $rsc_url, $htsrv_url;
  55  
  56      // var bgxy_expand is used by toggle_filter_area() and toggle_clickopen()
  57      // var htsrv_url is used for AJAX callbacks
  58      add_js_headline( "// Paths used by JS functions:
  59          var bgxy_expand = '".get_icon( 'expand', 'xy' )."';
  60          var bgxy_collapse = '".get_icon( 'collapse', 'xy' )."';
  61          var htsrv_url = '$htsrv_url';
  62          var blog_id = '".param( 'blog', 'integer' )."';
  63          var is_backoffice = true;" );
  64  
  65      add_js_for_toolbar();        // Registers all the javascripts needed by the toolbar menu
  66      init_bubbletip_js(); // Add jQuery bubbletip plugin
  67      init_scrollwide_js(); // Add jQuery Wide Scroll plugin
  68      init_results_js(); // Add functions to work with Results tables
  69  
  70      require_js( '#jqueryUI#' );
  71      // asimo> This was permanently removed, because we didn't find any usage of this.
  72      // require_css( 'jquery/smoothness/jquery-ui.css' );
  73  
  74      require_js( 'form_extensions.js'); // script allowing to check and uncheck all boxes in forms -- TODO: jQueryfy
  75  
  76      require_js( 'extracats.js' );
  77      require_js( 'dynamic_select.js' );
  78      require_js( 'admin.js' );
  79  
  80  
  81      global $UserSettings;
  82      if( $UserSettings->get('control_form_abortions') )
  83      {    // Activate bozo validator
  84          require_js( 'bozo_validator.js' );
  85      }
  86  
  87      if( $UserSettings->get('focus_on_first_input') )
  88      {    // Activate focus on first form <input type="text">:
  89          add_js_headline( 'jQuery( function() { focus_on_first_input() } )' );
  90      }
  91  
  92      global $Debuglog;
  93      $Debuglog->add( 'Admin-Path: '.var_export($this->path, true), 'skins' );
  94  
  95      if( $this->get_path(0) == 'files'
  96              || ($this->get_path_range(0,1) == array('blogs', 'perm') )
  97              || ($this->get_path_range(0,1) == array('blogs', 'permgroup') ) )
  98      {{{ // -- Inject javascript ----------------
  99          // gets initialized in _footer.php
 100  
 101          $begin_script = <<<JS
 102          <script type="text/javascript">
 103          <!--
 104            var allchecked = Array();
 105            var idprefix;
 106  JS;
 107              add_headline( $begin_script );
 108  
 109              switch( $this->get_path(0) )
 110              {
 111                  case 'files':
 112                  /**
 113                   * Toggles status of a bunch of checkboxes in a form
 114                   *
 115                   * @param string the form name
 116                   * @param string the checkbox(es) element(s) name
 117                   * @param string number/name of the checkall set to use. Defaults to 0 and is needed when there are several "checkall-sets" on one page.
 118                   */
 119                  $toggleCheckboxes_script = "
 120  				function toggleCheckboxes(the_form, the_elements, set_name )
 121                  {
 122                      if( typeof set_name == 'undefined' )
 123                      {
 124                          set_name = 0;
 125                      }
 126                      if( allchecked[set_name] ) allchecked[set_name] = false;
 127                      else allchecked[set_name] = true;
 128  
 129                      var elems = document.forms[the_form].elements[the_elements];
 130                      if( !elems )
 131                      {
 132                          return;
 133                      }
 134                      var elems_cnt = (typeof(elems.length) != 'undefined') ? elems.length : 0;
 135                      if (elems_cnt)
 136                      {
 137                          for (var i = 0; i < elems_cnt; i++)
 138                          {
 139                              elems[i].checked = allchecked[nr];
 140                          } // end for
 141                      }
 142                      else
 143                      {
 144                          elems.checked = allchecked[nr];
 145                      }
 146                      setcheckallspan( set_name );
 147                  }
 148  ";
 149                  add_headline( $toggleCheckboxes_script );
 150                  break;
 151              }
 152  
 153              // --- general functions ----------------
 154              /**
 155               * replaces the text of the checkall-html-ID for set_name
 156               *
 157               * @param integer|string number or name of the checkall "set" to use
 158               * @param boolean force setting to true/false
 159               */
 160              $setcheckallspan_script = "
 161  			function setcheckallspan( set_name, set )
 162              {
 163                  if( typeof(allchecked[set_name]) == 'undefined' || typeof(set) != 'undefined' )
 164                  { // init
 165                      allchecked[set_name] = set;
 166                  }
 167  
 168                  if( allchecked[set_name] )
 169                  {
 170                      var replace = document.createTextNode('" . TS_('uncheck all') . "');
 171                  }
 172                  else
 173                  {
 174                      var replace = document.createTextNode('" . TS_('check all') . "');
 175                  }
 176  
 177                  if( document.getElementById( idprefix+'_'+String(set_name) ) )
 178                  {
 179                      document.getElementById( idprefix+'_'+String(set_name) ).replaceChild(replace, document.getElementById( idprefix+'_'+String(set_name) ).firstChild);
 180                  }
 181                  //else alert('no element with id '+idprefix+'_'+String(set_name));
 182              }
 183  ";
 184              add_headline( $setcheckallspan_script );
 185              /**
 186               * inits the checkall functionality.
 187               *
 188               * @param string the prefix of the IDs where the '(un)check all' text should be set
 189               * @param boolean initial state of the text (if there is no checkbox with ID htmlid + '_state_' + nr)
 190               */ $initcheckall_script = <<<JS
 191  			function initcheckall( htmlid, init )
 192              {
 193                  // initialize array
 194                  allchecked = Array();
 195                  idprefix = typeof(htmlid) == 'undefined' ? 'checkallspan' : htmlid;
 196  
 197                  for( var lform = 0; lform < document.forms.length; lform++ )
 198                  {
 199                      for( var lelem = 0; lelem < document.forms[lform].elements.length; lelem++ )
 200                      {
 201                          if( document.forms[lform].elements[lelem].id.indexOf( idprefix ) == 0 )
 202                          {
 203                              var index = document.forms[lform].elements[lelem].name.substring( idprefix.length+2, document.forms[lform].elements[lelem].name.length );
 204                              if( document.getElementById( idprefix+'_state_'+String(index)) )
 205                              {
 206                                  setcheckallspan( index, document.getElementById( idprefix+'_state_'+String(index)).checked );
 207                              }
 208                              else
 209                              {
 210                                  setcheckallspan( index, init );
 211                              }
 212                          }
 213                      }
 214                  }
 215              }
 216              //-->
 217          </script>
 218  JS;
 219          add_headline( $initcheckall_script );
 220      }}}
 221  
 222      if( $Hit->is_winIE() )
 223      {
 224          add_headline( '<!--[if lt IE 7]>
 225  <style type="text/css">
 226  /* IE: fix extra space */
 227  div.skin_wrapper_loggedin {
 228      margin-top: 0;
 229      padding-top: 0;
 230  }
 231  </style>
 232  <![endif]-->' );
 233      }
 234  
 235      // fp> TODO: ideally all this should only be included when the datepicker will be needed
 236      // dh> The Datepicker could dynamically load this CSS in document.ready?!
 237      // Afwas> Done. Keeping this conversation for reference. The performance may be an issue.
 238      // require_css( 'ui.datepicker.css' );
 239  
 240      // Add event to the item title field to update document title and init it (important when switching tabs/blogs):
 241      global $js_doc_title_prefix;
 242      if( isset($js_doc_title_prefix) )
 243      { // dynamic document.title handling:
 244          $base_title = preg_quote( trim($js_doc_title_prefix) /* e.g. FF2 trims document.title */ );
 245          add_js_headline( 'jQuery(function(){
 246              var generateTitle = function()
 247              {
 248                  currentPostTitle = jQuery(\'#post_title\').val()
 249                  document.title = document.title.replace(/(' . $base_title . ').*$/, \'$1 \'+currentPostTitle)
 250              }
 251              generateTitle()
 252              jQuery(\'#post_title\').keyup(generateTitle)
 253          })' );
 254      }
 255  
 256  
 257      $datefmt = locale_datefmt();
 258      $datefmt = str_replace( array( 'd', 'j', 'm', 'Y' ), array( 'dd', 'd', 'mm', 'yy' ), $datefmt );
 259      add_js_headline( 'jQuery(function(){
 260          var monthNames = ["'.T_('January').'","'.T_('February').'", "'.T_('March').'",
 261                            "'.T_('April').'", "'.T_('May').'", "'.T_('June').'",
 262                            "'.T_('July').'", "'.T_('August').'", "'.T_('September').'",
 263                            "'.T_('October').'", "'.T_('November').'", "'.T_('December').'"];
 264  
 265          var dayNamesMin = ["'.T_('Sun').'", "'.T_('Mon').'", "'.T_('Tue').'",
 266                            "'.T_('Wed').'", "'.T_('Thu').'", "'.T_('Fri').'", "'.T_('Sat').'"];
 267  
 268          var docHead = document.getElementsByTagName("head")[0];
 269          for (i=0;i<dayNamesMin.length;i++)
 270              dayNamesMin[i] = dayNamesMin[i].substr(0, 2)
 271  
 272          jQuery(".form_date_input").datepicker({
 273              dateFormat: "'.$datefmt.'",
 274              monthNames: monthNames,
 275              dayNamesMin: dayNamesMin,
 276              firstDay: '.locale_startofweek().'
 277          })
 278        })' );
 279  
 280      // CALL PLUGINS NOW:
 281      global $Plugins;
 282      $Plugins->trigger_event( 'AdminEndHtmlHead', array() );
 283  
 284      include_headlines(); // Add javascript and css files included by plugins and skin
 285  ?>
 286  </head>

title

Description

title

Description

title

Description

title

title

Body