Source for file UserHomepage.php
Documentation is available at UserHomepage.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | MCMS: a PHP Content Management System for creating accessible sites. |
// | Copyright (C) 2005 Silvio Moioli |
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
// +----------------------------------------------------------------------+
// | Authors: Silvio Moioli <silvio at moioli dot net> www.moioli.net |
// +----------------------------------------------------------------------+
require_once $_SERVER["DOCUMENT_ROOT"]. "/admin/lib/view/UserPage.php";
require_once $_SERVER["DOCUMENT_ROOT"]. "/admin/lib/view/Tagger.php";
* Rappresenta l'homepage di un sito.
* @author Silvio Moioli <silvio at moioli dot net>
/** @var Homepage l'oggetto corrispondente a questa pagina */
* @param Site $site il sito a cui questa pagina appartiene
* Ritorna il titolo (in XHTML) di questa pagina.
* @return string una stringa XHTML rappresentante il titolo della pagina
* Ritorna una breve descrizione (solo testo) di questa pagina.
* @return string una stringa rappresentante la descrizione della pagina
* Ritorna un array di stringhe XHTML relative al menu (barra di navigazione)
* @return array vettore di stringhe XHTML rappresentante il menu della pagina
$categories = $this->site->getCategories();
foreach ($categories as $i) {
$desc = $i->getDescription();
$menuEntries = array(p("Sezioni del sito:"). unorderedList($listEntries));
* Ritorna il contenuto (XHTML) del corpo di questa pagina.
* @return string la stringa XHTML rappresentante il corpo della pagina
$siteID = $site->getID();
$categories = $site->getCategories();
$contents = $homepage->getContents();
$contents .= h1("Le notizie");
//Aggiunge le notizie in prima pagina
$news = $site->getNews();
//Massimo 5 notizie sulla homepage
$newsTitle = $i->getTitle();
$content = $i->getContents(). br();
$author = $i->getAuthor();
$contents .= h2(b($newsTitle). br(). $date,"notizia$newscount");
//Aggiunge gli articoli correlati
$correlati = $i->getCorrelatedArticles();
$ncorrelati = $i->getCorrelatedArticlesCount();
foreach ($correlati as $correlato) {
$idCorrelato = $correlato->getID();
$titoloCorrelato = $correlato->getTitle();
//Ci sono altri articoli, metto una virgola
$contents .= p("Articoli correlati a questa notizia: ". $temp);
//Aggiunge il corpo della notizia e la firma dell'autore
* Ritorna una stringa di parole chiave (solo testo, separate da virgole)
* @return string la stringa rappresentante le parole chiave della pagina
* Ritorna il nome del file in cui questa pagina deve essere salvata.
* @return string il nome del file
* Versione statica del metodo precedente: ritorna il nome del
* file in cui questa pagina deve essere salvata.
* @return string il nome del file
return "/index". $site->getID(). ".html";
* Ritorna il nome del file in cui questa pagina deve essere salvata
* @return string il nome del file
return "index". $this->site->getID(). ".html";
|