~quam-plures-core/quam-plures/install_bug_fix

« back to all changes in this revision

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

  • Committer: EdB
  • Date: 2013-03-22 20:56:19 UTC
  • mfrom: (7660.1.2 qp5_next_branch)
  • Revision ID: 1912webworks@gmail.com-20130322205619-19f3wwvnlnsyll0j
quam-plures/qp5_next_branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
2
/**
3
 
 * This file implements the "Simple Page list" widget
4
 
 *
 
3
 * This file implements the "Page List" widget
 
4
 *
 
5
 * To call this widget directly in your template (bypassing containers), use the
 
6
 * following code modified with any params you need to customize:
 
7
 * <code>
 
8
 * // display the Page List widget
 
9
 * template_widget( array(
 
10
 *   'widget' => 'page_list',
 
11
 *   'widget_title' => 'Pages', // default shown, customize as desired
 
12
 * ) );
 
13
 * </code>
 
14
 *
 
15
 * This widget is an extension of the "Universal Item List" widget. Some of it's
 
16
 * params are set for you, 4 params are available via this widget call:
 
17
 * - 'item_group_by' => default is 'none' which means no grouping. Optionally you
 
18
 *   can set this to 'chapter' for grouping by category.
 
19
 * - 'order_by' => default is 'datestart' which orders your items by date. See
 
20
 *   {@link get_available_sort_options()} for available options.
 
21
 * - 'order_dir' => default is 'DESC' which means descending order. Optionally you
 
22
 *   can set this to 'ASC for ascending order.
 
23
 * - 'limit' => default is 20, which means no more than 20 items will be shown.
 
24
 *
 
25
 * @see ComponentWidget::init_display()
5
26
 * @author {@link http://wonderwinds.com/ Ed Bennett}
6
27
 * @author {@link http://fplanque.net/ Francois PLANQUE}
7
28
 * @copyright (c) 2009 by {@link http://quamplures.net/ the Quam Plures project}
10
31
 */
11
32
if(!defined('QP_MAIN_INIT')) die('fail');
12
33
 
13
 
$wiCache = get_Cache('WidgetCache');
 
34
$wiCache = get_Cache( 'WidgetCache' );
14
35
$wiCache->load_widget( 'item_list' );
15
36
 
16
37
/**
17
38
 * page_list_Widget class
 
39
 *
18
40
 * @package widgets
19
41
 */
20
42
class page_list_Widget extends item_list_Widget
42
64
 
43
65
        /**
44
66
         * Get widget's title
 
67
         *
45
68
         * @todo (3069) EdB> rename this to get_title()
46
69
         */
47
70
        function get_short_desc()
52
75
 
53
76
        /**
54
77
         * Get definitions for editable params
 
78
         *
55
79
         * @see Plugin::GetDefaultSettings()
56
80
         * @param local params like 'for_editing' => true
57
81
         */
76
100
 
77
101
        /**
78
102
         * Display the widget!
 
103
         *
79
104
         * @param array must contain at least the basic display params
80
105
         */
81
106
        function display( $params )