[ 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/chicago/ -> _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.4 2007/09/29 03:08:24 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  
  46      /**

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

  48       */
  49  	function disp_html_head()
  50      {
  51          require_css( 'skins_adm/chicago/rsc/css/chicago.css', true );
  52  
  53          parent::disp_html_head();
  54      }
  55  
  56  
  57      /**

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

  59       *

  60       * @return string

  61       */
  62  	function get_page_head()
  63      {
  64          global $htsrv_url_sensitive, $baseurl, $admin_url, $rsc_url, $Blog;
  65          global $app_shortname, $app_version;
  66  
  67          $r = '
  68          <div id="header">'
  69  
  70              // Display MAIN menu:

  71              .$this->get_html_menu().'
  72          </div>
  73          ';
  74  
  75          return $r;
  76      }
  77  
  78  
  79      /**

  80       *

  81       *

  82       * @return string

  83       */
  84  	function get_body_top()
  85      {
  86          global $Messages;
  87  
  88          $r = '<div class="wrapper">';
  89  
  90          $r .= $this->get_page_head();
  91  
  92          $r .= $this->get_bloglist_buttons( '', '' );
  93  
  94          $r .= '<div class="panelbody">'
  95              ."\n\n";
  96  
  97          // Display info & error messages

  98          $r .= $Messages->display( NULL, NULL, false, 'all', NULL, NULL, 'action_messages' );
  99  
 100          return $r;
 101      }
 102  
 103      /**

 104       * Get the end of the HTML <body>. Close open divs, etc...

 105       *

 106       * @return string

 107       */
 108  	function get_body_bottom()
 109      {
 110          return "\n</div>\n</div>\n";
 111      }
 112  
 113    /**

 114       * Get the footer text

 115       */
 116  	function get_footer_contents()
 117      {
 118          global $app_footer_text, $copyright_text;
 119          global $adminskins_url;
 120  
 121  
 122          $r = '<div class="footer">';
 123  
 124          $r .= '<a href="http://b2evolution.net/" class="footer_logo"><img src="'.$adminskins_url.'chicago/rsc/img/b2evolution-footer-logo-blue-bg.gif" alt="Powered by b2evolution" width="142" height="43" longdesc="http://b2evolution.net/" /></a>';
 125  
 126          $r .= '<div class="copyright">'.$app_footer_text.' &ndash; '.$copyright_text."</div></div>\n\n";
 127  
 128          return $r;
 129      }
 130  
 131      /**

 132       * Get a template by name and depth.

 133       *

 134       * Templates can handle multiple depth levels

 135       *

 136       * This is a method (and not a member array) to allow dynamic generation and T_()

 137       *

 138       * @param string Name of the template ('main', 'sub')

 139       * @param integer Nesting level (start at 0)

 140       * @return array Associative array which defines layout and optionally properties.

 141       */
 142  	function get_template( $name, $depth = 0 )
 143      {
 144          global $rsc_url;
 145  
 146          $pb_begin1 = '<div class="pblock">';
 147          $pb_begin2 = '<div class="pan_left"><div class="pan_right"><div class="pan_top"><div class="pan_tl"><div class="pan"><div class="panelblock">';
 148          $pb_end = '</div></div></div></div></div></div>
 149                                  <div class="pan_bot"><div class="pan_bl"><div class="pan_br"></div></div></div></div>';
 150  
 151          switch( $name )
 152          {
 153              case 'sub':
 154                  // a payload block with embedded submenu

 155                  return array(
 156                          'before' => $pb_begin1
 157                              .'<span style="float:right">$global_icons$</span>'
 158                              .'<table class="tabs" cellspacing="0"><tr>'
 159                              .'<td class="first"></td>',
 160  
 161                          'after' => '<td class="last"></td>'
 162                              ."</tr></table>\n"
 163                              .$pb_begin2,
 164  
 165                          'empty' => $pb_begin1.$pb_begin2,
 166  
 167                          'beforeEach' => '<td class="option">',
 168                          'afterEach'  => '</td>',
 169                          'beforeEachSel' => '<td class="current">',
 170                          'afterEachSel' => '</td>',
 171  
 172                          'end' => $pb_end, // used to end payload block that opened submenu
 173                      );
 174  
 175  
 176              case 'block':
 177                  // an additional payload block, anywhere after the one with the submenu. Used by disp_payload_begin()/disp_payload_end()

 178                  return array(
 179                          'begin' => $pb_begin1.$pb_begin2,
 180                          'end' => $pb_end,
 181                      );
 182  
 183  
 184              case 'Results':
 185                  // Results list:

 186                  return array(
 187                      'page_url' => '', // All generated links will refer to the current page
 188                      'before' => '<div class="results">',
 189                      'header_start' => '<div class="results_nav">',
 190                          'header_text' => '<strong>'.T_('Pages').'</strong>: $prev$ $first$ $list_prev$ $list$ $list_next$ $last$ $next$',
 191                          'header_text_single' => '',
 192                      'header_end' => '</div>',
 193                      'list_start' => '',
 194                          'head_start' => '',
 195                              'head_title' => '<div class="fieldset_title"><div class="fieldset_title_right"><div class="fieldset_title_bg">
 196                                                                      <span style="float:right">$global_icons$</span>$title$
 197                                                                  </div></div></div>'
 198                                                              ."\n\n"
 199                                                              .'<table class="grouped" cellspacing="0">'
 200                                              ."\n<thead>\n",
 201                              'filters_start' => '<tr class="filters"><td colspan="$nb_cols$">',
 202                              'filters_end' => '</td></tr>',
 203                              'line_start_head' => '<tr>',  // TODO: fusionner avec colhead_start_first; mettre a jour admin_UI_general; utiliser colspan="$headspan$"
 204                              'colhead_start' => '<th $class_attrib$>',
 205                              'colhead_start_first' => '<th class="firstcol $class$">',
 206                              'colhead_start_last' => '<th class="lastcol $class$">',
 207                              'colhead_end' => "</th>\n",
 208                              'sort_asc_off' => '<img src="../admin/img/grey_arrow_up.gif" alt="A" title="'.T_('Ascending order')
 209                                                  .'" height="12" width="11" />',
 210                              'sort_asc_on' => '<img src="../admin/img/black_arrow_up.gif" alt="A" title="'.T_('Ascending order')
 211                                                  .'" height="12" width="11" />',
 212                              'sort_desc_off' => '<img src="../admin/img/grey_arrow_down.gif" alt="D" title="'.T_('Descending order')
 213                                                  .'" height="12" width="11" />',
 214                              'sort_desc_on' => '<img src="../admin/img/black_arrow_down.gif" alt="D" title="'.T_('Descending order')
 215                                                  .'" height="12" width="11" />',
 216                              'basic_sort_off' => '',
 217                              'basic_sort_asc' => get_icon( 'ascending' ),
 218                              'basic_sort_desc' => get_icon( 'descending' ),
 219                          'head_end' => "</thead>\n\n",
 220                          'tfoot_start' => "<tfoot>\n",
 221                          'tfoot_end' => "</tfoot>\n\n",
 222                          'body_start' => "<tbody>\n",
 223                              'line_start' => '<tr class="even">'."\n",
 224                              'line_start_odd' => '<tr class="odd">'."\n",
 225                              'line_start_last' => '<tr class="even lastline">'."\n",
 226                              'line_start_odd_last' => '<tr class="odd lastline">'."\n",
 227                                  'col_start' => '<td $class_attrib$>',
 228                                  'col_start_first' => '<td class="firstcol $class$">',
 229                                  'col_start_last' => '<td class="lastcol $class$">',
 230                                  'col_end' => "</td>\n",
 231                              'line_end' => "</tr>\n\n",
 232                              'grp_line_start' => '<tr class="group">'."\n",
 233                              'grp_line_start_odd' => '<tr class="odd">'."\n",
 234                              'grp_line_start_last' => '<tr class="lastline">'."\n",
 235                              'grp_line_start_odd_last' => '<tr class="odd lastline">'."\n",
 236                                          'grp_col_start' => '<td $class_attrib$ $colspan_attrib$>',
 237                                          'grp_col_start_first' => '<td class="firstcol $class$" $colspan_attrib$>',
 238                                          'grp_col_start_last' => '<td class="lastcol $class$" $colspan_attrib$>',
 239                                  'grp_col_end' => "</td>\n",
 240                              'grp_line_end' => "</tr>\n\n",
 241                          'body_end' => "</tbody>\n\n",
 242                          'total_line_start' => '<tr class="total">'."\n",
 243                              'total_col_start' => '<td $class_attrib$>',
 244                              'total_col_start_first' => '<td class="firstcol $class$">',
 245                              'total_col_start_last' => '<td class="lastcol $class$">',
 246                              'total_col_end' => "</td>\n",
 247                          'total_line_end' => "</tr>\n\n",
 248                      'list_end' => "</table>\n\n",
 249                      'footer_start' => '<div class="results_nav">',
 250                      'footer_text' => '<strong>'.T_('Pages').'</strong>: $prev$ $first$ $list_prev$ $list$ $list_next$ $last$ $next$'
 251                                        /* T_('Page $scroll_list$ out of $total_pages$   $prev$ | $next$<br />'. */

 252                                        /* '<strong>$total_pages$ Pages</strong> : $prev$ $list$ $next$' */

 253                                        /* .' <br />$first$  $list_prev$  $list$  $list_next$  $last$ :: $prev$ | $next$') */,
 254                      'footer_text_single' => '',
 255                      'footer_text_no_limit' => '', // Text if theres no LIMIT and therefor only one page anyway
 256                          'prev_text' => T_('Previous'),
 257                          'next_text' => T_('Next'),
 258                          'no_prev_text' => '',
 259                          'no_next_text' => '',
 260                          'list_prev_text' => T_('...'),
 261                          'list_next_text' => T_('...'),
 262                          'list_span' => 11,
 263                          'scroll_list_range' => 5,
 264                      'footer_end' => "</div>\n\n",
 265                      'no_results_start' => '<div class="fieldset_title"><div class="fieldset_title_right"><div class="fieldset_title_bg">
 266                                                                          <span style="float:right">$global_icons$</span>$title$
 267                                                                      </div></div></div>'
 268                                                                  ."\n\n"
 269                                                                  .'<table class="grouped" cellspacing="0">'
 270                                                  ."\n"
 271                                                  .'<tr class="lastline"><td class="firstcol lastcol">',
 272                      'no_results_end'   => '</td></tr>'
 273                                                  .'</table>'."\n\n",
 274                  'after' => '</div>',
 275                  'sort_type' => 'basic'
 276                  );
 277  
 278  
 279              case 'compact_form':
 280                  // Default Form settings:

 281                  return array(
 282                      'layout' => 'chicago',        // Temporary dirty hack
 283                      'formstart' => '<div class="fieldset_title"><div class="fieldset_title_right">',
 284  
 285                      'title_fmt' => '<div class="fieldset_title_bg" $title_attribs$><span style="float:right">$global_icons$</span>$title$</div></div></div><fieldset>'."\n",
 286                      'no_title_fmt' => '<div class="fieldset_title_bg" $title_attribs$><span style="float:right">$global_icons$</span>&nbsp;</div></div></div><fieldset>'."\n",
 287                      'fieldset_begin' => '<h2 $title_attribs$>$fieldset_title$</h2>',
 288                      'fieldset_end' => '',
 289                      'fieldstart' => '<fieldset $ID$>'."\n",
 290                      'labelstart' => '<div class="label">',
 291                      'labelend' => "</div>\n",
 292                      'labelempty' => '<div class="label"></div>', // so that IE6 aligns DIV.input correcctly
 293                      'inputstart' => '<div class="input">',
 294                      'infostart' => '<div class="info">',
 295                      'inputend' => "</div>\n",
 296                      'fieldend' => "</fieldset>\n\n",
 297                      'buttonsstart' => '<fieldset><div class="input">',
 298                      'buttonsend' => "</div></fieldset>\n\n",
 299                      'formend' => '</fieldset>'."\n",
 300                  );
 301  
 302  
 303              case 'Form':
 304                  // Default Form settings:

 305                  return array(
 306                      'layout' => 'chicago',        // Temporary dirty hack
 307                      'formstart' => '',
 308                      'title_fmt' => '<span style="float:right">$global_icons$</span><h2>$title$</h2>'."\n",
 309                      'no_title_fmt' => '<span style="float:right">$global_icons$</span>'."\n",
 310                      'fieldstart' => '<fieldset $ID$>'."\n",
 311                      'fieldset_begin' => '<div class="fieldset_title"><div class="fieldset_title_right">
 312                                                                  <div class="fieldset_title_bg" $title_attribs$>$fieldset_title$</div></div></div>
 313                                                                  <fieldset $fieldset_attribs$>'."\n",
 314                      'fieldset_end' => '</fieldset>'."\n",
 315                      'labelstart' => '<div class="label">',
 316                      'labelend' => "</div>\n",
 317                      'labelempty' => '<div class="label"></div>', // so that IE6 aligns DIV.input correcctly
 318                      'inputstart' => '<div class="input">',
 319                      'infostart' => '<div class="info">',
 320                      'inputend' => "</div>\n",
 321                      'fieldend' => "</fieldset>\n\n",
 322                      'buttonsstart' => '<fieldset><div class="input">',
 323                      'buttonsend' => "</div></fieldset>\n\n",
 324                      'formend' => '',
 325                  );
 326  
 327  
 328              case 'file_browser':
 329                  return array(
 330                          'block_start' => '<div class="block_item_wrap"><div class="fieldset_title"><div class="fieldset_title_right"><div class="fieldset_title_bg">
 331                                                                          <span style="float:right">$global_icons$</span>$title$
 332                                                                      </div></div></div>',
 333                          'block_end' => '</div>',
 334                      );
 335  
 336              case 'block_item':
 337                  return array(
 338                          'block_start' => '<div class="block_item_wrap"><div class="fieldset_title"><div class="fieldset_title_right"><div class="fieldset_title_bg">
 339                                                                          <span style="float:right">$global_icons$</span>$title$
 340                                                                      </div></div></div>
 341                                                                      <div class="block_item">',
 342                          'block_end' => '</div></div>',
 343                      );
 344  
 345              case 'side_item':
 346                  return array(
 347                          'block_start' => '<div class="browse_side_item_wrap"><div class="fieldset_title"><div class="fieldset_title_right"><div class="fieldset_title_bg">
 348                                                                          <span style="float:right">$global_icons$</span>$title$
 349                                                                      </div></div></div>
 350                                                                      <div class="browse_side_item">',
 351                          'block_end' => '</div></div>',
 352                      );
 353  
 354              default:
 355                  // Delegate to parent class:

 356                  return parent::get_template( $name, $depth );
 357          }
 358      }
 359  }
 360  ?>


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