Display project analytics in modal box

This commit is contained in:
Frederic Guillot
2017-01-08 14:00:51 -05:00
parent ea2cbb76d5
commit b3a450bace
23 changed files with 124 additions and 108 deletions

View File

@@ -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'].' > '.$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;
}

View File

@@ -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');
}
}