diff options
Diffstat (limited to 'src/xhtml/HTMLHeaderController.php')
-rw-r--r-- | src/xhtml/HTMLHeaderController.php | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/src/xhtml/HTMLHeaderController.php b/src/xhtml/HTMLHeaderController.php index 16e31584..dd1a6a6d 100644 --- a/src/xhtml/HTMLHeaderController.php +++ b/src/xhtml/HTMLHeaderController.php @@ -50,14 +50,14 @@ class HTMLHeaderController extends HTMLController $viewVars['dir'] = (0 !== \strcasecmp($lang['applangdir'], 'ltr')) ? ' dir="' . \htmlspecialchars($lang['applangdir']) . '"' : ''; $viewVars['headertemplate'] = $template; - $viewVars['headerFlags'][str_replace('.twig','',basename($template))]=1; - $viewVars['includeJsTree']=$template!=='header_sqledit.twig'; + $viewVars['headerFlags'][str_replace('.twig', '', basename($template))] = 1; + $viewVars['includeJsTree'] = true; + //$viewVars['excludeJsTree']=$template==='header_sqledit.twig'; $viewVars['title'] = ('' !== $title) ? ' - ' . $title : ''; $viewVars['lang'] = $lang; $viewVars['appName'] = \htmlspecialchars($this->appName); - - $reload_param = 'none'; + $reload_param = 'none'; if ($this->view->getReloadBrowser()) { $reload_param = 'other'; } elseif ($this->_reload_drop_database) { @@ -65,7 +65,11 @@ class HTMLHeaderController extends HTMLController } $viewVars['reload'] = $reload_param; $viewVars['script'] = $script; - $header_html = $this->view->fetch($template==='header_sqledit.twig'?$template:'header.twig', $viewVars); + if (!$this->view->offsetExists('excludeJsTree')) { + $this->view->offsetSet('excludeJsTree', false); + } + $template = $this->view->offsetGet('excludeJsTree') === true && $template === 'header_sqledit.twig' ? $template : 'header.twig'; + $header_html = $this->view->fetch($template, $viewVars); /*$plugins_head = []; $_params = ['heads' => &$plugins_head]; @@ -90,20 +94,25 @@ class HTMLHeaderController extends HTMLController * @param bool $doBody True to output body tag, false to return * @param string $bodyClass - name of body class * @param bool $onloadInit - if true, call init() on body load event + * @param bool $includeJsTree - if true, include the jstree section * * @return string the parsed template */ - public function printBody($doBody = true, $bodyClass = 'detailbody', $onloadInit = false,$includeJsTree=true) - { - - // $includeJsTree=$includeJsTree||( $this->view->offsetExists('includeJsTree')?$this->view->offsetGet('includeJsTree'):false); - $viewVars=[ - 'bodyClass'=> $this->lang['applangdir'] . ' ' . \htmlspecialchars($bodyClass).' '.$includeJsTree?'flexbox_body':'', - 'onload'=>($onloadInit ? 'onload="init();" ' : ''), - 'controller_name'=>$this->controller_name, - 'includeJsTree'=>$includeJsTree + public function printBody( + $doBody = true, + $bodyClass = 'detailbody', + $onloadInit = false, + $includeJsTree = true + ) { + + // $includeJsTree=$includeJsTree||( $this->view->offsetExists('includeJsTree')?$this->view->offsetGet('includeJsTree'):false); + $viewVars = [ + 'bodyClass' => $this->lang['applangdir'] . ' ' . \htmlspecialchars($bodyClass) . ' ' . $includeJsTree ? 'flexbox_body' : '', + 'onload' => ($onloadInit ? 'onload="init();" ' : ''), + 'controller_name' => $this->controller_name, + 'includeJsTree' => $includeJsTree ]; - + $bodyHtml = $this->view->fetch('components/common_body.twig', $viewVars); if (!$this->_no_output && $doBody) { |