Location: PHPKode > projects > ChiCoMaS - Chilek CMS > chicomas/modules/user/user_operation.php
<?
defined( '_VALID_DA_' ) or die( 'Direct Access to this location is not allowed.' );

global $module;
global $module_path;

$module = "user";
$module_path = "./modules/user/";

//Include Language File
include($module_path."groups.php");
include($module_path."groupperms.php");
include($module_path."groupusers.php");
include($module_path."allusers.php");

function Create_Tab_Menu($request){

	global $module;
	global $module_path;

	$obj_tempdbarray = new CTempDBArray();
	$obj_tempdbengine = new CTempDBEngine();

	$sf = $request['sf'];
	$group = $request['group'];
	if (!isset($group))
		$group="0";
	$groupid = $group;

	$content = "
	<div id=\"navcontainer\">
	<ul id=\"navlist\">";

	$current = "id=\"current\"";
	$active = "id=\"active\"";


	$submenu = null;
	if ($groupid!=0){

		$SQL = "SELECT * FROM groups ";
		$SQL .= "WHERE group_id='".intval($groupid)."' ";
		$row = $obj_tempdbengine->GetRow($SQL);
		$groupname = $row['group_name'];

		if ($groupname!=""){
			if ($sf=="groupperms")
				$submenu .= "<li $active><a href=\"".basename($PHP_SELF)."?f=user&sf=groupperms&group=$groupid\" $current>\"$groupname\""._CP_UA_PERMISSIONS_."</a></li>";
			else
				$submenu .= "<li><a href=\"".basename($PHP_SELF)."?f=user&sf=groupperms&group=$groupid\">\"$groupname\""._CP_UA_PERMISSIONS_."</a></li>";

			if ($sf=="groupusers")
				$submenu .= "<li $active><a href=\"".basename($PHP_SELF)."?f=user&sf=groupusers&group=$groupid\" $current>\"$groupname\""._CP_UA_OF_USERS_."</a></li>";
			else
				$submenu .= "<li><a href=\"".basename($PHP_SELF)."?f=user&sf=groupusers&group=$groupid\">\"$groupname\""._CP_UA_OF_USERS_."</a></li>";
		}

	}

	$content .= "<li><a href=\"".basename($PHP_SELF)."?mode=admin\">"._CONTROL_PANEL_."</a></li>";

	switch ($sf){
	default:
	case 'groups':
			$content .= "<li $active><a href=\"".basename($PHP_SELF)."?f=user&sf=groups&group=$groupid\" $current>"._CP_UA_GROUPS_."</a></li>";

			$content .= $submenu;
	
			$content .= "<li><a href=\"".basename($PHP_SELF)."?f=user&sf=allusers&group=$groupid\">"._CP_UA_ALL_USERS_."</a></li>";
	break;
	case 'allusers':
			$content .= "<li><a href=\"".basename($PHP_SELF)."?f=user&sf=groups&group=$groupid\">"._CP_UA_GROUPS_."</a></li>";

			$content .= $submenu;

			$content .= "<li $active><a href=\"".basename($PHP_SELF)."?f=user&sf=allusers&group=$groupid\" $current>"._CP_UA_ALL_USERS_."</a></li>";
	break;
	}

	$content .= "
	</ul>
	</div>";

	return $content;

};



//*****************************************************************************
function User_Operation($request){

	global $module;
	global $module_path;

	$obj_tempdbarray = new CTempDBArray();
	$obj_tempdbengine = new CTempDBEngine();

	$sf = $request['sf'];

	$content = Create_Tab_Menu($request);

	switch ($sf){
	default:
	case 'groups':
		$content .= Group_Operations($request);
	break;
	case 'groupperms':
		$content .= Group_Permissions($request);
	break;
	case 'groupusers':
		$content .= Group_Users($request);
	break;
	case 'allusers':
		$content .= All_Users($request);
	break;
	}

	return $content;
}

?>
Return current item: ChiCoMaS - Chilek CMS