kompletter umbau euf ein dynamiesches menue

git-svn-id: svn://svn.cccv.de/engel-system@188 29ba0400-6e00-0410-a75a-ca02368028f8
This commit is contained in:
cookie 2006-12-01 15:20:38 +00:00
parent b91450e558
commit 9c1117aae6
6 changed files with 631 additions and 542 deletions

File diff suppressed because it is too large Load Diff

View File

@ -32,9 +32,12 @@
set_error_handler("Error_Handler"); set_error_handler("Error_Handler");
ini_set( "error_reporting", E_ALL); ini_set( "error_reporting", E_ALL);
if( $DEBUG)
{
ini_set( "display_errors", "On"); ini_set( "display_errors", "On");
ini_set( "display_startup_errors", "On"); ini_set( "display_startup_errors", "On");
ini_set( "html_errors", "On"); ini_set( "html_errors", "On");
}
// send errors // send errors
function send_errors() function send_errors()

View File

@ -1,9 +1,9 @@
<?PHP <?PHP
function Get_Text ($TextID) function Get_Text ($TextID, $NoError=FALSE)
{ {
GLOBAL $con, $error_messages; GLOBAL $con, $error_messages, $DEBUG;
if( !isset($_SESSION['Sprache'])) if( !isset($_SESSION['Sprache']))
$_SESSION['Sprache'] = "EN"; $_SESSION['Sprache'] = "EN";
@ -17,6 +17,8 @@ function Get_Text ($TextID)
if( mysql_num_rows( $Erg) == 1) if( mysql_num_rows( $Erg) == 1)
return (@mysql_result($Erg, 0, "Text")); return (@mysql_result($Erg, 0, "Text"));
elseif( $NoError && !$DEBUG)
return "";
else else
{ {
array_push($error_messages, "Get_Text, '$TextID' found ". mysql_num_rows( $Erg). "x in Sprache Database Table for Language (".$_SESSION['Sprache'].")\n"); array_push($error_messages, "Get_Text, '$TextID' found ". mysql_num_rows( $Erg). "x in Sprache Database Table for Language (".$_SESSION['Sprache'].")\n");
@ -25,27 +27,9 @@ function Get_Text ($TextID)
} }
function Print_Text ($TextID) function Print_Text ($TextID, $NoError=FALSE)
{ {
GLOBAL $con, $error_messages; echo Get_Text ($TextID, $NoError);
if( !isset($_SESSION['Sprache']))
$_SESSION['Sprache'] = "EN";
if( $_SESSION['Sprache']=="")
$_SESSION['Sprache']="EN";
if( isset($_GET["SetLanguage"]))
$_SESSION['Sprache']= $_GET["SetLanguage"];
$SQL = "SELECT * FROM `Sprache` WHERE TextID=\"$TextID\" AND Sprache ='".$_SESSION['Sprache']."'";
@$Erg = mysql_query($SQL, $con);
if( mysql_num_rows( $Erg) == 1)
echo nl2br(@mysql_result($Erg, 0, "Text"));
else
{
array_push($error_messages, "Get_Text, '$TextID' found ". mysql_num_rows( $Erg). "x in Sprache Database Table for Language (".$_SESSION['Sprache'].")\n");
echo "Error Data, '$TextID' found ". mysql_num_rows( $Erg). "x";
}
} }
?> ?>

View File

@ -1,42 +1,40 @@
<?PHP <?PHP
function ShowMenu( $Menu ) function ShowMenu( $MenuName)
{ {
if( !isset($Menu["Entry"]) ) return; global $MenueTableStart, $MenueTableEnd, $_SESSION, $DEBUG, $url, $ENGEL_ROOT;
$Gefunden=FALSE;
global $MenueTableStart, $MenueTableEnd, $_SESSION, $DEBUG; //Überschift
$Text = "<h4 class=\"menu\">". Get_Text("$MenuName/"). "</h4>";
echo $MenueTableStart; //einträge
echo "<h4 class=\"menu\">". $Menu["Name"]. "</h4>"; foreach( $_SESSION['CVS'] as $Key => $Entry )
if( strpos( $Key, ".php") > 0)
foreach( $Menu["Entry"] as $Entry ) if( (strpos( "00$Key", "0$MenuName") > 0) ||
((strlen($MenuName)==0) && (strpos( "0$Key", "/") == 0) ) )
{ {
//wenn File mit ../ beginnt wird "../" abgeschnitten und der Ordener weggelassen $TempName = Get_Text($Key, TRUE);
if( strstr( $Entry["File"], "../" ) != FALSE ) if(( TRUE||$DEBUG) && (strlen($TempName)==0) )
$MenuFile = substr( $Entry["File"], strpos( $Entry["File"], "../" )+ 3) ; $TempName = "not found: \"$Key\"";
else
$MenuFile = $Menu["Path"]. $Entry["File"];
if( $_SESSION['CVS'][$MenuFile] == "Y") if( $Entry == "Y")
{ {
echo "\t\t\t<li><a href=\"". $Entry["File"]. "\">". $Entry["Name"]. "</a></li>\n"; //zum absichtlkichen ausblenden von einträgen
if( isset($Entry["Line"])) if( strlen($TempName)>1)
echo $Entry["Line"]; {
$Gefunden = TRUE;
$Text .= "\t\t\t<li><a href=\"". $url. substr( $ENGEL_ROOT, 1). $Key. "\">$TempName</a></li>\n";
} }
}
//DEBUG elseif( $DEBUG )
if( $DEBUG )
{ {
if( !isset($_SESSION['CVS'][$MenuFile] ) ) $Gefunden = TRUE;
echo "ERROR CVS: '". $MenuFile. "' not set"; $Text .= "\t\t\t<li>$TempName ($Key)</li>\n";
}
if( $_SESSION['CVS'][$MenuFile] != "Y") }
echo "\t\t\t<li>". $Entry["File"]. " (". $Entry["Name"]. ")</li>\n"; if( $Gefunden)
} // DEBUG echo $MenueTableStart.$Text.$MenueTableEnd;
} //foreach
echo $MenueTableEnd;
}//function ShowMenue }//function ShowMenue
?> ?>

View File

@ -1,6 +1,6 @@
<?PHP <?PHP
include ("./inc/error_handler.php");
include ("./inc/config.php"); include ("./inc/config.php");
include ("./inc/error_handler.php");
include ("./inc/config_db.php"); include ("./inc/config_db.php");
include ("./inc/funktion_lang.php"); include ("./inc/funktion_lang.php");
include ("./inc/funktion_menu.php"); include ("./inc/funktion_menu.php");

View File

@ -11,20 +11,14 @@ $MenueTableEnd="
<br> <br>
</td> </td>
</tr> </tr>
</table> </table><br>
"; ";
include("./menu.php"); include("./menu.php");
if( isset( $Menu)) ShowMenu("");
{ ShowMenu("nonpublic");
ShowMenu( $Menu ); ShowMenu("admin");
echo "<br>";
}
if( isset( $MenuAdmin))
ShowMenu( $MenuAdmin );
echo "<br>";
if( !isset($submenus)) if( !isset($submenus))
$submenus = 0; $submenus = 0;