minor whitespace cleanup
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 81331cd..fc25922 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -61,11 +61,11 @@
 		{

 			$form .= form_hidden($hidden);

 		}

-	

+

 		return $form;

 	}

 }

-	

+

 // ------------------------------------------------------------------------

 

 /**

@@ -78,7 +78,7 @@
  * @param	array	a key/value pair of attributes

  * @param	array	a key/value pair hidden data

  * @return	string

- */	

+ */

 if ( ! function_exists('form_open_multipart'))

 {

 	function form_open_multipart($action, $attributes = array(), $hidden = array())

@@ -87,7 +87,7 @@
 		return form_open($action, $attributes, $hidden);

 	}

 }

-	

+

 // ------------------------------------------------------------------------

 

 /**

@@ -100,7 +100,7 @@
  * @param	mixed

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_hidden'))

 {

 	function form_hidden($name, $value = '')

@@ -111,17 +111,17 @@
 		}

 

 		$form = '';

-		

+

 		foreach ($name as $name => $value)

 		{

 			$form .= "\n";

 			$form .= '<input type="hidden" name="'.$name.'" value="'.form_prep($value).'" />';

 		}

-	

+

 		return $form;

 	}

 }

-	

+

 // ------------------------------------------------------------------------

 

 /**

@@ -132,7 +132,7 @@
  * @param	string

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_input'))

 {

 	function form_input($data = '', $value = '', $extra = '')

@@ -142,7 +142,7 @@
 		return "<input "._parse_form_attributes($data, $defaults).$extra." />";

 	}

 }

-	

+

 // ------------------------------------------------------------------------

 

 /**

@@ -155,7 +155,7 @@
  * @param	string

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_password'))

 {

 	function form_password($data = '', $value = '', $extra = '')

@@ -169,7 +169,7 @@
 		return form_input($data, $value, $extra);

 	}

 }

-	

+

 // ------------------------------------------------------------------------

 

 /**

@@ -182,7 +182,7 @@
  * @param	string

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_upload'))

 {

 	function form_upload($data = '', $value = '', $extra = '')

@@ -196,7 +196,7 @@
 		return form_input($data, $value, $extra);

 	}

 }

-	

+

 // ------------------------------------------------------------------------

 

 /**

@@ -207,13 +207,13 @@
  * @param	string

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_textarea'))

 {

 	function form_textarea($data = '', $value = '', $extra = '')

 	{

 		$defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12');

-	

+

 		if ( ! is_array($data) OR ! isset($data['value']))

 		{

 			$val = $value;

@@ -223,11 +223,11 @@
 			$val = $data['value']; 

 			unset($data['value']); // textareas don't use the value attribute

 		}

-		

+

 		return "<textarea "._parse_form_attributes($data, $defaults).$extra.">".$val."</textarea>";

 	}

 }

-	

+

 // ------------------------------------------------------------------------

 

 /**

@@ -239,7 +239,7 @@
  * @param	string

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_dropdown'))

 {

 	function form_dropdown($name = '', $options = array(), $selected = array(), $extra = '')

@@ -248,7 +248,7 @@
 		{

 			$selected = array($selected);

 		}

-		

+

 		// If no selected state was submitted we will attempt to set it automatically

 		if (count($selected) === 0)

 		{

@@ -269,18 +269,18 @@
 		{

 			$key = (string) $key;

 			$val = (string) $val;

-		

+

 			$sel = (in_array($key, $selected))?' selected="selected"':'';

-		

+

 			$form .= '<option value="'.$key.'"'.$sel.'>'.$val."</option>\n";

 		}

 

 		$form .= '</select>';

-	

+

 		return $form;

 	}

 }

-	

+

 // ------------------------------------------------------------------------

 

 /**

@@ -292,17 +292,17 @@
  * @param	bool

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_checkbox'))

 {

 	function form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '')

 	{

 		$defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);

-	

+

 		if (is_array($data) AND array_key_exists('checked', $data))

 		{

 			$checked = $data['checked'];

-		

+

 			if ($checked == FALSE)

 			{

 				unset($data['checked']);

@@ -312,7 +312,7 @@
 				$data['checked'] = 'checked';

 			}

 		}

-	

+

 		if ($checked == TRUE)

 		{

 			$defaults['checked'] = 'checked';

@@ -325,7 +325,7 @@
 		return "<input "._parse_form_attributes($data, $defaults).$extra." />";

 	}

 }

-	

+

 // ------------------------------------------------------------------------

 

 /**

@@ -337,7 +337,7 @@
  * @param	bool

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_radio'))

 {

 	function form_radio($data = '', $value = '', $checked = FALSE, $extra = '')

@@ -351,7 +351,7 @@
 		return form_checkbox($data, $value, $checked, $extra);

 	}

 }

-	

+

 // ------------------------------------------------------------------------

 

 /**

@@ -383,7 +383,7 @@
  * @param	string

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_reset'))

 {

 	function form_reset($data = '', $value = '', $extra = '')

@@ -404,19 +404,19 @@
  * @param	string

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_button'))

 {

 	function form_button($data = '', $content = '', $extra = '')

 	{

 		$defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'type' => 'submit');

-		

+

 		if ( is_array($data) AND isset($data['content']))

 		{

 			$content = $data['content'];

 			unset($data['content']); // content is not an attribute

 		}

-		

+

 		return "<button "._parse_form_attributes($data, $defaults).$extra.">".$content."</button>";

 	}

 }

@@ -431,19 +431,19 @@
  * @param	string	The id the label applies to

  * @param	string	Additional attributes

  * @return	string

- */	

