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

Source for file AdminDropCategory.php

Documentation is available at AdminDropCategory.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 rimozione di una sezione. Viene richiesta una conferma
  33.  * da parte dell'utente.
  34.  * 
  35.  * @package  MCMS
  36.  * @version  2
  37.  * @author   Silvio Moioli <silvio at moioli dot net>
  38.  */
  39. class AdminDropCategory extends AdminPage
  40. {
  41.     /** @var Author l'autore che accede a questa pagina */
  42.     var $author = null;
  43.     /** @var Site il sito da cui cancellare la sezione */
  44.     var $site = null;
  45.     /** @var Category la sezione da cancellare */
  46.     var $category = null;
  47.     
  48.     /**
  49.      * Costruttore di default
  50.      *
  51.      * @param Author $author l'autore che accede a questa pagina
  52.      * @param Site $site il sito da cui cancellare la sezione
  53.      * @param Category $category la sezione da cancellare
  54.      * @see AdminPage
  55.      */
  56.     function AdminDropCategory($author$site$category)
  57.     {
  58.         parent::AdminPage();
  59.         $this->author=$author;
  60.         $this->site=$site;
  61.         $this->category=$category;
  62.     }
  63.     
  64.     /**
  65.      * Ritorna il titolo (in XHTML) di questa pagina.
  66.      *
  67.      * @return string una stringa XHTML rappresentante il titolo della pagina
  68.      * @see Compilable
  69.      */
  70.     function getTitle()
  71.     {
  72.         $authorID $this->author->getID();
  73.         $siteID $this->site->getID();
  74.         
  75.         $title a("do.php?goTo=AdminMain&amp;authorID=$authorID",
  76.             "Il Progettista")." > ".
  77.             a("do.php?goTo=AdminManageSite&amp;authorID=$authorID&amp;siteID=$siteID",
  78.             $this->site->getShortURL())." > ".a("do.php?goTo=AdminListCategories&amp;".
  79.             "authorID=$authorID&amp;siteID=$siteID","Sezioni").
  80.             " > Eliminazione di ".$this->category->getName();
  81.         
  82.         return $title;
  83.     }
  84.     
  85.     /**
  86.      * Ritorna un array di stringhe XHTML relative al menu (barra di navigazione)
  87.      * di questa pagina.
  88.      *
  89.      * @return array vettore di stringhe XHTML rappresentante il menu della pagina
  90.      * @see Compilable
  91.      */
  92.     function getMenuEntries()
  93.     {
  94.         $authorID $this->author->getID();
  95.         $siteID $this->site->getID();
  96.     
  97.         $menuEntries array(p(a("do.php?goTo=AdminManageSite&amp;".
  98.             "siteID=$siteID&amp;authorID=$authorID",
  99.             "Annulla e torna alla gestione del sito").br().
  100.             a("do.php?goTo=AdminListCategories&amp;siteID=$siteID&amp;".
  101.             "authorID=$authorID","Annulla e torna alla gestione delle sezioni")));
  102.         
  103.         return $menuEntries;
  104.     }
  105.     
  106.     /**
  107.      * Ritorna il contenuto (XHTML) del corpo di questa pagina.
  108.      *
  109.      * @return string la stringa XHTML rappresentante il corpo della pagina
  110.      * @see Compilable
  111.      */
  112.     function getContents()
  113.     {
  114.         $authorID $this->author->getID();
  115.         $siteID $this->site->getID();
  116.         $categoryName $this->category->getName();
  117.         $categoryID $this->category->getID();
  118.         
  119.         $contents h1("AttenzioneLa sezione dal nome: \"$categoryName\" ".
  120.             "sta per essere cancellata!").p("Sei proprio sicuro?".br().
  121.             form("do.php?goTo=AdminListCategories&amp;action=dropCategory&amp;".
  122.                 "authorID=$authorID&amp;siteID=$siteID","POST",
  123.                 
  124.                 input("hidden","categoryID",$categoryID).
  125.                 submit("S&igrave;, cancella la sezione!").br().
  126.                 a("do.php?goTo=AdminListCategories&amp;siteID=$siteID&amp;".
  127.                 "authorID=$authorID""No, annulla e torna alla pagina precedente"
  128.             )));
  129.         
  130.         return $contents;
  131.     }
  132. }
  133.  
  134. ?>

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