public function prepareView(\Nethgui\View\ViewInterface $view) { parent::prepareView($view); $this->wizDecorator = $view->spawnView($this, 'Decorator'); if (isset($this->currentAction)) { $nextAction = $this->getSuccessor($this->currentAction); } else { $nextAction = $this->getAction('Cover'); } $this->wizDecorator['steps'] = $this->getSteps($view, $nextAction ? $nextAction->getIdentifier() : ''); $this->wizDecorator->setTemplate('NethServer\\Template\\FirstConfigWiz'); if ($this->getRequest()->isValidated()) { $this->xhtmlDecoratorParams['disableMenu'] = TRUE; } }
public function prepareView(\Nethgui\View\ViewInterface $view) { $module = $this->getTargetModule(); if (is_null($module)) { $view->setTemplate(FALSE); return; } $moduleView = $view->spawnView($module); $module->prepareView($moduleView); $renderer = new \Nethgui\Module\Help\Renderer($moduleView, $this->getFileNameResolver(), 0); echo $renderer->render(); exit(0); // FIXME not so correct, but works.. }
/** * For each known format extension adds a subview that renders into an html * fragment that include the required resources. * * @param \Nethgui\View\ViewInterface $view * @return void */ public function prepareViewXhtml(\Nethgui\View\ViewInterface $view) { $fragments = array('js' => "<script src='%URI'></script>", 'css' => "<link rel='stylesheet' type='text/css' href='%URI' />"); foreach (array_keys($fragments) as $ext) { $view[$ext] = $view->spawnView($this); $thisModule = $this; $templateClosure = function (\Nethgui\Renderer\AbstractRenderer $renderer) use($ext, $thisModule, $fragments) { $uriList = $thisModule->getUseList($ext); $cachedFile = $thisModule->getFileName($ext); if ($cachedFile !== FALSE) { $uriList[] = $renderer->getModuleUrl('/Resource/' . $cachedFile); } $output = ''; foreach ($uriList as $uri) { $output .= strtr($fragments[$ext], array('%URI' => $uri)); } return $output; }; $view[$ext]->setTemplate($templateClosure); } $view->setTemplate(FALSE); }
public function prepareView(\Nethgui\View\ViewInterface $view) { $template = $this->getViewTemplate(); if (!is_null($template)) { $view->setTemplate($template); } }
public function prepareView(\Nethgui\View\ViewInterface $view) { $view->setTemplate('NethServer\\Template\\Dhcp\\Modify'); parent::prepareView($view); }