* 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$
$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>
* merge and adapt Vertical/horizontal browsing patch #492470
thanks to Garvin Hicking (hicking at faktor-e.de)
- config.inc.php3
- libraries/display_tbl.lib.php3
- lang/*
- Documentation.html
thanks to Garvin Hicking (hicking at faktor-e.de)
- config.inc.php3
- libraries/display_tbl.lib.php3
- lang/*
- Documentation.html
2001-12-15 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* libraries/common.lib.php3:

View File

@@ -218,10 +218,10 @@
Have a look at
<a class="navigation" href="#config">Configuration section</a> for an
explanation of all values.</li>
<li> It is recommended that you protect the directory in which
you installed phpMyAdmin (unless it's on a closed intranet, or you
wish to use http or cookie authentication), for example with
HTTP-AUTH (in a <i>.htaccess</i> file). See the
<li> It is recommended that you protect the directory in which you
installed phpMyAdmin (unless it's on a closed intranet, or you wish to
use http or cookie authentication), for example with HTTP-AUTH (in a
<i>.htaccess</i> file). See the
<a class="navigation" href="#faq">FAQ section</a> for additional
information.</li>
<li> Open the file
@@ -241,64 +241,67 @@
<p><b>Using authentication modes:</b></p>
<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
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
not need to be set in the phpMyAdmin configuration file. (except for the
&quot;standard user&quot; -see the Configuration section-).<br />
<li>Http and cookie authentication modes are secure: the MySQL password
does not need to be set in the phpMyAdmin configuration file. (except
for the &quot;standard user&quot; -see the Configuration section-).
<br />
In cookie mode, we send the password in a temporary cookie, so most
browsers should not store the password in their cookie file.
<br /><br /></li>
<li> For 'http' and 'cookie' modes, phpMyAdmin needs a stduser that
has <b>only</b> the <tt>SELECT</tt>
privilege on the <i>mysql.user (all columns except
&quot;Password&quot;)</i>, <i>mysql.db (all columns)</i> &amp;
<i>mysql.tables_priv (all columns except &quot;Grantor&quot; &amp;
&quot;Timestamp&quot;) </i>tables.<br />
You must specify the details for the stduser in the <i>config.inc.php3</i>
file under the <tt>$cfgServers[n]['stduser']</tt> &amp;
<tt>$cfgServers[n]['stdpass']</tt> settings.<br />
To create the control account (<tt>&lt;stduser&gt;</tt> and
<tt>&lt;stdpass&gt;</tt> have to be replaced by your own values, of course):<br />
<table border="0">
<tr>
<td>&nbsp;&nbsp;&nbsp;</td>
<td>
<tt>GRANT USAGE ON mysql.* TO '&lt;stduser&gt;'@'localhost' IDENTIFIED BY '&lt;stdpass&gt;';</tt><br />
<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 />
<tt>GRANT SELECT ON mysql.db TO '&lt;stduser&gt;'@'localhost';</tt><br />
<tt>GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) ON mysql.tables_priv TO '&lt;stduser&gt;'@'localhost';</tt>
</td>
</tr>
<tr>
<td colspan="2">
... and if you want to use the bookmark feature:
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;</td>
<td>
<tt>GRANT SELECT, INSERT, DELETE ON &lt;bookmark_db&gt;.&lt;bookmark_table&gt; TO '&lt;stduser&gt;'@'localhost';</tt>
</td>
</tr>
</table>
<br />
</li>
<li>
Then each of the <i>true</i> users should be granted of a set of
privileges on a set of perticular databases but shouldn't have any global
privileges. For example, to grant the user <i>real_user</i> with all
privileges on the database <i>user_base</i>:<br />
&nbsp;&nbsp;&nbsp;<tt>GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password';</tt>
<br />
What the user may now do is controlled entirely by the MySQL user management
system.<br />
With http or cookie auth mode, you don't need to fill the user/password
fields inside the <tt>$cfgServers</tt> array.<br />
</li>
<li>
For 'http' and 'cookie' modes, phpMyAdmin needs a stduser that has
<b>only</b> the <tt>SELECT</tt> privilege on the <i>mysql.user (all
columns except &quot;Password&quot;)</i>, <i>mysql.db (all columns)</i>
&amp; <i>mysql.tables_priv (all columns except &quot;Grantor&quot;
&amp; &quot;Timestamp&quot;) </i>tables.<br />
You must specify the details for the stduser in the
<i>config.inc.php3</i> file under the
<tt>$cfgServers[n]['stduser']</tt> &amp;
<tt>$cfgServers[n]['stdpass']</tt> settings.<br />
To create the control account (<tt>&lt;stduser&gt;</tt> and
<tt>&lt;stdpass&gt;</tt> have to be replaced by your own values, of
course):<br />
<table border="0">
<tr>
<td>&nbsp;&nbsp;&nbsp;</td>
<td>
<tt>GRANT USAGE ON mysql.* TO '&lt;stduser&gt;'@'localhost' IDENTIFIED BY '&lt;stdpass&gt;';</tt><br />
<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 />
<tt>GRANT SELECT ON mysql.db TO '&lt;stduser&gt;'@'localhost';</tt><br />
<tt>GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) ON mysql.tables_priv TO '&lt;stduser&gt;'@'localhost';</tt>
</td>
</tr>
<tr>
<td colspan="2">
... and if you want to use the bookmark feature:
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;</td>
<td>
<tt>GRANT SELECT, INSERT, DELETE ON &lt;bookmark_db&gt;.&lt;bookmark_table&gt; TO '&lt;stduser&gt;'@'localhost';</tt>
</td>
</tr>
</table>
<br />
</li>
<li>
Then each of the <i>true</i> users should be granted of a set of
privileges on a set of perticular databases but shouldn't have any
global privileges. For example, to grant the user <i>real_user</i> with
all privileges on the database <i>user_base</i>:<br />
&nbsp;&nbsp;&nbsp;<tt>GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password';</tt>
<br />
What the user may now do is controlled entirely by the MySQL user
management system.<br />
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>
<p><b>'http' authentication mode:</b></p>
@@ -308,6 +311,7 @@
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>
</ul>
<p><b>'cookie' authentication mode:</b></p>
<ul>
<li>You can use this method as a replacement for the http
@@ -325,8 +329,8 @@
fields.<br />
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 />
In the ISP FAQ section, there is an entry explaining how to
protect your configuration file.<br /></li>
In the ISP FAQ section, there is an entry explaining how to protect
your configuration file.<br /></li>
</ul>
@@ -438,8 +442,9 @@
<ul>
<li>
'config' authentication (<tt>$auth_type&nbsp;=&nbsp;'config'</tt>)
is the plain old way: username and password are stored in
'config' authentication
(<tt>$auth_type&nbsp;=&nbsp;'config'</tt>) is the plain old
way: username and password are stored in
<i>config.inc.php3</i>.
</li>
<li>
@@ -453,7 +458,7 @@
<li>
'http' authentication (was called 'advanced' in older versions)
(<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>
</ul><br />
@@ -724,21 +729,6 @@
<br /><br />
</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>
<b>$cfgLeftBgColor </b>string [HTML color]<br />
<b>$cfgRightBgColor </b>string [HTML color]
@@ -811,6 +801,21 @@
Defines the place where modify and delete links would be put when
tables contents are displayed (you may have them displayed both at the
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 />
</dd>

View File

@@ -173,10 +173,13 @@ $cfgTextareaCols = 40; // textarea size (columns) in edit mode
$cfgTextareaRows = 7; // textarea size (rows) in edit mode
$cfgLimitChars = 50; // max field data length in browse mode
$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
$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)
/**
* MySQL settings
*/

