| Current Path : /home/w/u/e/wuectly/www/03cbe/ |
| Current File : /home/w/u/e/wuectly/www/03cbe/route.php.tar |
home/wuectly/www/components/com_content/helpers/route.php 0000604 00000004124 15245562615 0020032 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Content Component Route Helper.
*
* @since 1.5
*/
abstract class ContentHelperRoute
{
/**
* Get the article route.
*
* @param integer $id The route of the content item.
* @param integer $catid The category ID.
* @param integer $language The language code.
* @param string $layout The layout value.
*
* @return string The article route.
*
* @since 1.5
*/
public static function getArticleRoute($id, $catid = 0, $language = 0, $layout = null)
{
// Create the link
$link = 'index.php?option=com_content&view=article&id=' . $id;
if ((int) $catid > 1)
{
$link .= '&catid=' . $catid;
}
if ($language && $language !== '*' && JLanguageMultilang::isEnabled())
{
$link .= '&lang=' . $language;
}
if ($layout)
{
$link .= '&layout=' . $layout;
}
return $link;
}
/**
* Get the category route.
*
* @param integer $catid The category ID.
* @param integer $language The language code.
* @param string $layout The layout value.
*
* @return string The article route.
*
* @since 1.5
*/
public static function getCategoryRoute($catid, $language = 0, $layout = null)
{
if ($catid instanceof JCategoryNode)
{
$id = $catid->id;
}
else
{
$id = (int) $catid;
}
if ($id < 1)
{
return '';
}
$link = 'index.php?option=com_content&view=category&id=' . $id;
if ($language && $language !== '*' && JLanguageMultilang::isEnabled())
{
$link .= '&lang=' . $language;
}
if ($layout)
{
$link .= '&layout=' . $layout;
}
return $link;
}
/**
* Get the form route.
*
* @param integer $id The form ID.
*
* @return string The article route.
*
* @since 1.5
*/
public static function getFormRoute($id)
{
return 'index.php?option=com_content&task=article.edit&a_id=' . (int) $id;
}
}
home/wuectly/www/components/com_contact/helpers/route.php 0000604 00000003642 15245603266 0020015 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Contact Component Route Helper
*
* @static
* @package Joomla.Site
* @subpackage com_contact
* @since 1.5
*/
abstract class ContactHelperRoute
{
/**
* Get the URL route for a contact from a contact ID, contact category ID and language
*
* @param integer $id The id of the contact
* @param integer $catid The id of the contact's category
* @param mixed $language The id of the language being used.
*
* @return string The link to the contact
*
* @since 1.5
*/
public static function getContactRoute($id, $catid, $language = 0)
{
// Create the link
$link = 'index.php?option=com_contact&view=contact&id=' . $id;
if ($catid > 1)
{
$link .= '&catid=' . $catid;
}
if ($language && $language !== '*' && JLanguageMultilang::isEnabled())
{
$link .= '&lang=' . $language;
}
return $link;
}
/**
* Get the URL route for a contact category from a contact category ID and language
*
* @param mixed $catid The id of the contact's category either an integer id or an instance of JCategoryNode
* @param mixed $language The id of the language being used.
*
* @return string The link to the contact
*
* @since 1.5
*/
public static function getCategoryRoute($catid, $language = 0)
{
if ($catid instanceof JCategoryNode)
{
$id = $catid->id;
}
else
{
$id = (int) $catid;
}
if ($id < 1)
{
$link = '';
}
else
{
// Create the link
$link = 'index.php?option=com_contact&view=category&id=' . $id;
if ($language && $language !== '*' && JLanguageMultilang::isEnabled())
{
$link .= '&lang=' . $language;
}
}
return $link;
}
}
home/wuectly/www/components/com_finder/helpers/route.php 0000604 00000007026 15245617114 0017626 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_finder
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Finder route helper class.
*
* @since 2.5
*/
class FinderHelperRoute
{
/**
* 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.
*
* @since 2.5
*/
public static function getSearchRoute($f = null, $q = null)
{
// Get the menu item id.
$query = array('view' => 'search', 'q' => $q, 'f' => $f);
$item = self::getItemid($query);
// Get the base route.
$uri = clone JUri::getInstance('index.php?option=com_finder&view=search');
// Add the pre-defined search filter if present.
if ($f !== null)
{
$uri->setVar('f', $f);
}
// Add the search query string if present.
if ($q !== null)
{
$uri->setVar('q', $q);
}
// Add the menu item id if present.
if ($item !== null)
{
$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.
*
* @since 2.5
*/
public static function getAdvancedRoute($f = null, $q = null)
{
// Get the menu item id.
$query = array('view' => 'advanced', 'q' => $q, 'f' => $f);
$item = self::getItemid($query);
// Get the base route.
$uri = clone JUri::getInstance('index.php?option=com_finder&view=advanced');
// Add the pre-defined search filter if present.
if ($q !== null)
{
$uri->setVar('f', $f);
}
// Add the search query string if present.
if ($q !== null)
{
$uri->setVar('q', $q);
}
// Add the menu item id if present.
if ($item !== null)
{
$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.
*
* @since 2.5
*/
public static function getItemid($query)
{
static $items, $active;
// Get the menu items for com_finder.
if (!$items || !$active)
{
$app = JFactory::getApplication('site');
$com = JComponentHelper::getComponent('com_finder');
$menu = $app->getMenu();
$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'])
{
return $active->id;
}
// 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'])
{
return $item->id;
}
}
// Try to match the view and filter.
foreach ($items as $item)
{
if (@$item->query['view'] == @$query['view'] && @$item->query['f'] == @$query['f'])
{
return $item->id;
}
}
// Try to match the view.
foreach ($items as $item)
{
if (@$item->query['view'] == @$query['view'])
{
return $item->id;
}
}
return null;
}
}
home/wuectly/www/components/com_tags/helpers/route.php 0000604 00000011713 15245617261 0017316 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_tags
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Tags Component Route Helper.
*
* @since 3.1
*/
class TagsHelperRoute extends JHelperRoute
{
protected static $lookup;
/**
* Tries to load the router for the component and calls it. Otherwise uses getTagRoute.
*
* @param integer $contentItemId Component item id
* @param string $contentItemAlias Component item alias
* @param integer $contentCatId Component item category id
* @param string $language Component item language
* @param string $typeAlias Component type alias
* @param string $routerName Component router
*
* @return string URL link to pass to JRoute
*
* @since 3.1
*/
public static function getItemRoute($contentItemId, $contentItemAlias, $contentCatId, $language, $typeAlias, $routerName)
{
$link = '';
$explodedAlias = explode('.', $typeAlias);
$explodedRouter = explode('::', $routerName);
if (file_exists($routerFile = JPATH_BASE . '/components/' . $explodedAlias[0] . '/helpers/route.php'))
{
JLoader::register($explodedRouter[0], $routerFile);
$routerClass = $explodedRouter[0];
$routerMethod = $explodedRouter[1];
if (class_exists($routerClass) && method_exists($routerClass, $routerMethod))
{
if ($routerMethod === 'getCategoryRoute')
{
$link = $routerClass::$routerMethod($contentItemId, $language);
}
else
{
$link = $routerClass::$routerMethod($contentItemId . ':' . $contentItemAlias, $contentCatId, $language);
}
}
}
if ($link === '')
{
// Create a fallback link in case we can't find the component router
$router = new JHelperRoute;
$link = $router->getRoute($contentItemId, $typeAlias, $link, $language, $contentCatId);
}
return $link;
}
/**
* Tries to load the router for the component and calls it. Otherwise calls getRoute.
*
* @param integer $id The ID of the tag
*
* @return string URL link to pass to JRoute
*
* @since 3.1
*/
public static function getTagRoute($id)
{
$needles = array(
'tag' => array((int) $id)
);
if ($id < 1)
{
$link = '';
}
else
{
$link = 'index.php?option=com_tags&view=tag&id=' . $id;
if ($item = self::_findItem($needles))
{
$link .= '&Itemid=' . $item;
}
else
{
$needles = array('tags' => array(1, 0));
if ($item = self::_findItem($needles))
{
$link .= '&Itemid=' . $item;
}
}
}
return $link;
}
/**
* Tries to load the router for the tags view.
*
* @return string URL link to pass to JRoute
*
* @since 3.7
*/
public static function getTagsRoute()
{
$needles = array(
'tags' => array(0)
);
$link = 'index.php?option=com_tags&view=tags';
if ($item = self::_findItem($needles))
{
$link .= '&Itemid=' . $item;
}
return $link;
}
/**
* Find Item static function
*
* @param array $needles Array used to get the language value
*
* @return null
*
* @throws Exception
*/
protected static function _findItem($needles = null)
{
$app = JFactory::getApplication();
$menus = $app->getMenu('site');
$language = isset($needles['language']) ? $needles['language'] : '*';
// Prepare the reverse lookup array.
if (self::$lookup === null)
{
self::$lookup = array();
$component = JComponentHelper::getComponent('com_tags');
$items = $menus->getItems('component_id', $component->id);
if ($items)
{
foreach ($items as $item)
{
if (isset($item->query, $item->query['view']))
{
$lang = ($item->language != '' ? $item->language : '*');
if (!isset(self::$lookup[$lang]))
{
self::$lookup[$lang] = array();
}
$view = $item->query['view'];
if (!isset(self::$lookup[$lang][$view]))
{
self::$lookup[$lang][$view] = array();
}
// Only match menu items that list one tag
if (isset($item->query['id']) && is_array($item->query['id']))
{
foreach ($item->query['id'] as $position => $tagId)
{
if (!isset(self::$lookup[$lang][$view][$item->query['id'][$position]]) || count($item->query['id']) == 1)
{
self::$lookup[$lang][$view][$item->query['id'][$position]] = $item->id;
}
}
}
elseif ($view == 'tags')
{
self::$lookup[$lang]['tags'][] = $item->id;
}
}
}
}
}
if ($needles)
{
foreach ($needles as $view => $ids)
{
if (isset(self::$lookup[$language][$view]))
{
foreach ($ids as $id)
{
if (isset(self::$lookup[$language][$view][(int) $id]))
{
return self::$lookup[$language][$view][(int) $id];
}
}
}
}
}
else
{
$active = $menus->getActive();
if ($active)
{
return $active->id;
}
}
return null;
}
}
home/wuectly/www/libraries/joomla/route/wrapper/route.php 0000604 00000001641 15245662670 0017751 0 ustar 00 <?php
/**
* @package Joomla.Platform
* @subpackage Application
*
* @copyright (C) 2014 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* Wrapper class for JRoute
*
* @package Joomla.Platform
* @subpackage Application
* @since 3.4
* @deprecated 4.0 Will be removed without replacement
*/
class JRouteWrapperRoute
{
/**
* Helper wrapper method for _
*
* @param string $url Absolute or Relative URI to Joomla resource.
* @param boolean $xhtml Replace & by & for XML compliance.
* @param integer $ssl Secure state for the resolved URI.
*
* @return string The translated humanly readable URL.
*
* @see JRoute::_()
* @since 3.4
*/
public function _($url, $xhtml = true, $ssl = null)
{
return JRoute::_($url, $xhtml, $ssl);
}
}