[PLUGINS] +set de base
[lhc/web/www.git] / www / plugins / zen-garden-2 / action / zengarden_activer_theme.php
1 <?php
2 /**
3 * Plugin Zen-Garden pour Spip 3.0
4 * Licence GPL (c) 2006-2013 Cedric Morin
5 *
6 */
7
8 if (!defined("_ECRIRE_INC_VERSION")) return;
9
10 function action_zengarden_activer_theme_dist(){
11 $securiser_action = charger_fonction('securiser_action','inc');
12 $arg = $securiser_action();
13
14 if (strncmp('defaut:',$arg,7) == 0){
15 $dir_theme = _DIR_RACINE . substr($arg,7);
16 $flux = pipeline('zengarden_activer_theme', array('args' => array('dir' =>$dir_theme, 'action'=>'effacer'), 'data' => true));
17 if ($flux) {
18 include_spip('inc/meta');
19 effacer_meta("zengarden_theme");
20 }
21 }
22 elseif (strncmp('apercu:',$arg,7) == 0){
23 $theme = substr($arg,7);
24 $dir_theme = _DIR_RACINE . $theme;
25 if (is_dir($dir_theme)) {
26 $flux = pipeline('zengarden_activer_theme', array('args' => array('dir' =>$dir_theme, 'action'=>'apercevoir'), 'data' => true));
27 if ($flux) {
28 include_spip('inc/cookie');
29 spip_setcookie('spip_zengarden_theme', $theme);
30 }
31 }
32 }
33 elseif (strncmp('activation:',$arg,11) == 0) {
34 $theme = substr($arg,11);
35 $dir_theme = _DIR_RACINE . $theme;
36 if (is_dir($dir_theme)) {
37 $flux = pipeline('zengarden_activer_theme', array('args' => array('dir' => $dir_theme, 'action'=>'activer'), 'data' => true));
38 if ($flux) {
39 include_spip('inc/meta');
40 ecrire_meta("zengarden_theme", $theme);
41 }
42 }
43 }
44 }
45
46 ?>