[ Index ]
 

Code source de SPIP Agora 1.4

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

title

Body

[fermer]

/Agora1-4/ecrire/ -> plan_trad.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  require_once ("PEAR.php");
  21  require_once (dirname(__FILE__). "/include/bd/inc_article_factory.php");
  22  require_once (dirname(__FILE__). "/include/bd/inc_rubrique_factory.php");
  23  
  24  debut_page(_T('titre_page_etat_traductions'), "asuivre", "plan-trad");
  25  
  26  $authorization = &recuperer_instance_authorization('afficherDetailsTraductions', $GLOBALS['connect_id_auteur'], array('connect_toutes_rubriques' => $connect_toutes_rubriques));
  27  
  28  if ($authorization->isAuthorizedAction()) {
  29      echo "<br>";
  30      barre_onglets("traductions", "detail");
  31  }
  32  
  33  debut_gauche();
  34  
  35  if (!$trad_lang)
  36      $trad_lang = $spip_lang;
  37  
  38  //debut_cadre_relief('langues-24.gif');
  39  echo "<p>";
  40  debut_cadre_formulaire();
  41  
  42  $link = new Link();
  43  
  44  echo "<font face='Arial,Sans,sans-serif'>";
  45  echo _T('titre_cadre_afficher_traductions'). "&nbsp;: <p>";
  46  echo menu_langues('trad_lang', $trad_lang);
  47  echo "</font>";
  48  
  49  //fin_cadre_relief();
  50  fin_cadre_formulaire();
  51  
  52  debut_boite_info();
  53  
  54  echo _T('texte_plan_trad');
  55  
  56  echo "<p>" . "<IMG SRC='img_pack/langues-off-12.gif' WIDTH='12' HEIGHT='12' BORDER='0'> " . _T('texte_plan_trad_en_cours');
  57  
  58  echo "<p>" . "<IMG SRC='img_pack/langues-modif-12.gif' WIDTH='12' HEIGHT='12' BORDER='0'> " . _T('texte_plan_trad_modif');
  59  
  60  echo "<p><i>" . _T('texte_plan_trad_note'). "</i>";
  61  
  62  fin_boite_info();
  63  
  64  debut_droite();
  65  
  66  function afficher_rubrique ($id_parent, $marge = 0, $cond = '', $afficher = true) {
  67      global $deplier;
  68      global $liste_rubs;
  69      global $trad_lang;
  70      global $couleur_foncee;
  71      global $dir_lang;
  72      global $spip_lang_left;
  73      static $total_articles = 0;
  74      static $rubriques_actives;
  75  
  76      //
  77      // Calculer les rubriques actives
  78      // (contenant des articles a afficher)
  79      //
  80  
  81      if (!$rubriques_actives) {
  82          $rubriques_actives[0] = true;
  83  
  84          /************ Modification elebescond@clever-age.com ***********************/
  85          $articleMetier = &recuperer_instance_article();
  86          $rubriqueIds = $articleMetier->calculatePublishedRubrique($trad_lang);
  87  
  88          if (PEAR::isError($rubriqueIds)) {
  89              die ($rubriqueIds->getMessage());
  90          }
  91          while (list(, $rubriqueId) = each($rubriqueIds)) {
  92              $rubriques_actives[$rubriqueId] = true;
  93          }
  94      }
  95  
  96      if (!$cond)
  97          $cond = array();
  98  
  99      $vide = !$rubriques_actives[$id_parent];
 100  
 101      if (!$vide) {
 102          echo $cond['avant'];
 103      }
 104  
 105      //
 106      // Afficher les articles a traduire
 107      //
 108  
 109      if ($id_parent AND !$vide AND $afficher) {
 110          /************ Modification elebescond@clever-age.com ***********************/
 111          $articleMetier = &recuperer_instance_article();
 112          $rows = $articleMetier->calculateNoTraductionForRubrique($trad_lang, $id_parent);
 113          $table = '';
 114  
 115          if (PEAR::isError($rows)) {
 116              die ($rows->getMessage());
 117          }
 118  
 119          while (list(, $row) = each($rows)) {
 120              $total_articles++;
 121  
 122              if ($lang = $row['lang'])
 123                  changer_typo ($lang);
 124  
 125              $id_article = $row['id_article'];
 126              $titre = typo($row['titre']);
 127              $date = $row['date'];
 128              $id_article_traduit = $row['trad_id_article'];
 129              $statut_traduit = $row['trad_statut'];
 130              $a_jour = $row['trad_a_jour'];
 131              $descriptif = $row['descriptif'];
 132  
 133              if ($descriptif)
 134                  $descriptif = ' title="' . attribut_html(typo($descriptif)). '"';
 135  
 136              $vals = '';
 137  
 138              $popularite = ceil(min(100, 100 * $row['popularite'] / max(1, 0 + lire_meta('popularite_max'))));
 139              $petition = $row['petition'];
 140  
 141              $s = "";
 142  
 143              if ($id_article_traduit) {
 144                  $s .= "<a href='articles.php?id_article=$id_article_traduit'>";
 145  
 146                  if ($a_jour AND $statut_traduit == 'publie') {
 147                      $puce = 'langues-12.gif';
 148                      $puce_title = "Traduction &agrave; jour";
 149                  }
 150                  else if ($statut_traduit == 'publie') {
 151                      $puce = 'langues-modif-12.gif';
 152                      $puce_title = "L'article original a &eacute;t&eacute; modifi&eacute, la traduction n'est plus &agrave; jour";
 153                  }
 154                  else {
 155                      $puce = 'langues-off-12.gif';
 156                      $puce_title = "Traduction en cours";
 157                  }
 158  
 159                  $s .= "<img src='img_pack/$puce' width='12' height='12' border='0' title=\"" . attribut_html($puce_title). "\">";
 160                  $s .= "</a>&nbsp;&nbsp;";
 161              }
 162  
 163              $s .= "<a href=\"articles.php?id_article=$id_article\"$descriptif$dir_lang>" . typo($titre). "</a>";
 164              $s .= " &nbsp; <font size='1' color='#666666'$dir_lang>(" . traduire_nom_langue($lang). ")</font>";
 165  
 166              $vals[] = $s;
 167  
 168              $s = affdate($date);
 169              $vals[] = $s;
 170  
 171              $table[] = $vals;
 172          }
 173          if ($table) {
 174              echo "<table width=100% cellpadding=0 cellspacing=0 border=0><tr><td width=100% background=''>";
 175              echo "<table width=100% cellpadding=3 cellspacing=0 border=0>";
 176              $largeurs = array('', 90);
 177              $styles = array('arial2', 'arial1');
 178              afficher_liste($largeurs, $table, $styles);
 179              echo "</table></td></tr></table>";
 180          }
 181      }
 182  
 183      if (!$vide) {
 184          echo $cond['apres'];
 185      }
 186  
 187      //
 188      // Parcourir les sous-rubriques
 189      //
 190  
 191      if ($afficher OR $vide) {
 192          /************ Modification elebescond@clever-age.com ***********************/
 193          $rubriqueMetier = &recuperer_instance_rubrique();
 194          $rubriques = $rubriqueMetier->getAllForParentId($id_parent, 'titre');
 195          while (list(, $rubrique) = each($rubriques)) {
 196              $id_rubrique = $rubrique->getRubriqueId();
 197              $titre_rubrique = $rubrique->getTitre();
 198  
 199              if ($deplier == 'oui')
 200                  $afficher_fils = !$liste_rubs[$id_rubrique];
 201              else if ($deplier == 'non')
 202                  $afficher_fils = $liste_rubs[$id_rubrique];
 203              else
 204                  $afficher_fils = ($total_articles < 30) || $liste_rubs[$id_rubrique];
 205  
 206              $afficher_fils &= $afficher;
 207  
 208              $rubs = $liste_rubs;
 209  
 210              if ($rubs[$id_rubrique])
 211                  unset ($rubs[$id_rubrique]);
 212              else
 213                  $rubs[$id_rubrique] = $id_rubrique;
 214  
 215              $lien = new Link();
 216              $lien->addVar('rubs', join(',', $rubs));
 217  
 218              $bandeau = "<div style='width: 100%; margin: 0px; padding: 3px; border: none; background: $couleur_foncee;'>\n" . "<b><a href='" . $lien->getUrl(). "'><img src='img_pack/" . ($afficher_fils ? 'triangle-bleu-bas.gif' : 'triangle-bleu.gif'). "' alt='' width='14' height='14' border='0'></a> " . "<a href='naviguer.php?coll=$id_rubrique'><font color='white' face='Verdana,Arial,Sans,sans-serif'>$titre_rubrique</font></a></b>\n" . "</div>\n";
 219  
 220              if ($afficher) {
 221                  $cond_fils['avant'] = "<div style='margin: 0px; margin-$spip_lang_left: " . $marge . "px; padding: 0px; background: none;'>\n" . $bandeau;
 222                  $cond_fils['apres'] = "</div>\n";
 223                  if (!$id_parent)
 224                      $cond_fils['avant'] = "<p>" . $cond_fils['avant'];
 225              }
 226  
 227              if ($vide) {
 228                  $cond_fils['avant'] = $cond['avant']. $cond['apres']. $cond_fils['avant'];
 229              }
 230  
 231              if (afficher_rubrique($id_rubrique, $marge + 20, $cond_fils, $afficher_fils))
 232                  $vide = false;
 233              if (!$afficher AND !$vide)
 234                  break;
 235          }
 236      }
 237  
 238      return !$vide;
 239  }
 240  
 241  echo "<p>";
 242  $lien = new Link();
 243  $lien->delVar('rubs');
 244  $lien->addVar('deplier', 'oui');
 245  echo "<a href='" . $lien->getUrl(). "'>" . _T('lien_tout_deplier'). "</a>";
 246  $lien->addVar('deplier', 'non');
 247  echo " | <a href='" . $lien->getUrl(). "'>" . _T('lien_tout_replier'). "</a>";
 248  echo "<p>";
 249  
 250  $liste_rubs = array();
 251  
 252  if ($rubs) {
 253      $t = explode(',', $rubs);
 254      while (list(, $rub) = each($t)) {
 255          $liste_rubs[$rub] = $rub;
 256      }
 257  }
 258  
 259  afficher_rubrique (0);
 260  
 261  fin_page();
 262  ?>


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