1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK ---------------------------------- |
---|
3 | # |
---|
4 | # This file is part of allBlogs, a plugin for Dotclear 2. |
---|
5 | # |
---|
6 | # Copyright (c) 2009 Philippe Amalgame and contributors |
---|
7 | # Licensed under the GPL version 2.0 license. |
---|
8 | # See LICENSE file or |
---|
9 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
10 | # |
---|
11 | # -- END LICENSE BLOCK ------------------------------------ |
---|
12 | |
---|
13 | if (!defined('DC_RC_PATH')) { return; } |
---|
14 | |
---|
15 | l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/public'); |
---|
16 | |
---|
17 | $core->addBehavior('initWidgets', array('allBlogsBehavior', 'initWidgets')); |
---|
18 | |
---|
19 | class allBlogsBehavior |
---|
20 | { |
---|
21 | public static function initWidgets(&$w) { |
---|
22 | global $core; |
---|
23 | $w->create('allBlogs',__('All Blogs'),array('publicAllBLogs','allBlogs')); |
---|
24 | $w->allBlogs->setting('title',__('Title:'),__('All Blogs')); |
---|
25 | $w->allBlogs->setting('homeonly',__('Home page only'),1,'check'); |
---|
26 | $w->allBlogs->setting('combo',__('Display list in combo box'),0,'check'); |
---|
27 | $w->allBlogs->setting('excluded',__('Excluded blogs:'),'','text'); |
---|
28 | $rs = $core->getBlogs(); |
---|
29 | if (!$rs->isEmpty()) { |
---|
30 | while ($rs->fetch()) { |
---|
31 | if($rs->nb_post > 0) { |
---|
32 | $w->allBlogs->setting($rs->blog_id,html::escapeHTML($rs->blog_name), |
---|
33 | false, 'check'); |
---|
34 | } |
---|
35 | } |
---|
36 | } |
---|
37 | } |
---|
38 | } |
---|
39 | ?> |
---|