[ Index ]
 

Code source de SPIP 1.9.2c

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/ecrire/action/ -> instituer_groupe_mots.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/filtres');
  16  include_spip('base/abstract_sql');
  17  
  18  // http://doc.spip.org/@action_instituer_groupe_mots_dist
  19  function action_instituer_groupe_mots_dist()
  20  {
  21      $securiser_action = charger_fonction('securiser_action', 'inc');
  22      $arg = $securiser_action();
  23  
  24      if (preg_match(",^([a-zA-Z_]\w+)$,", $arg, $r)) 
  25        action_instituer_groupe_mots_get($arg);
  26      elseif (!preg_match(",^(-?\d+)$,", $arg, $r)) {
  27           spip_log("action_instituer_groupe_mots_dist $arg pas compris");
  28      } else action_instituer_groupe_mots_post($r);
  29  }
  30  
  31  
  32  // http://doc.spip.org/@action_instituer_groupe_mots_post
  33  function action_instituer_groupe_mots_post($r)
  34  {
  35      global $acces_comite, $acces_forum, $acces_minirezo, $new, $articles, $breves, $change_type, $descriptif, $id_groupe, $obligatoire, $rubriques, $syndic, $texte, $unseul;
  36  
  37      $id_groupe = $r[1];
  38  
  39      if ($id_groupe < 0){
  40          spip_query("DELETE FROM spip_groupes_mots WHERE id_groupe=" . (0- $id_groupe));
  41      } else {
  42          $change_type = (corriger_caracteres($change_type));
  43          $texte = (corriger_caracteres($texte));
  44          $descriptif = (corriger_caracteres($descriptif));
  45  
  46          if ($id_groupe) {    // modif groupe
  47              spip_query("UPDATE spip_mots SET type=" . _q($change_type) . " WHERE id_groupe=$id_groupe");
  48  
  49              spip_query("UPDATE spip_groupes_mots SET titre=" . _q($change_type) . ", texte=" . _q($texte) . ", descriptif=" . _q($descriptif) . ", unseul=" . _q($unseul) . ", obligatoire=" . _q($obligatoire) . ", articles=" . _q($articles) . ", breves=" . _q($breves) . ", rubriques=" . _q($rubriques) . ", syndic=" . _q($syndic) . ",    minirezo=" . _q($acces_minirezo) . ", comite=" . _q($acces_comite) . ", forum=" . _q($acces_forum) . " WHERE id_groupe=$id_groupe");
  50  
  51          } else {    // creation groupe
  52            spip_abstract_insert('spip_groupes_mots', "(titre, texte, descriptif, unseul,  obligatoire, articles, breves, rubriques, syndic, minirezo, comite, forum)", "(" . _q($change_type) . ", " . _q($texte) . " , " . _q($descriptif) . " , " . _q($unseul) . " , " . _q($obligatoire) . " , " . _q($articles) . " ," . _q($breves) . " , " . _q($rubriques) . " , " . _q($syndic) . " , " . _q($acces_minirezo) . " ,  " . _q($acces_comite) . " , " . _q($acces_forum) . " )");
  53          }
  54      }
  55  }
  56  
  57  
  58  // http://doc.spip.org/@action_instituer_groupe_mots_get
  59  function action_instituer_groupe_mots_get($table)
  60  {
  61      $titre = _T('info_mot_sans_groupe');
  62  
  63      $id_groupe = spip_abstract_insert("spip_groupes_mots", "(titre, unseul, obligatoire, articles, breves, rubriques, syndic, minirezo, comite, forum)", "(" . _q($titre) . ", 'non',  'non', '" . (($table=='articles') ? 'oui' : 'non') ."', '" . (($table=='breves') ? 'oui' : 'non') ."','" . (($table=='rubriques') ? 'oui' : 'non') ."','" . (($table=='syndic') ? 'oui' : 'non') ."', 'oui', 'non', 'non'" . ")");
  64  
  65          redirige_par_entete(parametre_url(urldecode(_request('redirect')),
  66                        'id_groupe', $id_groupe, '&'));
  67  }
  68  
  69  ?>


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