[ Index ]
 

Code source de SPIP 1.9.2c

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/ecrire/exec/ -> mots_tous.php (source)

   1  <?php
   2  
   3  /***************************************************************************\
   4   *  SPIP, Systeme de publication pour l'internet                           *
   5   *                                                                         *
   6   *  Copyright (c) 2001-2007                                                *
   7   *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
   8   *                                                                         *
   9   *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
  10   *  Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne.   *
  11  \***************************************************************************/
  12  
  13  if (!defined("_ECRIRE_INC_VERSION")) return;
  14  
  15  include_spip('inc/presentation');
  16  include_spip('inc/actions');
  17  
  18  // http://doc.spip.org/@exec_mots_tous_dist
  19  function exec_mots_tous_dist()
  20  {
  21      global $conf_mot, $spip_lang, $spip_lang_right, $son_groupe;
  22  
  23      $conf_mot = intval($conf_mot);
  24  
  25      pipeline('exec_init',array('args'=>array('exec'=>'mots_tous'),'data'=>''));
  26      $commencer_page = charger_fonction('commencer_page', 'inc');
  27      echo $commencer_page(_T('titre_page_mots_tous'), "naviguer", "mots");
  28      debut_gauche();
  29  
  30  
  31      echo pipeline('affiche_gauche',array('args'=>array('exec'=>'mots_tous'),'data'=>''));
  32  
  33      if (autoriser('creer','groupemots')  AND !$conf_mot){
  34          $res = icone_horizontale(_T('icone_creation_groupe_mots'), generer_url_ecrire("mots_type","new=oui"), "groupe-mot-24.gif", "creer.gif",false);
  35  
  36          echo bloc_des_raccourcis($res);
  37      }
  38  
  39  
  40      creer_colonne_droite();
  41      echo pipeline('affiche_droite',array('args'=>array('exec'=>'mots_tous'),'data'=>''));
  42      debut_droite();
  43  
  44      gros_titre(_T('titre_mots_tous'));
  45      if (autoriser('creer','groupemots')) {
  46        echo typo(_T('info_creation_mots_cles')) . aide ("mots") ;
  47      }
  48      echo "<br /><br />";
  49  
  50  //
  51  // On boucle d'abord sur les groupes de mots
  52  //
  53  
  54      $result_groupes = spip_query($q="SELECT *, ".creer_objet_multi ("titre", "$spip_lang")." FROM spip_groupes_mots ORDER BY multi");
  55  
  56      while ($row_groupes = spip_fetch_array($result_groupes)) {
  57          $id_groupe = $row_groupes['id_groupe'];
  58          $titre_groupe = typo($row_groupes['titre']);
  59          $descriptif = $row_groupes['descriptif'];
  60          $texte = $row_groupes['texte'];
  61          $unseul = $row_groupes['unseul'];
  62          $obligatoire = $row_groupes['obligatoire'];
  63          $articles = $row_groupes['articles'];
  64          $breves = $row_groupes['breves'];
  65          $rubriques = $row_groupes['rubriques'];
  66          $syndic = $row_groupes['syndic'];
  67          $acces_minirezo = $row_groupes['minirezo'];
  68          $acces_comite = $row_groupes['comite'];
  69          $acces_forum = $row_groupes['forum'];
  70  
  71          // Afficher le titre du groupe
  72          echo "<a id='mots_tous-$id_groupe'></a>";
  73  
  74          debut_cadre_enfonce("groupe-mot-24.gif", false, '', $titre_groupe);
  75          // Affichage des options du groupe (types d'elements, permissions...)
  76          $res = '';
  77          if ($articles == "oui") $res .= "> "._T('info_articles_2')." &nbsp;&nbsp;";
  78          if ($breves == "oui") $res .= "> "._T('info_breves_02')." &nbsp;&nbsp;";
  79          if ($rubriques == "oui") $res .= "> "._T('info_rubriques')." &nbsp;&nbsp;";
  80          if ($syndic == "oui") $res .= "> "._T('icone_sites_references')." &nbsp;&nbsp;";
  81  
  82          if ($unseul == "oui" OR $obligatoire == "oui") $res .= "<br />";
  83          if ($unseul == "oui") $res .= "> "._T('info_un_mot')." &nbsp;&nbsp;";
  84          if ($obligatoire == "oui") $res .= "> "._T('info_groupe_important')." &nbsp;&nbsp;";
  85  
  86          $res .= "<br />";
  87          if ($acces_minirezo == "oui") $res .= "> "._T('info_administrateurs')." &nbsp;&nbsp;";
  88          if ($acces_comite == "oui") $res .= "> "._T('info_redacteurs')." &nbsp;&nbsp;";
  89          if ($acces_forum == "oui") $res .= "> "._T('info_visiteurs_02')." &nbsp;&nbsp;";
  90  
  91           echo "<span class='verdana1 spip_x-small'>", $res, "</span>";
  92          if ($descriptif) {
  93              echo "<div style='border: 1px dashed #aaaaaa; ' class='verdana1 spip_small'>", "<b>",_T('info_descriptif'),"</b> ", propre($descriptif), "&nbsp; </div>";
  94          }
  95  
  96          if (strlen($texte)>0){
  97              echo "<span class='verdana1 spip_small'>", propre($texte), "</span>";
  98          }
  99  
 100          //
 101          // Afficher les mots-cles du groupe
 102          //
 103  
 104          $groupe = spip_fetch_array(spip_query("SELECT COUNT(*) AS n FROM spip_mots WHERE id_groupe=$id_groupe"));
 105          $groupe = $groupe['n'];
 106  
 107          echo "<div\nid='editer_mot-$id_groupe' style='position: relative;'>";
 108  
 109          // Preliminaire: confirmation de suppression d'un mot lie à qqch
 110          // (cf fin de afficher_groupe_mots_boucle executee a l'appel precedent)
 111          if ($conf_mot  AND $son_groupe==$id_groupe) {
 112              include_spip('inc/grouper_mots');
 113              echo confirmer_mot($conf_mot, $id_groupe, $groupe);
 114          }
 115          if ($groupe) {
 116                $grouper_mots = charger_fonction('grouper_mots', 'inc');
 117              echo $grouper_mots($id_groupe, $groupe);
 118          }
 119  
 120          echo "</div>";
 121  
 122          if (autoriser('modifier','groupemots',$id_groupe)){
 123              echo "\n<table cellpadding='0' cellspacing='0' border='0' width='100%'>";
 124              echo "<tr>";
 125              echo "<td>";
 126              icone(_T('icone_modif_groupe_mots'), generer_url_ecrire("mots_type","id_groupe=$id_groupe"), "groupe-mot-24.gif", "edit.gif");
 127              echo "</td>";
 128              echo "\n<td id='editer_mot-$id_groupe-supprimer'",
 129                (!$groupe ? '' : " style='visibility: hidden'"),
 130                ">";
 131              icone(_T('icone_supprimer_groupe_mots'), redirige_action_auteur('instituer_groupe_mots', "-$id_groupe", "mots_tous"), "groupe-mot-24.gif", "supprimer.gif");
 132              echo "</td>";
 133              echo "<td>";
 134              echo "<div align='$spip_lang_right'>";
 135              icone(_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");
 136              echo "</div>";
 137              echo "</td></tr></table>";
 138          }    
 139  
 140          fin_cadre_enfonce();
 141      }
 142  
 143      echo pipeline('affiche_milieu',array('args'=>array('exec'=>'mots_tous'),'data'=>''));
 144  
 145  
 146      echo fin_gauche(), fin_page();
 147  }
 148  
 149  // http://doc.spip.org/@confirmer_mot
 150  function confirmer_mot ($conf_mot, $son_groupe, $total)
 151  {
 152      $row = spip_fetch_array(spip_query("SELECT * FROM spip_mots WHERE id_mot=$conf_mot"));
 153      if (!$row) return ""; // deja detruit (acces concurrent etc)
 154  
 155      $id_mot = $row['id_mot'];
 156      $titre_mot = typo($row['titre']);
 157      $type_mot = typo($row['type']);
 158  
 159      if (($na = intval(_request('na'))) == 1) {
 160          $texte_lie = _T('info_un_article')." ";
 161      } else if ($na > 1) {
 162          $texte_lie = _T('info_nombre_articles', array('nb_articles' => $na)) ." ";
 163      }
 164      if (($nb = intval(_request('nb'))) == 1) {
 165          $texte_lie .= _T('info_une_breve')." ";
 166      } else if ($nb > 1) {
 167          $texte_lie .= _T('info_nombre_breves', array('nb_breves' => $nb))." ";
 168      }
 169      if (($ns = intval(_request('ns'))) == 1) {
 170          $texte_lie .= _T('info_un_site')." ";
 171      } else if ($ns > 1) {
 172          $texte_lie .= _T('info_nombre_sites', array('nb_sites' => $ns))." ";
 173      }
 174      if (($nr = intval(_request('nr'))) == 1) {
 175          $texte_lie .= _T('info_une_rubrique')." ";
 176      } else if ($nr > 1) {
 177          $texte_lie .= _T('info_nombre_rubriques', array('nb_rubriques' => $nr))." ";
 178      }
 179  
 180      return debut_boite_info(true)
 181      . "<div class='serif'>"
 182      . _T('info_delet_mots_cles', array('titre_mot' => $titre_mot, 'type_mot' => $type_mot, 'texte_lie' => $texte_lie))
 183      . "<p style='text-align: right'>"
 184      . generer_supprimer_mot($id_mot, $son_groupe, ("<b>" . _T('item_oui') . "</b>"), $total)
 185      . "<br />\n"
 186      .  _T('info_oui_suppression_mot_cle')
 187      . '</p>'
 188        /* troublant. A refaire avec une visibility
 189       . "<li><b><a href='" 
 190      . generer_url_ecrire("mots_tous")
 191      . "#editer_mot-$son_groupe"
 192      . "'>"
 193      . _T('item_non')
 194      . "</a>,</b> "
 195      . _T('info_non_suppression_mot_cle')
 196      . "</ul>" */
 197      . "</div>"
 198      . fin_boite_info(true);
 199  }
 200  ?>


Généré le : Wed Nov 21 10:20:27 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics