_element, $name); $baseUrl = Front::getInstance()->getRequest()->getBaseUrl(); $this->setHeaderCode('') ->setBodyCode('') ->setBodyCode(''); $this->addAttribute('id', $name) ->addAttribute('class', self::ELEMENT_CLASS) ->addAttribute('readonly', 'readonly'); } /** * * set the custom data for the element, and add the javascript code * * @param array $customData * * @return $this */ public function setCustomData($customData) { $this->_customData = $customData; $formData = array( 'locale: "' . $this->getTranslate()->getLocale() . '"', 'ignoreReadonly: true', ); if (isset($this->_customData['formData'])) { foreach ((array)$this->_customData['formData'] as $key => $value) { $formData[] = "{$key}: {$value}"; } } $formData = implode(", \n", $formData); $this->setBodyCode( ""); return $this; } /** * * renders the date time form element * * @return string the html code of the element */ public function render() { $value = $this->getValue(); if (!is_string($value)) { $value = ''; } else { $value = str_replace('"', '"', $value); } $multiple = ($this->getMultiple() === true) ? $this->_brackets : ''; $attributes = array( 'type="' . $this->_type . '"', 'name="' . $this->_name . $multiple . '"', 'value="' . $value . '"', $this->renderAttributes() ); return $this->getPrefix() . ' ' . '
' . '_endTag . ' ' . '' . '
' . ' ' . $this->getSuffix(); } }