Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmenadiel <amenadiel@gmail.com>2020-02-07 12:02:31 +0300
committerAmenadiel <amenadiel@gmail.com>2020-02-07 12:02:31 +0300
commit3be9cefba391700cb07c7d3e4ab005f6a2aa5cf7 (patch)
tree7316097a4b73da2b46e25a24260058fdcfb8fe0f
parent687c549f95dc441266dcb5c78be5d2f2d28718b4 (diff)
Creating Tag v6.0.0-RC7 at 2020-02-07 - Fixes long forgotten bugsv6.0.0-RC7
-rw-r--r--src/controllers/DisplayController.php160
-rw-r--r--src/controllers/TablesController.php256
2 files changed, 207 insertions, 209 deletions
diff --git a/src/controllers/DisplayController.php b/src/controllers/DisplayController.php
index abc2bf1d..784ffbd4 100644
--- a/src/controllers/DisplayController.php
+++ b/src/controllers/DisplayController.php
@@ -29,13 +29,13 @@ class DisplayController extends BaseController
set_time_limit(0);
- $scripts = '<script src="' . \SUBFOLDER . '/assets/js/display.js" type="text/javascript"></script>';
+ $scripts = '<script src="'.\SUBFOLDER.'/assets/js/display.js" type="text/javascript"></script>';
- $scripts .= '<script type="text/javascript">' . PHP_EOL;
+ $scripts .= '<script type="text/javascript">'.PHP_EOL;
$scripts .= "var Display = {\n";
- $scripts .= "errmsg: '" . str_replace("'", "\\'", $this->lang['strconnectionfail']) . "'\n";
+ $scripts .= "errmsg: '".str_replace("'", "\\'", $this->lang['strconnectionfail'])."'\n";
$scripts .= "};\n";
- $scripts .= '</script>' . PHP_EOL;
+ $scripts .= '</script>'.PHP_EOL;
$footer_template = 'footer.twig';
$header_template = 'header.twig';
@@ -237,10 +237,10 @@ class DisplayController extends BaseController
//die(htmlspecialchars($query));
- echo '<form method="post" id="sqlform" action="' . $_SERVER['REQUEST_URI'] . '">';
+ echo '<form method="post" id="sqlform" action="'.$_SERVER['REQUEST_URI'].'">';
echo $this->misc->form;
if ($object) {
- echo '<input type="hidden" name="' . $subject . '" value="', htmlspecialchars($object), '" />' . PHP_EOL;
+ echo '<input type="hidden" name="'.$subject.'" value="', htmlspecialchars($object), '" />'.PHP_EOL;
}
echo '<textarea width="90%" name="query" id="query" rows="5" cols="100" resizable="true">';
echo htmlspecialchars($query);
@@ -516,7 +516,7 @@ class DisplayController extends BaseController
public function printResultsTable($resultset, $page, $max_pages, $_gets, $object)
{
if (!is_object($resultset) || $resultset->recordCount() <= 0) {
- echo "<p>{$this->lang['strnodata']}</p>" . PHP_EOL;
+ echo "<p>{$this->lang['strnodata']}</p>".PHP_EOL;
return;
}
@@ -530,18 +530,18 @@ class DisplayController extends BaseController
$paginator = $this->_printPages($page, $max_pages, $_gets);
echo $paginator;
- echo '<table id="data">' . PHP_EOL;
+ echo '<table id="data">'.PHP_EOL;
echo '<tr>';
// Display edit and delete actions if we have a key
$display_action_column = (count($actions['actionbuttons']) > 0 && count($key) > 0);
- echo $display_action_column ? "<th class=\"data\">{$this->lang['stractions']}</th>" . PHP_EOL : '';
+ echo $display_action_column ? "<th class=\"data\">{$this->lang['stractions']}</th>".PHP_EOL : '';
// we show OIDs only if we are in TABLE or SELECT type browsing
$this->printTableHeaderCells($resultset, $_gets, isset($object));
- echo '</tr>' . PHP_EOL;
+ echo '</tr>'.PHP_EOL;
reset($resultset->fields);
@@ -552,18 +552,18 @@ class DisplayController extends BaseController
$trclass = ($trclass === 'data2') ? 'data1' : 'data2';
$buttonclass = ($buttonclass === 'opbutton2') ? 'opbutton1' : 'opbutton2';
- echo sprintf('<tr class="%s">', $trclass) . PHP_EOL;
+ echo sprintf('<tr class="%s">', $trclass).PHP_EOL;
$this->_printResultsTableActionButtons($resultset, $key, $actions, $display_action_column, $buttonclass);
$this->printTableRowCells($resultset, $fkey_information, isset($object));
- echo '</tr>' . PHP_EOL;
+ echo '</tr>'.PHP_EOL;
$resultset->moveNext();
}
- echo '</table>' . PHP_EOL;
+ echo '</table>'.PHP_EOL;
- echo '<p>', $resultset->recordCount(), " {$this->lang['strrows']}</p>" . PHP_EOL;
+ echo '<p>', $resultset->recordCount(), " {$this->lang['strrows']}</p>".PHP_EOL;
// Show page navigation
echo $paginator;
}
@@ -588,7 +588,7 @@ class DisplayController extends BaseController
$keys_array["key[{$v}]"] = $resultset->fields[$v];
}
if ($has_nulls) {
- echo '<td>&nbsp;</td>' . PHP_EOL;
+ echo '<td>&nbsp;</td>'.PHP_EOL;
return;
}
@@ -612,7 +612,7 @@ class DisplayController extends BaseController
foreach ($actions['actionbuttons'] as $action) {
$this->printLink($action, true, __METHOD__);
}
- echo '</td>' . PHP_EOL;
+ echo '</td>'.PHP_EOL;
}
/**
@@ -637,7 +637,7 @@ class DisplayController extends BaseController
$finfo = $resultset->fetchField($index);
if (false === $args) {
- echo '<th class="data">', $this->misc->printVal($finfo->name), '</th>' . PHP_EOL;
+ echo '<th class="data">', $this->misc->printVal($finfo->name), '</th>'.PHP_EOL;
continue;
}
@@ -654,7 +654,7 @@ class DisplayController extends BaseController
$icon = ('asc' == $_REQUEST['sortdir']) ? $this->misc->icon('RaiseArgument') : $this->misc->icon('LowerArgument');
echo sprintf('<img src="%s" alt="%s">', $icon, $_REQUEST['sortdir']);
}
- echo '</a></th>' . PHP_EOL;
+ echo '</a></th>'.PHP_EOL;
}
reset($resultset->fields);
@@ -706,11 +706,11 @@ class DisplayController extends BaseController
$query_params = $fkey_information['byconstr'][$conid]['url_data'];
foreach ($fkey_information['byconstr'][$conid]['fkeys'] as $p_field => $f_field) {
- $query_params .= '&amp;' . urlencode("fkey[{$f_field}]") . '=' . urlencode($resultset->fields[$p_field]);
+ $query_params .= '&amp;'.urlencode("fkey[{$f_field}]").'='.urlencode($resultset->fields[$p_field]);
}
// $fkey_information['common_url'] is already urlencoded
- $query_params .= '&amp;' . $fkey_information['common_url'];
+ $query_params .= '&amp;'.$fkey_information['common_url'];
$title = htmlentities($fkey_information['byconstr'][$conid]['consrc'], ENT_QUOTES, 'UTF-8');
echo '<div style="display:inline-block;">';
echo sprintf('<a class="fk fk_%s" href="display?%s">', htmlentities($conid, ENT_QUOTES, 'UTF-8'), $query_params);
@@ -753,16 +753,16 @@ class DisplayController extends BaseController
$fksprops = $this->_getFKProps();
- echo '<form action="' . \SUBFOLDER . '/src/views/display" method="post" id="ac_form">' . PHP_EOL;
+ echo '<form action="'.\SUBFOLDER.'/src/views/display" method="post" id="ac_form">'.PHP_EOL;
$elements = 0;
$error = true;
if (1 == $resultset->recordCount() && $attrs->recordCount() > 0) {
- echo '<table>' . PHP_EOL;
+ echo '<table>'.PHP_EOL;
// Output table header
echo "<tr><th class=\"data\">{$this->lang['strcolumn']}</th><th class=\"data\">{$this->lang['strtype']}</th>";
- echo "<th class=\"data\">{$this->lang['strformat']}</th>" . PHP_EOL;
+ echo "<th class=\"data\">{$this->lang['strformat']}</th>".PHP_EOL;
echo "<th class=\"data\">{$this->lang['strnull']}</th><th class=\"data\">{$this->lang['strvalue']}</th></tr>";
$i = 0;
@@ -775,19 +775,19 @@ class DisplayController extends BaseController
$_REQUEST['format'][$attrs->fields['attname']] = 'VALUE';
}
- echo "<tr class=\"data{$id}\">" . PHP_EOL;
+ echo "<tr class=\"data{$id}\">".PHP_EOL;
echo '<td style="white-space:nowrap;">', $this->misc->printVal($attrs->fields['attname']), '</td>';
- echo '<td style="white-space:nowrap;">' . PHP_EOL;
+ echo '<td style="white-space:nowrap;">'.PHP_EOL;
echo $this->misc->printVal($data->formatType($attrs->fields['type'], $attrs->fields['atttypmod']));
echo '<input type="hidden" name="types[', htmlspecialchars($attrs->fields['attname']), ']" value="',
htmlspecialchars($attrs->fields['type']), '" /></td>';
++$elements;
- echo '<td style="white-space:nowrap;">' . PHP_EOL;
- echo '<select name="format[' . htmlspecialchars($attrs->fields['attname']), ']">' . PHP_EOL;
- echo '<option value="VALUE"', ($_REQUEST['format'][$attrs->fields['attname']] == 'VALUE') ? ' selected="selected"' : '', ">{$this->lang['strvalue']}</option>" . PHP_EOL;
+ echo '<td style="white-space:nowrap;">'.PHP_EOL;
+ echo '<select name="format['.htmlspecialchars($attrs->fields['attname']), ']">'.PHP_EOL;
+ echo '<option value="VALUE"', ($_REQUEST['format'][$attrs->fields['attname']] == 'VALUE') ? ' selected="selected"' : '', ">{$this->lang['strvalue']}</option>".PHP_EOL;
$selected = ($_REQUEST['format'][$attrs->fields['attname']] == 'EXPRESSION') ? ' selected="selected"' : '';
- echo '<option value="EXPRESSION"' . $selected . ">{$this->lang['strexpression']}</option>" . PHP_EOL;
- echo "</select>\n</td>" . PHP_EOL;
+ echo '<option value="EXPRESSION"'.$selected.">{$this->lang['strexpression']}</option>".PHP_EOL;
+ echo "</select>\n</td>".PHP_EOL;
++$elements;
echo '<td style="white-space:nowrap;">';
// Output null box if the column allows nulls (doesn't look at CHECKs or ASSERTIONS)
@@ -800,7 +800,7 @@ class DisplayController extends BaseController
$_REQUEST['nulls'][$attrs->fields['attname']] = 'on';
}
echo "<label><span><input type=\"checkbox\" class=\"nullcheckbox\" name=\"nulls[{$attrs->fields['attname']}]\"",
- isset($_REQUEST['nulls'][$attrs->fields['attname']]) ? ' checked="checked"' : '', ' /></span></label></td>' . PHP_EOL;
+ isset($_REQUEST['nulls'][$attrs->fields['attname']]) ? ' checked="checked"' : '', ' /></span></label></td>'.PHP_EOL;
++$elements;
} else {
echo '&nbsp;</td>';
@@ -827,20 +827,20 @@ class DisplayController extends BaseController
echo '</td>';
++$elements;
- echo '</tr>' . PHP_EOL;
+ echo '</tr>'.PHP_EOL;
++$i;
$attrs->moveNext();
}
- echo '</table>' . PHP_EOL;
+ echo '</table>'.PHP_EOL;
$error = false;
} elseif (1 != $resultset->recordCount()) {
- echo "<p>{$this->lang['strrownotunique']}</p>" . PHP_EOL;
+ echo "<p>{$this->lang['strrownotunique']}</p>".PHP_EOL;
} else {
- echo "<p>{$this->lang['strinvalidparam']}</p>" . PHP_EOL;
+ echo "<p>{$this->lang['strinvalidparam']}</p>".PHP_EOL;
}
- echo '<input type="hidden" name="action" value="editrow" />' . PHP_EOL;
+ echo '<input type="hidden" name="action" value="editrow" />'.PHP_EOL;
echo $this->misc->form;
echo isset($_REQUEST['table']) ? sprintf('<input type="hidden" name="table" value="%s" />%s', htmlspecialchars($_REQUEST['table']), PHP_EOL) : '';
@@ -852,29 +852,29 @@ class DisplayController extends BaseController
echo isset($_REQUEST['return']) ? sprintf('<input type="hidden" name="return" value="%s" />%s', htmlspecialchars($_REQUEST['return']), PHP_EOL) : '';
- echo '<input type="hidden" name="page" value="', htmlspecialchars($_REQUEST['page']), '" />' . PHP_EOL;
- echo '<input type="hidden" name="sortkey" value="', htmlspecialchars($_REQUEST['sortkey']), '" />' . PHP_EOL;
- echo '<input type="hidden" name="sortdir" value="', htmlspecialchars($_REQUEST['sortdir']), '" />' . PHP_EOL;
- echo '<input type="hidden" name="strings" value="', htmlspecialchars($_REQUEST['strings']), '" />' . PHP_EOL;
- echo '<input type="hidden" name="key" value="', htmlspecialchars(urlencode(serialize($key))), '" />' . PHP_EOL;
+ echo '<input type="hidden" name="page" value="', htmlspecialchars($_REQUEST['page']), '" />'.PHP_EOL;
+ echo '<input type="hidden" name="sortkey" value="', htmlspecialchars($_REQUEST['sortkey']), '" />'.PHP_EOL;
+ echo '<input type="hidden" name="sortdir" value="', htmlspecialchars($_REQUEST['sortdir']), '" />'.PHP_EOL;
+ echo '<input type="hidden" name="strings" value="', htmlspecialchars($_REQUEST['strings']), '" />'.PHP_EOL;
+ echo '<input type="hidden" name="key" value="', htmlspecialchars(urlencode(serialize($key))), '" />'.PHP_EOL;
echo '<p>';
if (!$error) {
- echo "<input type=\"submit\" name=\"save\" accesskey=\"r\" value=\"{$this->lang['strsave']}\" />" . PHP_EOL;
+ echo "<input type=\"submit\" name=\"save\" accesskey=\"r\" value=\"{$this->lang['strsave']}\" />".PHP_EOL;
}
- echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . PHP_EOL;
+ echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />".PHP_EOL;
if (false !== $fksprops) {
$autocomplete_string = "<input type=\"checkbox\" id=\"no_ac\" value=\"0\" /><label for=\"no_ac\">{$this->lang['strac']}</label>";
if ('default off' != $this->conf['autocomplete']) {
$autocomplete_string = "<input type=\"checkbox\" id=\"no_ac\" value=\"1\" checked=\"checked\" /><label for=\"no_ac\">{$this->lang['strac']}</label>";
}
- echo $autocomplete_string . PHP_EOL;
+ echo $autocomplete_string.PHP_EOL;
}
- echo '</p>' . PHP_EOL;
- echo '</form>' . PHP_EOL;
- echo '<script src="' . \SUBFOLDER . '/assets/js/insert_or_edit_row.js" type="text/javascript"></script>';
+ echo '</p>'.PHP_EOL;
+ echo '</form>'.PHP_EOL;
+ echo '<script src="'.\SUBFOLDER.'/assets/js/insert_or_edit_row.js" type="text/javascript"></script>';
}
/**
@@ -923,58 +923,58 @@ class DisplayController extends BaseController
$resultset = $data->browseRow($_REQUEST['table'], $_REQUEST['key']);
- echo '<form action="' . \SUBFOLDER . '/src/views/display" method="post">' . PHP_EOL;
+ echo '<form action="'.\SUBFOLDER.'/src/views/display" method="post">'.PHP_EOL;
echo $this->misc->form;
if (1 == $resultset->recordCount()) {
- echo "<p>{$this->lang['strconfdeleterow']}</p>" . PHP_EOL;
+ echo "<p>{$this->lang['strconfdeleterow']}</p>".PHP_EOL;
$fkinfo = [];
echo '<table><tr>';
$this->printTableHeaderCells($resultset, false, true);
echo '</tr>';
- echo '<tr class="data1">' . PHP_EOL;
+ echo '<tr class="data1">'.PHP_EOL;
$this->printTableRowCells($resultset, $fkinfo, true);
- echo '</tr>' . PHP_EOL;
- echo '</table>' . PHP_EOL;
- echo '<br />' . PHP_EOL;
+ echo '</tr>'.PHP_EOL;
+ echo '</table>'.PHP_EOL;
+ echo '<br />'.PHP_EOL;
- echo '<input type="hidden" name="action" value="delrow" />' . PHP_EOL;
- echo "<input type=\"submit\" name=\"yes\" value=\"{$this->lang['stryes']}\" />" . PHP_EOL;
- echo "<input type=\"submit\" name=\"no\" value=\"{$this->lang['strno']}\" />" . PHP_EOL;
+ echo '<input type="hidden" name="action" value="delrow" />'.PHP_EOL;
+ echo "<input type=\"submit\" name=\"yes\" value=\"{$this->lang['stryes']}\" />".PHP_EOL;
+ echo "<input type=\"submit\" name=\"no\" value=\"{$this->lang['strno']}\" />".PHP_EOL;
} elseif (1 != $resultset->recordCount()) {
- echo "<p>{$this->lang['strrownotunique']}</p>" . PHP_EOL;
- echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . PHP_EOL;
+ echo "<p>{$this->lang['strrownotunique']}</p>".PHP_EOL;
+ echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />".PHP_EOL;
} else {
- echo "<p>{$this->lang['strinvalidparam']}</p>" . PHP_EOL;
- echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . PHP_EOL;
+ echo "<p>{$this->lang['strinvalidparam']}</p>".PHP_EOL;
+ echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />".PHP_EOL;
}
if (isset($_REQUEST['table'])) {
- echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />' . PHP_EOL;
+ echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />'.PHP_EOL;
}
if (isset($_REQUEST['subject'])) {
- echo '<input type="hidden" name="subject" value="', htmlspecialchars($_REQUEST['subject']), '" />' . PHP_EOL;
+ echo '<input type="hidden" name="subject" value="', htmlspecialchars($_REQUEST['subject']), '" />'.PHP_EOL;
}
if (isset($_REQUEST['query'])) {
- echo '<input type="hidden" name="query" value="', htmlspecialchars($_REQUEST['query']), '" />' . PHP_EOL;
+ echo '<input type="hidden" name="query" value="', htmlspecialchars($_REQUEST['query']), '" />'.PHP_EOL;
}
if (isset($_REQUEST['count'])) {
- echo '<input type="hidden" name="count" value="', htmlspecialchars($_REQUEST['count']), '" />' . PHP_EOL;
+ echo '<input type="hidden" name="count" value="', htmlspecialchars($_REQUEST['count']), '" />'.PHP_EOL;
}
if (isset($_REQUEST['return'])) {
- echo '<input type="hidden" name="return" value="', htmlspecialchars($_REQUEST['return']), '" />' . PHP_EOL;
+ echo '<input type="hidden" name="return" value="', htmlspecialchars($_REQUEST['return']), '" />'.PHP_EOL;
}
- echo '<input type="hidden" name="page" value="', htmlspecialchars($_REQUEST['page']), '" />' . PHP_EOL;
- echo '<input type="hidden" name="sortkey" value="', htmlspecialchars($_REQUEST['sortkey']), '" />' . PHP_EOL;
- echo '<input type="hidden" name="sortdir" value="', htmlspecialchars($_REQUEST['sortdir']), '" />' . PHP_EOL;
- echo '<input type="hidden" name="strings" value="', htmlspecialchars($_REQUEST['strings']), '" />' . PHP_EOL;
- echo '<input type="hidden" name="key" value="', htmlspecialchars(urlencode(serialize($_REQUEST['key']))), '" />' . PHP_EOL;
- echo '</form>' . PHP_EOL;
+ echo '<input type="hidden" name="page" value="', htmlspecialchars($_REQUEST['page']), '" />'.PHP_EOL;
+ echo '<input type="hidden" name="sortkey" value="', htmlspecialchars($_REQUEST['sortkey']), '" />'.PHP_EOL;
+ echo '<input type="hidden" name="sortdir" value="', htmlspecialchars($_REQUEST['sortdir']), '" />'.PHP_EOL;
+ echo '<input type="hidden" name="strings" value="', htmlspecialchars($_REQUEST['strings']), '" />'.PHP_EOL;
+ echo '<input type="hidden" name="key" value="', htmlspecialchars(urlencode(serialize($_REQUEST['key']))), '" />'.PHP_EOL;
+ echo '</form>'.PHP_EOL;
} else {
$status = $data->deleteRow($_POST['table'], unserialize(urldecode($_POST['key'])));
if (0 == $status) {
@@ -1003,7 +1003,7 @@ class DisplayController extends BaseController
if (isset($_REQUEST['table'])) {
$constraints = $data->getConstraintsWithFields($_REQUEST['table']);
if ($constraints->recordCount() > 0) {
- $fkey_information['common_url'] = $this->misc->getHREF('schema') . '&amp;subject=table';
+ $fkey_information['common_url'] = $this->misc->getHREF('schema').'&amp;subject=table';
// build the FK constraints data structure
while (!$constraints->EOF) {
@@ -1011,7 +1011,7 @@ class DisplayController extends BaseController
if ('f' == $constr['contype']) {
if (!isset($fkey_information['byconstr'][$constr['conid']])) {
$fkey_information['byconstr'][$constr['conid']] = [
- 'url_data' => 'table=' . urlencode($constr['f_table']) . '&amp;schema=' . urlencode($constr['f_schema']),
+ 'url_data' => 'table='.urlencode($constr['f_table']).'&amp;schema='.urlencode($constr['f_schema']),
'fkeys' => [],
'consrc' => $constr['consrc'],
];
@@ -1060,7 +1060,7 @@ class DisplayController extends BaseController
$max_pages
);
- echo '<a href="javascript:void(0);" style="display:table-cell;" class="fk_delete"><img alt="[delete]" src="' . $this->misc->icon('Delete') . '" /></a>' . PHP_EOL;
+ echo '<a href="javascript:void(0);" style="display:table-cell;" class="fk_delete"><img alt="[delete]" src="'.$this->misc->icon('Delete').'" /></a>'.PHP_EOL;
echo '<div style="display:table-cell;">';
if (is_object($resultset) && $resultset->recordCount() > 0) {
@@ -1071,10 +1071,10 @@ class DisplayController extends BaseController
echo '<table><tr>';
$this->printTableHeaderCells($resultset, false, true);
echo '</tr>';
- echo '<tr class="data1">' . PHP_EOL;
+ echo '<tr class="data1">'.PHP_EOL;
$this->printTableRowCells($resultset, $fkinfo, true);
- echo '</tr>' . PHP_EOL;
- echo '</table>' . PHP_EOL;
+ echo '</tr>'.PHP_EOL;
+ echo '</table>'.PHP_EOL;
} else {
echo $this->lang['strnodata'];
}
@@ -1125,7 +1125,7 @@ class DisplayController extends BaseController
unset($gets['page']);
$url = http_build_query($gets);
- $result = '<p style="text-align: center">' . PHP_EOL;
+ $result = '<p style="text-align: center">'.PHP_EOL;
if ($page != 1) {
$result .= sprintf('<a class="pagenav" href="?%s&page=1">%s</a>%s&nbsp;', $url, $lang['strfirst'], PHP_EOL);
$result .= sprintf('<a class="pagenav" href="?%s&page=%s">%s</a>%s', $url, $page - 1, $lang['strprev'], PHP_EOL);
@@ -1134,14 +1134,14 @@ class DisplayController extends BaseController
list($min_page, $max_page) = $this->_getMinMaxPages($page, $pages);
for ($i = $min_page; $i <= $max_page; ++$i) {
- $result .= (($i === $page) ? $i : sprintf('<a class="pagenav" href="display?%s&page=%s">%s</a>', $url, $i, $i)) . PHP_EOL;
+ $result .= (($i === $page) ? $i : sprintf('<a class="pagenav" href="display?%s&page=%s">%s</a>', $url, $i, $i)).PHP_EOL;
}
if ($page != $pages) {
$result .= sprintf('<a class="pagenav" href="?%s&page=%s">%s</a>%s', $url, $page + 1, $lang['strnext'], PHP_EOL);
$result .= sprintf('&nbsp;<a class="pagenav" href="?%s&page=%s">%s</a>%s', $url, $pages, $lang['strlast'], PHP_EOL);
}
- $result .= '</p>' . PHP_EOL;
+ $result .= '</p>'.PHP_EOL;
return $result;
}
diff --git a/src/controllers/TablesController.php b/src/controllers/TablesController.php
index 9402c048..c950f767 100644
--- a/src/controllers/TablesController.php
+++ b/src/controllers/TablesController.php
@@ -142,7 +142,7 @@ class TablesController extends BaseController
'table' => [
'title' => $this->lang['strtable'],
'field' => Decorator::field('relname'),
- 'url' => \SUBFOLDER . "/redirect/table?{$this->misc->href}&amp;",
+ 'url' => \SUBFOLDER."/redirect/table?{$this->misc->href}&amp;",
'vars' => ['table' => 'relname'],
],
'owner' => [
@@ -469,46 +469,46 @@ class TablesController extends BaseController
$this->printTitle($this->lang['strcreatetable'], 'pg.table.create');
$this->printMsg($msg);
- echo '<form action="' . \SUBFOLDER . '/src/views/' . $this->script . '" method="post">';
+ echo '<form action="'.\SUBFOLDER.'/src/views/'.$this->script.'" method="post">';
echo PHP_EOL;
- echo '<table>' . PHP_EOL;
- echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strname']}</th>" . PHP_EOL;
+ echo '<table>'.PHP_EOL;
+ echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strname']}</th>".PHP_EOL;
echo "\t\t<td class=\"data\"><input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
- htmlspecialchars($_REQUEST['name']), "\" /></td>\n\t</tr>" . PHP_EOL;
- echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strnumcols']}</th>" . PHP_EOL;
+ htmlspecialchars($_REQUEST['name']), "\" /></td>\n\t</tr>".PHP_EOL;
+ echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strnumcols']}</th>".PHP_EOL;
echo "\t\t<td class=\"data\"><input name=\"fields\" size=\"5\" maxlength=\"{$data->_maxNameLen}\" value=\"",
- htmlspecialchars($_REQUEST['fields']), "\" /></td>\n\t</tr>" . PHP_EOL;
- echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['stroptions']}</th>" . PHP_EOL;
- echo "\t\t<td class=\"data\"><label for=\"withoutoids\"><input type=\"checkbox\" id=\"withoutoids\" name=\"withoutoids\"", isset($_REQUEST['withoutoids']) ? ' checked="checked"' : '', " />WITHOUT OIDS</label></td>\n\t</tr>" . PHP_EOL;
+ htmlspecialchars($_REQUEST['fields']), "\" /></td>\n\t</tr>".PHP_EOL;
+ echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['stroptions']}</th>".PHP_EOL;
+ echo "\t\t<td class=\"data\"><label for=\"withoutoids\"><input type=\"checkbox\" id=\"withoutoids\" name=\"withoutoids\"", isset($_REQUEST['withoutoids']) ? ' checked="checked"' : '', " />WITHOUT OIDS</label></td>\n\t</tr>".PHP_EOL;
// Tablespace (if there are any)
if ($data->hasTablespaces() && $tablespaces->recordCount() > 0) {
- echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strtablespace']}</th>" . PHP_EOL;
- echo "\t\t<td class=\"data1\">\n\t\t\t<select name=\"spcname\">" . PHP_EOL;
+ echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strtablespace']}</th>".PHP_EOL;
+ echo "\t\t<td class=\"data1\">\n\t\t\t<select name=\"spcname\">".PHP_EOL;
// Always offer the default (empty) option
echo "\t\t\t\t<option value=\"\"",
- ('' == $_REQUEST['spcname']) ? ' selected="selected"' : '', '></option>' . PHP_EOL;
+ ('' == $_REQUEST['spcname']) ? ' selected="selected"' : '', '></option>'.PHP_EOL;
// Display all other tablespaces
while (!$tablespaces->EOF) {
$spcname = htmlspecialchars($tablespaces->fields['spcname']);
echo "\t\t\t\t<option value=\"{$spcname}\"",
- ($tablespaces->fields['spcname'] == $_REQUEST['spcname']) ? ' selected="selected"' : '', ">{$spcname}</option>" . PHP_EOL;
+ ($tablespaces->fields['spcname'] == $_REQUEST['spcname']) ? ' selected="selected"' : '', ">{$spcname}</option>".PHP_EOL;
$tablespaces->moveNext();
}
- echo "\t\t\t</select>\n\t\t</td>\n\t</tr>" . PHP_EOL;
+ echo "\t\t\t</select>\n\t\t</td>\n\t</tr>".PHP_EOL;
}
- echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strcomment']}</th>" . PHP_EOL;
+ echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strcomment']}</th>".PHP_EOL;
echo "\t\t<td><textarea name=\"tblcomment\" rows=\"3\" cols=\"32\">",
- htmlspecialchars($_REQUEST['tblcomment']), "</textarea></td>\n\t</tr>" . PHP_EOL;
+ htmlspecialchars($_REQUEST['tblcomment']), "</textarea></td>\n\t</tr>".PHP_EOL;
- echo '</table>' . PHP_EOL;
- echo '<p><input type="hidden" name="action" value="create" />' . PHP_EOL;
- echo '<input type="hidden" name="stage" value="2" />' . PHP_EOL;
+ echo '</table>'.PHP_EOL;
+ echo '<p><input type="hidden" name="action" value="create" />'.PHP_EOL;
+ echo '<input type="hidden" name="stage" value="2" />'.PHP_EOL;
echo $this->misc->form;
- echo "<input type=\"submit\" value=\"{$this->lang['strnext']}\" />" . PHP_EOL;
- echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>" . PHP_EOL;
- echo '</form>' . PHP_EOL;
+ echo "<input type=\"submit\" value=\"{$this->lang['strnext']}\" />".PHP_EOL;
+ echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>".PHP_EOL;
+ echo '</form>'.PHP_EOL;
break;
case 2:
@@ -534,15 +534,15 @@ class TablesController extends BaseController
$this->printTitle($this->lang['strcreatetable'], 'pg.table.create');
$this->printMsg($msg);
- echo '<script src="' . \SUBFOLDER . '/assets/js/tables.js" type="text/javascript"></script>';
- echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post">' . PHP_EOL;
+ echo '<script src="'.\SUBFOLDER.'/assets/js/tables.js" type="text/javascript"></script>';
+ echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post">'.PHP_EOL;
// Output table header
- echo '<table>' . PHP_EOL;
+ echo '<table>'.PHP_EOL;
echo "\t<tr><th colspan=\"2\" class=\"data required\">{$this->lang['strcolumn']}</th><th colspan=\"2\" class=\"data required\">{$this->lang['strtype']}</th>";
echo "<th class=\"data\">{$this->lang['strlength']}</th><th class=\"data\">{$this->lang['strnotnull']}</th>";
echo "<th class=\"data\">{$this->lang['struniquekey']}</th><th class=\"data\">{$this->lang['strprimarykey']}</th>";
- echo "<th class=\"data\">{$this->lang['strdefault']}</th><th class=\"data\">{$this->lang['strcomment']}</th></tr>" . PHP_EOL;
+ echo "<th class=\"data\">{$this->lang['strdefault']}</th><th class=\"data\">{$this->lang['strcomment']}</th></tr>".PHP_EOL;
for ($i = 0; $i < $_REQUEST['fields']; ++$i) {
if (!isset($_REQUEST['field'][$i])) {
@@ -561,16 +561,16 @@ class TablesController extends BaseController
$_REQUEST['colcomment'][$i] = '';
}
- echo "\t<tr>\n\t\t<td>", $i + 1, '.&nbsp;</td>' . PHP_EOL;
+ echo "\t<tr>\n\t\t<td>", $i + 1, '.&nbsp;</td>'.PHP_EOL;
echo "\t\t<td><input name=\"field[{$i}]\" size=\"16\" maxlength=\"{$data->_maxNameLen}\" value=\"",
- htmlspecialchars($_REQUEST['field'][$i]), '" /></td>' . PHP_EOL;
- echo "\t\t<td>\n\t\t\t<select name=\"type[{$i}]\" class=\"select2\" id=\"types{$i}\" onchange=\"checkLengths(this.options[this.selectedIndex].value,{$i});\">" . PHP_EOL;
+ htmlspecialchars($_REQUEST['field'][$i]), '" /></td>'.PHP_EOL;
+ echo "\t\t<td>\n\t\t\t<select name=\"type[{$i}]\" class=\"select2\" id=\"types{$i}\" onchange=\"checkLengths(this.options[this.selectedIndex].value,{$i});\">".PHP_EOL;
// Output any "magic" types
foreach ($data->extraTypes as $v) {
$types_for_js[strtolower($v)] = 1;
echo "\t\t\t\t<option value=\"", htmlspecialchars($v), '"',
(isset($_REQUEST['type'][$i]) && $_REQUEST['type'][$i] == $v) ? ' selected="selected"' : '', '>',
- $this->misc->printVal($v), '</option>' . PHP_EOL;
+ $this->misc->printVal($v), '</option>'.PHP_EOL;
}
$types->moveFirst();
while (!$types->EOF) {
@@ -578,7 +578,7 @@ class TablesController extends BaseController
$types_for_js[$typname] = 1;
echo "\t\t\t\t<option value=\"", htmlspecialchars($typname), '"',
(isset($_REQUEST['type'][$i]) && $_REQUEST['type'][$i] == $typname) ? ' selected="selected"' : '', '>',
- $this->misc->printVal($typname), '</option>' . PHP_EOL;
+ $this->misc->printVal($typname), '</option>'.PHP_EOL;
$types->moveNext();
}
echo "\t\t\t</select>\n\t\t\n";
@@ -589,46 +589,46 @@ class TablesController extends BaseController
foreach ($predefined_size_types as $value) {
$escaped_predef_types[] = "'{$value}'";
}
- echo '<script type="text/javascript">predefined_lengths = new Array(' . implode(',', $escaped_predef_types) . ");</script>\n\t</td>";
+ echo '<script type="text/javascript">predefined_lengths = new Array('.implode(',', $escaped_predef_types).");</script>\n\t</td>";
}
// Output array type selector
- echo "\t\t<td>\n\t\t\t<select name=\"array[{$i}]\">" . PHP_EOL;
- echo "\t\t\t\t<option value=\"\"", (isset($_REQUEST['array'][$i]) && $_REQUEST['array'][$i] == '') ? ' selected="selected"' : '', '></option>' . PHP_EOL;
- echo "\t\t\t\t<option value=\"[]\"", (isset($_REQUEST['array'][$i]) && $_REQUEST['array'][$i] == '[]') ? ' selected="selected"' : '', '>[ ]</option>' . PHP_EOL;
- echo "\t\t\t</select>\n\t\t</td>" . PHP_EOL;
+ echo "\t\t<td>\n\t\t\t<select name=\"array[{$i}]\">".PHP_EOL;
+ echo "\t\t\t\t<option value=\"\"", (isset($_REQUEST['array'][$i]) && $_REQUEST['array'][$i] == '') ? ' selected="selected"' : '', '></option>'.PHP_EOL;
+ echo "\t\t\t\t<option value=\"[]\"", (isset($_REQUEST['array'][$i]) && $_REQUEST['array'][$i] == '[]') ? ' selected="selected"' : '', '>[ ]</option>'.PHP_EOL;
+ echo "\t\t\t</select>\n\t\t</td>".PHP_EOL;
echo "\t\t<td><input name=\"length[{$i}]\" id=\"lengths{$i}\" size=\"10\" value=\"",
- htmlspecialchars($_REQUEST['length'][$i]), '" /></td>' . PHP_EOL;
- echo "\t\t<td><input type=\"checkbox\" name=\"notnull[{$i}]\"", (isset($_REQUEST['notnull'][$i])) ? ' checked="checked"' : '', ' /></td>' . PHP_EOL;
+ htmlspecialchars($_REQUEST['length'][$i]), '" /></td>'.PHP_EOL;
+ echo "\t\t<td><input type=\"checkbox\" name=\"notnull[{$i}]\"", (isset($_REQUEST['notnull'][$i])) ? ' checked="checked"' : '', ' /></td>'.PHP_EOL;
echo "\t\t<td style=\"text-align: center\"><input type=\"checkbox\" name=\"uniquekey[{$i}]\""
- . (isset($_REQUEST['uniquekey'][$i]) ? ' checked="checked"' : '') . ' /></td>' . PHP_EOL;
+ .(isset($_REQUEST['uniquekey'][$i]) ? ' checked="checked"' : '').' /></td>'.PHP_EOL;
echo "\t\t<td style=\"text-align: center\"><input type=\"checkbox\" name=\"primarykey[{$i}]\" "
- . (isset($_REQUEST['primarykey'][$i]) ? ' checked="checked"' : '')
- . ' /></td>' . PHP_EOL;
+ .(isset($_REQUEST['primarykey'][$i]) ? ' checked="checked"' : '')
+ .' /></td>'.PHP_EOL;
echo "\t\t<td><input name=\"default[{$i}]\" size=\"20\" value=\"",
- htmlspecialchars($_REQUEST['default'][$i]), '" /></td>' . PHP_EOL;
+ htmlspecialchars($_REQUEST['default'][$i]), '" /></td>'.PHP_EOL;
echo "\t\t<td><input name=\"colcomment[{$i}]\" size=\"40\" value=\"",
htmlspecialchars($_REQUEST['colcomment'][$i]), "\" />
<script type=\"text/javascript\">checkLengths(document.getElementById('types{$i}').value,{$i});</script>
- </td>\n\t</tr>" . PHP_EOL;
+ </td>\n\t</tr>".PHP_EOL;
}
- echo '</table>' . PHP_EOL;
- echo '<p><input type="hidden" name="action" value="create" />' . PHP_EOL;
- echo '<input type="hidden" name="stage" value="3" />' . PHP_EOL;
+ echo '</table>'.PHP_EOL;
+ echo '<p><input type="hidden" name="action" value="create" />'.PHP_EOL;
+ echo '<input type="hidden" name="stage" value="3" />'.PHP_EOL;
echo $this->misc->form;
- echo '<input type="hidden" name="name" value="', htmlspecialchars($_REQUEST['name']), '" />' . PHP_EOL;
- echo '<input type="hidden" name="fields" value="', htmlspecialchars($_REQUEST['fields']), '" />' . PHP_EOL;
+ echo '<input type="hidden" name="name" value="', htmlspecialchars($_REQUEST['name']), '" />'.PHP_EOL;
+ echo '<input type="hidden" name="fields" value="', htmlspecialchars($_REQUEST['fields']), '" />'.PHP_EOL;
if (isset($_REQUEST['withoutoids'])) {
- echo '<input type="hidden" name="withoutoids" value="true" />' . PHP_EOL;
+ echo '<input type="hidden" name="withoutoids" value="true" />'.PHP_EOL;
}
- echo '<input type="hidden" name="tblcomment" value="', htmlspecialchars($_REQUEST['tblcomment']), '" />' . PHP_EOL;
+ echo '<input type="hidden" name="tblcomment" value="', htmlspecialchars($_REQUEST['tblcomment']), '" />'.PHP_EOL;
if (isset($_REQUEST['spcname'])) {
- echo '<input type="hidden" name="spcname" value="', htmlspecialchars($_REQUEST['spcname']), '" />' . PHP_EOL;
+ echo '<input type="hidden" name="spcname" value="', htmlspecialchars($_REQUEST['spcname']), '" />'.PHP_EOL;
}
- echo "<input type=\"submit\" value=\"{$this->lang['strcreate']}\" />" . PHP_EOL;
- echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>" . PHP_EOL;
- echo '</form>' . PHP_EOL;
+ echo "<input type=\"submit\" value=\"{$this->lang['strcreate']}\" />".PHP_EOL;
+ echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>".PHP_EOL;
+ echo '</form>'.PHP_EOL;
break;
case 3:
@@ -693,7 +693,7 @@ class TablesController extends BaseController
break;
default:
- echo "<p>{$this->lang['strinvalidparam']}</p>" . PHP_EOL;
+ echo "<p>{$this->lang['strinvalidparam']}</p>".PHP_EOL;
}
}
@@ -736,13 +736,13 @@ class TablesController extends BaseController
unset($tbltmp);
- echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post">' . PHP_EOL;
- echo "<table>\n\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strname']}</th>" . PHP_EOL;
- echo "\t\t<td class=\"data\"><input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"", htmlspecialchars($_REQUEST['name']), "\" /></td>\n\t</tr>" . PHP_EOL;
- echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strcreatetablelikeparent']}</th>" . PHP_EOL;
+ echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post">'.PHP_EOL;
+ echo "<table>\n\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strname']}</th>".PHP_EOL;
+ echo "\t\t<td class=\"data\"><input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"", htmlspecialchars($_REQUEST['name']), "\" /></td>\n\t</tr>".PHP_EOL;
+ echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strcreatetablelikeparent']}</th>".PHP_EOL;
echo "\t\t<td class=\"data\">";
echo \PHPPgAdmin\XHtml\HTMLController::printCombo($tables, 'like', true, $tblsel, false);
- echo "</td>\n\t</tr>" . PHP_EOL;
+ echo "</td>\n\t</tr>".PHP_EOL;
if ($data->hasTablespaces()) {
$tblsp_ = $data->getTablespaces();
if ($tblsp_->recordCount() > 0) {
@@ -752,10 +752,10 @@ class TablesController extends BaseController
$tblsp[$a['spcname']] = $a['spcname'];
}
- echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strtablespace']}</th>" . PHP_EOL;
+ echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strtablespace']}</th>".PHP_EOL;
echo "\t\t<td class=\"data\">";
echo \PHPPgAdmin\XHtml\HTMLController::printCombo($tblsp, 'tablespace', true, $_REQUEST['tablespace'], false);
- echo "</td>\n\t</tr>" . PHP_EOL;
+ echo "</td>\n\t</tr>".PHP_EOL;
}
}
echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['stroptions']}</th>\n\t\t<td class=\"data\">";
@@ -772,14 +772,14 @@ class TablesController extends BaseController
isset($_REQUEST['withindexes']) ? ' checked="checked"' : '',
"/>{$this->lang['strcreatelikewithindexes']}</label>";
}
- echo "</td>\n\t</tr>" . PHP_EOL;
+ echo "</td>\n\t</tr>".PHP_EOL;
echo '</table>';
- echo '<input type="hidden" name="action" value="confcreatelike" />' . PHP_EOL;
+ echo '<input type="hidden" name="action" value="confcreatelike" />'.PHP_EOL;
echo $this->misc->form;
- echo "<p><input type=\"submit\" value=\"{$this->lang['strcreate']}\" />" . PHP_EOL;
- echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>" . PHP_EOL;
- echo '</form>' . PHP_EOL;
+ echo "<p><input type=\"submit\" value=\"{$this->lang['strcreate']}\" />".PHP_EOL;
+ echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>".PHP_EOL;
+ echo '</form>'.PHP_EOL;
} else {
if ('' == trim($_REQUEST['name'])) {
$this->doCreateLike(false, $this->lang['strtableneedsname']);
@@ -831,10 +831,10 @@ class TablesController extends BaseController
$attrs = $data->getTableAttributes($_REQUEST['table']);
- echo '<form action="' . \SUBFOLDER . '/src/views/display" method="post" id="selectform">' . PHP_EOL;
+ echo '<form action="'.\SUBFOLDER.'/src/views/display" method="post" id="selectform">'.PHP_EOL;
if ($attrs->recordCount() > 0) {
// JavaScript for select all feature
- echo '<script type="text/javascript">' . PHP_EOL;
+ echo '<script type="text/javascript">'.PHP_EOL;
echo "//<![CDATA[\n";
echo " function selectAll() {\n";
echo " for (var i=0; i<document.getElementById('selectform').elements.length; i++) {\n";
@@ -842,10 +842,10 @@ class TablesController extends BaseController
echo " if (e.name.indexOf('show') == 0) e.checked = document.getElementById('selectform').selectall.checked;\n";
echo " }\n";
echo " }\n";
- echo '//]]>' . PHP_EOL;
- echo '</script>' . PHP_EOL;
+ echo '//]]>'.PHP_EOL;
+ echo '</script>'.PHP_EOL;
- echo '<table>' . PHP_EOL;
+ echo '<table>'.PHP_EOL;
// Output table header
echo "<tr><th class=\"data\">{$this->lang['strshow']}</th><th class=\"data\">{$this->lang['strcolumn']}</th>";
@@ -866,42 +866,42 @@ class TablesController extends BaseController
// Continue drawing row
$id = (0 == ($i % 2) ? '1' : '2');
- echo "<tr class=\"data{$id}\">" . PHP_EOL;
+ echo "<tr class=\"data{$id}\">".PHP_EOL;
echo '<td style="white-space:nowrap;">';
echo '<input type="checkbox" name="show[', htmlspecialchars($attrs->fields['attname']), ']"',
isset($_REQUEST['show'][$attrs->fields['attname']]) ? ' checked="checked"' : '', ' /></td>';
echo '<td style="white-space:nowrap;">', $this->misc->printVal($attrs->fields['attname']), '</td>';
echo '<td style="white-space:nowrap;">', $this->misc->printVal($data->formatType($attrs->fields['type'], $attrs->fields['atttypmod'])), '</td>';
echo '<td style="white-space:nowrap;">';
- echo "<select name=\"ops[{$attrs->fields['attname']}]\">" . PHP_EOL;
+ echo "<select name=\"ops[{$attrs->fields['attname']}]\">".PHP_EOL;
foreach (array_keys($data->selectOps) as $v) {
echo '<option value="', htmlspecialchars($v), '"', ($_REQUEST['ops'][$attrs->fields['attname']] == $v) ? ' selected="selected"' : '',
- '>', htmlspecialchars($v), '</option>' . PHP_EOL;
+ '>', htmlspecialchars($v), '</option>'.PHP_EOL;
}
- echo "</select>\n</td>" . PHP_EOL;
+ echo "</select>\n</td>".PHP_EOL;
echo '<td style="white-space:nowrap;">', $data->printField(
"values[{$attrs->fields['attname']}]",
$_REQUEST['values'][$attrs->fields['attname']],
$attrs->fields['type']
), '</td>';
- echo '</tr>' . PHP_EOL;
+ echo '</tr>'.PHP_EOL;
++$i;
$attrs->moveNext();
}
// Select all checkbox
echo "<tr><td colspan=\"5\"><input type=\"checkbox\" id=\"selectall\" name=\"selectall\" accesskey=\"a\" onclick=\"javascript:selectAll()\" /><label for=\"selectall\">{$this->lang['strselectallfields']}</label></td>";
- echo '</tr></table>' . PHP_EOL;
+ echo '</tr></table>'.PHP_EOL;
} else {
- echo "<p>{$this->lang['strinvalidparam']}</p>" . PHP_EOL;
+ echo "<p>{$this->lang['strinvalidparam']}</p>".PHP_EOL;
}
- echo '<p><input type="hidden" name="action" value="selectrows" />' . PHP_EOL;
- echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />' . PHP_EOL;
- echo '<input type="hidden" name="subject" value="table" />' . PHP_EOL;
+ echo '<p><input type="hidden" name="action" value="selectrows" />'.PHP_EOL;
+ echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />'.PHP_EOL;
+ echo '<input type="hidden" name="subject" value="table" />'.PHP_EOL;
echo $this->misc->form;
- echo "<input type=\"submit\" name=\"select\" accesskey=\"r\" value=\"{$this->lang['strselect']}\" />" . PHP_EOL;
- echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>" . PHP_EOL;
- echo '</form>' . PHP_EOL;
+ echo "<input type=\"submit\" name=\"select\" accesskey=\"r\" value=\"{$this->lang['strselect']}\" />".PHP_EOL;
+ echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>".PHP_EOL;
+ echo '</form>'.PHP_EOL;
return;
}
@@ -963,9 +963,9 @@ class TablesController extends BaseController
$this->coalesceArr($_REQUEST, 'nulls', []);
$this->coalesceArr($_REQUEST, 'format', []);
- echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post" id="ac_form">' . PHP_EOL;
+ echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post" id="ac_form">'.PHP_EOL;
if ($attrs->recordCount() > 0) {
- echo '<table>' . PHP_EOL;
+ echo '<table>'.PHP_EOL;
// Output table header
echo "<tr><th class=\"data\">{$this->lang['strcolumn']}</th><th class=\"data\">{$this->lang['strtype']}</th>";
@@ -994,9 +994,9 @@ class TablesController extends BaseController
$requested_format = $_REQUEST['format'][$attrs->fields['attnum']];
// Continue drawing row
$id = (0 == ($i % 2) ? '1' : '2');
- echo "<tr class=\"data{$id}\">" . PHP_EOL;
+ echo "<tr class=\"data{$id}\">".PHP_EOL;
echo '<td style="white-space:nowrap;">', $this->misc->printVal($attrs->fields['attname']), '</td>';
- echo '<td style="white-space:nowrap;">' . PHP_EOL;
+ echo '<td style="white-space:nowrap;">'.PHP_EOL;
echo $this->misc->printVal(
$data->formatType(
$attrs->fields['type'],
@@ -1005,9 +1005,9 @@ class TablesController extends BaseController
);
echo "<input type=\"hidden\" name=\"types[{$attrs->fields['attnum']}]\" value=\"",
htmlspecialchars($attrs->fields['type']), '" /></td>';
- echo '<td style="white-space:nowrap;">' . PHP_EOL;
+ echo '<td style="white-space:nowrap;">'.PHP_EOL;
- echo "<select name=\"format[{$attrs->fields['attnum']}]\">" . PHP_EOL;
+ echo "<select name=\"format[{$attrs->fields['attnum']}]\">".PHP_EOL;
echo sprintf(
'<option value="VALUE" %s >%s</option> %s',
($requested_format == 'VALUE') ? ' selected="selected" ' : '',
@@ -1021,12 +1021,11 @@ class TablesController extends BaseController
PHP_EOL
);
- echo "</select>\n</td>" . PHP_EOL;
+ echo "</select>\n</td>".PHP_EOL;
echo '<td style="white-space:nowrap;">';
// Output null box if the column allows nulls
// Edit: if it can be null, then null it is.
if (!$attrs->fields['attnotnull']) {
-
echo '<label><span>';
echo sprintf(
'<input type="checkbox" class="nullcheckbox" name="nulls[%s]" %s />',
@@ -1034,7 +1033,6 @@ class TablesController extends BaseController
' checked="checked"'
);
echo '</span></label>';
-
}
echo '</td>';
@@ -1054,40 +1052,40 @@ class TablesController extends BaseController
} else {
echo $data->printField("values[{$attrs->fields['attnum']}]", $_REQUEST['values'][$attrs->fields['attnum']], $attrs->fields['type'], ['class' => 'insert_row_input']);
}
- echo '</td>' . PHP_EOL;
- echo '</tr>' . PHP_EOL;
+ echo '</td>'.PHP_EOL;
+ echo '</tr>'.PHP_EOL;
++$i;
$attrs->moveNext();
}
- echo '</table>' . PHP_EOL;
+ echo '</table>'.PHP_EOL;
if (!isset($_SESSION['counter'])) {
$_SESSION['counter'] = 0;
}
- echo '<input type="hidden" name="action" value="insertrow" />' . PHP_EOL;
- echo '<input type="hidden" name="fields" value="', htmlentities(serialize($fields), ENT_QUOTES, 'UTF-8'), '" />' . PHP_EOL;
- echo '<input type="hidden" name="protection_counter" value="' . $_SESSION['counter'] . '" />' . PHP_EOL;
- echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />' . PHP_EOL;
- echo "<p><input type=\"submit\" name=\"insert\" value=\"{$this->lang['strinsert']}\" />" . PHP_EOL;
- echo "<input type=\"submit\" name=\"insertandrepeat\" accesskey=\"r\" value=\"{$this->lang['strinsertandrepeat']}\" />" . PHP_EOL;
- echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . PHP_EOL;
+ echo '<input type="hidden" name="action" value="insertrow" />'.PHP_EOL;
+ echo '<input type="hidden" name="fields" value="', htmlentities(serialize($fields), ENT_QUOTES, 'UTF-8'), '" />'.PHP_EOL;
+ echo '<input type="hidden" name="protection_counter" value="'.$_SESSION['counter'].'" />'.PHP_EOL;
+ echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />'.PHP_EOL;
+ echo "<p><input type=\"submit\" name=\"insert\" value=\"{$this->lang['strinsert']}\" />".PHP_EOL;
+ echo "<input type=\"submit\" name=\"insertandrepeat\" accesskey=\"r\" value=\"{$this->lang['strinsertandrepeat']}\" />".PHP_EOL;
+ echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />".PHP_EOL;
if (false !== $fksprops) {
if ('default off' != $this->conf['autocomplete']) {
- echo "<input type=\"checkbox\" id=\"no_ac\" value=\"1\" checked=\"checked\" /><label for=\"no_ac\">{$this->lang['strac']}</label>" . PHP_EOL;
+ echo "<input type=\"checkbox\" id=\"no_ac\" value=\"1\" checked=\"checked\" /><label for=\"no_ac\">{$this->lang['strac']}</label>".PHP_EOL;
} else {
- echo "<input type=\"checkbox\" id=\"no_ac\" value=\"0\" /><label for=\"no_ac\">{$this->lang['strac']}</label>" . PHP_EOL;
+ echo "<input type=\"checkbox\" id=\"no_ac\" value=\"0\" /><label for=\"no_ac\">{$this->lang['strac']}</label>".PHP_EOL;
}
}
- echo '</p>' . PHP_EOL;
+ echo '</p>'.PHP_EOL;
} else {
- echo "<p>{$this->lang['strnofieldsforinsert']}</p>" . PHP_EOL;
- echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . PHP_EOL;
+ echo "<p>{$this->lang['strnofieldsforinsert']}</p>".PHP_EOL;
+ echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />".PHP_EOL;
}
echo $this->misc->form;
- echo '</form>' . PHP_EOL;
- echo '<script src="' . \SUBFOLDER . '/assets/js/insert_or_edit_row.js" type="text/javascript"></script>';
+ echo '</form>'.PHP_EOL;
+ echo '<script src="'.\SUBFOLDER.'/assets/js/insert_or_edit_row.js" type="text/javascript"></script>';
}
/**
@@ -1139,29 +1137,29 @@ class TablesController extends BaseController
$this->printTrail('schema');
$this->printTitle($this->lang['strempty'], 'pg.table.empty');
- echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post">' . PHP_EOL;
+ echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post">'.PHP_EOL;
foreach ($_REQUEST['ma'] as $v) {
$a = unserialize(htmlspecialchars_decode($v, ENT_QUOTES));
- echo '<p>' . sprintf($this->lang['strconfemptytable'], $this->misc->printVal($a['table']));
+ echo '<p>'.sprintf($this->lang['strconfemptytable'], $this->misc->printVal($a['table']));
- echo '</p>' . PHP_EOL;
+ echo '</p>'.PHP_EOL;
printf('<input type="hidden" name="table[]" value="%s" />', htmlspecialchars($a['table']));
} // END mutli empty
} else {
$this->printTrail('table');
$this->printTitle($this->lang['strempty'], 'pg.table.empty');
- echo '<p>', sprintf($this->lang['strconfemptytable'], $this->misc->printVal($_REQUEST['table'])), '</p>' . PHP_EOL;
+ echo '<p>', sprintf($this->lang['strconfemptytable'], $this->misc->printVal($_REQUEST['table'])), '</p>'.PHP_EOL;
- echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post">' . PHP_EOL;
+ echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post">'.PHP_EOL;
- echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />' . PHP_EOL;
+ echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />'.PHP_EOL;
// END not mutli empty
}
echo "<input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$this->lang['strcascade']}</label>";
- echo '<input type="hidden" name="action" value="empty" />' . PHP_EOL;
+ echo '<input type="hidden" name="action" value="empty" />'.PHP_EOL;
echo $this->misc->form;
- echo "<input type=\"submit\" name=\"empty\" value=\"{$this->lang['strempty']}\" /> <input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . PHP_EOL;
+ echo "<input type=\"submit\" name=\"empty\" value=\"{$this->lang['strempty']}\" /> <input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />".PHP_EOL;
echo "</form>\n"; // END if confirm
} else {
// Do Empty
@@ -1188,7 +1186,7 @@ class TablesController extends BaseController
return $this->doDefault($msg);
}
- return $this->doDefault($sql . '<br>' . $this->lang['strtableemptiedbad']);
+ return $this->doDefault($sql.'<br>'.$this->lang['strtableemptiedbad']);
// END not mutli empty
}
// END do Empty
@@ -1214,28 +1212,28 @@ class TablesController extends BaseController
$this->printTrail('schema');
$this->printTitle($this->lang['strdrop'], 'pg.table.drop');
- echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post">' . PHP_EOL;
+ echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post">'.PHP_EOL;
foreach ($_REQUEST['ma'] as $v) {
$a = unserialize(htmlspecialchars_decode($v, ENT_QUOTES));
- echo '<p>', sprintf($this->lang['strconfdroptable'], $this->misc->printVal($a['table'])), '</p>' . PHP_EOL;
+ echo '<p>', sprintf($this->lang['strconfdroptable'], $this->misc->printVal($a['table'])), '</p>'.PHP_EOL;
printf('<input type="hidden" name="table[]" value="%s" />', htmlspecialchars($a['table']));
}
} else {
$this->printTrail('table');
$this->printTitle($this->lang['strdrop'], 'pg.table.drop');
- echo '<p>', sprintf($this->lang['strconfdroptable'], $this->misc->printVal($_REQUEST['table'])), '</p>' . PHP_EOL;
+ echo '<p>', sprintf($this->lang['strconfdroptable'], $this->misc->printVal($_REQUEST['table'])), '</p>'.PHP_EOL;
- echo '<form action="' . \SUBFOLDER . '/src/views/tables" method="post">' . PHP_EOL;
- echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />' . PHP_EOL;
+ echo '<form action="'.\SUBFOLDER.'/src/views/tables" method="post">'.PHP_EOL;
+ echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />'.PHP_EOL;
// END if multi drop
}
- echo '<input type="hidden" name="action" value="drop" />' . PHP_EOL;
+ echo '<input type="hidden" name="action" value="drop" />'.PHP_EOL;
echo $this->misc->form;
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$this->lang['strcascade']}</label></p>" . PHP_EOL;
- echo "<input type=\"submit\" name=\"drop\" value=\"{$this->lang['strdrop']}\" />" . PHP_EOL;
- echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . PHP_EOL;
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$this->lang['strcascade']}</label></p>".PHP_EOL;
+ echo "<input type=\"submit\" name=\"drop\" value=\"{$this->lang['strdrop']}\" />".PHP_EOL;
+ echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />".PHP_EOL;
echo "</form>\n"; // END confirm
} else {
//If multi drop