Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add support for 'actionbuttons' hooks in the plugin architecture.

By Leonardo Sapiras during the GSoC 2011. Reviewed, massively patched,
fixed, integrated and commited by ioguix
  • Loading branch information...
commit 4f77054ad815d1d28e40e38e3c5cc08761e2fbad 1 parent f5892dd
@leonardosapiras leonardosapiras authored ioguix committed
View
36 admin.php
@@ -628,23 +628,35 @@ function enlight($f, $p) {
$actions = array(
'edit' => array(
- 'title' => $lang['stredit'],
- 'url' => "{$script}?action=confeditautovac&{$misc->href}&subject={$type}&",
- 'vars' => array(
- 'schema' => 'nspname',
- 'table' => 'relname'
+ 'content' => $lang['stredit'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => $script,
+ 'urlvars' => array (
+ 'subject' => $type,
+ 'action' => 'confeditautovac',
+ 'schema' => field('nspname'),
+ 'table' => field('relname')
+ )
+ )
)
),
'delete' => array(
- 'title' => $lang['strdelete'],
- 'url' => "{$script}?action=confdelautovac&{$misc->href}&subject={$type}&",
- 'vars' => array(
- 'schema' => 'nspname',
- 'table' => 'relname'
+ 'content' => $lang['strdelete'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => $script,
+ 'urlvars' => array (
+ 'subject' => $type,
+ 'action' => 'confdelautovac',
+ 'schema' => field('nspname'),
+ 'table' => field('relname')
+ )
+ )
)
)
);
-
+
if ($type == 'table') {
unset($actions['edit']['vars']['schema'],
$actions['delete']['vars']['schema'],
@@ -653,7 +665,7 @@ function enlight($f, $p) {
);
}
- $misc->printTable($autovac, $columns, $actions, $lang['strnovacuumconf']);
+ $misc->printTable($autovac, $columns, $actions, 'admin-admin', $lang['strnovacuumconf']);
if (($type == 'table') and ($autovac->recordCount() == 0)) {
echo "<br />";
View
30 aggregates.php
@@ -344,19 +344,35 @@ function doDefault($msg = '') {
$actions = array(
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "aggregates.php?action=alter&amp;{$misc->href}&amp;",
- 'vars' => array('aggrname' => 'proname', 'aggrtype' => 'proargtypes'),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'aggregates.php',
+ 'urlvars' => array (
+ 'action' => 'alter',
+ 'aggrname' => field('proname'),
+ 'aggrtype' => field('proargtypes')
+ )
+ )
+ )
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "aggregates.php?action=confirm_drop&amp;{$misc->href}&amp;",
- 'vars' => array('aggrname' => 'proname', 'aggrtype' => 'proargtypes'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'aggregates.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'aggrname' => field('proname'),
+ 'aggrtype' => field('proargtypes')
+ )
+ )
+ )
)
);
if (!$data->hasAlterAggregate()) unset($actions['alter']);
- $misc->printTable($aggregates, $columns, $actions, $lang['strnoaggregates']);
+ $misc->printTable($aggregates, $columns, $actions, 'aggregates-aggregates', $lang['strnoaggregates']);
$navlinks = array (
array (
View
55 all_db.php
@@ -393,28 +393,51 @@ function doDefault($msg = '') {
$actions = array(
'multiactions' => array(
- 'keycols' => array('database' => 'datname'),
- 'url' => 'all_db.php',
- 'default' => null,
+ 'keycols' => array('database' => 'datname'),
+ 'url' => 'all_db.php',
+ 'default' => null,
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "all_db.php?action=confirm_drop&amp;subject=database&amp;{$misc->href}&amp;",
- 'vars' => array('dropdatabase' => 'datname'),
- 'multiaction' => 'confirm_drop',
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'all_db.php',
+ 'urlvars' => array (
+ 'subject' => 'database',
+ 'action' => 'confirm_drop',
+ 'dropdatabase' => field('datname')
+ )
+ )
+ ),
+ 'multiaction' => 'confirm_drop',
),
'privileges' => array(
- 'title' => $lang['strprivileges'],
- 'url' => "privileges.php?subject=database&amp;{$misc->href}&amp;",
- 'vars' => array('database' => 'datname'),
+ 'content' => $lang['strprivileges'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'privileges.php',
+ 'urlvars' => array (
+ 'subject' => 'database',
+ 'database' => field('datname')
+ )
+ )
+ )
)
);
if ($data->hasAlterDatabase() ) {
- $actions['alter'] = array(
- 'title' => $lang['stralter'],
- 'url' => "all_db.php?action=confirm_alter&amp;subject=database&amp;{$misc->href}&amp;",
- 'vars' => array('alterdatabase' => 'datname')
- );
+ $actions['alter'] = array(
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'all_db.php',
+ 'urlvars' => array (
+ 'subject' => 'database',
+ 'action' => 'confirm_alter',
+ 'alterdatabase' => field('datname')
+ )
+ )
+ )
+ );
}
if (!$data->hasTablespaces()) unset($columns['tablespace']);
@@ -422,7 +445,7 @@ function doDefault($msg = '') {
if (!$data->hasDatabaseCollation()) unset($columns['lc_collate'], $columns['lc_ctype']);
if (!isset($data->privlist['database'])) unset($actions['privileges']);
- $misc->printTable($databases, $columns, $actions, $lang['strnodatabases']);
+ $misc->printTable($databases, $columns, $actions, 'all_db-databases', $lang['strnodatabases']);
$navlinks = array (
array (
View
2  casts.php
@@ -62,7 +62,7 @@ function renderCastContext($val) {
$actions = array();
- $misc->printTable($casts, $columns, $actions, $lang['strnocasts']);
+ $misc->printTable($casts, $columns, $actions, 'casts-casts', $lang['strnocasts']);
}
/**
View
84 classes/Misc.php
@@ -594,35 +594,46 @@ function printReload($database) {
}
/**
- * Display a list of links
- * @param $links An associative array of links to print
- * links = array(
+ * Display a link
+ * @param $link An associative array of link parameters to print
+ * link = 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
+ * 'fields' => (optionnal) 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.
+ */
+ function printLink($link) {
+ $tag = "<a ";
+ foreach ($link['attr'] as $attr => $value) {
+ if ($attr == 'href' and is_array($value)) {
+ $tag.= 'href="'. htmlentities($this->getActionUrl($value, $link['fields'])).'" ';
+ }
+ else {
+ $tag.= htmlentities($attr).'="'. value($value, $link['fields'], 'html') .'" ';
+ }
+ }
+ $tag.= ">". value($link['content'], $link['fields'], 'html') ."</a>\n";
+ echo $tag;
+ }
+
+ /**
+ * Display a list of links
+ * @param $links An associative array of links to print. See printLink function for
+ * the links 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.
*/
function printLinksList($links, $class='') {
echo "<ul class=\"{$class}\">\n";
foreach ($links as $link) {
- $tag = "\t<li><a ";
- foreach ($link['attr'] as $attr => $value) {
- if ($attr == 'href' and is_array($value)) {
- $tag.= 'href="'. htmlentities($this->getActionUrl($value, $link['fields'])).'" ';
- }
- else {
- $tag.= htmlentities($attr).'="'. value($value, $link['fields'], 'html') .'" ';
- }
- }
- $tag.= ">". value($link['content'], $link['fields'], 'html') ."</a></li>\n";
- echo $tag;
+ echo "\t<li>";
+ $this->printLink($link);
+ echo "</li>\n";
}
echo "</ul>\n";
}
@@ -1723,15 +1734,18 @@ function getActionUrl(&$action, &$fields) {
$urlvars = array();
}
- if (isset($urlvars['subject'])) {
+ /* set server, database and schema parameter if not presents */
+ if (isset($urlvars['subject']))
$subject = value($urlvars['subject'], $fields);
- if (isset($_REQUEST['server']) && $subject != 'root') {
- $urlvars['server'] = $_REQUEST['server'];
- if (isset($_REQUEST['database']) && $subject != 'server') {
- $urlvars['database'] = $_REQUEST['database'];
- if (isset($_REQUEST['schema']) && $subject != 'database') {
- $urlvars['schema'] = $_REQUEST['schema'];
- }
+ else
+ $subject = '';
+
+ if (isset($_REQUEST['server']) and !isset($urlvars['server']) and $subject != 'root') {
+ $urlvars['server'] = $_REQUEST['server'];
+ if (isset($_REQUEST['database']) and !isset($urlvars['database']) and $subject != 'server') {
+ $urlvars['database'] = $_REQUEST['database'];
+ if (isset($_REQUEST['schema']) and !isset($urlvars['schema']) and $subject != 'database') {
+ $urlvars['schema'] = $_REQUEST['schema'];
}
}
}
@@ -1798,6 +1812,8 @@ function printUrlVars(&$vars, &$fields) {
* Add this action to the multi action form
* ), ...
* );
+ * @param $place Place where the $actions are displayed. Like 'display-browse', where 'display' is the file (display.php)
+ * and 'browse' is the place inside that code (doBrowse).
* @param $nodata (optional) Message to display if data set is empty.
* @param $pre_fn (optional) Name of a function to call for each row,
* it will be passed two params: $rowdata and $actions,
@@ -1808,8 +1824,15 @@ function printUrlVars(&$vars, &$fields) {
* The function must not must not store urls because
* they are relative and won't work out of context.
*/
- function printTable(&$tabledata, &$columns, &$actions, $nodata = null, $pre_fn = null) {
- global $data, $conf, $misc, $lang;
+ function printTable(&$tabledata, &$columns, &$actions, $place, $nodata = null, $pre_fn = null) {
+ global $data, $conf, $misc, $lang, $plugin_manager;
+
+ // Action buttons hook's place
+ $plugin_functions_parameters = array(
+ 'actionbuttons' => &$actions,
+ 'place' => $place
+ );
+ $plugin_manager->do_hook('actionbuttons', $plugin_functions_parameters);
if ($has_ma = isset($actions['multiactions']))
$ma = $actions['multiactions'];
@@ -1887,12 +1910,9 @@ function printTable(&$tabledata, &$columns, &$actions, $nodata = null, $pre_fn =
echo "<td></td>\n";
} else {
echo "<td class=\"opbutton{$id}\">";
- echo "<a href=\"{$action['url']}";
- if ($action['url'] === '') echo '?';
- $misc->printUrlVars($action['vars'], $tabledata->fields);
- if (isset($action['target']))
- echo "\" target=\"{$action['target']}";
- echo "\">{$action['title']}</a></td>\n";
+ $action['fields'] = $tabledata->fields;
+ $this->printLink($action);
+ echo "</td>\n";
}
}
break;
@@ -1943,7 +1963,7 @@ function printTable(&$tabledata, &$columns, &$actions, $nodata = null, $pre_fn =
echo "\t\t<option value=\"\">--</option>\n";
foreach($actions as $k => $a)
if (isset($a['multiaction']))
- echo "\t\t<option value=\"{$a['multiaction']}\"", ($ma['default'] == $k? ' selected="selected"': ''), ">{$a['title']}</option>\n";
+ echo "\t\t<option value=\"{$a['multiaction']}\"", ($ma['default'] == $k? ' selected="selected"': ''), ">{$a['content']}</option>\n";
echo "\t</select>\n";
echo "<input type=\"submit\" value=\"{$lang['strexecute']}\" />\n";
echo $misc->form;
View
2  classes/PluginManager.php
@@ -10,7 +10,7 @@ class PluginManager {
* Attributes
*/
private $plugins_list = array();
- private $available_hooks = array('toplinks', 'tabs', 'trail', 'navlinks' /* wip, more hooks to come in next commits */);
+ private $available_hooks = array('toplinks', 'tabs', 'trail', 'navlinks', 'actionbuttons' /* wip, more hooks to come in next commits */);
private $actions = array();
private $hooks = array();
View
2  colproperties.php
@@ -226,7 +226,7 @@ function attPre(&$rowdata) {
}
$actions=array();
- $misc->printTable($attrs, $column, $actions, null, 'attPre');
+ $misc->printTable($attrs, $column, $actions, 'colproperties-colproperties', null, 'attPre');
echo "<br />\n";
View
19 constraints.php
@@ -464,13 +464,22 @@ function cnPre(&$rowdata) {
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "constraints.php?action=confirm_drop&amp;{$misc->href}&amp;table=".urlencode($_REQUEST['table'])."&amp;",
- 'vars' => array('constraint' => 'conname', 'type' => 'contype'),
- ),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'constraints.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'table' => $_REQUEST['table'],
+ 'constraint' => field('conname'),
+ 'type' => field('contype')
+ )
+ )
+ )
+ )
);
- $misc->printTable($constraints, $columns, $actions, $lang['strnoconstraints'], 'cnPre');
+ $misc->printTable($constraints, $columns, $actions, 'constraints-constraints', $lang['strnoconstraints'], 'cnPre');
$navlinks = array (
array (
View
2  conversions.php
@@ -51,7 +51,7 @@ function doDefault($msg = '') {
$actions = array();
- $misc->printTable($conversions, $columns, $actions, $lang['strnoconversions']);
+ $misc->printTable($conversions, $columns, $actions, 'conversions-conversions', $lang['strnoconversions']);
}
/**
View
36 database.php
@@ -376,7 +376,7 @@ function doVariables() {
$actions = array();
- $misc->printTable($variables, $columns, $actions, $lang['strnodata']);
+ $misc->printTable($variables, $columns, $actions, 'database-variables', $lang['strnodata']);
}
/**
@@ -429,7 +429,7 @@ function currentProcesses($isAjax = false) {
$actions = array();
- $misc->printTable($prep_xacts, $columns, $actions, $lang['strnodata']);
+ $misc->printTable($prep_xacts, $columns, $actions, 'database-processes-preparedxacts', $lang['strnodata']);
}
// Fetch the processes from the database
@@ -462,14 +462,30 @@ function currentProcesses($isAjax = false) {
if ($data->isSuperUser()) {
$actions = array(
'cancel' => array(
- 'title' => $lang['strcancel'],
- 'url' => "database.php?action=signal&amp;signal=CANCEL&amp;{$misc->href}&amp;",
- 'vars' => array('procpid' => 'procpid')
+ 'content' => $lang['strcancel'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'database.php',
+ 'urlvars' => array (
+ 'action' => 'signal',
+ 'signal' => 'CANCEL',
+ 'procpid' => field('procpid')
+ )
+ )
+ )
),
'kill' => array(
- 'title' => $lang['strkill'],
- 'url' => "database.php?action=signal&amp;signal=KILL&amp;{$misc->href}&amp;",
- 'vars' => array('procpid' => 'procpid')
+ 'content' => $lang['strkill'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'database.php',
+ 'urlvars' => array (
+ 'action' => 'signal',
+ 'signal' => 'KILL',
+ 'procpid' => field('procpid')
+ )
+ )
+ )
)
);
@@ -483,7 +499,7 @@ function currentProcesses($isAjax = false) {
// Remove query start time for <7.4
if (!isset($processes->fields['query_start'])) unset($columns['start_time']);
- $misc->printTable($processes, $columns, $actions, $lang['strnodata']);
+ $misc->printTable($processes, $columns, $actions, 'database-processes', $lang['strnodata']);
if ($isAjax) exit;
}
@@ -529,7 +545,7 @@ function currentLocks($isAjax = false) {
if (!$data->hasVirtualTransactionId()) unset($columns['vxid']);
$actions = array();
- $misc->printTable($variables, $columns, $actions, $lang['strnodata']);
+ $misc->printTable($variables, $columns, $actions, 'database-locks', $lang['strnodata']);
if ($isAjax) exit;
}
View
32 display.php
@@ -551,9 +551,27 @@ function doBrowse($msg = '') {
break;
}
}
+
+ $buttons = array();
+ $plugin_functions_parameters = array(
+ 'actionbuttons' => &$buttons,
+ 'place' => 'display-browse'
+ );
+ $plugin_manager->do_hook('actionbuttons', $plugin_functions_parameters);
+
+ foreach (array_keys($plugin_functions_parameters['actionbuttons']) as $action) {
+ $plugin_functions_parameters['actionbuttons'][$action]['attr']['href']['urlvars'] = array_merge(
+ $plugin_functions_parameters['actionbuttons'][$action]['attr']['href']['urlvars'],
+ $_gets, $_getsort
+ );
+ }
+
+ error_log(print_r($plugin_functions_parameters, 1));
+
// Display edit and delete actions if we have a key
+ $colspan = count($buttons) + 2;
if (sizeof($key) > 0)
- echo "<th colspan=\"2\" class=\"data\">{$lang['stractions']}</th>\n";
+ echo "<th colspan=\"{$colspan}\" class=\"data\">{$lang['stractions']}</th>\n";
/* we show OIDs only if we are in TABLE or SELECT type browsing */
printTableHeaderCells($rs, $gets, isset($object));
@@ -578,7 +596,7 @@ function doBrowse($msg = '') {
$key_str .= urlencode("key[{$v}]") . '=' . urlencode($rs->fields[$v]);
}
if ($has_nulls) {
- echo "<td colspan=\"2\">&nbsp;</td>\n";
+ echo "<td colspan=\"{$colspan}\">&nbsp;</td>\n";
} else {
echo "<td class=\"opbutton{$id}\"><a href=\"display.php?action=confeditrow&amp;strings=",
urlencode($_REQUEST['strings']), "&amp;page=",
@@ -586,6 +604,16 @@ function doBrowse($msg = '') {
echo "<td class=\"opbutton{$id}\"><a href=\"display.php?action=confdelrow&amp;strings=",
urlencode($_REQUEST['strings']), "&amp;page=",
urlencode($_REQUEST['page']), "&amp;{$key_str}&amp;{$gets}&amp;{$getsort}\">{$lang['strdelete']}</a></td>\n";
+
+ foreach ($plugin_functions_parameters['actionbuttons'] as $action) {
+ echo "<td class=\"opbutton{$id}\">";
+ $misc->printLink($action);
+ // "<a href=\"display.php?action=confeditrow&amp;strings=",
+ // urlencode($_REQUEST['strings']), "&amp;page=",
+ // urlencode($_REQUEST['page']), "&amp;{$key_str}&amp;{$gets}&amp;{$getsort}\">{$lang['stredit']}</a>"
+ echo "</td>\n";
+ }
+
}
}
View
86 domains.php
@@ -200,30 +200,44 @@ function doProperties($msg = '') {
echo "</table>\n";
// Display domain constraints
+ echo "<h3>{$lang['strconstraints']}</h3>\n";
if ($data->hasDomainConstraints()) {
$domaincons = $data->getDomainConstraints($_REQUEST['domain']);
- if ($domaincons->recordCount() > 0) {
- echo "<h3>{$lang['strconstraints']}</h3>\n";
- echo "<table>\n";
- echo "<tr><th class=\"data\">{$lang['strname']}</th><th class=\"data\">{$lang['strdefinition']}</th><th class=\"data\">{$lang['stractions']}</th>\n";
- $i = 0;
-
- while (!$domaincons->EOF) {
- $id = (($i % 2 ) == 0 ? '1' : '2');
- echo "<tr class=\"data{$id}\"><td>", $misc->printVal($domaincons->fields['conname']), "</td>";
- echo "<td>";
- echo $misc->printVal($domaincons->fields['consrc']);
- echo "</td>";
- echo "<td class=\"opbutton{$id}\">";
- echo "<a href=\"domains.php?action=confirm_drop_con&amp;{$misc->href}&amp;constraint=", urlencode($domaincons->fields['conname']),
- "&amp;domain=", urlencode($_REQUEST['domain']), "&amp;type=", urlencode($domaincons->fields['contype']), "\">{$lang['strdrop']}</a></td></tr>\n";
-
- $domaincons->moveNext();
- $i++;
- }
-
- echo "</table>\n";
- }
+
+ error_log(print_r($domaincons, 1));
+
+ $columns = array (
+ 'name' => array (
+ 'title' => $lang['strname'],
+ 'field' => field('conname')
+ ),
+ 'definition' => array (
+ 'title' => $lang['strdefinition'],
+ 'field' => field('consrc'),
+ ),
+ 'actions' => array (
+ 'title' => $lang['stractions'],
+ )
+ );
+
+ $actions = array (
+ 'drop' => array (
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'domains.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop_con',
+ 'domain' => $_REQUEST['domain'],
+ 'constraint' => field('conname'),
+ 'type' => field('contype'),
+ )
+ )
+ )
+ )
+ );
+
+ $misc->printTable($domaincons, $columns, $actions, 'domains-properties', $lang['strnodata']);
}
}
else echo "<p>{$lang['strnodata']}</p>\n";
@@ -446,20 +460,34 @@ function doDefault($msg = '') {
$actions = array(
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "domains.php?action=alter&amp;{$misc->href}&amp;",
- 'vars' => array('domain' => 'domname'),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'domains.php',
+ 'urlvars' => array (
+ 'action' => 'alter',
+ 'domain' => field('domname')
+ )
+ )
+ )
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "domains.php?action=confirm_drop&amp;{$misc->href}&amp;",
- 'vars' => array('domain' => 'domname'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'domains.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'domain' => field('domname')
+ )
+ )
+ )
),
);
if (!$data->hasAlterDomains()) unset($actions['alter']);
- $misc->printTable($domains, $columns, $actions, $lang['strnodomains']);
+ $misc->printTable($domains, $columns, $actions, 'domains-domains', $lang['strnodomains']);
$navlinks = array (
array (
View
88 fulltext.php
@@ -45,18 +45,32 @@ function doDefault($msg = '') {
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "fulltext.php?action=dropconfig&amp;{$misc->href}&amp;",
- 'vars' => array('ftscfg' => 'name'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'fulltext.php',
+ 'urlvars' => array (
+ 'action' => 'dropconfig',
+ 'ftscfg' => field('name')
+ )
+ )
+ )
),
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "fulltext.php?action=alterconfig&amp;{$misc->href}&amp;",
- 'vars' => array('ftscfg' => 'name'),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'fulltext.php',
+ 'urlvars' => array (
+ 'action' => 'alterconfig',
+ 'ftscfg' => field('name')
+ )
+ )
+ )
),
);
- $misc->printTable($cfgs, $columns, $actions, $lang['strftsnoconfigs']);
+ $misc->printTable($cfgs, $columns, $actions, 'fulltext-fulltext', $lang['strftsnoconfigs']);
$navlinks = array(
array (
@@ -356,7 +370,7 @@ function doViewParsers($msg = '') {
$actions = array();
- $misc->printTable($parsers, $columns, $actions, $lang['strftsnoparsers']);
+ $misc->printTable($parsers, $columns, $actions, 'fulltext-viewparsers', $lang['strftsnoparsers']);
//TODO: navlink to "create parser"
}
@@ -396,18 +410,32 @@ function doViewDicts($msg = '') {
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "fulltext.php?action=dropdict&amp;{$misc->href}&amp;",
- 'vars' => array('ftsdict' => 'name'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'fulltext.php',
+ 'urlvars' => array (
+ 'action' => 'dropdict',
+ 'ftsdict' => field('name')
+ )
+ )
+ )
),
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "fulltext.php?action=alterdict&amp;{$misc->href}&amp;",
- 'vars' => array('ftsdict' => 'name'),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'fulltext.php',
+ 'urlvars' => array (
+ 'action' => 'alterdict',
+ 'ftsdict' => field('name')
+ )
+ )
+ )
),
);
- $misc->printTable($dicts, $columns, $actions, $lang['strftsnodicts']);
+ $misc->printTable($dicts, $columns, $actions, 'fulltext-viewdicts', $lang['strftsnodicts']);
$navlinks = array(
array (
@@ -466,15 +494,31 @@ function doViewConfig($ftscfg, $msg = '') {
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "fulltext.php?action=dropmapping&amp;{$misc->href}&amp;",
- 'vars' => array('mapping' => 'name', 'ftscfg' => 'cfgname'),
'multiaction' => 'dropmapping',
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'fulltext.php',
+ 'urlvars' => array (
+ 'action' => 'dropmapping',
+ 'mapping' => field('name'),
+ 'ftscfg' => field('cfgname')
+ )
+ )
+ )
),
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "fulltext.php?action=altermapping&amp;{$misc->href}&amp;",
- 'vars' => array('mapping' => 'name', 'ftscfg' => 'cfgname'),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'fulltext.php',
+ 'urlvars' => array (
+ 'action' => 'altermapping',
+ 'mapping' => field('name'),
+ 'ftscfg' => field('cfgname')
+ )
+ )
+ )
),
'multiactions' => array(
'keycols' => array('mapping' => 'name'),
@@ -485,7 +529,7 @@ function doViewConfig($ftscfg, $msg = '') {
);
- $misc->printTable($map, $columns, $actions, $lang['strftsemptymap']);
+ $misc->printTable($map, $columns, $actions, 'fulltext-viewconfig', $lang['strftsemptymap']);
$navlinks = array(
array (
View
44 functions.php
@@ -847,24 +847,48 @@ function doDefault($msg = '') {
'url' => 'functions.php',
),
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "functions.php?action=edit&amp;{$misc->href}&amp;",
- 'vars' => array('function' => 'proproto', 'function_oid' => 'prooid'),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'functions.php',
+ 'urlvars' => array (
+ 'action' => 'edit',
+ 'function' => field('proproto'),
+ 'function_oid' => field('prooid')
+ )
+ )
+ )
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "functions.php?action=confirm_drop&amp;{$misc->href}&amp;",
- 'vars' => array('function' => 'proproto', 'function_oid' => 'prooid'),
'multiaction' => 'confirm_drop',
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'functions.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'function' => field('proproto'),
+ 'function_oid' => field('prooid')
+ )
+ )
+ )
),
'privileges' => array(
- 'title' => $lang['strprivileges'],
- 'url' => "privileges.php?{$misc->href}&amp;subject=function&amp;",
- 'vars' => array('function' => 'proproto', 'function_oid' => 'prooid'),
+ 'content' => $lang['strprivileges'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'privileges.php',
+ 'urlvars' => array (
+ 'subject' => 'function',
+ 'function' => field('proproto'),
+ 'function_oid' => field('prooid')
+ )
+ )
+ )
),
);
- $misc->printTable($funcs, $columns, $actions, $lang['strnofunctions']);
+ $misc->printTable($funcs, $columns, $actions, 'functions-functions', $lang['strnofunctions']);
$navlinks = array(
array (
View
55 groups.php
@@ -74,20 +74,34 @@ function doProperties($msg = '') {
$users = $data->getUsers();
if ($groupdata->recordCount() > 0) {
- echo "<table>\n";
- echo "<tr><th class=\"data\">{$lang['strmembers']}</th><th class=\"data\">{$lang['stractions']}</th></tr>\n";
- $i = 0;
- while (!$groupdata->EOF) {
- $id = (($i % 2) == 0 ? '1' : '2');
- echo "<tr class=\"data{$id}\"><td>", $misc->printVal($groupdata->fields['usename']), "</td>\n";
- echo "<td class=\"opbutton{$id}\"><a href=\"groups.php?action=confirm_drop_member&{$misc->href}&group=",
- urlencode($_REQUEST['group']), "&user=", urlencode($groupdata->fields['usename']), "\">{$lang['strdrop']}</a></td>\n";
- echo "</tr>\n";
- $groupdata->moveNext();
- }
- echo "</table>\n";
+ $columns = array (
+ 'members' => array (
+ 'title' => $lang['strmembers'],
+ 'field' => field('usename')
+ ),
+ 'actions' => array (
+ 'title' => $lang['stractions'],
+ )
+ );
+
+ $actions = array (
+ 'drop' => array (
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'groups.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop_member',
+ 'group' => $_REQUEST['group'],
+ 'user' => field('usename')
+ )
+ )
+ )
+ )
+ );
+
+ $misc->printTable($groupdata, $columns, $actions, 'groups-properties', $lang['strnousers']);
}
- else echo "<p>{$lang['strnousers']}</p>\n";
// Display form for adding a user to the group
echo "<form action=\"groups.php\" method=\"post\">\n";
@@ -239,13 +253,20 @@ function doDefault($msg = '') {
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "groups.php?action=confirm_drop&amp;{$misc->href}&amp;",
- 'vars' => array('group' => 'groname'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'groups.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'group' => field('groname')
+ )
+ )
+ )
),
);
- $misc->printTable($groups, $columns, $actions, $lang['strnogroups']);
+ $misc->printTable($groups, $columns, $actions, 'groups-properties', $lang['strnogroups']);
$misc->printNavLinks(array (array (
'attr'=> array (
View
34 history.php
@@ -52,19 +52,35 @@ function doDefault() {
$actions = array(
'run' => array(
- 'title' => $lang['strexecute'],
- 'url' => "sql.php?{$misc->href}&amp;nohistory=t&amp;subject=history&amp;",
- 'vars' => array('queryid' => 'queryid', 'paginate' => 'paginate'),
- 'target' => 'detail',
+ 'content' => $lang['strexecute'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'sql.php',
+ 'urlvars' => array (
+ 'subject' => 'history',
+ 'nohistory' => 't',
+ 'queryid' => field('queryid'),
+ 'paginate' => field('paginate')
+ )
+ ),
+ 'target' => 'detail'
+ )
),
'remove' => array(
- 'title' => $lang['strdelete'],
- 'url' => "history.php?{$misc->href}&amp;action=confdelhistory&amp;",
- 'vars' => array('queryid' => 'queryid'),
- ),
+ 'content' => $lang['strdelete'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'history.php',
+ 'urlvars' => array (
+ 'action' => 'confdelhistory',
+ 'queryid' => field('queryid'),
+ )
+ )
+ )
+ )
);
- $misc->printTable($history, $columns, $actions, $lang['strnohistory']);
+ $misc->printTable($history, $columns, $actions, 'history-history', $lang['strnohistory']);
}
else echo "<p>{$lang['strnohistory']}</p>\n";
View
48 indexes.php
@@ -290,26 +290,50 @@ function indPre(&$rowdata, $actions) {
'field' => field('idxcomment'),
),
);
-
+
$actions = array(
'cluster' => array(
- 'title' => $lang['strclusterindex'],
- 'url' => "indexes.php?action=confirm_cluster_index&amp;{$misc->href}&amp;table=".urlencode($_REQUEST['table'])."&amp;",
- 'vars' => array('index' => 'indname'),
+ 'content' => $lang['strclusterindex'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'indexes.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_cluster_index',
+ 'table' => $_REQUEST['table'],
+ 'index' => field('indname')
+ )
+ )
+ )
),
'reindex' => array(
- 'title' => $lang['strreindex'],
- 'url' => "indexes.php?action=reindex&amp;{$misc->href}&amp;table=".urlencode($_REQUEST['table'])."&amp;",
- 'vars' => array('index' => 'indname'),
+ 'content' => $lang['strreindex'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'indexes.php',
+ 'urlvars' => array (
+ 'action' => 'reindex',
+ 'table' => $_REQUEST['table'],
+ 'index' => field('indname')
+ )
+ )
+ )
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "indexes.php?action=confirm_drop_index&amp;{$misc->href}&amp;table=".urlencode($_REQUEST['table'])."&amp;",
- 'vars' => array('index' => 'indname'),
- ),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'indexes.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop_index',
+ 'table' => $_REQUEST['table'],
+ 'index' => field('indname')
+ )
+ )
+ )
+ )
);
- $misc->printTable($indexes, $columns, $actions, $lang['strnoindexes'], 'indPre');
+ $misc->printTable($indexes, $columns, $actions, 'indexes-indexes', $lang['strnoindexes'], 'indPre');
$misc->printNavLinks(array (
array (
View
169 info.php
@@ -45,85 +45,118 @@ function doDefault($msg = '') {
// Referring foreign tables
if ($referrers !== -99 && $referrers->recordCount() > 0) {
echo "<h3>{$lang['strreferringtables']}</h3>\n";
- echo "<table>\n";
- echo "\t<tr>\n\t\t";
- echo "<th class=\"data\">{$lang['strschema']}</th>";
- echo "<th class=\"data\">{$lang['strtable']}</th>";
- echo "<th class=\"data\">{$lang['strname']}</th><th class=\"data\">{$lang['strdefinition']}</th>";
- echo "<th class=\"data\">{$lang['stractions']}</th>\n";
- echo "\t</tr>\n";
- $i = 0;
-
- while (!$referrers->EOF) {
- $id = ( ($i % 2 ) == 0 ? '1' : '2' );
- echo "\t<tr class=\"data{$id}\">\n\t\t";
- echo "<td>", $misc->printVal($referrers->fields['nspname']), "</td>";
- echo "<td>", $misc->printVal($referrers->fields['relname']), "</td>";
- echo "<td>", $misc->printVal($referrers->fields['conname']), "</td>";
- echo "<td>", $misc->printVal($referrers->fields['consrc']), "</td>";
- echo "<td class=\"opbutton{$id}\"><a href=\"constraints.php?{$misc->href}",
- "&amp;schema=", urlencode($referrers->fields['nspname']),
- "&amp;table=", urlencode($referrers->fields['relname']), "\">{$lang['strproperties']}</a></td>\n";
- echo "\t</tr>\n";
- $referrers->movenext();
- $i++;
- }
-
- echo "</table>\n";
+
+ $columns = array (
+ 'schema' => array (
+ 'title' => $lang['strschema'],
+ 'field' => field('nspname')
+ ),
+ 'table' => array (
+ 'title' => $lang['strtable'],
+ 'field' => field('relname'),
+ ),
+ 'name' => array (
+ 'title' => $lang['strname'],
+ 'field' => field('conname'),
+ ),
+ 'definition' => array (
+ 'title' => $lang['strdefinition'],
+ 'field' => field('consrc'),
+ ),
+ 'actions' => array (
+ 'title' => $lang['stractions'],
+ )
+ );
+
+ $actions = array (
+ 'properties' => array (
+ 'content' => $lang['strproperties'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'constraints.php',
+ 'urlvars' => array (
+ 'schema' => field('nspname'),
+ 'table' => field('relname')
+ )
+ )
+ )
+ )
+ );
+
+ $misc->printTable($referrers, $columns, $actions, 'info-referrers', $lang['strnodata']);
}
// Parent tables
if ($parents->recordCount() > 0) {
echo "<h3>{$lang['strparenttables']}</h3>\n";
- echo "<table>\n";
- echo "\t<tr>\n\t\t";
- echo "<th class=\"data\">{$lang['strschema']}</th>";
- echo "\t\t<th class=\"data\">{$lang['strtable']}</th>";
- echo "<th class=\"data\">{$lang['stractions']}</th>\n";
- echo "\t</tr>\n";
- $i = 0;
-
- while (!$parents->EOF) {
- $id = ( ($i % 2 ) == 0 ? '1' : '2' );
- echo "\t<tr class=\"data{$id}\">\n";
- echo "\t\t<td>", $misc->printVal($parents->fields['nspname']), "</td>";
- echo "<td>", $misc->printVal($parents->fields['relname']), "</td>";
- echo "<td class=\"opbutton{$id}\"><a href=\"tblproperties.php?{$misc->href}",
- "&amp;schema=", urlencode($parents->fields['nspname']),
- "&amp;table=", urlencode($parents->fields['relname']), "\">{$lang['strproperties']}</a></td>\n";
- echo "\t</tr>\n";
- $parents->movenext();
- $i++;
- }
-
- echo "</table>\n";
+
+ $columns = array (
+ 'schema' => array (
+ 'title' => $lang['strschema'],
+ 'field' => field('nspname')
+ ),
+ 'table' => array (
+ 'title' => $lang['strtable'],
+ 'field' => field('relname'),
+ ),
+ 'actions' => array (
+ 'title' => $lang['stractions'],
+ )
+ );
+
+ $actions = array (
+ 'properties' => array (
+ 'content' => $lang['strproperties'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tblproperties.php',
+ 'urlvars' => array (
+ 'schema' => field('nspname'),
+ 'table' => field('relname')
+ )
+ )
+ )
+ )
+ );
+
+ $misc->printTable($parents, $columns, $actions, 'info-parents', $lang['strnodata']);
}
// Child tables
if ($children->recordCount() > 0) {
echo "<h3>{$lang['strchildtables']}</h3>\n";
- echo "<table>\n";
- echo "\t<tr>\n";
- echo "<th class=\"data\">{$lang['strschema']}</th>";
- echo "\t\t<th class=\"data\">{$lang['strtable']}</th>";
- echo "<th class=\"data\">{$lang['stractions']}</th>\n";
- echo "\t</tr>\n";
- $i = 0;
+
+ $columns = array (
+ 'schema' => array (
+ 'title' => $lang['strschema'],
+ 'field' => field('nspname')
+ ),
+ 'table' => array (
+ 'title' => $lang['strtable'],
+ 'field' => field('relname'),
+ ),
+ 'actions' => array (
+ 'title' => $lang['stractions'],
+ )
+ );
- while (!$children->EOF) {
- $id = ( ($i % 2 ) == 0 ? '1' : '2' );
- echo "\t<tr class=\"data{$id}\">\n";
- echo "\t\t<td>", $misc->printVal($children->fields['nspname']), "</td>";
- echo "<td>", $misc->printVal($children->fields['relname']), "</td>";
- echo "<td class=\"opbutton{$id}\"><a href=\"tblproperties.php?{$misc->href}",
- "&amp;schema=", urlencode($children->fields['nspname']),
- "&amp;table=", urlencode($children->fields['relname']), "\">{$lang['strproperties']}</a></td>\n";
- echo "\t</tr>\n";
- $children->movenext();
- $i++;
- }
-
- echo "</table>\n";
+ $actions = array (
+ 'properties' => array (
+ 'content' => $lang['strproperties'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tblproperties.php',
+ 'urlvars' => array (
+ 'schema' => field('nspname'),
+ 'table' => field('relname')
+ )
+ )
+ )
+ )
+ );
+
+ $misc->printTable($children, $columns, $actions, 'info-children', $lang['strnodata']);
+
}
// Row performance
View
2  languages.php
@@ -43,7 +43,7 @@ function doDefault($msg = '') {
$actions = array();
- $misc->printTable($languages, $columns, $actions, $lang['strnolanguages']);
+ $misc->printTable($languages, $columns, $actions, 'languages-languages', $lang['strnolanguages']);
}
/**
View
2  opclasses.php
@@ -51,7 +51,7 @@ function doDefault($msg = '') {
$actions = array();
- $misc->printTable($opclasses, $columns, $actions, $lang['strnoopclasses']);
+ $misc->printTable($opclasses, $columns, $actions, 'opclasses-opclasses', $lang['strnoopclasses']);
}
/**
View
23 operators.php
@@ -130,6 +130,8 @@ function doDefault($msg = '') {
$operators = $data->getOperators();
+ error_log(print_r($operators, 1));
+
$columns = array(
'operator' => array(
'title' => $lang['stroperator'],
@@ -160,13 +162,24 @@ function doDefault($msg = '') {
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "operators.php?action=confirm_drop&amp;{$misc->href}&amp;",
- 'vars' => array('operator' => 'oprname', 'operator_oid' => 'oid'),
- ),
+ // 'title' => $lang['strdrop'],
+ // 'url' => "operators.php?action=confirm_drop&amp;{$misc->href}&amp;",
+ // 'vars' => array('operator' => 'oprname', 'operator_oid' => 'oid'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'operators.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'operator' => field('oprname'),
+ 'operator_oid' => field('oid')
+ )
+ )
+ )
+ )
);
- $misc->printTable($operators, $columns, $actions, $lang['strnooperators']);
+ $misc->printTable($operators, $columns, $actions, 'operators-operators', $lang['strnooperators']);
// TODO operators.php action=create $lang['strcreateoperator']
}
View
46 reports.php
@@ -279,7 +279,6 @@ function doDrop($confirm) {
else
doDefault($lang['strreportdroppedbad']);
}
-
}
/**
@@ -326,23 +325,48 @@ function doDefault($msg = '') {
$actions = array(
'run' => array(
- 'title' => $lang['strexecute'],
- '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'),
+ 'content' => $lang['strexecute'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'sql.php',
+ 'urlvars' => array (
+ 'subject' => 'report',
+ 'return' => 'report',
+ 'report' => field('report_name'),
+ 'database' => field('db_name'),
+ 'reportid' => field('report_id'),
+ 'paginate' => field('paginate')
+ )
+ )
+ )
),
'edit' => array(
- 'title' => $lang['stredit'],
- 'url' => "reports.php?action=edit&amp;{$misc->href}&amp;",
- 'vars' => array('report_id' => 'report_id'),
+ 'content' => $lang['stredit'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'reports.php',
+ 'urlvars' => array (
+ 'action' => 'edit',
+ 'report_id' => field('report_id')
+ )
+ )
+ )
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "reports.php?action=confirm_drop&amp;{$misc->href}&amp;",
- 'vars' => array('report_id' => 'report_id'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'reports.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'report_id' => field('report_id')
+ )
+ )
+ )
),
);
- $misc->printTable($reports, $columns, $actions, $lang['strnoreports']);
+ $misc->printTable($reports, $columns, $actions, 'reports-reports', $lang['strnoreports']);
$urlvars = array ('server' => $_REQUEST['server']);
if (isset($_REQUEST['database'])) $urlvars['database'] = $_REQUEST['database'];
View
28 roles.php
@@ -652,18 +652,32 @@ function renderRoleExpires($val) {
$actions = array(
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "roles.php?action=alter&amp;{$misc->href}&amp;",
- 'vars' => array('rolename' => 'rolname'),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'roles.php',
+ 'urlvars' => array (
+ 'action' => 'alter',
+ 'rolename' => field('rolname')
+ )
+ )
+ )
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "roles.php?action=confirm_drop&amp;{$misc->href}&amp;",
- 'vars' => array('rolename' => 'rolname'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'roles.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'rolename' => field('rolname')
+ )
+ )
+ )
),
);
- $misc->printTable($roles, $columns, $actions, $lang['strnoroles']);
+ $misc->printTable($roles, $columns, $actions, 'roles-roles', $lang['strnoroles']);
$navlinks = array (
array (
View
18 rules.php
@@ -149,13 +149,23 @@ function doDefault($msg = '') {
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "rules.php?action=confirm_drop&amp;{$misc->href}&amp;reltype={$subject}&amp;{$subject}={$object}&amp;subject=rule&amp;",
- 'vars' => array('rule' => 'rulename'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'rules.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'reltype' => $subject,
+ $subject => $object,
+ 'subject' => 'rule',
+ 'rule' => field('rulename')
+ )
+ )
+ )
),
);
- $misc->printTable($rules, $columns, $actions, $lang['strnorules']);
+ $misc->printTable($rules, $columns, $actions, 'rules-rules', $lang['strnorules']);
$misc->printNavLinks(array (array (
'attr'=> array (
View
43 schemas.php
@@ -52,26 +52,47 @@ function doDefault($msg = '') {
'url' => 'schemas.php',
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "schemas.php?action=drop&amp;{$misc->href}&amp;",
- 'vars' => array('nsp' => 'nspname'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'schemas.php',
+ 'urlvars' => array (
+ 'action' => 'drop',
+ 'nsp' => field('nspname')
+ )
+ )
+ ),
'multiaction' => 'drop',
),
'privileges' => array(
- 'title' => $lang['strprivileges'],
- 'url' => "privileges.php?subject=schema&amp;{$misc->href}&amp;",
- 'vars' => array('schema' => 'nspname'),
+ 'content' => $lang['strprivileges'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'privileges.php',
+ 'urlvars' => array (
+ 'subject' => 'schema',
+ 'schema' => field('nspname')
+ )
+ )
+ )
),
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "schemas.php?action=alter&amp;{$misc->href}&amp;",
- 'vars' => array('schema' => 'nspname'),
- ),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'schemas.php',
+ 'urlvars' => array (
+ 'action' => 'alter',
+ 'schema' => field('nspname')
+ )
+ )
+ )
+ )
);
if (!$data->hasAlterSchema()) unset($actions['alter']);
- $misc->printTable($schemas, $columns, $actions, $lang['strnoschemas']);
+ $misc->printTable($schemas, $columns, $actions, 'schemas-schemas', $lang['strnoschemas']);
$misc->printNavLinks(array (array (
'attr'=> array (
View
42 sequences.php
@@ -52,24 +52,46 @@ function doDefault($msg = '') {
'url' => 'sequences.php',
),
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "sequences.php?action=confirm_alter&amp;{$misc->href}&amp;subject=sequence&amp;",
- 'vars' => array('sequence' => 'seqname'),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'sequences.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_alter',
+ 'subject' => 'sequence',
+ 'sequence' => field('seqname')
+ )
+ )
+ )
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "sequences.php?action=confirm_drop&amp;{$misc->href}&amp;",
- 'vars' => array('sequence' => 'seqname'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'sequences.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'sequence' => field('seqname')
+ )
+ )
+ ),
'multiaction' => 'confirm_drop',
),
'privileges' => array(
- 'title' => $lang['strprivileges'],
- 'url' => "privileges.php?{$misc->href}&amp;subject=sequence&amp;",
- 'vars' => array('sequence' => 'seqname'),
+ 'content' => $lang['strprivileges'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'privileges.php',
+ 'urlvars' => array (
+ 'subject' => 'sequence',
+ 'sequence' => field('seqname')
+ )
+ )
+ )
),
);
- $misc->printTable($sequences, $columns, $actions, $lang['strnosequences']);
+ $misc->printTable($sequences, $columns, $actions, 'sequences-sequences', $lang['strnosequences']);
$misc->printNavLinks(array (array (
'attr'=> array (
View
17 servers.php
@@ -85,9 +85,16 @@ function svPre(&$rowdata, $actions) {
$actions = array(
'logout' => array(
- 'title' => $lang['strlogout'],
- 'url' => "servers.php?action=logout&amp;",
- 'vars' => array('logoutServer' => 'id'),
+ 'content' => $lang['strlogout'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'servers.php',
+ 'urlvars' => array (
+ 'action' => 'logout',
+ 'logoutServer' => field('id')
+ )
+ )
+ )
),
);
@@ -95,8 +102,8 @@ function svPre(&$rowdata, $actions) {
$misc->printTitle(sprintf($lang['strgroupservers'],htmlentities($conf['srv_groups'][$group]['desc'], ENT_QUOTES, 'UTF-8')));
$actions['logout']['url'] .= "group=" . htmlentities($group, ENT_COMPAT, 'UTF-8') . "&amp;";
}
-
- $misc->printTable($servers, $columns, $actions, $lang['strnoobjects'], 'svPre');
+
+ $misc->printTable($servers, $columns, $actions, 'servers-servers', $lang['strnoobjects'], 'svPre');
}
function doTree() {
View
122 tables.php
@@ -770,61 +770,125 @@ function doDefault($msg = '') {
'default' => 'analyze',
),
'browse' => array(
- 'title' => $lang['strbrowse'],
- 'url' => "display.php?{$misc->href}&amp;subject=table&amp;return=schema&amp;",
- 'vars' => array('table' => 'relname'),
+ 'content' => $lang['strbrowse'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'display.php',
+ 'urlvars' => array (
+ 'subject' => 'table',
+ 'return' => 'schema',
+ 'table' => field('relname')
+ )
+ )
+ )
),
'select' => array(
- 'title' => $lang['strselect'],
- 'url' => "tables.php?action=confselectrows&amp;{$misc->href}&amp;",
- 'vars' => array('table' => 'relname'),
+ 'content' => $lang['strselect'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tables.php',
+ 'urlvars' => array (
+ 'action' => 'confselectrows',
+ 'table' => field('relname')
+ )
+ )
+ )
),
'insert' => array(
- 'title' => $lang['strinsert'],
- 'url' => "tables.php?action=confinsertrow&amp;{$misc->href}&amp;",
- 'vars' => array('table' => 'relname'),
+ 'content' => $lang['strinsert'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tables.php',
+ 'urlvars' => array (
+ 'action' => 'confinsertrow',
+ 'table' => field('relname')
+ )
+ )
+ )
),
'empty' => array(
- 'title' => $lang['strempty'],
- 'url' => "tables.php?action=confirm_empty&amp;{$misc->href}&amp;",
- 'vars' => array('table' => 'relname'),
'multiaction' => 'confirm_empty',
+ 'content' => $lang['strempty'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tables.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_empty',
+ 'table' => field('relname')
+ )
+ )
+ )
),
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "tblproperties.php?action=confirm_alter&amp;{$misc->href}&amp;",
- 'vars' => array('table' => 'relname'),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tblproperties.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_alter',
+ 'table' => field('relname')
+ )
+ )
+ )
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "tables.php?action=confirm_drop&amp;{$misc->href}&amp;",
- 'vars' => array('table' => 'relname'),
'multiaction' => 'confirm_drop',
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tables.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'table' => field('relname')
+ )
+ )
+ )
),
'vacuum' => array(
- 'title' => $lang['strvacuum'],
- 'url' => "tables.php?action=confirm_vacuum&amp;{$misc->href}&amp;",
- 'vars' => array('table' => 'relname'),
'multiaction' => 'confirm_vacuum',
+ 'content' => $lang['strvacuum'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tables.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_vacuum',
+ 'table' => field('relname')
+ )
+ )
+ )
),
'analyze' => array(
- 'title' => $lang['stranalyze'],
- 'url' => "tables.php?action=confirm_analyze&amp;{$misc->href}&amp;",
- 'vars' => array('table' => 'relname'),
'multiaction' => 'confirm_analyze',
+ 'content' => $lang['stranalyze'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tables.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_analyze',
+ 'table' => field('relname')
+ )
+ )
+ )
),
'reindex' => array(
- 'title' => $lang['strreindex'],
- 'url' => "tables.php?action=confirm_reindex&amp;{$misc->href}&amp;",
- 'vars' => array('table' => 'relname'),
'multiaction' => 'confirm_reindex',
- ),
+ 'content' => $lang['strreindex'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tables.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_reindex',