コード例 #1
0
 public function getField($widgetId, $rowGroupName = '', $rowIndex, $model, $attribute, $name, $value = '', $fieldClassName = '', $htmlOptions = array(), $hasError = false, $data = '', $params = '')
 {
     if ($hasError) {
         $fieldClassName = $fieldClassName . ' ' . CHtml::$errorCss;
     }
     $htmlOptions = ClonnableFields::addClass($htmlOptions, $fieldClassName);
     if (ClonnableFields::isModel($model)) {
         return CHtml::activeTextArea($model, $attribute, $htmlOptions);
     } else {
         return CHtml::textArea($name, $value, $htmlOptions);
     }
 }
コード例 #2
0
 public function getField($widgetId, $rowGroupName = '', $rowIndex, $model, $attribute, $name, $value = '', $fieldClassName = '', $htmlOptions = array(), $hasError = false, $data = '', $params = '')
 {
     if ($hasError) {
         $fieldClassName = $fieldClassName . ' ' . CHtml::$errorCss;
     }
     $htmlOptions = ClonnableFields::addClass($htmlOptions, $fieldClassName);
     $asDropDownList = isset($params['asDropDownList']) && $params['asDropDownList'] ? true : false;
     if (ClonnableFields::isModel($model)) {
         return $asDropDownList ? CHtml::activeDropDownList($model, $attribute, $data, $htmlOptions) : CHtml::activeHiddenField($model, $attribute, $htmlOptions);
     } else {
         return $asDropDownList ? CHtml::dropDownList($name, $value, $data, $htmlOptions) : CHtml::hiddenField($name, $value, $htmlOptions);
     }
 }
コード例 #3
0
 public function getField($widgetId, $rowGroupName = '', $rowIndex, $model, $attribute, $name, $value = '', $fieldClassName = '', $htmlOptions = array(), $hasError = false, $data = '', $params = '')
 {
     if ($hasError) {
         $fieldClassName = $fieldClassName . ' ' . CHtml::$errorCss;
     }
     $toggleButtonHtmlOptions = array('class' => 'toggle-button ' . $fieldClassName);
     $result = CHtml::openTag('div', $toggleButtonHtmlOptions);
     if (ClonnableFields::isModel($model)) {
         $result .= CHtml::activeCheckBox($model, $attribute, $htmlOptions);
     } else {
         $result .= CHtml::checkBox($name, $value, $htmlOptions);
     }
     $result .= CHtml::closeTag('div');
     return $result;
 }
コード例 #4
0
 public function getField($widgetId, $rowGroupName = '', $rowIndex, $model, $attribute, $name, $value = '', $fieldClassName = '', $htmlOptions = array(), $hasError = false, $data = '', $params = '')
 {
     if ($hasError) {
         $fieldClassName = $fieldClassName . ' ' . CHtml::$errorCss;
     }
     $htmlOptions = ClonnableFields::addClass($htmlOptions, $fieldClassName);
     $htmlOptions['autocomplete'] = 'off';
     $htmlOptions['aria-autocomplete'] = 'list';
     $htmlOptions['aria-haspopup'] = 'true';
     if (ClonnableFields::isModel($model)) {
         return CHtml::activeTextField($model, $attribute, $htmlOptions);
     } else {
         return CHtml::textField($name, $value, $htmlOptions);
     }
 }
コード例 #5
0
 public function getField($widgetId, $rowGroupName = '', $rowIndex, $model, $attribute, $name, $value = '', $fieldClassName = '', $htmlOptions = array(), $hasError = false, $data = '', $params = '')
 {
     $prepend = isset($params['prepend']) && $params['prepend'];
     $additionClass = $prepend ? 'input-prepend' : 'input-append';
     $prependHtml = isset($params['prependHtml']) ? $params['prependHtml'] : '';
     $prependHtml = CHtml::tag('span', array('class' => 'add-on'), $prependHtml);
     if ($hasError) {
         $fieldClassName = $fieldClassName . ' ' . CHtml::$errorCss;
     }
     $htmlOptions = ClonnableFields::addClass($htmlOptions, $fieldClassName);
     if (ClonnableFields::isModel($model)) {
         $inputHtml = CHtml::activeTextField($model, $attribute, $htmlOptions);
     } else {
         $inputHtml = CHtml::textField($name, $value, $htmlOptions);
     }
     return CHtml::tag('div', array('class' => $additionClass), $prepend ? $prependHtml . $inputHtml : $inputHtml . $prependHtml);
 }
コード例 #6
0
 public function getField($widgetId, $rowGroupName = '', $rowIndex, $model, $attribute, $name, $value = '', $fieldClassName = '', $htmlOptions = array(), $hasError = false, $data = '', $params = '')
 {
     if ($hasError) {
         $fieldClassName = $fieldClassName . ' ' . CHtml::$errorCss;
     }
     $htmlOptions = ClonnableFields::addClass($htmlOptions, $fieldClassName);
     $htmlOptions['type'] = 'number';
     if (!isset($htmlOptions['name'])) {
         $htmlOptions['name'] = $name;
     }
     if (!isset($htmlOptions['value'])) {
         $htmlOptions['value'] = $value;
     }
     $htmlOptions['type'] = 'number';
     if (ClonnableFields::isModel($model)) {
         return CHtml::activeNumberField($model, $attribute, $htmlOptions);
     } else {
         return CHtml::tag('input', $htmlOptions);
     }
 }