Author: bill@adequates.com
Date: Wed Aug 16 15:38:02 2006
New Revision: 4560
Log:
installation/désintallation des choses possibles
Modified:
_plugins_/_amelioration_admin_/mots_partout/exec/config_mots_partout.php
Modified: _plugins_/_amelioration_admin_/mots_partout/exec/config_mots_partout.php
--- _plugins_/_amelioration_admin_/mots_partout/exec/config_mots_partout.php (original)
+++ _plugins_/_amelioration_admin_/mots_partout/exec/config_mots_partout.php Wed Aug 16 15:38:02 2006
@@ -8,6 +8,8 @@
include_spip ("inc/presentation");
include_spip ("base/abstract_sql");
+ global $choses_possibles;
+ include(_DIR_PLUGIN_MOTS_PARTOUT."/mots_partout_choses.php");
debut_page('« '._T('motspartout:titre_page').' »', 'configurations', 'mots_partout');
if ($connect_statut != '0minirezo' OR !$connect_toutes_rubriques) {
@@ -25,21 +27,25 @@
/************************************************************************/
$type = addslashes($_POST['nom_chose']);
-
- include(_DIR_PLUGIN_MOTS_PARTOUT."/mots_partout_choses.php");
$id_chose = $choses_possibles[$type]['id_chose'];
$table_principale = $choses_possibles[$type]['table_principale'];
$tables_installees = unserialize(lire_meta('MotsPartout:tables_installees'));
- if(($type != '') && (!$tables_installees[$type])) {
+ if ($type != ''){
+ if (!$tables_installees[$type]) {
spip_query("ALTER TABLE `".$table_pref."_groupes_mots` ADD `".$type."` CHAR( 3 ) NOT NULL DEFAULT 'non';");
spip_query("CREATE TABLE IF NOT EXISTS `".str_replace('spip_',$table_pref.'_mots_',$table_principale)."` (`id_mot` bigint(20) NOT NULL default '0',`$id_chose` bigint(20) NOT NULL default '0', KEY `$id_chose` (`id_mot`),KEY `id_mot` (`id_mot`)) TYPE=MyISAM;;");
$tables_installees[$type] = true;
+// } elseif ($_POST['del']=='oui'){
+ } else {
+ unset($tables_installees[$type]);
+ }
ecrire_meta('MotsPartout:tables_installees',serialize($tables_installees));
ecrire_metas();
}
+
/*Affichage*/
echo '<br><br><br>';
@@ -78,6 +84,17 @@
fin_cadre_enfonce();
+ debut_cadre_enfonce();
+ echo "<form action=\"".generer_url_ecrire('config_mots_partout')."\" method=\"post\">";
+ echo "<label for=\"nom_chose\">"._T("motspartout:desinstaller").":</label><br><br><select name=\"nom_chose\">";
+ foreach($tables_installees as $chose => $data) {
+ echo "<option value=\"$chose\">$chose</option>";
+ }
+ echo "</select>";
+// echo "<input type=\"hidden\" name=\"del\" value=\"oui\"/>";
+ echo "<input type=\"submit\" value=\""._T('valider')."\"/>";
+ echo '</form>';
+ fin_cadre_enfonce();
}
fin_page();