b2evolution PHP Cross Reference Blogging Systems

Source: /inc/widgets/widgets/_colls_list_owner.widget.php - 151 lines - 4013 bytes - Summary - Text - Print

Description: This file implements the colls_list_owner Widget 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 colls_list_owner Widget 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   *
  10   * {@internal License choice
  11   * - If you have received this file as part of a package, please find the license.txt file in
  12   *   the same folder or the closest folder above for complete license terms.
  13   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  14   *   then you must choose one of the following licenses before using the file:
  15   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  16   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  17   * }}
  18   *
  19   * @package evocore
  20   *
  21   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  22   * @author fplanque: Francois PLANQUE.
  23   *
  24   * @version $Id: _colls_list_owner.widget.php 6136 2014-03-08 07:59:48Z manuel $
  25   */
  26  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  27  
  28  load_class( 'widgets/model/_widget.class.php', 'ComponentWidget' );
  29  
  30  /**
  31   * ComponentWidget Class
  32   *
  33   * A ComponentWidget is a displayable entity that can be placed into a Container on a web page.
  34   *
  35   * @package evocore
  36   */
  37  class colls_list_owner_Widget extends ComponentWidget
  38  {
  39      /**
  40       * Constructor
  41       */
  42  	function colls_list_owner_Widget( $db_row = NULL )
  43      {
  44          // Call parent constructor:
  45          parent::ComponentWidget( $db_row, 'core', 'colls_list_owner' );
  46      }
  47  
  48  
  49      /**
  50       * Get name of widget
  51       */
  52  	function get_name()
  53      {
  54          return T_('Same owner\'s blog list');
  55      }
  56  
  57  
  58      /**
  59       * Get a very short desc. Used in the widget list.
  60       */
  61  	function get_short_desc()
  62      {
  63          return format_to_output($this->disp_params['title']);
  64      }
  65  
  66  
  67    /**
  68       * Get short description
  69       */
  70  	function get_desc()
  71      {
  72          return T_('Display list of all blogs owned by the same user.');
  73      }
  74  
  75  
  76    /**
  77     * Get definitions for editable params
  78     *
  79       * @see Plugin::GetDefaultSettings()
  80       * @param local params like 'for_editing' => true
  81       */
  82  	function get_param_definitions( $params )
  83      {
  84          global $use_strict;
  85          $r = array_merge( array(
  86                  'title' => array(
  87                      'label' => T_( 'Title' ),
  88                      'size' => 40,
  89                      'note' => T_( 'This is the title to display, $icon$ will be replaced by the feed icon' ),
  90                      'defaultvalue' => T_('My blogs'),
  91                  ),
  92                  'order_by' => array(
  93                      'label' => T_('Order by'),
  94                      'note' => T_('How to sort the blogs'),
  95                      'type' => 'select',
  96                      'options' => get_coll_sort_options(),
  97                      'defaultvalue' => 'ID',
  98                  ),
  99                  'order_dir' => array(
 100                      'label' => T_('Direction'),
 101                      'note' => T_('How to sort the blogs'),
 102                      'type' => 'radio',
 103                      'options' => array( array( 'ASC', T_('Ascending') ),
 104                                          array( 'DESC', T_('Descending') ) ),
 105                      'defaultvalue' => 'ASC',
 106                  ),
 107                  /* 3.3? this is borked
 108                  'list_type' => array(
 109                      'label' => T_( 'Display type' ),
 110                      'type' => 'select',
 111                      'defaultvalue' => 'list',
 112                      'options' => array( 'list' => T_('List'), 'form' => T_('Select menu') ),
 113                      'note' => T_( 'How do you want to display blogs?' ),
 114                  ),
 115                  */
 116              ), parent::get_param_definitions( $params )    );
 117  
 118          return $r;
 119      }
 120  
 121  
 122      /**
 123       * Display the widget!
 124       *
 125       * @param array MUST contain at least the basic display params
 126       */
 127  	function display( $params )
 128      {
 129          $this->init_display( $params );
 130  
 131          $this->disp_coll_list( 'owner', $this->disp_params['order_by'], $this->disp_params['order_dir'] );
 132  
 133          return true;
 134      }
 135  
 136  
 137      /**
 138       * Maybe be overriden by some widgets, depending on what THEY depend on..
 139       *
 140       * @return array of keys this widget depends on
 141       */
 142  	function get_cache_keys()
 143      {
 144          return array(
 145                  'wi_ID'   => $this->ID,                    // Have the widget settings changed ?
 146                  'set_coll_ID' =>'any',                     // Have the settings of ANY blog changed ? (ex: new skin here, new name on another)
 147              );
 148      }
 149  }
 150  
 151  ?>

title

Description

title

Description

title

Description

title

title

Body