source: trunk/spip/esqueleto-redcta/themes/alternatives/plugins/sktheme/1_9_1/exec/sktheme_config.php @ 30

Last change on this file since 30 was 30, checked in by sebas, 17 years ago

nueva importacion del codigo del esqueleto de redcta con los plugins

File size: 5.5 KB
Line 
1<?php
2  // ---------------------------------------------------------------------
3  //
4  // Sktheme : manage themes under SPIP (squelettes + habillages)
5  //
6  // Copyright (c) 2006 - Skedus
7  //
8  // This program is free software; you can redistribute it and/or modify
9  // it under the terms of the GNU General Public License as published by
10  // the Free Software Foundation; either version 2 of the License, or
11  // (at your option) any later version.
12  //
13  // You should have received a copy of the GNU General Public License
14  // along with this program;
15  //
16  // ---------------------------------------------------------------------
17
18if (!defined("_ECRIRE_INC_VERSION")) return;
19
20include_spip('inc/presentation');
21include_spip('inc/sktheme_util');
22
23function exec_sktheme_config() {
24 
25  global $sktheme_action;
26  global $squelettes_public_dir;
27  global $habillages_public_dir;
28  global $habillage_switcher_style;
29  global $theme_switcher_style;
30  global $switcher_activated;
31  global $switcher_admin_only;
32 
33  debut_page(_T('sktheme:title_config'),'configuration','sktheme_config');
34
35  echo "<br />";
36  gros_titre(_T('sktheme:main_config_title'));
37 
38  // Include 'onglets'
39  sktheme_config_onglets();
40 
41  debut_gauche();
42 
43  // Include Doc box
44  sktheme_config_doc_box();
45 
46  debut_droite();
47 
48  //
49  // PUBLIC THEMES DIRECTORIES CONFIG
50  //
51  debut_cadre_trait_couleur('', false, "sktheme_config", _T('sktheme:public_themes_config'));
52 
53  // if submit : then save values
54  if ($sktheme_action=="set_dir") {
55    ecrire_meta('sktheme_squelettes_public_dir',$squelettes_public_dir);
56    ecrire_meta('sktheme_habillages_public_dir',$habillages_public_dir);
57    ecrire_metas();
58  }
59 
60  // Set directories
61  echo '<form action="'.generer_url_ecrire("sktheme_config", "sktheme_action=set_dir").'" method="post">';
62 
63  // Set squelettes_public_dir
64  debut_cadre_gris_clair();
65  echo '<strong>'._T('sktheme:squelettes_public_dir').' : </strong><input type="text" name="squelettes_public_dir" size="25" value="'.
66    $GLOBALS['meta']['sktheme_squelettes_public_dir'].'">';
67  fin_cadre_gris_clair();
68 
69  // Set habillages_public_dir
70  debut_cadre_couleur();
71  echo '<strong>'._T('sktheme:habillages_public_dir').' : </strong><input type="text" name="habillages_public_dir" size="25" value="'.
72    $GLOBALS['meta']['sktheme_habillages_public_dir'].'">';
73  fin_cadre_couleur(); 
74 
75  echo '<div><div style="text-align:right"><input type="submit" value="'._T('sktheme:save_public_directories').'" /></div></div>';
76  echo '</form>';
77 
78  fin_cadre_trait_couleur(); 
79 
80  //
81  // PRIVATE THEMES DIRECTORIES CONFIG
82  //
83  //   debut_cadre_trait_couleur('', false, "sktheme_config", _T('sktheme:private_themes_config'));
84  //   echo '<br />';
85  //   echo _T('sktheme:to_be_done');
86  //   echo '<br />';
87  //   fin_cadre_trait_couleur(); 
88  //
89  // SWITCHER OPTIONS
90  //
91  // if submit : save switcher options
92  if ($sktheme_action=="set_switcher") {
93    ecrire_meta('sktheme_theme_switcher_style',$theme_switcher_style);
94    ecrire_meta('sktheme_habillage_switcher_style',$habillage_switcher_style);
95    ecrire_meta('sktheme_switcher_activated',$switcher_activated);
96    ecrire_meta('sktheme_switcher_admin_only',$switcher_admin_only);
97    ecrire_metas();
98  }
99  debut_cadre_trait_couleur('', false, "sktheme_config", _T('sktheme:themes_switcher'));
100 
101  echo '<form action="'.generer_url_ecrire("sktheme_config", "sktheme_action=set_switcher").'" method="post">';
102 
103  // Set sktheme_switcher_activated
104  debut_cadre_gris_clair();
105  echo '<strong>'._T('sktheme:switcher_activated').' : </strong>';
106  echo '<input type="radio" name="switcher_activated"  value="yes" ';
107  if (isset($GLOBALS['meta']['sktheme_switcher_activated']) AND ($GLOBALS['meta']['sktheme_switcher_activated']=="yes")) {
108    echo ' checked="checked" ';
109  }
110  echo ' />'._T('sktheme:yes');
111  echo '<input type="radio" name="switcher_activated" value="no" ';
112  if (isset($GLOBALS['meta']['sktheme_switcher_activated']) AND ($GLOBALS['meta']['sktheme_switcher_activated']=="no")) {
113    echo ' checked="checked" ';
114  }
115  echo ' />'._T('sktheme:no');
116  fin_cadre_gris_clair();
117 
118  // Set sktheme_switcher_admin_only
119  debut_cadre_couleur();
120  echo '<strong>'._T('sktheme:switcher_admin_only').' : </strong>';
121  echo '<input type="radio" name="switcher_admin_only"  value="yes" ';
122  if (isset($GLOBALS['meta']['sktheme_switcher_admin_only']) AND ($GLOBALS['meta']['sktheme_switcher_admin_only']=="yes")) {
123    echo ' checked="checked" ';
124  }
125  echo ' />'._T('sktheme:yes');
126  echo '<input type="radio" name="switcher_admin_only"  value="no" ';
127  if (isset($GLOBALS['meta']['sktheme_switcher_admin_only']) AND ($GLOBALS['meta']['sktheme_switcher_admin_only']=="no")) {
128    echo ' checked="checked" ';
129  }
130  echo ' />'._T('sktheme:no');
131  fin_cadre_couleur(); 
132 
133  // Set theme_switcher_style
134  debut_cadre_gris_clair();
135  echo '<strong>'._T('sktheme:theme_switcher_style').' : </strong>';
136  echo "<br />";
137  echo '<textarea  cols="50" rows="8" name="theme_switcher_style">';
138  echo $GLOBALS['meta']['sktheme_theme_switcher_style'].'</textarea>'; 
139  fin_cadre_gris_clair();
140 
141  // Set habillage_switcher_style
142  debut_cadre_couleur();
143  echo '<strong>'._T('sktheme:habillage_switcher_style').' : </strong>';
144  echo "<br />";
145  echo '<textarea  cols="50" rows="8" name="habillage_switcher_style">';
146  echo $GLOBALS['meta']['sktheme_habillage_switcher_style'].'</textarea>'; 
147  fin_cadre_couleur(); 
148 
149   
150  echo '<div><div style="text-align:right"><input type="submit" value="'._T('sktheme:save_switcher_options').'" /></div></div>';
151  echo '</form>';
152 
153  fin_cadre_trait_couleur(); 
154 
155  fin_page();
156
157}
158
159
160?>
Note: See TracBrowser for help on using the repository browser.