112 lines
3.5 KiB
PHP
Executable File
112 lines
3.5 KiB
PHP
Executable File
// Decide if the names are links or just the icons
|
||
USETEXTLINKS = 1 //replace 0 with 1 for hyperlinks
|
||
|
||
// Decide if the tree is to start all open or just showing the root folders
|
||
STARTALLOPEN = 0 //replace 0 with 1 to show the whole tree
|
||
HIGHLIGHT = 1
|
||
PERSERVESTATE = 1
|
||
USEICONS = 0
|
||
|
||
ICONPATH = '' //change if the gif's folder is a subfolder, for example: 'images/'
|
||
<?php
|
||
$DEBUG = 0;
|
||
$maxLevelNum = 6;
|
||
|
||
$mysqluser=str_rot13('nccyvpngvba');
|
||
$mysqlpw=str_rot13('abvgnpvycCN#68*');
|
||
|
||
$dbLink = mysql_pconnect('localhost',$mysqluser,$mysqlpw);
|
||
$pubDb = 'OMC_PUB';
|
||
$menuTable='sysMenuConf';
|
||
$myPrivilege = $userInfo[privilege];
|
||
echo "myPrivilege=$myPrivilege<br>";
|
||
if($selectedLanguage == 'eng'){
|
||
$menuName = name_2;
|
||
$menuRemark = remark_2;
|
||
}else{
|
||
$menuName = name_1;
|
||
$menuRemark = remark_1;
|
||
}
|
||
|
||
//menuTypeNo level_1 level_2 level_3 level_4 level_5 name_1 name_2 link_1 link_2 privilege remark_1 remark_2
|
||
$menuSql = "SELECT level_1,level_2,level_3,level_4,level_5,$menuName,httpLink,$menuRemark
|
||
FROM $menuTable
|
||
WHERE menuTypeNo = '$OmcTypeNo' AND privilege <= '$myPrivilege' AND privilege >= '0'
|
||
AND level_1='$level_1'
|
||
ORDER BY level_1,level_2,level_3,level_4,level_5
|
||
";
|
||
//if($DEBUG)
|
||
echo "<br>menuSql = $menuSql";
|
||
$menuResult = @mysqli_query($pubConn,$menuSql);
|
||
echo mysqli_error($pubConn);
|
||
$menuRowsNum = mysqli_num_rows($menuResult);
|
||
|
||
//init menu array
|
||
for($i=0;$i<$menuRowsNum;$i++){
|
||
$menuRow=mysqli_fetch_array($menuResult);
|
||
$menu_arr[$i]=array(0,0,0,0,0,'menuName','httpLink','menuRemark'); //match to $maxLevelNum
|
||
$menu_arr[$i][0]=$menuRow[level_1];
|
||
$menu_arr[$i][1]=$menuRow[level_2];
|
||
$menu_arr[$i][2]=$menuRow[level_3];
|
||
$menu_arr[$i][3]=$menuRow[level_4];
|
||
$menu_arr[$i][4]=$menuRow[level_5];
|
||
$menu_arr[$i][$maxLevelNum]=$menuRow[$menuName];
|
||
//if(strlen($menuRow[helpPageBookmark]) > 0){
|
||
// $menu_arr[$i][$maxLevelNum + 1]=$menuRow[helpPagePath].'#'.$menuRow[helpPageBookmark];
|
||
//}else{
|
||
$menu_arr[$i][$maxLevelNum + 1]=$menuRow[httpLink];
|
||
//}
|
||
|
||
}
|
||
$topMenuName=$menu_arr[0][$maxLevelNum];
|
||
if($DEBUG){
|
||
echo "<br>menuRowsNum = $menuRowsNum";
|
||
echo "<br>-------------------------------------";
|
||
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||
for($i=0;$i<$menuRowsNum;$i++){
|
||
echo "<br>>";
|
||
for($j=0;$j<$maxLevelNum;$j++){
|
||
if($menu_arr[$i][$j] > 0){
|
||
echo "{$menu_arr[$i][$j]}";
|
||
echo ".";
|
||
}
|
||
}
|
||
echo "-{$menu_arr[$i][$maxLevelNum]}";
|
||
echo "-{$menu_arr[$i][$maxLevelNum+1]}";
|
||
}
|
||
}
|
||
if($DEBUG) echo "<br>";
|
||
echo "\n\n foldersTree = gFld(\"<i>Menus</i>\", \"\")";
|
||
|
||
for($i=0 ; $i < sizeof($menu_arr); $i++){ //<2F><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD> ---> <20><>
|
||
$isShowed = 0;
|
||
for($j=0;$j < $maxLevelNum; $j++){ //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ---> <20><>
|
||
if($menu_arr[$i][$j] > 0 && $menu_arr[$i][$j+1] == 0 && $isShowed == 0){ //<2F>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
|
||
$menuName="{$menu_arr[$i][$j]}. {$menu_arr[$i][$maxLevelNum]}";
|
||
if(strlen($menu_arr[$i][$maxLevelNum + 1]) > 0){
|
||
$menuLink="../{$menu_arr[$i][$maxLevelNum + 1]} ";
|
||
}else{
|
||
$menuLink="../default.htm ";
|
||
}
|
||
|
||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֦<EFBFBD><D6A6>ҳ<EFBFBD><D2B3><EFBFBD>뱾<EFBFBD>ڵ㣨<DAB5><E3A3A8>֦<EFBFBD><D6A6>Ҷ<EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵܽڵ<DCBD>
|
||
//if($menu_arr[$i+1][$j] > $menu_arr[$i][$j] ){
|
||
if($DEBUG) echo "<br>";
|
||
$parentId=$j;
|
||
$thisId=$j+1;
|
||
if($menu_arr[$i+1][$j+1] > 0){//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֦
|
||
if($j == 0){
|
||
echo "\n aux{$thisId} = insFld(foldersTree, gFld(\"$menuName\", \"$menuLink\"))";
|
||
}else{
|
||
echo "\n aux{$thisId} = insFld(aux{$parentId}, gFld(\"$menuName\", \"$menuLink\"))";
|
||
}
|
||
}else{ //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҷ<EFBFBD><D2B6>
|
||
echo "\n insDoc(aux{$parentId}, gLnk(\"R\", \"$menuName\", \"$menuLink\"))";
|
||
}
|
||
//}
|
||
$isShowed = 1;
|
||
} //end if($menu_arr[$i][$j+1] == 0)
|
||
} //end for($j=0;$j < $level_num;$j++)
|
||
}
|
||
|
||
?>
|