From b8e13f5b7a2cd03a2ea8950f556ee11228908b60 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Mon, 1 Dec 2014 08:44:07 +0530 Subject: [PATCH] Distinguish between options of each result set Signed-off-by: Madhura Jayaratne --- libraries/DisplayResults.class.php | 15 +++++++++------ libraries/Util.class.php | 10 ++++++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 4c76f26e20..f7e683e714 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -1642,7 +1642,8 @@ class PMA_DisplayResults // pftext means "partial or full texts" (done to reduce line lengths) $options_html .= PMA_Util::getRadioFields( 'pftext', $choices, - $_SESSION['tmpval']['pftext'] + $_SESSION['tmpval']['pftext'], + true, true, '', 'pftext_' . $this->__get('unique_id') ) . ''; @@ -1657,7 +1658,8 @@ class PMA_DisplayResults $options_html .= PMA_Util::getRadioFields( 'relational_display', $choices, - $_SESSION['tmpval']['relational_display'] + $_SESSION['tmpval']['relational_display'], + true, true, '', 'relational_display_' . $this->__get('unique_id') ) . ''; } @@ -1666,13 +1668,13 @@ class PMA_DisplayResults . PMA_Util::getCheckbox( 'display_binary', __('Show binary contents'), ! empty($_SESSION['tmpval']['display_binary']), false, - 'display_binary' + 'display_binary_' . $this->__get('unique_id') ) . '
' . PMA_Util::getCheckbox( 'display_blob', __('Show BLOB contents'), ! empty($_SESSION['tmpval']['display_blob']), false, - 'display_blob' + 'display_blob_' . $this->__get('unique_id') ) . ''; @@ -1684,7 +1686,7 @@ class PMA_DisplayResults . PMA_Util::getCheckbox( 'hide_transformation', __('Hide browser transformation'), ! empty($_SESSION['tmpval']['hide_transformation']), false, - 'hide_transformation' + 'hide_transformation_' . $this->__get('unique_id') ) . ''; @@ -1698,7 +1700,8 @@ class PMA_DisplayResults $options_html .= PMA_Util::getRadioFields( 'geoOption', $choices, - $_SESSION['tmpval']['geoOption'] + $_SESSION['tmpval']['geoOption'], + true, true, '', 'geoOption_' . $this->__get('unique_id') ) . ''; } diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 6f367ae451..c1989b6989 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -2629,12 +2629,15 @@ class PMA_Util * @param boolean $line_break whether to add HTML line break after a choice * @param boolean $escape_label whether to use htmlspecialchars() on label * @param string $class enclose each choice with a div of this class + * @param string $id_prefix prefix for the id attribute, name will be + * used if this is not supplied * * @return string set of html radio fiels */ public static function getRadioFields( $html_field_name, $choices, $checked_choice = '', - $line_break = true, $escape_label = true, $class = '' + $line_break = true, $escape_label = true, $class = '', + $id_prefix = '' ) { $radio_html = ''; @@ -2644,7 +2647,10 @@ class PMA_Util $radio_html .= '
'; } - $html_field_id = $html_field_name . '_' . $choice_value; + if (! $id_prefix) { + $id_prefix = $html_field_name; + } + $html_field_id = $id_prefix . '_' . $choice_value; $radio_html .= '