Location: PHPKode > projects > MWS - ModularWebSystem > mwsf/panels/home.php
<?php
/***********************************************************************
 * MWS - ModularWebSystem
 * (C) paolo bosetti 2003
 * 
 * 
 * home.php 
 * 
 * CVS info:
 * 	Author: 	$Author: isil $
 *	Date: 		$Date: 2003/03/27 16:51:45 $
 *	Tag:		$Name: mwsf_alpha_5 $
 *	Revision:	$Revision: 1.3 $
 * 
 **********************************************************************/
 
 /***************************************************************************
 *
 *   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.
 *
 ***************************************************************************/


// Check HackAttack
if (!defined('IN_MWS')) { die("Hack Attack!"); }

/*************************/
/* Build up panel content */
/*************************/

// Set the requested panelAction
$panelAction = isset($action)?"panel_$action":"panel_basic";

// Build the panel with (first available):
// 	- the function $panelAction
//	- the template templates/panels/$action.tpl
//	- warning message
if (function_exists($panelAction)) {
	$panelContent = $panelAction();
}
elseif (file_exists(TEMPLATE_PATH."panels/$action.tpl")) {
	$panelContent = showPanel($action);
}
else {
	$panelContent = panel_basic();
}
	

/*********************************/
/* Function for building content */
/*********************************/

// Default
function panel_basic() {
	$content = <<<EOD
<strong>In Breve:</strong> MWS &egrave; un sistema di sviluppo di siti dinamici
e statici in PHP. Integra un sistema di gestione dei Template e le principali 
funzioni per creare siti dall'aspetto elegante e omogeneo.
<hr>
<strong>Licenza:</strong> MWS &egrave; distribuito sotto licenza GNU.
<hr>
<strong>Autore:</strong> L'autore &egrave; Paolo Bosetti
<hr>
<form method="post" action="$PHP_SELF">
<select name="theme">
<option label="MWS Default" value="mws" selected>MWS Default</option>
<option label="Framed" value="framed">Framed</option>
</select>
<input type="submit" name="submit" value="Imposta il tema">
<input type="hidden" name="function" value="setTheme">
</form>
EOD;
	return $content;
}

// inclusione automatica dei template in /templates/panels
function showPanel($page) {
	global $tpl;
	$tpl->define( array(
		"panel"		=> "panels/$page.tpl"
	)); 
	$tpl->parse(PANEL, "panel");
	return $tpl->fetch("PANEL");
}


function panel_logo() {
	$content = <<<EOD
<strong>Attenzione:</strong> Nel caso in cui troviate utile MWS, inserite uno
dei loghi qui presentati nei crediti del Vostro sito. Grazie!
EOD;
	return $content;
}
?>
Return current item: MWS - ModularWebSystem