bugfix hauptmenu

This commit is contained in:
Xenomporio 2022-05-23 17:55:11 +02:00
parent 3f7a031bd7
commit f1c0a10017

View File

@ -1,96 +1,89 @@
<?php <?php
/* /*
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE **** * *** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
* *
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019 * Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
* *
* This file is licensed under the Embedded Projects General Public License *Version 3.1. * This file is licensed under the Embedded Projects General Public License *Version 3.1.
* *
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis * You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
* to obtain the text of the corresponding license version. * to obtain the text of the corresponding license version.
* *
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE **** * *** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
*/ */
?> ?>
<?php <?php
class Hauptmenu { class Hauptmenu {
var $app; var $app;
function __construct(&$app) { function __construct(&$app) {
//parent::GenHauptmenu($app); //parent::GenHauptmenu($app);
$this->app=&$app; $this->app = &$app;
$this->app->ActionHandlerInit($this); $this->app->ActionHandlerInit($this);
$this->app->ActionHandler("list","HauptmenuList"); $this->app->ActionHandler("list", "HauptmenuList");
$this->app->ActionHandlerListen($app); $this->app->ActionHandlerListen($app);
$this->app->Tpl->Set('UEBERSCHRIFT',"Hauptmen&uuml;"); $this->app->Tpl->Set('UEBERSCHRIFT', "Hauptmen&uuml;");
} }
function HauptmenuList() {
function HauptmenuList()
{
//this->WFconf[menu][mitarbeiter] //this->WFconf[menu][mitarbeiter]
$menu = $this->app->Conf->WFconf['menu'][$this->app->User->GetType()]; $menu = $this->app->Conf->WFconf['menu'][$this->app->User->GetType()];
$this->app->Tpl->Add('PAGE',"<table border=\"0\" width=\"100%\" style=\"background-color: #ffffff;\"><tr valign=\"top\">"); $this->app->Tpl->Add('PAGE', "<table border=\"0\" width=\"100%\" style=\"background-color: #ffffff;\"><tr valign=\"top\">");
$spalten_anzahl = 5; $spalten_anzahl = 5;
$i=0; $i = 0;
if(count($menu)>0){
foreach($menu as $key=>$value){ if (!is_null($menu)) {
if (count($menu) > 0) {
foreach ($menu as $key => $value) {
$i++; $i++;
if($value[first][2]!="") if ($value[first][2] != "")
// $this->app->Tpl->Set(FIRSTNAV,' href="index.php?module='.$value[first][1].'&action='.$value[first][2].'" // $this->app->Tpl->Set(FIRSTNAV,' href="index.php?module='.$value[first][1].'&action='.$value[first][2].'"
$this->app->Tpl->Set('FIRSTNAV',' $this->app->Tpl->Set('FIRSTNAV', '
>'.$value['first'][0].'</a>'); >' . $value['first'][0] . '</a>');
else else
$this->app->Tpl->Set('FIRSTNAV',' href="index.php?module='.$value['first'][1].'" $this->app->Tpl->Set('FIRSTNAV', ' href="index.php?module=' . $value['first'][1] . '"
>'.$value['first'][0].'</a>'); >' . $value['first'][0] . '</a>');
$this->app->Tpl->Add('PAGE',"<td>"); $this->app->Tpl->Add('PAGE', "<td>");
$this->app->Tpl->Parse('PAGE','firstnav.tpl'); $this->app->Tpl->Parse('PAGE', 'firstnav.tpl');
$spalten++; $spalten++;
if(count($value['sec'])>0){ if (count($value['sec']) > 0) {
$this->app->Tpl->Add('PAGE','<ul>'); $this->app->Tpl->Add('PAGE', '<ul>');
foreach($value['sec'] as $secnav){ foreach ($value['sec'] as $secnav) {
if($secnav[2]!="") if ($secnav[2] != "")
$this->app->Tpl->Set('SECNAV',' href="index.php?module='.$secnav[1].'&action='.$secnav[2].'" $this->app->Tpl->Set('SECNAV', ' href="index.php?module=' . $secnav[1] . '&action=' . $secnav[2] . '"
>'.$secnav[0].'</a>'); >' . $secnav[0] . '</a>');
else else
$this->app->Tpl->Set('SECNAV',' href="index.php?module='.$secnav[1].'">'.$secnav[0].'</a>'); $this->app->Tpl->Set('SECNAV', ' href="index.php?module=' . $secnav[1] . '">' . $secnav[0] . '</a>');
$this->app->Tpl->Parse('PAGE','secnav.tpl'); $this->app->Tpl->Parse('PAGE', 'secnav.tpl');
}
$this->app->Tpl->Add('PAGE', "</td>");
if ($spalten % $spalten_anzahl == 0) {
$this->app->Tpl->Add('PAGE', "</tr><tr valign=\"top\">");
} }
$this->app->Tpl->Add('PAGE',"</td>");
if($spalten % $spalten_anzahl == 0)
{
$this->app->Tpl->Add('PAGE',"</tr><tr valign=\"top\">");
} }
} }
} }
} }
$restliche_td = $spalten % $spalten_anzahl; $restliche_td = $spalten % $spalten_anzahl;
for($i=0;$i<$restliche_td;$i++) for ($i = 0; $i < $restliche_td; $i++)
$this->app->Tpl->Add('PAGE',"<td></td>"); $this->app->Tpl->Add('PAGE', "<td></td>");
$this->app->Tpl->Add('PAGE',"</tr></table>"); $this->app->Tpl->Add('PAGE', "</tr></table>");
} }
} }
?> ?>