browse mode page drop-down

This commit is contained in:
Marc Delisle
2003-03-17 14:38:24 +00:00
parent caabb6aff6
commit 777e04f807
3 changed files with 43 additions and 0 deletions

View File

@@ -8,6 +8,8 @@ $Source$
2003-03-17 Marc Delisle <lem9@users.sourceforge.net>
* user_password.php3, header.inc.php3, libraries/user_password.js:
put back js functions for user password change (= old user_details.js)
* libraries/display_tbl.lib.php3, functions.js: new feature:
browse mode page drop-down, thanks to Alexis Soulard (alexis_soulard)
2003-03-15 Marc Delisle <lem9@users.sourceforge.net>
* pdf_pages.php3: Automatic layout of tables on the schema

View File

@@ -348,6 +348,40 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
<?php
} // end move toward
//page redirection
$pageNow = @floor($pos / $session_max_rows) + 1;
$nbTotalPage = @ceil($unlim_num_rows / $session_max_rows);
if ($nbTotalPage > 1){ //if1
?>
<td>
&nbsp;&nbsp;&nbsp;
</td>
<td>
<?php //<form> for keep the form alignment of button < and << ?>
<form>
<?php echo $GLOBALS['strPageNumber']; ?>
<SELECT NAME="goToPage" onChange="goToUrl(this, '<?php echo "sql.php3?sql_query=".$encoded_query."&amp;session_max_rows=".$session_max_rows."&amp;disp_direction=".$disp_direction."&amp;repeat_cells=".$repeat_cells."&amp;goto=".$goto."&amp;dontlimitchars=".$dontlimitchars."&amp;".PMA_generate_common_url($db, $table)."&amp;"; ?>')">
<?php
for ($i=1; $i<=$nbTotalPage; $i++){
if ($i == $pageNow) {
$selected = 'selected="selected"';
} else {
$selected = "";
}
echo " <option ".$selected." value=\"".(($i - 1) * $session_max_rows)."\">".$i."</option>\n";
}
?>
</SELECT>
</form>
</td>
<?php
} //_if1
// Show all the records if allowed
if ($GLOBALS['cfg']['ShowAll'] && ($num_rows < $unlim_num_rows)) {
echo "\n";

View File

@@ -635,3 +635,10 @@ function onKeyDownArrowsHandler(e) {
}
e.returnValue = false;
}
/**
* listbox redirection
*/
function goToUrl(selObj, goToLocation){
eval("document.location.href = '" + goToLocation + "pos=" + selObj.options[selObj.selectedIndex].value + "'");
}