|
@@ -27,11 +27,35 @@ class AceRight extends Form
|
|
|
{
|
|
|
$variableRow = DistAppearanceVariable::getVariableRow($this->distId,$this->appearanceId,$this->templateId);
|
|
|
if ($variableRow) {
|
|
|
-
|
|
|
- } else {
|
|
|
- $this->disableSubmitButton();
|
|
|
+ $i = 0;
|
|
|
+ foreach ($variableRow as $key => $value) {
|
|
|
+ $this->hidden('field['.$i.'][id]',$value->id);
|
|
|
+ if ($value->variable_type == '1') {
|
|
|
+ //文本类型
|
|
|
+ $this->text('field['.$i.']['.$value->variable_name.']',$value->variable_name)
|
|
|
+ ->default($value->variable_value)
|
|
|
+ ->width(12,12)
|
|
|
+ ->setLabelClass('d-flex');
|
|
|
+ } elseif ($value->variable_type == '2') {
|
|
|
+ //长文本类型
|
|
|
+ $this->textarea('field['.$i.']['.$value->variable_name.']',$value->variable_name)
|
|
|
+ ->default($value->variable_value)
|
|
|
+ ->width(12,12)
|
|
|
+ ->setLabelClass('d-flex');
|
|
|
+ } elseif ($value->variable_type == '3') {
|
|
|
+ //json类型
|
|
|
+ $this->textarea('field['.$i.']['.$value->variable_name.']',$value->variable_name)
|
|
|
+ ->default($value->variable_value)
|
|
|
+ ->width(12,12)
|
|
|
+ ->setLabelClass('d-flex');
|
|
|
+ }
|
|
|
+ $i++;
|
|
|
+ }
|
|
|
}
|
|
|
+ $this->disableSubmitButton();
|
|
|
$this->disableResetButton();
|
|
|
+
|
|
|
+ $this->html('<button type="button" class="btn btn-primary">add</button> <button type="button" class="btn btn-success">save</button>');
|
|
|
}
|
|
|
|
|
|
// 处理表单提交请求
|