charttpl.html.php 1.3 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. $field = $thSetting['field'];
  3. $required = $thSetting['required'] ? 'required' : '';
  4. $options = $thSetting['options'] == 'field' ? arrayUnion(array('' => ''), $fieldList) : $this->lang->pivot->{$thSetting['options']};
  5. $placeholder = $thSetting['placeholder'];
  6. $default = isset($defaultValues[$field]) ? $defaultValues[$field] : '';
  7. if($isMultiCol) $default = isset($default[$index]) ? $default[$index] : '';
  8. /* If the saved pivot type is not the type of the current type form, no value is echoed.*/
  9. /* 如果formSettings是数组并且当前图表的类型是数据库里存的图表类型,回显数据。*/
  10. if(is_array($formSettings) and $pivot->type == $pivotType)
  11. {
  12. if(isset($formSettings[0][$field]))
  13. {
  14. if(is_array($formSettings[0][$field]))
  15. {
  16. $default = $formSettings[0][$field][$i];
  17. }
  18. else
  19. {
  20. $default = $formSettings[0][$field];
  21. }
  22. }
  23. }
  24. if(!is_string($default)) $default = '';
  25. ?>
  26. <td colspan='<?php echo $thSetting['col']?>'>
  27. <?php echo html::select($isMultiCol ? $field . '[]' : $field, $options, $default, "class='form-control " . ($isMultiCol ? "multi-$field" : '') . " chosen $required' $required onchange='pieChange(this.value, \"$field\", true, " . ($isMultiCol ? '1' : '0') . ")' data-placeholder='$placeholder'");?>
  28. </td>