<?php
/*========================================================*\
||########################################################||
||# #||
||# WB News v2.0.0 #||
||# ---------------------------------------------------- #||
||# Copyright (c) 2004-2007 #||
||# Created: 9th June 2007 #||
||# Filename: theme.php #||
||# #||
||########################################################||
/*========================================================*/
/**
* @author $Author: pmcilwaine $
* @version $Id: theme.php,v 1.1.2.4 2008/06/25 10:27:12 pmcilwaine Exp $
*/
require_once( "global.php" );
$auth->login_if( !$auth->is_logged() );
$_SESSION["return_page"] = make_url( array("ajax"=>FALSE) );
$page = new PageTemplateEngine( BuildPath("admin/main-page.ihtml") );
$tmpl->SetFilename( BuildPath("admin/theme.ihtml") );
$params = array(
"entry" => "\t<li>%s</li>\n\t",
"separator" => FALSE,
"class_open" => "open",
"links" => toolbarmenu()
);
$toolbar = include( INCDIR . "/page-menu.php" );
$page->AddParam( "toolbar", $toolbar );
$page->AddParam( "userinfo", $userinfo );
$rows =& $tmpl->AddParam( "rows", array() );
$cond = array();
$cond = join( " AND ", $cond );
$offset = 0;
if ( isset($_GET["ajax"]) && $_GET["ajax"] == 1 )
{
if ( isset($_GET["offset"]) )
{
$offset = intval( $_GET["offset"] );
}
}
else
{
$offset = isset($_REQUEST["offset"]) ? intval( $_REQUEST["offset"] ) : 0 ;
}
$fields = array(
"themeid as id",
"title"
);
$ids = $DB->ListBy( TBL_THEMES, $cond, $fields, "\"title\" ASC", 10, $offset );
$count_ids = $DB->CountBy( TBL_THEMES, $cond );
$pagemenu =& $tmpl->AddParam( "pagemenu", array() );
$page->BindParam( "pagemenu", $tmpl );
$params = array(
"entry" => "\t<li>%s</li>\n\t",
"separator" => "\t<li>|</li>\n\t",
"links" => buildmenu( $theme_info["pagemenu_build"] )
);
$params = array_merge( $params, $theme_info["pagemenu"] );
$pagemenu = include( INCDIR . "/page-menu.php" );
if ( $ids )
{
foreach ( $ids as $id )
{
$rows[$id["id"]] = array(
"title" => htmlspecialchars($id["title"]),
"edit-link" => make_url_html( array("id"=>$id["id"]), MAIN_SERVER . "/admin/edit-theme" )
);
}
}
$tmpl->Pagination( $count_ids, $offset, 10 );
$page->ParseContent( $tmpl->GetHTML() );
$page->ShowPage();
?>