10 Yii::import(
'gii.generators.crud.CrudCode');
21 if ($column->type ===
'boolean') {
22 return "\$form->checkBoxGroup(\$model,'{$column->name}')";
23 }
else if (stripos($column->dbType,
'text') !==
false) {
24 return "\$form->textAreaGroup(\$model,'{$column->name}', array('widgetOptions'=>array('htmlOptions'=>array('rows'=>6, 'cols'=>50, 'class'=>'span8'))))";
26 if (preg_match(
'/^(password|pass|passwd|passcode)$/i', $column->name)) {
27 $inputField =
'passwordFieldGroup';
29 $inputField =
'textFieldGroup';
32 if ($column->type !==
'string' || $column->size === null) {
33 if($column->dbType ==
'date') {
34 return "\$form->datePickerGroup(\$model,'{$column->name}',array('widgetOptions'=>array('options'=>array(),'htmlOptions'=>array('class'=>'span5')), 'prepend'=>'<i class=\"glyphicon glyphicon-calendar\"></i>', 'append'=>'Click on Month/Year to select a different Month/Year.'))";
36 return "\$form->{$inputField}(\$model,'{$column->name}',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5'))))";
39 if (strpos ( $column->dbType,
'enum(' ) !==
false) {
40 $temp = $column->dbType;
41 $temp = str_replace (
'enum',
'array', $temp );
43 eval (
'$options = ' . $temp .
';' );
44 $dropdown_options =
"array(";
45 foreach ( $options as $option ) {
46 $dropdown_options .=
"\"$option\"=>\"$option\",";
48 $dropdown_options .=
")";
49 return "\$form->dropDownListGroup(\$model,'{$column->name}', array('widgetOptions'=>array('data'=>{$dropdown_options}, 'htmlOptions'=>array('class'=>'input-large'))))";
51 return "\$form->{$inputField}(\$model,'{$column->name}',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5','maxlength'=>$column->size))))";