summaryrefslogtreecommitdiff
path: root/www-ssl
diff options
context:
space:
mode:
authorcookie <cookie@29ba0400-6e00-0410-a75a-ca02368028f8>2006-12-01 15:20:38 +0000
committercookie <cookie@29ba0400-6e00-0410-a75a-ca02368028f8>2006-12-01 15:20:38 +0000
commit9c1117aae6a9dbdebf29f1d84220f425546dd484 (patch)
treeb503768d5338b2f7cff9bbb47733660a78ab3d1a /www-ssl
parentb91450e558455d704cd0d09504b503be9eacd590 (diff)
kompletter umbau euf ein dynamiesches menue
git-svn-id: svn://svn.cccv.de/engel-system@188 29ba0400-6e00-0410-a75a-ca02368028f8
Diffstat (limited to 'www-ssl')
-rwxr-xr-xwww-ssl/inc/error_handler.php9
-rwxr-xr-xwww-ssl/inc/funktion_lang.php28
-rwxr-xr-xwww-ssl/inc/funktion_menu.php68
-rwxr-xr-xwww-ssl/inc/header.php2
-rwxr-xr-xwww-ssl/inc/menu.php14
5 files changed, 50 insertions, 71 deletions
diff --git a/www-ssl/inc/error_handler.php b/www-ssl/inc/error_handler.php
index cbb3bd83..b0a41581 100755
--- a/www-ssl/inc/error_handler.php
+++ b/www-ssl/inc/error_handler.php
@@ -32,9 +32,12 @@
set_error_handler("Error_Handler");
ini_set( "error_reporting", E_ALL);
- ini_set( "display_errors", "On");
- ini_set( "display_startup_errors", "On");
- ini_set( "html_errors", "On");
+ if( $DEBUG)
+ {
+ ini_set( "display_errors", "On");
+ ini_set( "display_startup_errors", "On");
+ ini_set( "html_errors", "On");
+ }
// send errors
function send_errors()
diff --git a/www-ssl/inc/funktion_lang.php b/www-ssl/inc/funktion_lang.php
index 044da6a5..d5d3e144 100755
--- a/www-ssl/inc/funktion_lang.php
+++ b/www-ssl/inc/funktion_lang.php
@@ -1,9 +1,9 @@
<?PHP
-function Get_Text ($TextID)
+function Get_Text ($TextID, $NoError=FALSE)
{
- GLOBAL $con, $error_messages;
+ GLOBAL $con, $error_messages, $DEBUG;
if( !isset($_SESSION['Sprache']))
$_SESSION['Sprache'] = "EN";
@@ -17,6 +17,8 @@ function Get_Text ($TextID)
if( mysql_num_rows( $Erg) == 1)
return (@mysql_result($Erg, 0, "Text"));
+ elseif( $NoError && !$DEBUG)
+ return "";
else
{
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;
-
- 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";
- }
+ echo Get_Text ($TextID, $NoError);
}
?>
diff --git a/www-ssl/inc/funktion_menu.php b/www-ssl/inc/funktion_menu.php
index 586fce91..bd425b3c 100755
--- a/www-ssl/inc/funktion_menu.php
+++ b/www-ssl/inc/funktion_menu.php
@@ -1,42 +1,40 @@
<?PHP
-function ShowMenu( $Menu )
+function ShowMenu( $MenuName)
{
- if( !isset($Menu["Entry"]) ) return;
-
- global $MenueTableStart, $MenueTableEnd, $_SESSION, $DEBUG;
-
- echo $MenueTableStart;
- echo "<h4 class=\"menu\">". $Menu["Name"]. "</h4>";
+ global $MenueTableStart, $MenueTableEnd, $_SESSION, $DEBUG, $url, $ENGEL_ROOT;
+ $Gefunden=FALSE;
- foreach( $Menu["Entry"] as $Entry )
- {
- //wenn File mit ../ beginnt wird "../" abgeschnitten und der Ordener weggelassen
- if( strstr( $Entry["File"], "../" ) != FALSE )
- $MenuFile = substr( $Entry["File"], strpos( $Entry["File"], "../" )+ 3) ;
- else
- $MenuFile = $Menu["Path"]. $Entry["File"];
+ //Überschift
+ $Text = "<h4 class=\"menu\">". Get_Text("$MenuName/"). "</h4>";
- if( $_SESSION['CVS'][$MenuFile] == "Y")
- {
- echo "\t\t\t<li><a href=\"". $Entry["File"]. "\">". $Entry["Name"]. "</a></li>\n";
- if( isset($Entry["Line"]))
- echo $Entry["Line"];
- }
-
- //DEBUG
- if( $DEBUG )
- {
- if( !isset($_SESSION['CVS'][$MenuFile] ) )
- echo "ERROR CVS: '". $MenuFile. "' not set";
-
- if( $_SESSION['CVS'][$MenuFile] != "Y")
- echo "\t\t\t<li>". $Entry["File"]. " (". $Entry["Name"]. ")</li>\n";
- } // DEBUG
- } //foreach
-
- echo $MenueTableEnd;
-} //function ShowMenue
-
+ //einträge
+ foreach( $_SESSION['CVS'] as $Key => $Entry )
+ if( strpos( $Key, ".php") > 0)
+ if( (strpos( "00$Key", "0$MenuName") > 0) ||
+ ((strlen($MenuName)==0) && (strpos( "0$Key", "/") == 0) ) )
+ {
+ $TempName = Get_Text($Key, TRUE);
+ if(( TRUE||$DEBUG) && (strlen($TempName)==0) )
+ $TempName = "not found: \"$Key\"";
+
+ if( $Entry == "Y")
+ {
+ //zum absichtlkichen ausblenden von einträgen
+ if( strlen($TempName)>1)
+ {
+ $Gefunden = TRUE;
+ $Text .= "\t\t\t<li><a href=\"". $url. substr( $ENGEL_ROOT, 1). $Key. "\">$TempName</a></li>\n";
+ }
+ }
+ elseif( $DEBUG )
+ {
+ $Gefunden = TRUE;
+ $Text .= "\t\t\t<li>$TempName ($Key)</li>\n";
+ }
+ }
+ if( $Gefunden)
+ echo $MenueTableStart.$Text.$MenueTableEnd;
+}//function ShowMenue
?>
diff --git a/www-ssl/inc/header.php b/www-ssl/inc/header.php
index ab11066c..2933a457 100755
--- a/www-ssl/inc/header.php
+++ b/www-ssl/inc/header.php
@@ -1,6 +1,6 @@
<?PHP
-include ("./inc/error_handler.php");
include ("./inc/config.php");
+include ("./inc/error_handler.php");
include ("./inc/config_db.php");
include ("./inc/funktion_lang.php");
include ("./inc/funktion_menu.php");
diff --git a/www-ssl/inc/menu.php b/www-ssl/inc/menu.php
index 579b3e63..c06edba9 100755
--- a/www-ssl/inc/menu.php
+++ b/www-ssl/inc/menu.php
@@ -11,20 +11,14 @@ $MenueTableEnd="
<br>
</td>
</tr>
-</table>
+</table><br>
";
include("./menu.php");
-if( isset( $Menu))
-{
- ShowMenu( $Menu );
- echo "<br>";
-}
-if( isset( $MenuAdmin))
- ShowMenu( $MenuAdmin );
-
-echo "<br>";
+ShowMenu("");
+ShowMenu("nonpublic");
+ShowMenu("admin");
if( !isset($submenus))
$submenus = 0;