Skip to content
Extraits de code Groupes Projets
Valider 4484b5f9 rédigé par RealET's avatar RealET :kissing_cat:
Parcourir les fichiers

* Clarté du code pour le array du contenu à insérer.

* un array qui n'était pas défini pour la màj d'un mot
parent 63716192
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -144,15 +144,15 @@ function create_groupe($titre, $descriptif='', $texte='', $unseul='non', $obliga ...@@ -144,15 +144,15 @@ function create_groupe($titre, $descriptif='', $texte='', $unseul='non', $obliga
spip_log("1. (create_groupe) pret a creer groupe : titre = $titre. retour de find_groupe = $id_groupe", _LOG_DEBUG); spip_log("1. (create_groupe) pret a creer groupe : titre = $titre. retour de find_groupe = $id_groupe", _LOG_DEBUG);
if ($id_groupe == 0) { if ($id_groupe == 0) {
$set = array( $set = array(
"id_groupe" => '', "id_groupe" => '',
"titre" => $titre, "titre" => $titre,
"descriptif" => $descriptif, "descriptif" => $descriptif,
"texte" => $texte, "texte" => $texte,
"unseul" => $unseul, "unseul" => $unseul,
"obligatoire" => $obligatoire, "obligatoire" => $obligatoire,
"tables_liees" => $tables_liees, "tables_liees" => $tables_liees,
"minirezo" => $minirezo, "minirezo" => $minirezo,
"comite" => $comite, "comite" => $comite,
"forum" => $forum "forum" => $forum
); );
$id_insert = objet_inserer('groupes_mots', $id_groupe, $set); $id_insert = objet_inserer('groupes_mots', $id_groupe, $set);
...@@ -193,14 +193,14 @@ function remplacer_groupe($titre, $descriptif, $texte, $unseul, $obligatoire, $t ...@@ -193,14 +193,14 @@ function remplacer_groupe($titre, $descriptif, $texte, $unseul, $obligatoire, $t
include_spip('action/editer_objet'); include_spip('action/editer_objet');
$id_groupe = id_groupe($titre); $id_groupe = id_groupe($titre);
$set = array( $set = array(
"titre" => $titre, "titre" => $titre,
"descriptif" => $descriptif, "descriptif" => $descriptif,
"texte" => $texte, "texte" => $texte,
"unseul" => $unseul, "unseul" => $unseul,
"obligatoire" => $obligatoire, "obligatoire" => $obligatoire,
"tables_liees" => $tables_liees, "tables_liees" => $tables_liees,
"minirezo" => $minirezo, "minirezo" => $minirezo,
"comite" => $comite, "comite" => $comite,
"forum" => $forum "forum" => $forum
); );
objet_modifier('groupes_mots', $id_groupe, $set); objet_modifier('groupes_mots', $id_groupe, $set);
...@@ -238,7 +238,15 @@ function create_mot($groupe, $mot, $descriptif='', $texte='') { ...@@ -238,7 +238,15 @@ function create_mot($groupe, $mot, $descriptif='', $texte='') {
$find_mot = find_mot($mot, $id_groupe); $find_mot = find_mot($mot, $id_groupe);
if ($find_mot == 0) { if ($find_mot == 0) {
spip_log("1. (create_mot) debut create_mot. mot inexistant donc creation : $id_groupe - $mot", _LOG_DEBUG); spip_log("1. (create_mot) debut create_mot. mot inexistant donc creation : $id_groupe - $mot", _LOG_DEBUG);
$id_mot = objet_inserer('mots', $id_groupe, array("id_mot" => '', "titre" => $mot, "descriptif" => $descriptif, "texte" => $texte, "id_groupe" => $id_groupe, "type" => $groupe)); $set = array(
"id_mot" => '',
"titre" => $mot,
"descriptif" => $descriptif,
"texte" => $texte,
"id_groupe" => $id_groupe,
"type" => $groupe
);
$id_mot = objet_inserer('mots', $id_groupe, $set);
spip_log("2. (create_mot) mot cle $mot insere sous l'id $id_mot dans la table avec groupe = $id_groupe", _LOG_DEBUG); spip_log("2. (create_mot) mot cle $mot insere sous l'id $id_mot dans la table avec groupe = $id_groupe", _LOG_DEBUG);
} }
else if ($find_mot > 0) { else if ($find_mot > 0) {
...@@ -255,6 +263,13 @@ function create_mot($groupe, $mot, $descriptif='', $texte='') { ...@@ -255,6 +263,13 @@ function create_mot($groupe, $mot, $descriptif='', $texte='') {
//fonction qui permet de mettre à jour un mot clé //fonction qui permet de mettre à jour un mot clé
function remplacer_mot($id_mot, $mot, $descriptif, $texte, $id_groupe, $groupe) { function remplacer_mot($id_mot, $mot, $descriptif, $texte, $id_groupe, $groupe) {
include_spip('action/editer_objet'); include_spip('action/editer_objet');
$set = array(
"titre" => $mot,
"descriptif" => $descriptif,
"texte" => $texte,
"id_groupe" => $id_groupe,
"type" => $groupe
);
objet_modifier('mots', $id_mot, $set); objet_modifier('mots', $id_mot, $set);
return true; return true;
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter