* @package MCMS\Components\Editor */ class EditorStringBase extends EditorBase { public static function getHandledDataType() { return 'string'; } public function resetCSSClass() { $this->setCSSClass('string'); } public function generate($parent) { $id = $this->getID(); $name = $this->getName(); $css = $this->getCSSClass(); $size = $this->getParam('size', 0); $maxsize = $this->getParam('maxsize', 40); $value = $this->getValue(); $js_import = array(); $js_submit = ''; // if ($this->isReadOnly()) { // $html = self::escapeString((string) $value); // } // else { $html = 'getInlineCSS()) $html .= 'style="' . $this->getInlineCSS() . '" '; if($size > 0) $html .= 'size="' . $size . '" '; if($maxsize > 0) $html .= 'maxlength="' . $maxsize . '" '; if ($this->isRequired()) $html .= 'required="required" '; if ($this->isReadOnly()) $html .= 'readonly="readonly" '; if($value !== false) $html .= 'value="' . self::escapeString((string) $value) . '" '; // if($this->isRequired()) { // $html .= ' onblur="validate(\'' . self::escapeString($id) . '\',\'^.+$\',\'' . $css . '\',\'' . $css . '_error\',true);" '; // $js_import[] = 'jscript/form/validate.js'; // $js_submit .= ''; // } $html .= '/>'; // } return array('html' => $html,'js_import' => $js_import,'js_submit' => $js_submit); } }