Source for file route.php
Documentation is available at route.php
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* Finder route helper class.
* Method to get the route for a search page.
* @param integer $f The search filter id. [optional]
* @param string $q The search query string. [optional]
* @return string The search route.
$query =
array('view' =>
'search', 'q' =>
$q, 'f' =>
$f);
$item =
self::getItemid($query);
$uri =
clone(JUri::getInstance('index.php?option=com_finder&view=search'));
// Add the pre-defined search filter if present.
// Add the search query string if present.
// Add the menu item id if present.
$uri->setVar('Itemid', $item);
return $uri->toString(array('path', 'query'));
* Method to get the route for an advanced search page.
* @param integer $f The search filter id. [optional]
* @param string $q The search query string. [optional]
* @return string The advanced search route.
$query =
array('view' =>
'advanced', 'q' =>
$q, 'f' =>
$f);
$item =
self::getItemid($query);
$uri =
clone(JUri::getInstance('index.php?option=com_finder&view=advanced'));
// Add the pre-defined search filter if present.
// Add the search query string if present.
// Add the menu item id if present.
$uri->setVar('Itemid', $item);
return $uri->toString(array('path', 'query'));
* Method to get the most appropriate menu item for the route based on the
* supplied query needles.
* @param array $query An array of URL parameters.
* @return mixed An integer on success, null otherwise.
// Get the menu items for com_finder.
$active =
$menu->getActive();
$items =
$menu->getItems('component_id', $com->id);
$items =
is_array($items) ?
$items :
array();
// Try to match the active view and filter.
if ($active &&
@$active->query['view'] ==
@$query['view'] &&
@$active->query['f'] ==
@$query['f'])
// Try to match the view, query, and filter.
foreach ($items as $item)
if (@$item->query['view'] ==
@$query['view'] &&
@$item->query['q'] ==
@$query['q'] &&
@$item->query['f'] ==
@$query['f'])
// Try to match the view and filter.
foreach ($items as $item)
if (@$item->query['view'] ==
@$query['view'] &&
@$item->query['f'] ==
@$query['f'])
// Try to match the view.
foreach ($items as $item)
if (@$item->query['view'] ==
@$query['view'])
Documentation generated on Tue, 19 Nov 2013 15:12:21 +0100 by phpDocumentor 1.4.3