aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/controller
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-03-15 13:35:43 +0100
committerDavid King <imkingdavid@gmail.com>2013-03-15 09:18:12 -0400
commitff9a0e4ef4756c5a9cce3f023b07d9f9a0e5653a (patch)
treed74fb3ba7b7632ef53ca9f88dba0a0ab361bbe3d /phpBB/includes/controller
parentcd697e68129868dc811c141660652360e0f0f983 (diff)
downloadforums-ff9a0e4ef4756c5a9cce3f023b07d9f9a0e5653a.tar
forums-ff9a0e4ef4756c5a9cce3f023b07d9f9a0e5653a.tar.gz
forums-ff9a0e4ef4756c5a9cce3f023b07d9f9a0e5653a.tar.bz2
forums-ff9a0e4ef4756c5a9cce3f023b07d9f9a0e5653a.tar.xz
forums-ff9a0e4ef4756c5a9cce3f023b07d9f9a0e5653a.zip
[ticket/11334] Expand functionality of helper->url()
Expanded the functionality of helper->url() to support all parameters of append_sid() itself. PHPBB3-11334
Diffstat (limited to 'phpBB/includes/controller')
-rw-r--r--phpBB/includes/controller/helper.php24
1 files changed, 21 insertions, 3 deletions
diff --git a/phpBB/includes/controller/helper.php b/phpBB/includes/controller/helper.php
index 451c448a18..4c021849f4 100644
--- a/phpBB/includes/controller/helper.php
+++ b/phpBB/includes/controller/helper.php
@@ -87,12 +87,30 @@ class phpbb_controller_helper
/**
* Generate a URL
*
- * @param string $route The route to travel
+ * @param string $route The route to travel
+ * @param mixed $params String or array of additional url parameters
+ * @param bool $is_amp Is url using &amp; (true) or & (false)
+ * @param string $session_id Possibility to use a custom session id instead of the global one
* @return string The URL already passed through append_sid()
*/
- public function url($route)
+ public function url($route, $params = false, $is_amp = true, $session_id = false)
{
- return append_sid($this->phpbb_root_path . 'app' . $this->php_ext, array('controller' => $route));
+ if (is_array($params) && !empty($params))
+ {
+ $params = array_merge(array(
+ 'controller' => $route,
+ ), $params);
+ }
+ else if (is_string($params) && $params)
+ {
+ $params = 'controller=' . $route . (($is_amp) ? '&amp;' : '&') . $params;
+ }
+ else
+ {
+ $params = array('controller' => $route);
+ }
+
+ return append_sid($this->phpbb_root_path . 'app' . $this->php_ext, $params, $is_amp, $session_id);
}
/**