Пример #1
0
               /* set value of field to label if this is an inline 
                  labeled field */
               if (empty($model->{$fieldName}) && $labelType == 'inline') {
                   $model->{$fieldName} = $field->attributeLabel;
               }
               if ($field->type === 'text') {
                   $textFieldHeight = $item['height'] . 'px';
               }
               $item['height'] = 'auto';
               $htmlString .= '<div class="formItem ' . $labelClass . '">';
               $htmlString .= $form->labelEx($model, $field->fieldName);
               $htmlString .= '<div class="formInputBox" 
 style="width:' . $item['width'] . 'px;height:' . $item['height'] . ';">';
               $default = $model->{$fieldName} == $field->attributeLabel;
               if (isset($idArray)) {
                   $htmlString .= X2Model::renderMergeInput($modelName, $idArray, $field);
               } else {
                   if (isset($specialFields[$fieldName])) {
                       $htmlString .= $specialFields[$fieldName];
                   } else {
                       $htmlString .= $model->renderInput($fieldName, array('tabindex' => isset($item['tabindex']) ? $item['tabindex'] : null, 'disabled' => $item['readOnly'] ? 'disabled' : null, 'style' => $field->type === 'text' ? 'height: ' . $textFieldHeight : ''));
                   }
               }
               $htmlString .= "</div>";
               if ($field->type === 'link' && !$suppressQuickCreate && isset($modelsWhichSupportQuickCreate[$field->linkType])) {
                   $htmlString .= '<span class="quick-create-button create-' . $field->linkType . '">+</span>';
                   $quickCreateButtonTypes[] = $field->linkType;
               }
           }
       }
       unset($item);
Пример #2
0
 public function renderAttribute($item, Fields $field)
 {
     $fieldName = preg_replace('/^formItem_/u', '', $item['name']);
     $html = X2Html::openTag('div', array('class' => "formInputBox"));
     if (isset($this->idArray)) {
         $html .= X2Model::renderMergeInput($this->modelName, $this->idArray, $field);
     } else {
         if (isset($this->specialFields[$fieldName])) {
             $html .= $this->specialFields[$fieldName];
         } else {
             $html .= $this->model->renderInput($fieldName, array('tabindex' => $item['tabindex'], 'disabled' => $item['readOnly'], 'style' => $item['height'], 'id' => $this->namespace . X2Html::resolveId($this->model, $fieldName)));
         }
     }
     $html .= '</div>';
     $html .= $this->renderExtra($field);
     return $html;
 }