View File

@@ -181,6 +181,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
* without any programmatically appended "LIMIT" clause
* @global integer the current position in results
* @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
* text type fields or not
*
@@ -192,7 +194,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
{
global $lang, $server, $db, $table;
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;
?>
@@ -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="pos" value="0" />
<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="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<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="pos" value="<?php echo $pos_prev; ?>" />
<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="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<input type="submit" name="navig" value="<?php echo $caption2; ?>"<?php echo $title2; ?> />
@@ -250,7 +257,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<td>
&nbsp;&nbsp;&nbsp;
</td>
<td>
<td align="center">
<form action="sql.php3" method="post"
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; ?>" />
@@ -263,33 +270,19 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<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()" />
<?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()"/>
<br />
<?php echo sprintf($GLOBALS['strRowsModeOptions'],
// first parameter
"<select name=\"displaymode\">
<option value=\"horizontal\"" .
(($displaymode == "horizontal"
or $GLOBALS['cfgDefaultDisplay'] == "horizontal") ?
" selected=\"selected\" ": "") . ">" .
$GLOBALS['strRowsModeHorizontal'] . "</option>" .
"<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) .
"\" />"
);
?>
<input type="text" name="pos" size="3" value="<?php echo (($pos_next >= $unlim_num_rows) ? 0 : $pos_next); ?>" onfocus="this.select()" />
<br />
<?php
// Display mode (horizontal/vertical and repeat headers)
$param1 = ' <select name="disp_direction">' . "\n"
. ' <option value="horizontal"' . (($disp_direction == 'horizontal') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeHorizontal'] . '</option>' . "\n"
. ' <option value="vertical"' . (($disp_direction == 'vertical') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeVertical'] . '</option>' . "\n"
. ' </select>' . "\n"
. ' ';
$param2 = ' <input type="text" size="3" name="repeat_cells" value="' . $repeat_cells . '" />' . "\n"
. ' ';
echo ' ' . sprintf($GLOBALS['strRowsModeOptions'], "\n" . $param1, "\n" . $param2) . "\n";
?>
</form>
</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="pos" value="<?php echo $pos_next; ?>" />
<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="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<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="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="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="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<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="pos" value="0" />
<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="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<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 current position in results
* @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
* text type fields or not
*
@@ -409,19 +411,19 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
global $lang, $server, $db, $table;
global $goto;
global $sql_query, $num_rows, $pos, $session_max_rows;
global $verticaldisplay, $disp_direction, $repeat_cells;
global $dontlimitchars;
global $verticaldisplay, $displaymode, $repeatcells;
if (!($displaymode) or ($displaymode=="horizontal")) {
?>
if ($disp_direction == 'horizontal') {
?>
<!-- Results table headers -->
<tr>
<?php
echo "\n";
}
<?php
}
echo "\n";
$verticaldisplay["emptypre"] = 0;
$verticaldisplay["emptyafter"] = 0;
$verticaldisplay['emptypre'] = 0;
$verticaldisplay['emptyafter'] = 0;
// 1. Displays the full/partial text button (part 1)...
$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;session_max_rows=' . $session_max_rows
. '&amp;pos=' . $pos
. '&amp;disp_direction=' . $disp_direction
. '&amp;repeat_cells=' . $repeat_cells
. '&amp;goto=' . $goto
. '&amp;dontlimitchars=' . (($dontlimitchars) ? 0 : 1);
// ... before the result table
if (($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')
&& $is_display['text_btn'] == '1') {
$verticaldisplay["emptypre"] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if (!($displaymode) or ($displaymode=="horizontal")) {
?>
$verticaldisplay['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if ($disp_direction == 'horizontal') {
?>
<td colspan="<?php echo $fields_cnt; ?>" align="center">
<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>
@@ -452,33 +456,33 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
</tr>
<tr>
<?php
}
<?php
}
}
// ... at the left column of the result table header if possible
// and required
else if ($GLOBALS['cfgModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') {
echo "\n";
$verticaldisplay["emptypre"] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if (!($displaymode) or ($displaymode=="horizontal")) {
?>
$verticaldisplay['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if ($disp_direction == 'horizontal') {
?>
<td<?php echo $colspan; ?>" align="center">
<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>
</td>
<?php
}
<?php
}
}
// ... else if no button, displays empty(ies) col(s) if required
else if ($GLOBALS['cfgModifyDeleteAtLeft']
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) {
echo "\n";
$verticaldisplay["emptypre"] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if (!($displaymode) or ($displaymode=="horizontal")) {
?>
$verticaldisplay['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if ($disp_direction == 'horizontal') {
?>
<td<?php echo $colspan; ?>></td>
<?php
}
<?php
}
}
echo "\n";
@@ -556,39 +560,39 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
. '&amp;table=' . urlencode($table)
. '&amp;pos=' . $pos
. '&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);
// 2.1.5 Displays the sorting url
if (!($displaymode) or ($displaymode=="horizontal")) {
?>
// 2.1.5 Displays the sorting url
if ($disp_direction == 'horizontal') {
?>
<th>
<a href="sql.php3?<?php echo $url_query; ?>">
<?php echo htmlspecialchars($fields_meta[$i]->name); ?></a><?php echo $order_img . "\n"; ?>
</th>
<?php
}
$verticaldisplay["desc"][] = ' <th>' . "\n"
. ' <a href="sql.php3?' . $url_query . '">' . "\n"
. ' ' . htmlspecialchars($fields_meta[$i]->name) . '</a>' . $order_img . "\n"
. ' </th>';
} // end if (2.1)
<?php
}
$verticaldisplay['desc'][] = ' <th>' . "\n"
. ' <a href="sql.php3?' . $url_query . '">' . "\n"
. ' ' . htmlspecialchars($fields_meta[$i]->name) . '</a>' . $order_img . "\n"
. ' </th>' . "\n";
} // end if (2.1)
// 2.2 Results can't be sorted
else {
if (!($displaymode) or ($displaymode=="horizontal")) {
echo "\n";
?>
echo "\n";
if ($disp_direction == 'horizontal') {
?>
<th>
<?php echo htmlspecialchars($fields_meta[$i]->name) . "\n"; ?>
</th>
<?php
}
$verticaldisplay["desc"][] = ' <th>' . "\n"
. ' ' . htmlspecialchars($fields_meta[$i]->name) . "\n"
. ' </th>';
<?php
}
$verticaldisplay['desc'][] = ' <th>' . "\n"
. ' ' . htmlspecialchars($fields_meta[$i]->name) . "\n"
. ' </th>';
} // end else (2.2)
echo "\n";
} // 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['text_btn'] == '1') {
echo "\n";
$verticaldisplay["emptyafter"] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if (!($displaymode) or ($displaymode=="horizontal")) {
?>
$verticaldisplay['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if ($disp_direction == 'horizontal') {
?>
<td<?php echo $colspan; ?>" align="center">
<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>
</td>
<?php
}
<?php
}
}
// ... else if no button, displays empty cols if required
else if ($GLOBALS['cfgModifyDeleteAtRight']
&& ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')) {
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 (!($displaymode) or ($displaymode=="horizontal")) {
?>
if ($disp_direction == 'horizontal') {
?>
</tr>
<?php
echo "\n";
}
<?php
}
echo "\n";
return true;
return TRUE;
} // 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 array the list of fields properties
* @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
* text type fields or not
*
@@ -662,19 +668,19 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
{
global $lang, $server, $db, $table;
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 $verticaldisplay, $displaymode, $repeatcells;
?>
<!-- Results table body -->
<?php
echo "\n";
$foo = 0;
$verticaldisplay["edit"] = array();
$verticaldisplay["delete"] = array();
$verticaldisplay["data"] = array();
$foo = 0;
$verticaldisplay['edit'] = array();
$verticaldisplay['delete'] = array();
$verticaldisplay['data'] = array();
// Correction uva 19991216 in the while below
// 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)) {
if (($foo != 0) and ($repeatcells != 0) and !($foo % $repeatcells) and $displaymode == "horizontal") {
echo "<tr>";
// lem9: "vertical display" mode stuff
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++) {
echo "<td>&nbsp;</td>";
}
for ($foo_i = 0; $foo_i < $verticaldisplay['emptypre']; $foo_i++) {
echo ' <td>&nbsp;</td>' . "\n";
}
reset($verticaldisplay["desc"]);
while(list($key, $val) = each($verticaldisplay["desc"])) {
echo $val;
}
reset($verticaldisplay["desc"]);
while (list($key, $val) = each($verticaldisplay['desc'])) {
echo ' ' . $val;
}
for ($foo_i=0;$foo_i<$verticaldisplay["emptyafter"];$foo_i++) {
echo "<td>&nbsp;</td>";
}
for ($foo_i = 0; $foo_i < $verticaldisplay['emptyafter']; $foo_i++) {
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")) {
// loic1: pointer code part
$on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
? ''
: ' onmouseover="setPointer(this, \'' .
$GLOBALS['cfgBrowsePointerColor'] . '\')" onmouseout="setPointer(this, \'' .
$bgcolor . '\')"';
?>
if ($disp_direction == 'horizontal') {
// loic1: pointer code part
$on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
? ''
: ' onmouseover="setPointer(this, \'' . $GLOBALS['cfgBrowsePointerColor'] . '\')" onmouseout="setPointer(this, \'' . $bgcolor . '\')"';
?>
<tr<?php echo $on_mouse; ?>>
<?php
echo "\n";
}
<?php
}
echo "\n";
// 1. Prepares the row (gets primary keys to use)
if ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') {
@@ -772,7 +778,9 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)
. '&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;
// 1.2.1 Modify link(s)
@@ -780,21 +788,21 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
if (!empty($goto)
&& empty($GLOBALS['QUERY_STRING'])
&& (empty($GLOBALS['HTTP_SERVER_VARS']) || empty($GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING']))) {
// void
$lnk_goto = $goto;
} else {
$goto = 'sql.php3';
$lnk_goto = 'sql.php3';
}
$edit_url = 'tbl_change.php3'
. '?' . $url_query
. '&amp;primary_key=' . $uva_condition
. '&amp;sql_query=' . urlencode($sql_query)
. '&amp;goto=' . urlencode($goto);
. '&amp;goto=' . urlencode($lnk_goto);
$edit_str = $GLOBALS['strEdit'];
} // end if (1.2.1)
// 1.2.2 Delete/Kill link(s)
if ($is_display['del_lnk'] == 'dr') { // delete row case
$goto = 'sql.php3'
$lnk_goto = 'sql.php3'
. '?' . str_replace('&amp;', '&', $url_query)
. '&sql_query=' . urlencode($sql_query)
. '&zero_rows=' . urlencode(htmlspecialchars($GLOBALS['strDeleted']))
@@ -803,12 +811,12 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
. '?' . $url_query
. '&amp;sql_query=' . urlencode('DELETE FROM ' . PMA_backquote($table) . ' WHERE') . $uva_condition . urlencode(' LIMIT 1')
. '&amp;zero_rows=' . urlencode(htmlspecialchars($GLOBALS['strDeleted']))
. '&amp;goto=' . urlencode($goto);
. '&amp;goto=' . urlencode($lnk_goto);
$js_conf = 'DELETE FROM ' . PMA_jsFormat($table)
. ' WHERE ' . trim(PMA_jsFormat(urldecode($uva_condition), FALSE)) . ' LIMIT 1';
$del_str = $GLOBALS['strDelete'];
} else if ($is_display['del_lnk'] == 'kp') { // kill process case
$goto = 'sql.php3'
$lnk_goto = 'sql.php3'
. '?' . str_replace('&amp;', '&', $url_query)
. '&sql_query=' . urlencode($sql_query)
. '&goto=main.php3';
@@ -817,13 +825,14 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
. '&amp;server=' . $server
. '&amp;db=mysql'
. '&amp;sql_query=' . urlencode('KILL ' . $row['Id'])
. '&amp;goto=' . urlencode($goto);
. '&amp;goto=' . urlencode($lnk_goto);
$js_conf = 'KILL ' . $row['Id'];
$del_str = $GLOBALS['strKill'];
} // end if (1.2.2)
// 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)) {
?>
<td bgcolor="<?php echo $bgcolor; ?>">
@@ -831,7 +840,7 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
<?php echo $edit_str; ?></a>
</td>
<?php
}
}
if (!empty($del_url)) {
echo "\n";
?>
@@ -843,7 +852,7 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
<?php
}
} // end if (1.3)
if (!($displaymode) or ($displaymode=="horizontal")) echo "\n";
echo "\n";
} // end if (1)
// 2. Displays the rows' values
@@ -852,11 +861,11 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
if ($primary->numeric == 1) {
if (!isset($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] != '') {
$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 {
$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)) {
// loic1 : mysql_fetch_fields returns BLOB in place of TEXT
@@ -865,11 +874,11 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
// fields.
$field_flags = mysql_field_flags($dt_result, $i);
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 {
if (!isset($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] != '') {
if (strlen($row[$primary->name]) > $GLOBALS['cfgLimitChars'] && ($dontlimitchars != 1)) {
$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] = 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]);
$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 {
$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 {
if (!isset($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] != '') {
// loic1: Cut text/blob fields even if $cfgShowBlob is true
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] = 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 {
$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
if (!($displaymode) or ($displaymode=="horizontal")) {
echo $verticaldisplay["data"][$foo][$i];
}
// lem9: output stored cell
if ($disp_direction == 'horizontal') {
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)
// 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)) {
?>
<td bgcolor="<?php echo $bgcolor; ?>">
@@ -947,30 +961,38 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
}
} // end if (3)
if (!($displaymode) or ($displaymode=="horizontal")) {
?>
if ($disp_direction == 'horizontal') {
echo "\n";
?>
</tr>
<?php
}
<?php
} // end if
// 4. Gather links of del_urls and edit_urls in an array for later output
$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";
// 4. Gather links of del_urls and edit_urls in an array for later
// output
if (!isset($verticaldisplay['edit'][$foo])) {
$verticaldisplay['edit'][$foo] = '';
$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] .= ' <a href="' . $del_url . '"';
if (isset($js_conf)) $verticaldisplay["delete"][$foo] .= 'onclick="return confirmLink(this, \'' . $js_conf . '\')"';
$verticaldisplay["delete"][$foo] .= '>' . "\n";
$verticaldisplay["delete"][$foo] .= ' ' . $del_str . '</a>' . "\n";
$verticaldisplay["delete"][$foo] .= ' </td>' . "\n";
$verticaldisplay['delete'][$foo] .= ' <td bgcolor="' . $bgcolor . '">' . "\n";
$verticaldisplay['delete'][$foo] .= ' <a href="' . $del_url . '"';
if (isset($js_conf)) {
$verticaldisplay['delete'][$foo] .= 'onclick="return confirmLink(this, \'' . $js_conf . '\')"';
}
$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++;
} // end while
return true;
return TRUE;
} // end of the 'PMA_displayTableBody()' function
@@ -996,6 +1018,9 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
* displayed
* @global array the list of fields properties
* @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
* text type fields or not
*
@@ -1010,8 +1035,8 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
global $lang, $server, $db, $table;
global $goto;
global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt;
global $verticaldisplay, $disp_direction, $repeat_cells;
global $dontlimitchars;
global $verticaldisplay, $displaymode, $repeatcells;
// 1. ----- Prepares the work -----
@@ -1078,119 +1103,117 @@ $on_mouse = ($GLOBALS['cfgBrowsePointerColor'] == '')
}
// 3. ----- Displays the results table -----
// horizontal output?
if (!($displaymode) or ($displaymode == "horizontal"))
{
?>
// lem9: horizontal output?
if ($disp_direction == 'horizontal') {
?>
<!-- Results table -->
<table border="<?php echo $GLOBALS['cfgBorder']; ?>" cellpadding="5">
<?php
echo "\n";
PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $encoded_sql_query);
PMA_displayTableBody($dt_result, $is_display);
?>
<?php
echo "\n";
PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $encoded_sql_query);
PMA_displayTableBody($dt_result, $is_display);
?>
</table>
<br />
<?php
}
else
{
?>
<?php
}
else {
echo "\n";
?>
<!-- Results table -->
<table border="<?php echo $GLOBALS['cfgBorder']; ?>" cellpadding="5">
<?php
echo "\n";
PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $encoded_sql_query);
PMA_displayTableBody($dt_result, $is_display);
reset($verticaldisplay);
<?php
echo "\n";
PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $encoded_sql_query);
PMA_displayTableBody($dt_result, $is_display);
reset($verticaldisplay);
if ($GLOBALS['cfgModifyDeleteAtTop'] AND is_array($verticaldisplay["edit"])) {
echo "<tr>\n";
echo "<td>&nbsp;</td>";
reset($verticaldisplay["edit"]);
$foo_counter=0;
while(list($key, $val) = each($verticaldisplay["edit"])) {
if (($foo_counter != 0) and ($repeatcells != 0) and !($foo_counter % $repeatcells)) {
echo "<td>&nbsp;</td>";
}
if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($verticaldisplay['edit'])) {
echo '<tr>' . "\n";
echo ' <td>&nbsp;</td>' . "\n";
reset($verticaldisplay['edit']);
$foo_counter = 0;
while (list($key, $val) = each($verticaldisplay['edit'])) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo ' <td>&nbsp;</td>' . "\n";
}
echo $val;
$foo_counter++;
}
echo "</tr>\n";
}
echo $val;
$foo_counter++;
} // end while
echo '</tr>' . "\n";
} // end if
if ($GLOBALS['cfgModifyDeleteAtTop'] AND is_array($verticaldisplay["delete"])) {
echo "<tr>\n";
echo "<td>&nbsp;</td>";
reset($verticaldisplay["delete"]);
$foo_counter=0;
while(list($key, $val) = each($verticaldisplay["delete"])) {
if (($foo_counter != 0) and ($repeatcells != 0) and !($foo_counter % $repeatcells)) {
echo "<td>&nbsp;</td>";
}
if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($verticaldisplay['delete'])) {
echo '<tr>' . "\n";
echo '<td>&nbsp;</td>' . "\n";
reset($verticaldisplay['delete']);
$foo_counter = 0;
while (list($key, $val) = each($verticaldisplay['delete'])) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo '<td>&nbsp;</td>' . "\n";
}
echo $val;
$foo_counter++;
}
echo "</tr>\n";
}
echo $val;
$foo_counter++;
} // end while
echo '</tr>' . "\n";
} // end if
reset($verticaldisplay["desc"]);
while(list($key, $val) = each($verticaldisplay["desc"])) {
echo "<tr>\n";
echo $val;
reset($verticaldisplay['desc']);
while (list($key, $val) = each($verticaldisplay['desc'])) {
echo '<tr>' . "\n";
echo $val;
$foo_counter = 0;
while(list($subkey, $subval) = each($verticaldisplay["rowdata"][$key])) {
if (($foo_counter != 0) and ($repeatcells != 0) and !($foo_counter % $repeatcells)) {
echo $val;
}
$foo_counter = 0;
while (list($subkey, $subval) = each($verticaldisplay['rowdata'][$key])) {
if (($foo_counter != 0) && ($repeat_cells != 0) and !($foo_counter % $repeat_cells)) {
echo $val;
}
echo $subval;
$foo_counter++;
}
echo $subval;
$foo_counter++;
} // end while
echo "</tr>\n";
}
echo '</tr>' . "\n";
} // end while
if ($GLOBALS['cfgModifyDeleteAtBottom'] AND is_array($verticaldisplay["edit"])) {
echo "<tr>\n";
echo "<td>&nbsp;</td>";
reset($verticaldisplay["edit"]);
$foo_counter=0;
while(list($key, $val) = each($verticaldisplay["edit"])) {
if (($foo_counter != 0) and ($repeatcells != 0) and !($foo_counter % $repeatcells)) {
echo "<td>&nbsp;</td>";
}
if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($verticaldisplay['edit'])) {
echo '<tr>' . "\n";
echo ' <td>&nbsp;</td>' . "\n";
reset($verticaldisplay['edit']);
$foo_counter = 0;
while (list($key, $val) = each($verticaldisplay['edit'])) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo '<td>&nbsp;</td>' . "\n";
}
echo $val;
$foo_counter++;
}
echo "</tr>\n";
}
echo $val;
$foo_counter++;
} // end while
echo '</tr>' . "\n";
} // end if
if ($GLOBALS['cfgModifyDeleteAtBottom'] AND is_array($verticaldisplay["delete"])) {
echo "<tr>\n";
echo "<td>&nbsp;</td>";
reset($verticaldisplay["delete"]);
$foo_counter=0;
while(list($key, $val) = each($verticaldisplay["delete"])) {
if (($foo_counter != 0) and ($repeatcells != 0) and !($foo_counter % $repeatcells)) {
echo "<td>&nbsp;</td>";
}
if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($verticaldisplay['delete'])) {
echo '<tr>' . "\n";
echo '<td>&nbsp;</td>' . "\n";
reset($verticaldisplay['delete']);
$foo_counter = 0;
while (list($key, $val) = each($verticaldisplay['delete'])) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo '<td>&nbsp;</td>' . "\n";
}
echo $val;
$foo_counter++;
}
echo "</tr>\n";
}
?>
echo $val;
$foo_counter++;
} // end while
echo '</tr>' . "\n";
}
?>
</table>
<br />
<?php
} // end if (check $displaymode)
<?php
} // end if (check $disp_direction)
echo "\n";

