$n)); } $liste = $script = ''; if($n) { $exec = _request('exec'); $fin_delete = _T('couteauprive:pack_delete'); $img = defined('_SPIP30000')?chemin_image('poubelle.png'):_DIR_IMG_PACK.'poubelle.gif'; $fin_delete = "\" class='pack_delete' title=\"$fin_delete\">\"$fin_delete\"  \"$fin_install\"  "; foreach(array_keys($GLOBALS['cs_installer']) as $pack) { $u = urlencode($pack); $liste .= "\n-* \n"; } // appel direct, sans ajax, histoire de mettre a jour le menu : return redirige_action_post('action_rapide', 'sauve_pack', 'admin_couteau_suisse', "cmd=pack#cs_infos", "\n$script

$info

$liste

"._T('couteauprive:pack_sauver_descrip', array('file' => show_file_options())) ."

"); } // fonction {$outil}_{$arg}_action() appelee par action/action_rapide.php // clic "Sauver la configuration actuelle" function pack_sauve_pack_action() { // pour inserer un pack de config dans config/mes_options.php $titre0 = $titre = _T('couteauprive:pack_actuel', array('date'=>cs_date())); $n=0; if(isset($GLOBALS['cs_installer'][$titre])) while(isset($GLOBALS['cs_installer']["$titre (".++$n.')'])); if($n) $titre = "$titre ($n)"; include_spip(_DIR_CS_TMP.'config'); $fct = md5($titre.time()); $config = $GLOBALS['cs_installer'][$titre0]; if(function_exists($config)) $config = $config(); $pack = "\n# Le Couteau Suisse : pack de configuration du ".date("d M Y, H:i:s")."\n\$GLOBALS['cs_installer']['$titre'] = 'cs_$fct'; function cs_$fct() { return " . var_export($config, true) . ";\n} # $titre #\n"; cs_ecrire_config(',\?'.'>\s*$,m', $pack.'?'.'>', $pack); } ?>