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

Source for file AdminAddSite.php

Documentation is available at AdminAddSite.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 aggiunta di un nuovo sito (vengono richiesti l'URL,
  33.  * le parole chiave, ecc.)
  34.  * 
  35.  * @package  MCMS
  36.  * @version  2
  37.  * @author   Silvio Moioli <silvio at moioli dot net>
  38.  */
  39. class AdminAddSite extends AdminPage
  40. {
  41.     /** @var Author l'autore che accede a questa pagina */
  42.     var $author = null;
  43.     
  44.     /** @var string nome proposto all'utente per questo sito */
  45.     var $defaultName="http://www.mionuovosito.it";
  46.     /** @var string motto proposto all'utente per questo sito */
  47.     var $defaultSlogan="Eccomi qui!";
  48.     /** @var string parole chiave proposte all'utente per questo sito */
  49.     var $defaultKeywords="";
  50.         
  51.     /**
  52.      * Costruttore standard
  53.      *
  54.      * @param Author $author l'autore del sito da aggiungere
  55.      * @see AdminPage
  56.      */
  57.     function AdminAddSite($author)
  58.     {
  59.         parent::AdminPage();
  60.         $this->author=$author;
  61.     }
  62.     
  63.     /**
  64.      * Cambia il nome proposto all'utente per questo sito
  65.      *
  66.      * @param string $defaultName il nuovo nome
  67.      */
  68.     function setDefaultName($defaultName)
  69.     {
  70.         $this->defaultName = $defaultName;
  71.     }
  72.     
  73.     /**
  74.      * Cambia il motto proposto all'utente per questo sito
  75.      *
  76.      * @param string $defaultTitle il nuovo motto
  77.      */
  78.     function setDefaultSlogan($defaultSlogan)
  79.     {
  80.         $this->defaultSlogan = $defaultSlogan;
  81.     }
  82.     
  83.     /**
  84.      * Cambia le parole chiave proposte all'utente per questo sito
  85.      *
  86.      * @param string $defaultKeywords le nuove parole chiave
  87.      */
  88.     function setDefaultKeywords($defaultKeywords)
  89.     {
  90.         $this->defaultKeywords = $defaultKeywords;
  91.     }
  92.     
  93.         /**
  94.      * Ritorna il titolo (in XHTML) di questa pagina.
  95.      *
  96.      * @return string una stringa XHTML rappresentante il titolo della pagina
  97.      * @see Compilable
  98.      */
  99.     function getTitle()
  100.     {
  101.         $authorID $this->author->getID();
  102.         $title a("do.php?goTo=AdminMain&amp;authorID=$authorID",
  103.         "Il Progettista")." > Aggiungi sito";
  104.         return $title;
  105.     }
  106.     
  107.     /**
  108.      * Ritorna un array di stringhe XHTML relative al menu (barra di navigazione)
  109.      * di questa pagina.
  110.      *
  111.      * @return array vettore di stringhe XHTML rappresentante il menu della pagina
  112.      * @see Compilable
  113.      */
  114.     function getMenuEntries()
  115.     {
  116.         $menuEntries array(p(a("do.php?goTo=AdminIndex",
  117.         "Annulla e torna alla pagina principale del Progettista")));
  118.         return $menuEntries;
  119.     }
  120.     
  121.     /**
  122.      * Ritorna il contenuto (XHTML) del corpo di questa pagina.
  123.      *
  124.      * @return string la stringa XHTML rappresentante il corpo della pagina
  125.      * @see Compilable
  126.      */
  127.     function getContents()
  128.     {
  129.         $authorID $this->author->getID();
  130.         
  131.         $formContents h1("Incominciamo dal nome...").
  132.         p("Cosa sarebbe un buon sito senza un nome? Bene, il Progettista consiglia
  133.         di partire dal nome per creare il tuo sito. Come saprai, i nomi dei siti
  134.         Internet si chiamano URL, e il tuo sito non fa eccezione. Inserisci qui
  135.         l&#039;URL attraverso cui i visitatori accederanno al tuo sito (se non ne
  136.         hai uno, potresti provarne uno gratuito registrandolo su ".
  137.         a("http://www.dot.tk/","www.dot.tk").br().input("text","name",$this->defaultName).br().
  138.         "Se non sai cos&#039;&egrave; un URL, o non sai cosa sia un dominio e 
  139.         come dovrebbe essere usato, dovresti imparare qualche nozione base su 
  140.         Internet. Un buon posto dove iniziare: ".a("http://www.html.it/",
  141.         "HTML.it")).
  142.         h1("...poi un motto...").
  143.         p("Un&#039;altra buona idea &egrave;dare uno slogan al tuo sito. Se &egrave;
  144.         brillante i visitatori se lo ricorderanno!".br().
  145.         "Il Progettista consiglia: qualcosa di breve (per esempio Clarence: a
  146.         wwworld apart)".br().
  147.         input("text","slogan",$this->defaultSlogan)).
  148.         h1("...e le parole chiave!").
  149.         p("Per finire, indica per favore una lista di parole chiave per il tuo
  150.         sito. Dovrebbero essere delle parole che aiutino gli utenti Internet nelle
  151.         loro ricerche, e dovrebbero essere inerenti ai contenuti del tuo sito.".
  152.         br()."Il Progettista raccomanda: per favore ".b("elenca le parole
  153.         separandole con una virgola!").br().
  154.         input("text""keywords",$this->defaultKeywords)).
  155.         p("Quando hai finito, clicca il bottone qui sotto:".br().
  156.         submit());
  157.         
  158.         $contents form("do.php?goTo=AdminManageSite&amp;".
  159.         "action=addSite&amp;authorID=$authorID","POST"$formContents);
  160.         
  161.         return $contents;
  162.     }
  163. }
  164. ?>

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