<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
//v1.5 www.bcoos.net 2006-08 GPL
//v1.4 www.exoops.info 2006/03 GPL
// $Id: cp_functions.php,v 1.3 2003/03/19 06:58:09 half-dead Exp $
// ------------------------------------------------------------------------- //
//               E-Xoops: Content Management for the Masses                  //
//                       < http://www.e-xoops.com >                          //
// ------------------------------------------------------------------------- //
// Original Author: Kazumi Ono
// Author Website : http://www.mywebaddons.com/ , http://www.myweb.ne.jp
// License Type   : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //
if ( !defined("EXOOPS_CPFUNCTIONS_INCLUDED") ) {
	define("EXOOPS_CPFUNCTIONS_INCLUDED", 1);
//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function xoops_cp_header() {
global $bcoosConfig, $xoopsUser, $xoopsModule, $fct;
xoops_header(false);
include_once(XOOPS_ROOT_PATH . "/modules/system/cache/adminmenu.php");
$admin_mids      = XoopsModule::getByRight($xoopsUser->groups(), "A");
$abscissa_step   = 140; // step for the left boundaries of layers
$abscissa_offset = 15; // to choose the horizontal coordinate start offset for the layers
$abscissa_stepx5 = ($abscissa_step * 5);
$rightarrow      = " &middot;&middot;&middot;&gt;";
// the following is to support browsers not detecting the mouse position
$ordinata_step = 15; // estimated value of the number of pixels between links on a layer
$ordinata[1]   = (150 - $ordinata_step); // to choose the vertical coordinate start offset for the layers
?>
<script type="text/javascript">
<!--
var thresholdY = 15; // in pixels; threshold for vertical repositioning of a layer
var ordinata_margin = 20; // to start the layer a bit above the mouse vertical coordinate
// -->
</script>
<script type="text/javascript" src="<?php echo XOOPS_URL."/include/layersmenu.js";?>">
</script>
<script type="text/javascript">
<!--
<?php
echo $xoops_admin_menu_js;
?>
function moveLayers() {
<?php
foreach ($admin_mids as $adm) {
	echo $xoops_admin_menu_ml[$adm];
}
?>
}
function shutdown() {
<?php
foreach ($admin_mids as $adm) {
	echo $xoops_admin_menu_sd[$adm];
}
?>
}
if (NS4) {
document.onmousedown = function() { shutdown(); }
} else {
document.onclick = function() { shutdown(); }
}
// -->
</script>
<?php
if ($xoopsModule) {
	if ($xoopsModule->dirname() == "system") {
		if ( @is_dir(XOOPS_ROOT_PATH . "/modules/system/admin/".$fct."/manual/".$bcoosConfig['language']."") ) {
			$modinfo = "| <a href='".XOOPS_URL."/modules/system/admin/".$fct."/manual/".$bcoosConfig['language']."/'><b>".ucfirst($fct)." "._MANUAL."</b></a> <img src='".XOOPS_URL."/images/language/".$bcoosConfig['language'].".gif' border ='0' height='10' width='15'>";
			} elseif ( @is_dir(XOOPS_ROOT_PATH . "/modules/system/admin/".$fct."/manual/english") ) {
				$modinfo = "| <a href='".XOOPS_URL."/modules/system/admin/".$fct."/manual/english/'><b>".ucfirst($fct)." "._MANUAL."</b></a> <img src='".XOOPS_URL."/images/language/english.gif' border ='0' height='10' width='15'>";
			}
	} else {
		if ( @is_dir(XOOPS_ROOT_PATH . "/modules/".$xoopsModule->dirname()."/manual/".$bcoosConfig['language']) ) {
			$modinfo = "| <a href='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/manual/".$bcoosConfig['language']."/'><b>".$xoopsModule->name()." "._MANUAL."</b></a> <img src='".XOOPS_URL."/images/language/".$bcoosConfig['language'].".gif' border ='0' height='10' width='15'>";
			} elseif ( @is_dir(XOOPS_ROOT_PATH . "/modules/".$xoopsModule->dirname()."/manual/english") ) {
				$modinfo = "| <a href='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/manual/english/'><b>".$xoopsModule->name()." "._MANUAL."</b></a> <img src='".XOOPS_URL."/images/language/english.gif' border ='0' height='10' width='15'>";
			}
	}
}
?>
</head>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
<br />
<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr class="bg3">
<td>&nbsp;&nbsp;<a href="<?php echo XOOPS_URL;?>/admin.php"><?php echo _CPHOME;?></a></td>
<td align="right">
<a href="<?php echo XOOPS_URL;?>/"><?php echo _YOURHOME;?></a>
<?php echo $modinfo;?>&nbsp;&nbsp;</td>
</tr></table>
<br />
<table border="0" cellpadding="0" cellspacing="5" width="100%"><tr>
<td width="150" valign="top">
<table border="0" cellpadding="0" cellspacing="0" valign="top" width="100%"><tr>
<td class="bg2">
<table width='160' border="0" cellpadding="4" cellspacing="1">
<?php
foreach ($admin_mids as $adm) {
	if ( !empty($xoops_admin_menu_ft[$adm]) ) {
		echo "<tr><td class='bg3' align='left'>".$xoops_admin_menu_ft[$adm]."</td></tr>";
	}
}
echo "</table></td></tr></table></td><td valign='top' width='100%'>";
}
//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function xoops_cp_footer() {
global $bcoosConfig;
?>
</td></tr></table>
<?php
include(XOOPS_ROOT_PATH."/modules/system/cache/adminmenu.php");
echo $xoops_admin_menu_dv;
if ( !empty($bcoosConfig['debug_mode']) ) {
	debug_info($bcoosConfig['debug_mode']);
} else {
echo "<span style='font-size:15px;font-weight: bold;'&nbsp;&copy;<a href='http://www.bcoos.net/'>".XOOPS_VERSION." [GPL]</a>";
}
echo "</body></html>";
ob_end_flush();
}
//---------------------------------------------------------------------------------------//
/**
* We need these because theme files will not be included
*
* @param type $var description
* @return type description
*/
function OpenTable() {
?>
<table width="100%" border="0" cellspacing="1" cellpadding="0"><tr class="bg2">
<td valign="top">
<table width="100%" border="0" cellspacing="1" cellpadding="8"><tr class="bg1">
<td valign="top">
<?php
}
//---------------------------------------------------------------------------------------//
/**
* We need these because theme files will not be included
*
* @param type $var description
* @return type description
*/
function CloseTable() {
?>
</td></tr></table></td></tr></table>
<?php
}
// ------------------------------------------------------------------------- //
}
?>
