source: trunk/spip/esqueleto-redcta/themes/alternatives/plugins/sktheme/1_9_2/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.7 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  echo "<small><a href='?exec=sktheme_public_choice'>Habillages</a> | <a href='?exec=sktheme_doc'>Documentation</a></small><br />";
38 
39  // Include 'onglets'
40  sktheme_config_onglets();
41 
42  debut_gauche();
43 
44  // Include Doc box
45  sktheme_config_doc_box();
46 
47  debut_droite();
48 
49  //
50  // PUBLIC THEMES DIRECTORIES CONFIG
51  //
52  debut_cadre_trait_couleur('', false, "sktheme_config", _T('sktheme:public_themes_config'));
53 
54  // if submit : then save values
55  if ($sktheme_action=="set_dir") {
56    ecrire_meta('sktheme_squelettes_public_dir',$squelettes_public_dir);
57    ecrire_meta('sktheme_habillages_public_dir',$habillages_public_dir);
58    ecrire_metas();
59  }
60 
61  // Set directories
62  echo '<form action="'.generer_url_ecrire("sktheme_config", "sktheme_action=set_dir").'" method="post">';
63 
64  // Set squelettes_public_dir
65  debut_cadre('gris_clair');
66  echo '<strong>'._T('sktheme:squelettes_public_dir').' : </strong><input type="text" name="squelettes_public_dir" size="25" value="'.
67    $GLOBALS['meta']['sktheme_squelettes_public_dir'].'">';
68  fin_cadre('gris_clair');
69 
70  // Set habillages_public_dir
71  debut_cadre_couleur();
72  echo '<strong>'._T('sktheme:habillages_public_dir').' : </strong><input type="text" name="habillages_public_dir" size="25" value="'.
73    $GLOBALS['meta']['sktheme_habillages_public_dir'].'">';
74  fin_cadre_couleur(); 
75 
76  echo '<div><div style="text-align:right"><input type="submit" value="'._T('sktheme:save_public_directories').'" /></div></div>';
77  echo '</form>';
78 
79  fin_cadre_trait_couleur(); 
80 
81  //
82  // PRIVATE THEMES DIRECTORIES CONFIG
83  //
84  //   debut_cadre_trait_couleur('', false, "sktheme_config", _T('sktheme:private_themes_config'));
85  //   echo '<br />';
86  //   echo _T('sktheme:to_be_done');
87  //   echo '<br />';
88  //   fin_cadre_trait_couleur(); 
89  //
90  // SWITCHER OPTIONS
91  //
92  // if submit : save switcher options
93  if ($sktheme_action=="set_switcher") {
94    ecrire_meta('sktheme_theme_switcher_style',$theme_switcher_style);
95    ecrire_meta('sktheme_habillage_switcher_style',$habillage_switcher_style);
96    ecrire_meta('sktheme_switcher_activated',$switcher_activated);
97    ecrire_meta('sktheme_switcher_admin_only',$switcher_admin_only);
98    ecrire_metas();
99  }
100  debut_cadre_trait_couleur('', false, "sktheme_config", _T('sktheme:themes_switcher'));
101 
102  echo '<form action="'.generer_url_ecrire("sktheme_config", "sktheme_action=set_switcher").'" method="post">';
103 
104  // Set sktheme_switcher_activated
105  debut_cadre('gris_clair');
106  echo '<strong>'._T('sktheme:switcher_activated').' : </strong>';
107  echo '<input type="radio" name="switcher_activated"  value="yes" ';
108  if (isset($GLOBALS['meta']['sktheme_switcher_activated']) AND ($GLOBALS['meta']['sktheme_switcher_activated']=="yes")) {
109    echo ' checked="checked" ';
110  }
111  echo ' />'._T('sktheme:yes');
112  echo '<input type="radio" name="switcher_activated" value="no" ';
113  if (isset($GLOBALS['meta']['sktheme_switcher_activated']) AND ($GLOBALS['meta']['sktheme_switcher_activated']=="no")) {
114    echo ' checked="checked" ';
115  }
116  echo ' />'._T('sktheme:no');
117  fin_cadre('gris_clair');
118 
119  // Set sktheme_switcher_admin_only
120  debut_cadre_couleur();
121  echo '<strong>'._T('sktheme:switcher_admin_only').' : </strong>';
122  echo '<input type="radio" name="switcher_admin_only"  value="yes" ';
123  if (isset($GLOBALS['meta']['sktheme_switcher_admin_only']) AND ($GLOBALS['meta']['sktheme_switcher_admin_only']=="yes")) {
124    echo ' checked="checked" ';
125  }
126  echo ' />'._T('sktheme:yes');
127  echo '<input type="radio" name="switcher_admin_only"  value="no" ';
128  if (isset($GLOBALS['meta']['sktheme_switcher_admin_only']) AND ($GLOBALS['meta']['sktheme_switcher_admin_only']=="no")) {
129    echo ' checked="checked" ';
130  }
131  echo ' />'._T('sktheme:no');
132  fin_cadre_couleur(); 
133 
134  // Set theme_switcher_style
135  debut_cadre('gris_clair');
136  echo '<strong>'._T('sktheme:theme_switcher_style').' : </strong>';
137  echo "<br />";
138  echo '<textarea  cols="50" rows="8" name="theme_switcher_style">';
139  echo $GLOBALS['meta']['sktheme_theme_switcher_style'].'</textarea>'; 
140  fin_cadre('gris_clair');
141 
142  // Set habillage_switcher_style
143  debut_cadre_couleur();
144  echo '<strong>'._T('sktheme:habillage_switcher_style').' : </strong>';
145  echo "<br />";
146  echo '<textarea  cols="50" rows="8" name="habillage_switcher_style">';
147  echo $GLOBALS['meta']['sktheme_habillage_switcher_style'].'</textarea>'; 
148  fin_cadre_couleur(); 
149 
150   
151  echo '<div><div style="text-align:right"><input type="submit" value="'._T('sktheme:save_switcher_options').'" /></div></div>';
152  echo '</form>';
153 
154  fin_cadre_trait_couleur(); 
155 
156  fin_page();
157
158}
159
160
161?>
Note: See TracBrowser for help on using the repository browser.