[ Index ]
 

Code source de SPIP Agora 1.4

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

title

Body

[fermer]

/Agora1-4/ecrire/ -> brouteur_frame.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  debut_html();
  22  
  23  if ($spip_ecran == "large") {
  24      $nb_col = 4;
  25  }
  26  else {
  27      $nb_col = 3;
  28  }
  29  
  30  if ($effacer_suivant == "oui") {
  31      for ($i = $frame + 1; $i < $nb_col; $i++) {
  32          echo "<script type='text/javascript'>\n"
  33              ."<!--\n"
  34              ."parent.iframe$i.location.href='brouteur_frame.php?frame=$i'\n"
  35              ."-->\n"
  36              ."</script>\n";
  37      }
  38  }
  39  
  40  echo "<div class='arial2'>";
  41  
  42  if ($special == "redac") {
  43      $articleMetier = &recuperer_instance_article();
  44      $articles = $articleMetier->getArticlesForStatutAndAuteur('prepa', $connect_id_auteur);
  45  
  46      if (PEAR::isError($articles)) {
  47          die ($articles->getMessage());
  48      }
  49      if (sizeOf($articles) > 0) {
  50          echo "<div style='padding-top:6px; padding-bottom:3px;'><b class='verdana2'>"
  51               ._T("info_cours_edition")."</b></div>";
  52          echo "<div class='plan-articles'>";
  53  
  54          while (list(, $article) = each($articles)) {
  55              $authorization = &recuperer_instance_authorization(
  56                                    'isManagedRubriqueByAuteurId', $GLOBALS['connect_id_auteur'],
  57                                    array('rubriqueId' => $article->getRubriqueId()));
  58              if ($authorization->isAuthorizedAction()) {
  59                  $id_article = $article->getArticleId();
  60                  $titre = $article->getTitre();
  61                  $statut = $article->getStatut();
  62                  echo "<a class='$statut' href='javascript:window.parent.location=\"articles.php?id_article=$id_article\"'>$titre</a>";
  63              }
  64          }
  65          echo "</div>";
  66      }
  67  }
  68  else if ($special == "valider") {
  69      $articleMetier = &recuperer_instance_article();
  70      $articles = $articleMetier->getAllForStatut('prop', 'date_heure', true);
  71  
  72      if (PEAR::isError($articles)) {
  73          die ($articles->getMessage());
  74      }
  75  
  76      if (sizeOf($articles) > 0) {
  77          echo "<div style='padding-top:6px; padding-bottom:3px;'><b class='verdana2'>"
  78              ._T("info_articles_proposes")."</b></div>";
  79          echo "<div class='plan-articles'>";
  80  
  81          while (list(, $article) = each($articles)) {
  82              $authorization = &recuperer_instance_authorization(
  83                                    'isManagedRubriqueByAuteurId', $GLOBALS['connect_id_auteur'],
  84                                    array('rubriqueId' => $article->getRubriqueId()));
  85              if ($authorization->isAuthorizedAction()) {
  86                  $id_article = $article->getArticleId();
  87                  $titre = $article->getTitre();
  88                  $statut = $article->getStatut();
  89                  echo "<a class='$statut' href='javascript:window.parent.location=\"articles.php?id_article=$id_article\"'>$titre</a>";
  90              }
  91          }
  92          echo "</div>";
  93      }
  94  
  95      $breveMetier = &recuperer_instance_breve();
  96      $breves = $breveMetier->getAllForStatut('prop', 'date_heure', true, 0, 20);
  97  
  98      if (PEAR::isError($breves)) {
  99          die ($breves->getMessage());
 100      }
 101      if (sizeOf($breves) > 0) {
 102          echo "<div style='padding-top: 6px;'><b class='verdana2'>"._T("info_breves_valider")."</b></div>";
 103          while (list(, $breve) = each($breves)) {
 104              $authorization = &recuperer_instance_authorization(
 105                                    'isManagedRubriqueByAuteurId', $GLOBALS['connect_id_auteur'],
 106                                    array('rubriqueId' => $breve->getRubriqueId()));
 107              if ($authorization->isAuthorizedAction()) {
 108                  $id_breve = $breve->getArticleId();
 109                  $titre = $breve->getTitre();
 110                  $statut = $breve->getStatut();
 111                  $puce = "puce-orange-breve.gif";
 112                  echo "<div style='margin:3px; padding-top:3px; padding-bottom:3px; padding-$spip_lang_left:12px; background:url(img_pack/$puce) $spip_lang_left center no-repeat;'>"
 113                      ."<a href='javascript:window.parent.location=\"breves_voir.php?id_breve=$id_breve\"' class='arial1'>"
 114                      .$titre."</a></div>";
 115              }
 116          }
 117      }
 118  }
 119  else {
 120      $rubriqueMetier = &recuperer_instance_rubrique();
 121      $loadOK = $rubriqueMetier->load($id_rubrique);
 122  
 123      if (!PEAR::isError($loadOK)) {
 124          $authorization = &recuperer_instance_authorization('isManagedRubriqueByAuteurId', $GLOBALS['connect_id_auteur'],
 125                                                             array('rubriqueId' => $rubriqueMetier->getRubriqueId()));
 126          if ($authorization->isAuthorizedAction()) {
 127              $ze_rubrique = $rubriqueMetier->getRubriqueId();
 128              $titre = $rubriqueMetier->getTitre();
 129              $id_parent = $rubriqueMetier->getParentId();
 130  
 131              if ($id_parent == 0)
 132                  $icone = "secteur-24.gif";
 133              else
 134                  $icone = "rubrique-24.gif";
 135  
 136              echo "<div style='background-color: #cccccc; margin-bottom: 3px;'>";
 137              icone_horizontale("$titre", "javascript:window.parent.location=\"naviguer.php?coll=$id_rubrique\"",
 138                                "$icone", "");
 139              echo "</div>";
 140          }
 141      }
 142      else if ($frame == 0) {
 143          echo "<div style='background-color: #cccccc; margin-bottom: 3px;'>";
 144          icone_horizontale(_T('info_racine_site'), "javascript:window.parent.location=\"naviguer.php\"",
 145                            "racine-site-24.gif", "");
 146          echo "</div>";
 147      }
 148  
 149      $rubriqueMetier = &recuperer_instance_rubrique();
 150      $rubriques = $rubriqueMetier->getAllForParentId($id_rubrique, 'titre');
 151  
 152      if (!PEAR::isError($rubriques)) {
 153          while (list(, $rubrique) = each($rubriques)) {
 154              $authorization = &recuperer_instance_authorization(
 155                                    'isManagedRubriqueByAuteurId', $GLOBALS['connect_id_auteur'],
 156                                    array('rubriqueId' => $rubrique->getRubriqueId()));
 157              if ($authorization->isAuthorizedAction()) {
 158                  $ze_rubrique = $rubrique->getRubriqueId();
 159                  $titre = $rubrique->getTitre();
 160                  $id_parent = $rubrique->getParentId();
 161                  if ($id_parent == '0') {
 162                      echo "<div style='margin:3px; padding-top:5px; padding-bottom:5px; padding-$spip_lang_left:28px; background:url(img_pack/secteur-24.gif) $spip_lang_left center no-repeat;'>"
 163                          ."<b class='verdana2'><a href='brouteur_frame.php?id_rubrique=$ze_rubrique&frame="
 164                          .($frame+1)."&effacer_suivant=oui' target='iframe".($frame+1)."'>$titre</a></b></div>";
 165                  }
 166                  else {
 167                      if ($frame + 1 < $nb_col)
 168                          echo "<div style='margin:3px; padding-top:5px; padding-bottom:5px; padding-$spip_lang_left:28px; background:url(img_pack/rubrique-24.gif) $spip_lang_left center no-repeat;'>"
 169                              ."<b><a href='brouteur_frame.php?id_rubrique=$ze_rubrique&frame="
 170                              .($frame+1)."&effacer_suivant=oui' target='iframe".($frame+1). "'>$titre</a></b></div>";
 171                      else
 172                          echo "<div style='margin:3px; padding-top:5px; padding-bottom:5px; padding-$spip_lang_left:28px; background:url(img_pack/rubrique-24.gif) $spip_lang_left center no-repeat;'>"
 173                              ."<b><a href='javascript:window.parent.location=\"brouteur.php?id_rubrique=$ze_rubrique\"'>$titre</a></b></div>";
 174                  }
 175              }
 176          }
 177      }
 178  
 179      if ($id_rubrique > 0) {
 180          $profilMetier = &recuperer_instance_profil();
 181          $profil = $profilMetier->getProfilForIntitule('item_webmestre');
 182  
 183          if ($connect_profil >= $profil->getPoids()) {
 184              $articleMetier = &recuperer_instance_article();
 185              $articles = $articleMetier->getArticlesForRubriqueId($id_rubrique, 'date_heure', true);
 186          }
 187          else {
 188              $articleMetier = &recuperer_instance_article();
 189              $articles = $articleMetier->getArticlesForRubriqueIdAndAuteurIdAndIDontKnowWhyButIloveYou(
 190                              $id_rubrique, $connect_id_auteur);
 191          }
 192  
 193          if (sizeOf($articles) > 0) {
 194              echo "<div style='padding-top: 6px; padding-bottom: 3px;'><b class='verdana2'>"
 195                  ._T('info_articles'). "</b></div>";
 196              echo "<div class='plan-articles'>";
 197  
 198              while (list(, $article) = each($articles)) {
 199                  $authorization = &recuperer_instance_authorization(
 200                                        'isManagedRubriqueByAuteurId', $GLOBALS['connect_id_auteur'],
 201                                        array('rubriqueId' => $article->getRubriqueId()));
 202                  if ($authorization->isAuthorizedAction()) {
 203                      $id_article = $article->getArticleId();
 204                      $titre = $article->getTitre();
 205                      $statut = $article->getStatut();
 206                      echo "<a class='$statut' href='javascript:window.parent.location=\"articles.php?id_article=$id_article\"'>$titre</a>";
 207                  }
 208              }
 209              echo "</div>";
 210          }
 211  
 212          $breveMetier = &recuperer_instance_breve();
 213          $breves = $breveMetier->getBrevesForRubriqueId($id_rubrique, 'date_heure', true, 0, 20);
 214  
 215          if (sizeOf($breves) > 0) {
 216              echo "<div style='padding-top: 6px;'><b class='verdana2'>"._T('info_breves_02')."</b></div>";
 217              while (list(, $breve) = each($breves)) {
 218                  $authorization = &recuperer_instance_authorization(
 219                                        'isManagedRubriqueByAuteurId', $GLOBALS['connect_id_auteur'],
 220                                        array('rubriqueId' => $breve->getRubriqueId()));
 221                  if ($authorization->isAuthorizedAction()) {
 222                      $id_breve = $breve->getBreveId();
 223                      $titre = $breve->getTitre();
 224                      $statut = $breve->getStatut();
 225  
 226                      switch ($statut) {
 227                          case 'publie':
 228                              $puce = 'verte';
 229                              break;
 230  
 231                          case 'prepa':
 232                              $puce = 'blanche';
 233                              break;
 234  
 235                          case 'prop':
 236                              $puce = 'orange';
 237                              break;
 238  
 239                          case 'refuse':
 240                              $puce = 'rouge';
 241                              break;
 242  
 243                          case 'poubelle':
 244                              $puce = 'poubelle';
 245                              break;
 246                      }
 247  
 248                      $puce = "puce-$puce-breve.gif";
 249                      echo 
 250                      "<div style='margin:3px; padding-top:3px; padding-bottom:3px; padding-$spip_lang_left:12px; background:url(img_pack/$puce) $spip_lang_left center no-repeat;'>"
 251                      ."<a href='javascript:window.parent.location=\"breves_voir.php?id_breve=$id_breve\"' class='arial1'>"
 252                      .$titre."</a></div>";
 253                  }
 254              }
 255          }
 256  
 257          $syndicMetier = &recuperer_instance_syndic();
 258          $syndics = $syndicMetier->getSyndicsForRubriqueIdAndStatut($id_rubrique, 'refuse', 'nom_site');
 259          if (sizeOf($syndics) > 0) {
 260              echo "<div style='padding-top:6px;'><b class='verdana2'>"._T('icone_sites_references')."</b></div>";
 261              while (list(, $syndic) = each($syndics)) {
 262                  $authorization = &recuperer_instance_authorization(
 263                                        'isManagedRubriqueByAuteurId', $GLOBALS['connect_id_auteur'],
 264                                        array('rubriqueId' => $syndic->getRubriqueId()));
 265                  if ($authorization->isAuthorizedAction()) {
 266                      $id_syndic = $syndic->getSyndicId();
 267                      $titre = $syndic->getNomSite();
 268                      $statut = $syndic->getStatut();
 269  
 270                      switch ($statut) {
 271                          case 'publie':
 272                              $puce = 'verte';
 273                              break;
 274  
 275                          case 'prepa':
 276                              $puce = 'blanche';
 277                              break;
 278  
 279                          case 'prop':
 280                              $puce = 'orange';
 281                              break;
 282  
 283                          case 'refuse':
 284                              $puce = 'rouge';
 285                              break;
 286  
 287                          case 'poubelle':
 288                              $puce = 'poubelle';
 289                              break;
 290                      }
 291                      echo 
 292                      "<div style='margin:3px; padding-top:5px; padding-bottom:5px; padding-$spip_lang_left:28px; background:url(img_pack/site-24.gif) $spip_lang_left center no-repeat;'>"
 293                      ."<b><a href='javascript:window.parent.location=\"sites.php?id_syndic=$id_syndic\"'>$titre</a></b></div>";
 294                  }
 295              }
 296          }
 297      }
 298      if ($frame == 0 AND $id_rubrique == 0) {
 299          echo "<hr style='border:0px; color:#999999; background-color:#999999; height:2px;'>";
 300          $articleMetier = &recuperer_instance_article();
 301  
 302          if ($articleMetier->isStatutDoneArticleByAuteur('prepa', $connect_id_auteur) > 0) {
 303              echo
 304                  "<div style='margin:3px; padding-top:5px; padding-bottom:5px; padding-$spip_lang_left:28px; background:url(img_pack/article-24.gif) $spip_lang_left center no-repeat;'>"
 305                  ."<b class='verdana2'><a href='brouteur_frame.php?special=redac&frame="
 306                  .($frame+1)."&effacer_suivant=oui' target='iframe"
 307                  .($frame+1)."'>"._T("info_cours_edition")."</a></b></div>";
 308          }
 309          $total_articles = $articleMetier->howManyProposed();
 310          $breveMetier = &recuperer_instance_breve();
 311          $total_breves = $breveMetier->howManyProposed();
 312  
 313          if ($total_articles + $total_breves > 0)
 314              echo
 315                  "<div style='margin:3px; padding-top:5px; padding-bottom:5px; padding-$spip_lang_left:28px; background:url(img_pack/article-24.gif) $spip_lang_left center no-repeat;'>"
 316                  ."<b class='verdana2'><a href='brouteur_frame.php?special=valider&frame="
 317                  .($frame+1)."&effacer_suivant=oui' target='iframe".($frame+1)."'>"
 318                  ._T("info_articles_proposes")." / "._T("info_breves_valider")."</a></b></div>";
 319      }
 320  }
 321  
 322  echo "</div>";
 323  
 324  echo "</body></html>";
 325  ?>


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