<?PHP
/*
* index.php main user control file.
* copyright (c)2005 Marco Islas <markuz@islascruz.org>
*/
/*
 *  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 Library 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, USA.
 */
 
 //includes
 //You need to include config.php
 require_once("./include/config.php") ;

$title = $GLOBALS["functions"]->get_registry_value("/pagval/title");
$url = $GLOBALS["functions"]->get_registry_value("/pagval/url");

//main block
$tpl = new template(CINTILLA_PATH."xhtml/");
$tpl->load("layout","principal.html");
$tpl->setBlock("main","layout");
//Header
$tpl->setBlock("header","layout");
$tpl->set_variable("title",$title);
$tpl->expand("expheader","header");
//Body
if (!isset($_REQUEST["action"])){
	$tpl1 = new template(CINTILLA_PATH."xhtml/");
	$tpl1->load("layout","principal.html");
	$tpl1->setBlock("index","layout");
	$tpl1->set_variable("notes",$GLOBALS["actions"]->execute("notes"));
	$tpl1->set_variable("themes",$GLOBALS["functions"]->get_themes());
	$tpl1->set_variable("url",$url);
	$tpl1->set_variable("sitename",$name);
	$tpl1->expand("expindex","index");
	$data = $tpl1->export("expindex");
}else
	$data = $GLOBALS["actions"]->execute($_REQUEST["action"]);
$tpl->setBlock("body","layout");
$tpl->set_variable("unaproved",$GLOBALS["functions"]->unaproved_sites());
$tpl->set_variable("aproved",$GLOBALS["functions"]->aproved_sites());
$tpl->set_variable("data",$data);
$tpl->expand("expbody","body");
//Footer
$tpl->setBlock("footer","layout");
$tpl->expand("expfooter","footer");
$tpl->expand("expmain","main");
$tpl->print_export("expmain")
?>