* the number of rows to return, display direction and table headers frequencies

weren't passed between scripts;
* codding standards;
* little bugs with vertical/horizontal display directions.
This commit is contained in:
Loïc Chapeaux
2001-12-18 12:07:13 +00:00
parent 60a56c67a6
commit 51cd7cd732
7 changed files with 458 additions and 386 deletions

View File

@@ -5,13 +5,25 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2001-12-18 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* sql.php3; tbl_change.php3; tbl_replace.php3;
libraries/display_tbl.lib.php3: the number of rows to return, display
direction and table headers "frequencies" weren't passed between scripts.
* config.inc.php3; Documentation.html; libraries/display_tbl.lib.php3:
- codding standards;
- little bugs with vertical/horizontal display direction.
2001-12-16 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* footer.inc.php3: back to previous version (it does not fix the bug
#493200 but creates a new one).
2001-12-16 Marc Delisle <lem9@users.sourceforge.net> 2001-12-16 Marc Delisle <lem9@users.sourceforge.net>
* merge and adapt Vertical/horizontal browsing patch #492470 * merge and adapt Vertical/horizontal browsing patch #492470
thanks to Garvin Hicking (hicking at faktor-e.de) thanks to Garvin Hicking (hicking at faktor-e.de)
- config.inc.php3 - config.inc.php3
- libraries/display_tbl.lib.php3 - libraries/display_tbl.lib.php3
- lang/* - lang/*
- Documentation.html - Documentation.html
2001-12-15 Lo<4C>c Chapeaux <lolo@phpheaven.net> 2001-12-15 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* libraries/common.lib.php3: * libraries/common.lib.php3:

View File

@@ -218,10 +218,10 @@
Have a look at Have a look at
<a class="navigation" href="#config">Configuration section</a> for an <a class="navigation" href="#config">Configuration section</a> for an
explanation of all values.</li> explanation of all values.</li>
<li> It is recommended that you protect the directory in which <li> It is recommended that you protect the directory in which you
you installed phpMyAdmin (unless it's on a closed intranet, or you installed phpMyAdmin (unless it's on a closed intranet, or you wish to
wish to use http or cookie authentication), for example with use http or cookie authentication), for example with HTTP-AUTH (in a
HTTP-AUTH (in a <i>.htaccess</i> file). See the <i>.htaccess</i> file). See the
<a class="navigation" href="#faq">FAQ section</a> for additional <a class="navigation" href="#faq">FAQ section</a> for additional
information.</li> information.</li>
<li> Open the file <li> Open the file
@@ -241,64 +241,67 @@
<p><b>Using authentication modes:</b></p> <p><b>Using authentication modes:</b></p>
<ul> <ul>
<li> Http and cookie authentication modes are recommended in a multi-user <li>Http and cookie authentication modes are recommended in a multi-user
environment where you want to give users access to their own database environment where you want to give users access to their own database
and don't want them to play around with others.<br /><br /></li> and don't want them to play around with others.<br /><br /></li>
<li> Http and cookie authentication modes are secure: the MySQL password does <li>Http and cookie authentication modes are secure: the MySQL password
not need to be set in the phpMyAdmin configuration file. (except for the does not need to be set in the phpMyAdmin configuration file. (except
&quot;standard user&quot; -see the Configuration section-).<br /> for the &quot;standard user&quot; -see the Configuration section-).
<br />
In cookie mode, we send the password in a temporary cookie, so most In cookie mode, we send the password in a temporary cookie, so most
browsers should not store the password in their cookie file. browsers should not store the password in their cookie file.
<br /><br /></li> <br /><br /></li>
<li> For 'http' and 'cookie' modes, phpMyAdmin needs a stduser that <li>
has <b>only</b> the <tt>SELECT</tt> For 'http' and 'cookie' modes, phpMyAdmin needs a stduser that has
privilege on the <i>mysql.user (all columns except <b>only</b> the <tt>SELECT</tt> privilege on the <i>mysql.user (all
&quot;Password&quot;)</i>, <i>mysql.db (all columns)</i> &amp; columns except &quot;Password&quot;)</i>, <i>mysql.db (all columns)</i>
<i>mysql.tables_priv (all columns except &quot;Grantor&quot; &amp; &amp; <i>mysql.tables_priv (all columns except &quot;Grantor&quot;
&quot;Timestamp&quot;) </i>tables.<br /> &amp; &quot;Timestamp&quot;) </i>tables.<br />
You must specify the details for the stduser in the <i>config.inc.php3</i> You must specify the details for the stduser in the
file under the <tt>$cfgServers[n]['stduser']</tt> &amp; <i>config.inc.php3</i> file under the
<tt>$cfgServers[n]['stdpass']</tt> settings.<br /> <tt>$cfgServers[n]['stduser']</tt> &amp;
To create the control account (<tt>&lt;stduser&gt;</tt> and <tt>$cfgServers[n]['stdpass']</tt> settings.<br />
<tt>&lt;stdpass&gt;</tt> have to be replaced by your own values, of course):<br /> To create the control account (<tt>&lt;stduser&gt;</tt> and
<table border="0"> <tt>&lt;stdpass&gt;</tt> have to be replaced by your own values, of
<tr> course):<br />
<td>&nbsp;&nbsp;&nbsp;</td> <table border="0">
<td> <tr>
<tt>GRANT USAGE ON mysql.* TO '&lt;stduser&gt;'@'localhost' IDENTIFIED BY '&lt;stdpass&gt;';</tt><br /> <td>&nbsp;&nbsp;&nbsp;</td>
<tt>GRANT SELECT (Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv) ON mysql.user TO '&lt;stduser&gt;'@'localhost';</tt><br /> <td>
<tt>GRANT SELECT ON mysql.db TO '&lt;stduser&gt;'@'localhost';</tt><br /> <tt>GRANT USAGE ON mysql.* TO '&lt;stduser&gt;'@'localhost' IDENTIFIED BY '&lt;stdpass&gt;';</tt><br />
<tt>GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) ON mysql.tables_priv TO '&lt;stduser&gt;'@'localhost';</tt> <tt>GRANT SELECT (Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv) ON mysql.user TO '&lt;stduser&gt;'@'localhost';</tt><br />
</td> <tt>GRANT SELECT ON mysql.db TO '&lt;stduser&gt;'@'localhost';</tt><br />
</tr> <tt>GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) ON mysql.tables_priv TO '&lt;stduser&gt;'@'localhost';</tt>
<tr> </td>
<td colspan="2"> </tr>
... and if you want to use the bookmark feature: <tr>
</td> <td colspan="2">
</tr> ... and if you want to use the bookmark feature:
<tr> </td>
<td>&nbsp;&nbsp;&nbsp;</td> </tr>
<td> <tr>
<tt>GRANT SELECT, INSERT, DELETE ON &lt;bookmark_db&gt;.&lt;bookmark_table&gt; TO '&lt;stduser&gt;'@'localhost';</tt> <td>&nbsp;&nbsp;&nbsp;</td>
</td> <td>
</tr> <tt>GRANT SELECT, INSERT, DELETE ON &lt;bookmark_db&gt;.&lt;bookmark_table&gt; TO '&lt;stduser&gt;'@'localhost';</tt>
</table> </td>
<br /> </tr>
</li> </table>
<li> <br />
Then each of the <i>true</i> users should be granted of a set of </li>
privileges on a set of perticular databases but shouldn't have any global <li>
privileges. For example, to grant the user <i>real_user</i> with all Then each of the <i>true</i> users should be granted of a set of
privileges on the database <i>user_base</i>:<br /> privileges on a set of perticular databases but shouldn't have any
&nbsp;&nbsp;&nbsp;<tt>GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password';</tt> global privileges. For example, to grant the user <i>real_user</i> with
<br /> all privileges on the database <i>user_base</i>:<br />
What the user may now do is controlled entirely by the MySQL user management &nbsp;&nbsp;&nbsp;<tt>GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password';</tt>
system.<br /> <br />
With http or cookie auth mode, you don't need to fill the user/password What the user may now do is controlled entirely by the MySQL user
fields inside the <tt>$cfgServers</tt> array.<br /> management system.<br />
</li> With http or cookie auth mode, you don't need to fill the user/password
fields inside the <tt>$cfgServers</tt> array.<br />
</li>
</ul> </ul>
<p><b>'http' authentication mode:</b></p> <p><b>'http' authentication mode:</b></p>
@@ -308,6 +311,7 @@
allows you to login as any valid MySQL user.</li> allows you to login as any valid MySQL user.</li>
<li>Is only supported with PHP running as an Apache module, not with cgi.</li> <li>Is only supported with PHP running as an Apache module, not with cgi.</li>
</ul> </ul>
<p><b>'cookie' authentication mode:</b></p> <p><b>'cookie' authentication mode:</b></p>
<ul> <ul>
<li>You can use this method as a replacement for the http <li>You can use this method as a replacement for the http
@@ -325,8 +329,8 @@
fields.<br /> fields.<br />
But usually you don't need to setup a &quot;standard user&quot; here: But usually you don't need to setup a &quot;standard user&quot; here:
using the <tt>$cfgServers[n]['only_db']</tt> might be enough.<br /> using the <tt>$cfgServers[n]['only_db']</tt> might be enough.<br />
In the ISP FAQ section, there is an entry explaining how to In the ISP FAQ section, there is an entry explaining how to protect
protect your configuration file.<br /></li> your configuration file.<br /></li>
</ul> </ul>
@@ -438,8 +442,9 @@
<ul> <ul>
<li> <li>
'config' authentication (<tt>$auth_type&nbsp;=&nbsp;'config'</tt>) 'config' authentication
is the plain old way: username and password are stored in (<tt>$auth_type&nbsp;=&nbsp;'config'</tt>) is the plain old
way: username and password are stored in
<i>config.inc.php3</i>. <i>config.inc.php3</i>.
</li> </li>
<li> <li>
@@ -453,7 +458,7 @@
<li> <li>
'http' authentication (was called 'advanced' in older versions) 'http' authentication (was called 'advanced' in older versions)
(<tt>$auth_type&nbsp;=&nbsp;'http'</tt>) as introduced in 1.3.0 (<tt>$auth_type&nbsp;=&nbsp;'http'</tt>) as introduced in 1.3.0
allows you to log in as any valid MySQL user via HTTP-Auth.<br /> allows you to log in as any valid MySQL user via HTTP-Auth.
</li> </li>
</ul><br /> </ul><br />
@@ -724,21 +729,6 @@
<br /><br /> <br /><br />
</dd> </dd>
<dt>
<dt><b>$cfgDefaultDisplay </b>string</dt>
<dd>
There are 2 display modes: horizontal and vertical. Define which one
is displayed by default.
<br /><br />
</dd>
<dt>
<dt><b>$cfgRepeatCells </b>integer</dt>
<dd>
Repeat the headers every X cells, or 0 to deactivate.
<br /><br />
</dd>
<dt> <dt>
<b>$cfgLeftBgColor </b>string [HTML color]<br /> <b>$cfgLeftBgColor </b>string [HTML color]<br />
<b>$cfgRightBgColor </b>string [HTML color] <b>$cfgRightBgColor </b>string [HTML color]
@@ -811,6 +801,21 @@
Defines the place where modify and delete links would be put when Defines the place where modify and delete links would be put when
tables contents are displayed (you may have them displayed both at the tables contents are displayed (you may have them displayed both at the
left and at the right). left and at the right).
&quot;Left&quot; and &quot;right&quot; are parsed as &quot;top&quot;
and &quot;bottom&quot; with vertical display mode.
<br /><br />
</dd>
<dt><b>$cfgDefaultDisplay </b>string</dt>
<dd>
There are 2 display modes: horizontal and vertical. Define which one is
displayed by default.
<br /><br />
</dd>
<dt><b>$cfgRepeatCells </b>integer</dt>
<dd>
Repeat the headers every X cells, or 0 to deactivate.
<br /><br /> <br /><br />
</dd> </dd>

View File

@@ -173,10 +173,13 @@ $cfgTextareaCols = 40; // textarea size (columns) in edit mode
$cfgTextareaRows = 7; // textarea size (rows) in edit mode $cfgTextareaRows = 7; // textarea size (rows) in edit mode
$cfgLimitChars = 50; // max field data length in browse mode $cfgLimitChars = 50; // max field data length in browse mode
$cfgModifyDeleteAtLeft = TRUE; // show edit/delete links on left side of browse $cfgModifyDeleteAtLeft = TRUE; // show edit/delete links on left side of browse
// (or at the top with vertical browse)
$cfgModifyDeleteAtRight = FALSE; // show edit/delete links on right side of browse $cfgModifyDeleteAtRight = FALSE; // show edit/delete links on right side of browse
$cfgDefaultDisplay = 'horizontal'; // default display mode (horizontal|vertical) // (or at the bottom with vertical browse)
$cfgDefaultDisplay = 'horizontal'; // default display direction (horizontal|vertical)
$cfgRepeatCells = 100; // repeat header names every X cells? (0 = deactivate) $cfgRepeatCells = 100; // repeat header names every X cells? (0 = deactivate)
/** /**
* MySQL settings * MySQL settings
*/ */

View File

@@ -181,6 +181,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
* without any programmatically appended "LIMIT" clause * without any programmatically appended "LIMIT" clause
* @global integer the current position in results * @global integer the current position in results
* @global mixed the maximum number of rows per page ('all' = no limit) * @global mixed the maximum number of rows per page ('all' = no limit)
* @global string the display mode (horizontal/vertical)
* @global integer the number of row to display between two table headers
* @global boolean whether to limit the number of displayed characters of * @global boolean whether to limit the number of displayed characters of
* text type fields or not * text type fields or not
* *
@@ -192,7 +194,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
{ {
global $lang, $server, $db, $table; global $lang, $server, $db, $table;
global $goto; global $goto;
global $num_rows, $unlim_num_rows, $pos, $session_max_rows, $displaymode, $repeatcells; global $num_rows, $unlim_num_rows, $pos, $session_max_rows;
global $disp_direction, $repeat_cells;
global $dontlimitchars; global $dontlimitchars;
?> ?>
@@ -224,6 +227,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" /> <input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" />
<input type="hidden" name="pos" value="0" /> <input type="hidden" name="pos" value="0" />
<input type="hidden" name="session_max_rows" value="<?php echo $session_max_rows; ?>" /> <input type="hidden" name="session_max_rows" value="<?php echo $session_max_rows; ?>" />
<input type="hidden" name="disp_direction" value="<?php echo $disp_direction; ?>" />
<input type="hidden" name="repeat_cells" value="<?php echo $repeat_cells; ?>" />
<input type="hidden" name="goto" value="<?php echo $goto; ?>" /> <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" /> <input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<input type="submit" name="navig" value="<?php echo $caption1; ?>"<?php echo $title1; ?> /> <input type="submit" name="navig" value="<?php echo $caption1; ?>"<?php echo $title1; ?> />
@@ -238,6 +243,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" /> <input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" />
<input type="hidden" name="pos" value="<?php echo $pos_prev; ?>" /> <input type="hidden" name="pos" value="<?php echo $pos_prev; ?>" />
<input type="hidden" name="session_max_rows" value="<?php echo $session_max_rows; ?>" /> <input type="hidden" name="session_max_rows" value="<?php echo $session_max_rows; ?>" />
<input type="hidden" name="disp_direction" value="<?php echo $disp_direction; ?>" />
<input type="hidden" name="repeat_cells" value="<?php echo $repeat_cells; ?>" />
<input type="hidden" name="goto" value="<?php echo $goto; ?>" /> <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" /> <input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<input type="submit" name="navig" value="<?php echo $caption2; ?>"<?php echo $title2; ?> /> <input type="submit" name="navig" value="<?php echo $caption2; ?>"<?php echo $title2; ?> />
@@ -250,7 +257,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<td> <td>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
</td> </td>
<td> <td align="center">
<form action="sql.php3" method="post" <form action="sql.php3" method="post"
onsubmit="return (checkFormElementInRange(this, 'session_max_rows', 1) && checkFormElementInRange(this, 'pos', 0, <?php echo $unlim_num_rows - 1; ?>))"> onsubmit="return (checkFormElementInRange(this, 'session_max_rows', 1) && checkFormElementInRange(this, 'pos', 0, <?php echo $unlim_num_rows - 1; ?>))">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" /> <input type="hidden" name="lang" value="<?php echo $lang; ?>" />
@@ -263,33 +270,19 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<input type="submit" name="navig" value="<?php echo $GLOBALS['strShow']; ?>&nbsp;:" /> <input type="submit" name="navig" value="<?php echo $GLOBALS['strShow']; ?>&nbsp;:" />
<input type="text" name="session_max_rows" size="3" value="<?php echo (($session_max_rows != 'all') ? $session_max_rows : $GLOBALS['cfgMaxRows']); ?>" onfocus="this.select()" /> <input type="text" name="session_max_rows" size="3" value="<?php echo (($session_max_rows != 'all') ? $session_max_rows : $GLOBALS['cfgMaxRows']); ?>" onfocus="this.select()" />
<?php echo $GLOBALS['strRowsFrom'] . "\n"; ?> <?php echo $GLOBALS['strRowsFrom'] . "\n"; ?>
<input type="text" name="pos" size="3" value="<?php echo (($pos_next >= $unlim_num_rows) ? 0 : $pos_next); ?>" onfocus="this.select()"/> <input type="text" name="pos" size="3" value="<?php echo (($pos_next >= $unlim_num_rows) ? 0 : $pos_next); ?>" onfocus="this.select()" />
<br /> <br />
<?php
<?php echo sprintf($GLOBALS['strRowsModeOptions'], // Display mode (horizontal/vertical and repeat headers)
$param1 = ' <select name="disp_direction">' . "\n"
// first parameter . ' <option value="horizontal"' . (($disp_direction == 'horizontal') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeHorizontal'] . '</option>' . "\n"
"<select name=\"displaymode\"> . ' <option value="vertical"' . (($disp_direction == 'vertical') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeVertical'] . '</option>' . "\n"
<option value=\"horizontal\"" . . ' </select>' . "\n"
(($displaymode == "horizontal" . ' ';
or $GLOBALS['cfgDefaultDisplay'] == "horizontal") ? $param2 = ' <input type="text" size="3" name="repeat_cells" value="' . $repeat_cells . '" />' . "\n"
" selected=\"selected\" ": "") . ">" . . ' ';
$GLOBALS['strRowsModeHorizontal'] . "</option>" . echo ' ' . sprintf($GLOBALS['strRowsModeOptions'], "\n" . $param1, "\n" . $param2) . "\n";
"<option value=\"vertical\" " . ?>
(($displaymode == "vertical"
or $GLOBALS['cfgDefaultDisplay'] == "vertical") ?
" selected=\"selected\" ": "") . ">" .
$GLOBALS['strRowsModeVertical'] . "</option>" .
" </select>",
// second parameter
"<input type=\"text\" size=\"3\" name=\"repeatcells\"" .
" value=\"" .
(!($repeatcells) ? $GLOBALS['cfgRepeatCells'] : $repeatcells) .
"\" />"
);
?>
</form> </form>
</td> </td>
<td> <td>
@@ -322,6 +315,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" /> <input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" />
<input type="hidden" name="pos" value="<?php echo $pos_next; ?>" /> <input type="hidden" name="pos" value="<?php echo $pos_next; ?>" />
<input type="hidden" name="session_max_rows" value="<?php echo $session_max_rows; ?>" /> <input type="hidden" name="session_max_rows" value="<?php echo $session_max_rows; ?>" />
<input type="hidden" name="disp_direction" value="<?php echo $disp_direction; ?>" />
<input type="hidden" name="repeat_cells" value="<?php echo $repeat_cells; ?>" />
<input type="hidden" name="goto" value="<?php echo $goto; ?>" /> <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" /> <input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<input type="submit" name="navig" value="<?php echo $caption3; ?>"<?php echo $title3; ?> /> <input type="submit" name="navig" value="<?php echo $caption3; ?>"<?php echo $title3; ?> />
@@ -337,6 +332,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" /> <input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" />
<input type="hidden" name="pos" value="<?php echo $unlim_num_rows - $session_max_rows; ?>" /> <input type="hidden" name="pos" value="<?php echo $unlim_num_rows - $session_max_rows; ?>" />
<input type="hidden" name="session_max_rows" value="<?php echo $session_max_rows; ?>" /> <input type="hidden" name="session_max_rows" value="<?php echo $session_max_rows; ?>" />
<input type="hidden" name="disp_direction" value="<?php echo $disp_direction; ?>" />
<input type="hidden" name="repeat_cells" value="<?php echo $repeat_cells; ?>" />
<input type="hidden" name="goto" value="<?php echo $goto; ?>" /> <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" /> <input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<input type="submit" name="navig" value="<?php echo $caption4; ?>"<?php echo $title4; ?> /> <input type="submit" name="navig" value="<?php echo $caption4; ?>"<?php echo $title4; ?> />
@@ -361,6 +358,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" /> <input type="hidden" name="sql_query" value="<?php echo $encoded_query; ?>" />
<input type="hidden" name="pos" value="0" /> <input type="hidden" name="pos" value="0" />
<input type="hidden" name="session_max_rows" value="all" /> <input type="hidden" name="session_max_rows" value="all" />
<input type="hidden" name="disp_direction" value="<?php echo $disp_direction; ?>" />
<input type="hidden" name="repeat_cells" value="<?php echo $repeat_cells; ?>" />
<input type="hidden" name="goto" value="<?php echo $goto; ?>" /> <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" /> <input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<input type="submit" name="navig" value="<?php echo $GLOBALS['strShowAll']; ?>" /> <input type="submit" name="navig" value="<?php echo $GLOBALS['strShowAll']; ?>" />
@@ -397,6 +396,9 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
* @global integer the total number of rows returned by the sql query * @global integer the total number of rows returned by the sql query
* @global integer the current position in results * @global integer the current position in results
* @global integer the maximum number of rows per page * @global integer the maximum number of rows per page
* @global array informations used with vertical display mode
* @global string the display mode (horizontal/vertical)
* @global integer the number of row to display between two table headers
* @global boolean whether to limit the number of displayed characters of * @global boolean whether to limit the number of displayed characters of
* text type fields or not * text type fields or not
* *
@@ -409,19 +411,19 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
global $lang, $server, $db, $table; global $lang, $server, $db, $table;
global $goto; global $goto;
global $sql_query, $num_rows, $pos, $session_max_rows; global $sql_query, $num_rows, $pos, $session_max_rows;
global $verticaldisplay, $disp_direction, $repeat_cells;
global $dontlimitchars; global $dontlimitchars;
global $verticaldisplay, $displaymode, $repeatcells;
if (!($displaymode) or ($displaymode=="horizontal")) { if ($disp_direction == 'horizontal') {
?> ?>
<!-- Results table headers --> <!-- Results table headers -->
<tr> <tr>
<?php <?php
echo "\n"; }
} echo "\n";
$verticaldisplay["emptypre"] = 0; $verticaldisplay['emptypre'] = 0;
$verticaldisplay["emptyafter"] = 0; $verticaldisplay['emptyafter'] = 0;
// 1. Displays the full/partial text button (part 1)... // 1. Displays the full/partial text button (part 1)...
$colspan = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') $colspan = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn')
@@ -436,15 +438,17 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
. '&amp;pos=' . $pos . '&amp;pos=' . $pos
. '&amp;session_max_rows=' . $session_max_rows . '&amp;session_max_rows=' . $session_max_rows
. '&amp;pos=' . $pos . '&amp;pos=' . $pos
. '&amp;disp_direction=' . $disp_direction
. '&amp;repeat_cells=' . $repeat_cells
. '&amp;goto=' . $goto . '&amp;goto=' . $goto
. '&amp;dontlimitchars=' . (($dontlimitchars) ? 0 : 1); . '&amp;dontlimitchars=' . (($dontlimitchars) ? 0 : 1);
// ... before the result table // ... before the result table
if (($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn') if (($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')
&& $is_display['text_btn'] == '1') { && $is_display['text_btn'] == '1') {
$verticaldisplay["emptypre"] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; $verticaldisplay['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if (!($displaymode) or ($displaymode=="horizontal")) { if ($disp_direction == 'horizontal') {
?> ?>
<td colspan="<?php echo $fields_cnt; ?>" align="center"> <td colspan="<?php echo $fields_cnt; ?>" align="center">
<a href="<?php echo $text_url; ?>"> <a href="<?php echo $text_url; ?>">
<img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a> <img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a>
@@ -452,33 +456,33 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
</tr> </tr>
<tr> <tr>
<?php <?php
} }
} }
// ... at the left column of the result table header if possible // ... at the left column of the result table header if possible
// and required // and required
else if ($GLOBALS['cfgModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') { else if ($GLOBALS['cfgModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') {
echo "\n"; echo "\n";
$verticaldisplay["emptypre"] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; $verticaldisplay['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if (!($displaymode) or ($displaymode=="horizontal")) { if ($disp_direction == 'horizontal') {
?> ?>
<td<?php echo $colspan; ?>" align="center"> <td<?php echo $colspan; ?>" align="center">
<a href="<?php echo $text_url; ?>"> <a href="<?php echo $text_url; ?>">
<img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a> <img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a>
</td> </td>
<?php <?php
} }
} }
// ... else if no button, displays empty(ies) col(s) if required // ... else if no button, displays empty(ies) col(s) if required
else if ($GLOBALS['cfgModifyDeleteAtLeft'] else if ($GLOBALS['cfgModifyDeleteAtLeft']
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) { && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) {
echo "\n"; echo "\n";
$verticaldisplay["emptypre"] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; $verticaldisplay['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if (!($displaymode) or ($displaymode=="horizontal")) { if ($disp_direction == 'horizontal') {
?> ?>
<td<?php echo $colspan; ?>></td> <td<?php echo $colspan; ?>></td>
<?php <?php
} }
} }
echo "\n"; echo "\n";
@@ -556,39 +560,39 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
. '&amp;table=' . urlencode($table) . '&amp;table=' . urlencode($table)
. '&amp;pos=' . $pos . '&amp;pos=' . $pos
. '&amp;session_max_rows=' . $session_max_rows . '&amp;session_max_rows=' . $session_max_rows
. '&amp;dontlimitchars' . $dontlimitchars . '&amp;disp_direction=' . $disp_direction
. '&amp;repeat_cells=' . $repeat_cells
. '&amp;dontlimitchars=' . $dontlimitchars
. '&amp;sql_query=' . urlencode($sorted_sql_query); . '&amp;sql_query=' . urlencode($sorted_sql_query);
// 2.1.5 Displays the sorting url
if (!($displaymode) or ($displaymode=="horizontal")) { // 2.1.5 Displays the sorting url
?> if ($disp_direction == 'horizontal') {
?>
<th> <th>
<a href="sql.php3?<?php echo $url_query; ?>"> <a href="sql.php3?<?php echo $url_query; ?>">
<?php echo htmlspecialchars($fields_meta[$i]->name); ?></a><?php echo $order_img . "\n"; ?> <?php echo htmlspecialchars($fields_meta[$i]->name); ?></a><?php echo $order_img . "\n"; ?>
</th> </th>
<?php <?php
} }
$verticaldisplay['desc'][] = ' <th>' . "\n"
$verticaldisplay["desc"][] = ' <th>' . "\n" . ' <a href="sql.php3?' . $url_query . '">' . "\n"
. ' <a href="sql.php3?' . $url_query . '">' . "\n" . ' ' . htmlspecialchars($fields_meta[$i]->name) . '</a>' . $order_img . "\n"
. ' ' . htmlspecialchars($fields_meta[$i]->name) . '</a>' . $order_img . "\n" . ' </th>' . "\n";
. ' </th>'; } // end if (2.1)
} // end if (2.1)
// 2.2 Results can't be sorted // 2.2 Results can't be sorted
else { else {
if (!($displaymode) or ($displaymode=="horizontal")) { echo "\n";
echo "\n"; if ($disp_direction == 'horizontal') {
?> ?>
<th> <th>
<?php echo htmlspecialchars($fields_meta[$i]->name) . "\n"; ?> <?php echo htmlspecialchars($fields_meta[$i]->name) . "\n"; ?>
</th> </th>
<?php <?php
} }
$verticaldisplay["desc"][] = ' <th>' . "\n" $verticaldisplay['desc'][] = ' <th>' . "\n"
. ' ' . htmlspecialchars($fields_meta[$i]->name) . "\n" . ' ' . htmlspecialchars($fields_meta[$i]->name) . "\n"
. ' </th>'; . ' </th>';
} // end else (2.2) } // end else (2.2)
echo "\n"; echo "\n";
} // end for } // end for
@@ -599,33 +603,32 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')
&& $is_display['text_btn'] == '1') { && $is_display['text_btn'] == '1') {
echo "\n"; echo "\n";
$verticaldisplay["emptyafter"] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; $verticaldisplay['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if (!($displaymode) or ($displaymode=="horizontal")) { if ($disp_direction == 'horizontal') {
?> ?>
<td<?php echo $colspan; ?>" align="center"> <td<?php echo $colspan; ?>" align="center">
<a href="<?php echo $text_url; ?>"> <a href="<?php echo $text_url; ?>">
<img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a> <img src="./images/<?php echo (($dontlimitchars) ? 'partialtext' : 'fulltext'); ?>.png" border="0" width="50" height="20" alt="<?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?>" /></a>
</td> </td>
<?php <?php
} }
} }
// ... else if no button, displays empty cols if required // ... else if no button, displays empty cols if required
else if ($GLOBALS['cfgModifyDeleteAtRight'] else if ($GLOBALS['cfgModifyDeleteAtRight']
&& ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')) { && ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')) {
echo "\n" . ' <td' . $colspan . '></td>'; echo "\n" . ' <td' . $colspan . '></td>';
$verticaldisplay["emptyafter"] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; $verticaldisplay['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
} }
echo "\n";
if (!($displaymode) or ($displaymode=="horizontal")) echo "\n"; if ($disp_direction == 'horizontal') {
?>
if (!($displaymode) or ($displaymode=="horizontal")) {
?>
</tr> </tr>
<?php <?php
echo "\n"; }
} echo "\n";
return true; return TRUE;
} // end of the 'PMA_displayTableHeaders()' function } // end of the 'PMA_displayTableHeaders()' function
@@ -651,6 +654,9 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
* @global integer the maximum number of rows per page * @global integer the maximum number of rows per page
* @global array the list of fields properties * @global array the list of fields properties
* @global integer the total number of fields returned by the sql query * @global integer the total number of fields returned by the sql query
* @global array informations used with vertical display mode
* @global string the display mode (horizontal/vertical)
* @global integer the number of row to display between two table headers
* @global boolean whether to limit the number of displayed characters of * @global boolean whether to limit the number of displayed characters of
* text type fields or not * text type fields or not
* *
@@ -662,19 +668,19 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
{ {
global $lang, $server, $db, $table; global $lang, $server, $db, $table;
global $goto; global $goto;
global $sql_query, $pos, $sessionMaxRow, $fields_meta, $fields_cnt; global $sql_query, $pos, $session_max_rows, $fields_meta, $fields_cnt;
global $verticaldisplay, $disp_direction, $repeat_cells;
global $dontlimitchars; global $dontlimitchars;
global $verticaldisplay, $displaymode, $repeatcells;
?> ?>
<!-- Results table body --> <!-- Results table body -->
<?php <?php
echo "\n"; echo "\n";
$foo = 0; $foo = 0;
$verticaldisplay["edit"] = array(); $verticaldisplay['edit'] = array();
$verticaldisplay["delete"] = array(); $verticaldisplay['delete'] = array();
$verticaldisplay["data"] = array(); $verticaldisplay['data'] = array();
// Correction uva 19991216 in the while below // Correction uva 19991216 in the while below
// Previous code assumed that all tables have keys, specifically that // Previous code assumed that all tables have keys, specifically that
@@ -693,39 +699,39 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
while ($row = mysql_fetch_array($dt_result)) { while ($row = mysql_fetch_array($dt_result)) {
if (($foo != 0) and ($repeatcells != 0) and !($foo % $repeatcells) and $displaymode == "horizontal") { // lem9: "vertical display" mode stuff
echo "<tr>"; if (($foo != 0) && ($repeat_cells != 0) && !($foo % $repeat_cells) && $disp_direction == 'horizontal') {
echo '<tr>' . "\n";
for ($foo_i=0;$foo_i<$verticaldisplay["emptypre"];$foo_i++) { for ($foo_i = 0; $foo_i < $verticaldisplay['emptypre']; $foo_i++) {
echo "<td>&nbsp;</td>"; echo ' <td>&nbsp;</td>' . "\n";
} }
reset($verticaldisplay["desc"]); reset($verticaldisplay["desc"]);
while(list($key, $val) = each($verticaldisplay["desc"])) { while (list($key, $val) = each($verticaldisplay['desc'])) {
echo $val; echo ' ' . $val;
} }
for ($foo_i=0;$foo_i<$verticaldisplay["emptyafter"];$foo_i++) { for ($foo_i = 0; $foo_i < $verticaldisplay['emptyafter']; $foo_i++) {
echo "<td>&nbsp;</td>"; echo ' <td>&nbsp;</td>' . "\n";
} }
echo "</tr>"; echo '</tr>' . "\n";
} } // end if
$bgcolor = ($foo % 2) ? $GLOBALS['cfgBgcolorOne'] : $GLOBALS['cfgBgcolorTwo']; $bgcolor = ($foo % 2) ? $GLOBALS['cfgBgcolorOne'] : $GLOBALS['cfgBgcolorTwo'];
if (!($displaymode) or ($displaymode=="horizontal")) { if ($disp_direction == 'horizontal') {
// loic1: pointer code part // loic1: pointer code part
$on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '') $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
? '' ? ''
: ' onmouseover="setPointer(this, \'' . : ' onmouseover="setPointer(this, \'' . $GLOBALS['cfgBrowsePointerColor'] . '\')" onmouseout="setPointer(this, \'' . $bgcolor . '\')"';
$GLOBALS['cfgBrowsePointerColor'] . '\')" onmouseout="setPointer(this, \'' .
$bgcolor . '\')"'; ?>
?>
<tr<?php echo $on_mouse; ?>> <tr<?php echo $on_mouse; ?>>
<?php <?php
echo "\n"; }
} echo "\n";
// 1. Prepares the row (gets primary keys to use) // 1. Prepares the row (gets primary keys to use)
if ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') { if ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') {
@@ -772,7 +778,9 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
. '&amp;db=' . urlencode($db) . '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table) . '&amp;table=' . urlencode($table)
. '&amp;pos=' . $pos . '&amp;pos=' . $pos
. '&amp;sessionMaxRow=' . $sessionMaxRow . '&amp;session_max_rows=' . $session_max_rows
. '&amp;disp_direction=' . $disp_direction
. '&amp;repeat_cells=' . $repeat_cells
. '&amp;dontlimitchars=' . $dontlimitchars; . '&amp;dontlimitchars=' . $dontlimitchars;
// 1.2.1 Modify link(s) // 1.2.1 Modify link(s)
@@ -780,21 +788,21 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
if (!empty($goto) if (!empty($goto)
&& empty($GLOBALS['QUERY_STRING']) && empty($GLOBALS['QUERY_STRING'])
&& (empty($GLOBALS['HTTP_SERVER_VARS']) || empty($GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING']))) { && (empty($GLOBALS['HTTP_SERVER_VARS']) || empty($GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING']))) {
// void $lnk_goto = $goto;
} else { } else {
$goto = 'sql.php3'; $lnk_goto = 'sql.php3';
} }
$edit_url = 'tbl_change.php3' $edit_url = 'tbl_change.php3'
. '?' . $url_query . '?' . $url_query
. '&amp;primary_key=' . $uva_condition . '&amp;primary_key=' . $uva_condition
. '&amp;sql_query=' . urlencode($sql_query) . '&amp;sql_query=' . urlencode($sql_query)
. '&amp;goto=' . urlencode($goto); . '&amp;goto=' . urlencode($lnk_goto);
$edit_str = $GLOBALS['strEdit']; $edit_str = $GLOBALS['strEdit'];
} // end if (1.2.1) } // end if (1.2.1)
// 1.2.2 Delete/Kill link(s) // 1.2.2 Delete/Kill link(s)
if ($is_display['del_lnk'] == 'dr') { // delete row case if ($is_display['del_lnk'] == 'dr') { // delete row case
$goto = 'sql.php3' $lnk_goto = 'sql.php3'
. '?' . str_replace('&amp;', '&', $url_query) . '?' . str_replace('&amp;', '&', $url_query)
. '&sql_query=' . urlencode($sql_query) . '&sql_query=' . urlencode($sql_query)
. '&zero_rows=' . urlencode(htmlspecialchars($GLOBALS['strDeleted'])) . '&zero_rows=' . urlencode(htmlspecialchars($GLOBALS['strDeleted']))
@@ -803,12 +811,12 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
. '?' . $url_query . '?' . $url_query
. '&amp;sql_query=' . urlencode('DELETE FROM ' . PMA_backquote($table) . ' WHERE') . $uva_condition . urlencode(' LIMIT 1') . '&amp;sql_query=' . urlencode('DELETE FROM ' . PMA_backquote($table) . ' WHERE') . $uva_condition . urlencode(' LIMIT 1')
. '&amp;zero_rows=' . urlencode(htmlspecialchars($GLOBALS['strDeleted'])) . '&amp;zero_rows=' . urlencode(htmlspecialchars($GLOBALS['strDeleted']))
. '&amp;goto=' . urlencode($goto); . '&amp;goto=' . urlencode($lnk_goto);
$js_conf = 'DELETE FROM ' . PMA_jsFormat($table) $js_conf = 'DELETE FROM ' . PMA_jsFormat($table)
. ' WHERE ' . trim(PMA_jsFormat(urldecode($uva_condition), FALSE)) . ' LIMIT 1'; . ' WHERE ' . trim(PMA_jsFormat(urldecode($uva_condition), FALSE)) . ' LIMIT 1';
$del_str = $GLOBALS['strDelete']; $del_str = $GLOBALS['strDelete'];
} else if ($is_display['del_lnk'] == 'kp') { // kill process case } else if ($is_display['del_lnk'] == 'kp') { // kill process case
$goto = 'sql.php3' $lnk_goto = 'sql.php3'
. '?' . str_replace('&amp;', '&', $url_query) . '?' . str_replace('&amp;', '&', $url_query)
. '&sql_query=' . urlencode($sql_query) . '&sql_query=' . urlencode($sql_query)
. '&goto=main.php3'; . '&goto=main.php3';
@@ -817,13 +825,14 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
. '&amp;server=' . $server . '&amp;server=' . $server
. '&amp;db=mysql' . '&amp;db=mysql'
. '&amp;sql_query=' . urlencode('KILL ' . $row['Id']) . '&amp;sql_query=' . urlencode('KILL ' . $row['Id'])
. '&amp;goto=' . urlencode($goto); . '&amp;goto=' . urlencode($lnk_goto);
$js_conf = 'KILL ' . $row['Id']; $js_conf = 'KILL ' . $row['Id'];
$del_str = $GLOBALS['strKill']; $del_str = $GLOBALS['strKill'];
} // end if (1.2.2) } // end if (1.2.2)
// 1.3 Displays the links at left if required // 1.3 Displays the links at left if required
if ($GLOBALS['cfgModifyDeleteAtLeft'] AND (!($displaymode) or ($displaymode=="horizontal"))) { if ($GLOBALS['cfgModifyDeleteAtLeft']
&& ($disp_direction == 'horizontal')) {
if (!empty($edit_url)) { if (!empty($edit_url)) {
?> ?>
<td bgcolor="<?php echo $bgcolor; ?>"> <td bgcolor="<?php echo $bgcolor; ?>">
@@ -831,7 +840,7 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
<?php echo $edit_str; ?></a> <?php echo $edit_str; ?></a>
</td> </td>
<?php <?php
} }
if (!empty($del_url)) { if (!empty($del_url)) {
echo "\n"; echo "\n";
?> ?>
@@ -843,7 +852,7 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
<?php <?php
} }
} // end if (1.3) } // end if (1.3)
if (!($displaymode) or ($displaymode=="horizontal")) echo "\n"; echo "\n";
} // end if (1) } // end if (1)
// 2. Displays the rows' values // 2. Displays the rows' values
@@ -852,11 +861,11 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
if ($primary->numeric == 1) { if ($primary->numeric == 1) {
if (!isset($row[$primary->name]) if (!isset($row[$primary->name])
|| (function_exists('is_null') && is_null($row[$primary->name]))) { || (function_exists('is_null') && is_null($row[$primary->name]))) {
$verticaldisplay["data"][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n"; $verticaldisplay['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
} else if ($row[$i] != '') { } else if ($row[$i] != '') {
$verticaldisplay["data"][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n"; $verticaldisplay['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n";
} else { } else {
$verticaldisplay["data"][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n"; $verticaldisplay['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n";
} }
} else if ($GLOBALS['cfgShowBlob'] == FALSE && eregi('BLOB', $primary->type)) { } else if ($GLOBALS['cfgShowBlob'] == FALSE && eregi('BLOB', $primary->type)) {
// loic1 : mysql_fetch_fields returns BLOB in place of TEXT // loic1 : mysql_fetch_fields returns BLOB in place of TEXT
@@ -865,11 +874,11 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
// fields. // fields.
$field_flags = mysql_field_flags($dt_result, $i); $field_flags = mysql_field_flags($dt_result, $i);
if (eregi('BINARY', $field_flags)) { if (eregi('BINARY', $field_flags)) {
$verticaldisplay["data"][$foo][$i] = ' <td align="center" valign="top" bgcolor="' . $bgcolor . '">[BLOB]</td>' . "\n"; $verticaldisplay['data'][$foo][$i] = ' <td align="center" valign="top" bgcolor="' . $bgcolor . '">[BLOB]</td>' . "\n";
} else { } else {
if (!isset($row[$primary->name]) if (!isset($row[$primary->name])
|| (function_exists('is_null') && is_null($row[$primary->name]))) { || (function_exists('is_null') && is_null($row[$primary->name]))) {
$verticaldisplay["data"][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n"; $verticaldisplay['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
} else if ($row[$primary->name] != '') { } else if ($row[$primary->name] != '') {
if (strlen($row[$primary->name]) > $GLOBALS['cfgLimitChars'] && ($dontlimitchars != 1)) { if (strlen($row[$primary->name]) > $GLOBALS['cfgLimitChars'] && ($dontlimitchars != 1)) {
$row[$primary->name] = substr($row[$primary->name], 0, $GLOBALS['cfgLimitChars']) . '...'; $row[$primary->name] = substr($row[$primary->name], 0, $GLOBALS['cfgLimitChars']) . '...';
@@ -879,15 +888,15 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
$row[$primary->name] = htmlspecialchars($row[$primary->name]); $row[$primary->name] = htmlspecialchars($row[$primary->name]);
$row[$primary->name] = str_replace("\011", '&nbsp;&nbsp;&nbsp;&nbsp;', str_replace(' ', '&nbsp;', $row[$primary->name])); $row[$primary->name] = str_replace("\011", '&nbsp;&nbsp;&nbsp;&nbsp;', str_replace(' ', '&nbsp;', $row[$primary->name]));
$row[$primary->name] = ereg_replace("((\015\012)|(\015)|(\012))", '<br />', $row[$primary->name]); $row[$primary->name] = ereg_replace("((\015\012)|(\015)|(\012))", '<br />', $row[$primary->name]);
$verticaldisplay["data"][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n"; $verticaldisplay['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n";
} else { } else {
$verticaldisplay["data"][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n"; $verticaldisplay['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n";
} }
} }
} else { } else {
if (!isset($row[$primary->name]) if (!isset($row[$primary->name])
|| (function_exists('is_null') && is_null($row[$primary->name]))) { || (function_exists('is_null') && is_null($row[$primary->name]))) {
$verticaldisplay["data"][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n"; $verticaldisplay['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
} else if ($row[$primary->name] != '') { } else if ($row[$primary->name] != '') {
// loic1: Cut text/blob fields even if $cfgShowBlob is true // loic1: Cut text/blob fields even if $cfgShowBlob is true
if (eregi('BLOB', $primary->type)) { if (eregi('BLOB', $primary->type)) {
@@ -911,22 +920,27 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
$row[$primary->name] = str_replace("\011", '&nbsp;&nbsp;&nbsp;&nbsp;', str_replace(' ', '&nbsp;', $row[$primary->name])); $row[$primary->name] = str_replace("\011", '&nbsp;&nbsp;&nbsp;&nbsp;', str_replace(' ', '&nbsp;', $row[$primary->name]));
$row[$primary->name] = ereg_replace("((\015\012)|(\015)|(\012))", '<br />', $row[$primary->name]); $row[$primary->name] = ereg_replace("((\015\012)|(\015)|(\012))", '<br />', $row[$primary->name]);
} }
$verticaldisplay["data"][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n"; $verticaldisplay['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n";
} else { } else {
$verticaldisplay["data"][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n"; $verticaldisplay['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n";
} }
} }
// output stored cell // lem9: output stored cell
if (!($displaymode) or ($displaymode=="horizontal")) { if ($disp_direction == 'horizontal') {
echo $verticaldisplay["data"][$foo][$i]; echo $verticaldisplay['data'][$foo][$i];
} }
$verticaldisplay["rowdata"][$i][$foo] .= $verticaldisplay["data"][$foo][$i]; if (isset($verticaldisplay['rowdata'][$i][$foo])) {
$verticaldisplay['rowdata'][$i][$foo] .= $verticaldisplay['data'][$foo][$i];
} else {
$verticaldisplay['rowdata'][$i][$foo] = $verticaldisplay['data'][$foo][$i];
}
} // end for (2) } // end for (2)
// 3. Displays the modify/delete links on the right if required // 3. Displays the modify/delete links on the right if required
if ($GLOBALS['cfgModifyDeleteAtRight'] AND (!($displaymode) or ($displaymode=="horizontal"))) { if ($GLOBALS['cfgModifyDeleteAtRight']
&& ($disp_direction == 'horizontal')) {
if (!empty($edit_url)) { if (!empty($edit_url)) {
?> ?>
<td bgcolor="<?php echo $bgcolor; ?>"> <td bgcolor="<?php echo $bgcolor; ?>">
@@ -947,30 +961,38 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
} }
} // end if (3) } // end if (3)
if (!($displaymode) or ($displaymode=="horizontal")) { if ($disp_direction == 'horizontal') {
?> echo "\n";
?>
</tr> </tr>
<?php <?php
} } // end if
// 4. Gather links of del_urls and edit_urls in an array for later output // 4. Gather links of del_urls and edit_urls in an array for later
$verticaldisplay["edit"][$foo] .= ' <td bgcolor="' . $bgcolor . '">' . "\n"; // output
$verticaldisplay["edit"][$foo] .= ' <a href="' . $edit_url . '">' . "\n"; if (!isset($verticaldisplay['edit'][$foo])) {
$verticaldisplay["edit"][$foo] .= ' ' . $edit_str . '</a>' . "\n"; $verticaldisplay['edit'][$foo] = '';
$verticaldisplay["edit"][$foo] .= ' </td>' . "\n"; $verticaldisplay['delete'][$foo] = '';
}
$verticaldisplay['edit'][$foo] .= ' <td bgcolor="' . $bgcolor . '">' . "\n";
$verticaldisplay['edit'][$foo] .= ' <a href="' . $edit_url . '">' . "\n";
$verticaldisplay['edit'][$foo] .= ' ' . $edit_str . '</a>' . "\n";
$verticaldisplay['edit'][$foo] .= ' </td>' . "\n";
$verticaldisplay["delete"][$foo] .= ' <td bgcolor="' . $bgcolor . '">' . "\n"; $verticaldisplay['delete'][$foo] .= ' <td bgcolor="' . $bgcolor . '">' . "\n";
$verticaldisplay["delete"][$foo] .= ' <a href="' . $del_url . '"'; $verticaldisplay['delete'][$foo] .= ' <a href="' . $del_url . '"';
if (isset($js_conf)) $verticaldisplay["delete"][$foo] .= 'onclick="return confirmLink(this, \'' . $js_conf . '\')"'; if (isset($js_conf)) {
$verticaldisplay["delete"][$foo] .= '>' . "\n"; $verticaldisplay['delete'][$foo] .= 'onclick="return confirmLink(this, \'' . $js_conf . '\')"';
$verticaldisplay["delete"][$foo] .= ' ' . $del_str . '</a>' . "\n"; }
$verticaldisplay["delete"][$foo] .= ' </td>' . "\n"; $verticaldisplay['delete'][$foo] .= '>' . "\n";
$verticaldisplay['delete'][$foo] .= ' ' . $del_str . '</a>' . "\n";
$verticaldisplay['delete'][$foo] .= ' </td>' . "\n";
if (!($displaymode) or ($displaymode=="horizontal")) echo "\n"; echo "\n";
$foo++; $foo++;
} // end while } // end while
return true; return TRUE;
} // end of the 'PMA_displayTableBody()' function } // end of the 'PMA_displayTableBody()' function
@@ -996,6 +1018,9 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
* displayed * displayed
* @global array the list of fields properties * @global array the list of fields properties
* @global integer the total number of fields returned by the sql query * @global integer the total number of fields returned by the sql query
* @global array informations used with vertical display mode
* @global string the display mode (horizontal/vertical)
* @global integer the number of row to display between two table headers
* @global boolean whether to limit the number of displayed characters of * @global boolean whether to limit the number of displayed characters of
* text type fields or not * text type fields or not
* *
@@ -1010,8 +1035,8 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
global $lang, $server, $db, $table; global $lang, $server, $db, $table;
global $goto; global $goto;
global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt; global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt;
global $verticaldisplay, $disp_direction, $repeat_cells;
global $dontlimitchars; global $dontlimitchars;
global $verticaldisplay, $displaymode, $repeatcells;
// 1. ----- Prepares the work ----- // 1. ----- Prepares the work -----
@@ -1078,119 +1103,117 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
} }
// 3. ----- Displays the results table ----- // 3. ----- Displays the results table -----
// lem9: horizontal output?
// horizontal output? if ($disp_direction == 'horizontal') {
if (!($displaymode) or ($displaymode == "horizontal")) ?>
{
?>
<!-- Results table --> <!-- Results table -->
<table border="<?php echo $GLOBALS['cfgBorder']; ?>" cellpadding="5"> <table border="<?php echo $GLOBALS['cfgBorder']; ?>" cellpadding="5">
<?php <?php
echo "\n"; echo "\n";
PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $encoded_sql_query); PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $encoded_sql_query);
PMA_displayTableBody($dt_result, $is_display); PMA_displayTableBody($dt_result, $is_display);
?> ?>
</table> </table>
<br /> <br />
<?php <?php
} }
else else {
{ echo "\n";
?> ?>
<!-- Results table --> <!-- Results table -->
<table border="<?php echo $GLOBALS['cfgBorder']; ?>" cellpadding="5"> <table border="<?php echo $GLOBALS['cfgBorder']; ?>" cellpadding="5">
<?php <?php
echo "\n"; echo "\n";
PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $encoded_sql_query); PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $encoded_sql_query);
PMA_displayTableBody($dt_result, $is_display); PMA_displayTableBody($dt_result, $is_display);
reset($verticaldisplay); reset($verticaldisplay);
if ($GLOBALS['cfgModifyDeleteAtTop'] AND is_array($verticaldisplay["edit"])) { if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($verticaldisplay['edit'])) {
echo "<tr>\n"; echo '<tr>' . "\n";
echo "<td>&nbsp;</td>"; echo ' <td>&nbsp;</td>' . "\n";
reset($verticaldisplay["edit"]); reset($verticaldisplay['edit']);
$foo_counter=0; $foo_counter = 0;
while(list($key, $val) = each($verticaldisplay["edit"])) { while (list($key, $val) = each($verticaldisplay['edit'])) {
if (($foo_counter != 0) and ($repeatcells != 0) and !($foo_counter % $repeatcells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo "<td>&nbsp;</td>"; echo ' <td>&nbsp;</td>' . "\n";
} }
echo $val; echo $val;
$foo_counter++; $foo_counter++;
} } // end while
echo "</tr>\n"; echo '</tr>' . "\n";
} } // end if
if ($GLOBALS['cfgModifyDeleteAtTop'] AND is_array($verticaldisplay["delete"])) { if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($verticaldisplay['delete'])) {
echo "<tr>\n"; echo '<tr>' . "\n";
echo "<td>&nbsp;</td>"; echo '<td>&nbsp;</td>' . "\n";
reset($verticaldisplay["delete"]); reset($verticaldisplay['delete']);
$foo_counter=0; $foo_counter = 0;
while(list($key, $val) = each($verticaldisplay["delete"])) { while (list($key, $val) = each($verticaldisplay['delete'])) {
if (($foo_counter != 0) and ($repeatcells != 0) and !($foo_counter % $repeatcells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo "<td>&nbsp;</td>"; echo '<td>&nbsp;</td>' . "\n";
} }
echo $val; echo $val;
$foo_counter++; $foo_counter++;
} } // end while
echo "</tr>\n"; echo '</tr>' . "\n";
} } // end if
reset($verticaldisplay["desc"]); reset($verticaldisplay['desc']);
while(list($key, $val) = each($verticaldisplay["desc"])) { while (list($key, $val) = each($verticaldisplay['desc'])) {
echo "<tr>\n"; echo '<tr>' . "\n";
echo $val; echo $val;
$foo_counter = 0; $foo_counter = 0;
while(list($subkey, $subval) = each($verticaldisplay["rowdata"][$key])) { while (list($subkey, $subval) = each($verticaldisplay['rowdata'][$key])) {
if (($foo_counter != 0) and ($repeatcells != 0) and !($foo_counter % $repeatcells)) { if (($foo_counter != 0) && ($repeat_cells != 0) and !($foo_counter % $repeat_cells)) {
echo $val; echo $val;
} }
echo $subval; echo $subval;
$foo_counter++; $foo_counter++;
} } // end while
echo "</tr>\n"; echo '</tr>' . "\n";
} } // end while
if ($GLOBALS['cfgModifyDeleteAtBottom'] AND is_array($verticaldisplay["edit"])) { if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($verticaldisplay['edit'])) {
echo "<tr>\n"; echo '<tr>' . "\n";
echo "<td>&nbsp;</td>"; echo ' <td>&nbsp;</td>' . "\n";
reset($verticaldisplay["edit"]); reset($verticaldisplay['edit']);
$foo_counter=0; $foo_counter = 0;
while(list($key, $val) = each($verticaldisplay["edit"])) { while (list($key, $val) = each($verticaldisplay['edit'])) {
if (($foo_counter != 0) and ($repeatcells != 0) and !($foo_counter % $repeatcells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo "<td>&nbsp;</td>"; echo '<td>&nbsp;</td>' . "\n";
} }
echo $val; echo $val;
$foo_counter++; $foo_counter++;
} } // end while
echo "</tr>\n"; echo '</tr>' . "\n";
} } // end if
if ($GLOBALS['cfgModifyDeleteAtBottom'] AND is_array($verticaldisplay["delete"])) { if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($verticaldisplay['delete'])) {
echo "<tr>\n"; echo '<tr>' . "\n";
echo "<td>&nbsp;</td>"; echo '<td>&nbsp;</td>' . "\n";
reset($verticaldisplay["delete"]); reset($verticaldisplay['delete']);
$foo_counter=0; $foo_counter = 0;
while(list($key, $val) = each($verticaldisplay["delete"])) { while (list($key, $val) = each($verticaldisplay['delete'])) {
if (($foo_counter != 0) and ($repeatcells != 0) and !($foo_counter % $repeatcells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo "<td>&nbsp;</td>"; echo '<td>&nbsp;</td>' . "\n";
} }
echo $val; echo $val;
$foo_counter++; $foo_counter++;
} } // end while
echo "</tr>\n"; echo '</tr>' . "\n";
} }
?> ?>
</table> </table>
<br /> <br />
<?php <?php
} // end if (check $displaymode) } // end if (check $disp_direction)
echo "\n"; echo "\n";

