Prev | Current Page 346 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

The getActive()
method returns a reference to the currently selected menu item object. This object is a
stdClass object that contains various attributes that relate to the menu item.
The attribute that we are interested in is query. This attribute is an associative array
that describes the URI query associated with the menu item. So to enhance our
category pathway we would do this:
if ($menuitem->query['view'] != 'category')
{
$pathway =& $mainframe->getPathWay();
$pathway->addItem($categoryName);
}
The view key is the layout that the menu item is set to view.
Chapter 9
[ 261 ]
To improve our pathway when viewing an item we can build on this example by
adding a switch statement:
if ($menuitem->query['view'] != 'item')
{
$pathway =& $mainframe->getPathWay();
switch ($menuitem->query['view'])
{
case 'categories':
$pathway->addItem($categoryName, $categoryURI);
default:
$pathway->addItem($itemName);
}
}
We now have the ability to build the pathway from the point at which the menu item
enters the component.


Pages:
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358
London Escort Agencies katalog stron Connie Talbot dieta light fenomenalne mieszkania do wynajęcia warszawa