diff options
Diffstat (limited to 'app/Helper/LayoutHelper.php')
-rw-r--r-- | app/Helper/LayoutHelper.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/app/Helper/LayoutHelper.php b/app/Helper/LayoutHelper.php index 8d2e7e00..91745f58 100644 --- a/app/Helper/LayoutHelper.php +++ b/app/Helper/LayoutHelper.php @@ -22,12 +22,19 @@ 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); } if (! isset($params['no_layout']) && ! isset($params['board_selector'])) { $params['board_selector'] = $this->projectUserRoleModel->getActiveProjectsByUser($this->userSession->getId()); + + if (isset($params['project']['id'])) { + unset($params['board_selector'][$params['project']['id']]); + } } return $this->pageLayout($template, $params); @@ -160,7 +167,7 @@ class LayoutHelper extends Base $params['title'] = $params['project']['name'].' > '.$params['title']; } - return $this->subLayout('analytic/layout', 'analytic/sidebar', $template, $params); + return $this->subLayout('analytic/layout', 'analytic/sidebar', $template, $params, true); } /** @@ -188,13 +195,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; } |