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

« back to all changes in this revision

Viewing changes to qp_plugins/title_widget/_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 class.
4
 
 *
5
 
 * This file is part of Quam Plures - {@link http://quamplures.net/}
6
 
 * See also {@link https://launchpad.net/quam-plures}.
7
 
 *
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/}
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
 
 * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
21
 
 * @author fplanque: Francois PLANQUE.
22
 
 *
23
 
 * @package widgets
24
 
 */
25
 
if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
26
 
 
27
 
load_class( 'widgets/model/_widget.class.php' );
28
 
 
29
 
 
30
 
/**
31
 
 * @package widgets
32
 
 */
33
 
class title_Widget extends ComponentWidget
34
 
{
35
 
        /**
36
 
         * Constructor
37
 
         */
38
 
        function title_Widget( $db_row = NULL )
39
 
        {
40
 
                // Call parent constructor:
41
 
                parent::ComponentWidget( $db_row, 'widget', 'title' );
42
 
 
43
 
                $this->widget_name = $this->T_('Blog title');
44
 
                $this->widget_title = '';
45
 
        }
46
 
 
47
 
 
48
 
        /**
49
 
         * Get a very short desc. Used in the widget list.
50
 
         */
51
 
        function get_short_desc()
52
 
        {
53
 
                global $Blog;
54
 
 
55
 
                return $Blog->dget( 'name', 'htmlbody' );
56
 
        }
57
 
 
58
 
 
59
 
        /**
60
 
         * Get short description
61
 
         */
62
 
        function get_desc()
63
 
        {
64
 
                global $Blog;
65
 
                return sprintf( $this->T_('&laquo;%s&raquo; from the blog\'s <a %s>general settings</a>.'),
66
 
                                '<strong>'.$Blog->dget('name').'</strong>', 'href="?ctrl=coll_settings&tab=general&blog='.$Blog->ID.'"' );
67
 
        }
68
 
 
69
 
 
70
 
        /**
71
 
         * Display the widget!
72
 
         *
73
 
         * @param array MUST contain at least the basic display params
74
 
         */
75
 
        function display( $params )
76
 
        {
77
 
                global $Blog;
78
 
 
79
 
                $this->init_display( $params );
80
 
 
81
 
                // Collection title:
82
 
                echo $this->disp_params['block_start'];
83
 
 
84
 
                $title = '<a href="'.$Blog->get( 'url', 'raw' ).'" title="'.$Blog->dget( 'tagline', 'htmlattr' ).'">'
85
 
                                                        .$Blog->dget( 'name', 'htmlbody' )
86
 
                                                        .'</a>';
87
 
                $this->disp_title( $title );
88
 
 
89
 
                echo $this->disp_params['block_end'];
90
 
 
91
 
                return true;
92
 
        }
93
 
}
94
 
 
95
 
 
96
 
?>
 
 
b'\\ No newline at end of file'