Fix bug #3429633 '"Back" link from "Browse" leads to error'
authorJehan-Guillaume (ioguix) de Rorthais <ioguix@free.fr>
Thu, 29 Dec 2011 19:10:15 +0000 (20:10 +0100)
committerJehan-Guillaume (ioguix) de Rorthais <ioguix@free.fr>
Fri, 30 Dec 2011 10:54:56 +0000 (11:54 +0100)
The old design did not allow to escaped things properly without breaking
the return URL. Moreover, it raised some bug as well when the return URL
was too long, hitting the GET max length limit.
This patch remove the old architecture and introduce the new "return"
GET parameter that only holds the name of the section we want to go
back.

classes/Misc.php
colproperties.php
display.php
reports.php
sql.php
tables.php
tblproperties.php
viewproperties.php
views.php

index 49774ff6f56e4deea3b7057f5a8260f53c149679..6a2fce8fe0d308e48e1d25dd5c3bb77c1758faa8 100644 (file)
                        return htmlentities($href);
                }
 
+               function getHREFSubject($subject) {
+
+                       $vars = array();
+
+                       switch($subject) {
+                               case 'root':
+                                       return 'redirect.php?subject=root';
+                                       break;
+                               case 'server':
+                                       $vars = array (
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'server'
+                                       );
+                                       break;
+                               case 'report':
+                                       return 'reports.php?'. http_build_query(array(
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'report',
+                                               'report' => $_REQUEST['report']
+                                       ), '', '&amp;');
+                                       break;
+                               case 'role':
+                                       $vars = array(
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'role',
+                                               'action' => 'properties',
+                                               'rolename' => $_REQUEST['rolename']
+                                       );
+                                       break;
+                               case 'database':
+                                       $vars = array(
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'database',
+                                               'database' => $_REQUEST['database'],
+                                       );
+                                       break;
+                               case 'schema':
+                                       $vars = array(
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'schema',
+                                               'database' => $_REQUEST['database'],
+                                               'schema' => $_REQUEST['schema']
+                                       );
+                                       break;
+                               case 'slony_cluster':
+                                       $vars = array(
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'slony_cluster',
+                                               'database' => $_REQUEST['database'],
+                                               'schema' => $_REQUEST['schema'],
+                                               'slony_cluster' => $_REQUEST['slony_cluster']
+                                       );
+                                       break;
+                               case 'table':
+                                       $vars = array(
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'table',
+                                               'database' => $_REQUEST['database'],
+                                               'schema' => $_REQUEST['schema'],
+                                               'table' => $_REQUEST['table']
+                                       );
+                                       break;
+                               case 'selectrows':
+                                       return 'tables.php?'. http_build_query(array(
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'table',
+                                               'database' => $_REQUEST['database'],
+                                               'schema' => $_REQUEST['schema'],
+                                               'table' => $_REQUEST['table'],
+                                               'action' => 'confselectrows'
+                                       ), '', '&amp;');
+                                       break;
+                               case 'view':
+                                       $vars = array(
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'view',
+                                               'database' => $_REQUEST['database'],
+                                               'schema' => $_REQUEST['schema'],
+                                               'view' => $_REQUEST['view']
+                                       );
+                                       break;
+                               case 'fulltext':
+                               case 'ftscfg':
+                                       $vars = array(
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'fulltext',
+                                               'database' => $_REQUEST['database'],
+                                               'schema' => $_REQUEST['schema'],
+                                               'action' => 'viewconfig',
+                                               'ftscfg' => $_REQUEST['ftscfg']
+                                       );
+                                       break;
+                               case 'function':
+                                       $vars = array(
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'function',
+                                               'database' => $_REQUEST['database'],
+                                               'schema' => $_REQUEST['schema'],
+                                               'function' => $_REQUEST['function'],
+                                               'function_oid' => $_REQUEST['function_oid']
+                                       );
+                                       break;
+                               case 'aggregate':
+                                       $vars = array(
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'aggregate',
+                                               'action' => 'properties',
+                                               'database' => $_REQUEST['database'],
+                                               'schema' => $_REQUEST['schema'],
+                                               'aggrname' => $_REQUEST['aggrname'],
+                                               'aggrtype' => $_REQUEST['aggrtype']
+                                       );
+                                       break;
+                               case 'slony_node':
+                                       $vars = array(
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'slony_cluster',
+                                               'database' => $_REQUEST['database'],
+                                               'schema' => $_REQUEST['schema'],
+                                               'no_id' => $_REQUEST['no_id'],
+                                               'no_name' => $_REQUEST['no_name']
+                                       );
+                                       break;
+                               case 'slony_set':
+                                       $vars = array(
+                                               'server' => $_REQUEST['server'],
+                                               'subject' => 'slony_set',
+                                               'database' => $_REQUEST['database'],
+                                               'schema' => $_REQUEST['schema'],
+                                               'slony_set_id' => $_REQUEST['slony_set'],
+                                               'slony_set' => $_REQUEST['slony_set']
+                                       );
+                                       break;
+                               case 'column':
+                                       if (isset($_REQUEST['table']))
+                                               $vars = array(
+                                                       'server' => $_REQUEST['server'],
+                                                       'subject' => 'column',
+                                                       'database' => $_REQUEST['database'],
+                                                       'schema' => $_REQUEST['schema'],
+                                                       'table' => $_REQUEST['table'],
+                                                       'column' => $_REQUEST['column']
+                                               );
+                                       else
+                                               $vars = array(
+                                                       'server' => $_REQUEST['server'],
+                                                       'subject' => 'column',
+                                                       'database' => $_REQUEST['database'],
+                                                       'schema' => $_REQUEST['schema'],
+                                                       'view' => $_REQUEST['view'],
+                                                       'column' => $_REQUEST['column']
+                                               );
+                                       break;
+                               default:
+                                       return false;
+                       }
+
+                       return 'redirect.php?'. http_build_query($vars, '', '&amp;');
+               }
+
                /**
                 * Sets the form tracking variable
                 */
                                $crumblink = "<a";
 
                                if (isset($crumb['url']))
