<?php
// $Id: cp_functions.php,v 1.1 2004/07/11 10:27:44 Farsus Exp $
// -------------------------------------------------------------------------//
//			                 RUNCMS                                         //
//                                                                          //
//	 reliable - Unique - Nocost &  Simplicity & ease off use                //
//                       < http://www.runcms.org >                          //
// -------------------------------------------------------------------------//
// 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 $xoopsConfig, $xoopsUser, $xoopsModule, $fct, $meta;

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/".$xoopsConfig['language']."") ) {
			$modinfo = "| <a href='".XOOPS_URL."/modules/system/admin/".$fct."/manual/".$xoopsConfig['language']."/' target='_blank'><b>".ucfirst($fct)." "._MANUAL."</b></a> <img src='".XOOPS_URL."/images/language/".$xoopsConfig['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/' target='_blank'><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/".$xoopsConfig['language']) ) {
			$modinfo = "| <a href='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/manual/".$xoopsConfig['language']."/' target='_blank'><b>".$xoopsModule->name()." "._MANUAL."</b></a> <img src='".XOOPS_URL."/images/language/".$xoopsConfig['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/' target='_blank'><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="110" valign="top">
<table border="0" cellpadding="0" cellspacing="0" valign="top" width="100%"><tr>
<td class="bg2">
<table width="100%" 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='center'>".$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 $xoopsConfig;
?>
</td>
</tr><tr>
<td colspan="2">
<div align="center"><?php echo XOOPS_VERSION;?> &copy; 2004 <a href="http://www.runcms.org/" target="_blank">RUNCMS</a></div>
</td>
</tr></table>
<?php
include(XOOPS_ROOT_PATH."/modules/system/cache/adminmenu.php");
echo $xoops_admin_menu_dv;
if ( !empty($xoopsConfig['debug_mode']) ) {
	debug_info($xoopsConfig['debug_mode']);
}
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
}
// ------------------------------------------------------------------------- //
}
?>
