Esempio n. 1
0
 public function renderModuleMenu(\Nethgui\Renderer\Xhtml $view)
 {
     $view->includeFile('Nethgui/Js/jquery.nethgui.controller.js');
     $view->includeFile('Nethgui/Js/jquery.nethgui.navigation.js');
     $rootList = $view->elementList()->setAttribute('wrap', '/');
     foreach ($view['categories'] as $category) {
         // Add category title with fake module
         $rootList->insert($view->panel()->setAttribute('class', 'category')->insert($view->literal($category['title'])->setAttribute('hsc', TRUE)));
         // Add category contents:
         $el = $view->elementList()->setAttribute('class', FALSE);
         foreach ($category['items'] as $item) {
             $el->insert($this->renderMenuItem($view, $item));
         }
         $rootList->insert($el);
     }
     $searchPanel = $view->panel()->setAttribute('class', 'searchPanel ui-corner-all')->insert($view->textInput("search", $view::LABEL_NONE)->setAttribute('placeholder', $view->translate('Search') . "..."))->insert($view->button("Find", $view::BUTTON_SUBMIT)->setAttribute('class', 'Button search'));
     return $view->panel()->setAttribute('class', 'Navigation Flat ' . $view->getClientEventTarget("tags"))->insert($view->form()->setAttribute('method', 'get')->insert($searchPanel)->insert($rootList));
 }
Esempio n. 2
0
 public function testPanel()
 {
     $this->assertInstanceOf('Nethgui\\Widget\\Xhtml\\Panel', $this->object->panel('test'));
 }
Esempio n. 3
0
 public function renderDocument(\Nethgui\Renderer\Xhtml $renderer)
 {
     $renderer->rejectFlag($renderer::INSET_FORM);
     return $renderer->panel()->setAttribute('class', 'HelpDocument')->insert($renderer->literal($this->helpContent));
 }
Esempio n. 4
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);
 }
 public function renderIndex(\Nethgui\Renderer\Xhtml $renderer)
 {
     $renderer->includeFile('Nethgui/Js/jquery.nethgui.controller.js');
     $container = $renderer->panel()->setAttribute('class', 'Controller');
     foreach ($this->getChildren() as $index => $module) {
         $identifier = $module->getIdentifier();
         $flags = $renderer::INSET_WRAP;
         if ($index > 0) {
             $flags |= $renderer::STATE_UNOBTRUSIVE;
         }
         if ($this->needsAutoFormWrap($module)) {
             $flags |= $renderer::INSET_FORM;
         }
         $container->insert($renderer->inset($identifier, $flags)->setAttribute('class', 'Action'));
     }
     return $container;
 }