1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK ---------------------------------- |
---|
3 | # This file is part of referer, a plugin for Dotclear. |
---|
4 | # |
---|
5 | # Copyright (c) 2008-2010 Tomtom |
---|
6 | # http://blog.zenstyle.fr/ |
---|
7 | # |
---|
8 | # Licensed under the GPL version 2.0 license. |
---|
9 | # A copy of this license is available in LICENSE file or at |
---|
10 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
11 | # -- END LICENSE BLOCK ------------------------------------ |
---|
12 | |
---|
13 | if (!defined('DC_RC_PATH')) { return; } |
---|
14 | |
---|
15 | $core->addBehavior('initWidgets',array('refererWidgets','initWidgets')); |
---|
16 | |
---|
17 | class refererWidgets |
---|
18 | { |
---|
19 | /** |
---|
20 | * This function creates the referer's widgets object |
---|
21 | * |
---|
22 | * @param w Widget object |
---|
23 | */ |
---|
24 | public static function initWidgets($w) |
---|
25 | { |
---|
26 | $w->create('top_referer',__('Referer: top referers'),array('refererPublic','top')); |
---|
27 | $w->top_referer->setting('title',__('Title:'),__('Top referers'),'text'); |
---|
28 | $w->top_referer->setting('numbertodisplay',__('Number to display:'),'5','combo', |
---|
29 | array('5' => '5', '10' => '10', '15' => '15', '20' => '20') |
---|
30 | ); |
---|
31 | $w->top_referer->setting('homeonly',__('Display on:'),0,'combo', |
---|
32 | array( |
---|
33 | __('All pages') => 0, |
---|
34 | __('Home page only') => 1, |
---|
35 | __('Except on home page') => 2 |
---|
36 | ) |
---|
37 | ); |
---|
38 | $w->top_referer->setting('content_only',__('Content only'),0,'check'); |
---|
39 | $w->top_referer->setting('class',__('CSS class:'),''); |
---|
40 | $w->top_referer->setting('offline',__('Offline'),0,'check'); |
---|
41 | |
---|
42 | $w->create('last_referer',__('Referer: last referers'),array('refererPublic','last')); |
---|
43 | $w->last_referer->setting('title',__('Title:'),__('Last referers'),'text'); |
---|
44 | $w->last_referer->setting('numbertodisplay',__('Number to display:'),'5','combo', |
---|
45 | array('5' => '5', '10' => '10', '15' => '15', '20' => '20') |
---|
46 | ); |
---|
47 | $w->last_referer->setting('homeonly',__('Display on:'),0,'combo', |
---|
48 | array( |
---|
49 | __('All pages') => 0, |
---|
50 | __('Home page only') => 1, |
---|
51 | __('Except on home page') => 2 |
---|
52 | ) |
---|
53 | ); |
---|
54 | $w->last_referer->setting('content_only',__('Content only'),0,'check'); |
---|
55 | $w->last_referer->setting('class',__('CSS class:'),''); |
---|
56 | $w->last_referer->setting('offline',__('Offline'),0,'check'); |
---|
57 | } |
---|
58 | } |
---|