Html_menu - prevnext mode
| From: | Mike C | Date: | Thu, 16 Sep 2004 16:14:54 +0000 |
| Subject: | Html_menu - prevnext mode | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-14549@lists.php.net to get a copy of this message | ||
Hi,
I'm generated a hash array for use with HTML_Menu's 'prevnext' rendering. I
want to use it as a pager to move between pages in a document.
If I have an array formatted such as:-
Array
(
[1] => Array
(
[title] => Chapter 1 (1052-1070) Income tax and corporation
[sub] => Array
(
[11] => Array
(
[title] => 1052 Penalties for failure to make
certain returns, etc.
[url] => /page/9701
)
[12] => Array
(
[title] => 1053 Penalty for fraudulently or
negligently making
[url] => /page/9702
)
[13] => Array
(
[title] => 1054 Increased penalties in case of
body of persons.
[url] => /page/9703
)
[14] => Array
(
[title] => 1055 Penalty for assisting in making
incorrect returns, etc.
[url] => /page/9704
)
)
)
When I call show() to get the HTML to display, it's showing the initial
'prev' as 'Chapter 1 (1052-1070) Income tax and corporation' and current
item as 'Chapter 1 (1052-1070) Income tax and corporation' and the 'next'
item as '1052 Penalties for failure to make certain returns, etc.' - why is
the previous and current items the same? Can I stop previous item being the
same as the current item somehow?
Another problem I have: If I add a 'url' to the root menu, such as:-
[title] => Chapter 1 (1052-1070) Income tax and corporation
[url] => /bet.com/selectbook.php
[sub] => Array
The three prev, current, next now no longer display because the url is not
matching with the script "viewbook.php" which is rendering the menu, I
assume? I thought that clicking the centre item would allow the user to go
"up" one level in the menu, and in my case this would be to the script
/bet.com/selectbook.php
Is this not posible with HTML_Menu?
Regards,
Mike C.