View File

@@ -74,11 +74,11 @@ if (isset($btnDrop) || isset($navig)) {
if ($goto == 'sql.php3') {
$goto = 'sql.php3'
. '?lang=' . $lang
. '&server=' . $server
. '&db=' . urlencode($db)
. '&table=' . urlencode($table)
. '&pos=' . $pos
. '&sql_query=' . urlencode($sql_query);
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)
. '&amp;pos=' . $pos
. '&amp;sql_query=' . urlencode($sql_query);
}
@@ -95,7 +95,7 @@ if (isset($btnDrop) && $btnDrop == $strNo) {
}
include('./' . ereg_replace('\.\.*', '.', $goto));
} else {
header('Location: ' . $cfgPmaAbsoluteUri . $goto);
header('Location: ' . $cfgPmaAbsoluteUri . str_replace('&amp;', '&', $goto));
}
exit();
} // end if
@@ -161,11 +161,18 @@ else {
$reload = 1;
}
// Gets the number of rows per page
if (!isset($session_max_rows)){
if (!isset($session_max_rows)) {
$session_max_rows = $cfgMaxRows;
} else if ($session_max_rows != 'all') {
$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;
if (eregi('^EXPLAIN[[:space:]]+', $sql_query)) {
@@ -320,7 +327,7 @@ else {
include('./' . $goto);
} // end if file_exist
else {
header('Location: ' . $cfgPmaAbsoluteUri . $goto . '&message=' . $message);
header('Location: ' . $cfgPmaAbsoluteUri . str_replace('&amp;', '&', $goto) . '&message=' . $message);
} // end else
exit();
} // end no rows returned
@@ -353,13 +360,23 @@ else {
// Displays "Insert a new row" link if required
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
. '&amp;server=' . $server
. '&amp;db=' . urlencode($db)
. '&amp;table=' . urlencode($table)
. '&amp;pos=' . $pos
. '&amp;sql_query=' . urlencode($sql_query)
. '&amp;goto=' . urlencode($goto);
. '&amp;goto=' . urlencode($lnk_goto);
echo "\n\n";
echo '<!-- Insert a new row -->' . "\n";
@@ -380,6 +397,9 @@ else {
. '&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)
. '&amp;id_bookmark=1';
?>

View File

@@ -31,11 +31,11 @@ if (!empty($message)) {
}
PMA_showMessage($message);
if (isset($goto_cpy)) {
$goto = $goto_cpy;
$goto = $goto_cpy;
unset($goto_cpy);
}
if (isset($sql_query_cpy)) {
$sql_query = $sql_query_cpy;
$sql_query = $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="goto" value="<?php echo $goto; ?>" />
<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="sql_query" value="<?php echo isset($sql_query) ? urlencode($sql_query) : ''; ?>" />
<?php

View File

@@ -25,15 +25,21 @@ if (isset($after_insert) && $after_insert == 'new_insert') {
. '&goto=' . urlencode($goto)
. (empty($primary_key) ? '' : '&primary_key=' . $primary_key)
. '&pos=' . $pos
. '&session_max_rows=' . $session_max_rows
. '&disp_direction=' . $disp_direction
. '&repeat_cells=' . $repeat_cells
. (empty($sql_query) ? '' : '&sql_query=' . urlencode($sql_query));
} else if ($goto == 'sql.php3') {
$goto = 'sql.php3?'
. 'lang=' . $lang
. '&server=' . $server
. '&db=' . urlencode($db)
. '&table=' . urlencode($table)
. '&pos=' . $pos
. '&sql_query=' . urlencode($sql_query);
$goto = 'sql.php3?'
. 'lang=' . $lang
. '&server=' . $server
. '&db=' . urlencode($db)
. '&table=' . urlencode($table)
. '&pos=' . $pos
. '&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
if (isset($url_err)) {