How to use targets on XP Menu Class
|
Thanks for use the class XP Menu. If your application uses frames, you may need use targets. There's two methods for implement target on XP Menu Generator Class:
|
1. Using <base target='your_target'>
|
This method is very simple, on page that contains the menu, add this code <base target='your_target'> between <head> and </head> tags
|
2. Making some alterations on class:
|
This method is very simple too, and is recommended in cases where the application uses more than one targets
On file xpMenu.class.php:
On line 191:
Change this:
$array = array("name" => $name, "image" => $image, "link" => $link);
By this:
$array = array("name" => $name, "image" => $image, "link" => $link, "target" => $target);
On line 216:
Change this:
$return .= '<div class="option" onmouseover="this.style.background=\''.$this->submenu_onmouseover.'\'" onmouseout="this.style.background=\''.$this->submenu_onmouseout.'\'"><a href="'.$menu[$key]['submenus'][$key_s]['link'].'"><img style="vertical-align: middle" width=16 height=16 src="'.$menu[$key]['submenus'][$key_s]['image'].'" border=0 hspace=3>'.$menu[$key]['submenus'][$key_s]['name'].'</a></div>';
By this:
$return .= '<div class="option" onmouseover="this.style.background=\''.$this->submenu_onmouseover.'\'" onmouseout="this.style.background=\''.$this->submenu_onmouseout.'\'"><a target="'.$menu[$key]['submenus'][$key_s]['target'].'" href="'.$menu[$key]['submenus'][$key_s]['link'].'"><img style="vertical-align: middle" width=16 height=16 src="'.$menu[$key]['submenus'][$key_s]['image'].'" border=0 hspace=3>'.$menu[$key]['submenus'][$key_s]['name'].'</a></div>';
Thanks to Dominique <dominique at arrea dot com>
En�as Gesing
|