From: Jehan-Guillaume (ioguix) de Rorthais Date: Tue, 11 Sep 2012 13:23:43 +0000 (+0200) Subject: Fix a bug with empty actions column when browsing data X-Git-Tag: REL_5-1-0~36 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=77586a65a1c3bf18ceba5e7bf8adfbc91a16f100;p=phppgadmin.git Fix a bug with empty actions column when browsing data When no action is allowed (eg. when GuiControl removes them) on the browsing page (display.php), the "action" header was still showed, but not its data column, leading to a difference between the number of header columns and data columns. This bug was raised by Julien Rouhaud (rjuju). This patch is based on his work (some cleanup). --- diff --git a/display.php b/display.php index 5551500a..82c95aff 100644 --- a/display.php +++ b/display.php @@ -565,12 +565,14 @@ ); } - $edit_params = $actions['actionbuttons']['edit']; - $delete_params = $actions['actionbuttons']['delete']; + $edit_params = isset($actions['actionbuttons']['edit'])? + $actions['actionbuttons']['edit']:array(); + $delete_params = isset($actions['actionbuttons']['delete'])? + $actions['actionbuttons']['delete']:array(); // Display edit and delete actions if we have a key $colspan = count($buttons); - if (sizeof($key) > 0) + if ($colspan > 0) echo "{$lang['stractions']}\n"; /* we show OIDs only if we are in TABLE or SELECT type browsing */ @@ -584,7 +586,7 @@ $id = (($i % 2) == 0 ? '1' : '2'); echo "\n"; // Display edit and delete links if we have a key - if (sizeof($key) > 0) { + if ($colspan > 0 and count($key) > 0) { $keys_array = array(); $has_nulls = false; foreach ($key as $v) {