~quam-plures-core/quam-plures/qp5_colls-blogs_chaps-cats

« back to all changes in this revision

Viewing changes to qp_inc/widgets/_title.widget.php

http://forums.quamplures.net/viewtopic.php?p=9237#p9237

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * This file implements the "Blog title" widget
 
4
 *
 
5
 * @author {@link http://wonderwinds.com/ Ed Bennett}
 
6
 * @author {@link http://fplanque.net/ Francois PLANQUE}
 
7
 * @copyright (c) 2009 by {@link http://quamplures.net/ the Quam Plures project}
 
8
 * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
 
9
 * @package widgets
 
10
 */
 
11
if(!defined('QP_MAIN_INIT')) die('fail');
 
12
 
 
13
/**
 
14
 * title_Widget class
 
15
 * @package widgets
 
16
 */
 
17
class title_Widget extends ComponentWidget
 
18
{
 
19
        /**
 
20
         * Constructor
 
21
         */
 
22
        function title_Widget( $db_row = NULL )
 
23
        {
 
24
                // Call parent constructor
 
25
                parent::ComponentWidget( $db_row, 'widget', 'title' );
 
26
                $this->widget_name = T_('Blog Title');
 
27
                $this->widget_title = '';
 
28
        }
 
29
 
 
30
 
 
31
        /**
 
32
         * Get widget's short description
 
33
         */
 
34
        function get_desc()
 
35
        {
 
36
                global $Blog;
 
37
                return sprintf( T_('&laquo;%s&raquo; from the blog\'s <a %s>general settings</a>.'),
 
38
                        '<strong>'.$Blog->dget( 'name' ).'</strong>', 'href="?ctrl=blog_settings&tab=general&blog='.$Blog->ID.'"' );
 
39
        }
 
40
 
 
41
 
 
42
        /**
 
43
         * Get widget's title
 
44
         * @todo (3069): rename this to get_title()
 
45
         */
 
46
        function get_short_desc()
 
47
        {
 
48
                global $Blog;
 
49
 
 
50
                return $Blog->dget( 'name', 'htmlbody' );
 
51
        }
 
52
 
 
53
 
 
54
        /**
 
55
         * Display the widget!
 
56
         * @param array must contain at least the basic display params
 
57
         */
 
58
        function display( $params )
 
59
        {
 
60
                global $Blog;
 
61
 
 
62
                $this->init_display( $params );
 
63
 
 
64
                echo $this->disp_params['block_start'];
 
65
                $title = '<a href="'.$Blog->get( 'url', 'raw' ).'" title="'.$Blog->dget( 'tagline', 'htmlattr' ).'">'
 
66
                        .$Blog->dget( 'name', 'htmlbody' ).'</a>';
 
67
                $this->disp_title( $title );
 
68
                echo $this->disp_params['block_end'];
 
69
 
 
70
                return true;
 
71
        }
 
72
 
 
73
}
 
74
 
 
75
?>