[ 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/legacy/ -> _adminUI.class.php (source)

   1  <?php
   2  /**

   3   * This file implements the Admin UI class.

   4   * Alternate admin skins should derive from this class.

   5   *

   6   * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.

   7   * See also {@link http://sourceforge.net/projects/evocms/}.

   8   *

   9   * @copyright (c)2003-2007 by Francois PLANQUE - {@link http://fplanque.net/}.

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

  11   *

  12   * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)

  13   *

  14   * {@internal Open Source relicensing agreement:

  15   * Daniel HAHLER grants Francois PLANQUE the right to license

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

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

  18   * }}

  19   *

  20   * @package admin-skin

  21   * @subpackage evo

  22   *

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

  24   * @author blueyed: Daniel HAHLER

  25   *

  26   * @version $Id: _adminUI.class.php,v 1.22 2007/07/16 02:53:04 fplanque Exp $

  27   */
  28  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  29  
  30  /**

  31   * Includes

  32   */
  33  require_once dirname(__FILE__).'/../_adminUI_general.class.php';
  34  
  35  
  36  /**

  37   * We define a special template for the main menu.

  38   *

  39   * @package admin-skin

  40   * @subpackage evo

  41   */
  42  class AdminUI extends AdminUI_general
  43  {
  44      /**

  45       * Get a template by name and depth.

  46       *

  47       * @param string The template name ('main', 'sub').

  48       * @return array

  49       */
  50  	function get_template( $name, $depth = 0 )
  51      {
  52          switch( $name )
  53          {
  54              case 'main':
  55                  switch( $depth )
  56                  {
  57                      default: // just one level for now (might provide dropdown later)
  58                          return array(
  59                              'before' => '<ul class="tabs">',
  60                              'after' => '</ul>',
  61                              'beforeEach' => '<li>',
  62                              'afterEach' => '</li>',
  63                              'beforeEachSel' => '<li class="current">',
  64                              'afterEachSel' => '</li>',
  65                          );
  66                  }
  67                  break;
  68  
  69              case 'CollectionList':
  70                  // Template for a list of Collections (Blogs)

  71                  return array(
  72                          'before' => '',
  73                          'after' => '',
  74                          'beforeEach' => '',
  75                          'afterEach' => '',
  76                          'beforeEachSel' => '',
  77                          'afterEachSel' => '',
  78                      );
  79  
  80              default:
  81                  // Delegate to parent class:

  82                  return parent::get_template( $name, $depth );
  83          }
  84      }
  85  
  86  
  87      /**

  88       * Display doctype + <head>...</head> section

  89       */
  90  	function disp_html_head()
  91      {
  92          global $mode, $rsc_url, $adminskins_path;
  93  
  94          require_css ( 'skins_adm/legacy/rsc/css/variation.css', TRUE, 'Variation' );
  95          require_css ( 'skins_adm/legacy/rsc/css/desert.css', TRUE, 'Desert' );
  96          require_css ( 'skins_adm/legacy/rsc/css/legacy.css', TRUE, 'Legacy' );
  97  
  98          if( is_file( $adminskins_path.'/legacy/rsc/css/custom.css' ) )
  99          {
 100              require_css ( 'skins_adm/legacy/rsc/css/custom.css', TRUE, 'Custom' );
 101          }
 102  
 103          // Style switcher:

 104          require_js( 'styleswitcher.js' );
 105  
 106          parent::disp_html_head();
 107      }
 108  
 109  
 110      /**

 111       * GLOBAL HEADER - APP TITLE, LOGOUT, ETC.

 112       *

 113       * @return string

 114       */
 115  	function get_page_head()
 116      {
 117          global $htsrv_url_sensitive, $baseurl, $admin_url, $rsc_url, $Blog;
 118          global $app_shortname, $app_version;
 119  
 120          $r = '
 121          <div id="header">
 122              <div id="headfunctions">
 123                  '.$app_shortname.' v <strong>'.$app_version.'</strong> &middot;
 124                  '.T_('Color:').'
 125                  <a href="#" onclick="StyleSwitcher.setActiveStyleSheet(\'Variation\'); return false;" title="Variation (Default)">V</a>'
 126                  .'&middot;<a href="#" onclick="StyleSwitcher.setActiveStyleSheet(\'Desert\'); return false;" title="Desert">D</a>'
 127                  .'&middot;<a href="#" onclick="StyleSwitcher.setActiveStyleSheet(\'Legacy\'); return false;" title="Legacy">L</a>'
 128                  .( is_file( dirname(__FILE__).'/rsc/css/custom.css' ) ? '&middot;<a href="#" onclick="StyleSwitcher.setActiveStyleSheet(\'Custom\'); return false;" title="Custom">C</a>' : '' )
 129                  .'
 130              </div>'
 131  
 132              // Display MAIN menu:

 133              .$this->get_html_menu().'
 134          </div>
 135          ';
 136  
 137          return $r;
 138      }
 139  
 140  
 141      /**

 142       *

 143       *

 144       * @return string

 145       */
 146  	function get_body_top()
 147      {
 148          global $Messages;
 149  
 150          $r = '';
 151  
 152          if( empty($this->mode) )
 153          { // We're not running in an special mode (bookmarklet...)
 154              $r .= $this->get_page_head();
 155          }
 156  
 157          $r .= '
 158              <div id="TitleArea">
 159                  <h1><strong>'.$this->get_title_for_titlearea().'</strong>
 160                  '.$this->get_bloglist_buttons( '', '' ).'
 161                  </h1>
 162              </div>
 163  
 164              <div class="panelbody">'
 165              ."\n\n";
 166  
 167          // Display info & error messages

 168          $r .= $Messages->display( NULL, NULL, false, 'all', NULL, NULL, 'action_messages' );
 169  
 170          return $r;
 171      }
 172  
 173  
 174      /**

 175       * Close open div.

 176       *

 177       * @return string

 178       */
 179  	function get_body_bottom()
 180      {
 181          return "\n</div>\n";
 182      }
 183  }
 184  
 185  ?>


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