public function renderIndex(\Nethgui\Renderer\Xhtml $view)
 {
     $view->includeFile('Nethgui/Js/jquery.nethgui.tabs.js');
     $view->includeFile('Nethgui/Js/jquery.nethgui.controller.js');
     $tabs = $view->tabs()->setAttribute('receiver', '');
     foreach ($this->getChildren() as $module) {
         $moduleIdentifier = $module->getIdentifier();
         $flags = \Nethgui\Renderer\WidgetFactoryInterface::INSET_WRAP;
         if ($this->needsAutoFormWrap($module)) {
             $flags |= \Nethgui\Renderer\WidgetFactoryInterface::INSET_FORM;
         }
         $action = $view->inset($moduleIdentifier, $flags)->setAttribute('class', 'Action')->setAttribute('title', $view->getTranslator()->translate($module, $moduleIdentifier . '_Title'));
         $tabs->insert($action);
     }
     return $tabs;
 }
Beispiel #2
0
 public function renderIndex(\Nethgui\Renderer\Xhtml $renderer)
 {
     $moduleList = $renderer->elementList();
     $templateList = $renderer->elementList();
     $translator = $renderer->getTranslator();
     $renderer->rejectFlag($renderer::INSET_FORM);
     foreach ($this->getModuleSet() as $module) {
         // skip Help module:
         if ($module === $this->getParent()) {
             continue;
         }
         $template = '<a href="%URL">%LABEL</a>';
         $args1 = array('%URL' => $renderer->getModuleUrl($module->getIdentifier()) . '.rst', '%LABEL' => $translator->translate($module, $module->getAttributesProvider()->getTitle()));
         $args2 = array('%URL' => $renderer->getModuleUrl('../Template/' . $module->getIdentifier()) . '.rst', '%LABEL' => $translator->translate($module, $module->getAttributesProvider()->getTitle()));
         $moduleList->insert($renderer->literal(strtr($template, $args1)));
         $templateList->insert($renderer->literal(strtr($template, $args2)));
     }
     return $renderer->columns()->insert($renderer->fieldset()->setAttribute('template', $renderer->translate('Documents'))->insert($moduleList))->insert($renderer->fieldset()->setAttribute('template', $renderer->translate('Templates'))->insert($templateList));
 }
Beispiel #3
0
 public function renderIndex(\Nethgui\Renderer\Xhtml $view)
 {
     $view->includeFile('Nethgui/Js/jquery.nethgui.tabs.js');
     $view->includeFile('Nethgui/Js/jquery.nethgui.controller.js');
     $panel = $view->panel()->setAttribute('class', 'ModulesWrapped')->setAttribute('id', 'PackageManager');
     $header = $view->header()->setAttribute('template', $view->translate('Modules_header'));
     $tabs = $view->tabs()->setAttribute('receiver', '');
     foreach ($this->getChildren() as $module) {
         $moduleIdentifier = $module->getIdentifier();
         if ($moduleIdentifier === 'AdminTodo') {
             continue;
         }
         $flags = \Nethgui\Renderer\WidgetFactoryInterface::INSET_WRAP;
         if ($this->needsAutoFormWrap($module)) {
             $flags |= \Nethgui\Renderer\WidgetFactoryInterface::INSET_FORM;
         }
         $action = $view->inset($moduleIdentifier, $flags)->setAttribute('class', 'Action')->setAttribute('title', $view->getTranslator()->translate($module, $moduleIdentifier . '_Title'));
         $tabs->insert($action);
     }
     $element = json_encode($view->getUniqueId());
     $url = json_encode($view->getModuleUrl());
     $view->includeJavascript(sprintf('(function($){$(function(){$.Nethgui.Server.ajaxMessage({url:%s, freezeElement:$("#" + %s)})})})(jQuery);', $url, $element));
     return $panel->insert($header)->insert($tabs);
 }