code = 'lire_config(' . $arg . ',' . ($sinon && $sinon != "''" ? $sinon : 'null') . ',' . $unserialize . ')'; return $p; } # CFG_CHEMIN // // La balise CFG_CHEMIN retourne le chemin d'une image stockee // par cfg. // // cfg stocke : 'config/vue/champ.ext' (ce qu'affiche #CONFIG) // #cfg_chemin retourne l'adresse complete : 'IMG/config/vue/champ.ext' // function balise_CFG_CHEMIN_dist($p) { if (!$arg = interprete_argument_balise(1,$p)) { $arg = "''"; } $sinon = interprete_argument_balise(2,$p); $p->code = '($l = lire_config(' . $arg . ',' . ($sinon && $sinon != "''" ? $sinon : 'null') . ')) ? _DIR_IMG . $l : null'; return $p; } # CFG_ARBO /* * Affiche une arborescence du contenu d'un #CONFIG * * #CFG_ARBO, * #CFG_ARBO{ma_meta}, * #CFG_ARBO{~toto}, * #CFG_ARBO{ma_meta/mon_casier}, * #CFG_ARBO{ma_table:mon_id/mon_champ} * */ function balise_CFG_ARBO_dist($p) { if (!$arg = interprete_argument_balise(1,$p)) { $arg = "''"; } $p->interdire_scripts = false; $p->code = 'cfg_affiche_arborescence(' . $arg . ')'; return $p; } function cfg_affiche_arborescence($cfg='') { $sortie = ''; $hash = substr(md5(rand()*rand()),0,6); // integration du css // Suppression de cette inclusion des css arbo au profit d'une inclusion d'un fichier cfg.css dans le header prive // $sortie .= "\n"; // integration du js $sortie .= "\n"; $tableau = lire_config($cfg); if ($c = @unserialize($tableau)) $tableau = $c; if (empty($cfg)) $cfg = 'spip_meta'; // parcours des donnees $sortie .= "
\n" . cfg_affiche_sous_arborescence($cfg, $tableau) . "\n
\n"; return $sortie; } function cfg_affiche_sous_arborescence($nom, $tableau){ $sortie = "\n
$nom
\n"; $sortie .= "\n\n"; return $sortie; } ?>