Permalink
Browse files

Automatically add id="" to input fields if it is not present in $para…

…meters (report #86)
  • Loading branch information...
1 parent d2a4979 commit a48e911e37d006284737c0b7a15ea98a9ea67bad @haraldpdl haraldpdl committed Nov 4, 2010
Showing with 24 additions and 0 deletions.
  1. +12 −0 catalog/admin/includes/functions/html_output.php
  2. +12 −0 catalog/includes/functions/html_output.php
@@ -176,6 +176,10 @@ function tep_draw_input_field($name, $value = '', $parameters = '', $required =
$field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';
+ if (strpos($parameters, 'id=') === false) {
+ $field .= ' id="' . tep_output_string($name) . '"';
+ }
+
if ( ($reinsert_value == true) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
$value = stripslashes($HTTP_GET_VARS[$name]);
@@ -250,6 +254,10 @@ function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $par
$field = '<textarea name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';
+ if (strpos($parameters, 'id=') === false) {
+ $field .= ' id="' . tep_output_string($name) . '"';
+ }
+
if (tep_not_null($parameters)) $field .= ' ' . $parameters;
$field .= '>';
@@ -312,6 +320,10 @@ function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = ''
$field = '<select name="' . tep_output_string($name) . '"';
+ if (strpos($parameters, 'id=') === false) {
+ $field .= ' id="' . tep_output_string($name) . '"';
+ }
+
if (tep_not_null($parameters)) $field .= ' ' . $parameters;
$field .= '>';
@@ -170,6 +170,10 @@ function tep_draw_input_field($name, $value = '', $parameters = '', $type = 'tex
$field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';
+ if (strpos($parameters, 'id=') === false) {
+ $field .= ' id="' . tep_output_string($name) . '"';
+ }
+
if ( ($reinsert_value == true) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
$value = stripslashes($HTTP_GET_VARS[$name]);
@@ -234,6 +238,10 @@ function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $par
$field = '<textarea name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';
+ if (strpos($parameters, 'id=') === false) {
+ $field .= ' id="' . tep_output_string($name) . '"';
+ }
+
if (tep_not_null($parameters)) $field .= ' ' . $parameters;
$field .= '>';
@@ -294,6 +302,10 @@ function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = ''
$field = '<select name="' . tep_output_string($name) . '"';
+ if (strpos($parameters, 'id=') === false) {
+ $field .= ' id="' . tep_output_string($name) . '"';
+ }
+
if (tep_not_null($parameters)) $field .= ' ' . $parameters;
$field .= '>';

0 comments on commit a48e911

Please sign in to comment.