Location: PHPKode > projects > Enigma > Enigma2/Enigma2_Install/PortalSources/Subs.inc.php
<?php
/*
*****************************************************************

 Subs.inc.php
 
*****************************************************************
LSP: Lunabyte Systems Portal
Open-Source Project Inspired by Zef Hemel (hide@address.com)
*****************************************************************
Software Version:                  LSP 2.0 "Enigma 2"
Software by:                         Lunabyte Systems (http://www.lunabyte.net)
Copyright 2002-2005 by:       Lunabyte Systems (http://www.lunabyte.net)
Support, News, Updates at:    http://www.lunabyte.net
*****************************************************************
This program is free software; you may redistribute it and/or modify it 
under the terms of the provided license as published by Lunabyte Systems.

This program is distributed in the hope that it is and will be useful,                  
but WITHOUT ANY WARRANTIES; without even any implied warranty of           
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                        

See the "LSP_license.txt" file for details of the LSP license.
The latest version can always be found at http://www.lunabyte.net.
*****************************************************************
*/

	global $db_prefix, $context, $scripturl, $moduledir, $txt, $user_info, $language;
	global $modSettings, $blockdir;

	// list membergroups for Enigma...
	$request_groups = db_query("
		SELECT ID_GROUP, groupName
		FROM {$db_prefix}membergroups", __FILE__, __LINE__);

	while ($result = mysql_fetch_assoc ($request_groups))
		$modSettings['listed_Membergroups'][] = array(
			'ID_GROUP'	=> $result['ID_GROUP'],
			'groupName'	=> $result['groupName'],
		);

	mysql_free_result ($request_groups);

	loadPLanguage('Subs.inc');

	// ############################################### //
	// Admin area 'Site Controls.'
	if (allowedTo(array('admin_forum', 'manage_menus', 'manage_blocks', 'manage_pages', 'manage_news', 'manage_articles')))
	{
		$portaladmin_areas['sitecontrol'] = array(
			'title' => $txt['PortalIndex'],
			'areas' => array()
		);
	}
	if (allowedTo('admin_forum'))
		$portaladmin_areas['sitecontrol']['areas']['Portal_Settings'] = '<a href="' . $scripturl . '?op=modifyPortalSettings">' . $txt['Portal_Settings'] . '</a>';
	if (allowedTo('manage_menus'))
		$portaladmin_areas['sitecontrol']['areas']['Menu_Management'] = '<a href="' . $scripturl . '?op=MenuManagement">' . $txt['Menu_Management'] . '</a>';
	if (allowedTo('manage_blocks'))
		$portaladmin_areas['sitecontrol']['areas']['Block_Management'] = '<a href="' . $scripturl . '?op=BlockManagement">' . $txt['Block_Management'] . '</a>';
	if (allowedTo('manage_pages'))
		$portaladmin_areas['sitecontrol']['areas']['Page_Management'] = '<a href="' . $scripturl . '?op=PageManagement">' . $txt['Page_Management'] . '</a>';
	if (allowedTo('manage_news'))
		$portaladmin_areas['sitecontrol']['areas']['News_Management'] = '<a href="' . $scripturl . '?op=NewsManagement">' . $txt['News_Management'] . '</a>';
	if (allowedTo('manage_articles'))
		$portaladmin_areas['sitecontrol']['areas']['Articles_Management'] = '<a href="' . $scripturl . '?module=ArticlesManagement">' . $txt['Articles_Management'] . '</a>';
	if (allowedTo(array('admin_forum', 'manage_menus', 'manage_blocks', 'manage_pages', 'manage_news', 'manage_articles')))
		$portaladmin_areas['sitecontrol']['areas']['Portal_Credits'] = '<a href="' . $scripturl . '?op=PortalAdmin;sa=credits">' . $txt['Portal_Credits'] . '</a>';

	// ############################################### //

	// Module Control links
	if (!empty($moduledir) && file_exists ($moduledir . '/ModuleControls.php'))
		require_once ($moduledir . '/ModuleControls.php');
	// auto load extra files
	if (!empty($moduledir) && is_dir($moduledir . '/ModuleControls'))
	{	// get lang files first to prevent undefined errors
		$files = autoLoadLangFiles('portal/modules/ModuleControls', 'Controls_', true);
		foreach ($files as $file)
		{
			$file = str_replace(array('.' . $user_info['language'], '.' . $language), '', $file);
			if (file_exists($moduledir . '/ModuleControls/' . $file))
				include_once($moduledir . '/ModuleControls/' . $file);
		}
		natcasesort($portaladmin_areas['modulecontrol']['areas']);
	}

	$context['admin_areas'] = array_merge($portaladmin_areas, $context['admin_areas']);

?>
Return current item: Enigma