diff options
author | Felipe Figueroa <amenadiel@gmail.com> | 2018-05-18 01:17:49 +0300 |
---|---|---|
committer | Felipe Figueroa <amenadiel@gmail.com> | 2018-05-18 01:17:49 +0300 |
commit | f2d04b3542b47760fab4b38d81a1ff2e29511753 (patch) | |
tree | 869088821ff8069f9e473dff321ca428c0219050 /src/controllers/DisplayController.php | |
parent | 5397c54379abd89c64b29acebe61e4e2cf6fbd52 (diff) |
ensure server, database and table are defined in display controller form
Diffstat (limited to 'src/controllers/DisplayController.php')
-rw-r--r-- | src/controllers/DisplayController.php | 196 |
1 files changed, 101 insertions, 95 deletions
diff --git a/src/controllers/DisplayController.php b/src/controllers/DisplayController.php index 859a6c30..bb9f1c50 100644 --- a/src/controllers/DisplayController.php +++ b/src/controllers/DisplayController.php @@ -28,13 +28,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">'."\n"; + $scripts .= '<script type="text/javascript">' . "\n"; $scripts .= "var Display = {\n"; - $scripts .= "errmsg: '".str_replace("'", "\\'", $this->lang['strconnectionfail'])."'\n"; + $scripts .= "errmsg: '" . str_replace("'", "\\'", $this->lang['strconnectionfail']) . "'\n"; $scripts .= "};\n"; - $scripts .= '</script>'."\n"; + $scripts .= '</script>' . "\n"; $footer_template = 'footer.twig'; $header_template = 'header.twig'; @@ -124,8 +124,8 @@ class DisplayController extends BaseController $subject = $this->coalesceArr($_REQUEST, 'subject', 'table')['subject']; - $object = null; - $object = $this->setIfIsset($object, $_REQUEST[$subject]); + $object = $this->coalesceArr($_REQUEST, $subject)[$subject]; + //$object = $this->setIfIsset($object, $_REQUEST[$subject]); //$this->prtrace($subject, $object); @@ -236,13 +236,19 @@ class DisplayController extends BaseController //$query = isset($_REQUEST['query'])? $_REQUEST['query'] : "select * from {$_REQUEST['schema']}.{$_REQUEST['table']};"; $this->prtrace($query); + //die(htmlspecialchars($query)); - echo '<form method="post" id="sqlform" action="'.str_replace('?', '?', $_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), '" />' . "\n"; + } echo '<textarea width="90%" name="query" id="query" rows="5" cols="100" resizable="true">'; - echo htmlspecialchars($query); - echo '</textarea><br><input type="submit"/></form>'; + echo '</textarea><br><input type="submit"/>'; + + echo '</form>'; if (is_object($resultset) && $resultset->recordCount() > 0) { // Show page navigation @@ -319,19 +325,19 @@ class DisplayController extends BaseController // Display edit and delete actions if we have a key $colspan = count($buttons); if ($colspan > 0 and count($key) > 0) { - echo "<th colspan=\"{$colspan}\" class=\"data\">{$this->lang['stractions']}</th>"."\n"; + echo "<th colspan=\"{$colspan}\" class=\"data\">{$this->lang['stractions']}</th>" . "\n"; } // we show OIDs only if we are in TABLE or SELECT type browsing $this->printTableHeaderCells($resultset, $_gets, isset($object)); - echo '</tr>'."\n"; + echo '</tr>' . "\n"; $i = 0; reset($resultset->fields); while (!$resultset->EOF) { $id = (0 == ($i % 2) ? '1' : '2'); - echo "<tr class=\"data{$id}\">"."\n"; + echo "<tr class=\"data{$id}\">" . "\n"; // Display edit and delete links if we have a key if ($colspan > 0 and count($key) > 0) { $keys_array = []; @@ -345,7 +351,7 @@ class DisplayController extends BaseController $keys_array["key[{$v}]"] = $resultset->fields[$v]; } if ($has_nulls) { - echo "<td colspan=\"{$colspan}\"> </td>"."\n"; + echo "<td colspan=\"{$colspan}\"> </td>" . "\n"; } else { if (isset($actions['actionbuttons']['edit'])) { $actions['actionbuttons']['edit'] = $edit_params; @@ -366,24 +372,24 @@ class DisplayController extends BaseController foreach ($actions['actionbuttons'] as $this->action) { echo "<td class=\"opbutton{$id}\">"; $this->printLink($this->action, true, __METHOD__); - echo '</td>'."\n"; + echo '</td>' . "\n"; } } } $this->printTableRowCells($resultset, $fkey_information, isset($object)); - echo '</tr>'."\n"; + echo '</tr>' . "\n"; $resultset->moveNext(); ++$i; } - echo '</table>'."\n"; + echo '</table>' . "\n"; - echo '<p>', $resultset->recordCount(), " {$this->lang['strrows']}</p>"."\n"; + echo '<p>', $resultset->recordCount(), " {$this->lang['strrows']}</p>" . "\n"; // Show page navigation echo $paginator; } else { - echo "<p>{$this->lang['strnodata']}</p>"."\n"; + echo "<p>{$this->lang['strnodata']}</p>" . "\n"; } // Navigation links @@ -543,8 +549,8 @@ class DisplayController extends BaseController /** * Show confirmation of edit and perform actual update. * - * @param mixed $confirm - * @param mixed $msg + * @param bool $confirm if true, display row edit form. If false, perform the update + * @param string $msg message to display on top of the form or after performing edition */ public function doEditRow($confirm, $msg = '') { @@ -573,7 +579,7 @@ class DisplayController extends BaseController $fksprops = false; } - echo '<form action="'.\SUBFOLDER.'/src/views/display" method="post" id="ac_form">'."\n"; + echo '<form action="' . \SUBFOLDER . '/src/views/display" method="post" id="ac_form">' . "\n"; /*echo '<p>'; if (!$error) { @@ -587,11 +593,11 @@ class DisplayController extends BaseController $elements = 0; $error = true; if (1 == $resultset->recordCount() && $attrs->recordCount() > 0) { - echo '<table>'."\n"; + echo '<table>' . "\n"; // 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>"."\n"; + echo "<th class=\"data\">{$this->lang['strformat']}</th>" . "\n"; echo "<th class=\"data\">{$this->lang['strnull']}</th><th class=\"data\">{$this->lang['strvalue']}</th></tr>"; $i = 0; @@ -604,19 +610,19 @@ class DisplayController extends BaseController $_REQUEST['format'][$attrs->fields['attname']] = 'VALUE'; } - echo "<tr class=\"data{$id}\">"."\n"; + echo "<tr class=\"data{$id}\">" . "\n"; echo '<td style="white-space:nowrap;">', $this->misc->printVal($attrs->fields['attname']), '</td>'; - echo '<td style="white-space:nowrap;">'."\n"; + echo '<td style="white-space:nowrap;">' . "\n"; 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;">'."\n"; - echo '<select name="format['.htmlspecialchars($attrs->fields['attname']), ']">'."\n"; - echo '<option value="VALUE"', ($_REQUEST['format'][$attrs->fields['attname']] == 'VALUE') ? ' selected="selected"' : '', ">{$this->lang['strvalue']}</option>"."\n"; + echo '<td style="white-space:nowrap;">' . "\n"; + echo '<select name="format[' . htmlspecialchars($attrs->fields['attname']), ']">' . "\n"; + echo '<option value="VALUE"', ($_REQUEST['format'][$attrs->fields['attname']] == 'VALUE') ? ' selected="selected"' : '', ">{$this->lang['strvalue']}</option>" . "\n"; $selected = ($_REQUEST['format'][$attrs->fields['attname']] == 'EXPRESSION') ? ' selected="selected"' : ''; - echo '<option value="EXPRESSION"'.$selected.">{$this->lang['strexpression']}</option>"."\n"; - echo "</select>\n</td>"."\n"; + echo '<option value="EXPRESSION"' . $selected . ">{$this->lang['strexpression']}</option>" . "\n"; + echo "</select>\n</td>" . "\n"; ++$elements; echo '<td style="white-space:nowrap;">'; // Output null box if the column allows nulls (doesn't look at CHECKs or ASSERTIONS) @@ -626,7 +632,7 @@ class DisplayController extends BaseController $_REQUEST['nulls'][$attrs->fields['attname']] = 'on'; } echo "<label><span><input type=\"checkbox\" name=\"nulls[{$attrs->fields['attname']}]\"", - isset($_REQUEST['nulls'][$attrs->fields['attname']]) ? ' checked="checked"' : '', ' /></span></label></td>'."\n"; + isset($_REQUEST['nulls'][$attrs->fields['attname']]) ? ' checked="checked"' : '', ' /></span></label></td>' . "\n"; ++$elements; } else { echo ' </td>'; @@ -641,7 +647,7 @@ class DisplayController extends BaseController // keep track of which element offset we're up to. We can't refer to the null checkbox by name // as it contains '[' and ']' characters. if (!$attrs->fields['attnotnull']) { - $extras['onChange'] = 'elements['.($elements - 1).'].checked = false;'; + $extras['onChange'] = 'elements[' . ($elements - 1) . '].checked = false;'; } if ((false !== $fksprops) && isset($fksprops['byfield'][$attrs->fields['attnum']])) { @@ -653,63 +659,63 @@ class DisplayController extends BaseController echo '</td>'; ++$elements; - echo '</tr>'."\n"; + echo '</tr>' . "\n"; ++$i; $attrs->moveNext(); } - echo '</table>'."\n"; + echo '</table>' . "\n"; $error = false; } elseif (1 != $resultset->recordCount()) { - echo "<p>{$this->lang['strrownotunique']}</p>"."\n"; + echo "<p>{$this->lang['strrownotunique']}</p>" . "\n"; } else { - echo "<p>{$this->lang['strinvalidparam']}</p>"."\n"; + echo "<p>{$this->lang['strinvalidparam']}</p>" . "\n"; } - echo '<input type="hidden" name="action" value="editrow" />'."\n"; + echo '<input type="hidden" name="action" value="editrow" />' . "\n"; echo $this->misc->form; if (isset($_REQUEST['table'])) { - echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />'."\n"; + echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />' . "\n"; } if (isset($_REQUEST['subject'])) { - echo '<input type="hidden" name="subject" value="', htmlspecialchars($_REQUEST['subject']), '" />'."\n"; + echo '<input type="hidden" name="subject" value="', htmlspecialchars($_REQUEST['subject']), '" />' . "\n"; } if (isset($_REQUEST['query'])) { - echo '<input type="hidden" name="query" value="', htmlspecialchars($_REQUEST['query']), '" />'."\n"; + echo '<input type="hidden" name="query" value="', htmlspecialchars($_REQUEST['query']), '" />' . "\n"; } if (isset($_REQUEST['count'])) { - echo '<input type="hidden" name="count" value="', htmlspecialchars($_REQUEST['count']), '" />'."\n"; + echo '<input type="hidden" name="count" value="', htmlspecialchars($_REQUEST['count']), '" />' . "\n"; } if (isset($_REQUEST['return'])) { - echo '<input type="hidden" name="return" value="', htmlspecialchars($_REQUEST['return']), '" />'."\n"; + echo '<input type="hidden" name="return" value="', htmlspecialchars($_REQUEST['return']), '" />' . "\n"; } - echo '<input type="hidden" name="page" value="', htmlspecialchars($_REQUEST['page']), '" />'."\n"; - echo '<input type="hidden" name="sortkey" value="', htmlspecialchars($_REQUEST['sortkey']), '" />'."\n"; - echo '<input type="hidden" name="sortdir" value="', htmlspecialchars($_REQUEST['sortdir']), '" />'."\n"; - echo '<input type="hidden" name="strings" value="', htmlspecialchars($_REQUEST['strings']), '" />'."\n"; - echo '<input type="hidden" name="key" value="', htmlspecialchars(urlencode(serialize($key))), '" />'."\n"; + echo '<input type="hidden" name="page" value="', htmlspecialchars($_REQUEST['page']), '" />' . "\n"; + echo '<input type="hidden" name="sortkey" value="', htmlspecialchars($_REQUEST['sortkey']), '" />' . "\n"; + echo '<input type="hidden" name="sortdir" value="', htmlspecialchars($_REQUEST['sortdir']), '" />' . "\n"; + echo '<input type="hidden" name="strings" value="', htmlspecialchars($_REQUEST['strings']), '" />' . "\n"; + echo '<input type="hidden" name="key" value="', htmlspecialchars(urlencode(serialize($key))), '" />' . "\n"; echo '<p>'; if (!$error) { - echo "<input type=\"submit\" name=\"save\" accesskey=\"r\" value=\"{$this->lang['strsave']}\" />"."\n"; + echo "<input type=\"submit\" name=\"save\" accesskey=\"r\" value=\"{$this->lang['strsave']}\" />" . "\n"; } - echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />"."\n"; + echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . "\n"; 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>"."\n"; + echo "<input type=\"checkbox\" id=\"no_ac\" value=\"1\" checked=\"checked\" /><label for=\"no_ac\">{$this->lang['strac']}</label>" . "\n"; } else { - echo "<input type=\"checkbox\" id=\"no_ac\" value=\"0\" /><label for=\"no_ac\">{$this->lang['strac']}</label>"."\n"; + echo "<input type=\"checkbox\" id=\"no_ac\" value=\"0\" /><label for=\"no_ac\">{$this->lang['strac']}</label>" . "\n"; } } - echo '</p>'."\n"; - echo '</form>'."\n"; + echo '</p>' . "\n"; + echo '</form>' . "\n"; } else { if (!isset($_POST['values'])) { $_POST['values'] = []; @@ -752,58 +758,58 @@ class DisplayController extends BaseController $resultset = $data->browseRow($_REQUEST['table'], $_REQUEST['key']); - echo '<form action="'.\SUBFOLDER.'/src/views/display" method="post">'."\n"; + echo '<form action="' . \SUBFOLDER . '/src/views/display" method="post">' . "\n"; echo $this->misc->form; if (1 == $resultset->recordCount()) { - echo "<p>{$this->lang['strconfdeleterow']}</p>"."\n"; + echo "<p>{$this->lang['strconfdeleterow']}</p>" . "\n"; $fkinfo = []; echo '<table><tr>'; $this->printTableHeaderCells($resultset, false, true); echo '</tr>'; - echo '<tr class="data1">'."\n"; + echo '<tr class="data1">' . "\n"; $this->printTableRowCells($resultset, $fkinfo, true); - echo '</tr>'."\n"; - echo '</table>'."\n"; - echo '<br />'."\n"; + echo '</tr>' . "\n"; + echo '</table>' . "\n"; + echo '<br />' . "\n"; - echo '<input type="hidden" name="action" value="delrow" />'."\n"; - echo "<input type=\"submit\" name=\"yes\" value=\"{$this->lang['stryes']}\" />"."\n"; - echo "<input type=\"submit\" name=\"no\" value=\"{$this->lang['strno']}\" />"."\n"; + echo '<input type="hidden" name="action" value="delrow" />' . "\n"; + echo "<input type=\"submit\" name=\"yes\" value=\"{$this->lang['stryes']}\" />" . "\n"; + echo "<input type=\"submit\" name=\"no\" value=\"{$this->lang['strno']}\" />" . "\n"; } elseif (1 != $resultset->recordCount()) { - echo "<p>{$this->lang['strrownotunique']}</p>"."\n"; - echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />"."\n"; + echo "<p>{$this->lang['strrownotunique']}</p>" . "\n"; + echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . "\n"; } else { - echo "<p>{$this->lang['strinvalidparam']}</p>"."\n"; - echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />"."\n"; + echo "<p>{$this->lang['strinvalidparam']}</p>" . "\n"; + echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />" . "\n"; } if (isset($_REQUEST['table'])) { - echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />'."\n"; + echo '<input type="hidden" name="table" value="', htmlspecialchars($_REQUEST['table']), '" />' . "\n"; } if (isset($_REQUEST['subject'])) { - echo '<input type="hidden" name="subject" value="', htmlspecialchars($_REQUEST['subject']), '" />'."\n"; + echo '<input type="hidden" name="subject" value="', htmlspecialchars($_REQUEST['subject']), '" />' . "\n"; } if (isset($_REQUEST['query'])) { - echo '<input type="hidden" name="query" value="', htmlspecialchars($_REQUEST['query']), '" />'."\n"; + echo '<input type="hidden" name="query" value="', htmlspecialchars($_REQUEST['query']), '" />' . "\n"; } if (isset($_REQUEST['count'])) { - echo '<input type="hidden" name="count" value="', htmlspecialchars($_REQUEST['count']), '" />'."\n"; + echo '<input type="hidden" name="count" value="', htmlspecialchars($_REQUEST['count']), '" />' . "\n"; } if (isset($_REQUEST['return'])) { - echo '<input type="hidden" name="return" value="', htmlspecialchars($_REQUEST['return']), '" />'."\n"; + echo '<input type="hidden" name="return" value="', htmlspecialchars($_REQUEST['return']), '" />' . "\n"; } - echo '<input type="hidden" name="page" value="', htmlspecialchars($_REQUEST['page']), '" />'."\n"; - echo '<input type="hidden" name="sortkey" value="', htmlspecialchars($_REQUEST['sortkey']), '" />'."\n"; - echo '<input type="hidden" name="sortdir" value="', htmlspecialchars($_REQUEST['sortdir']), '" />'."\n"; - echo '<input type="hidden" name="strings" value="', htmlspecialchars($_REQUEST['strings']), '" />'."\n"; - echo '<input type="hidden" name="key" value="', htmlspecialchars(urlencode(serialize($_REQUEST['key']))), '" />'."\n"; - echo '</form>'."\n"; + echo '<input type="hidden" name="page" value="', htmlspecialchars($_REQUEST['page']), '" />' . "\n"; + echo '<input type="hidden" name="sortkey" value="', htmlspecialchars($_REQUEST['sortkey']), '" />' . "\n"; + echo '<input type="hidden" name="sortdir" value="', htmlspecialchars($_REQUEST['sortdir']), '" />' . "\n"; + echo '<input type="hidden" name="strings" value="', htmlspecialchars($_REQUEST['strings']), '" />' . "\n"; + echo '<input type="hidden" name="key" value="', htmlspecialchars(urlencode(serialize($_REQUEST['key']))), '" />' . "\n"; + echo '</form>' . "\n"; } else { $status = $data->deleteRow($_POST['table'], unserialize(urldecode($_POST['key']))); if (0 == $status) { @@ -832,7 +838,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').'&subject=table'; + $fkey_information['common_url'] = $this->misc->getHREF('schema') . '&subject=table'; // build the FK constraints data structure while (!$constraints->EOF) { @@ -840,7 +846,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']).'&schema='.urlencode($constr['f_schema']), + 'url_data' => 'table=' . urlencode($constr['f_table']) . '&schema=' . urlencode($constr['f_schema']), 'fkeys' => [], 'consrc' => $constr['consrc'], ]; @@ -882,7 +888,7 @@ class DisplayController extends BaseController $finfo = $resultset->fetchField($j); if (false === $args) { - echo '<th class="data">', $this->misc->printVal($finfo->name), '</th>'."\n"; + echo '<th class="data">', $this->misc->printVal($finfo->name), '</th>' . "\n"; } else { $args['page'] = $_REQUEST['page']; $args['sortkey'] = $j + 1; @@ -898,12 +904,12 @@ class DisplayController extends BaseController , $this->misc->printVal($finfo->name); if ($_REQUEST['sortkey'] == ($j + 1)) { if ('asc' == $_REQUEST['sortdir']) { - echo '<img src="'.$this->misc->icon('RaiseArgument').'" alt="asc">'; + echo '<img src="' . $this->misc->icon('RaiseArgument') . '" alt="asc">'; } else { - echo '<img src="'.$this->misc->icon('LowerArgument').'" alt="desc">'; + echo '<img src="' . $this->misc->icon('LowerArgument') . '" alt="desc">'; } } - echo '</a></th>'."\n"; + echo '</a></th>' . "\n"; } ++$j; } @@ -937,16 +943,16 @@ 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 .= '&'.urlencode("fkey[{$f_field}]").'='.urlencode($resultset->fields[$p_field]); + $query_params .= '&' . urlencode("fkey[{$f_field}]") . '=' . urlencode($resultset->fields[$p_field]); } // $fkey_information['common_url'] is already urlencoded - $query_params .= '&'.$fkey_information['common_url']; + $query_params .= '&' . $fkey_information['common_url']; echo '<div style="display:inline-block;">'; - echo '<a class="fk fk_'.htmlentities($conid, ENT_QUOTES, 'UTF-8')."\" href=\"display?{$query_params}\">"; - echo '<img src="'.$this->misc->icon('ForeignKey').'" style="vertical-align:middle;" alt="[fk]" title="' - .htmlentities($fkey_information['byconstr'][$conid]['consrc'], ENT_QUOTES, 'UTF-8') - .'" />'; + echo '<a class="fk fk_' . htmlentities($conid, ENT_QUOTES, 'UTF-8') . "\" href=\"display?{$query_params}\">"; + echo '<img src="' . $this->misc->icon('ForeignKey') . '" style="vertical-align:middle;" alt="[fk]" title="' + . htmlentities($fkey_information['byconstr'][$conid]['consrc'], ENT_QUOTES, 'UTF-8') + . '" />'; echo '</a>'; echo '</div>'; } @@ -986,7 +992,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>'."\n"; + echo '<a href="javascript:void(0);" style="display:table-cell;" class="fk_delete"><img alt="[delete]" src="' . $this->misc->icon('Delete') . '" /></a>' . "\n"; echo '<div style="display:table-cell;">'; if (is_object($resultset) && $resultset->recordCount() > 0) { @@ -997,10 +1003,10 @@ class DisplayController extends BaseController echo '<table><tr>'; $this->printTableHeaderCells($resultset, false, true); echo '</tr>'; - echo '<tr class="data1">'."\n"; + echo '<tr class="data1">' . "\n"; $this->printTableRowCells($resultset, $fkinfo, true); - echo '</tr>'."\n"; - echo '</table>'."\n"; + echo '</tr>' . "\n"; + echo '</table>' . "\n"; } else { echo $this->lang['strnodata']; } @@ -1051,7 +1057,7 @@ class DisplayController extends BaseController unset($gets['page']); $url = http_build_query($gets); - $result = '<p style="text-align: center">'."\n"; + $result = '<p style="text-align: center">' . "\n"; if ($page != 1) { $result .= sprintf('<a class="pagenav" href="?%s&page=1">%s</a>%s ', $url, $lang['strfirst'], "\n"); $result .= sprintf('<a class="pagenav" href="?%s&page=%s">%s</a>%s', $url, $page - 1, $lang['strprev'], "\n"); @@ -1060,7 +1066,7 @@ 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))."\n"; + $result .= (($i === $page) ? $i : sprintf('<a class="pagenav" href="display?%s&page=%s">%s</a>', $url, $i, $i)) . "\n"; } if ($page != $pages) { |