[PLUGINS] +set de base
[lhc/web/www.git] / www / plugins / zen-garden-2 / inc / zengarden.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 if (!defined('_DIR_THEMES'))
11 define('_DIR_THEMES',_DIR_RACINE."themes/");
12
13 function zengarden_charge_themes($dir = _DIR_THEMES, $tous = false, $force = false){
14 $themes = array();
15
16 include_spip('inc/plugin');
17 $files = liste_plugin_files($dir);
18
19 if (count($files)) {
20 $get_infos = charger_fonction('get_infos','plugins');
21
22 $t = $get_infos($files,$force,$dir);
23 $themes = array();
24
25 foreach($files as $d){
26 if (isset($t[$d])){
27 if (isset($t[$d]['categorie']) and $t[$d]['categorie']=='theme'
28 AND ($tous OR $t[$d]['etat']=='stable')){
29 $t[$d]['tri'] = strtolower(basename($d));
30 $themes[substr($dir.$d,strlen(_DIR_RACINE))] = $t[$d];
31 }
32 }
33 unset($t[$d]);
34 }
35 }
36
37 return $themes;
38 }
39
40 ?>