Example #1
0
 private function renderWidgetList($value, $choices, $attributes)
 {
     $name = $this->getAttribute('name');
     $flags = $this->getAttribute('flags');
     $hiddenWidget = new Hidden($this->view);
     $hiddenWidget->setAttribute('flags', $flags)->setAttribute('value', '')->setAttribute('class', 'Hidden')->setAttribute('name', $name);
     $contentWidget = new Literal($this->view);
     $contentWidget->setAttribute('data', $this->generateSelectorContentWidgetList($name, $value, $choices, $flags));
     $panelWidget = new Panel($this->view);
     $panelWidget->setAttribute('class', $attributes['class'])->setAttribute('name', $name)->insert($hiddenWidget)->insert($contentWidget);
     if ($this->getAttribute('flags') & \Nethgui\Renderer\WidgetFactoryInterface::LABEL_NONE) {
         return $panelWidget->renderContent();
     }
     $fieldsetWidget = new Fieldset($this->view);
     $fieldsetWidget->setAttribute('template', $this->getAttribute('label', $this->getTranslateClosure($name . '_label')))->setAttribute('flags', $this->getAttribute('flags'));
     if ($this->hasAttribute('icon-before')) {
         $fieldsetWidget->setAttribute('icon-before', $this->getAttribute('icon-before'));
     }
     $fieldsetWidget->insert($panelWidget);
     return $fieldsetWidget->renderContent();
 }