router.php
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* @package Joomla.Site
* @subpackage com_privacy
*
* @copyright Copyright (C) 2005 - 2019 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_privacy
*
* @since 3.9.0
*/
class PrivacyRouter extends JComponentRouterView
{
/**
* Privacy Component router constructor
*
* @param JApplicationCms $app The application object
* @param JMenu $menu The menu object to work with
*
* @since 3.9.0
*/
public function __construct($app = null, $menu = null)
{
$this->registerView(new JComponentRouterViewconfiguration('confirm'));
$this->registerView(new JComponentRouterViewconfiguration('request'));
$this->registerView(new JComponentRouterViewconfiguration('remind'));
parent::__construct($app, $menu);
$this->attachRule(new JComponentRouterRulesMenu($this));
$this->attachRule(new JComponentRouterRulesStandard($this));
$this->attachRule(new JComponentRouterRulesNomenu($this));
}
}
/**
* Privacy router functions
*
* These functions are proxies for the new router interface
* for old SEF extensions.
*
* @param array &$query REQUEST query
*
* @return array Segments of the SEF url
*
* @since 3.9.0
* @deprecated 4.0 Use Class based routers instead
*/
function privacyBuildRoute(&$query)
{
$app = JFactory::getApplication();
$router = new PrivacyRouter($app, $app->getMenu());
return $router->build($query);
}
/**
* Convert SEF URL segments into query variables
*
* @param array $segments Segments in the current URL
*
* @return array Query variables
*
* @since 3.9.0
* @deprecated 4.0 Use Class based routers instead
*/
function privacyParseRoute($segments)
{
$app = JFactory::getApplication();
$router = new PrivacyRouter($app, $app->getMenu());
return $router->parse($segments);
}