📄 index.php
字号:
<?php
include_once( "inc/auth.php" );
$theme = $_SESSION['LOGIN_THEME'];
$webroot = get_cfg_var( "doc_root" );
$themedir = $webroot."/images/menu";
echo "\r\n<html>\r\n<head>\r\n<title>菜单设置</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n";
echo "<s";
echo "cript Language=\"JavaScript\">\r\nfunction delete_menu(MENU_ID,FUNC_ID,FUNC_NAME)\r\n{\r\n msg='确认要删除子菜单项 \\''+FUNC_NAME+'\\' 么?';\r\n if(window.confirm(msg))\r\n {\r\n URL=\"delete.php?MENU_ID=\" + MENU_ID+\"&FUNC_ID1=\"+FUNC_ID;\r\n location=URL;\r\n }\r\n}\r\n</script>\r\n</head>\r\n";
$connection = openconnection( );
$query = "SELECT * from SYS_FUNCTION where MENU_ID='{$MENU_ID}'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$FUNC_NAME = $ROW['FUNC_NAME'];
$FUNC_ISEOFFICE = $ROW['FUNC_ISEOFFICE'];
}
echo "<body class=\"bodycolor\" topmargin=\"5\">\r\n<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"0\">\r\n <tr class=\"tablehead1\">\r\n <td><img src=\"/images/menu/system.gif\" align=\"absmiddle\"> 子菜单项设置(";
echo $FUNC_NAME;
echo ")\r\n </td>\r\n </tr>\r\n <tr class=\"tablehead2\">\r\n <td colspan=\"2\">";
if ( $FUNC_ISEOFFICE != 1 )
{
echo "\t <a href=\"#\" onClick=\"javascript:location.href='new.php?MENU_ID=";
echo $MENU_ID;
echo "'\"><img src=\"/images/button/achildmenu.gif\" alt=\"增加子菜单\" border=\"0\"></a>";
}
echo " <a href=\"../blank.php\"><img src=\"/images/button/return.gif\" alt=\"返回\" border=\"0\"></a>\r\n </td>\r\n </tr>\r\n\t </table>\r\n\t <table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" cellpadding=\"3\" >\r\n\t ";
if ( $_REQUEST['error'] == 1 )
{
echo "\t <tr><td colspan=\"2\"><font color='red'>请删除子菜单</font></td><tr>\r\n\t ";
}
$query1 = "SELECT * from SYS_FUNCTION where MENU_ID like '{$MENU_ID}%' and length(MENU_ID)=4 order by MENU_ID";
$cursor1 = exequery( $connection, $query1 );
$FLOW_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$MENU_ID = $ROW['MENU_ID'];
$FUNC_ID = $ROW['FUNC_ID'];
$FUNC_NAME = $ROW['FUNC_NAME'];
$FUNC_CODE = $ROW['FUNC_CODE'];
$FUNC_ISEOFFICE = $ROW['FUNC_ISEOFFICE'];
if ( strstr( $FUNC_CODE, "http://" ) )
{
$FUNC_IMAGE = "menu_url";
}
else if ( strstr( $FUNC_CODE, "file://" ) )
{
$FUNC_IMAGE = "winexe";
}
else if ( strstr( $FUNC_CODE, "/" ) )
{
$FUNC_IMAGE = substr( $FUNC_CODE, 0, strpos( $FUNC_CODE, "/" ) );
}
else
{
$FUNC_IMAGE = $FUNC_CODE;
}
++$FLOW_COUNT;
if ( $FLOW_COUNT % 2 == 1 )
{
$TableLine = "TableLine1";
}
else
{
$TableLine = "TableLine2";
}
$src = "/images/menu/".$theme."/icon/".$FUNC_ID.".gif";
$filepath = $themedir."/".$theme."/icon/".$FUNC_ID.".gif";
if ( !file_exists( $filepath ) )
{
$src = "/images/menu/1/icon/none.gif";
if ( 999 < $FUNC_ID )
{
$src = "/images/menu/".$theme."/icon/sysdefinenone.gif";
}
if ( 1999 < $FUNC_ID )
{
$src = "/images/menu/".$theme."/icon/mydefinenone.gif";
}
}
$ishaveson = substr( $FUNC_CODE, 0, 1 ) == "@" ? true : false;
$haveson = 0;
$warningimgstr = "";
if ( $ishaveson )
{
$sql_son = " \r\n\t\t\t\t\t\t SELECT COUNT(FUNC_ID) AS cnt FROM sys_function \r\n\t\t\t\t\t\t\t WHERE LEFT(MENU_ID,4)='".$MENU_ID."' \r\n\t\t\t\t\t\t\t AND LENGTH(MENU_ID)=6\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t ";
$rs_son = exequery( $connection, $sql_son );
$row_son = mysql_fetch_array( $rs_son );
if ( $row_son['cnt'] == 0 )
{
$warningimgstr = "  <img src='/images/littlegif/murumpyo.gif' title='注意:此主菜单没有下级菜单'>";
}
else
{
$haveson = 1;
}
}
echo " <tr class=\"";
echo $TableLine;
echo "\">\r\n <td nowrap title=\"";
echo $FUNC_NAME;
echo "\" > \r\n <img src=\"";
echo $src;
echo "\"> <b>";
echo $FUNC_NAME;
echo "</b> ";
echo $warningimgstr;
echo "\t\t\t</td>\r\n <td nowrap >";
if ( $ishaveson && $FUNC_ISEOFFICE != 1 )
{
echo "\t\t <a href=\"new.php?MENU_ID=";
echo $MENU_ID;
echo "\">增加子菜单</a>";
}
echo " <a href=\"edit.php?FUNC_ID1=";
echo $FUNC_ID;
echo "\"> 编辑</a> \r\n ";
if ( $FUNC_ISEOFFICE == 0 && $haveson == 0 )
{
echo "<a href=\"javascript:delete_menu('";
echo $MENU_ID;
echo "','";
echo $FUNC_ID;
echo "','";
echo $FUNC_NAME;
echo "');\"> 删除</a>";
}
echo " </td>\r\n </tr>\r\n";
if ( substr( $FUNC_CODE, 0, 1 ) == "@" )
{
$query2 = "SELECT * from SYS_FUNCTION where MENU_ID like '{$MENU_ID}%' and length(MENU_ID)=6 order by MENU_ID";
$cursor2 = exequery( $connection, $query2 );
$i = 0;
while ( $ROW = mysql_fetch_array( $cursor2 ) )
{
$FUNC_ID = $ROW['FUNC_ID'];
$MENU_ID = $ROW['MENU_ID'];
$FUNC_NAME = $ROW['FUNC_NAME'];
$FUNC_CODE = $ROW['FUNC_CODE'];
$src = "/images/menu/".$theme."/icon/".$FUNC_ID.".gif";
$filepath = $themedir."/".$theme."/icon/".$FUNC_ID.".gif";
if ( !file_exists( $filepath ) )
{
$src = "/images/menu/1/icon/none.gif";
if ( 999 < $FUNC_ID )
{
$src = "/images/menu/".$theme."/icon/sysdefinenone.gif";
}
if ( 1999 < $FUNC_ID )
{
$src = "/images/menu/".$theme."/icon/mydefinenone.gif";
}
}
if ( strstr( $FUNC_CODE, "http://" ) )
{
$FUNC_IMAGE = "menu_url";
}
else if ( strstr( $FUNC_CODE, "file://" ) )
{
$FUNC_IMAGE = "winexe";
}
else if ( strstr( $FUNC_CODE, "/" ) )
{
$FUNC_IMAGE = substr( $FUNC_CODE, 0, strpos( $FUNC_CODE, "/" ) );
}
else
{
$FUNC_IMAGE = $FUNC_CODE;
}
if ( $FUNC_CODE == "bbs2/admin" )
{
$FUNC_IMAGE = "system";
}
++$i;
if ( $i % 2 == 1 )
{
$TableLine = "TableLine2";
}
else
{
$TableLine = "TableLine1";
}
echo " <tr class=\"";
echo $TableLine;
echo "\">\r\n <td nowrap title=\"";
echo $FUNC_NAME;
echo "\">\r\n \r\n <img src=\"";
echo $src;
echo "\"> <b>";
echo $FUNC_NAME;
echo "</b>\r\n </td>\r\n <td nowrap > \r\n <a href=\"edit.php?FUNC_ID1=";
echo $FUNC_ID;
echo "\"> 编辑</a> \r\n ";
if ( $FUNC_ISEOFFICE == 0 )
{
echo "<a href=\"javascript:delete_menu('";
echo $MENU_ID;
echo "','";
echo $FUNC_ID;
echo "','";
echo $FUNC_NAME;
echo "');\"> 删除</a>";
}
echo " </td>\r\n </tr>\r\n\r\n";
}
}
}
if ( $FLOW_COUNT == 0 )
{
message( "", "没有子菜单,请添加子菜单!" );
}
echo " </table>\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -