Skip to content
Snippets Groups Projects
Commit 62a1ccfb authored by Peter Rotich's avatar Peter Rotich
Browse files

Add ability to set id on navigation elements.

parent d65cbc24
No related branches found
No related tags found
No related merge requests found
...@@ -122,8 +122,10 @@ class StaffNav { ...@@ -122,8 +122,10 @@ class StaffNav {
if($staff->canCreateTickets()) if($staff->canCreateTickets())
$subnav[]=array('desc'=>'New Ticket', $subnav[]=array('desc'=>'New Ticket',
'title' => 'Open New Ticket',
'href'=>'tickets.php?a=open', 'href'=>'tickets.php?a=open',
'iconclass'=>'newTicket', 'iconclass'=>'newTicket',
'id' => 'new-ticket',
'droponly'=>true); 'droponly'=>true);
} }
break; break;
......
...@@ -67,9 +67,12 @@ ...@@ -67,9 +67,12 @@
echo sprintf('<li class="%s"><a href="%s">%s</a>',$tab['active']?'active':'inactive',$tab['href'],$tab['desc']); echo sprintf('<li class="%s"><a href="%s">%s</a>',$tab['active']?'active':'inactive',$tab['href'],$tab['desc']);
if(!$tab['active'] && ($subnav=$nav->getSubMenu($name))){ if(!$tab['active'] && ($subnav=$nav->getSubMenu($name))){
echo "<ul>\n"; echo "<ul>\n";
foreach($subnav as $item) { foreach($subnav as $k => $item) {
echo sprintf('<li><a class="%s" href="%s" title="%s" >%s</a></li>', if (!($id=$item['id']))
$item['iconclass'],$item['href'],$item['title'],$item['desc']); $id="nav$k";
echo sprintf('<li><a class="%s" href="%s" title="%s" id="%s">%s</a></li>',
$item['iconclass'], $item['href'], $item['title'], $id, $item['desc']);
} }
echo "\n</ul>\n"; echo "\n</ul>\n";
} }
...@@ -94,8 +97,11 @@ ...@@ -94,8 +97,11 @@
) )
))) )))
$class="$class active"; $class="$class active";
if (!($id=$item['id']))
$id="subnav$k";
echo sprintf('<li><a class="%s" href="%s" title="%s" >%s</a></li>',$class,$item['href'],$item['title'],$item['desc']); echo sprintf('<li><a class="%s" href="%s" title="%s" id="%s">%s</a></li>',
$class, $item['href'], $item['title'], $id, $item['desc']);
} }
} }
?> ?>
......
...@@ -569,8 +569,10 @@ if($thisstaff->showAssignedOnly() && $stats['closed']) { ...@@ -569,8 +569,10 @@ if($thisstaff->showAssignedOnly() && $stats['closed']) {
if($thisstaff->canCreateTickets()) { if($thisstaff->canCreateTickets()) {
$nav->addSubMenu(array('desc'=>'New Ticket', $nav->addSubMenu(array('desc'=>'New Ticket',
'title' => 'Open New Ticket',
'href'=>'tickets.php?a=open', 'href'=>'tickets.php?a=open',
'iconclass'=>'newTicket'), 'iconclass'=>'newTicket',
'id' => 'new-ticket'),
($_REQUEST['a']=='open')); ($_REQUEST['a']=='open'));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment