help.verua.ch/include/class.nav.php

83 lines
2.8 KiB
PHP
Raw Normal View History

2026-01-05 08:46:20 +01:00
<?php
/*********************************************************************
class.nav.php
Navigation helper classes. Pointless BUT helps keep navigation clean and free from errors.
Peter Rotich <peter@osticket.com>
Copyright (c) 2006-2010 osTicket
http://www.osticket.com
Released under the GNU General Public License WITHOUT ANY WARRANTY.
See LICENSE.TXT for details.
vim: expandtab sw=4 ts=4 sts=4:
$Id: $
**********************************************************************/
class StaffNav {
var $tabs=array();
var $submenu=array();
var $activetab;
var $ptype;
function StaffNav($pagetype='staff'){
global $thisuser;
$this->ptype=$pagetype;
$tabs=array();
if($thisuser->isAdmin() && strcasecmp($pagetype,'admin')==0) {
$tabs['dashboard']=array('desc'=>'Dashboard','href'=>'admin.php?t=dashboard','title'=>'Admin Dashboard');
$tabs['settings']=array('desc'=>'Einstellungen','href'=>'admin.php?t=settings','title'=>'Systemeinstellungen');
$tabs['emails']=array('desc'=>'Emails','href'=>'admin.php?t=email','title'=>'Emaileinstellungen');
$tabs['topics']=array('desc'=>'Hilfethemen','href'=>'admin.php?t=topics','title'=>'Hilfethemen');
$tabs['staff']=array('desc'=>'Personal','href'=>'admin.php?t=staff','title'=>'Personalmitglieder');
$tabs['depts']=array('desc'=>'Abteilungen','href'=>'admin.php?t=depts','title'=>'Abteilungen');
}else {
$tabs['tickets']=array('desc'=>'Tickets','href'=>'tickets.php','title'=>'Ticketabfrage');
if($thisuser && $thisuser->canManageKb()){
$tabs['kbase']=array('desc'=>'Knowledge Base','href'=>'kb.php','title'=>'Knowledge Base: Vorschl&auml;ge');
}
$tabs['directory']=array('desc'=>'Verzeichnis','href'=>'directory.php','title'=>'Personalverzeichnis');
$tabs['profile']=array('desc'=>'Mein Account','href'=>'profile.php','title'=>'Mein Profil');
}
$this->tabs=$tabs;
}
function setTabActive($tab){
if($this->tabs[$tab]){
$this->tabs[$tab]['active']=true;
if($this->activetab && $this->activetab!=$tab && $this->tabs[$this->activetab])
$this->tabs[$this->activetab]['active']=false;
$this->activetab=$tab;
return true;
}
return false;
}
function addSubMenu($item,$tab=null) {
$tab=$tab?$tab:$this->activetab;
$this->submenu[$tab][]=$item;
}
function getActiveTab(){
return $this->activetab;
}
function getTabs(){
return $this->tabs;
}
function getSubMenu($tab=null){
$tab=$tab?$tab:$this->activetab;
return $this->submenu[$tab];
}
}
?>