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

Source for file search.php

Documentation is available at search.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.  * Classe per la creazione della mappa di un sito gestito da MCMS.
  27.  *
  28.  * @package  MCMS
  29.  * @version  2
  30.  * @author   Silvio Moioli <silvio at moioli dot net>
  31.  */
  32.  
  33. /** Carica la classe base di MCMS per l'interfacciamento al Database */
  34. require_once $_SERVER["DOCUMENT_ROOT"]."/admin/lib/model/Engine.php";
  35.  
  36. /**
  37.  * Classe per la creazione della mappa di un sito gestito da MCMS.
  38.  * Il componente è composto da questo file e dal file viewMap.php
  39.  * nella cartella principale del progetto.
  40.  *
  41.  * @package  MCMS
  42.  * @version  2
  43.  * @author   Silvio Moioli <silvio at moioli dot net>
  44.  */
  45. class search extends Component
  46. {
  47.     /**
  48.      * Scritto solo per la concatenazione dei costruttori.
  49.      *
  50.      */
  51.     function MCMS_map()
  52.     {
  53.         $this->Component();
  54.     }
  55.  
  56.     /**
  57.      * Ritorna il nome di questo componente.
  58.      *
  59.      * @return string il nome del componente
  60.      */
  61.     function getName()
  62.     {
  63.         return "Ricerca con Google";
  64.     }
  65.  
  66.     /**
  67.      *
  68.      * Questo componente non ha bisogno di inizializzazione,
  69.      * perciò questo metodo è vuoto.
  70.      *
  71.      * @param Engine $engine il motore di MCMS
  72.      */
  73.     function init($engine)
  74.     {
  75.     }
  76.  
  77.     /**
  78.      *
  79.      * Aggiunge la voce di menu per la mappa del sito (a tutte le
  80.      * pagine).
  81.      *
  82.      * @param string $contents i contenuti della pagina da modificare
  83.      * @param array $menuEntries il menu della pagina
  84.      * @param string $title il titolo della pagina da modificare
  85.      * @param Site $site il sito corrente
  86.      */
  87.     function applyComponent(&$contents&$menuEntries&$title,
  88.         &$description$site)
  89.     {
  90.         $siteName $site->getShortURL();
  91.         
  92.         $menuEntries ['
  93. <form method="get" action="http://www.google.it/search">
  94. <p>
  95. <label for="q">Cerca in questo sito:</label>
  96. <input type="text" id="q" name="q" size="10" value="sms"/>
  97. <input type="hidden" id="domains" name="domains" value="'.$siteName.'"/>
  98. <input type="hidden" id="sitesearch" name="sitesearch" value="'.$siteName.'"/>
  99. <input type="hidden" id="sourceid" name="sourceid" value="google-search"/>
  100. <input type="submit" id="submit" name="Cerca" value="Cerca"/>
  101. </p>
  102. </form>
  103. ';
  104.     }
  105.     
  106.     /**
  107.      * Questo componente non ha file esterni da salvare
  108.      */
  109.     /*abstract*/ function saveFiles($site$compiler){
  110.         //Niente da fare
  111.     }
  112. }
  113. ?>

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