+ */

 if ( ! function_exists('form_label'))

 {

 	function form_label($label_text = '', $id = '', $attributes = array())

 	{

 

 		$label = '<label';

-	

+

 		if ($id != '')

 		{

 			 $label .= " for=\"$id\"";

 		}

-		

+

 		if (is_array($attributes) AND count($attributes) > 0)

 		{

 			foreach ($attributes as $key => $val)

@@ -469,7 +469,7 @@
  * @param	string	The legend text

  * @param	string	Additional attributes

  * @return	string

- */	

+ */

 if ( ! function_exists('form_fieldset'))

 {

 	function form_fieldset($legend_text = '', $attributes = array())

@@ -477,9 +477,9 @@
 		$fieldset = "<fieldset";

 

 		$fieldset .= _attributes_to_string($attributes, FALSE);

-	

+

 		$fieldset .= ">\n";

-	

+

 		if ($legend_text != '')

 		{

 			$fieldset .= "<legend>$legend_text</legend>\n";

@@ -497,7 +497,7 @@
  * @access	public

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_fieldset_close'))

 {

 	function form_fieldset_close($extra = '')

@@ -505,7 +505,7 @@
 		return "</fieldset>".$extra;

 	}

 }

-	

+

 // ------------------------------------------------------------------------

 

 /**

@@ -514,7 +514,7 @@
  * @access	public

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_close'))

 {

 	function form_close($extra = '')

@@ -522,7 +522,7 @@
 		return "</form>".$extra;

 	}

 }

-	

+

 // ------------------------------------------------------------------------

 

 /**

@@ -533,7 +533,7 @@
  * @access	public

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_prep'))

 {

 	function form_prep($str = '')

@@ -545,17 +545,17 @@
 			{

 				$str[$key] = form_prep($val);

 			}

-		

+

 			return $str;

 		}

-	

+

 		if ($str === '')

 		{

 			return '';

 		}

 

 		$temp = '__TEMP_AMPERSANDS__';

-	

+

 		// Replace entities to temporary markers so that 

 		// htmlspecialchars won't mess them up

 		$str = preg_replace("/&#(\d+);/", "$temp\\1;", $str);

@@ -564,13 +564,13 @@
 		$str = htmlspecialchars($str);

 

 		// In case htmlspecialchars misses these.

-		$str = str_replace(array("'", '"'), array("&#39;", "&quot;"), $str);	

-	

+		$str = str_replace(array("'", '"'), array("&#39;", "&quot;"), $str);

+

 		// Decode the temp markers back to entities

 		$str = preg_replace("/$temp(\d+);/","&#\\1;",$str);

-		$str = preg_replace("/$temp(\w+);/","&\\1;",$str);	

-	

-		return $str;	

+		$str = preg_replace("/$temp(\w+);/","&\\1;",$str);

+

+		return $str;

 	}

 }

 

@@ -586,7 +586,7 @@
  * @access	public

  * @param	string

  * @return	mixed

- */	

+ */

 if ( ! function_exists('set_value'))

 {

 	function set_value($field = '', $default = '')

@@ -597,10 +597,10 @@
 			{

 				return $default;

 			}

-			

+

 			return $_POST[$field];

 		}

-		

+

 		return $OBJ->set_value($field, $default);

 	}

 }

@@ -618,7 +618,7 @@
  * @param	string

  * @param	bool

  * @return	string

- */	

+ */

 if ( ! function_exists('set_select'))

 {

 	function set_select($field = '', $value = '', $default = FALSE)

@@ -635,9 +635,9 @@
 				}

 				return '';

 			}

-	

+

 			$field = $_POST[$field];

-			

+

 			if (is_array($field))

 			{

 				if ( ! in_array($value, $field))

@@ -652,10 +652,10 @@
 					return '';

 				}

 			}

-				

+

 			return ' selected="selected"';

 		}

-		

+

 		return $OBJ->set_select($field, $value, $default);

 	}

 }

@@ -673,7 +673,7 @@
  * @param	string

  * @param	bool

  * @return	string

- */	

+ */

 if ( ! function_exists('set_checkbox'))

 {

 	function set_checkbox($field = '', $value = '', $default = FALSE)

@@ -690,7 +690,7 @@
 				}

 				return '';

 			}

-	

+

 			$field = $_POST[$field];

 			

 			if (is_array($field))

@@ -707,10 +707,10 @@
 					return '';

 				}

 			}

