array('exec'=>'mots_tous'),'data'=>''));
$commencer_page = charger_fonction('commencer_page', 'inc');
echo $commencer_page(_T('titre_page_mots_tous'), "naviguer", "mots");
echo debut_gauche('', true);
echo pipeline('affiche_gauche',array('args'=>array('exec'=>'mots_tous'),'data'=>''));
if (autoriser('creer','groupemots') AND !$conf_mot){
$out = "";
$result = sql_select("*, ".sql_multi ("titre", "$spip_lang"), "spip_groupes_mots", "", "", "multi");
while ($row_groupes = sql_fetch($result)) {
$id_groupe = $row_groupes['id_groupe'];
$titre_groupe = typo($row_groupes['titre']);
$out .= "
";
echo debut_cadre_enfonce("groupe-mot-24.gif", true, '', $titre_groupe);
// Affichage des options du groupe (types d'elements, permissions...)
$res = '';
$tables_liees = explode(',',$tables_liees);
$libelles = array('articles'=>'info_articles_2','breves'=>'info_breves_02','rubriques'=>'info_rubriques','syndic'=>'icone_sites_references');
$libelles = pipeline('libelle_association_mots',$libelles);
foreach($tables_liees as $table)
if (strlen($table))
$res .= "> " . _T(isset($libelles[$table])?$libelles[$table]:"$table:info_$table") . " ";
if ($unseul == "oui" OR $obligatoire == "oui") $res .= "
";
if ($unseul == "oui") $res .= "> "._T('info_un_mot')." ";
if ($obligatoire == "oui") $res .= "> "._T('info_groupe_important')." ";
$res .= "
";
if ($acces_minirezo == "oui") $res .= "> "._T('info_administrateurs')." ";
if ($acces_comite == "oui") $res .= "> "._T('info_redacteurs')." ";
if ($acces_forum == "oui") $res .= "> "._T('info_visiteurs_02')." ";
echo "
", $res, "";
if (strlen($descriptif)) {
echo "
", propre("{{"._T('info_descriptif')."}} ".$descriptif), "
";
}
if (strlen($texte)>0){
echo "
", propre($texte), "
";
}
//
// Afficher les mots-cles du groupe
//
$groupe = sql_countsel("spip_mots", "id_groupe=$id_groupe");
echo "
";
// Preliminaire: confirmation de suppression d'un mot lie a qqch
// (cf fin de afficher_groupe_mots_boucle executee a l'appel precedent)
if ($conf_mot AND $son_groupe==$id_groupe) {
echo confirmer_mot($conf_mot, $row_groupes, $groupe);
}
if ($groupe) {
$grouper_mots = charger_fonction('grouper_mots', 'inc');
echo $grouper_mots($id_groupe, $groupe);
}
echo "
";
if (autoriser('modifier','groupemots',$id_groupe)){
echo "\n
";
echo "";
echo "";
echo icone_inline(_T('icone_modif_groupe_mots'), generer_url_ecrire("mots_type","id_groupe=$id_groupe"), "groupe-mot-24.gif", "edit.gif", $spip_lang_left);
echo " | ";
echo "\n";
echo icone_inline(_T('icone_supprimer_groupe_mots'), redirige_action_auteur('instituer_groupe_mots', "-$id_groupe", "mots_tous"), "groupe-mot-24.gif", "supprimer.gif", $spip_lang_left);
echo " | ";
echo "";
echo icone_inline(_T('icone_creation_mots_cles'), generer_url_ecrire("mots_edit","new=oui&id_groupe=$id_groupe&redirect=" . generer_url_retour('mots_tous', "#mots_tous-$id_groupe")), "mot-cle-24.gif", "creer.gif", $spip_lang_right);
echo " |
";
}
echo fin_cadre_enfonce(true);
echo "
";
}
}
echo pipeline('affiche_milieu',array('args'=>array('exec'=>'mots_tous'),'data'=>''));
echo fin_gauche(), fin_page();
}
// http://doc.spip.org/@confirmer_mot
function confirmer_mot ($id_mot, $row_groupe, $total)
{
$row = sql_fetsel("titre", "spip_mots", "id_mot=$id_mot");
if (!$row) return ""; // deja detruit (acces concurrent etc)
if (!autoriser('modifier', 'mot', $id_mot, null, array('id_groupe' => $row_groupe['id_groupe'])))
return ''; // usurpateur
include_spip('inc/grouper_mots');
$titre_mot = typo($row['titre']);
$type_mot = typo($row_groupe['titre']);
$son_groupe = $row_groupe['id_groupe'];
if (($na = intval(_request('na'))) == 1) {
$texte_lie = _T('info_un_article')." ";
} else if ($na > 1) {
$texte_lie = _T('info_nombre_articles', array('nb_articles' => $na)) ." ";
}
if (($nb = intval(_request('nb'))) == 1) {
$texte_lie .= _T('info_une_breve')." ";
} else if ($nb > 1) {
$texte_lie .= _T('info_nombre_breves', array('nb_breves' => $nb))." ";
}
if (($ns = intval(_request('ns'))) == 1) {
$texte_lie .= _T('info_un_site')." ";
} else if ($ns > 1) {
$texte_lie .= _T('info_nombre_sites', array('nb_sites' => $ns))." ";
}
if (($nr = intval(_request('nr'))) == 1) {
$texte_lie .= _T('info_une_rubrique')." ";
} else if ($nr > 1) {
$texte_lie .= _T('info_nombre_rubriques', array('nb_rubriques' => $nr))." ";
}
return debut_boite_info(true)
. ""
. _T('info_delet_mots_cles', array('titre_mot' => $titre_mot, 'type_mot' => $type_mot, 'texte_lie' => $texte_lie))
. "
"
. generer_supprimer_mot($id_mot, $son_groupe, ("" . _T('item_oui') . ""), $total)
. "
\n"
. _T('info_oui_suppression_mot_cle')
. '
'
/* troublant. A refaire avec une visibility
. "
"
. _T('item_non')
. ", "
. _T('info_non_suppression_mot_cle')
. "" */
. " "
. fin_boite_info(true);
}
?>