Location: PHPKode > projects > WB News > admin/usergroup.php
<?php

/*========================================================*\
||########################################################||
||#                                                      #||
||#     WB News v1.0.0                                   #||
||# ---------------------------------------------------- #||
||#     Copyright (c) 2004-2005                          #||
||#     Created: 9th September 2005                      #||
||#     Filename: usergroup.php                          #||
||#                                                      #||
||########################################################||
/*========================================================*/

/**
 *  @author $Author: pmcilwaine $
 *	@version $Id: usergroup.php,v 1.2.2.3.2.1 2008/07/14 11:04:08 pmcilwaine Exp $
 */

require_once( "global.php" );
$auth->login_if( !$auth->has_perm( "usergroups" ) );

$_SESSION["return_page"] = make_url( array("ajax"=>FALSE) );

$page = new PageTemplateEngine( BuildPath("admin/main-page.ihtml") );
$tmpl->SetFilename( BuildPath("admin/usergroup.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() );

$offset = isset($_REQUEST["offset"]) ? intval( $_REQUEST["offset"] ) : 0 ;

$fields = array(
	"usergroupid",
	"title"
	);

$cond = array();
$cond = join( " AND ", $cond );

$ids = $DB->ListBy( TBL_UGROUPS, $cond, $fields, "title ASC", 10, $offset );
$count_ids = $DB->CountBy( TBL_UGROUPS, $cond );

if ( is_array($ids) && count($ids) != 0 )
{
	foreach ( $ids as $id )
	{
		$rows[$id["usergroupid"]] = array(
			"title" => htmlspecialchars( $id["title"] ),
			"edit-link" => make_url_html( array("id"=>$id["usergroupid"]), MAIN_SERVER . "/admin/edit-usergroup" )
			);
	}
}

$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" );

$tmpl->Pagination( $count_ids, $offset, 10 );
$page->ParseContent( $tmpl->GetHTML() );
$page->ShowPage();

?>
Return current item: WB News