[ 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/skins_adm/ -> _html_header.inc.php (source)

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

   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,v 1.3 2007/07/04 23:36:10 blueyed Exp $

  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, $generating_static;
  37  global $month, $month_abbrev, $weekday, $weekday_abbrev; /* for localized calendar */
  38  global $debug;
  39  
  40  header( 'Content-type: text/html; charset='.$io_charset );
  41  ?>
  42  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  43  <html xml:lang="<?php locale_lang() ?>" lang="<?php locale_lang() ?>">
  44  <head>
  45      <title><?php echo $this->get_html_title(); ?></title>
  46      <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
  47      <?php
  48      global $rsc_path, $rsc_url, $htsrv_url;
  49  
  50      $paths_script = "
  51      <script type=\"text/javascript\">
  52          // Paths used by JS functions:

  53          var imgpath_expand = '" . get_icon( 'expand', 'url' ) . "';
  54          var imgpath_collapse = '" . get_icon( 'collapse', 'url' ) . "';
  55          var htsrv_url = '$htsrv_url';
  56      </script>";
  57      add_headline( $paths_script );
  58  
  59       // script allowing to check and uncheck all boxes in forms

  60      require_js( 'functions.js');
  61      require_js( 'form_extensions.js');
  62      require_js( 'anchorposition.js');
  63      require_js( 'date.js');
  64  
  65      $date_overrides_script = "
  66      <script type=\"text/javascript\">
  67          // Override vars used by date.js (and calendarpopup.js, if present)

  68          var MONTH_NAMES=new Array( '" . implode("','", array_map('T_',$month)) ."','" . implode("','", array_map('trim', array_map( 'T_', $month_abbrev ))) . "' );
  69          var DAY_NAMES=new Array('" . implode("','", array_map('T_', $weekday)) . "','" . implode("','", array_map('T_',$weekday_abbrev)) . "');
  70      </script>";
  71      add_headline( $date_overrides_script );
  72  
  73      require_js( 'popupwindow.js' );
  74      require_js( 'calendarpopup.js' );
  75      require_js( 'rollovers.js' );
  76      require_js( 'extracats.js' );
  77      require_js( 'dynamic_select.js' );
  78      require_js( 'admin.js' );
  79      require_js( '#jquery#' );
  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          $focus_on_first = '<script type="text/javascript">addEvent( window, "load", focus_on_first_input, false );</script>';
  90          add_headline( $focus_on_first );
  91      }
  92  
  93      global $Debuglog;
  94      $Debuglog->add( 'Admin-Path: '.var_export($this->path, true) );
  95  
  96      if( $this->get_path(0) == 'files'
  97              || ($this->get_path_range(0,1) == array('blogs', 'perm') )
  98              || ($this->get_path_range(0,1) == array('blogs', 'permgroup') ) )
  99      {{{ // -- Inject javascript ----------------
 100          // gets initialized in _footer.php

 101  
 102          $begin_script = <<<JS
 103          <script type="text/javascript">
 104          <!--
 105            var allchecked = Array();
 106            var idprefix;
 107  JS;
 108              add_headline( $begin_script );
 109  
 110              switch( $this->get_path(0) )
 111              {
 112                  case 'files':
 113                  /**

 114                   * Toggles status of a bunch of checkboxes in a form

 115                   *

 116                   * @param string the form name

 117                   * @param string the checkbox(es) element(s) name

 118                   * @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.

 119                   */
 120                  $toggleCheckboxes_script = "
 121  				function toggleCheckboxes(the_form, the_elements, set_name )
 122                  {
 123                      if( typeof set_name == 'undefined' )
 124                      {
 125                          set_name = 0;
 126                      }
 127                      if( allchecked[set_name] ) allchecked[set_name] = false;
 128                      else allchecked[set_name] = true;
 129  
 130                      var elems = document.forms[the_form].elements[the_elements];
 131                      if( !elems )
 132                      {
 133                          return;
 134                      }
 135                      var elems_cnt = (typeof(elems.length) != 'undefined') ? elems.length : 0;
 136                      if (elems_cnt)
 137                      {
 138                          for (var i = 0; i < elems_cnt; i++)
 139                          {
 140                              elems[i].checked = allchecked[nr];
 141                          } // end for

 142                      }
 143                      else
 144                      {
 145                          elems.checked = allchecked[nr];
 146                      }
 147                      setcheckallspan( set_name );
 148                  }
 149  ";
 150                  add_headline( $toggleCheckboxes_script );
 151                  break;
 152              }
 153  
 154              // --- general functions ----------------

 155              /**

 156               * replaces the text of the checkall-html-ID for set_name

 157               *

 158               * @param integer|string number or name of the checkall "set" to use

 159               * @param boolean force setting to true/false

 160               */
 161              $setcheckallspan_script = "
 162  			function setcheckallspan( set_name, set )
 163              {
 164                  if( typeof(allchecked[set_name]) == 'undefined' || typeof(set) != 'undefined' )
 165                  { // init
 166                      allchecked[set_name] = set;
 167                  }
 168  
 169                  if( allchecked[set_name] )
 170                  {
 171                      var replace = document.createTextNode('" . TS_('uncheck all') . "');
 172                  }
 173                  else
 174                  {
 175                      var replace = document.createTextNode('" . TS_('check all') . "');
 176                  }
 177  
 178                  if( document.getElementById( idprefix+'_'+String(set_name) ) )
 179                  {
 180                      document.getElementById( idprefix+'_'+String(set_name) ).replaceChild(replace, document.getElementById( idprefix+'_'+String(set_name) ).firstChild);
 181                  }
 182                  //else alert('no element with id '+idprefix+'_'+String(set_name));

 183              }
 184  ";
 185              add_headline( $setcheckallspan_script );
 186              /**

 187               * inits the checkall functionality.

 188               *

 189               * @param string the prefix of the IDs where the '(un)check all' text should be set

 190               * @param boolean initial state of the text (if there is no checkbox with ID htmlid + '_state_' + nr)

 191               */ $initcheckall_script = <<<JS
 192  			function initcheckall( htmlid, init )
 193              {
 194                  // initialize array

 195                  allchecked = Array();
 196                  idprefix = typeof(htmlid) == 'undefined' ? 'checkallspan' : htmlid;
 197  
 198                  for( var lform = 0; lform < document.forms.length; lform++ )
 199                  {
 200                      for( var lelem = 0; lelem < document.forms[lform].elements.length; lelem++ )
 201                      {
 202                          if( document.forms[lform].elements[lelem].id.indexOf( idprefix ) == 0 )
 203                          {
 204                              var index = document.forms[lform].elements[lelem].name.substring( idprefix.length+2, document.forms[lform].elements[lelem].name.length );
 205                              if( document.getElementById( idprefix+'_state_'+String(index)) )
 206                              {
 207                                  setcheckallspan( index, document.getElementById( idprefix+'_state_'+String(index)).checked );
 208                              }
 209                              else
 210                              {
 211                                  setcheckallspan( index, init );
 212                              }
 213                          }
 214                      }
 215                  }
 216              }
 217              //-->

 218          </script>
 219  JS;
 220          add_headline( $initcheckall_script );
 221      }}}
 222  
 223      // CALL PLUGINS NOW:

 224      global $Plugins;
 225      $Plugins->trigger_event( 'AdminEndHtmlHead', array() );
 226  
 227      include_headlines(); // Add javascript and css files included by plugins and skin

 228  ?>
 229  </head>
 230  
 231  <?php
 232  /*

 233   * $Log: _html_header.inc.php,v $

 234   * Revision 1.3  2007/07/04 23:36:10  blueyed

 235   * Fixed folding

 236   *

 237   * Revision 1.2  2007/06/30 22:03:34  fplanque

 238   * cleanup

 239   *

 240   * Revision 1.1  2007/06/25 11:02:35  fplanque

 241   * MODULES (refactored MVC)

 242   *

 243   * Revision 1.32  2007/06/24 22:35:57  fplanque

 244   * cleanup

 245   *

 246   * Revision 1.30  2007/06/24 20:09:06  personman2

 247   * switching to require_css and require_js in admin skins

 248   *

 249   * Revision 1.28  2007/04/26 00:11:11  fplanque

 250   * (c) 2007

 251   *

 252   * Revision 1.27  2007/03/12 22:59:32  blueyed

 253   * Fixed inclusion of jQuery

 254   *

 255   * Revision 1.26  2007/03/11 18:04:30  blueyed

 256   * Updated jQuery; now uncompressed jquery.js gets used in backoffice if $debug is true and jquery.js exists - otherwise the compressed jquery.min.js gets used.

 257   * jquery.js is not meant to get shipped in releases!

 258   *

 259   * Revision 1.25  2006/11/26 23:25:20  blueyed

 260   * Newline at the end, so "view-source" is nicer

 261   *

 262   * Revision 1.24  2006/11/26 02:30:39  fplanque

 263   * doc / todo

 264   */
 265  ?>


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