View File

@@ -74,11 +74,11 @@ if (isset($btnDrop) || isset($navig)) {
if ($goto == 'sql.php3') { if ($goto == 'sql.php3') {
$goto = 'sql.php3' $goto = 'sql.php3'
. '?lang=' . $lang . '?lang=' . $lang
. '&server=' . $server . '&amp;server=' . $server
. '&db=' . urlencode($db) . '&amp;db=' . urlencode($db)
. '&table=' . urlencode($table) . '&amp;table=' . urlencode($table)
. '&pos=' . $pos . '&amp;pos=' . $pos
. '&sql_query=' . urlencode($sql_query); . '&amp;sql_query=' . urlencode($sql_query);
} }
@@ -95,7 +95,7 @@ if (isset($btnDrop) && $btnDrop == $strNo) {
} }
include('./' . ereg_replace('\.\.*', '.', $goto)); include('./' . ereg_replace('\.\.*', '.', $goto));
} else { } else {
header('Location: ' . $cfgPmaAbsoluteUri . $goto); header('Location: ' . $cfgPmaAbsoluteUri . str_replace('&amp;', '&', $goto));
} }
exit(); exit();
} // end if } // end if
@@ -161,11 +161,18 @@ else {
$reload = 1; $reload = 1;
} }
// Gets the number of rows per page // Gets the number of rows per page
if (!isset($session_max_rows)){ if (!isset($session_max_rows)) {
$session_max_rows = $cfgMaxRows; $session_max_rows = $cfgMaxRows;
} else if ($session_max_rows != 'all') { } else if ($session_max_rows != 'all') {
$cfgMaxRows = $session_max_rows; $cfgMaxRows = $session_max_rows;
} }
// Defines the display mode (horizontal/vertical) and header "frequency"
if (empty($disp_direction)) {
$disp_direction = $cfgDefaultDisplay;
}
if (empty($repeat_cells)) {
$repeat_cells = $cfgRepeatCells;
}
$is_explain = $is_select = $is_count = $is_export = $is_delete = $is_insert = $is_affected = $is_show = $is_maint = FALSE; $is_explain = $is_select = $is_count = $is_export = $is_delete = $is_insert = $is_affected = $is_show = $is_maint = FALSE;
if (eregi('^EXPLAIN[[:space:]]+', $sql_query)) { if (eregi('^EXPLAIN[[:space:]]+', $sql_query)) {
@@ -320,7 +327,7 @@ else {
include('./' . $goto); include('./' . $goto);
} // end if file_exist } // end if file_exist
else { else {
header('Location: ' . $cfgPmaAbsoluteUri . $goto . '&message=' . $message); header('Location: ' . $cfgPmaAbsoluteUri . str_replace('&amp;', '&', $goto) . '&message=' . $message);
} // end else } // end else
exit(); exit();
} // end no rows returned } // end no rows returned
@@ -353,13 +360,23 @@ else {
// Displays "Insert a new row" link if required // Displays "Insert a new row" link if required
if ($disp_mode[6] == '1') { if ($disp_mode[6] == '1') {
$lnk_goto = 'sql.php3'
. '?lang=' . $lang
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)
. '&amp;pos=' . $pos
. '&amp;session_max_rows=' . $session_max_rows
. '&amp;disp_direction=' . $disp_direction
. '&amp;repeat_cells=' . $repeat_cells
. '&amp;sql_query=' . urlencode($sql_query);
$url_query = 'lang=' . $lang $url_query = 'lang=' . $lang
. '&amp;server=' . $server . '&amp;server=' . $server
. '&amp;db=' . urlencode($db) . '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table) . '&amp;table=' . urlencode($table)
. '&amp;pos=' . $pos . '&amp;pos=' . $pos
. '&amp;sql_query=' . urlencode($sql_query) . '&amp;sql_query=' . urlencode($sql_query)
. '&amp;goto=' . urlencode($goto); . '&amp;goto=' . urlencode($lnk_goto);
echo "\n\n"; echo "\n\n";
echo '<!-- Insert a new row -->' . "\n"; echo '<!-- Insert a new row -->' . "\n";
@@ -380,6 +397,9 @@ else {
. '&amp;db=' . urlencode($db) . '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table) . '&amp;table=' . urlencode($table)
. '&amp;pos=' . $pos . '&amp;pos=' . $pos
. '&amp;session_max_rows=' . $session_max_rows
. '&amp;disp_direction=' . $disp_direction
. '&amp;repeat_cells=' . $repeat_cells
. '&amp;sql_query=' . urlencode($sql_query) . '&amp;sql_query=' . urlencode($sql_query)
. '&amp;id_bookmark=1'; . '&amp;id_bookmark=1';
?> ?>

View File

@@ -31,11 +31,11 @@ if (!empty($message)) {
} }
PMA_showMessage($message); PMA_showMessage($message);
if (isset($goto_cpy)) { if (isset($goto_cpy)) {
$goto = $goto_cpy; $goto = $goto_cpy;
unset($goto_cpy); unset($goto_cpy);
} }
if (isset($sql_query_cpy)) { if (isset($sql_query_cpy)) {
$sql_query = $sql_query_cpy; $sql_query = $sql_query_cpy;
unset($sql_query_cpy); unset($sql_query_cpy);
} }
} }
@@ -123,6 +123,9 @@ else
<input type="hidden" name="table" value="<?php echo $table; ?>" /> <input type="hidden" name="table" value="<?php echo $table; ?>" />
<input type="hidden" name="goto" value="<?php echo $goto; ?>" /> <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
<input type="hidden" name="pos" value="<?php echo isset($pos) ? $pos : 0; ?>" /> <input type="hidden" name="pos" value="<?php echo isset($pos) ? $pos : 0; ?>" />
<input type="hidden" name="session_max_rows" value="<?php echo isset($session_max_rows) ? $session_max_rows : ''; ?>" />
<input type="hidden" name="disp_direction" value="<?php echo isset($disp_direction) ? $disp_direction : ''; ?>" />
<input type="hidden" name="repeat_cells" value="<?php echo isset($disp_direction) ? $repeat_cells : ''; ?>" />
<input type="hidden" name="err_url" value="<?php echo urlencode($err_url); ?>" /> <input type="hidden" name="err_url" value="<?php echo urlencode($err_url); ?>" />
<input type="hidden" name="sql_query" value="<?php echo isset($sql_query) ? urlencode($sql_query) : ''; ?>" /> <input type="hidden" name="sql_query" value="<?php echo isset($sql_query) ? urlencode($sql_query) : ''; ?>" />
<?php <?php

View File

@@ -25,15 +25,21 @@ if (isset($after_insert) && $after_insert == 'new_insert') {
. '&goto=' . urlencode($goto) . '&goto=' . urlencode($goto)
. (empty($primary_key) ? '' : '&primary_key=' . $primary_key) . (empty($primary_key) ? '' : '&primary_key=' . $primary_key)
. '&pos=' . $pos . '&pos=' . $pos
. '&session_max_rows=' . $session_max_rows
. '&disp_direction=' . $disp_direction
. '&repeat_cells=' . $repeat_cells
. (empty($sql_query) ? '' : '&sql_query=' . urlencode($sql_query)); . (empty($sql_query) ? '' : '&sql_query=' . urlencode($sql_query));
} else if ($goto == 'sql.php3') { } else if ($goto == 'sql.php3') {
$goto = 'sql.php3?' $goto = 'sql.php3?'
. 'lang=' . $lang . 'lang=' . $lang
. '&server=' . $server . '&server=' . $server
. '&db=' . urlencode($db) . '&db=' . urlencode($db)
. '&table=' . urlencode($table) . '&table=' . urlencode($table)
. '&pos=' . $pos . '&pos=' . $pos
. '&sql_query=' . urlencode($sql_query); . '&session_max_rows=' . $session_max_rows
. '&disp_direction=' . $disp_direction
. '&repeat_cells=' . $repeat_cells
. '&sql_query=' . urlencode($sql_query);
} }
// Defines the url to return in case of failure of the query // Defines the url to return in case of failure of the query
if (isset($url_err)) { if (isset($url_err)) {