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

Source for file AdminDropArticle.php

Documentation is available at AdminDropArticle.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 un articolo. 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 AdminDropArticle extends AdminPage
  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.     /** @var Article l'articolo da cancellare */
  46.     var $article = 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 di cui mostrare le sezioni
  53.      * @see AdminPage
  54.      */
  55.     function AdminDropArticle($site$article$author)
  56.     {
  57.         parent::AdminPage();
  58.         $this->article=$article;
  59.         $this->author=$author;
  60.         $this->site=$site;
  61.     }
  62.     
  63.     /**
  64.      * Ritorna il titolo (in XHTML) di questa pagina.
  65.      *
  66.      * @return string una stringa XHTML rappresentante il titolo della pagina
  67.      * @see Compilable
  68.      */
  69.     function getTitle()
  70.     {
  71.         $authorID $this->author->getID();
  72.         $siteID $this->site->getID();
  73.         
  74.         $title a("do.php?goTo=AdminMain&amp;authorID=$authorID",
  75.              "Il Progettista")." > ".
  76.             a("do.php?goTo=AdminManageSite&amp;authorID=$authorID&amp;".
  77.             "siteID=$siteID"$this->site->getShortURL())." > ".
  78.             a("do.php?goTo=AdminListArticles&amp;authorID=$authorID&amp;".
  79.             "siteID=$siteID","Articoli")." > Eliminazione ".$this->article->getTitle();
  80.         
  81.         return $title;
  82.     }
  83.     
  84.     /**
  85.      * Ritorna un array di stringhe XHTML relative al menu (barra di navigazione)
  86.      * di questa pagina.
  87.      *
  88.      * @return array vettore di stringhe XHTML rappresentante il menu della pagina
  89.      * @see Compilable
  90.      */
  91.     function getMenuEntries()
  92.     {
  93.         $authorID $this->author->getID();
  94.         $siteID $this->site->getID();
  95.     
  96.         $menuEntries array(p(a("do.php?goTo=AdminManageSite&amp;".
  97.             "siteID=$siteID&amp;authorID=$authorID","Annulla e torna alla 
  98.             gestione del sito").br().
  99.             a("do.php?goTo=AdminListArticles&amp;siteID=$siteID&amp;".
  100.             "authorID=$authorID""Annulla e torna alla gestione degli articoli")));
  101.         
  102.         return $menuEntries;
  103.     }
  104.     
  105.     /**
  106.      * Ritorna il contenuto (XHTML) del corpo di questa pagina.
  107.      *
  108.      * @return string la stringa XHTML rappresentante il corpo della pagina
  109.      * @see Compilable
  110.      */
  111.     function getContents()
  112.     {
  113.         $authorID $this->author->getID();
  114.         $siteID $this->site->getID();
  115.         $articleTitle $this->article->getTitle();
  116.         $articleID $this->article->getID();
  117.         
  118.         $contents h1("AttenzioneL&#039;articolo dal titolo
  119.             \"$articleTitle\""." sta per essere cancellato!").
  120.             p("Sei proprio sicuro?".br().
  121.             form("do.php?goTo=AdminListArticles&amp;action=dropArticle&amp;".
  122.             "authorID=$authorID&amp;siteID=$siteID","POST",
  123.                 input("hidden""articleID"$articleID).
  124.                 submit("S&igrave;, cancella l&#039;articolo!").br().
  125.                 a("do.php?goTo=AdminListArticles&amp;siteID=$siteID&amp;".
  126.                 "authorID=$authorID","No, annulla e torna alla pagina precedente")
  127.             ));
  128.         
  129.         return $contents;
  130.     }
  131. }
  132.  
  133. ?>

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