summaryrefslogtreecommitdiffstats
path: root/system/helpers/form_helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/helpers/form_helper.php')
-rw-r--r--system/helpers/form_helper.php36
1 files changed, 18 insertions, 18 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 42355df42..e722a0758 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -37,7 +37,7 @@
* @param array a key/value pair of attributes
* @param array a key/value pair hidden data
* @return string
- */
+ */
if ( ! function_exists('form_open'))
{
function form_open($action = '', $attributes = '', $hidden = array())
@@ -52,9 +52,9 @@ if ( ! function_exists('form_open'))
$action = ( strpos($action, '://') === FALSE) ? $CI->config->site_url($action) : $action;
$form = '<form action="'.$action.'"';
-
+
$form .= _attributes_to_string($attributes, TRUE);
-
+
$form .= '>';
// CSRF
@@ -143,7 +143,7 @@ if ( ! function_exists('form_hidden'))
{
foreach ($value as $k => $v)
{
- $k = (is_int($k)) ? '' : $k;
+ $k = (is_int($k)) ? '' : $k;
form_hidden($name.'['.$k.']', $v, TRUE);
}
}
@@ -250,10 +250,10 @@ if ( ! function_exists('form_textarea'))
}
else
{
- $val = $data['value'];
+ $val = $data['value'];
unset($data['value']); // textareas don't use the value attribute
}
-
+
$name = (is_array($data)) ? $data['name'] : $data;
return "<textarea "._parse_form_attributes($data, $defaults).$extra.">".form_prep($val, $name)."</textarea>";
}
@@ -279,7 +279,7 @@ if ( ! function_exists('form_multiselect'))
{
$extra .= ' multiple="multiple"';
}
-
+
return form_dropdown($name, $options, $selected, $extra);
}
}
@@ -414,7 +414,7 @@ if ( ! function_exists('form_radio'))
function form_radio($data = '', $value = '', $checked = FALSE, $extra = '')
{
if ( ! is_array($data))
- {
+ {
$data = array('name' => $data);
}
@@ -435,7 +435,7 @@ if ( ! function_exists('form_radio'))
* @return string
*/
if ( ! function_exists('form_submit'))
-{
+{
function form_submit($data = '', $value = '', $extra = '')
{
$defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
@@ -512,7 +512,7 @@ if ( ! function_exists('form_label'))
if ($id != '')
{
- $label .= " for=\"$id\"";
+ $label .= " for=\"$id\"";
}
if (is_array($attributes) AND count($attributes) > 0)
@@ -610,7 +610,7 @@ if ( ! function_exists('form_prep'))
function form_prep($str = '', $field_name = '')
{
static $prepped_fields = array();
-
+
// if the field name is an array we do this recursively
if (is_array($str))
{
@@ -635,7 +635,7 @@ if ( ! function_exists('form_prep'))
{
return $str;
}
-
+
$str = htmlspecialchars($str);
// In case htmlspecialchars misses these.
@@ -645,7 +645,7 @@ if ( ! function_exists('form_prep'))
{
$prepped_fields[$field_name] = $field_name;
}
-
+
return $str;
}
}
@@ -757,7 +757,7 @@ if ( ! function_exists('set_checkbox'))
$OBJ =& _get_validation_object();
if ($OBJ === FALSE)
- {
+ {
if ( ! isset($_POST[$field]))
{
if (count($_POST) === 0 AND $default == TRUE)
@@ -768,7 +768,7 @@ if ( ! function_exists('set_checkbox'))
}
$field = $_POST[$field];
-
+
if (is_array($field))
{
if ( ! in_array($value, $field))
@@ -823,7 +823,7 @@ if ( ! function_exists('set_radio'))
}
$field = $_POST[$field];
-
+
if (is_array($field))
{
if ( ! in_array($value, $field))
@@ -933,7 +933,7 @@ if ( ! function_exists('_parse_form_attributes'))
}
$att = '';
-
+
foreach ($default as $key => $val)
{
if ($key == 'value')
@@ -978,7 +978,7 @@ if ( ! function_exists('_attributes_to_string'))
return ' '.$attributes;
}
-
+
if (is_object($attributes) AND count($attributes) > 0)
{
$attributes = (array)$attributes;