3
* This file implements the "Common Navigation Links" widget
5
* @todo (0000): dh> why are "STRONG" tags hardcoded here? can this get
6
* dropped/removed? should the style get adjusted to use font-weight:bold then?
8
* @author {@link http://wonderwinds.com/ Ed Bennett}
9
* @author {@link http://fplanque.net/ Francois PLANQUE}
10
* @copyright (c) 2009 by {@link http://quamplures.net/ the Quam Plures project}
11
* @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
14
if(!defined('QP_MAIN_INIT')) die('fail');
17
* common_links_Widget class
20
class common_links_Widget extends ComponentWidget
25
function common_links_Widget( $db_row = NULL )
27
// Call parent constructor
28
parent::ComponentWidget( $db_row, 'widget', 'common_links' );
29
$this->widget_name = T_('Common Navigation Links');
30
$this->widget_title = '';
35
* Get widget's short description
39
return T_('Display these links: Recently, Archives, Categories, Latest Comments');
45
* @todo (3069): rename this to get_title()
47
function get_short_desc()
49
return format_to_output( $this->disp_params['widget_title'] );
54
* Get definitions for editable params
55
* @see Plugin::GetDefaultSettings()
56
* @param local params like 'for_editing' => true
58
function get_param_definitions( $params )
60
$r = array_merge( array(
61
'show_recently' => array(
62
'label' => T_('Show "Recently"'),
64
'defaultvalue' => '1',
65
'note' => T_('Go to the most recent posts / the blog\'s home.'),
67
'show_archives' => array(
68
'label' => T_('Show "Archives"'),
70
'defaultvalue' => '1',
71
'note' => T_('Go to the monthly/weekly/daily archive list.'),
73
'show_categories' => array(
74
'label' => T_('Show "Categories"'),
76
'defaultvalue' => '1',
77
'note' => T_('Go to the category tree.'),
79
'show_latestcomments' => array(
80
'label' => T_('Show "Latest comments"'),
82
'defaultvalue' => '1',
83
'note' => T_('Go to the latest comments.'),
85
), parent::get_param_definitions( $params ) );
92
* @param array must contain at least the basic display params
94
function display( $params )
98
$this->init_display( $params );
100
echo $this->disp_params['block_start'];
102
echo $this->disp_params['list_start'];
104
if( $this->disp_params['show_recently'] )
106
echo $this->disp_params['item_start'];
107
echo '<strong><a href="'.$Blog->get( 'url' ).'" title="'.T_('visit this blog\'s home page').'">'.T_('Recently').'</a></strong>';
108
echo $this->disp_params['item_end'];
111
if( $this->disp_params['show_archives'] )
113
// @todo (0000): fp> don't display this if archives plugin not installed... or depluginize archives (I'm not sure)
114
echo $this->disp_params['item_start'];
115
echo '<strong><a href="'.$Blog->get( 'arcdirurl' ).'" title="'.T_('visit this blog\'s archives').'">'.T_('Archives').'</a></strong>';
116
echo $this->disp_params['item_end'];
119
if( $this->disp_params['show_categories'] )
121
// @todo (0000): fp> don't display this if categories plugin not installed... or depluginize categories (I'm not sure)
122
echo $this->disp_params['item_start'];
123
echo '<strong><a href="'.$Blog->get( 'catdirurl' ).'" title="'.T_('visit this blog\'s categories').'">'.T_('Categories').'</a></strong>';
124
echo $this->disp_params['item_end'];
127
if( $this->disp_params['show_latestcomments'] )
129
echo $this->disp_params['item_start'];
130
echo '<strong><a href="'.$Blog->get( 'lastcommentsurl' ).'" title="'.T_('see this blog\'s latest comments').'">'.T_('Latest comments').'</a></strong>';
131
echo $this->disp_params['item_end'];
134
echo $this->disp_params['list_end'];
135
echo $this->disp_params['block_end'];