summaryrefslogtreecommitdiff
path: root/app/Helper
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-05-25 14:58:24 -0400
committerFrederic Guillot <fred@kanboard.net>2015-05-25 14:58:24 -0400
commit7442499bb5b709e6a4d920098b92b21156ae4945 (patch)
treeb60be3aac6d78312d42d5d8952c764806d0d09ac /app/Helper
parent87c711cb55399bd858d61cf3974fa163a9add2ee (diff)
Move swimlane title and add swimlane anchor
Diffstat (limited to 'app/Helper')
-rw-r--r--app/Helper/Url.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/Helper/Url.php b/app/Helper/Url.php
index 9bb38e59..64b2c83f 100644
--- a/app/Helper/Url.php
+++ b/app/Helper/Url.php
@@ -24,11 +24,12 @@ class Url extends \Core\Base
* @param boolean $csrf Add a CSRF token
* @param string $class CSS class attribute
* @param boolean $new_tab Open the link in a new tab
+ * @param string $anchor Link Anchor
* @return string
*/
- public function link($label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $new_tab = false)
+ public function link($label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $new_tab = false, $anchor = '')
{
- return '<a href="'.$this->href($controller, $action, $params, $csrf).'" class="'.$class.'" title="'.$title.'" '.($new_tab ? 'target="_blank"' : '').'>'.$label.'</a>';
+ return '<a href="'.$this->href($controller, $action, $params, $csrf, $anchor).'" class="'.$class.'" title="'.$title.'" '.($new_tab ? 'target="_blank"' : '').'>'.$label.'</a>';
}
/**
@@ -39,9 +40,10 @@ class Url extends \Core\Base
* @param string $action Action name
* @param array $params Url parameters
* @param boolean $csrf Add a CSRF token
+ * @param string $anchor Link Anchor
* @return string
*/
- public function href($controller, $action, array $params = array(), $csrf = false)
+ public function href($controller, $action, array $params = array(), $csrf = false, $anchor = '')
{
$values = array(
'controller' => $controller,
@@ -54,7 +56,7 @@ class Url extends \Core\Base
$values += $params;
- return '?'.http_build_query($values, '', '&amp;');
+ return '?'.http_build_query($values, '', '&amp;').(empty($anchor) ? '' : '#'.$anchor);
}
/**