MCMS
[ class tree: MCMS ] [ index: MCMS ] [ all elements ]

Source for file AdminListCategories.php

Documentation is available at AdminListCategories.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | MCMS: a PHP Content Management System for creating accessible sites. |
  5. // | Copyright (C) 2005  Silvio Moioli                                    |
  6. // |                                                                      |
  7. // | This program is free software; you can redistribute it and/or modify |
  8. // | it under the terms of the GNU General Public License as published by |
  9. // | the Free Software Foundation; either version 2 of the License, or    |
  10. // | (at your option) any later version.                                  |
  11. // |                                                                      |
  12. // | This program is distributed in the hope that it will be useful,      |
  13. // | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
  14. // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
  15. // | GNU General Public License for more details.                         |
  16. // |                                                                      |
  17. // | You should have received a copy of the GNU General Public License    |
  18. // | along with this program; if not, write to the Free Software          |
  19. // | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 |
  20. // +----------------------------------------------------------------------+
  21. // | Authors: Silvio Moioli <silvio at moioli dot net> www.moioli.net     |
  22. // +----------------------------------------------------------------------+
  23. //
  24. //$Id:
  25.  
  26. /** Importa la classe di base per l"interfaccia utente (autore) */
  27. require_once $_SERVER["DOCUMENT_ROOT"]."/admin/lib/view/AdminPage.php";
  28. /** Importa la libreria per semplificare l"aggiunta di tag XML */
  29. require_once $_SERVER["DOCUMENT_ROOT"]."/admin/lib/view/Tagger.php";
  30.  
  31. /**
  32.  * Rappresenta la pagina di gestione delle sezioni. Viene mostrato un elenco da
  33.  * cui è possibile scegliere di modificare, cancellare o aggiungere sezioni al
  34.  * sito.
  35.  * 
  36.  * @package  MCMS
  37.  * @version  2
  38.  * @author   Silvio Moioli <silvio at moioli dot net>
  39.  */
  40. {
  41.     /** @var Author l'autore che accede a questa pagina */
  42.     var $author = null;
  43.     /** @var Site il sito di cui mostrare le sezioni */
  44.     var $site = null;
  45.     
  46.     /**
  47.      * Costruttore di default
  48.      *
  49.      * @param Author l'autore che accede a questa pagina
  50.      * @param Site il sito di cui mostrare le sezioni
  51.      * @see AdminPage
  52.      */
  53.     function AdminListCategories($author$site)
  54.     {
  55.         parent::AdminPage();
  56.         $this->author=$author;
  57.         $this->site=$site;
  58.     }
  59.     
  60.     /**
  61.      * Ritorna il titolo (in XHTML) di questa pagina.
  62.      *
  63.      * @return string una stringa XHTML rappresentante il titolo della pagina
  64.      * @see Compilable
  65.      */
  66.     function getTitle()
  67.     {
  68.         $authorID $this->author->getID();
  69.         $siteID $this->site->getID();
  70.         
  71.         $title a("do.php?goTo=AdminMain&amp;authorID=$authorID",
  72.             "Il Progettista")." > ".
  73.             a("do.php?goTo=AdminManageSite&amp;authorID=$authorID".
  74.             "&amp;siteID=$siteID",$this->site->getShortURL())." > Sezioni";
  75.         return $title;
  76.     }
  77.     
  78.     /**
  79.      * Ritorna un array di stringhe XHTML relative al menu (barra di navigazione)
  80.      * di questa pagina.
  81.      *
  82.      * @return array vettore di stringhe XHTML rappresentante il menu della pagina
  83.      * @see Compilable
  84.      */
  85.     function getMenuEntries()
  86.     {
  87.         $authorID $this->author->getID();
  88.         $siteID $this->site->getID();
  89.     
  90.         $menuEntries array(p(a("do.php?goTo=AdminManageSite&amp;".
  91.             "siteID=$siteID&amp;authorID=$authorID","Torna alla gestione del sito").
  92.             br().a("../index$siteID.html","Vedi il tuo sito!")));
  93.         
  94.         return $menuEntries;
  95.     }
  96.     
  97.     /**
  98.      * Ritorna il contenuto (XHTML) del corpo di questa pagina.
  99.      *
  100.      * @return string la stringa XHTML rappresentante il corpo della pagina
  101.      * @see Compilable
  102.      */
  103.     function getContents()
  104.     {
  105.         $authorID $this->author->getID();
  106.         $siteID $this->site->getID();
  107.         
  108.         $contents .= h1("Le sezioni del sito ".
  109.             a("../index$siteID.html",$this->site->getShortURL()));
  110.         $contents .= p("Da questa pagina puoi gestire le sezioni del tuo sito,
  111.             rimuovendole o modificandole a tuo piacere. Le sezioni sono come dei
  112.             contenitori per i tuoi articoli, in modo da poterli organizzare.
  113.             Puoi modificare le sezioni solo se sei il ".b("fondatore")." del sito.");
  114.     
  115.         $contents .= h2(a("do.php?goTo=AdminEditCategory&amp;".
  116.             "authorID=$authorID&amp;siteID=$siteID&amp;mode=new","Aggiungi nuova sezione..."));
  117.         
  118.         $categories $this->site->getCategories();
  119.         foreach ($categories as $i{
  120.             $categoryID $i->getID();
  121.             $categoryName $i->getName();
  122.             $contents .= h2("Sezione \"".$i->getName()."\"").
  123.                 unorderedList(array(
  124.                     a("do.php?goTo=AdminEditCategory&amp;authorID=$authorID&amp;".
  125.                     "siteID=$siteID&amp;categoryID=$categoryID&amp;mode=edit","Modifica sezione"),
  126.                     a("do.php?goTo=AdminDropCategory&amp;authorID=$authorID&amp;".
  127.                     "siteID=$siteID&amp;categoryID=$categoryID","Cancella sezione")
  128.                 ));
  129.         }
  130.         
  131.         return $contents;
  132.     }
  133. }
  134. ?>

Documentation generated on Wed, 26 Jul 2006 21:44:44 +0200 by phpDocumentor 1.3.0RC6