\n
EOF;
public $colorHtml = <<
\n
EOF;
public $dateHtml = <<
\n
EOF;
public $dateRangeHtml = <<
\n
EOF;
public $datetimeHtml = <<
\n
EOF;
public $datetimeRangeHtml = <<
\n
EOF;
public $editorHtml = <<
\n
EOF;
public $emailHtml = <<
\n
EOF;
public $fileHtml = <<
\n
EOF;
public $iconHtml = <<
\n
EOF;
public $idCardHtml = <<
\n
EOF;
public $imageHtml = <<
\n
EOF;
public $ipHtml = <<
\n
EOF;
public $mapHtml = <<
\n
EOF;
public $mobileHtml = <<
\n
EOF;
public $multiFileHtml = <<
\n
EOF;
public $multiImageHtml = <<
\n
EOF;
public $multiSelectHtml = <<
\n
EOF;
public $numberHtml = <<
\n
EOF;
public $passwordHtml = <<
\n
EOF;
public $radioHtml = <<
\n
EOF;
public $selectHtml = <<
\n
EOF;
public $switchHtml = <<
\n
EOF;
public $textHtml = <<
\n
EOF;
public $textareaHtml = <<
\n
EOF;
public $timeHtml = <<
\n
EOF;
public $timeRangeHtml = <<
\n
EOF;
public $urlHtml = <<
\n
EOF;
public $yearHtml = <<
\n
EOF;
public $yearMonthHtml = <<
\n
EOF;
public $yearMonthRangeHtml = <<
\n
EOF;
public $yearRangeHtml = <<
\n
EOF;
public $radioList = <<
[OPTION_NAME]
EOF;
protected function getFieldForm($type, $name, $field, $content, $option)
{
$html_var = parse_name($type, 1, 0) . 'Html';
$form = $this->$html_var;
switch ($type) {
case 'switch':
$form = str_replace(array('[ON_TEXT]', '[OFF_TEXT]', '[SWITCH_CHECKED]'), array('是', '否', $content ? 'checked' : ''), $form);
break;
case 'select':
$option_html = '';
$option = explode("\r\n", $option);
foreach ($option as $item) {
$option_key_value = explode('||', $item);
$select='';
if ($content == $option_key_value[0]) {
$select = 'selected';
}
$option_html .= '';
}
$form = str_replace('[OPTION_DATA]', $option_html, $form);
break;
case 'radio':
$option_html = '';
$option = explode("\r\n", $option);
foreach ($option as $item) {
$option_key_value = explode('||', $item);
$checked = '';
if ($content == $option_key_value[0]) {
$checked = 'checked';
}
$html_tmp = $this->radioList;
$html_tmp = str_replace(array('[OPTION_VALUE]', '[OPTION_NAME]', '[OPTION_CHECKED]'), array($option_key_value[0], $option_key_value[1], $checked), $html_tmp);
$option_html.=$html_tmp;
}
$form = str_replace('[OPTION_DATA]', $option_html, $form);
break;
default:
//$form = '';
break;
}
$form = str_replace(array('[FIELD_NAME]', '[FORM_NAME]', '[FIELD_CONTENT]'), array($field, $name, $content), $form);
return $form;
}
}