- md5
- a27f805b3bbe5d011ce592dff62a1dd1
- sha1
- 34a6d456ff6be53769a17265a510933c49487668
- sha256
- be5cd0adda878a38c40f8e174073b5e89bdb4cdef9000cdc85b3cf97e49b466a
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
<?php
/**
* @package Joomla.Site
* @subpackage com_wrapper
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Routing class from com_wrapper
*
* @package Joomla.Site
* @subpackage com_wrapper
* @since 3.3
*/
class WrapperRouter extends JComponentRouterBase
{
/**
* Build the route for the com_wrapper component
*
* @param array &$query An array of URL arguments
*
* @return array The URL arguments to use to assemble the subsequent URL.
*
* @since 3.3
*/
public function build(&$query)
{
$segments = array();
if (isset($query['view']))
{
unset($query['view']);
}
$total = count($segments);
for ($i = 0; $i < $total; $i++)
{
$segments[$i] = str_replace(':', '-', $segments[$i]);
}
return $segments;
}
/**
* Parse the segments of a URL.
*
* @param array &$segments The segments of the URL to parse.
*
* @return array The URL attributes to be used by the application.
*
* @since 3.3
*/
public function parse(&$segments)
{
$total = count($segments);
$vars = array();
for ($i = 0; $i < $total; $i++)
{
$segments[$i] = preg_replace('/-/', ':', $segments[$i], 1);
}
$vars['view'] = 'wrapper';
return $vars;
}
}
/**
* Wrapper router functions
*
* These functions are proxys for the new router interface
* for old SEF extensions.
*
* @param array &$query An array of URL arguments
*
* @return array The URL arguments to use to assemble the subsequent URL.
*
* @deprecated 4.0 Use Class based routers instead
*/
function WrapperBuildRoute(&$query)
{
$router = new WrapperRouter;
return $router->build($query);
}
/**
* Wrapper router functions
*
* These functions are proxys for the new router interface
* for old SEF extensions.
*
* @param array &$segments The segments of the URL to parse.
*
* @return array The URL attributes to be used by the application.
*
* @deprecated 4.0 Use Class based routers instead
*/
function WrapperParseRoute($segments)
{
$router = new WrapperRouter;
return $router->parse($segments);
}
The same content is in 3 releases, Joomla 3.3.4 to 3.3.6. See them all, or every version of this file.