Ejemplo n.º 1
0
 protected static function getInput($type, $name, $value, $length = null, $primary, $attributes = array())
 {
     if ($length) {
         $attributes['maxlength'] = $length;
     }
     //-------------------------------------------------
     if ($primary) {
         $attributes['readonly'] = TRUE;
         $attributes['style'] = 'width: 100%;';
         return HTML::input_text($name, $value, $attributes);
     } elseif ($type == 'integer') {
         $attributes['style'] = 'width: 100%;';
         return HTML::input_text($name, $value, $attributes);
     } elseif ($type == 'string') {
         $attributes['style'] = 'width: 100%;';
         return HTML::input_text($name, $value, $attributes);
     } elseif ($type == 'text') {
         $attributes['style'] = 'width: 100%;';
         return HTML::textarea($name, $value, $attributes);
     } elseif ($type == 'boolean') {
         return HTML::bool($name, $value, $attributes);
     } elseif ($type == 'html') {
         DOC::addEditor();
         $attributes['class'] = 'html';
         return HTML::textarea($name, $value, $attributes);
     } else {
         $attributes['style'] = 'width: 100%;';
         return HTML::input_text($name, $value, $attributes);
     }
 }