diff options
author | Leonardo Sapiras | 2012-01-04 00:00:09 +0000 |
---|---|---|
committer | Jehan-Guillaume (ioguix) de Rorthais | 2012-08-22 10:26:04 +0000 |
commit | 0f563228264b18a77dd33266bb1344c8bc5f82b4 (patch) | |
tree | 002a2731fb72e544efab3423aae0e828c21f83d5 | |
parent | 3d2a2102958691fa741e1652ff4447a0531ea03c (diff) |
Add support for 'navlink' hooks in the plugin architecture.
By Leonardo Sapiras during the GSoC 2011. Reviewed, massively patched,
fixed, integrated and commited by ioguix
-rw-r--r-- | aggregates.php | 76 | ||||
-rw-r--r-- | all_db.php | 17 | ||||
-rw-r--r-- | classes/Misc.php | 173 | ||||
-rw-r--r-- | classes/PluginManager.php | 2 | ||||
-rw-r--r-- | colproperties.php | 97 | ||||
-rw-r--r-- | constraints.php | 71 | ||||
-rw-r--r-- | display.php | 188 | ||||
-rw-r--r-- | domains.php | 74 | ||||
-rw-r--r-- | fulltext.php | 69 | ||||
-rw-r--r-- | functions.php | 105 | ||||
-rw-r--r-- | groups.php | 25 | ||||
-rw-r--r-- | history.php | 51 | ||||
-rw-r--r-- | indexes.php | 19 | ||||
-rw-r--r-- | operators.php | 18 | ||||
-rw-r--r-- | privileges.php | 84 | ||||
-rw-r--r-- | reports.php | 66 | ||||
-rw-r--r-- | roles.php | 76 | ||||
-rw-r--r-- | rules.php | 17 | ||||
-rwxr-xr-x | schemas.php | 14 | ||||
-rw-r--r-- | sequences.php | 119 | ||||
-rw-r--r-- | servers.php | 1 | ||||
-rw-r--r-- | sql.php | 89 | ||||
-rw-r--r-- | tables.php | 39 | ||||
-rwxr-xr-x | tablespaces.php | 14 | ||||
-rw-r--r-- | tblproperties.php | 119 | ||||
-rw-r--r-- | triggers.php | 16 | ||||
-rw-r--r-- | types.php | 69 | ||||
-rw-r--r-- | users.php | 26 | ||||
-rwxr-xr-x | viewproperties.php | 88 | ||||
-rw-r--r-- | views.php | 33 |
30 files changed, 1577 insertions, 278 deletions
diff --git a/aggregates.php b/aggregates.php index 3f55f295..fdf10223 100644 --- a/aggregates.php +++ b/aggregates.php @@ -245,13 +245,59 @@ } else echo "<p>{$lang['strnodata']}</p>\n"; - echo "<ul class=\"navlink\">\n\t<li><a class=\"navlink\" href=\"aggregates.php?{$misc->href}\">{$lang['straggrshowall']}</a></li>\n"; + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'aggregates.php', + 'urlvars' => array ( + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['straggrshowall'] + ) + ); + if ($data->hasAlterAggregate()) { - echo "\t<li><a class=\"navlink\" href=\"aggregates.php?action=alter&{$misc->href}&aggrname=", - urlencode($_REQUEST['aggrname']), "&aggrtype=", urlencode($_REQUEST['aggrtype']), "\">{$lang['stralter']}</a></li>\n"; + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'aggregates.php', + 'urlvars' => array ( + 'action' => 'alter', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'aggrname' => $_REQUEST['aggrname'], + 'aggrtype' => $_REQUEST['aggrtype'] + ) + ) + ), + 'content' => $lang['stralter'] + ); } - echo "\t<li><a class=\"navlink\" href=\"aggregates.php?action=confirm_drop&{$misc->href}&aggrname=", - urlencode($_REQUEST['aggrname']), "&aggrtype=", urlencode($_REQUEST['aggrtype']), "\">{$lang['strdrop']}</a></li>\n</ul>\n"; + + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'aggregates.php', + 'urlvars' => array ( + 'action' => 'confirm_drop', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'aggrname' => $_REQUEST['aggrname'], + 'aggrtype' => $_REQUEST['aggrtype'] + ) + ) + ), + 'content' => $lang['strdrop'] + ); + + $misc->printNavLinks($navlinks, 'aggregates-properties'); } @@ -311,8 +357,24 @@ if (!$data->hasAlterAggregate()) unset($actions['alter']); $misc->printTable($aggregates, $columns, $actions, $lang['strnoaggregates']); - - echo "<p><a class=\"navlink\" href=\"aggregates.php?action=create&{$misc->href}\">{$lang['strcreateaggregate']}</a></p>\n"; + + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'aggregates.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + ) + ) + ), + 'content' => $lang['strcreateaggregate'] + ) + ); + $misc->printNavLinks($navlinks, 'aggregates-aggregates'); } /** @@ -424,8 +424,21 @@ $misc->printTable($databases, $columns, $actions, $lang['strnodatabases']); - echo "<p><a class=\"navlink\" href=\"all_db.php?action=create&{$misc->href}\">{$lang['strcreatedatabase']}</a></p>\n"; - + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'all_db.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'] + ) + ) + ), + 'content' => $lang['strcreatedatabase'] + ) + ); + $misc->printNavLinks($navlinks, 'all_db-databases'); } function doTree() { diff --git a/classes/Misc.php b/classes/Misc.php index 7ba4a125..64cd26f7 100644 --- a/classes/Misc.php +++ b/classes/Misc.php @@ -49,110 +49,109 @@ return htmlentities($href); } - function getHREFSubject($subject) { + function getSubjectParams($subject) { $vars = array(); switch($subject) { case 'root': - return 'redirect.php?subject=root'; + $vars = array ( + 'params' => array( + 'subject' => 'root' + ) + ); break; case 'server': - $vars = array ( + $vars = array ('params' => array( 'server' => $_REQUEST['server'], 'subject' => 'server' - ); + )); break; case 'report': - return 'reports.php?'. http_build_query(array( - 'server' => $_REQUEST['server'], - 'subject' => 'report', - 'report' => $_REQUEST['report'] - ), '', '&'); + $vars = array( + 'url' => 'reports.php', + 'params' => array( + 'server' => $_REQUEST['server'], + 'subject' => 'report', + 'report' => $_REQUEST['report'] + )); break; case 'role': - $vars = array( + $vars = array('params' => array( 'server' => $_REQUEST['server'], 'subject' => 'role', 'action' => 'properties', 'rolename' => $_REQUEST['rolename'] - ); + )); break; case 'database': - $vars = array( + $vars = array('params' => array( 'server' => $_REQUEST['server'], 'subject' => 'database', 'database' => $_REQUEST['database'], - ); + )); break; case 'schema': - $vars = array( + $vars = array('params' => 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( + $vars = array('params' => 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' - ), '', '&'); + $vars = array( + 'url' => 'tables.php', + 'params' => array( + 'server' => $_REQUEST['server'], + 'subject' => 'table', + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'], + 'action' => 'confselectrows' + )); break; case 'view': - $vars = array( + $vars = array('params' => array( 'server' => $_REQUEST['server'], 'subject' => 'view', 'database' => $_REQUEST['database'], 'schema' => $_REQUEST['schema'], 'view' => $_REQUEST['view'] - ); + )); break; case 'fulltext': case 'ftscfg': - $vars = array( + $vars = array('params' => array( 'server' => $_REQUEST['server'], 'subject' => 'fulltext', 'database' => $_REQUEST['database'], 'schema' => $_REQUEST['schema'], 'action' => 'viewconfig', 'ftscfg' => $_REQUEST['ftscfg'] - ); + )); break; case 'function': - $vars = array( + $vars = array('params' => 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( + $vars = array('params' => array( 'server' => $_REQUEST['server'], 'subject' => 'aggregate', 'action' => 'properties', @@ -160,53 +159,41 @@ '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( + $vars = array('params' => array( 'server' => $_REQUEST['server'], 'subject' => 'column', 'database' => $_REQUEST['database'], 'schema' => $_REQUEST['schema'], 'table' => $_REQUEST['table'], 'column' => $_REQUEST['column'] - ); + )); else - $vars = array( + $vars = array('params' => 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, '', '&'); + if (!isset($vars['url'])) + $vars['url'] = 'redirect.php'; + + return $vars; + } + + function getHREFSubject($subject) { + $vars = $this->getSubjectParams($subject); + return "{$vars['url']}?". http_build_query($vars['params'], '', '&'); } /** @@ -609,13 +596,16 @@ /** * Display a list of links * @param $links An associative array of links to print - * links = array( - * 'attr' => array( // list of A tag attribute - * ... - * ), - * 'content' => The link text - * 'fields' => the data from which content and attr's values are obtained - * ); + * links = array( + * 'attr' => array( // list of A tag attribute + * 'attrname' => attribute value + * ... + * ), + * 'content' => The link text + * 'fields' => the data from which content and attr's values are obtained + * ); + * the special attribute 'href' might be a string or an array. If href is an array it + * will be generated by getActionUrl. See getActionUrl comment for array format. * @param $class An optional class or list of classes seprated by a space * WARNING: This field is NOT escaped! No user should be able to inject something here, use with care. */ @@ -1294,16 +1284,14 @@ 'target' => "sqledit", 'onclick' => "window.open('{$sql_url}&action=sql','{$sql_window_id}','toolbar=no,width=700,height=500,resizable=yes,scrollbars=yes').focus(); return false;" ), - 'content' => noEscape(field('strsql')), - 'fields' => $lang + 'content' => $lang['strsql'] ), array ( 'attr' => array ( 'href' => $history_url, 'onclick' => "window.open('{$history_url}','{$history_window_id}','toolbar=no,width=800,height=600,resizable=yes,scrollbars=yes').focus(); return false;", ), - 'content' => noEscape(field('strhistory')), - 'fields' => $lang + 'content' => $lang['strhistory'] ), array ( 'attr' => array ( @@ -1311,16 +1299,14 @@ 'target' => "sqledit", 'onclick' => "window.open('{$sql_url}&action=find','{$sql_window_id}','toolbar=no,width=700,height=500,resizable=yes,scrollbars=yes').focus(); return false;", ), - 'content' => noEscape(field('strfind')), - 'fields' => $lang + 'content' => $lang['strfind'] ), array( 'attr' => array ( 'href' => "servers.php?action=logout&logoutServer=".htmlentities($server_info['host']).":".htmlentities($server_info['port']).":".htmlentities($server_info['sslmode']), 'onclick' => $logout_shared, ), - 'content' => noEscape(field('strlogout')), - 'fields' => $lang + 'content' => $lang['strlogout'] ) ); @@ -1565,6 +1551,29 @@ } /** + * Display the navlinks + * + * @param $navlinks - An array with the the attributes and values that will be shown. See printLinksList for array format. + * @param $place - Place where the $navlinks are displayed. Like 'display-browse', where 'display' is the file (display.php) + * and 'browse' is the place inside that code (doBrowse). + */ + function printNavLinks($navlinks=array(), $place) { + global $plugin_manager; + + // Navlinks hook's place + $plugin_functions_parameters = array( + 'navlinks' => &$navlinks, + 'place' => $place + ); + $plugin_manager->do_hook('navlinks', $plugin_functions_parameters); + + if (count($navlinks) > 0) { + $this->printLinksList($navlinks, 'navlink'); + } + } + + + /** * Do multi-page navigation. Displays the prev, next and page options. * @param $page the page currently viewed * @param $pages the maximum number of pages diff --git a/classes/PluginManager.php b/classes/PluginManager.php index 14ac543f..3932f8ce 100644 --- a/classes/PluginManager.php +++ b/classes/PluginManager.php @@ -10,7 +10,7 @@ class PluginManager { * Attributes */ private $plugins_list = array(); - private $available_hooks = array('toplinks', 'tabs', 'trail' /* wip, more hooks to come in next commits */); + private $available_hooks = array('toplinks', 'tabs', 'trail', 'navlinks' /* wip, more hooks to come in next commits */); private $actions = array(); private $hooks = array(); diff --git a/colproperties.php b/colproperties.php index c16ae900..75051423 100644 --- a/colproperties.php +++ b/colproperties.php @@ -230,41 +230,98 @@ echo "<br />\n"; - echo "<ul class=\"navlink\">\n"; $f_attname = $_REQUEST['column']; $f_table = $tableName; $f_schema = $data->_schema; $data->fieldClean($f_attname); $data->fieldClean($f_table); $data->fieldClean($f_schema); - $query_url = urlencode("SELECT \"{$f_attname}\", count(*) AS \"count\" FROM \"{$f_schema}\".\"{$f_table}\" GROUP BY \"{$f_attname}\" ORDER BY \"{$f_attname}\"") ; + $query = "SELECT \"{$f_attname}\", count(*) AS \"count\" FROM \"{$f_schema}\".\"{$f_table}\" GROUP BY \"{$f_attname}\" ORDER BY \"{$f_attname}\""; if ($isTable) { + /* 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}&subject=column&table=", - urlencode($_REQUEST['table']), - "&column=", urlencode($_REQUEST['column']), - "&return=column", - "&query={$query_url}\">{$lang['strbrowse']}</a></li>\n"; - /* Edit link */ - echo "\t<li><a href=\"colproperties.php?action=properties&{$misc->href}&table=", urlencode($tableName), - "&column=", urlencode($_REQUEST['column']) . "\">{$lang['stralter']}</a></li>\n"; - - echo "\t<li><a href=\"tblproperties.php?action=confirm_drop&{$misc->href}&table=", urlencode($tableName), - "&column=" . urlencode($_REQUEST['column']) . "\">{$lang['strdrop']}</a></li>\n"; - } else { + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'display.php', + 'urlvars' => array ( + 'subject' => 'column', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $tableName, + 'column' => $_REQUEST['column'], + 'return' => 'column', + 'query' => $query + ) + ) + ), + 'content' => $lang['strbrowse'], + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'colproperties.php', + 'urlvars' => array ( + 'action' => 'properties', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $tableName, + 'column' => $_REQUEST['column'], + ) + ) + ), + 'content' => $lang['stralter'], + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'tblproperties.php', + 'urlvars' => array ( + 'action' => 'confirm_drop', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $tableName, + 'column' => $_REQUEST['column'], + ) + ) + ), + 'content' => $lang['strdrop'], + ) + ); + } + else { /* Browse link */ - echo "\t<li><a href=\"display.php?{$misc->href}&subject=column&view=", - urlencode($_REQUEST['view']), - "&column=", urlencode($_REQUEST['column']), - "&return=column", - "&query={$query_url}\">{$lang['strbrowse']}</a></li>\n"; + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'display.php', + 'urlvars' => array ( + 'subject' => 'column', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'view' => $tableName, + 'column' => $_REQUEST['column'], + 'return' => 'column', + 'query' => $query + ) + ) + ), + 'content' => $lang['strbrowse'] + ) + ); } - echo "</ul>\n"; + $misc->printNavLinks($navlinks, 'colproperties-colproperties'); } } diff --git a/constraints.php b/constraints.php index f966f48d..93c2036b 100644 --- a/constraints.php +++ b/constraints.php @@ -472,14 +472,69 @@ $misc->printTable($constraints, $columns, $actions, $lang['strnoconstraints'], 'cnPre'); - echo "<ul class=\"navlink\">\n\t<li><a href=\"constraints.php?action=add_check&{$misc->href}&table=", urlencode($_REQUEST['table']), - "\">{$lang['straddcheck']}</a></li>\n"; - echo "\t<li><a href=\"constraints.php?action=add_unique_key&{$misc->href}&table=", urlencode($_REQUEST['table']), - "\">{$lang['stradduniq']}</a></li>\n"; - echo "\t<li><a href=\"constraints.php?action=add_primary_key&{$misc->href}&table=", urlencode($_REQUEST['table']), - "\">{$lang['straddpk']}</a></li>\n"; - echo "\t<li><a href=\"constraints.php?action=add_foreign_key&{$misc->href}&table=", urlencode($_REQUEST['table']), - "\">{$lang['straddfk']}</a></li>\n</ul>\n"; + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'constraints.php', + 'urlvars' => array ( + 'action' => 'add_check', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'] + ) + ) + ), + 'content' => $lang['straddcheck'], + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'constraints.php', + 'urlvars' => array ( + 'action' => 'add_unique_key', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'] + ) + ) + ), + 'content' => $lang['stradduniq'], + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'constraints.php', + 'urlvars' => array ( + 'action' => 'add_primary_key', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'] + ) + ) + ), + 'content' => $lang['straddpk'], + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'constraints.php', + 'urlvars' => array ( + 'action' => 'add_foreign_key', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'] + ) + ) + ), + 'content' => $lang['straddfk'] + ) + ); + $misc->printNavLinks($navlinks, 'constraints-constraints'); } function doTree() { diff --git a/display.php b/display.php index f4d18d84..a05e872e 100644 --- a/display.php +++ b/display.php @@ -413,7 +413,7 @@ * Displays requested data */ function doBrowse($msg = '') { - global $data, $conf, $misc, $lang; + global $data, $conf, $misc, $lang, $plugin_manager; $save_history = false; // If current page is not set, default to first page @@ -504,11 +504,33 @@ if (isset($_REQUEST['return'])) $gets .= "&return=" . urlencode($_REQUEST['return']); if (isset($_REQUEST['search_path'])) $gets .= "&search_path=" . urlencode($_REQUEST['search_path']); if (isset($_REQUEST['table'])) $gets .= "&table=" . urlencode($_REQUEST['table']); - + + // Build strings for GETs in array + $_gets = array( + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'] + ); + + if (isset($_REQUEST['schema'])) $_gets['schema'] = $_REQUEST['schema']; + if (isset($object)) $_gets[$subject] = $object; + if (isset($subject)) $_gets['subject'] = $subject; + if (isset($_REQUEST['query'])) $_gets['query'] = $_REQUEST['query']; + if (isset($_REQUEST['report'])) $_gets['report'] = $_REQUEST['report']; + if (isset($_REQUEST['count'])) $_gets['count'] = $_REQUEST['count']; + if (isset($_REQUEST['return'])) $_gets['return'] = $_REQUEST['return']; + if (isset($_REQUEST['search_path'])) $_gets['search_path'] = $_REQUEST['search_path']; + if (isset($_REQUEST['table'])) $_gets['table'] = $_REQUEST['table']; + // This string just contains sort info $getsort = "sortkey=" . urlencode($_REQUEST['sortkey']) . "&sortdir=" . urlencode($_REQUEST['sortdir']); + // This array only contains sort info + $_getsort = array( + 'sortkey' => $_REQUEST['sortkey'], + 'sortdir' => $_REQUEST['sortdir'] + ); + if ($save_history && is_object($rs) && ($type == 'QUERY')) //{ $misc->saveScriptHistory($_REQUEST['query']); @@ -581,57 +603,165 @@ } else echo "<p>{$lang['strnodata']}</p>\n"; - // Navigation links - echo "<ul class=\"navlink\">\n"; + // Navigation links + $navlinks = array(); + + $fields = array( + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + ); + + if (isset($_REQUEST['schema'])) + $fields['schema'] = $_REQUEST['schema']; // Return 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"; + $urlvars = $misc->getSubjectParams($_REQUEST['return']); + + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => $urlvars['url'], + 'urlvars' => $urlvars['params'] + ) + ), + 'content' => $lang['strback'] + ); } // Edit SQL link if (isset($_REQUEST['query'])) - echo "\t<li><a href=\"database.php?{$misc->href}&action=sql&paginate=on&query=", - urlencode($_REQUEST['query']), "\">{$lang['streditsql']}</a></li>\n"; + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'database.php', + 'urlvars' => array_merge($fields, array ( + 'action' => 'sql', + 'paginate' => 'on', + 'query' => $_REQUEST['query'] + )) + ) + ), + 'content' => $lang['streditsql'] + ); // Expand/Collapse if ($_REQUEST['strings'] == 'expanded') - echo "\t<li><a href=\"display.php?{$gets}&{$getsort}&strings=collapsed&page=", - urlencode($_REQUEST['page']), "\">{$lang['strcollapse']}</a></li>\n"; + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'display.php', + 'urlvars' => array_merge( + $_gets, $_getsort, + array ( + 'strings' => 'collapsed', + 'page' => $_REQUEST['page'] + )) + ) + ), + 'content' => $lang['strcollapse'] + ); else - echo "\t<li><a href=\"display.php?{$gets}&{$getsort}&strings=expanded&page=", - urlencode($_REQUEST['page']), "\">{$lang['strexpand']}</a></li>\n"; + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'display.php', + 'urlvars' => array_merge( + $_gets, $_getsort, + array ( + 'strings' => 'expanded', + 'page' => $_REQUEST['page'] + )) + ) + ), + 'content' => $lang['strexpand'] + ); // Create report - if (isset($_REQUEST['query']) && ($subject !== 'report') && $conf['show_reports'] && isset($rs) && is_object($rs) && $rs->recordCount() > 0) - echo "\t<li><a href=\"reports.php?{$misc->href}&action=create&report_sql=", - urlencode($_REQUEST['query']), "&paginate=", (isset($_REQUEST['paginate'])? urlencode($_REQUEST['paginate']):'f'), "\">{$lang['strcreatereport']}</a></li>\n"; + if (isset($_REQUEST['query']) && ($subject !== 'report') && $conf['show_reports'] && isset($rs) && is_object($rs) && $rs->recordCount() > 0) { + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'reports.php', + 'urlvars' => array_merge($fields, array( + 'action' => 'create', + 'report_sql' => $_REQUEST['query'], + 'paginate' => isset($_REQUEST['paginate'])? $_REQUEST['paginate']:'f' + )) + ) + ), + 'content' => $lang['strcreatereport'] + ); + } // Create view and download if (isset($_REQUEST['query']) && isset($rs) && is_object($rs) && $rs->recordCount() > 0) { + + // Report views don't set a schema, so we need to disable create view in that case - if (isset($_REQUEST['schema'])) - echo "\t<li><a href=\"views.php?action=create&formDefinition=", - urlencode($_REQUEST['query']), "&{$misc->href}\">{$lang['strcreateview']}</a></li>\n"; - echo "\t<li><a href=\"dataexport.php?query=", urlencode($_REQUEST['query']); + if (isset($_REQUEST['schema'])) { + + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'views.php', + 'urlvars' => array_merge($fields, array( + 'action' => 'create', + 'formDefinition' => $_REQUEST['query'] + )) + ) + ), + 'content' => $lang['strcreateview'] + ); + } + + $urlvars = array('query' => $_REQUEST['query']); if (isset($_REQUEST['search_path'])) - echo "&search_path=", urlencode($_REQUEST['search_path']); - echo "&{$misc->href}\">{$lang['strdownload']}</a></li>\n"; + $urlvars['search_path'] = $_REQUEST['search_path']; + + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'dataexport.php', + 'urlvars' => array_merge($fields, $urlvars) + ) + ), + 'content' => $lang['strdownload'] + ); } // Insert if (isset($object) && (isset($subject) && $subject == 'table')) - echo "\t<li><a href=\"tables.php?action=confinsertrow&table=", - urlencode($object), "&{$misc->href}\">{$lang['strinsert']}</a></li>\n"; + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'tables.php', + 'urlvars' => array_merge($fields, array( + 'action' => 'confinsertrow', + 'table' => $object + )) + ) + ), + 'content' => $lang['strinsert'] + ); // Refresh - echo "\t<li><a href=\"display.php?{$gets}&{$getsort}&strings=", urlencode($_REQUEST['strings']), - "&page=" . urlencode($_REQUEST['page']), - "\">{$lang['strrefresh']}</a></li>\n"; - echo "</ul>\n"; + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'display.php', + 'urlvars' => array_merge( + $_gets, $_getsort, + array( + 'strings' => $_REQUEST['strings'], + 'page' => $_REQUEST['page'] + )) + ) + ), + 'content' => $lang['strrefresh'] + ); + + $misc->printNavLinks($navlinks, 'display-browse'); } diff --git a/domains.php b/domains.php index 79a26c91..1df7fa50 100644 --- a/domains.php +++ b/domains.php @@ -228,14 +228,57 @@ } else echo "<p>{$lang['strnodata']}</p>\n"; - echo "<ul class=\"navlink\">\n\t<li><a href=\"domains.php?action=confirm_drop&{$misc->href}&domain=", urlencode($_REQUEST['domain']),"\">{$lang['strdrop']}</a></li>\n"; + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'domains.php', + 'urlvars' => array ( + 'action' => 'confirm_drop', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'domain' => $_REQUEST['domain'] + ) + ) + ), + 'content' => $lang['strdrop'] + ) + ); if ($data->hasAlterDomains()) { - echo "\t<li><a href=\"domains.php?action=add_check&{$misc->href}&domain=", urlencode($_REQUEST['domain']), - "\">{$lang['straddcheck']}</a></li>\n"; - echo "\t<li><a href=\"domains.php?action=alter&{$misc->href}&domain=", - urlencode($_REQUEST['domain']), "\">{$lang['stralter']}</a></li>\n"; + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'domains.php', + 'urlvars' => array ( + 'action' => 'add_check', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'domain' => $_REQUEST['domain'] + ) + ) + ), + 'content' => $lang['straddcheck'] + ); + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'domains.php', + 'urlvars' => array ( + 'action' => 'alter', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'domain' => $_REQUEST['domain'] + ) + ) + ), + 'content' => $lang['stralter'] + ); } - echo "</ul>\n"; + + $misc->printNavLinks($navlinks, 'domains-properties'); } /** @@ -417,9 +460,24 @@ if (!$data->hasAlterDomains()) unset($actions['alter']); $misc->printTable($domains, $columns, $actions, $lang['strnodomains']); - - echo "<p><a class=\"navlink\" href=\"domains.php?action=create&{$misc->href}\">{$lang['strcreatedomain']}</a></p>\n"; + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'domains.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + ) + ) + ), + 'content' => $lang['strcreatedomain'] + ) + ); + $misc->printNavLinks($navlinks, 'domains-domains'); } /** diff --git a/fulltext.php b/fulltext.php index 9c8733ca..8d16da92 100644 --- a/fulltext.php +++ b/fulltext.php @@ -58,10 +58,24 @@ $misc->printTable($cfgs, $columns, $actions, $lang['strftsnoconfigs']); - - echo "<ul class=\"navlink\">\n"; - echo "\t<li><a href=\"fulltext.php?action=createconfig&{$misc->href}\">{$lang['strftscreateconfig']}</a></li>\n"; - echo "</ul>\n"; + $navlinks = array( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'fulltext.php', + 'urlvars' => array ( + 'action' => 'createconfig', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strftscreateconfig'] + ) + ); + + $misc->printNavLinks($navlinks, 'fulltext-fulltext'); } function doDropConfig($confirm) { @@ -344,10 +358,7 @@ $misc->printTable($parsers, $columns, $actions, $lang['strftsnoparsers']); - //TODO: create parser - //echo "<ul class=\"navlink\">\n"; - //echo "\t<li><a href=\"#\">{$lang['strftscreateparser']}</a></li>\n"; - //echo "</ul>\n"; + //TODO: navlink to "create parser" } @@ -398,9 +409,24 @@ $misc->printTable($dicts, $columns, $actions, $lang['strftsnodicts']); - echo "<ul class=\"navlink\">\n"; - echo "\t<li><a href=\"fulltext.php?action=createdict&{$misc->href}&\">{$lang['strftscreatedict']}</a></li>\n"; - echo "</ul>\n"; + $navlinks = array( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'fulltext.php', + 'urlvars' => array ( + 'action' => 'createdict', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + ) + ) + ), + 'content' => $lang['strftscreatedict'] + ) + ); + + $misc->printNavLinks($navlinks, 'fulltext-viewdicts'); } @@ -461,10 +487,25 @@ $misc->printTable($map, $columns, $actions, $lang['strftsemptymap']); - echo "<ul class=\"navlink\">\n"; - echo "\t<li><a href=\"fulltext.php?action=addmapping&{$misc->href}&ftscfg={$ftscfg}\">{$lang['strftsaddmapping']}</a></li>\n"; - echo "</ul>\n"; + $navlinks = array( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'fulltext.php', + 'urlvars' => array ( + 'action' => 'addmapping', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'ftscfg' => $ftscfg + ) + ) + ), + 'content' => $lang['strftsaddmapping'] + ) + ); + $misc->printNavLinks($navlinks, 'fulltext-viewconfig'); } /** diff --git a/functions.php b/functions.php index 4a043cf6..84ef140a 100644 --- a/functions.php +++ b/functions.php @@ -325,11 +325,55 @@ } else echo "<p>{$lang['strnodata']}</p>\n"; - echo "<ul class=\"navlink\">\n\t<li><a href=\"functions.php?{$misc->href}\">{$lang['strshowallfunctions']}</a></li>\n"; - echo "\t<li><a href=\"functions.php?action=edit&{$misc->href}&function=", - urlencode($_REQUEST['function']), "&function_oid=", urlencode($_REQUEST['function_oid']), "\">{$lang['stralter']}</a></li>\n"; - echo "\t<li><a href=\"functions.php?action=confirm_drop&{$misc->href}&function=", - urlencode($func_full), "&function_oid=", $_REQUEST['function_oid'], "\">{$lang['strdrop']}</a></li>\n</ul>"; + $navlinks = array( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'functions.php', + 'urlvars' => array ( + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + ) + ) + ), + 'content' => $lang['strshowallfunctions'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'functions.php', + 'urlvars' => array ( + 'action' => 'edit', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'function' => $_REQUEST['function'], + 'function_oid' => $_REQUEST['function_oid'] + ) + ) + ), + 'content' => $lang['stralter'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'functions.php', + 'urlvars' => array ( + 'action' => 'confirm_drop', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'function' => $func_full, + 'function_oid' => $_REQUEST['function_oid'] + ) + ) + ), + 'content' => $lang['strdrop'] + ) + ); + + $misc->printNavLinks($navlinks, 'functions-properties'); } /** @@ -822,9 +866,54 @@ $misc->printTable($funcs, $columns, $actions, $lang['strnofunctions']); - echo "<ul class=\"navlink\">\n\t<li><a href=\"functions.php?action=create&{$misc->href}\">{$lang['strcreateplfunction']}</a></li>\n"; - echo "\t<li><a href=\"functions.php?action=create&language=internal&{$misc->href}\">{$lang['strcreateinternalfunction']}</a></li>\n"; - echo "\t<li><a href=\"functions.php?action=create&language=C&{$misc->href}\">{$lang['strcreatecfunction']}</a></li>\n</ul>\n"; + $navlinks = array( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'functions.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strcreateplfunction'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'functions.php', + 'urlvars' => array ( + 'action' => 'create', + 'language' => 'internal', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strcreateinternalfunction'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'functions.php', + 'urlvars' => array ( + 'action' => 'create', + 'language' => 'C', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strcreatecfunction'] + ) + ); + + $misc->printNavLinks($navlinks, 'functions-functions'); } /** @@ -105,7 +105,17 @@ echo "<input type=\"hidden\" name=\"action\" value=\"add_member\" />\n"; echo "</form>\n"; - echo "<p><a class=\"navlink\" href=\"groups.php?{$misc->href}\">{$lang['strshowallgroups']}</a></p>\n"; + $misc->printNavLinks(array (array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'groups.php', + 'urlvars' => array ( + 'server' => $_REQUEST['server'] + ) + ) + ), + 'content' => $lang['strshowallgroups'] + )), 'groups-properties'); } /** @@ -237,7 +247,18 @@ $misc->printTable($groups, $columns, $actions, $lang['strnogroups']); - echo "<p><a class=\"navlink\" href=\"groups.php?action=create&{$misc->href}\">{$lang['strcreategroup']}</a></p>\n"; + $misc->printNavLinks(array (array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'groups.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'] + ) + ) + ), + 'content' => $lang['strcreategroup'] + )), 'groups-groups'); } diff --git a/history.php b/history.php index 83b2dff4..c0db8188 100644 --- a/history.php +++ b/history.php @@ -68,12 +68,53 @@ } else echo "<p>{$lang['strnohistory']}</p>\n"; - echo "<ul class=\"navlink\">\n"; + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'history.php', + 'urlvars' => array ( + 'action' => 'history', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + ) + ) + ), + 'content' => $lang['strrefresh'] + ) + ); + if (isset($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']]) - && count($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']])) - echo "\t<li><a href=\"history.php?action=confclearhistory&{$misc->href}\">{$lang['strclearhistory']}</a></li>\n"; - echo "\t<li><a href=\"history.php?action=history&{$misc->href}\">{$lang['strrefresh']}</a></li>\n"; - echo "\t<li><a href=\"history.php?action=download&{$misc->href}\">{$lang['strdownload']}</a></li>\n</ul>\n"; + && count($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']])) { + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'history.php', + 'urlvars' => array ( + 'action' => 'download', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'] + ) + ) + ), + 'content' => $lang['strdownload'] + ); + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'history.php', + 'urlvars' => array( + 'action' => 'confclearhistory', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'] + ) + ) + ), + 'content' => $lang['strclearhistory'] + ); + } + + $misc->printNavLinks($navlinks, 'history-history'); } function doDelHistory($qid, $confirm) { diff --git a/indexes.php b/indexes.php index 23682a21..fa5f296c 100644 --- a/indexes.php +++ b/indexes.php @@ -311,8 +311,23 @@ $misc->printTable($indexes, $columns, $actions, $lang['strnoindexes'], 'indPre'); - echo "<p><a class=\"navlink\" href=\"indexes.php?action=create_index&{$misc->href}&table=", - urlencode($_REQUEST['table']), "\">{$lang['strcreateindex']}</a></p>\n"; + $misc->printNavLinks(array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'indexes.php', + 'urlvars' => array ( + 'action' => 'create_index', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'] + ) + ) + ), + 'content' => $lang['strcreateindex'] + ) + ), 'indexes-indexes'); } function doTree() { diff --git a/operators.php b/operators.php index 14475199..02a886f3 100644 --- a/operators.php +++ b/operators.php @@ -64,7 +64,21 @@ } echo "</table>\n"; - echo "<p><a class=\"navlink\" href=\"operators.php?{$misc->href}\">{$lang['strshowalloperators']}</a></p>\n"; + $misc->printNavLinks(array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'operators.php', + 'urlvars' => array ( + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strshowalloperators'] + )), 'operators-properties' + ); } else doDefault($lang['strinvalidparam']); @@ -154,7 +168,7 @@ $misc->printTable($operators, $columns, $actions, $lang['strnooperators']); -// echo "<p><a class=\"navlink\" href=\"operators.php?action=create&{$misc->href}\">{$lang['strcreateoperator']}</a></p>\n"; +// TODO operators.php action=create $lang['strcreateoperator'] } /** diff --git a/privileges.php b/privileges.php index b552543a..b5e9a67e 100644 --- a/privileges.php +++ b/privileges.php @@ -245,27 +245,85 @@ break; } - $subject = htmlspecialchars(urlencode($_REQUEST['subject'])); - $object = htmlspecialchars(urlencode($_REQUEST[$_REQUEST['subject']])); + $subject = $_REQUEST['subject']; + $object = $_REQUEST[$_REQUEST['subject']]; if ($_REQUEST['subject'] == 'function') { $objectoid = $_REQUEST[$_REQUEST['subject'].'_oid']; - $alterurl = "privileges.php?action=alter&{$misc->href}&{$subject}={$object}&{$subject}_oid={$objectoid}&subject={$subject}&mode="; + $urlvars = array ( + 'action' => 'alter', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + $subject => $object, + "{$_subject}_oid" => $objectoid, + 'subject'=> $subject + ); } else if ($_REQUEST['subject'] == 'column') { - $alterurl = "privileges.php?action=alter&{$misc->href}&{$subject}={$object}" - ."&subject={$subject}&table=". urlencode($_REQUEST['table']) ."&mode="; + $urlvars = array ( + 'action' => 'alter', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + $subject => $object, + 'subject'=> $subject + ); + + if (isset($_REQUEST['table'])) + $urlvars['table'] = $_REQUEST['table']; + else + $urlvars['view'] = $_REQUEST['view']; } else { - $alterurl = "privileges.php?action=alter&{$misc->href}&{$subject}={$object}&subject={$subject}&mode="; + $urlvars = array ( + 'action' => 'alter', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + $subject => $object, + 'subject'=> $subject + ); } - - echo "<ul class=\"navlink\">\n\t<li><a href=\"{$alterurl}grant\">{$lang['strgrant']}</a></li>\n"; - echo "\t<li><a href=\"{$alterurl}revoke\">{$lang['strrevoke']}</a></li>\n"; - if (isset($allurl)) - echo "\t<li><a href=\"{$allurl}?{$misc->href}\">{$alltxt}</a></li>\n"; - - echo "</ul>\n"; + + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'privileges.php', + 'urlvars' => array_merge($urlvars, array('mode' => 'grant')) + ) + ), + 'content' => $lang['strgrant'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'privileges.php', + 'urlvars' => array_merge($urlvars, array('mode' => 'revoke')) + ) + ), + 'content' => $lang['strrevoke'] + ) + ); + + if (isset($allurl)) { + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => $allurl, + 'urlvars' => array ( + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $alltxt + ); + } + + $misc->printNavLinks($navlinks, 'privileges-privileges'); } $misc->printHeader($lang['strprivileges']); diff --git a/reports.php b/reports.php index 148ff5c9..005ce03e 100644 --- a/reports.php +++ b/reports.php @@ -123,8 +123,50 @@ } else echo "<p>{$lang['strinvalidparam']}</p>\n"; - echo "<ul class=\"navlink\">\n\t<li><a href=\"reports.php?{$misc->href}\">{$lang['strshowallreports']}</a></li>\n"; - echo "\t<li><a href=\"reports.php?action=edit&{$misc->href}&report_id={$report->fields['report_id']}\">{$lang['stredit']}</a></li>\n</ul>\n"; + $urlvars = array ('server' => $_REQUEST['server']); + if (isset($_REQUEST['schema'])) $urlvars['schema'] = $_REQUEST['schema']; + if (isset($_REQUEST['database'])) $urlvars['database'] = $_REQUEST['database']; + + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'reports.php', + 'urlvars' => $urlvars + ) + ), + 'content' => $lang['strshowallreports'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'reports.php', + 'urlvars' => array_merge($urlvars, array( + 'action' => 'edit', + 'report_id' => $report->fields['report_id'] + )) + ) + ), + 'content' => $lang['stredit'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'sql.php', + 'urlvars' => array_merge($urlvars, array( + 'subject' => 'report', + 'report' => $report->fields['report_name'], + 'return' => 'report', + 'database' => $report->fields['db_name'], + 'reportid' => $report->fields['report_id'], + 'paginate' => $report->fields['paginate'] + )) + ) + ), + 'content' => $lang['strexecute'] + ) + ); + $misc->printNavLinks($navlinks, 'reports-properties'); } /** @@ -302,9 +344,25 @@ $misc->printTable($reports, $columns, $actions, $lang['strnoreports']); - echo "<p><a class=\"navlink\" href=\"reports.php?action=create&{$misc->href}\">{$lang['strcreatereport']}</a></p>\n"; + $urlvars = array ('server' => $_REQUEST['server']); + if (isset($_REQUEST['database'])) $urlvars['database'] = $_REQUEST['database']; + if (isset($_REQUEST['schema'])) $urlvars['schema'] = $_REQUEST['schema']; + + $misc->printNavLinks(array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'reports.php', + 'urlvars' => array_merge(array ( + 'action' => 'create' + ), $urlvars) + ) + ), + 'content' => $lang['strcreatereport'] + )), 'reports-reports' + ); } - + $misc->printHeader($lang['strreports']); $misc->printBody(); @@ -425,11 +425,47 @@ } else echo "<p>{$lang['strnodata']}</p>\n"; - echo "<ul class=\"navlink\">\n\t<li><a href=\"roles.php?{$misc->href}\">{$lang['strshowallroles']}</a></li>\n"; - echo "\t<li><a href=\"roles.php?action=alter&{$misc->href}&rolename=", - urlencode($_REQUEST['rolename']), "\">{$lang['stralter']}</a></li>\n"; - echo "\t<li><a href=\"roles.php?action=confirm_drop&{$misc->href}&rolename=", - urlencode($_REQUEST['rolename']), "\">{$lang['strdrop']}</li>\n</ul>\n"; + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'roles.php', + 'urlvars' => array ( + 'server' => $_REQUEST['server'] + ) + ) + ), + 'content' => $lang['strshowallroles'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'roles.php', + 'urlvars' => array ( + 'action' => 'alter', + 'server' => $_REQUEST['server'], + 'rolename' => $_REQUEST['rolename'] + ) + ) + ), + 'content' => $lang['stralter'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'roles.php', + 'urlvars' => array ( + 'action' => 'confirm_drop', + 'server' => $_REQUEST['server'], + 'rolename' => $_REQUEST['rolename'] + ) + ) + ), + 'content' => $lang['strdrop'] + ) + ); + + $misc->printNavLinks($navlinks, 'roles-properties'); } /** @@ -478,7 +514,18 @@ } else echo "<p>{$lang['strnodata']}</p>\n"; - echo "<p><a class=\"navlink\" href=\"roles.php?action=confchangepassword&{$misc->href}\">{$lang['strchangepassword']}</a></p>\n"; + $misc->printNavLinks(array (array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'roles.php', + 'urlvars' => array ( + 'action' => 'confchangepassword', + 'server' => $_REQUEST['server'] + ) + ) + ), + 'content' => $lang['strchangepassword'] + )), 'roles-account'); } /** @@ -618,8 +665,21 @@ $misc->printTable($roles, $columns, $actions, $lang['strnoroles']); - echo "<p><a class=\"navlink\" href=\"roles.php?action=create&{$misc->href}\">{$lang['strcreaterole']}</a></p>\n"; - + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'roles.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'] + ) + ) + ), + 'content' => $lang['strcreaterole'] + ) + ); + $misc->printNavLinks($navlinks, 'roles-roles'); } $misc->printHeader($lang['strroles']); @@ -157,7 +157,22 @@ $misc->printTable($rules, $columns, $actions, $lang['strnorules']); - echo "<p><a class=\"navlink\" href=\"rules.php?action=create_rule&{$misc->href}&{$subject}={$object}&subject={$subject}\">{$lang['strcreaterule']}</a></p>\n"; + $misc->printNavLinks(array (array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'rules.php', + 'urlvars' => array ( + 'action' => 'create_rule', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + $subject => $object, + 'subject' => $subject + ) + ) + ), + 'content' => $lang['strcreaterule'] + )), 'rules-rules'); } function doTree() { diff --git a/schemas.php b/schemas.php index c6be3655..0935f016 100755 --- a/schemas.php +++ b/schemas.php @@ -73,7 +73,19 @@ $misc->printTable($schemas, $columns, $actions, $lang['strnoschemas']); - echo "<p><a class=\"navlink\" href=\"schemas.php?action=create&{$misc->href}\">{$lang['strcreateschema']}</a></p>\n"; + $misc->printNavLinks(array (array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'schemas.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'] + ) + ) + ), + 'content' => $lang['strcreateschema'] + )), 'schemas-schemas'); } /** diff --git a/sequences.php b/sequences.php index 1e9a3271..433ed61c 100644 --- a/sequences.php +++ b/sequences.php @@ -71,7 +71,20 @@ $misc->printTable($sequences, $columns, $actions, $lang['strnosequences']); - echo "<p><a class=\"navlink\" href=\"sequences.php?action=create&{$misc->href}\">{$lang['strcreatesequence']}</a></p>\n"; + $misc->printNavLinks(array (array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'sequences.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strcreatesequence'] + )), 'sequences-sequences'); } /** @@ -152,15 +165,101 @@ echo "</tr>"; echo "</table>"; - echo "<ul class=\"navlink\">\n"; - echo "\t<li><a href=\"sequences.php?action=confirm_alter&{$misc->href}&sequence=", urlencode($sequence->fields['seqname']), "\">{$lang['stralter']}</a></li>\n"; - echo "\t<li><a href=\"sequences.php?action=confirm_setval&{$misc->href}&sequence=", urlencode($sequence->fields['seqname']), "\">{$lang['strsetval']}</a></li>\n"; - echo "\t<li><a href=\"sequences.php?action=nextval&{$misc->href}&sequence=", urlencode($sequence->fields['seqname']), "\">{$lang['strnextval']}</a></li>\n"; - if ($data->hasAlterSequenceStart()) { - echo "\t<li><a href=\"sequences.php?action=restart&{$misc->href}&sequence=", urlencode($sequence->fields['seqname']), "\">{$lang['strrestart']}</a></li>\n"; - } - echo "\t<li><a href=\"sequences.php?action=reset&{$misc->href}&sequence=", urlencode($sequence->fields['seqname']), "\">{$lang['strreset']}</a></li>\n"; - echo "\t<li><a href=\"sequences.php?{$misc->href}\">{$lang['strshowallsequences']}</a></li>\n</ul>\n"; + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'sequences.php', + 'urlvars' => array ( + 'action' => 'confirm_alter', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'sequence' => $sequence->fields['seqname'] + ) + ) + ), + 'content' => $lang['stralter'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'sequences.php', + 'urlvars' => array ( + 'action' => 'confirm_setval', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'sequence' => $sequence->fields['seqname'] + ) + ) + ), + 'content' => $lang['strsetval'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'sequences.php', + 'urlvars' => array ( + 'action' => 'nextval', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'sequence' => $sequence->fields['seqname'] + ) + ) + ), + 'content' => $lang['strnextval'] + ), + 'restart' => array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'sequences.php', + 'urlvars' => array ( + 'action' => 'restart', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'sequence' => $sequence->fields['seqname'] + ) + ) + ), + 'content' => $lang['strrestart'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'sequences.php', + 'urlvars' => array ( + 'action' => 'reset', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'sequence' => $sequence->fields['seqname'] + ) + ) + ), + 'content' => $lang['strreset'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'sequences.php', + 'urlvars' => array ( + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strshowallsequences'] + ) + ); + + if (! $data->hasAlterSequenceStart()) + unset($navlinks['restart']); + + $misc->printNavLinks($navlinks, 'sequences-properties'); } else echo "<p>{$lang['strnodata']}</p>\n"; } diff --git a/servers.php b/servers.php index 775fb321..50583544 100644 --- a/servers.php +++ b/servers.php @@ -97,7 +97,6 @@ } $misc->printTable($servers, $columns, $actions, $lang['strnoobjects'], 'svPre'); - } function doTree() { @@ -196,36 +196,93 @@ echo "<p>{$lang['strsqlexecuted']}</p>\n"; - echo "<ul class=\"navlink\">\n"; + $navlinks = array(); + $fields = array( + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + ); + + if(isset($_REQUEST['schema'])) + $fields['schema'] = $_REQUEST['schema']; // Return if (isset($_REQUEST['return'])) { - $return_url = $misc->getHREFSubject($_REQUEST['return']); - echo "\t<li><a href=\"{$return_url}\">{$lang['strback']}</a></li>\n"; + $urlvars = $misc->getSubjectParams($_REQUEST['return']); + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => $urlvars['url'], + 'urlvars' => $urlvars['params'] + ) + ), + 'content' => $lang['strback'] + ); } // Edit - echo "\t<li><a href=\"database.php?database=", urlencode($_REQUEST['database']), - "&server=", urlencode($_REQUEST['server']), "&action=sql\">{$lang['streditsql']}</a></li>\n"; - + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'database.php', + 'urlvars' => array_merge($fields, array ( + 'action' => 'sql', + )) + ) + ), + 'content' => $lang['streditsql'] + ); + // Create report - if (($subject !== 'report') && $conf['show_reports'] && isset($rs) && is_object($rs) && $rs->recordCount() > 0) - echo "\t<li><a href=\"reports.php?{$misc->href}&action=create&report_sql=", - urlencode($_SESSION['sqlquery']), "\">{$lang['strcreatereport']}</a></li>\n"; + if (($subject !== 'report') && $conf['show_reports'] && isset($rs) && is_object($rs) && $rs->recordCount() > 0) { + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'reports.php', + 'urlvars' => array_merge($fields, array ( + 'action' => 'create', + 'report_sql' => $_SESSION['sqlquery'] + )) + ) + ), + 'content' => $lang['strcreatereport'] + ); + } // Create view and download if (isset($_SESSION['sqlquery']) && isset($rs) && is_object($rs) && $rs->recordCount() > 0) { // Report views don't set a schema, so we need to disable create view in that case - if (isset($_REQUEST['schema'])) - echo "\t<li><a href=\"views.php?action=create&formDefinition=", - urlencode($_SESSION['sqlquery']), "&{$misc->href}\">{$lang['strcreateview']}</a></li>\n"; - echo "\t<li><a href=\"dataexport.php?query=", urlencode($_SESSION['sqlquery']); + if (isset($_REQUEST['schema'])) { + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'views.php', + 'urlvars' => array_merge($fields, array ( + 'action' => 'create', + 'formDefinition' => $_SESSION['sqlquery'] + )) + ) + ), + 'content' => $lang['strcreateview'] + ); + } + if (isset($_REQUEST['search_path'])) - echo "&search_path=", urlencode($_REQUEST['search_path']); - echo "&{$misc->href}\">{$lang['strdownload']}</a></li>\n"; + $fields['search_path'] = $_REQUEST['search_path']; + + $navlinks['download'] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'dataexport.php', + 'urlvars' => array_merge($fields, array( + 'query' => $_SESSION['sqlquery'] + )) + ) + ), + 'content' => $lang['strdownload'] + ); } - echo "</ul>\n"; + $misc->printNavLinks($navlinks, 'sql-form'); $misc->printFooter(); ?> @@ -826,10 +826,41 @@ $misc->printTable($tables, $columns, $actions, $lang['strnotables']); - echo "<ul class=\"navlink\">\n\t<li><a href=\"tables.php?action=create&{$misc->href}\">{$lang['strcreatetable']}</a></li>\n"; - if (($tables->recordCount() > 0) && $data->hasCreateTableLike()) - echo "\t<li><a href=\"tables.php?action=createlike&{$misc->href}\">{$lang['strcreatetablelike']}</a></li>\n"; - echo "</ul>\n"; + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'tables.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strcreatetable'] + ) + ); + + if (($tables->recordCount() > 0) && $data->hasCreateTableLike()) { + $navlinks[] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'tables.php', + 'urlvars' => array ( + 'action' => 'createlike', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strcreatetablelike'] + ); + } + + $misc->printNavLinks($navlinks, 'tables-tables'); } require('./admin.php'); diff --git a/tablespaces.php b/tablespaces.php index 5e2ffb78..c9cfb7ff 100755 --- a/tablespaces.php +++ b/tablespaces.php @@ -256,8 +256,18 @@ $misc->printTable($tablespaces, $columns, $actions, $lang['strnotablespaces']); - echo "<p><a class=\"navlink\" href=\"tablespaces.php?action=create&{$misc->href}\">{$lang['strcreatetablespace']}</a></p>\n"; - + $misc->printNavLinks(array (array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'tablespaces.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'] + ) + ) + ), + 'content' => $lang['strcreatetablespace'] + )), 'tablespaces-tablespaces'); } $misc->printHeader($lang['strtablespaces']); diff --git a/tblproperties.php b/tblproperties.php index 9c462a1c..5eeccf37 100644 --- a/tblproperties.php +++ b/tblproperties.php @@ -565,15 +565,116 @@ $misc->printTable($attrs, $columns, $actions, null, 'attPre'); - echo "<ul class=\"navlink\">\n"; - echo "\t<li><a href=\"display.php?{$misc->href}&table=", urlencode($_REQUEST['table']), "&subject=table&return=table\">{$lang['strbrowse']}</a></li>\n"; - echo "\t<li><a href=\"tables.php?action=confselectrows&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['strselect']}</a></li>\n"; - echo "\t<li><a href=\"tables.php?action=confinsertrow&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['strinsert']}</a></li>\n"; - echo "\t<li><a href=\"tables.php?action=confirm_empty&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['strempty']}</a></li>\n"; - echo "\t<li><a href=\"tables.php?action=confirm_drop&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['strdrop']}</a></li>\n"; - echo "\t<li><a href=\"tblproperties.php?action=add_column&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['straddcolumn']}</a></li>\n"; - echo "\t<li><a href=\"tblproperties.php?action=confirm_alter&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['stralter']}</a></li>\n"; - echo "</ul>\n"; + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'display.php', + 'urlvars' => array ( + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'], + 'subject' => 'table', + 'return' => 'table' + ) + ) + ), + 'content' => $lang['strbrowse'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'tables.php', + 'urlvars' => array ( + 'action' => 'confselectrows', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'] + ) + ) + ), + 'content' => $lang['strselect'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'tables.php', + 'urlvars' => array ( + 'action' => 'confinsertrow', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'] + ) + ) + ), + 'content' => $lang['strinsert'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'tables.php', + 'urlvars' => array ( + 'action' => 'confirm_empty', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'] + ) + ) + ), + 'content' => $lang['strempty'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'tables.php', + 'urlvars' => array ( + 'action' => 'confirm_drop', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'], + ) + ) + ), + 'content' => $lang['strdrop'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'tblproperties.php', + 'urlvars' => array ( + 'action' => 'add_column', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'] + ) + ) + ), + 'content' => $lang['straddcolumn'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'tblproperties.php', + 'urlvars' => array ( + 'action' => 'confirm_alter', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'] + ) + ) + ), + 'content' => $lang['stralter'] + ) + ); + $misc->printNavLinks($navlinks, 'tblproperties-tblproperties'); + } $misc->printHeader($lang['strtables'] . ' - ' . $_REQUEST['table']); diff --git a/triggers.php b/triggers.php index c81b2a3d..90d05348 100644 --- a/triggers.php +++ b/triggers.php @@ -331,7 +331,21 @@ $misc->printTable($triggers, $columns, $actions, $lang['strnotriggers'], 'tgPre'); - echo "<p><a class=\"navlink\" href=\"triggers.php?action=create&{$misc->href}&table=", urlencode($_REQUEST['table']), "\">{$lang['strcreatetrigger']}</a></p>\n"; + $misc->printNavLinks(array (array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'triggers.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'table' => $_REQUEST['table'] + ) + ) + ), + 'content' => $lang['strcreatetrigger'] + )), 'triggers-triggers'); } function doTree() { @@ -85,7 +85,19 @@ echo "</table>\n"; } - echo "<p><a class=\"navlink\" href=\"types.php?{$misc->href}\">{$lang['strshowalltypes']}</a></p>\n"; + $misc->printNavLinks(array (array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'types.php', + 'urlvars' => array ( + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + ) + ) + ), + 'content' => $lang['strshowalltypes'] + )), 'types-properties'); } else doDefault($lang['strinvalidparam']); } @@ -575,11 +587,56 @@ $misc->printTable($types, $columns, $actions, $lang['strnotypes']); - echo "<ul class=\"navlink\">\n\t<li><a href=\"types.php?action=create&{$misc->href}\">{$lang['strcreatetype']}</a></li>\n"; - echo "\t<li><a href=\"types.php?action=create_comp&{$misc->href}\">{$lang['strcreatecomptype']}</a></li>\n"; - if ($data->hasEnumTypes()) - echo "\t<li><a href=\"types.php?action=create_enum&{$misc->href}\">{$lang['strcreateenumtype']}</a></li>\n"; - echo "</ul>\n"; + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'types.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strcreatetype'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'types.php', + 'urlvars' => array ( + 'action' => 'create_comp', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strcreatecomptype'] + ), + 'enum' => array ( + 'attr'=> array ( + 'href' => array( + 'url' => 'types.php', + 'urlvars' => array ( + 'action' => 'create_enum', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strcreateenumtype'] + ) + ); + + if (! $data->hasEnumTypes()) { + unset($navlinks['enum']); + } + + $misc->printNavLinks($navlinks, 'types-types'); } /** @@ -47,7 +47,18 @@ } else echo "<p>{$lang['strnodata']}</p>\n"; - echo "<p><a class=\"navlink\" href=\"users.php?action=confchangepassword&{$misc->href}\">{$lang['strchangepassword']}</a></p>\n"; + $misc->printNavLinks(array (array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'users.php', + 'urlvars' => array ( + 'action' => 'confchangepassword', + 'server' => $_REQUEST['server'] + ) + ) + ), + 'content' => $lang['strchangepassword'] + )), 'users-account'); } /** @@ -330,7 +341,18 @@ $misc->printTable($users, $columns, $actions, $lang['strnousers']); - echo "<p><a class=\"navlink\" href=\"users.php?action=create&{$misc->href}\">{$lang['strcreateuser']}</a></p>\n"; + $misc->printNavLinks(array (array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'users.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'] + ) + ) + ), + 'content' => $lang['strcreateuser'] + )), 'users-users'); } diff --git a/viewproperties.php b/viewproperties.php index 3073352c..8fa8317d 100755 --- a/viewproperties.php +++ b/viewproperties.php @@ -150,8 +150,21 @@ } else echo "<p>{$lang['strnodata']}</p>\n"; - echo "<p><a class=\"navlink\" href=\"viewproperties.php?action=edit&{$misc->href}&view=", - urlencode($_REQUEST['view']), "\">{$lang['stralter']}</a></p>\n"; + $misc->printNavLinks(array (array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'viewproperties.php', + 'urlvars' => array ( + 'action' => 'edit', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'view' => $_REQUEST['view'] + ) + ) + ), + 'content' => $lang['stralter'] + )), 'viewproperties-definition'); } /** @@ -431,12 +444,71 @@ echo "<br />\n"; - echo "<ul class=\"navlink\">\n"; - echo "\t<li><a href=\"display.php?{$misc->href}&view=", urlencode($_REQUEST['view']), "&subject=view&return=view\">{$lang['strbrowse']}</a></li>\n"; - echo "\t<li><a href=\"views.php?action=confselectrows&{$misc->href}&view=", urlencode($_REQUEST['view']),"\">{$lang['strselect']}</a></li>\n"; - echo "\t<li><a href=\"views.php?action=confirm_drop&{$misc->href}&view=", urlencode($_REQUEST['view']),"\">{$lang['strdrop']}</a></li>\n"; - echo "\t<li><a href=\"viewproperties.php?action=confirm_alter&{$misc->href}&view=", urlencode($_REQUEST['view']),"\">{$lang['stralter']}</a></li>\n"; - echo "</ul>\n"; + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'display.php', + 'urlvars' => array ( + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'view' => $_REQUEST['view'], + 'subject' => 'view', + 'return' => 'view' + ) + ) + ), + 'content' => $lang['strbrowse'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'views.php', + 'urlvars' => array ( + 'action' => 'confselectrows', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'view' => $_REQUEST['view'] + ) + ) + ), + 'content' => $lang['strselect'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'views.php', + 'urlvars' => array ( + 'action' => 'confirm_drop', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'view' => $_REQUEST['view'] + ) + ) + ), + 'content' => $lang['strdrop'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'viewproperties.php', + 'urlvars' => array ( + 'action' => 'confirm_alter', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'], + 'view' => $_REQUEST['view'] + ) + ) + ), + 'content' => $lang['stralter'] + ) + ); + + $misc->printNavLinks($navlinks, 'viewproperties-viewproperties'); } $misc->printHeader($lang['strviews'] . ' - ' . $_REQUEST['view']); @@ -617,8 +617,37 @@ $misc->printTable($views, $columns, $actions, $lang['strnoviews']); - echo "<ul class=\"navlink\">\n\t<li><a href=\"views.php?action=create&{$misc->href}\">{$lang['strcreateview']}</a></li>\n"; - echo "\t<li><a href=\"views.php?action=wiz_create&{$misc->href}\">{$lang['strcreateviewwiz']}</a></li>\n</ul>\n"; + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'views.php', + 'urlvars' => array ( + 'action' => 'create', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strcreateview'] + ), + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'views.php', + 'urlvars' => array ( + 'action' => 'wiz_create', + 'server' => $_REQUEST['server'], + 'database' => $_REQUEST['database'], + 'schema' => $_REQUEST['schema'] + ) + ) + ), + 'content' => $lang['strcreateviewwiz'] + ) + ); + $misc->printNavLinks($navlinks, 'views-views'); } |