From 79a3d04ed5a2bafd02bb2d94e75f72ab4666b155 Mon Sep 17 00:00:00 2001 From: Nisarg Jhaveri Date: Wed, 3 Dec 2014 19:14:35 +0530 Subject: [PATCH] Show placeholder in number of rows dropdown when showing all - Implemented placeholder in dropdown in getDropdown in PMA_Util - Show 'All' as placeholder when Show all is checked, in "Number of rows:" dropdown Signed-off-by: Nisarg Jhaveri --- libraries/DisplayResults.class.php | 7 ++++++- libraries/Util.class.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index b7c0d84221..98ee21e7d0 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -961,6 +961,11 @@ class PMA_DisplayResults // Do not change the position when changing the number of rows . $_SESSION['tmpval']['pos'] . '" />'; + $numberOfRowsPlaceholder = null; + if ($_SESSION['tmpval']['max_rows'] == self::ALL_ROWS) { + $numberOfRowsPlaceholder = 'All'; + } + $numberOfRowsChoices = array( '25' => 25, '50' => 50, @@ -971,7 +976,7 @@ class PMA_DisplayResults $additional_fields_html .= __('Number of rows:') . ' '; $additional_fields_html .= PMA_Util::getDropdown( 'session_max_rows', $numberOfRowsChoices, - $_SESSION['tmpval']['max_rows'], '', 'autosubmit' + $_SESSION['tmpval']['max_rows'], '', 'autosubmit', $numberOfRowsPlaceholder ); if ($GLOBALS['cfg']['ShowDisplayDirection']) { diff --git a/libraries/Util.class.php b/libraries/Util.class.php index c0ebdeeb37..cc88d30536 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -2679,13 +2679,14 @@ class PMA_Util * case the dropdown is present more than once * on the page * @param string $class class for the select element + * @param string $placeholder Placeholder for dropdown if nothing else is selected * * @return string html content * * @todo support titles */ public static function getDropdown( - $select_name, $choices, $active_choice, $id, $class = '' + $select_name, $choices, $active_choice, $id, $class = '', $placeholder = null ) { $result = ''; + if (!empty($placeholder)) { + $result .= ''; + } + foreach ($choices as $one_choice_value => $one_choice_label) { $result .= '