[ Index ]
 

Code source de SPIP Agora 1.4

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

title

Body

[fermer]

/Agora1-4/ecrire/ -> documents_liste.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_index.php");
  22  include_ecrire  ("inc_logos.php");
  23  
  24  // Couche métier
  25  require_once ("PEAR.php");
  26  require_once (dirname(__FILE__). "/include/bd/inc_document_factory.php");
  27  require_once (dirname(__FILE__). "/include/bd/inc_type_document_factory.php");
  28  
  29  //
  30  // Recupere les donnees
  31  //
  32  
  33  debut_page(_T('titre_page_documents_liste'), "documents", "documents");
  34  debut_gauche();
  35  
  36  //////////////////////////////////////////////////////
  37  // Boite "voir en ligne"
  38  //
  39  
  40  debut_boite_info();
  41  
  42  echo propre(_T('texte_recapitiule_liste_documents'));
  43  
  44  fin_boite_info();
  45  
  46  debut_droite();
  47  
  48  // recupere les types, couche métier
  49  $typeDocumentMetier = &recuperer_instance_type_document();
  50  $types = $typeDocumentMetier->getAllTypeIds();
  51  
  52  if (PEAR::isError($types)) {
  53      die ($types->getMessage());
  54  }
  55  
  56  // utilisation couche métier
  57  $documentMetier = &recuperer_instance_document();
  58  $allDocuments = $documentMetier->getAllDocumentRubriqueForMode('document');
  59  
  60  if (PEAR::isError($allDocuments)) {
  61      die ($allDocuments->getMessage());
  62  }
  63  
  64  while (list(, $monDocument) = each($allDocuments)) {
  65      $titre = $monDocument['titre'];
  66      $descriptif = $monDocument['descriptif'];
  67      $date = $monDocument['date_heure'];
  68      $id_document = $monDocument['id_doc'];
  69      $id_rubrique = $monDocument['id_rub'];
  70      $titre_rub = $monDocument['titre_rub'];
  71      $fichier = $monDocument['fichier'];
  72  
  73      $authorization = &recuperer_instance_authorization('isManagedRubriqueByAuteurId', $GLOBALS['connect_id_auteur'], array('rubriqueId' => $id_rubrique));
  74      if ($authorization->isAuthorizedAction()) {
  75          if (!$titre)
  76              $titre = _T('info_document'). ' ' . $id_document;
  77  
  78          debut_cadre_relief ("doc-24.gif");
  79          echo "<b>$titre</b> (" . $types[$monDocument['type']]['titre']. ', ' . affdate($date). ")";
  80  
  81          if ($descriptif)
  82              echo "<p>" . propre($descriptif);
  83          else
  84              echo "<p><tt>$fichier</tt>";
  85  
  86          echo "<p>" . _T('info_dans_rubrique'). " <a href='naviguer.php?coll=$id_rubrique'>$titre_rub</a>";
  87          fin_cadre_relief();
  88      }
  89  }
  90  fin_page();
  91  ?>


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