fieldtype = TRUE; $this->defaulttype = 'TEXT'; } /** * 字段相关属性参数 * * @param array $value 值 * @return string */ public function option($option) { return ['

'.dr_lang('用于字段为空时显示该填充值,并不会去主动变更数据库中的实际值;可以设置会员表字段,表示用当前登录会员信息来填充这个值').'

'.$this->field_type($option['fieldtype'], $option['fieldlength']), '
'.dr_lang('[整数]表示固定宽度;[整数%]表示百分比').'
' ]; } /** * 字段显示 * * @return string */ public function show($field, $value = null) { $html = '
'.nl2br(htmlspecialchars_decode((string)$value)).'
'; return $this->input_format($field['fieldname'], $field['name'], $html); } /** * 字段表单输入 */ public function input($field, $value = '') { // 字段禁止修改时就返回显示字符串 if ($this->_not_edit($field, $value)) { return $this->show($field, $value); } // 字段存储名称 $name = $field['fieldname']; // 字段显示名称 $text = ($field['setting']['validate']['required'] ? ' * ' : '').dr_lang($field['name']); // 表单宽度设置 $width = \Phpcmf\Service::IS_MOBILE_USER() ? '100%' : ($field['setting']['option']['width'] ? $field['setting']['option']['width'] : '100%'); // 表单附加参数 $attr = $field['setting']['validate']['formattr']; // 字段提示信息 $tips = ($name == 'title' && APP_DIR) || $field['setting']['validate']['tips'] ? ''.$field['setting']['validate']['tips'].'' : ''; // 表单高度设置 $height = $field['setting']['option']['height'] ? $field['setting']['option']['height'] : '100'; // 字段默认值 $value = dr_strlen($value) ? $value : $this->get_default_value($field['setting']['option']['value']); $str = ''; return $this->input_format($name, $text, $str.$tips); } }