The branch, master has been updated via 78b6f3d6bade0c066f7a4916932c795b0eeaf471 (commit) via d5f18d4e7f12fa656423b00594315e44ec1d82f7 (commit) via 860250f02026360caf2291b27c8b51a0ca7e3cb2 (commit) from 604c57631365736bdc8378b27f06d84c1855e5b6 (commit)
- Log ----------------------------------------------------------------- commit 78b6f3d6bade0c066f7a4916932c795b0eeaf471 Author: Michal Čihař mcihar@novell.com Date: Thu Jun 2 11:43:12 2011 +0200
Mark directories as such in .gitignore
commit d5f18d4e7f12fa656423b00594315e44ec1d82f7 Merge: 604c57631365736bdc8378b27f06d84c1855e5b6 860250f02026360caf2291b27c8b51a0ca7e3cb2 Author: Michal Čihař mcihar@novell.com Date: Thu Jun 2 11:41:31 2011 +0200
Merge branch 'integration'
Conflicts: libraries/config/setup.forms.php libraries/config/user_preferences.forms.php
commit 860250f02026360caf2291b27c8b51a0ca7e3cb2 Author: Rouslan Placella rouslan@placella.com Date: Fri May 20 17:17:52 2011 +0100
Fix bug #3302961 - Row check boxes missing when table row links are disabled
-----------------------------------------------------------------------
Summary of changes: .gitignore | 14 +++--- Documentation.html | 10 ++-- js/sql.js | 2 +- libraries/config.default.php | 18 ++---- libraries/config.values.php | 1 + libraries/config/messages.inc.php | 5 +- libraries/config/setup.forms.php | 3 +- libraries/config/user_preferences.forms.php | 3 +- libraries/display_tbl.lib.php | 77 ++++++++++++++++++--------- 9 files changed, 75 insertions(+), 58 deletions(-)
diff --git a/.gitignore b/.gitignore index b492910..dda2e0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,14 @@ # Directory for creating releases -release +/release/ # Configuration files config.inc.php config.header.inc.php config.footer.inc.php # Upload/save dirs -upload -save +/upload/ +/save/ # For setup script -config +/config/ # ctags tags # Editor files @@ -22,12 +22,12 @@ phpmyadmin.wpj .idea *.sw[op] # Locales -locale +/locale/ # Backups *~ # Javascript sources -sources +/sources/ # API documentation -apidoc +/apidoc/ # Demo server revision-info.php diff --git a/Documentation.html b/Documentation.html index 2ff0881..ed6a5ca 100644 --- a/Documentation.html +++ b/Documentation.html @@ -1934,14 +1934,12 @@ $cfg['TrustedProxies'] = <dd>Maximum number of characters shown in any non-numeric field on browse view. Can be turned off by a toggle button on the browse page.</dd>
- <dt><span id="cfg_ModifyDeleteAtLeft">$cfg['ModifyDeleteAtLeft'] </span>boolean - <span id="cfg_ModifyDeleteAtRight">$cfg['ModifyDeleteAtRight'] </span>boolean + <dt><span id="cfg_RowActionLinks">$cfg['RowActionLinks'] </span>string </dt> <dd>Defines the place where table row links (Edit, Inline edit, Copy, - Delete) would be put when - tables contents are displayed (you may have them displayed both at the - left and at the right). - "Left" and "right" are parsed as "top" + Delete) would be put when tables contents are displayed (you may + have them displayed at the left side, right side, both sides or nowhere). + "left" and "right" are parsed as "top" and "bottom" with vertical display mode.</dd>
<dt id="cfg_DefaultDisplay">$cfg['DefaultDisplay'] string</dt> diff --git a/js/sql.js b/js/sql.js index 32a5bba..b334b5f 100644 --- a/js/sql.js +++ b/js/sql.js @@ -66,7 +66,7 @@ function appendInlineAnchor() {
if (disp_mode == 'vertical') { // there can be one or two tr containing this class, depending - // on the ModifyDeleteAtLeft and ModifyDeleteAtRight cfg parameters + // on the RowActionLinks cfg parameter $('#table_results tr') .find('.edit_row_anchor') .removeClass('edit_row_anchor') diff --git a/libraries/config.default.php b/libraries/config.default.php index aa883d2..c804dcc 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -2249,20 +2249,14 @@ $cfg['CharTextareaRows'] = 2; $cfg['LimitChars'] = 50;
/** - * show edit/delete links on left side of browse - * (or at the top with vertical browse) + * Where to show the edit/inline_edit/delete links in browse mode + * Possible values are 'left', 'right', 'both' and 'none'; + * which will be interpreted as 'top', 'bottom', 'both' and 'none' + * respectively for vertical display mode * - * @global boolean $cfg['ModifyDeleteAtLeft'] + * @global string $cfg['RowActionLinks'] */ -$cfg['ModifyDeleteAtLeft'] = true; - -/** - * show edit/delete links on right side of browse - * (or at the bottom with vertical browse) - * - * @global boolean $cfg['ModifyDeleteAtRight'] - */ -$cfg['ModifyDeleteAtRight'] = false; +$cfg['RowActionLinks'] = 'left';
/** * default display direction (horizontal|vertical|horizontalflipped) diff --git a/libraries/config.values.php b/libraries/config.values.php index d884e59..0e72064 100644 --- a/libraries/config.values.php +++ b/libraries/config.values.php @@ -44,6 +44,7 @@ $cfg_db['LeftFrameDBSeparator'] = 'short_string'; $cfg_db['LeftFrameTableSeparator'] = 'short_string'; $cfg_db['NavigationBarIconic'] = array(true => __('Yes'), false => __('No'), 'both' => __('Both')); $cfg_db['Order'] = array('ASC', 'DESC', 'SMART'); +$cfg_db['RowActionLinks'] = array('none' => __('Nowhere'), 'left' => __('Left'), 'right' => __('Right'), 'both' => __('Both')); $cfg_db['ProtectBinary'] = array(false, 'blob', 'all'); $cfg_db['DefaultDisplay'] = array('horizontal', 'vertical', 'horizontalflipped'); $cfg_db['CharEditing'] = array('input', 'textarea'); diff --git a/libraries/config/messages.inc.php b/libraries/config/messages.inc.php index 034214c..e76b52e 100644 --- a/libraries/config/messages.inc.php +++ b/libraries/config/messages.inc.php @@ -314,9 +314,8 @@ $strConfigMcryptDisableWarning_desc = __('Disable the default warning that is di $strConfigMcryptDisableWarning_name = __('mcrypt warning'); $strConfigMemoryLimit_desc = __('The number of bytes a script is allowed to allocate, eg. [kbd]32M[/kbd] ([kbd]0[/kbd] for no limit)'); $strConfigMemoryLimit_name = __('Memory limit'); -$strConfigModifyDeleteAtLeft_desc = __('These are Edit, Inline edit, Copy and Delete links'); -$strConfigModifyDeleteAtLeft_name = __('Show table row links on left side'); -$strConfigModifyDeleteAtRight_name = __('Show table row links on right side'); +$strConfigRowActionLinks_desc = __('These are Edit, Inline edit, Copy and Delete links'); +$strConfigRowActionLinks_name = __('Where to show the table row links'); $strConfigNaturalOrder_desc = __('Use natural order for sorting table and database names'); $strConfigNaturalOrder_name = __('Natural order'); $strConfigNavigationBarIconic_desc = __('Use only icons, only text or both'); diff --git a/libraries/config/setup.forms.php b/libraries/config/setup.forms.php index 5cf5111..0754091 100644 --- a/libraries/config/setup.forms.php +++ b/libraries/config/setup.forms.php @@ -199,8 +199,7 @@ $forms['Main_frame']['Browse'] = array( 'BrowseMarkerEnable', 'RepeatCells', 'LimitChars', - 'ModifyDeleteAtLeft', - 'ModifyDeleteAtRight', + 'RowActionLinks', 'DefaultDisplay', 'RememberSorting'); $forms['Main_frame']['Edit'] = array( diff --git a/libraries/config/user_preferences.forms.php b/libraries/config/user_preferences.forms.php index 68619c9..003f508 100644 --- a/libraries/config/user_preferences.forms.php +++ b/libraries/config/user_preferences.forms.php @@ -109,8 +109,7 @@ $forms['Main_frame']['Browse'] = array( 'BrowseMarkerEnable', 'RepeatCells', 'LimitChars', - 'ModifyDeleteAtLeft', - 'ModifyDeleteAtRight', + 'RowActionLinks', 'DefaultDisplay', 'RememberSorting'); $forms['Main_frame']['Edit'] = array( diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index ca8041b..c9e04f3 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -661,7 +661,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// ... at the left column of the result table header if possible // and required - elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') { + elseif (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both') + && $is_display['text_btn'] == '1') { $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 4 : 0; if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal' || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') { @@ -677,7 +678,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $ }
// ... elseif no button, displays empty(ies) col(s) if required - elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft'] + elseif (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both') && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) { $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 4 : 0; if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal' @@ -691,6 +692,12 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $ } // end vertical mode }
+ // ... elseif display an empty column if the actions links are disabled to match the rest of the table + elseif ($GLOBALS['cfg']['RowActionLinks'] == 'none' && ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal' + || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) { + echo '<td></td>'; + } + // 2. Displays the fields' name // 2.0 If sorting links should be used, checks if the query is a "JOIN" // statement (see 2.1.3) @@ -912,9 +919,9 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// 3. Displays the needed checkboxes at the right // column of the result table header if possible and required... - if ($GLOBALS['cfg']['ModifyDeleteAtRight'] - && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') - && $is_display['text_btn'] == '1') { + if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both') + && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') + && $is_display['text_btn'] == '1') { $vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 4 : 1; if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal' || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') { @@ -933,7 +940,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// ... elseif no button, displays empty columns if required // (unless coming from Browse mode print view) - elseif ($GLOBALS['cfg']['ModifyDeleteAtRight'] + elseif (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both') && ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn') && (!$GLOBALS['is_header_sent'])) { $vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 4 : 1; @@ -1249,13 +1256,20 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { } // end if (1.2.2)
// 1.3 Displays the links at left if required - if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] - && ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal' - || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) { + if (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both') + && ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal' + || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) { if (! isset($js_conf)) { $js_conf = ''; } echo PMA_generateCheckboxAndLinks('left', $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $del_query, 'l', $edit_url, $copy_url, $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf); + } else if (($GLOBALS['cfg']['RowActionLinks'] == 'none') + && ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal' + || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) { + if (! isset($js_conf)) { + $js_conf = ''; + } + echo PMA_generateCheckboxAndLinks('none', $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $del_query, 'l', $edit_url, $copy_url, $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf); } // end if (1.3) } // end if (1)
@@ -1465,13 +1479,13 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { } // end for (2)
// 3. Displays the modify/delete links on the right if required - if ($GLOBALS['cfg']['ModifyDeleteAtRight'] - && ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal' - || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) { - if (! isset($js_conf)) { - $js_conf = ''; - } - echo PMA_generateCheckboxAndLinks('right', $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $del_query, 'r', $edit_url, $copy_url, $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf); + if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both') + && ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal' + || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) { + if (! isset($js_conf)) { + $js_conf = ''; + } + echo PMA_generateCheckboxAndLinks('right', $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $del_query, 'r', $edit_url, $copy_url, $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf); } // end if (3)
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal' @@ -1551,15 +1565,19 @@ function PMA_displayVerticalTable() global $vertical_display;
// Displays "multi row delete" link at top if required - if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['row_delete']) && (count($vertical_display['row_delete']) > 0 || !empty($vertical_display['textbtn']))) { + if (($GLOBALS['cfg']['RowActionLinks'] != 'right') + && is_array($vertical_display['row_delete']) && (count($vertical_display['row_delete']) > 0 || !empty($vertical_display['textbtn']))) { echo '<tr>' . "\n"; + if ($GLOBALS['cfg']['RowActionLinks'] == 'none') { + // if we are not showing the RowActionLinks, then we need to show the Multi-Row-Action checkboxes + echo '<th></th>' . "\n"; + } echo $vertical_display['textbtn']; $foo_counter = 0; foreach ($vertical_display['row_delete'] as $val) { if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) { echo '<th></th>' . "\n"; } - echo str_replace('[%_PMA_CHECKBOX_DIR_%]', '_left', $val); $foo_counter++; } // end while @@ -1567,7 +1585,8 @@ function PMA_displayVerticalTable() } // end if
// Displays "edit" link at top if required - if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['edit']) && (count($vertical_display['edit']) > 0 || !empty($vertical_display['textbtn']))) { + if (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both') + && is_array($vertical_display['edit']) && (count($vertical_display['edit']) > 0 || !empty($vertical_display['textbtn']))) { echo '<tr>' . "\n"; if (! is_array($vertical_display['row_delete'])) { echo $vertical_display['textbtn']; @@ -1585,7 +1604,8 @@ function PMA_displayVerticalTable() } // end if
// Displays "copy" link at top if required - if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['copy']) && (count($vertical_display['copy']) > 0 || !empty($vertical_display['textbtn']))) { + if (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both') + && is_array($vertical_display['copy']) && (count($vertical_display['copy']) > 0 || !empty($vertical_display['textbtn']))) { echo '<tr>' . "\n"; if (! is_array($vertical_display['row_delete'])) { echo $vertical_display['textbtn']; @@ -1603,7 +1623,8 @@ function PMA_displayVerticalTable() } // end if
// Displays "delete" link at top if required - if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['delete']) && (count($vertical_display['delete']) > 0 || !empty($vertical_display['textbtn']))) { + if (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both') + && is_array($vertical_display['delete']) && (count($vertical_display['delete']) > 0 || !empty($vertical_display['textbtn']))) { echo '<tr>' . "\n"; if (! is_array($vertical_display['edit']) && ! is_array($vertical_display['row_delete'])) { echo $vertical_display['textbtn']; @@ -1640,7 +1661,8 @@ function PMA_displayVerticalTable() } // end while
// Displays "multi row delete" link at bottom if required - if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && is_array($vertical_display['row_delete']) && (count($vertical_display['row_delete']) > 0 || !empty($vertical_display['textbtn']))) { + if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both') + && is_array($vertical_display['row_delete']) && (count($vertical_display['row_delete']) > 0 || !empty($vertical_display['textbtn']))) { echo '<tr>' . "\n"; echo $vertical_display['textbtn']; $foo_counter = 0; @@ -1656,7 +1678,8 @@ function PMA_displayVerticalTable() } // end if
// Displays "edit" link at bottom if required - if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && is_array($vertical_display['edit']) && (count($vertical_display['edit']) > 0 || !empty($vertical_display['textbtn']))) { + if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both') + && is_array($vertical_display['edit']) && (count($vertical_display['edit']) > 0 || !empty($vertical_display['textbtn']))) { echo '<tr>' . "\n"; if (! is_array($vertical_display['row_delete'])) { echo $vertical_display['textbtn']; @@ -1674,7 +1697,8 @@ function PMA_displayVerticalTable() } // end if
// Displays "copy" link at bottom if required - if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && is_array($vertical_display['copy']) && (count($vertical_display['copy']) > 0 || !empty($vertical_display['textbtn']))) { + if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both') + && is_array($vertical_display['copy']) && (count($vertical_display['copy']) > 0 || !empty($vertical_display['textbtn']))) { echo '<tr>' . "\n"; if (! is_array($vertical_display['row_delete'])) { echo $vertical_display['textbtn']; @@ -1692,7 +1716,8 @@ function PMA_displayVerticalTable() } // end if
// Displays "delete" link at bottom if required - if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && is_array($vertical_display['delete']) && (count($vertical_display['delete']) > 0 || !empty($vertical_display['textbtn']))) { + if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both') + && is_array($vertical_display['delete']) && (count($vertical_display['delete']) > 0 || !empty($vertical_display['textbtn']))) { echo '<tr>' . "\n"; if (! is_array($vertical_display['edit']) && ! is_array($vertical_display['row_delete'])) { echo $vertical_display['textbtn']; @@ -2680,6 +2705,8 @@ function PMA_generateCheckboxAndLinks($position, $del_url, $is_display, $row_no, $ret .= PMA_generateEditLink($edit_url, $class, $edit_str, $where_clause, $where_clause_html, '');
$ret .= PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, $where_clause_html, $del_query, $id_suffix='_right', '', '', ''); + } else { // $position == 'none' + $ret .= PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, $where_clause_html, $del_query, $id_suffix='_left', '', '', ''); } return $ret; }
hooks/post-receive