-				

+

 			return ' checked="checked"';

 		}

-		

+

 		return $OBJ->set_checkbox($field, $value, $default);

 	}

 }

@@ -728,7 +728,7 @@
  * @param	string

  * @param	bool

  * @return	string

- */	

+ */

 if ( ! function_exists('set_radio'))

 {

 	function set_radio($field = '', $value = '', $default = FALSE)

@@ -745,7 +745,7 @@
 				}

 				return '';

 			}

-	

+

 			$field = $_POST[$field];

 			

 			if (is_array($field))

@@ -762,10 +762,10 @@
 					return '';

 				}

 			}

-				

+

 			return ' checked="checked"';

 		}

-		

+

 		return $OBJ->set_radio($field, $value, $default);

 	}

 }

@@ -783,7 +783,7 @@
  * @param	string

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('form_error'))

 {

 	function form_error($field = '', $prefix = '', $suffix = '')

@@ -792,7 +792,7 @@
 		{

 			return '';

 		}

-		

+

 		return $OBJ->error($field, $prefix, $suffix);

 	}

 }

@@ -809,7 +809,7 @@
  * @param	string

  * @param	string

  * @return	string

- */	

+ */

 if ( ! function_exists('validation_errors'))

 {

 	function validation_errors($prefix = '', $suffix = '')

@@ -818,7 +818,7 @@
 		{

 			return '';

 		}

-				

+

 		return $OBJ->error_string($prefix, $suffix);

 	}

 }

@@ -834,7 +834,7 @@
  * @param	array

  * @param	array

  * @return	string

- */	

+ */

 if ( ! function_exists('_parse_form_attributes'))

 {

 	function _parse_form_attributes($attributes, $default)

@@ -849,21 +849,22 @@
 					unset($attributes[$key]);

 				}

 			}

-		

+

 			if (count($attributes) > 0)

-			{	

+			{

 				$default = array_merge($default, $attributes);

 			}

 		}

-	

+

 		$att = '';

+

 		foreach ($default as $key => $val)

 		{

 			if ($key == 'value')

 			{

 				$val = form_prep($val);

 			}

-	

+

 			$att .= $key . '="' . $val . '" ';

 		}

 

@@ -882,43 +883,43 @@
  * @param	mixed

  * @param	bool

  * @return	string

- */	

+ */

 if ( ! function_exists('_attributes_to_string'))

 {

 	function _attributes_to_string($attributes, $formtag = FALSE)

 	{

-	   if (is_string($attributes) AND strlen($attributes) > 0)

-	   {

-		   if ($formtag == TRUE AND strpos($attributes, 'method=') === FALSE)

-		   {

-			  $attributes .= ' method="post"';

-		   }

-		   

-		   return ' '.$attributes;	   

-	   }

-	

-	   if (is_object($attributes) AND count($attributes) > 0)

-	   {

-		  $attributes = (array)$attributes;

-	   }

-	   

-	   if (is_array($attributes) AND count($attributes) > 0)

-	   {

-		  $atts = '';

+		if (is_string($attributes) AND strlen($attributes) > 0)

+		{

+			if ($formtag == TRUE AND strpos($attributes, 'method=') === FALSE)

+			{

+				$attributes .= ' method="post"';

+			}

 

-		  if ( ! isset($attributes['method']) AND $formtag === TRUE)

-		  {

-			 $atts .= ' method="post"';

-		  }

+		return ' '.$attributes;

+		}

 	

-		  foreach ($attributes as $key => $val)

-		  {

-			 $atts .= ' '.$key.'="'.$val.'"';

-		  }

+		if (is_object($attributes) AND count($attributes) > 0)

+		{

+			$attributes = (array)$attributes;

+		}

 

-		  return $atts;

-	   }

-	} 

+		if (is_array($attributes) AND count($attributes) > 0)

+		{

+		$atts = '';

+

+		if ( ! isset($attributes['method']) AND $formtag === TRUE)

+		{

+			$atts .= ' method="post"';

+		}

+

+		foreach ($attributes as $key => $val)

+		{

+			$atts .= ' '.$key.'="'.$val.'"';

+		}

+

+		return $atts;

+		}

+	}

 }

 

 // ------------------------------------------------------------------------

@@ -931,28 +932,28 @@
  *

  * @access	private

  * @return	mixed

- */	

+ */

 if ( ! function_exists('_get_validation_object'))

-{	

+{

 	function &_get_validation_object()

 	{

 		$CI =& get_instance();

-		

+

 		// We set this as a variable since we're returning by reference

 		$return = FALSE;

-		

+

 		if ( ! isset($CI->load->_ci_classes) OR  ! isset($CI->load->_ci_classes['form_validation']))

 		{

 			return $return;

 		}

-		

+

 		$object = $CI->load->_ci_classes['form_validation'];

-		

+

 		if ( ! isset($CI->$object) OR ! is_object($CI->$object))

 		{

 			return $return;

 		}

-		

+

 		return $CI->$object;

 	}

 }