-                                       $crumblink .= ' href="' . $this->printVal($crumb['url'], 'nbsp') . '"';
+                                       $crumblink .= " href=\"{$crumb['url']}\"";
 
                                if (isset($crumb['title']))
                                        $crumblink .= " title=\"{$crumb['title']}\"";
                        if ($subject == 'root') $done = true;
 
                        if (!$done) {
-                               $vars = 'server='.urlencode($_REQUEST['server']).'&';
                                $server_info = $this->getServerInfo();
                                $trail['server'] = array(
                                        'title' => $lang['strserver'],
                                        'text'  => $server_info['desc'],
-                                       'url'   => "redirect.php?subject=server&{$vars}",
+                                       'url'   => $this->getHREFSubject('server'),
                                        'help'  => 'pg.server',
                                        'icon'  => 'Server'
                                );
                        if ($subject == 'server') $done = true;
 
                        if (isset($_REQUEST['report']) && !$done) {
-                               $vars .= 'report='.urlencode($_REQUEST['report']).'&';
                                $trail['report'] = array(
                                        'title' => $lang['strreport'],
                                        'text'  => $_REQUEST['report'],
-                                       'url'   => "reports.php?subject=report&{$vars}",
+                                       'url'   => $this->getHREFSubject('report'),
                                        'icon'  => 'Report'
                                );
                        }
 
                        if (isset($_REQUEST['database']) && !$done) {
-                               $vars .= 'database='.urlencode($_REQUEST['database']).'&';
                                $trail['database'] = array(
                                        'title' => $lang['strdatabase'],
                                        'text'  => $_REQUEST['database'],
-                                       'url'   => "redirect.php?subject=database&{$vars}",
+                                       'url'   => $this->getHREFSubject('database'),
                                        'help'  => 'pg.database',
                                        'icon'  => 'Database'
                                );
                        } elseif (isset($_REQUEST['rolename']) && !$done) {
-                               $vars .= "subject=role&action=properties&rolename=".urlencode($_REQUEST['rolename']);
                                $trail['role'] = array(
                                        'title' => $lang['strrole'],
                                        'text'  => $_REQUEST['rolename'],
-                                       'url'   => "redirect.php?{$vars}",
+                                       'url'   => $this->getHREFSubject('role'),
                                        'help'  => 'pg.role',
                                        'icon'  => 'Roles'
                                );
                        if ($subject == 'database' || $subject == 'role' || $subject == 'report') $done = true;
 
                        if (isset($_REQUEST['schema']) && !$done) {
-                               $vars .= 'schema='.urlencode($_REQUEST['schema']).'&';
                                $trail['schema'] = array(
                                        'title' => $lang['strschema'],
                                        'text'  => $_REQUEST['schema'],
-                                       'url'   => "redirect.php?subject=schema&{$vars}",
+                                       'url'   => $this->getHREFSubject('schema'),
                                        'help'  => 'pg.schema',
                                        'icon'  => 'Schema'
                                );
                        if ($subject == 'schema') $done = true;
 
                        if (isset($_REQUEST['slony_cluster']) && !$done) {
-                               $vars .= 'slony_cluster='.urlencode($_REQUEST['slony_cluster']).'&';
                                $trail['slony_cluster'] = array(
                                        'title' => 'Slony Cluster',
                                        'text'  => $_REQUEST['slony_cluster'],
-                                       'url'   => "redirect.php?subject=slony_cluster&{$vars}",
+                                       'url'   => $this->getHREFSubject('slony_cluster'),
                                        'help'  => 'sl.cluster',
                                        'icon'  => 'Cluster'
                                );
                        if ($subject == 'slony_cluster') $done = true;
 
                        if (isset($_REQUEST['table']) && !$done) {
-                               $vars .= "table=".urlencode($_REQUEST['table']);
                                $trail['table'] = array(
                                        'title' => $lang['strtable'],
                                        'text'  => $_REQUEST['table'],
-                                       'url'   => "redirect.php?subject=table&{$vars}",
+                                       'url'   => $this->getHREFSubject('table'),
                                        'help'  => 'pg.table',
                                        'icon'  => 'Table'
                                );
                        } elseif (isset($_REQUEST['view']) && !$done) {
-                               $vars .= "view=".urlencode($_REQUEST['view']);
                                $trail['view'] = array(
                                        'title' => $lang['strview'],
                                        'text'  => $_REQUEST['view'],
-                                       'url'   => "redirect.php?subject=view&{$vars}",
+                                       'url'   => $this->getHREFSubject('view'),
                                        'help'  => 'pg.view',
                                        'icon'  => 'View'
                                );
                        } elseif (isset($_REQUEST['ftscfg']) && !$done) {
-                               $vars .= "action=viewconfig&ftscfg=".urlencode($_REQUEST['ftscfg']);
                                $trail['ftscfg'] = array(
                                        'title' => $lang['strftsconfig'],
                                        'text'  => $_REQUEST['ftscfg'],
-                                       'url'   => "fulltext.php?{$vars}",
+                                       'url'   => $this->getHREFSubject('ftscfg'),
                                        'help'  => 'pg.ftscfg.example',
                                        'icon'  => 'Fts'
                                );
                        if (!$done && !is_null($subject)) {
                                switch ($subject) {
                                        case 'function':
-                                               $vars .= "{$subject}_oid=".urlencode($_REQUEST[$subject.'_oid']).'&';
-                                               $vars .= "subject={$subject}&{$subject}=".urlencode($_REQUEST[$subject]);
                                                $trail[$subject] = array(
                                                        'title' => $lang['str'.$subject],
                                                        'text'  => $_REQUEST[$subject],
-                                                       'url'   => "redirect.php?{$vars}",
+                                                       'url'   => $this->getHREFSubject('function'),
                                                        'help'  => 'pg.function',
                                                        'icon'  => 'Function'
                                                );
                                                break;
                                        case 'aggregate':
-                                               $vars .= "subject=aggregate&action=properties&aggrname=".urlencode($_REQUEST['aggrname']);
-                                               $vars .= "&aggrtype=".urlencode($_REQUEST['aggrtype']);
                                                $trail[$subject] = array(
                                                        'title' => $lang['straggregate'],
                                                        'text'  => $_REQUEST['aggrname'],
-                                                       'url'   => "redirect.php?{$vars}",
+                                                       'url'   => $this->getHREFSubject('aggregate'),
                                                        'help'  => 'pg.aggregate',
                                                        'icon'  => 'Aggregate'
                                                );
                                                break;
                                        case 'slony_node':
-                                               $vars .= 'no_id='.urlencode($_REQUEST['no_id']).'&no_name='.urlencode($_REQUEST['no_name']);
                                                $trail[$subject] = array(
                                                        'title' => 'Slony Node',
                                                        'text'  => $_REQUEST['no_name'],
-                                                       'url'   => "redirect.php?{$vars}",
                                                        'help'  => 'sl.'.$subject,
                                                        'icon'  => 'Node'
                                                );
                                                break;
                                        case 'slony_set':
-                                               $vars .= "{$subject}_id=".urlencode($_REQUEST[$subject]).'&';
-                                               $vars .= "subject={$subject}&{$subject}=".urlencode($_REQUEST[$subject]);
                                                $trail[$subject] = array(
                                                        'title' => $lang['str'.$subject],
                                                        'text'  => $_REQUEST[$subject],
-                                                       'url'   => "redirect.php?{$vars}",
                                                        'help'  => 'sl.'.$subject,
                                                        'icon'  => 'AvailableReplicationSet'
                                                );
                                                break;
                                        case 'column':
-                                               $vars .= "&column=". urlencode($_REQUEST['column']) ."&subject=column";
                                                $trail['column'] = array (
                                                        'title' => $lang['strcolumn'],
                                                        'text'  => $_REQUEST['column'],
                                                        'icon'  => 'Column',
-                                                       'url'   => "redirect.php?{$vars}"
+                                                       'url'   => $this->getHREFSubject('column')
                                                );
                                                break;
                                        default:
index 9aa7f7293d6d9b23f084b7936e53a1cdfe9f2312..c16ae900e57f16e347e0ee30aac046572bf938f2 100644 (file)
                        $query_url = urlencode("SELECT \"{$f_attname}\", count(*) AS \"count\" FROM \"{$f_schema}\".\"{$f_table}\" GROUP BY \"{$f_attname}\" ORDER BY \"{$f_attname}\"") ;
 
                        if ($isTable) {
-                               $return_url = urlencode("colproperties.php?{$misc->href}&amp;table=". urlencode($tableName)
-                                       ."&amp;column=". urlencode($_REQUEST['column']));
-
                                /* Browse link */
                                /* FIXME browsing a col should somehow be a action so we don't
                                 * send an ugly SQL in the URL */
                                echo "\t<li><a href=\"display.php?{$misc->href}&amp;subject=column&amp;table=",
                                        urlencode($_REQUEST['table']),
                                        "&amp;column=", urlencode($_REQUEST['column']),
-                                       "&amp;return_url={$return_url}&amp;return_desc=", urlencode($lang['strback']), 
+                                       "&amp;return=column",
                                        "&amp;query={$query_url}\">{$lang['strbrowse']}</a></li>\n";
 
                                /* Edit link */
                                echo "\t<li><a href=\"colproperties.php?action=properties&amp;{$misc->href}&amp;table=", urlencode($tableName),
                                    "&amp;column=", urlencode($_REQUEST['column']) . "\">{$lang['stralter']}</a></li>\n";
                                
-                                       echo "\t<li><a href=\"tblproperties.php?action=confirm_drop&amp;{$misc->href}&amp;table=", urlencode($tableName),
-                                               "&amp;column=" . urlencode($_REQUEST['column']) . "\">{$lang['strdrop']}</a></li>\n";
+                               echo "\t<li><a href=\"tblproperties.php?action=confirm_drop&amp;{$misc->href}&amp;table=", urlencode($tableName),
+                                       "&amp;column=" . urlencode($_REQUEST['column']) . "\">{$lang['strdrop']}</a></li>\n";
                        } else {
-                               $return_url = urlencode("colproperties.php?{$misc->href}&amp;view=". urlencode($tableName)
-                                       ."&amp;column=". urlencode($_REQUEST['column']));
                                /* Browse link */
-                               echo "\t<li><a href=\"display.php?{$misc->href}&amp;subject=column&amp;column=",
-                                       urlencode($_REQUEST['column']), "&amp;return_url={$return_url}&amp;return_desc=", urlencode($lang['strback']),
+                               echo "\t<li><a href=\"display.php?{$misc->href}&amp;subject=column&amp;view=",
+                                       urlencode($_REQUEST['view']),
+                                       "&amp;column=", urlencode($_REQUEST['column']),
+                                       "&amp;return=column",
                                        "&amp;query={$query_url}\">{$lang['strbrowse']}</a></li>\n";
                        }
 
index b7a31ceda72efd23d1a40016ce13afb58251775a..41bcfab082807d58b33a81da8b4a98d3287636c1 100644 (file)
@@ -5,8 +5,7 @@
         * tables, reports, arbitrary queries, etc. to avoid code duplication.
         * @param $query The SQL SELECT string to execute
         * @param $count The same SQL query, but only retrieves the count of the rows (AS total)
-        * @param $return_url The return URL
-        * @param $return_desc The return link name
+        * @param $return The return section
         * @param $page The current page
         *
         * $Id: display.php,v 1.68 2008/04/14 12:44:27 ioguix Exp $
                                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";
-                       if (isset($_REQUEST['return_url']))
-                               echo "<input type=\"hidden\" name=\"return_url\" value=\"", htmlspecialchars($_REQUEST['return_url']), "\" />\n";
-                       if (isset($_REQUEST['return_desc']))
-                               echo "<input type=\"hidden\" name=\"return_desc\" value=\"", htmlspecialchars($_REQUEST['return_desc']), "\" />\n";
+                       if (isset($_REQUEST['return']))
+                               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=\"query\" value=\"", htmlspecialchars($_REQUEST['query']), "\" />\n";
                        if (isset($_REQUEST['count']))
                                echo "<input type=\"hidden\" name=\"count\" value=\"", htmlspecialchars($_REQUEST['count']), "\" />\n";
-                       if (isset($_REQUEST['return_url']))
-                               echo "<input type=\"hidden\" name=\"return_url\" value=\"", htmlspecialchars($_REQUEST['return_url']), "\" />\n";
-                       if (isset($_REQUEST['return_desc']))
-                               echo "<input type=\"hidden\" name=\"return_desc\" value=\"", htmlspecialchars($_REQUEST['return_desc']), "\" />\n";
+                       if (isset($_REQUEST['return']))
+                               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";
                        $constraints = $data->getConstraintsWithFields($_REQUEST['table']);
                        if ($constraints->recordCount() > 0) {
 
-                               /* build the common parts of the url for the FK  */
-                               $fk_return_url = "{$misc->href}&amp;subject=table&amp;table=". urlencode($_REQUEST['table']);
-                               if (isset($_REQUEST['page'])) $fk_return_url .= "&amp;page=" . urlencode($_REQUEST['page']);
-                               if (isset($_REQUEST['query'])) $fk_return_url .= "&amp;query=" . urlencode($_REQUEST['query']);
-                               if (isset($_REQUEST['search_path'])) $fk_return_url .= "&amp;search_path=" . urlencode($_REQUEST['search_path']);
-
-                               /* yes, we double urlencode fk_return_url so parameters here don't 
-                                * overwrite real one when included in the final url */
-                               $fkey_information['common_url'] = $misc->getHREF('schema') .'&amp;subject=table&amp;return_url=display.php?'
-                                       . urlencode($fk_return_url) .'&amp;return_desc='. urlencode($lang['strback']);
+                               $fkey_information['common_url'] = $misc->getHREF('schema') .'&amp;subject=table';
 
                                /* build the FK constraints data structure */
                                while (!$constraints->EOF) {
                if (isset($_REQUEST['query'])) $gets .= "&amp;query=" . urlencode($_REQUEST['query']);
                if (isset($_REQUEST['report'])) $gets .= "&amp;report=" . urlencode($_REQUEST['report']);
                if (isset($_REQUEST['count'])) $gets .= "&amp;count=" . urlencode($_REQUEST['count']);
-               if (isset($_REQUEST['return_url'])) $gets .= "&amp;return_url=" . urlencode($_REQUEST['return_url']);
-               if (isset($_REQUEST['return_desc'])) $gets .= "&amp;return_desc=" . urlencode($_REQUEST['return_desc']);
+               if (isset($_REQUEST['return'])) $gets .= "&amp;return=" . urlencode($_REQUEST['return']);
                if (isset($_REQUEST['search_path'])) $gets .= "&amp;search_path=" . urlencode($_REQUEST['search_path']);
                if (isset($_REQUEST['table'])) $gets .= "&amp;table=" . urlencode($_REQUEST['table']);
                
                echo "<ul class=\"navlink\">\n";
 
                // Return
-               if (isset($_REQUEST['return_url']) && isset($_REQUEST['return_desc']))
-                       echo "\t<li><a href=\"". htmlspecialchars($_REQUEST['return_url']) ."\">". htmlspecialchars($_REQUEST['return_desc']) ."</a></li>\n";
+               if (isset($_REQUEST['return'])) {
+                       $return_url = $misc->getHREFSubject($_REQUEST['return']);
+
+                       if ($return_url)
+                               echo "\t<li><a href=\"{$return_url}\">{$lang['strback']}</a></li>\n";
+               }
 
                // Edit SQL link
                if (isset($_REQUEST['query']))
index 3e13ad5b52b44b96d2df16b4b9cde4e40da14ccf..148ff5c93ac9ca6bf61023fda41952e808ccc047 100644 (file)
                        ),
                );
                
-               $return_url = urlencode("reports.php?{$misc->href}");
-               
                $actions = array(
                        'run' => array(
                                'title' => $lang['strexecute'],
-                               'url'   => "sql.php?subject=report&amp;{$misc->href}&amp;return_url={$return_url}&amp;return_desc=".urlencode($lang['strback'])."&amp;",
+                               'url'   => "sql.php?subject=report&amp;{$misc->href}&amp;return=report&amp;",
                                'vars'  => array('report' => 'report_name', 'database' => 'db_name', 'reportid' => 'report_id', 'paginate' => 'paginate'),
                        ),
                        'edit' => array(
diff --git a/sql.php b/sql.php
index 8280e3d2024440e18fc5b15e267f9e739ad419f1..9ab6fc5944c0bbb1ae98ff32ca29b8fb179df3ca 100644 (file)
--- a/sql.php
+++ b/sql.php
        echo "<ul class=\"navlink\">\n";
        
        // Return
-       if (isset($_REQUEST['return_url']) && isset($_REQUEST['return_desc']))
-               echo "\t<li><a href=\"{$_REQUEST['return_url']}\">{$_REQUEST['return_desc']}</a></li>\n";
+       if (isset($_REQUEST['return'])) {
+               $return_url = $misc->getHREFSubject($_REQUEST['return']);
+               echo "\t<li><a href=\"{$return_url}\">{$lang['strback']}</a></li>\n";
+       }
 
        // Edit         
        echo "\t<li><a href=\"database.php?database=", urlencode($_REQUEST['database']),
index 469457192c23a9bc63bc5576b6a2c5d347d2d02e..0ba0edc7c88212bf9d1e69acdc85cc4c87282164 100644 (file)
                                $query = $data->getSelectSQL($_REQUEST['table'], array_keys($_POST['show']),
                                        $_POST['values'], $_POST['ops']);
                                $_REQUEST['query'] = $query;
-                               $_REQUEST['return_url'] = "tables.php?action=confselectrows&amp;{$misc->href}&amp;table={$_REQUEST['table']}";
-                               $_REQUEST['return_desc'] = $lang['strback'];
+                               $_REQUEST['return'] = 'selectrows';
 
                                $_no_output = true;
                                include('./display.php');
                        ),
                        'browse' => array(
                                'title' => $lang['strbrowse'],
-                               'url'   => "display.php?{$misc->href}&amp;subject=table&amp;return_url=".urlencode("tables.php?{$misc->href}")."&amp;return_desc=".urlencode($lang['strback'])."&amp;",
+                               'url'   => "display.php?{$misc->href}&amp;subject=table&amp;return=schema&amp;",
                                'vars'  => array('table' => 'relname'),
                        ),
                        'select' => array(
index f65e284b480d073293f95415d1944771cb267892..c9aa64bed30bd6b5353a67e421d45263deb9a868 100644 (file)
                        return $str;
                }
 
-               $return_url = urlencode("tblproperties.php?{$misc->href}&amp;table=". urlencode($_REQUEST['table']));
-
                $actions = array(
                        'browse' => array(
                                'title' => $lang['strbrowse'],
-                               'url' => "display.php?{$misc->href}&amp;subject=column&amp;return_url={$return_url}&amp;table=".urlencode($_REQUEST['table'])."&amp;return_desc=" . urlencode($lang['strback']) . '&amp;',
+                               'url' => "display.php?{$misc->href}&amp;subject=column&amp;return=table&amp;table=".urlencode($_REQUEST['table']).'&amp;',
                                'vars' => array('column' => 'attname'),
                        ),
                        'alter' => array(
                $misc->printTable($attrs, $columns, $actions, null, 'attPre');
 
                echo "<ul class=\"navlink\">\n";
-               echo "\t<li><a href=\"display.php?{$misc->href}&amp;table=", urlencode($_REQUEST['table']), "&amp;subject=table&amp;return_url={$return_url}&amp;return_desc=",
-                       urlencode($lang['strback']), "\">{$lang['strbrowse']}</a></li>\n";
+               echo "\t<li><a href=\"display.php?{$misc->href}&amp;table=", urlencode($_REQUEST['table']), "&amp;subject=table&amp;return=table\">{$lang['strbrowse']}</a></li>\n";
                echo "\t<li><a href=\"tables.php?action=confselectrows&amp;{$misc->href}&amp;table=", urlencode($_REQUEST['table']),"\">{$lang['strselect']}</a></li>\n";
                echo "\t<li><a href=\"tables.php?action=confinsertrow&amp;{$misc->href}&amp;table=", urlencode($_REQUEST['table']),"\">{$lang['strinsert']}</a></li>\n";
                echo "\t<li><a href=\"tables.php?action=confirm_empty&amp;{$misc->href}&amp;table=", urlencode($_REQUEST['table']),"\">{$lang['strempty']}</a></li>\n";
index 5d97366530fd4de189fef174a4ca291f7a0db00d..3073352c005e038d7ae1219678d4681ffda56f39 100755 (executable)
                echo "<br />\n";
 
                echo "<ul class=\"navlink\">\n";
-               $return_url = urlencode("viewproperties.php?{$misc->href}&amp;view=" . urlencode($_REQUEST['view']));
-               echo "\t<li><a href=\"display.php?{$misc->href}&amp;view=", urlencode($_REQUEST['view']), "&amp;subject=view&amp;return_url={$return_url}&amp;return_desc=",
-                       urlencode($lang['strback']), "\">{$lang['strbrowse']}</a></li>\n";
+               echo "\t<li><a href=\"display.php?{$misc->href}&amp;view=", urlencode($_REQUEST['view']), "&amp;subject=view&amp;return=view\">{$lang['strbrowse']}</a></li>\n";
                echo "\t<li><a href=\"views.php?action=confselectrows&amp;{$misc->href}&amp;view=", urlencode($_REQUEST['view']),"\">{$lang['strselect']}</a></li>\n";
                echo "\t<li><a href=\"views.php?action=confirm_drop&amp;{$misc->href}&amp;view=", urlencode($_REQUEST['view']),"\">{$lang['strdrop']}</a></li>\n";
                echo "\t<li><a href=\"viewproperties.php?action=confirm_alter&amp;{$misc->href}&amp;view=", urlencode($_REQUEST['view']),"\">{$lang['stralter']}</a></li>\n";
index e784103136241de0fb1e3e0779e95cdc1c232e56..e20ff80cb7dcec4d63fa89e768c1f811dffd7f1e 100644 (file)
--- a/views.php
+++ b/views.php
                        else {
                                // Generate query SQL
                                $query = $data->getSelectSQL($_REQUEST['view'], array_keys($_POST['show']),
-                                       $_POST['values'], $_POST['ops']);
+                               $_POST['values'], $_POST['ops']);
                                $_REQUEST['query'] = $query;
-                               $_REQUEST['return_url'] = "views.php?action=confselectrows&amp;{$misc->href}&amp;view=". urlencode($_REQUEST['view']);
-                               $_REQUEST['return_desc'] = $lang['strback'];
-                       
-                                $_no_output = true;    
+                               $_REQUEST['return'] = "schema";
+                               $_no_output = true;
                                include('./display.php');
                                exit;
                        }
                        ),
                        'browse' => array(
                                'title' => $lang['strbrowse'],
-                               'url'   => "display.php?{$misc->href}&amp;subject=view&amp;return_url=".urlencode("views.php?{$misc->href}")."&amp;return_desc=".urlencode($lang['strback'])."&amp;",
+                               'url'   => "display.php?{$misc->href}&amp;subject=view&amp;return=schema&amp;",
                                'vars'  => array('view' => 'relname'),
                        ),
                        'select' => array(