Example #1
0
 public function render()
 {
     View::addModuleLib('jquery-ui-1.8.9.custom.js', 'vendor/jquery/jqueryui');
     View::addModuleLib('jquery-ui-1.8.9.custom.css', 'vendor/jquery/jqueryui');
     $name = $this->getId();
     if ($this->getParameter('mode') == View\FormComponent::SEARCH_MODE) {
         $name = ViewUri::getUriAdapter()->getIdentifier('search') . '[' . $this->_nametoDomId($name) . ']';
     }
     switch ($this->getParameter('mode')) {
         case View\FormComponent::SEARCH_MODE:
             $so = ViewUri::getUriAdapter()->getIdentifier('search');
             $dataArray = isset($_GET[$so][$this->_obj->getAltId()]) ? $_GET[$so][$this->_obj->getAltId()] : array();
             $html = $this->_renderField($so . '[' . $this->_obj->getAltId() . '][from]', isset($dataArray['from']) ? $dataArray['from'] : NULL, 'du', false) . $this->_renderField($so . '[' . $this->_obj->getAltId() . '][to]', isset($dataArray['to']) ? $dataArray['to'] : NULL, 'au', false);
             break;
         default:
             if (($this->_obj->getConstraint('neditable') == 'Y' || $this->getParameter('noteditable') == 'Y') && $this->_obj->getValue() != null) {
                 $html = $this->_obj->formatValue($this->_obj->getValue());
             } else {
                 $html = $this->_renderField($name, $this->_obj->getValue());
             }
             break;
     }
     return $html;
 }