Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Basic Configuration / Admin Header Links

Admin Header Links

Locked

Started by wiggst3r on 15 May 2008, 8:23 AM · Views: 1,436

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
15 May 2008, 8:23 AM
#1
wiggst3r avatar

wiggst3r

New Zenner

Join Date:
Mar 2008
Posts:
39
Plugin Contributions:
0

Admin Header Links

Hi

I want to make it so in the admin section, when the admin clicks on one of the header links, rather than it showing all the links in the tree-like sitemap, I want each of the admin links, go to the first page in the drop-down.

Image of what it looks like so far.

http://i93.photobucket.com/albums/l72/cwiggst3r/Picture2.png

I have done all the links, apart from the modules link.

When you click on 'Modules', i want the page to open up as the first link in the drop-down menu, which is 'Payment'.

But I'm not sure how to do this with the code as it's different to all the other pages as it uses 'set' => 'set=payment'

Can anyone help me, I'll post the code below:

<?php
/**
 * @package admin
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: modules_dhtml.php - amendment for Admin Profiles 2006-04-17 by kuroi
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}

$za_contents = array();

if (menu_header_visible('Modules')=='true') {


	$za_heading = array('text' => BOX_HEADING_MODULES, 'link' => zen_href_link(FILENAME_MODULES, '', 'NONSSL'));

	$options = array( array( 'page' => FILENAME_MODULES, 'box' => BOX_MODULES_PAYMENT, 'set' => 'set=payment'),
					array( 'page' => FILENAME_MODULES, 'box' => BOX_MODULES_SHIPPING, 'set' => 'set=shipping'),
					array( 'page' => FILENAME_MODULES, 'box' => BOX_MODULES_ORDER_TOTAL, 'set' => 'set=ordertotal')
				  );

	foreach ($options as $key => $value)
	if (page_allowed($value['page'].$value['set'])=='true') $za_contents[] = array('text' => $value['box'], 'link' => zen_href_link($value['page'], $value['set'], 'NONSSL'));

	if ($za_dir = @dir(DIR_WS_BOXES . 'extra_boxes')) {
	while ($zv_file = $za_dir->read()) {
	if (preg_match('/modules_dhtml.php$/', $zv_file)) {
	  require(DIR_WS_BOXES . 'extra_boxes/' . $zv_file);
		}
	  }
	}

	?>

Thank you.

15 May 2008, 10:01 AM
#3
wiggst3r avatar

wiggst3r

New Zenner

Join Date:
Mar 2008
Posts:
39
Plugin Contributions:
0

Re: Admin Header Links

Via the drop-down menu.

I want it, so when you click on each header link, it doesn't show the whole sitemap of links.

Click on image

As you can see from the image above, each header link (catalog, modules etc) once clicked, will, rather than display alt_nav.php, will display the first link in the drop down.

So when 'Catalog' is clicked, it displays, the first link in the drop-down, which is 'Categories/Products' page (categories.php)

If you want to view the second page within 'Catalog', you need to hover over the 'Catalog' link and select the second item in the dropdown etc etc.

I'm just trying to tidy up the admin section, as the alt_nav.php page displays a sitemap that I have to scroll quite far down to click on certain links. So by default, would rather it go to the first page of the dropdown menu.

So, I have made each link in the header menu, go to the first page of the dropdown when clicked, a part from 'Modules'.

Does anyone know how I can modify my code in my previos post, to make sure that when 'Modules' is clicked, the page that opens is:

modules.php?set=payment

is opened?

Thanks

15 May 2008, 10:18 AM
#4
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town &amp; London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Admin Header Links

I think I understand what you want, but is seems illogical...

The whole purpose of the "hover" function is to assist in guiding the user to a desired sub-section - and you have to be pretty dumb not to establish how this function operates.

The first time I used the admin panel. I clicked a header and saw what happened... so I never click the header again and used the hover function...

... and what if your user now thinks that to reach the desired admin service they must first click the header.

In solving one "problem" you are potentially creating another.

Doesn't seem logical to me ... :huh:

15 May 2008, 10:33 AM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Admin Header Links

Changing this> $za_heading = array('text' => BOX_HEADING_MODULES, 'link' => zen_href_link(FILENAME_MODULES, '', 'NONSSL'));to this> $za_heading = array('text' => BOX_HEADING_MODULES, 'link' => zen_href_link(FILENAME_MODULES, 'set=payment', 'NONSSL'));
should do it. But I agree with fairestcape that this would be a very unintuitive navigation. It would be better to simply disable the links to the alternative navigation (assuming that all your admin users will have javascript enabled).

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

15 May 2008, 12:57 PM
#6
wiggst3r avatar

wiggst3r

New Zenner

Join Date:
Mar 2008
Posts:
39
Plugin Contributions:
0

Re: Admin Header Links

I see your point and I agree.

But this is for a client, who wants this as part of his admin section.

I have suggested other options, like disabling the header links etc

But this is what he wanted and is a paying customer.

Thanks kuroi, that worked perfectly.

18 May 2008, 5:31 PM
#7
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town &amp; London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Admin Header Links

wiggst3r:

But this is what he wanted and is a paying customer.

True... customers want the daftest things - often not realising the implications!