diff --git a/system/form.php b/system/form.php
index 574ab584..9e67d25f 100644
--- a/system/form.php
+++ b/system/form.php
@@ -145,7 +145,9 @@ public static function label($name, $value, $attributes = array())
*/
public static function input($type, $name, $value = null, $attributes = array())
{
- return ' $type, 'name' => $name, 'value' => $value, 'id' => static::id($name, $attributes)))).'>'.PHP_EOL;
+ $id = static::id($name, $attributes);
+
+ return ''.PHP_EOL;
}
/**
@@ -275,15 +277,9 @@ public static function textarea($name, $value = '', $attributes = array())
{
$attributes = array_merge($attributes, array('id' => static::id($name, $attributes), 'name' => $name));
- if ( ! isset($attributes['rows']))
- {
- $attributes['rows'] = 10;
- }
+ if ( ! isset($attributes['rows'])) $attributes['rows'] = 10;
- if ( ! isset($attributes['cols']))
- {
- $attributes['cols'] = 50;
- }
+ if ( ! isset($attributes['cols'])) $attributes['cols'] = 50;
return ''.PHP_EOL;
}
@@ -305,7 +301,9 @@ public static function select($name, $options = array(), $selected = null, $attr
foreach ($options as $value => $display)
{
- $html[] = '';
+ $option_attributes = array('value' => HTML::entities($value), 'selected' => ($value == $selected) ? 'selected' : null);
+
+ $html[] = '';
}
return ''.PHP_EOL;
@@ -419,15 +417,9 @@ public static function button($value, $attributes = array())
*/
private static function id($name, $attributes)
{
- if (array_key_exists('id', $attributes))
- {
- return $attributes['id'];
- }
+ if (array_key_exists('id', $attributes)) return $attributes['id'];
- if (in_array($name, static::$labels))
- {
- return $name;
- }
+ if (in_array($name, static::$labels)) return $name;
}
}
\ No newline at end of file