[ Index ]
 

Code source de SPIP Agora 1.4

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Agora1-4/ecrire/ -> sites_edit.php (source)

   1  <?php
   2  /*****************************************************
   3  * This file is part of Agora, web based content management system.
   4  *
   5  * Agora is free software; you can redistribute it and/or modify
   6  * it under the terms of the GNU General Public License as published by
   7  * the Free Software Foundation; version 2 of the License.
   8  *
   9  * Agora is distributed in the hope that it will be useful,
  10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  * GNU General Public License for more details (file "COPYING").
  13  *
  14  * Copyright © Arnaud Martin, Antoine Pitrou et Philippe Rivière.
  15  * List of authors detailed in "copyright_fr.html" file.
  16  * E-mail : agora@sig.premier-ministre.gouv.fr
  17  * Web site : http://www.agora.gouv.fr
  18  *****************************************************/
  19  include  ("inc.php");
  20  
  21  include_ecrire  ("inc_sites.php");
  22  
  23  $proposer_sites = lire_meta("proposer_sites");
  24  
  25  function mySel ($varaut, $variable) {
  26      $retour = " VALUE=\"$varaut\"";
  27  
  28      if ($variable == $varaut) {
  29          $retour .= " SELECTED";
  30      }
  31  
  32      return $retour;
  33  }
  34  
  35  $proposer_sites = lire_meta("proposer_sites");
  36  
  37  //-------------MODIFICATION CLEVER AGE elebescond
  38  $syndicMetier = &recuperer_instance_syndic();
  39  $loadOK = $syndicMetier->load($id_syndic);
  40  
  41  if (!PEAR::isError($loadOK)) {
  42      $id_syndic = $syndicMetier->getSyndicId();
  43      $id_rubrique = $syndicMetier->getRubriqueId();
  44      //--------Zone de modifications Clever Age elebescond-------------
  45      $authorization = &recuperer_instance_authorization('isManagedRubriqueByAuteurId', $GLOBALS['connect_id_auteur'], array('rubriqueId' => $id_rubrique));
  46  
  47      if (!$authorization->isAuthorizedAction()) {
  48          echo _T('avis_acces_interdit');
  49          exit;
  50      }
  51  
  52      $authorization = &recuperer_instance_authorization('modifierSite', $GLOBALS['connect_id_auteur'], array('id_syndic' => $id_syndic));
  53  
  54      if (!$authorization->isAuthorizedAction()) {
  55          echo _T('avis_acces_interdit');
  56          exit;
  57      }
  58  
  59      //--------Fin Zone de modifications Clever Age elebescond-------------
  60      $nom_site = $syndicMetier->getNomSite();
  61      $url_site = $syndicMetier->getUrlSite();
  62      $url_syndic = $syndicMetier->getUrlSyndic();
  63      $descriptif = $syndicMetier->getDescriptif();
  64      $syndication = $syndicMetier->getSyndication();
  65  }
  66  else {
  67      $syndication = 'non';
  68      $new = 'oui';
  69  }
  70  
  71  debut_page(_T('info_site_reference_2'), "documents", "sites");
  72  
  73  debut_grand_cadre();
  74  afficher_parents ($id_rubrique);
  75  $parents = "~ <img src='img_pack/racine-site-24.gif' width=24 height=24 align='middle'> <A HREF='naviguer.php?coll=0'><B>" . _T('lien_racine_site'). "</B></A> " . aide("rubhier"). "<BR>" . $parents;
  76  
  77  $parents = ereg_replace("~", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $parents);
  78  $parents = ereg_replace("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ", "", $parents);
  79  
  80  echo "$parents";
  81  
  82  fin_grand_cadre();
  83  
  84  debut_gauche();
  85  debut_droite();
  86  debut_cadre_formulaire();
  87  
  88  echo "\n<table cellpadding=0 cellspacing=0 border=0 width='100%'>";
  89  echo "<tr width='100%'>";
  90  
  91  if ($new != 'oui') {
  92      echo "<td>";
  93      icone(_T('icone_retour'), "sites.php?id_syndic=$id_syndic", 'site-24.gif', "rien.gif");
  94      echo "</td>";
  95      echo "<td><img src='img_pack/rien.gif' width=10></td>\n";
  96  }
  97  
  98  echo "<td width='100%'>";
  99  echo _T('titre_referencer_site');
 100  gros_titre ($nom_site);
 101  echo "</td></tr></table>";
 102  echo "<p>";
 103  
 104  if ($new == 'oui') {
 105      $proposer_sites = lire_meta("proposer_sites");
 106      //------------AJOUT elebescond@clever-age.com-------------------------------
 107      $authorization = &recuperer_instance_authorization('creerSite', $GLOBALS['connect_id_auteur']);
 108      if ($authorization->isAuthorizedAction()OR $proposer_sites > 0) {
 109          //if ($connect_statut == 'minirezo' OR $proposer_sites > 0) {
 110          //------------FIN AJOUT elebescond@clever-age.com-------------------------------    
 111          debut_cadre_relief ("site-24.gif");
 112  
 113          $link = new Link('sites.php');
 114  
 115          if (!$id_rubrique) { // si l'id de la rubrique n'est pas défini, on passe directement sur la premiere rubrique dont l'auteur à accès
 116              include_once (dirname(__FILE__). '/include/bd/inc_auteur_factory.php');
 117              $auteur = &recuperer_instance_auteur();
 118              $auteur->load($GLOBALS['connect_id_auteur']);
 119              $id_rubrique = $auteur->getPremiereRubrique();
 120          }
 121  
 122          $link->addVar('id_rubrique', $id_rubrique);
 123          $link->addVar('new', 'oui');
 124          $link->addVar('redirect', $clean_link->getUrl());
 125          $link->addVar('analyser_site', 'oui');
 126          echo $link->getForm();
 127          echo "<font face='Verdana,Arial,Sans,sans-serif' size=2>" . _T('texte_referencement_automatique'). "</font>";
 128          echo "<div align='right'><input type=\"text\" name=\"url\" class='fondl' value=\"http://\">";
 129          echo "<input type=\"submit\" name=\"submit\" value=\"" . _T('bouton_ajouter'). "\" class='fondo'>";
 130  
 131          fin_cadre_relief();
 132          echo "</form>";
 133  
 134          echo "<p><b>" . _T('texte_non_fonction_referencement'). "</b>";
 135          $cadre_ouvert = true;
 136          debut_cadre_enfonce ("site-24.gif");
 137      }
 138  }
 139  
 140  $link = new Link($target);
 141  $link->addVar('new');
 142  $link->addVar('modifier_site', 'oui');
 143  $link->addVar('syndication_old', $syndication);
 144  echo $link->getForm('POST', null, null, 'formulaire');
 145  
 146  $nom_site = entites_html($nom_site);
 147  $url_site = entites_html($url_site);
 148  $url_syndic = entites_html($url_syndic);
 149  
 150  echo "<input type='hidden' name='id_syndic' value=\"$id_syndic\">";
 151  
 152  echo _T('info_nom_site_2'). "<br>";
 153  echo "<input type='text' class='formo' name='nom_site' value=\"$nom_site\" size='40'><p>";
 154  
 155  if (strlen($url_site) < 8)
 156      $url_site = "http://";
 157  
 158  echo _T('entree_adresse_site'). "<br>";
 159  echo "<input type='text' class='formo' name='url_site' value=\"$url_site\" size='40'><p>";
 160  
 161  if ($id_rubrique == 0)
 162      $logo_parent = "racine-site-24.gif";
 163  else {
 164      /* Modification Clever Age, elebescond, utilisation couche métier */
 165      $rubriqueMetier = recuperer_instance_rubrique();
 166      $loadOK = $rubriqueMetier->load($id_rubrique);
 167  
 168      if (PEAR::isError($loadOK)) {
 169          die ($loadOK->getMessage());
 170      }
 171      else {
 172          $parent_parent = $rubriqueMetier->getParentId();
 173      }
 174  
 175      if ($parent_parent == 0)
 176          $logo_parent = "secteur-24.gif";
 177      else
 178          $logo_parent = "rubrique-24.gif";
 179  }
 180  
 181  debut_cadre_relief ("$logo_parent");
 182  echo "<b>" . _T('entree_interieur_rubrique'). "</b><br>\n";
 183  echo selecteur_rubrique($syndicMetier, $id_rubrique, $rubriqueMetier);
 184  fin_cadre_relief();
 185  
 186  echo "<b>" . _T('entree_description_site'). "</b><br>";
 187  echo "<textarea name='descriptif' rows='8' class='forml' cols='40' wrap=soft>";
 188  echo $descriptif;
 189  echo "</textarea>\n";
 190  
 191  $activer_syndic = lire_meta("activer_syndic");
 192  
 193  echo "<input type='hidden' name='syndication_old' value=\"$syndication\">";
 194  
 195  if ($activer_syndic != "non") {
 196      debut_cadre_enfonce();
 197  
 198      if ($syndication == "non") {
 199          echo "<INPUT TYPE='radio' NAME='syndication' VALUE='non' id='syndication_non' CHECKED>";
 200      }
 201      else {
 202          echo "<INPUT TYPE='radio' NAME='syndication' VALUE='non' id='syndication_non'>";
 203      }
 204  
 205      echo " <b><label for='syndication_non'>" . _T('bouton_radio_non_syndication'). "</label></b><p>";
 206  
 207      if ($syndication == "non") {
 208          echo "<INPUT TYPE='radio' NAME='syndication' VALUE='oui' id='syndication_oui'>";
 209      }
 210      else {
 211          echo "<INPUT TYPE='radio' NAME='syndication' VALUE='oui' id='syndication_oui' CHECKED>";
 212      }
 213  
 214      echo " <b><label for='syndication_oui'>" . _T('bouton_radio_syndication'). "</label></b>";
 215      echo aide("rubsyn");
 216  
 217      echo "<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td width=50>&nbsp;</td><td>";
 218  
 219      if (strlen($url_syndic) < 8)
 220          $url_syndic = "http://";
 221  
 222      echo _T('entree_adresse_fichier_syndication');
 223      echo "<br>";
 224      echo "<INPUT TYPE='text' CLASS='formo' NAME='url_syndic' VALUE=\"$url_syndic\" SIZE='40'><P>";
 225      echo "<INPUT TYPE='hidden' NAME='old_syndic' VALUE=\"$url_syndic\"";
 226      echo "</td></tr></table>";
 227  
 228      fin_cadre_enfonce();
 229  }
 230  else {
 231      echo "<INPUT TYPE='Hidden' NAME='syndication' VALUE=\"$syndication\">";
 232      echo "<INPUT TYPE='hidden' NAME='url_syndic' VALUE=\"$url_syndic\"";
 233  }
 234  
 235  echo "<div ALIGN='right'><INPUT TYPE='submit' NAME='Valider' VALUE='" . _T('bouton_valider'). "' CLASS='fondo'></div>";
 236  echo "</FORM>";
 237  
 238  if ($cadre_ouvert)
 239      fin_cadre_enfonce();
 240  
 241  fin_cadre_formulaire();
 242  
 243  fin_page();
 244  ?>


Généré le : Sat Feb 24 14:40:03 2007 par Balluche grâce à PHPXref 0.7