[ Index ]
 

Code source de SPIP 1.9.2c

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/ecrire/exec/ -> mots_type.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  
  17  // http://doc.spip.org/@exec_mots_type_dist
  18  function exec_mots_type_dist()
  19  {
  20      global $connect_statut, $descriptif, $id_groupe, $new, $options, $texte, $titre;
  21  
  22      if ($new == "oui") {
  23        $id_groupe = 0;
  24        $type = filtrer_entites(_T('titre_nouveau_groupe'));
  25        $onfocus = " onfocus=\"if(!antifocus){this.value='';antifocus=true;}\"";
  26        $ancien_type = '';
  27        $unseul = 'non';
  28        $obligatoire = 'non';
  29        $articles = 'oui';
  30        $breves = 'oui';
  31        $rubriques = 'non';
  32        $syndic = 'oui';
  33        $acces_minirezo = 'oui';
  34        $acces_comite = 'oui';
  35        $acces_forum = 'non';
  36      } else {
  37          $id_groupe= intval($id_groupe);
  38          $result_groupes = spip_query("SELECT * FROM spip_groupes_mots WHERE id_groupe=$id_groupe");
  39  
  40          while($row = spip_fetch_array($result_groupes)) {
  41              $id_groupe = $row['id_groupe'];
  42              $type = $row['titre'];
  43              $titre = typo($type);
  44              $descriptif = $row['descriptif'];
  45              $texte = $row['texte'];
  46              $unseul = $row['unseul'];
  47              $obligatoire = $row['obligatoire'];
  48              $articles = $row['articles'];
  49              $breves = $row['breves'];
  50              $rubriques = $row['rubriques'];
  51              $syndic = $row['syndic'];
  52              $acces_minirezo = $row['minirezo'];
  53              $acces_comite = $row['comite'];
  54              $acces_forum = $row['forum'];
  55              $onfocus ="";
  56          }
  57      }
  58  
  59      pipeline('exec_init',array('args'=>array('exec'=>'mots_types','id_groupe'=>$id_groupe),'data'=>''));
  60      $commencer_page = charger_fonction('commencer_page', 'inc');
  61      echo $commencer_page("&laquo; $titre &raquo;", "naviguer", "mots");
  62      
  63      debut_gauche();
  64  
  65      echo pipeline('affiche_gauche',array('args'=>array('exec'=>'mots_types','id_groupe'=>$id_groupe),'data'=>''));
  66      creer_colonne_droite();
  67      echo pipeline('affiche_droite',array('args'=>array('exec'=>'mots_types','id_groupe'=>$id_groupe),'data'=>''));
  68      debut_droite();
  69  
  70      if ($connect_statut != "0minirezo") {
  71          echo "<h3>"._T('avis_non_acces_page')."</h3>";
  72          exit;
  73      }
  74  
  75  
  76      $type = entites_html(rawurldecode($type));
  77  
  78      $res = debut_cadre_relief("groupe-mot-24.gif", true)
  79      . "\n<table cellpadding='0' cellspacing='0' border='0' width='100%'>"
  80      . "<tr>"
  81      . "<td  align='right' valign='top'>"
  82      . icone(_T('icone_retour'), generer_url_ecrire("mots_tous",""), "mot-cle-24.gif", "rien.gif",'', false)
  83      . "</td>"
  84      . "<td>". http_img_pack('rien.gif', " ", "width='5'") . "</td>\n"
  85      . "<td style='width: 100%' valign='top'>"
  86        . "<span class='verdana1 spip_x-small'><b>". _T('titre_groupe_mots') . "</b></span><br />"
  87        . gros_titre($titre,'',false)
  88      . aide("motsgroupes")
  89      . "<div class='verdana1'>"
  90      . debut_cadre_formulaire('',true)
  91      . "<b>"._T('info_changer_nom_groupe')."</b><br />\n"
  92      . "<input type='text' size='40' class='formo' name='change_type' value=\"$type\" $onfocus />\n";
  93          
  94      if ($options == 'avancees' OR $descriptif) {
  95              $res .= "<br /><b>"._T('texte_descriptif_rapide')
  96              . "</b><br />"
  97              . "<textarea name='descriptif' class='forml' rows='4' cols='40'>"
  98              . entites_html($descriptif)
  99              . "</textarea>\n";
 100      } else
 101              $res .= "<input type='hidden' name='descriptif' value=\"$descriptif\" />";
 102  
 103      if ($options == 'avancees' OR $texte) {
 104              $res .= "<br /><b>"._T('info_texte_explicatif')."</b><br />";
 105              $res .= "<textarea name='texte' rows='8' class='forml' cols='40'>";
 106              $res .= entites_html($texte);
 107              $res .= "</textarea>\n";
 108      } else
 109            $res .= "<input type='hidden' name='texte' value=\"$texte\" />";
 110  
 111      $res .= "<div align='right'><input type='submit' class='fondo' value='"
 112      . _T('bouton_valider')
 113      . "' /></div>"
 114      . fin_cadre_formulaire(true)
 115      . "</div>"
 116      . "</td></tr></table>"
 117      . fin_cadre_relief(true)
 118      . "<br />\n<div class='verdana1'>"
 119      . debut_cadre_formulaire('',true)
 120      . "<div style='padding: 5px; border: 1px dashed #aaaaaa; background-color: #dddddd;'>"
 121      . "<b>"._T('info_mots_cles_association')."</b>"
 122      . "<br />";
 123          
 124      $checked =  ($articles == "oui") ? "checked='checked'" : ''; 
 125      $res .= "<input type='checkbox' name='articles' value='oui' $checked id='articles' /> <label for='articles'>"._T('item_mots_cles_association_articles')."</label><br />";
 126      $activer_breves = $GLOBALS['meta']["activer_breves"];
 127  
 128      if ($activer_breves != "non"){
 129          $checked =  ($breves == "oui") ? "checked='checked'" : '';
 130              
 131          $res .= "<input type='checkbox' name='breves' value='oui' $checked id='breves' /> <label for='breves'>"._T('item_mots_cles_association_breves')."</label><br />";
 132      } else {
 133          $res .= "<input type='hidden' name='breves' value='non' />";
 134      }
 135      $checked = ($rubriques == "oui") ? "checked='checked'" : '';    
 136  
 137      $res .= "<input type='checkbox' name='rubriques' value='oui' $checked id='rubriques' /> <label for='rubriques'>"._T('item_mots_cles_association_rubriques')."</label><br />";
 138  
 139      $checked = ($syndic == "oui") ? "checked='checked'" : ''; 
 140      $res .= "<input type='checkbox' name='syndic' value='oui' $checked id='syndic' /> <label for='syndic'>"._T('item_mots_cles_association_sites')."</label>"
 141      .  "</div>";
 142  
 143      if ($GLOBALS['meta']["config_precise_groupes"] == "oui" OR $unseul == "oui" OR $obligatoire == "oui"){
 144          $res .= "<div style='padding: 5px; border: 1px dashed #aaaaaa; background-color: #dddddd;'>";
 145  
 146          $checked =  ($unseul == "oui") ? "checked='checked'" : ''; 
 147          $res .= "<input type='checkbox' name='unseul' value='oui' $checked id='unseul' /> <label for='unseul'>"._T('info_selection_un_seul_mot_cle')."</label>";
 148          $res .= "<br />";
 149  
 150          $checked = ($obligatoire == "oui") ? "checked='checked'" : '';
 151          $res .= "<input type='checkbox' name='obligatoire' value='oui' $checked id='obligatoire' /> <label for='obligatoire'>"._T('avis_conseil_selection_mot_cle')."</label>";
 152          $res .= "</div>";
 153      } else {
 154            $res .= "<input type='hidden' name='unseul' value='non' />";
 155            $res .= "<input type='hidden' name='obligatoire' value='non' />";
 156      }
 157  
 158      $res .= "<div style='padding: 5px; border: 1px dashed #aaaaaa; background-color: #dddddd;'>"
 159      .  "<b>"._T('info_qui_attribue_mot_cle')."</b>"
 160      .  "<br />";
 161          
 162      $checked = ($acces_minirezo == "oui") ? "checked='checked'" : ''; 
 163      $res .= "<input type='checkbox' name='acces_minirezo' value='oui' $checked id='administrateurs' /> <label for='administrateurs'>"
 164       . _T('bouton_checkbox_qui_attribue_mot_cle_administrateurs')
 165      . "</label><br />";
 166  
 167      $checked =  ($acces_comite == "oui") ? "checked='checked'" : ''; 
 168      $res .= "<input type='checkbox' name='acces_comite' value='oui' $checked id='comite' /> <label for='comite'>"._T('bouton_checkbox_qui_attribue_mot_cle_redacteurs')."</label><br />";
 169      
 170      $mots_cles_forums = $GLOBALS['meta']["mots_cles_forums"];
 171      $forums_publics=$GLOBALS['meta']["forums_publics"];
 172          
 173      if (($mots_cles_forums == "oui" OR $acces_forum == "oui") AND $forums_publics != "non"){
 174          $checked = ($acces_forum == "oui") ? "checked='checked'" : ''; 
 175          $res .= "<input type='checkbox' name='acces_forum' value='oui' $checked id='forum' /> <label for='forum'>"._T('bouton_checkbox_qui_attribue_mot_cle_visiteurs')."</label>";
 176      } 
 177      else {
 178          $res .= "<input type='hidden' name='acces_forum' value='non' />";
 179      }
 180              
 181      $res .= "<br /></div><div align='right'><input type='submit' class='fondo' value='"
 182      . _T('bouton_valider')
 183      . "' /></div>"
 184      .  fin_cadre_formulaire(true)
 185      . "</div>";
 186  
 187      $res .= pipeline('affiche_milieu',array('args'=>array('exec'=>'mots_types','id_groupe'=>$id_groupe),'data'=>''));
 188  
 189  
 190      echo redirige_action_auteur('instituer_groupe_mots', $id_groupe, "mots_tous", "id_groupe=$id_groupe", $res),
 191          fin_gauche(),
 192          fin_page();
 193  }
 194  
 195  ?>


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