3
* This file implements the linkblog_Widget class.
5
* This file is part of Quam Plures - {@link http://quamplures.net/}
6
* See also {@link https://launchpad.net/quam-plures}.
8
* @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
9
* @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
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
20
* {@internal Below is a list of authors who have contributed to design/coding of this file: }}
21
* @author fplanque: Francois PLANQUE.
25
if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
27
$wiCache = get_Cache('WidgetCache');
28
$wiCache->load_widget( 'item_list' );
31
* linkblog_widget class
33
* This widget displays another blog as a linkblog.
37
class linkblog_Widget extends item_list_Widget
42
function linkblog_Widget( $db_row = NULL )
44
// Call parent constructor:
45
parent::ComponentWidget( $db_row, 'widget', 'linkblog' );
47
$this->widget_name = $this->T_('Simple Linkblog Links list');
48
$this->widget_title = $this->T_('Linkblog');
53
* Get definitions for editable params
55
* @see Plugin::GetDefaultSettings()
56
* @param local params like 'for_editing' => true
58
function get_param_definitions( $params )
60
// This is derived from post_list_Widget, so we DO NOT ADD ANY param here!
61
$r = parent::get_param_definitions( $params );
62
// We only change the defaults and hide some params.
63
$r['title_link']['no_edit'] = true;
64
$r['follow_mainlist']['no_edit'] = true;
65
$r['blog_ID']['defaultvalue'] = 0; // zero is a magic number that we'll use to try and use defaults used in previous versions of B2evo
66
$r['item_group_by']['defaultvalue'] = 'chapter';
67
$r['item_title_link_type']['no_edit'] = true;
68
$r['disp_excerpt']['no_edit'] = true;
69
$r['disp_teaser']['no_edit'] = true;
70
$r['disp_teaser_maxwords']['no_edit'] = true;
71
$r['widget_css_class']['no_edit'] = true;
72
$r['widget_ID']['no_edit'] = true;
79
* Get a very short desc. Used in the widget list.
81
function get_short_desc()
83
return format_to_output($this->disp_params['widget_title']);
88
* Get short description
92
return $this->T_('Simplified Item list for listing links from another blog.');
99
* @param array MUST contain at least the basic display params
101
function display( $params )
105
$this->init_display( $params );
107
// Force some params (because this is a simplified widget):
109
if( $this->disp_params['blog_ID'] == 0 )
110
{ // We want to try and use previous defaults:
111
if( !empty( $this->disp_params['linkblog_ID'] ) )
113
$params['blog_ID'] = $this->disp_params['linkblog_ID'];
116
{ // Recycle the previous value from deprecated links_blog_ID param. We will eventually drop that field from the database.
117
$params['blog_ID'] = $Blog->get('links_blog_ID');
121
parent::display( $params );