Dotclear

source: themes/balcony/_config.php @ 3343

Revision 3343, 1.6 KB checked in by brol, 9 years ago (diff)

v1.1 voir changelog + suppression fichiers non utilisés

Line 
1<?php
2# -- BEGIN LICENSE BLOCK ----------------------------------
3# This file is part of Balcony, a theme for Dotclear.
4#
5# Copyright (c) 2010
6# annso contact@as-i-am.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
13if (!defined('DC_CONTEXT_ADMIN')) { return; }
14
15global $core;
16
17//PARAMS
18
19# Translations
20l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/public');
21
22# Default values
23$default_menu = 'simplemenu';
24
25# Settings
26$my_menu = $core->blog->settings->themes->balcony_menu;
27
28# Menu type
29$balcony_menu_combo = array(
30     __('simpleMenu') => 'simplemenu',
31     __('none') => 'menu-no'
32);
33
34// POST ACTIONS
35
36if (!empty($_POST))
37{
38     try
39     {
40          $core->blog->settings->addNamespace('themes');
41
42          # Menu type
43          if (!empty($_POST['balcony_menu']) && in_array($_POST['balcony_menu'],$balcony_menu_combo))
44          {
45               $my_menu = $_POST['balcony_menu'];
46
47          } elseif (empty($_POST['balcony_menu']))
48          {
49               $my_menu = $default_menu;
50
51          }
52          $core->blog->settings->themes->put('balcony_menu',$my_menu,'string','Menu to display',true);
53
54          // Blog refresh
55          $core->blog->triggerBlog();
56
57          // Template cache reset
58          $core->emptyTemplatesCache();
59
60          dcPage::success(__('Theme configuration has been successfully updated.'),true,true);
61     }
62     catch (Exception $e)
63     {
64          $core->error->add($e->getMessage());
65     }
66}
67
68// DISPLAY
69
70# Menu
71echo
72'<div class="fieldset"><h4>'.__('Customizations').'</h4>'.
73'<p class="field"><label>'.__('Menu to display:').'</label>'.
74form::combo('balcony_menu',$balcony_menu_combo,$my_menu).
75'</p>'.
76'</div>';
Note: See TracBrowser for help on using the repository browser.

Sites map