b2evolution PHP Cross Reference Blogging Systems

Source: /inc/skins/model/_skin.class.php - 833 lines - 22783 bytes - Summary - Text - Print

Description: This file implements the Skin class. 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 implements the Skin class.
   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   * @package evocore
  21   *
  22   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  23   * @author fplanque: Francois PLANQUE.
  24   *
  25   * @version $Id: _skin.class.php 6136 2014-03-08 07:59:48Z manuel $
  26   */
  27  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  28  
  29  
  30  load_class( '_core/model/dataobjects/_dataobject.class.php', 'DataObject' );
  31  
  32  
  33  /**
  34   * Skin Class
  35   *
  36   * @package evocore
  37   */
  38  class Skin extends DataObject
  39  {
  40      var $name;
  41      var $folder;
  42      var $type;
  43  
  44      /**
  45       * Lazy filled.
  46       * @var array
  47       */
  48      var $container_list = NULL;
  49  
  50      /**
  51       * The translations keyed by locale. They get loaded through include() of _global.php.
  52       * @see Skin::T_()
  53       * @var array
  54       */
  55      var $_trans = array();
  56  
  57  
  58      /**
  59       * Constructor
  60       *
  61       * @param table Database row
  62       */
  63  	function Skin( $db_row = NULL, $skin_folder = NULL )
  64      {
  65          // Call parent constructor:
  66          parent::DataObject( 'T_skins__skin', 'skin_', 'skin_ID' );
  67  
  68          $this->delete_restrictions = array(
  69                  array( 'table'=>'T_coll_settings', 'fk'=>'cset_value', 'msg'=>T_('%d blogs using this skin'), 
  70                          'and_condition' => '( cset_name = "normal_skin_ID" OR cset_name = "mobile_skin_ID" OR cset_name = "tablet_skin_ID" )' ),
  71                  array( 'table'=>'T_settings', 'fk'=>'set_value', 'msg'=>T_('This skin is set as default skin.'), 
  72                          'and_condition' => '( set_name = "def_normal_skin_ID" OR set_name = "def_mobile_skin_ID" OR set_name = "def_tablet_skin_ID" )' ),
  73              );
  74  
  75          $this->delete_cascades = array(
  76                  array( 'table'=>'T_skins__container', 'fk'=>'sco_skin_ID', 'msg'=>T_('%d linked containers') ),
  77              );
  78  
  79          if( is_null($db_row) )
  80          {    // We are creating an object here:
  81              $this->set( 'folder', $skin_folder );
  82              $this->set( 'name', $this->get_default_name() );
  83              $this->set( 'type', $this->get_default_type() );
  84          }
  85          else
  86          {    // Wa are loading an object:
  87              $this->ID = $db_row->skin_ID;
  88              $this->name = $db_row->skin_name;
  89              $this->folder = $db_row->skin_folder;
  90              $this->type = $db_row->skin_type;
  91          }
  92      }
  93  
  94  
  95      /**
  96       * Install current skin to DB
  97       */
  98  	function install()
  99      {
 100          // Look for containers in skin file:
 101          $this->discover_containers();
 102  
 103          // INSERT NEW SKIN INTO DB:
 104          $this->dbinsert();
 105      }
 106  
 107  
 108      /**
 109       * Get default name for the skin.
 110       * Note: the admin can customize it.
 111       */
 112  	function get_default_name()
 113      {
 114          return $this->folder;
 115      }
 116  
 117  
 118      /**
 119       * Get default type for the skin.
 120       */
 121  	function get_default_type()
 122      {
 123          return (substr($this->folder,0,1) == '_' ? 'feed' : 'normal');
 124      }
 125  
 126  
 127      /**
 128       * Get the customized name for the skin.
 129       */
 130  	function get_name()
 131      {
 132          return $this->name;
 133      }
 134  
 135  
 136      /**
 137       * Load data from Request form fields.
 138       *
 139       * @return boolean true if loaded data seems valid.
 140       */
 141  	function load_from_Request()
 142      {
 143          // Name
 144          param_string_not_empty( 'skin_name', T_('Please enter a name.') );
 145          $this->set_from_Request( 'name' );
 146  
 147          // Skin type
 148          param( 'skin_type', 'string' );
 149          $this->set_from_Request( 'type' );
 150  
 151          return ! param_errors_detected();
 152      }
 153  
 154  
 155      /**
 156       * Load params
 157       */
 158  	function load_params_from_Request()
 159      {
 160          load_funcs('plugins/_plugin.funcs.php');
 161  
 162          // Loop through all widget params:
 163          foreach( $this->get_param_definitions( array('for_editing'=>true) ) as $parname => $parmeta )
 164          {
 165              if( isset( $parmeta['type'] ) && $parmeta['type'] == 'color' && empty( $parmeta['valid_pattern'] ) )
 166              { // Set default validation for color fields
 167                  $parmeta['valid_pattern'] = array(
 168                          'pattern' => '~^(#([a-f0-9]{3}){1,2})?$~i',
 169                          'error'   => T_('Invalid color code.')
 170                      );
 171              }
 172              autoform_set_param_from_request( $parname, $parmeta, $this, 'Skin' );
 173          }
 174      }
 175  
 176  
 177      /**
 178       * Display a container
 179       *
 180       * @todo fp> if it doesn't get any skin specific, move it outta here! :P
 181       * fp> Do we need Skin objects in the frontoffice at all? -- Do we want to include the dispatcher into the Skin object? WARNING: globals
 182       * fp> We might want to customize the container defaults. -- Per blog or per skin?
 183       *
 184       * @param string
 185       * @param array
 186       */
 187  	function container( $sco_name, $params = array() )
 188      {
 189          /**
 190           * Blog currently displayed
 191           * @var Blog
 192           */
 193          global $Blog;
 194          global $admin_url, $rsc_url;
 195          global $Timer;
 196  
 197          $timer_name = 'skin_container('.$sco_name.')';
 198          $Timer->start($timer_name);
 199  
 200          if( false )
 201          {    // DEBUG:
 202              echo '<div class="debug_container">';
 203              echo '<div class="debug_container_name"><span class="debug_container_action"><a href="'
 204                          .$admin_url.'?ctrl=widgets&amp;blog='.$Blog->ID.'">Edit</a></span>'.$sco_name.'</div>';
 205          }
 206  
 207          /**
 208           * @var EnabledWidgetCache
 209           */
 210          $EnabledWidgetCache = & get_EnabledWidgetCache();
 211          $Widget_array = & $EnabledWidgetCache->get_by_coll_container( $Blog->ID, $sco_name );
 212  
 213          if( !empty($Widget_array) )
 214          {
 215              foreach( $Widget_array as $ComponentWidget )
 216              {    // Let the Widget display itself (with contextual params):
 217                  $widget_timer_name = 'Widget->display('.$ComponentWidget->code.')';
 218                  $Timer->start($widget_timer_name);
 219                  $ComponentWidget->display_with_cache( $params, array(
 220                          // 'sco_name' => $sco_name, // fp> not sure we need that for now
 221                      ) );
 222                  $Timer->pause($widget_timer_name);
 223              }
 224          }
 225  
 226          if( false )
 227          {    // DEBUG:
 228              echo get_icon( 'pixel', 'imgtag', array( 'class' => 'clear' ) );
 229              echo '</div>';
 230          }
 231  
 232          $Timer->pause($timer_name);
 233      }
 234  
 235  
 236      /**
 237       * Discover containers included in skin files
 238       */
 239  	function discover_containers()
 240      {
 241          global $skins_path, $Messages;
 242  
 243          $this->container_list = array();
 244  
 245          if( ! $dir = @opendir($skins_path.$this->folder) )
 246          {    // Skin directory not found!
 247              $Messages->add( 'Cannot open skin directory.', 'error' ); // No trans
 248              return false;
 249          }
 250  
 251          // Go through all files in the skin directory:
 252          while( ( $file = readdir($dir) ) !== false )
 253          {
 254              $rf_main_subpath = $this->folder.'/'.$file;
 255              $af_main_path = $skins_path.$rf_main_subpath;
 256  
 257              if( !is_file( $af_main_path ) || ! preg_match( '~\.php$~', $file ) )
 258              { // Not a php template file, go to next:
 259                  continue;
 260              }
 261  
 262              if( ! is_readable($af_main_path) )
 263              {    // Cannot open PHP file:
 264                  $Messages->add( sprintf( T_('Cannot read skin file &laquo;%s&raquo;!'), $rf_main_subpath ), 'error' );
 265                  continue;
 266              }
 267  
 268              $file_contents = @file_get_contents( $af_main_path );
 269              if( ! is_string($file_contents) )
 270              {    // Cannot get contents:
 271                  $Messages->add( sprintf( T_('Cannot read skin file &laquo;%s&raquo;!'), $rf_main_subpath ), 'error' );
 272                  continue;
 273              }
 274  
 275              // DETECT if the file contains containers:
 276              // if( ! preg_match_all( '~ \$Skin->container\( .*? (\' (.+?) \' )|(" (.+?) ") ~xmi', $file_contents, $matches ) )
 277              if( ! preg_match_all( '~ (\$Skin->|skin_)container\( .*? ((\' (.+?) \')|(" (.+?) ")) ~xmi', $file_contents, $matches ) )
 278              {    // No containers in this file, go to next:
 279                  continue;
 280              }
 281  
 282              // Merge matches from the two regexp parts (due to regexp "|" )
 283              $container_list = array_merge( $matches[4], $matches[6] );
 284  
 285              $c = 0;
 286              foreach( $container_list as $container )
 287              {
 288                  if( empty($container) )
 289                  {    // regexp empty match -- NOT a container:
 290                      continue;
 291                  }
 292  
 293                  // We have one more container:
 294                  $c++;
 295  
 296                  if( in_array( $container, $this->container_list ) )
 297                  {    // we already have that one
 298                      continue;
 299                  }
 300  
 301                  $this->container_list[] = $container;
 302              }
 303  
 304              if( $c )
 305              {
 306                  $Messages->add( sprintf( T_('%d containers have been found in skin template &laquo;%s&raquo;.'), $c, $rf_main_subpath ), 'success' );
 307              }
 308          }
 309  
 310          // pre_dump( $this->container_list );
 311  
 312          if( empty($this->container_list) )
 313          {
 314              $Messages->add( T_('No containers found in this skin!'), 'error' );
 315              return false;
 316          }
 317  
 318          return true;
 319      }
 320  
 321  
 322      /**
 323       * Get the list of containers that have been previously discovered for this skin.
 324       *
 325       * @return array
 326       */
 327  	function get_containers()
 328      {
 329          /**
 330           * @var DB
 331           */
 332          global $DB;
 333  
 334          if( is_null( $this->container_list ) )
 335          {
 336              $this->container_list = $DB->get_col(
 337                  'SELECT sco_name
 338                       FROM T_skins__container
 339                      WHERE sco_skin_ID = '.$this->ID, 0, 'get list of containers for skin' );
 340          }
 341  
 342          return $this->container_list;
 343      }
 344  
 345  
 346      /**
 347       * Update the DB based on previously recorded changes
 348       *
 349       * @return boolean true
 350       */
 351  	function dbupdate()
 352      {
 353          global $DB;
 354  
 355          $DB->begin();
 356  
 357          if( parent::dbupdate() !== false )
 358          {    // Skin updated, also save containers:
 359              $this->db_save_containers();
 360          }
 361  
 362          $DB->commit();
 363  
 364          return true;
 365      }
 366  
 367  
 368      /**
 369       * Insert object into DB based on previously recorded changes.
 370       *
 371       * @return boolean true
 372       */
 373  	function dbinsert()
 374      {
 375          global $DB;
 376  
 377          $DB->begin();
 378  
 379          if( parent::dbinsert() )
 380          {    // Skin saved, also save containers:
 381              $this->db_save_containers();
 382          }
 383  
 384          $DB->commit();
 385  
 386          return true;
 387      }
 388  
 389  
 390      /**
 391       * Save containers
 392       *
 393       * to be called by dbinsert / dbupdate
 394       */
 395  	function db_save_containers()
 396      {
 397          global $DB;
 398  
 399          // Get a list of all currently empty containers:
 400          $sql = 'SELECT sco_name
 401                            FROM T_skins__container LEFT JOIN T_widget ON ( sco_name = wi_sco_name )
 402                           WHERE sco_skin_ID = '.$this->ID.'
 403                           GROUP BY sco_name
 404                          HAVING COUNT(wi_ID) = 0';
 405          $empty_containers_list = $DB->get_col( $sql, 0, 'Get empty containers' );
 406          //pre_dump( $empty_containers_list );
 407  
 408          // Look for containers in skin file:
 409          $this->discover_containers();
 410  
 411          // Delete empty containers:
 412          foreach( $empty_containers_list as $empty_container )
 413          {
 414              if( !in_array( $empty_container, $this->container_list ) )
 415              {    // This container has been removed from the skin + it's empty, so delete it from DB:
 416                  $DB->query( 'DELETE FROM T_skins__container
 417                                      WHERE sco_name = '.$DB->quote($empty_container) );
 418              }
 419          }
 420  
 421          // Make sure new containers are added:
 422          if( ! empty( $this->container_list ) )
 423          {
 424              $values = array();
 425              foreach( $this->container_list as $container_name )
 426              {
 427                  $values [] = '( '.$this->ID.', '.$DB->quote($container_name).' )';
 428              }
 429  
 430              $DB->query( 'REPLACE INTO T_skins__container( sco_skin_ID, sco_name )
 431                                          VALUES '.implode( ',', $values ), 'Insert containers' );
 432          }
 433      }
 434  
 435  
 436      /**
 437       * Display skinshot for skin folder in various places.
 438       *
 439       * Including for NON installed skins.
 440       *
 441       * @static
 442       */
 443  	function disp_skinshot( $skin_folder, $skin_name, $disp_params = array() )
 444      {
 445          global $skins_path, $skins_url;
 446  
 447          $disp_params = array_merge( array(
 448                  'selected'       => false,
 449                  'skinshot_class' => 'skinshot',
 450              ), $disp_params );
 451  
 452          if( isset( $disp_params[ 'select_url' ] ) )
 453          {
 454              $select_a_begin = '<a href="'.$disp_params[ 'select_url' ].'" title="'.T_('Select this skin!').'">';
 455              $select_a_end = '</a>';
 456          }
 457          elseif( isset( $disp_params[ 'function_url' ] ) )
 458          {
 459              $select_a_begin = '<a href="'.$disp_params[ 'function_url' ].'" title="'.T_('Install NOW!').'">';
 460              $select_a_end = '</a>';
 461          }
 462          else
 463          {
 464              $select_a_begin = '';
 465              $select_a_end = '';
 466          }
 467  
 468          echo '<div class="'.$disp_params[ 'skinshot_class' ].'">';
 469          echo '<div class="skinshot_placeholder';
 470          if( $disp_params[ 'selected' ] )
 471          {
 472              echo ' current';
 473          }
 474          echo '">';
 475          if( file_exists( $skins_path.$skin_folder.'/skinshot.png' ) )
 476          {
 477              echo $select_a_begin;
 478              echo '<img src="'.$skins_url.$skin_folder.'/skinshot.png" width="240" height="180" alt="'.$skin_folder.'" />';
 479              echo $select_a_end;
 480          }
 481          elseif( file_exists( $skins_path.$skin_folder.'/skinshot.jpg' ) )
 482          {
 483              echo $select_a_begin;
 484              echo '<img src="'.$skins_url.$skin_folder.'/skinshot.jpg" width="240" height="180" alt="'.$skin_folder.'" />';
 485              echo $select_a_end;
 486          }
 487          elseif( file_exists( $skins_path.$skin_folder.'/skinshot.gif' ) )
 488          {
 489              echo $select_a_begin;
 490              echo '<img src="'.$skins_url.$skin_folder.'/skinshot.gif" width="240" height="180" alt="'.$skin_folder.'" />';
 491              echo $select_a_end;
 492          }
 493          else
 494          {
 495              echo '<div class="skinshot_noshot">'.T_('No skinshot available for').'</div>';
 496              echo '<div class="skinshot_name">'.$select_a_begin.$skin_folder.$select_a_end.'</div>';
 497          }
 498          echo '</div>';
 499          echo '<div class="legend">';
 500          if( isset( $disp_params[ 'function' ] ) && isset( $disp_params[ 'function_url' ] ) )
 501          {
 502              echo '<div class="actions">';
 503              switch( $disp_params[ 'function' ] )
 504              {
 505                  case 'install':
 506                      echo '<a href="'.$disp_params[ 'function_url' ].'" title="'.T_('Install NOW!').'">';
 507                      echo T_('Install NOW!').'</a>';
 508                      break;
 509  
 510                  case 'select':
 511                      echo '<a href="'.$disp_params[ 'function_url' ].'" target="_blank" title="'.T_('Preview blog with this skin in a new window').'">';
 512                      echo T_('Preview').'</a>';
 513                      break;
 514              }
 515              echo '</div>';
 516          }
 517          echo '<strong>'.$skin_name.'</strong>';
 518          echo '</div>';
 519          echo '</div>';
 520      }
 521  
 522  
 523      /**
 524       * Get definitions for editable params
 525       *
 526       * @todo this is destined to be overridden by derived Skin classes
 527       *
 528       * @see Plugin::GetDefaultSettings()
 529       * @param local params like 'for_editing' => true
 530       */
 531  	function get_param_definitions( $params )
 532      {
 533          $r = array();
 534  
 535          return $r;
 536      }
 537  
 538  
 539      /**
 540        * Get a skin specific param value from current Blog
 541        *
 542       */
 543  	function get_setting( $parname )
 544      {
 545          /**
 546           * @var Blog
 547           */
 548          global $Blog;
 549  
 550          // Name of the setting in the blog settings:
 551          $blog_setting_name = 'skin'.$this->ID.'_'.$parname;
 552  
 553          $value = $Blog->get_setting( $blog_setting_name );
 554  
 555          if( ! is_null( $value ) )
 556          {    // We have a value for this param:
 557              return $value;
 558          }
 559  
 560          // Try default values:
 561          $params = $this->get_param_definitions( NULL );
 562          if( isset( $params[$parname]['defaultvalue'] ) )
 563          {    // We ahve a default value:
 564              return $params[$parname]['defaultvalue'] ;
 565          }
 566  
 567          return NULL;
 568      }
 569  
 570  
 571      /**
 572       * Get current skin post navigation setting.
 573       * Possible values:
 574       *    - NULL - In this case the Blog post navigation setting will be used
 575       *    - 'same_category' - to always navigate through the same category in this skin
 576       *    - 'same_author' - to always navigate through the same authors in this skin
 577       * 
 578       * Set this to not NULL only if the same post navigation should be used in every Blog where this skin is used
 579       */
 580  	function get_post_navigation()
 581      {
 582          return NULL;
 583      }
 584  
 585  
 586      /**
 587       * Get current skin path
 588       * @return string
 589       */
 590  	function get_path()
 591      {
 592          global $skins_path;
 593  
 594          return trailing_slash($skins_path.$this->folder);
 595      }
 596  
 597  
 598      /**
 599       * Get current skin URL
 600       * @return string
 601       */
 602  	function get_url()
 603      {
 604          global $skins_url;
 605  
 606          return trailing_slash($skins_url.$this->folder);
 607      }
 608  
 609  
 610      /**
 611       * Set a skin specific param value for current Blog
 612       *
 613       * @param string parameter name
 614       * @param mixed parameter value
 615       */
 616  	function set_setting( $parname, $parvalue )
 617      {
 618          /**
 619           * @var Blog
 620           */
 621          global $Blog;
 622  
 623          // Name of the setting in the blog settings:
 624          $blog_setting_name = 'skin'.$this->ID.'_'.$parname;
 625  
 626          $Blog->set_setting( $blog_setting_name, $parvalue );
 627      }
 628  
 629  
 630      /**
 631       * Save skin specific settings for current blgo to DB
 632       */
 633  	function dbupdate_settings()
 634      {
 635          /**
 636           * @var Blog
 637           */
 638          global $Blog;
 639  
 640          $Blog->dbupdate();
 641      }
 642  
 643  
 644      /**
 645       * Get ready for displaying the skin.
 646       *
 647       * This may register some CSS or JS...
 648       */
 649  	function display_init()
 650      {
 651          // Make sure standard CSS is called ahead of custom CSS generated below:
 652          // require_css( 'style.css', true );
 653  
 654          // override in specific skins...
 655      }
 656  
 657  
 658      /**
 659       * Translate a given string, in the Skin's context.
 660       *
 661       * This means, that the translation is obtained from the Skin's
 662       * "locales" folder.
 663       *
 664       * It uses the global/regular {@link T_()} function as a fallback.
 665       *
 666       * @param string The string (english), that should be translated
 667       * @param string Requested locale ({@link $current_locale} gets used by default)
 668       * @return string The translated string.
 669       *
 670       * @uses T_()
 671       * @since 3.2.0 (after beta)
 672       */
 673      function T_( $string, $req_locale = '' )
 674      {
 675          global $skins_path;
 676  
 677          if( ( $return = T_( $string, $req_locale, array(
 678                                  'ext_transarray' => & $this->_trans,
 679                                  'alt_basedir'    => $skins_path.$this->folder,
 680                              ) ) ) == $string )
 681          {    // This skin did not provide a translation - fallback to global T_():
 682              return T_( $string, $req_locale );
 683          }
 684  
 685          return $return;
 686      }
 687  
 688  
 689      /**
 690       * Translate and escape single quotes.
 691       *
 692       * This is to be used mainly for Javascript strings.
 693       *
 694       * @param string String to translate
 695       * @param string Locale to use
 696       * @return string The translated and escaped string.
 697       *
 698       * @uses Skin::T_()
 699       * @since 3.2.0 (after beta)
 700       */
 701  	function TS_( $string, $req_locale = '' )
 702      {
 703          return str_replace( "'", "\\'", $this->T_( $string, $req_locale ) );
 704      }
 705  
 706  
 707      /**
 708       * Those templates are used for example by the messaging screens.
 709       */
 710  	function get_template( $name )
 711      {
 712          switch( $name )
 713          {
 714              case 'Results':
 715                  // Results list:
 716                  return array(
 717                      'page_url' => '', // All generated links will refer to the current page
 718                      'before' => '<div class="results">',
 719                      'content_start' => '<div id="$prefix$ajax_content">',
 720                      'header_start' => '<div class="results_nav">',
 721                          'header_text' => '<strong>'.T_('Pages').'</strong>: $prev$ $first$ $list_prev$ $list$ $list_next$ $last$ $next$',
 722                          'header_text_single' => '',
 723                      'header_end' => '</div>',
 724                      'head_title' => '<div class="title"><span style="float:right">$global_icons$</span>$title$</div>'
 725                                          ."\n",
 726                      'filters_start' => '<div class="filters">',
 727                      'filters_end' => '</div>',
 728                      'list_start' => '<div class="table_scroll">'."\n"
 729                                     .'<table class="grouped" cellspacing="0">'."\n",
 730                          'head_start' => '<thead>'."\n",
 731                              'line_start_head' => '<tr>',  // TODO: fusionner avec colhead_start_first; mettre a jour admin_UI_general; utiliser colspan="$headspan$"
 732                              'colhead_start' => '<th $class_attrib$ $title_attrib$>',
 733                              'colhead_start_first' => '<th class="firstcol $class$" $title_attrib$>',
 734                              'colhead_start_last' => '<th class="lastcol $class$" $title_attrib$>',
 735                              'colhead_end' => "</th>\n",
 736                              'sort_asc_off' => get_icon( 'sort_asc_off' ),
 737                              'sort_asc_on' => get_icon( 'sort_asc_on' ),
 738                              'sort_desc_off' => get_icon( 'sort_desc_off' ),
 739                              'sort_desc_on' => get_icon( 'sort_desc_on' ),
 740                              'basic_sort_off' => '',
 741                              'basic_sort_asc' => get_icon( 'ascending' ),
 742                              'basic_sort_desc' => get_icon( 'descending' ),
 743                          'head_end' => "</thead>\n\n",
 744                          'tfoot_start' => "<tfoot>\n",
 745                          'tfoot_end' => "</tfoot>\n\n",
 746                          'body_start' => "<tbody>\n",
 747                              'line_start' => '<tr class="even">'."\n",
 748                              'line_start_odd' => '<tr class="odd">'."\n",
 749                              'line_start_last' => '<tr class="even lastline">'."\n",
 750                              'line_start_odd_last' => '<tr class="odd lastline">'."\n",
 751                                  'col_start' => '<td $class_attrib$>',
 752                                  'col_start_first' => '<td class="firstcol $class$">',
 753                                  'col_start_last' => '<td class="lastcol $class$">',
 754                                  'col_end' => "</td>\n",
 755                              'line_end' => "</tr>\n\n",
 756                              'grp_line_start' => '<tr class="group">'."\n",
 757                              'grp_line_start_odd' => '<tr class="odd">'."\n",
 758                              'grp_line_start_last' => '<tr class="lastline">'."\n",
 759                              'grp_line_start_odd_last' => '<tr class="odd lastline">'."\n",
 760                                          'grp_col_start' => '<td $class_attrib$ $colspan_attrib$>',
 761                                          'grp_col_start_first' => '<td class="firstcol $class$" $colspan_attrib$>',
 762                                          'grp_col_start_last' => '<td class="lastcol $class$" $colspan_attrib$>',
 763                                  'grp_col_end' => "</td>\n",
 764                              'grp_line_end' => "</tr>\n\n",
 765                          'body_end' => "</tbody>\n\n",
 766                          'total_line_start' => '<tr class="total">'."\n",
 767                              'total_col_start' => '<td $class_attrib$>',
 768                              'total_col_start_first' => '<td class="firstcol $class$">',
 769                              'total_col_start_last' => '<td class="lastcol $class$">',
 770                              'total_col_end' => "</td>\n",
 771                          'total_line_end' => "</tr>\n\n",
 772                      'list_end' => "</table></div>\n\n",
 773                      'footer_start' => '<div class="results_nav nav_footer">',
 774                      'footer_text' => '<strong>'.T_('Pages').'</strong>: $prev$ $first$ $list_prev$ $list$ $list_next$ $last$ $next$'
 775                                        /* T_('Page $scroll_list$ out of $total_pages$   $prev$ | $next$<br />'. */
 776                                        /* '<strong>$total_pages$ Pages</strong> : $prev$ $list$ $next$' */
 777                                        /* .' <br />$first$  $list_prev$  $list$  $list_next$  $last$ :: $prev$ | $next$') */,
 778                      'footer_text_single' => '',
 779                      'footer_text_no_limit' => '', // Text if theres no LIMIT and therefor only one page anyway
 780                          'prev_text' => T_('Previous'),
 781                          'next_text' => T_('Next'),
 782                          'no_prev_text' => '',
 783                          'no_next_text' => '',
 784                          'list_prev_text' => T_('...'),
 785                          'list_next_text' => T_('...'),
 786                          'list_span' => 11,
 787                          'scroll_list_range' => 5,
 788                      'footer_end' => "</div>\n\n",
 789                      'no_results_start' => '<table class="grouped" cellspacing="0">'."\n",
 790                      'no_results_end'   => '<tr class="lastline"><td class="firstcol lastcol">$no_results$</td></tr>'
 791                                            .'</table>'."\n\n",
 792                  'content_end' => '</div>',
 793                  'after' => '</div>',
 794                  'sort_type' => 'basic'
 795                  );
 796  
 797              case 'messages':
 798                  return array(
 799                      'show_only_date' => true,
 800                      'show_columns' => 'login',
 801                  );
 802  
 803              case 'blockspan_form':
 804                  // blockspan Form settings:
 805                  return array(
 806                      'layout' => 'blockspan',        // Temporary dirty hack
 807                      'formstart' => '',
 808                      'title_fmt' => '$title$'."\n", // TODO: icons
 809                      'no_title_fmt' => '',          //           "
 810                      'fieldset_begin' => '<fieldset $fieldset_attribs$>'."\n"
 811                                                              .'<legend $title_attribs$>$fieldset_title$</legend>'."\n",
 812                      'fieldset_end' => '</fieldset>'."\n",
 813                      'fieldstart' => '<span class="block" $ID$>',
 814                      'labelstart' => '',
 815                      'labelend' => "\n",
 816                      'labelempty' => '',
 817                      'inputstart' => '',
 818                      'infostart' => '',
 819                      'inputend' => "\n",
 820                      'fieldend' => '</span>'.get_icon( 'pixel' )."\n",
 821                      'buttonsstart' => '',
 822                      'buttonsend' => "\n",
 823                      'customstart' => '',
 824                      'customend' => "\n",
 825                      'formend' => '',
 826                  );
 827          }
 828  
 829          return array();
 830      }
 831  }
 832  
 833  ?>

title

Description

title

Description

title

Description

title

title

Body