1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK ---------------------------------- |
---|
3 | # This file is part of Newsletter, a plugin for Dotclear. |
---|
4 | # |
---|
5 | # Copyright (c) 2009 Benoit de Marne |
---|
6 | # benoit.de.marne@gmail.com |
---|
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 | // initialisation du widget |
---|
14 | $core->addBehavior('initWidgets', array('newsletterWidgets', 'initWidgets')); |
---|
15 | |
---|
16 | class newsletterWidgets |
---|
17 | { |
---|
18 | /** |
---|
19 | * initialisation du widget |
---|
20 | */ |
---|
21 | public static function initWidgets(&$w) |
---|
22 | { |
---|
23 | global $core, $plugin_name; |
---|
24 | try { |
---|
25 | $w->create(newsletterPlugin::pname(), __('Newsletter'), array('publicWidgetsNewsletter', 'initWidgets')); |
---|
26 | |
---|
27 | $w->newsletter->setting('title', __('Title').' : ', __('Newsletter')); |
---|
28 | $w->newsletter->setting('showtitle', __('Show title'), 1, 'check'); |
---|
29 | $w->newsletter->setting('homeonly', __('Home page only'), 0, 'check'); |
---|
30 | $w->newsletter->setting('inwidget', __('In widget'), 0, 'check'); |
---|
31 | $w->newsletter->setting('insublink', __('In sublink'), 1, 'check'); |
---|
32 | $w->newsletter->setting('subscription_link',__('Title subscription link').' : ',__('Subscription link')); |
---|
33 | |
---|
34 | } catch (Exception $e) { |
---|
35 | $core->error->add($e->getMessage()); |
---|
36 | } |
---|
37 | } |
---|
38 | |
---|
39 | } |
---|
40 | |
---|
41 | ?> |
---|