1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK ---------------------------------- |
---|
3 | # This file is part of breadcrumb, a plugin for Dotclear 2. |
---|
4 | # |
---|
5 | # Copyright (c) Franck Paul and contributors |
---|
6 | # carnet.franck.paul@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 | if (!defined('DC_CONTEXT_ADMIN')) { return; } |
---|
14 | |
---|
15 | // dead but useful code, in order to have translations |
---|
16 | __('Breadcrumb').__('Breadcrumb for Dotclear'); |
---|
17 | |
---|
18 | $core->addBehavior('adminBlogPreferencesForm',array('breadcrumbBehaviors','adminBlogPreferencesForm')); |
---|
19 | $core->addBehavior('adminBeforeBlogSettingsUpdate',array('breadcrumbBehaviors','adminBeforeBlogSettingsUpdate')); |
---|
20 | |
---|
21 | class breadcrumbBehaviors |
---|
22 | { |
---|
23 | public static function adminBlogPreferencesForm($core,$settings) |
---|
24 | { |
---|
25 | $settings->addNameSpace('breadcrumb'); |
---|
26 | echo |
---|
27 | '<div class="fieldset"><h4>'.__('Breadcrumb').'</h4>'. |
---|
28 | '<p><label class="classic">'. |
---|
29 | form::checkbox('breadcrumb_enabled','1',$settings->breadcrumb->breadcrumb_enabled). |
---|
30 | __('Enable breadcrumb for this blog').'</label></p>'. |
---|
31 | '<p class="form-note">'.__('The {{tpl:Breadcrumb [separator=" &rsaquo; "]}} tag should be present (or inserted if not) in the template.').'</p>'. |
---|
32 | form::checkbox('breadcrumb_alone','1',$settings->breadcrumb->breadcrumb_alone). |
---|
33 | __('Do not encapsulate breadcrumb in a <p id="breadcrumb">...</p> tag.').'</label></p>'. |
---|
34 | '</div>'; |
---|
35 | } |
---|
36 | |
---|
37 | public static function adminBeforeBlogSettingsUpdate($settings) |
---|
38 | { |
---|
39 | $settings->addNameSpace('breadcrumb'); |
---|
40 | $settings->breadcrumb->put('breadcrumb_enabled',!empty($_POST['breadcrumb_enabled']),'boolean'); |
---|
41 | $settings->breadcrumb->put('breadcrumb_alone',!empty($_POST['breadcrumb_alone']),'boolean'); |
---|
42 | } |
---|
43 | } |
---|