summaryrefslogtreecommitdiff
path: root/app/Helper
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-01-08 14:00:51 -0500
committerFrederic Guillot <fred@kanboard.net>2017-01-08 14:00:51 -0500
commitb3a450bace8461fb7989d5406b9d9ec644d7df4a (patch)
tree89827b899d4a3fad9d123750955a0fc4692de312 /app/Helper
parentea2cbb76d5d48ef8d2601fc33edc55c15929b963 (diff)
Display project analytics in modal box
Diffstat (limited to 'app/Helper')
-rw-r--r--app/Helper/LayoutHelper.php14
-rw-r--r--app/Helper/ModalHelper.php5
2 files changed, 15 insertions, 4 deletions
diff --git a/app/Helper/LayoutHelper.php b/app/Helper/LayoutHelper.php
index 8d2e7e00..8be71757 100644
--- a/app/Helper/LayoutHelper.php
+++ b/app/Helper/LayoutHelper.php
@@ -22,7 +22,10 @@ class LayoutHelper extends Base
*/
public function app($template, array $params = array())
{
- if ($this->request->isAjax()) {
+ $isAjax = $this->request->isAjax();
+ $params['is_ajax'] = $isAjax;
+
+ if ($isAjax) {
return $this->template->render($template, $params);
}
@@ -160,7 +163,7 @@ class LayoutHelper extends Base
$params['title'] = $params['project']['name'].' &gt; '.$params['title'];
}
- return $this->subLayout('analytic/layout', 'analytic/sidebar', $template, $params);
+ return $this->subLayout('analytic/layout', 'analytic/sidebar', $template, $params, true);
}
/**
@@ -188,13 +191,16 @@ class LayoutHelper extends Base
* @param string $sidebar
* @param string $template
* @param array $params
+ * @param bool $ignoreAjax
* @return string
*/
- public function subLayout($sublayout, $sidebar, $template, array $params = array())
+ public function subLayout($sublayout, $sidebar, $template, array $params = array(), $ignoreAjax = false)
{
+ $isAjax = $this->request->isAjax();
+ $params['is_ajax'] = $isAjax;
$content = $this->template->render($template, $params);
- if ($this->request->isAjax()) {
+ if (!$ignoreAjax && $isAjax) {
return $content;
}
diff --git a/app/Helper/ModalHelper.php b/app/Helper/ModalHelper.php
index b3241b9d..efbe2c4d 100644
--- a/app/Helper/ModalHelper.php
+++ b/app/Helper/ModalHelper.php
@@ -75,4 +75,9 @@ class ModalHelper extends Base
{
return $this->helper->url->link($label, $controller, $action, $params, false, 'js-modal-confirm');
}
+
+ public function replaceLink($label, $controller, $action, array $params = array())
+ {
+ return $this->helper->url->link($label, $controller, $action, $params, false, 'js-modal-replace');
+ }
}