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

Source for file AdminDropSite.php

Documentation is available at AdminDropSite.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.  * Chiede una conferma per la cancellazione di un autore.
  33.  * 
  34.  * @package  MCMS
  35.  * @version  2
  36.  * @author   Silvio Moioli <silvio at moioli dot net>
  37.  */
  38. class AdminDropSite extends AdminPage
  39. {
  40.     /** @var Author l'autore che accede a questa pagina */
  41.     var $author = null;
  42.     /** @var Site il sito da cancellare */
  43.     var $site = null;
  44.     
  45.     /**
  46.      * Costruttore di default
  47.      *
  48.      * @param Author $author l'autore che accede a questa pagina
  49.      * @param Site $site il sito da cancellare
  50.      * @see AdminPage
  51.      */
  52.     function AdminDropSite($author$site)
  53.     {
  54.         parent::AdminPage();
  55.         $this->author=$author;
  56.         $this->site=$site;
  57.     }
  58.     
  59.     /**
  60.      * Ritorna il titolo (in XHTML) di questa pagina.
  61.      *
  62.      * @return string una stringa XHTML rappresentante il titolo della pagina
  63.      * @see Compilable
  64.      */
  65.     function getTitle()
  66.     {
  67.         $authorID $this->author->getID();
  68.         $siteID $this->site->getID();
  69.         
  70.         $title a("do.php?goTo=AdminMain&amp;authorID=$authorID",
  71.         "Il Progettista")." > ".
  72.         a("do.php?goTo=AdminManageSite&amp;authorID=$authorID&amp;siteID=$siteID",
  73.             $siteName)." > Eliminazione sito";
  74.         
  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.         $menuEntries array(p(a("do.php?goTo=AdminIndex",
  88.         "Annulla e torna alla pagina principale del Progettista")));
  89.         
  90.         return $menuEntries;
  91.     }
  92.     
  93.     /**
  94.      * Ritorna il contenuto (XHTML) del corpo di questa pagina.
  95.      *
  96.      * @return string la stringa XHTML rappresentante il corpo della pagina
  97.      * @see Compilable
  98.      */
  99.     function getContents()
  100.     {
  101.         $authorID $this->author->getID();
  102.         $siteID $this->site->getID();
  103.         $siteName $this->site->getShortURL();
  104.         
  105.         $contents .= h1("AttenzioneIl sito $siteName sta per essere 
  106.         cancellato!").
  107.         p("Sei proprio sicuro?".br().
  108.         form("do.php?goTo=AdminMain&amp;action=dropSite&amp;authorID=$authorID",
  109.             "POST",
  110.             input("hidden","siteID",$siteID).
  111.             submit("S&igrave;, cancella il sito!")
  112.         ).br().
  113.         a("do.php?goTo=AdminMain&amp;authorID=$authorID","No, annulla e
  114.         torna alla pagina precedente"));
  115.         
  116.         return $contents;
  117.     }
  118. }
  119. ?>

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