1 | <?php /* -*- tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ |
---|
2 | /***************************************************************\ |
---|
3 | * This is 'Dcom', a plugin for Dotclear 2 * |
---|
4 | * * |
---|
5 | * Copyright (c) 2007-2008 * |
---|
6 | * Oleksandr Syenchuk, Jean-François Michaud and contributors.* |
---|
7 | * * |
---|
8 | * This is an open source software, distributed under the GNU * |
---|
9 | * General Public License (version 2) terms and conditions. * |
---|
10 | * * |
---|
11 | * You should have received a copy of the GNU General Public * |
---|
12 | * License along 'Dcom' (see COPYING.txt); * |
---|
13 | * if not, write to the Free Software Foundation, Inc., * |
---|
14 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * |
---|
15 | \***************************************************************/ |
---|
16 | if (!defined('DC_RC_PATH')) { return; } |
---|
17 | |
---|
18 | class commonDcom |
---|
19 | { |
---|
20 | public static function adjustDefaults(&$p) |
---|
21 | { |
---|
22 | global $core; |
---|
23 | |
---|
24 | if (!is_array($p)) { |
---|
25 | $r = array(); |
---|
26 | } else { |
---|
27 | $r = $p; |
---|
28 | } |
---|
29 | |
---|
30 | $p = array(); |
---|
31 | $p['homeonly'] = empty($r['homeonly']) |
---|
32 | ? false |
---|
33 | : true; |
---|
34 | $p['c_limit'] = isset($r['c_limit']) |
---|
35 | ? abs((integer) $r['c_limit']) |
---|
36 | : 10; |
---|
37 | $p['t_limit'] = isset($r['t_limit']) |
---|
38 | ? abs((integer) $r['t_limit']) |
---|
39 | : 20; |
---|
40 | $p['co_limit'] = !empty($r['co_limit']) |
---|
41 | ? abs((integer) $r['co_limit']) |
---|
42 | : 80; |
---|
43 | $p['title'] = isset($r['title']) |
---|
44 | ? (string) $r['title'] |
---|
45 | : __('Last comments'); |
---|
46 | $p['stringformat'] = !empty($r['stringformat']) |
---|
47 | ? (string) $r['stringformat'] |
---|
48 | : '<a href="%5$s" title="%4$s">%2$s - %3$s<br/>%1$s</a>'; |
---|
49 | $p['dateformat'] = !empty($r['dateformat']) |
---|
50 | ? (string) $r['dateformat'] |
---|
51 | : $core->blog->settings->date_format.','. |
---|
52 | $core->blog->settings->time_format; |
---|
53 | } |
---|
54 | } |
---|
55 | ?> |
---|