summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-07-21 13:58:56 +0200
committerDerek Allard <derek.allard@ellislab.com>2008-07-21 13:58:56 +0200
commitc507418db9a35ef11965cb9226e6f23f3b41b195 (patch)
tree9515d8c933fcf52bee4217a14da2b7f0475f71d1
parent3a6ab8d73340fff064aa9677af7608766d506e35 (diff)
Removed added newlines ("\n") from most form and html helper functions.
-rw-r--r--system/helpers/form_helper.php21
-rw-r--r--system/helpers/html_helper.php4
-rw-r--r--user_guide/changelog.html1
3 files changed, 16 insertions, 10 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 5b28d3de8..21b7df42f 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -111,6 +111,7 @@ if ( ! function_exists('form_hidden'))
}
$form = '';
+
foreach ($name as $name => $value)
{
$form .= '<input type="hidden" name="'.$name.'" value="'.form_prep($value).'" />';
@@ -137,7 +138,7 @@ if ( ! function_exists('form_input'))
{
$defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
- return "<input ".parse_form_attributes($data, $defaults).$extra." />\n";
+ return "<input ".parse_form_attributes($data, $defaults).$extra." />";
}
}
@@ -222,7 +223,7 @@ if ( ! function_exists('form_textarea'))
unset($data['value']); // textareas don't use the value attribute
}
- return "<textarea ".parse_form_attributes($data, $defaults).$extra.">".$val."</textarea>\n";
+ return "<textarea ".parse_form_attributes($data, $defaults).$extra.">".$val."</textarea>";
}
}
@@ -302,11 +303,15 @@ if ( ! function_exists('form_checkbox'))
}
if ($checked == TRUE)
+ {
$defaults['checked'] = 'checked';
+ }
else
+ {
unset($defaults['checked']);
+ }
- return "<input ".parse_form_attributes($data, $defaults).$extra." />\n";
+ return "<input ".parse_form_attributes($data, $defaults).$extra." />";
}
}
@@ -353,7 +358,7 @@ if ( ! function_exists('form_submit'))
{
$defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
- return "<input ".parse_form_attributes($data, $defaults).$extra." />\n";
+ return "<input ".parse_form_attributes($data, $defaults).$extra." />";
}
}
@@ -374,7 +379,7 @@ if ( ! function_exists('form_reset'))
{
$defaults = array('type' => 'reset', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
- return "<input ".parse_form_attributes($data, $defaults).$extra." />\n";
+ return "<input ".parse_form_attributes($data, $defaults).$extra." />";
}
}
@@ -401,7 +406,7 @@ if ( ! function_exists('form_button'))
unset($data['content']); // content is not an attribute
}
- return "<button ".parse_form_attributes($data, $defaults).$extra.">".$content."</button>\n";
+ return "<button ".parse_form_attributes($data, $defaults).$extra.">".$content."</button>";
}
}
@@ -486,7 +491,7 @@ if ( ! function_exists('form_fieldset_close'))
{
function form_fieldset_close($extra = '')
{
- return "</fieldset>\n".$extra;
+ return "</fieldset>".$extra;
}
}
@@ -503,7 +508,7 @@ if ( ! function_exists('form_close'))
{
function form_close($extra = '')
{
- return "</form>\n".$extra;
+ return "</form>".$extra;
}
}
diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php
index 7a61055f7..c3f0fbc29 100644
--- a/system/helpers/html_helper.php
+++ b/system/helpers/html_helper.php
@@ -274,7 +274,7 @@ if ( ! function_exists('link_tag'))
}
}
- $link .= "/>\n";
+ $link .= "/>";
}
else
{
@@ -303,7 +303,7 @@ if ( ! function_exists('link_tag'))
$link .= 'title="'.$title.'" ';
}
- $link .= '/>'."\n";
+ $link .= '/>'."";
}
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index b2c7b99a6..a8954d922 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -66,6 +66,7 @@ SVN Revision: XXXX</p>
<li>Helpers
<ul>
<li>Improved accuracy of calculations in <a href="helpers/number_helper.html">Number helper</a>.</li>
+ <li>Removed added newlines ("\n") from most form and html helper functions.</li>
</ul>
</li>
<li>Other changes