$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'],
);
}
- $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 />";
$actions = array(
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "aggregates.php?action=alter&{$misc->href}&",
- '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&{$misc->href}&",
- '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 (
$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&subject=database&{$misc->href}&",
- '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&{$misc->href}&",
- '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&subject=database&{$misc->href}&",
- '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']);
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 (
$actions = array();
- $misc->printTable($casts, $columns, $actions, $lang['strnocasts']);
+ $misc->printTable($casts, $columns, $actions, 'casts-casts', $lang['strnocasts']);
}
/**
}
/**
- * 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";
}
$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'];
}
}
}
* 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,
* 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'];
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;
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;
* 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();
}
$actions=array();
- $misc->printTable($attrs, $column, $actions, null, 'attPre');
+ $misc->printTable($attrs, $column, $actions, 'colproperties-colproperties', null, 'attPre');
echo "<br />\n";
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "constraints.php?action=confirm_drop&{$misc->href}&table=".urlencode($_REQUEST['table'])."&",
- '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 (
$actions = array();
- $misc->printTable($conversions, $columns, $actions, $lang['strnoconversions']);
+ $misc->printTable($conversions, $columns, $actions, 'conversions-conversions', $lang['strnoconversions']);
}
/**
$actions = array();
- $misc->printTable($variables, $columns, $actions, $lang['strnodata']);
+ $misc->printTable($variables, $columns, $actions, 'database-variables', $lang['strnodata']);
}
/**
$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
if ($data->isSuperUser()) {
$actions = array(
'cancel' => array(
- 'title' => $lang['strcancel'],
- 'url' => "database.php?action=signal&signal=CANCEL&{$misc->href}&",
- '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&signal=KILL&{$misc->href}&",
- 'vars' => array('procpid' => 'procpid')
+ 'content' => $lang['strkill'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'database.php',
+ 'urlvars' => array (
+ 'action' => 'signal',
+ 'signal' => 'KILL',
+ 'procpid' => field('procpid')
+ )
+ )
+ )
)
);
// 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;
}
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;
}
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));
$key_str .= urlencode("key[{$v}]") . '=' . urlencode($rs->fields[$v]);
}
if ($has_nulls) {
- echo "<td colspan=\"2\"> </td>\n";
+ echo "<td colspan=\"{$colspan}\"> </td>\n";
} else {
echo "<td class=\"opbutton{$id}\"><a href=\"display.php?action=confeditrow&strings=",
urlencode($_REQUEST['strings']), "&page=",
echo "<td class=\"opbutton{$id}\"><a href=\"display.php?action=confdelrow&strings=",
urlencode($_REQUEST['strings']), "&page=",
urlencode($_REQUEST['page']), "&{$key_str}&{$gets}&{$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&strings=",
+ // urlencode($_REQUEST['strings']), "&page=",
+ // urlencode($_REQUEST['page']), "&{$key_str}&{$gets}&{$getsort}\">{$lang['stredit']}</a>"
+ echo "</td>\n";
+ }
+
}
}
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&{$misc->href}&constraint=", urlencode($domaincons->fields['conname']),
- "&domain=", urlencode($_REQUEST['domain']), "&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";
$actions = array(
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "domains.php?action=alter&{$misc->href}&",
- '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&{$misc->href}&",
- '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 (
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "fulltext.php?action=dropconfig&{$misc->href}&",
- '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&{$misc->href}&",
- '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 (
$actions = array();
- $misc->printTable($parsers, $columns, $actions, $lang['strftsnoparsers']);
+ $misc->printTable($parsers, $columns, $actions, 'fulltext-viewparsers', $lang['strftsnoparsers']);
//TODO: navlink to "create parser"
}
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "fulltext.php?action=dropdict&{$misc->href}&",
- '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&{$misc->href}&",
- '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 (
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "fulltext.php?action=dropmapping&{$misc->href}&",
- '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&{$misc->href}&",
- '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'),
);
- $misc->printTable($map, $columns, $actions, $lang['strftsemptymap']);
+ $misc->printTable($map, $columns, $actions, 'fulltext-viewconfig', $lang['strftsemptymap']);
$navlinks = array(
array (
'url' => 'functions.php',
),
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "functions.php?action=edit&{$misc->href}&",
- '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&{$misc->href}&",
- '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}&subject=function&",
- '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 (
$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";
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "groups.php?action=confirm_drop&{$misc->href}&",
- '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 (
$actions = array(
'run' => array(
- 'title' => $lang['strexecute'],
- 'url' => "sql.php?{$misc->href}&nohistory=t&subject=history&",
- '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}&action=confdelhistory&",
- '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";
'field' => field('idxcomment'),
),
);
-
+
$actions = array(
'cluster' => array(
- 'title' => $lang['strclusterindex'],
- 'url' => "indexes.php?action=confirm_cluster_index&{$misc->href}&table=".urlencode($_REQUEST['table'])."&",
- '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&{$misc->href}&table=".urlencode($_REQUEST['table'])."&",
- '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&{$misc->href}&table=".urlencode($_REQUEST['table'])."&",
- '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 (
// 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}",
- "&schema=", urlencode($referrers->fields['nspname']),
- "&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}",
- "&schema=", urlencode($parents->fields['nspname']),
- "&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}",
- "&schema=", urlencode($children->fields['nspname']),
- "&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
$actions = array();
- $misc->printTable($languages, $columns, $actions, $lang['strnolanguages']);
+ $misc->printTable($languages, $columns, $actions, 'languages-languages', $lang['strnolanguages']);
}
/**
$actions = array();
- $misc->printTable($opclasses, $columns, $actions, $lang['strnoopclasses']);
+ $misc->printTable($opclasses, $columns, $actions, 'opclasses-opclasses', $lang['strnoopclasses']);
}
/**
$operators = $data->getOperators();
+ error_log(print_r($operators, 1));
+
$columns = array(
'operator' => array(
'title' => $lang['stroperator'],
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "operators.php?action=confirm_drop&{$misc->href}&",
- 'vars' => array('operator' => 'oprname', 'operator_oid' => 'oid'),
- ),
+ // 'title' => $lang['strdrop'],
+ // 'url' => "operators.php?action=confirm_drop&{$misc->href}&",
+ // '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']
}
else
doDefault($lang['strreportdroppedbad']);
}
-
}
/**
$actions = array(
'run' => array(
- 'title' => $lang['strexecute'],
- 'url' => "sql.php?subject=report&{$misc->href}&return=report&",
- '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&{$misc->href}&",
- '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&{$misc->href}&",
- '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'];
$actions = array(
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "roles.php?action=alter&{$misc->href}&",
- '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&{$misc->href}&",
- '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 (
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "rules.php?action=confirm_drop&{$misc->href}&reltype={$subject}&{$subject}={$object}&subject=rule&",
- '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 (
'url' => 'schemas.php',
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "schemas.php?action=drop&{$misc->href}&",
- '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&{$misc->href}&",
- '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&{$misc->href}&",
- '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 (
'url' => 'sequences.php',
),
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "sequences.php?action=confirm_alter&{$misc->href}&subject=sequence&",
- '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&{$misc->href}&",
- '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}&subject=sequence&",
- '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 (
$actions = array(
'logout' => array(
- 'title' => $lang['strlogout'],
- 'url' => "servers.php?action=logout&",
- 'vars' => array('logoutServer' => 'id'),
+ 'content' => $lang['strlogout'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'servers.php',
+ 'urlvars' => array (
+ 'action' => 'logout',
+ 'logoutServer' => field('id')
+ )
+ )
+ )
),
);
$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') . "&";
}
-
- $misc->printTable($servers, $columns, $actions, $lang['strnoobjects'], 'svPre');
+
+ $misc->printTable($servers, $columns, $actions, 'servers-servers', $lang['strnoobjects'], 'svPre');
}
function doTree() {
'default' => 'analyze',
),
'browse' => array(
- 'title' => $lang['strbrowse'],
- 'url' => "display.php?{$misc->href}&subject=table&return=schema&",
- '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&{$misc->href}&",
- '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&{$misc->href}&",
- '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&{$misc->href}&",
- '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&{$misc->href}&",
- '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&{$misc->href}&",
- '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&{$misc->href}&",
- '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&{$misc->href}&",
- '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&{$misc->href}&",
- 'vars' => array('table' => 'relname'),
'multiaction' => 'confirm_reindex',
- ),
+ 'content' => $lang['strreindex'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tables.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_reindex',
+ 'table' => field('relname')
+ )
+ )
+ )
+ )
//'cluster' TODO ?
);
if (!$data->hasTablespaces()) unset($columns['tablespace']);
- $misc->printTable($tables, $columns, $actions, $lang['strnotables']);
+ $misc->printTable($tables, $columns, $actions, 'tables-tables', $lang['strnotables']);
$navlinks = array (
array (
$actions = array(
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "tablespaces.php?action=edit&{$misc->href}&",
- 'vars' => array('tablespace' => 'spcname')
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tablespaces.php',
+ 'urlvars' => array (
+ 'action' => 'edit',
+ 'tablespace' => field('spcname')
+ )
+ )
+ )
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "tablespaces.php?action=confirm_drop&{$misc->href}&",
- 'vars' => array('tablespace' => 'spcname')
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tablespaces.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'tablespace' => field('spcname')
+ )
+ )
+ )
),
'privileges' => array(
- 'title' => $lang['strprivileges'],
- 'url' => "privileges.php?subject=tablespace&{$misc->href}&",
- 'vars' => array('tablespace' => 'spcname')
+ 'content' => $lang['strprivileges'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'privileges.php',
+ 'urlvars' => array (
+ 'subject' => 'tablespace',
+ 'tablespace' => field('spcname')
+ )
+ )
+ )
)
);
- $misc->printTable($tablespaces, $columns, $actions, $lang['strnotablespaces']);
+ $misc->printTable($tablespaces, $columns, $actions, 'tablespaces-tablespaces', $lang['strnotablespaces']);
$misc->printNavLinks(array (array (
'attr'=> array (
$data->fieldClean($attname);
$data->fieldClean($table);
- $actions['browse']['url'] .= 'query=' . urlencode("SELECT \"{$attname}\", count(*) AS \"count\"
- FROM \"{$table}\" GROUP BY \"{$attname}\" ORDER BY \"{$attname}\"") . '&';
+ $actions['browse']['attr']['href']['urlvars']['query'] = "SELECT \"{$attname}\", count(*) AS \"count\"
+ FROM \"{$table}\" GROUP BY \"{$attname}\" ORDER BY \"{$attname}\"";
+
return $actions;
}
),
);
- $misc->printTable($attrs, $columns, $actions, null, 'attPre');
+ $actions = array(
+ 'browse' => array(
+ 'content' => $lang['strbrowse'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'display.php',
+ 'urlvars' => array (
+ 'table' => $_REQUEST['table'],
+ 'subject' => 'column',
+ 'return' => 'table',
+ 'column' => field('attname')
+ )
+ )
+ )
+ ),
+ 'alter' => array(
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'colproperties.php',
+ 'urlvars' => array (
+ 'subject' => 'column',
+ 'action' => 'properties',
+ 'table' => $_REQUEST['table'],
+ 'column' => field('attname')
+ )
+ )
+ )
+ ),
+ 'privileges' => array(
+ 'content' => $lang['strprivileges'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'privileges.php',
+ 'urlvars' => array (
+ 'subject' => 'column',
+ 'table' => $_REQUEST['table'],
+ 'column' => field('attname')
+ )
+ )
+ )
+ ),
+ 'drop' => array(
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'tblproperties.php',
+ 'urlvars' => array (
+ 'subject' => 'column',
+ 'action' => 'confirm_drop',
+ 'table' => $_REQUEST['table'],
+ 'column' => field('attname')
+ )
+ )
+ )
+ ),
+ );
+
+ $misc->printTable($attrs, $columns, $actions, 'tblproperties-tblproperties', null, 'attPre');
$navlinks = array (
array (
$actions = array(
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "triggers.php?action=confirm_alter&{$misc->href}&table=".urlencode($_REQUEST['table'])."&",
- 'vars' => array('trigger' => 'tgname'),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'triggers.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_alter',
+ 'table' => $_REQUEST['table'],
+ 'trigger' => field('tgname')
+ )
+ )
+ )
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "triggers.php?action=confirm_drop&{$misc->href}&table=".urlencode($_REQUEST['table'])."&",
- 'vars' => array('trigger' => 'tgname'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'triggers.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'table' => $_REQUEST['table'],
+ 'trigger' => field('tgname')
+ )
+ )
+ )
),
);
if($data->hasDisableTriggers()) {
- $actions['enable'] = array(
- 'title' => $lang['strenable'],
- 'url' => "triggers.php?action=confirm_enable&{$misc->href}&table=".urlencode($_REQUEST['table'])."&",
- 'vars' => array('trigger' => 'tgname'),
- );
- $actions['disable'] = array(
- 'title' => $lang['strdisable'],
- 'url' => "triggers.php?action=confirm_disable&{$misc->href}&table=".urlencode($_REQUEST['table'])."&",
- 'vars' => array('trigger' => 'tgname'),
- );
+ $actions['enable'] = array(
+ 'content' => $lang['strenable'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'triggers.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_enable',
+ 'table' => $_REQUEST['table'],
+ 'trigger' => field('tgname')
+ )
+ )
+ )
+ );
+ $actions['disable'] = array(
+ 'content' => $lang['strdisable'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'triggers.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_disable',
+ 'table' => $_REQUEST['table'],
+ 'trigger' => field('tgname')
+ )
+ )
+ )
+ );
}
- $misc->printTable($triggers, $columns, $actions, $lang['strnotriggers'], 'tgPre');
+ $misc->printTable($triggers, $columns, $actions, 'triggers-triggers', $lang['strnotriggers'], 'tgPre');
$misc->printNavLinks(array (array (
'attr'=> array (
$actions = array();
- $misc->printTable($attrs, $columns, $actions, null, 'attPre');
+ $misc->printTable($attrs, $columns, $actions, 'types-properties', null, 'attPre');
break;
case 'e':
$actions = array(
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "types.php?action=confirm_drop&{$misc->href}&",
- 'vars' => array('type' => 'basename'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'types.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'type' => field('basename')
+ )
+ )
+ )
),
);
- $misc->printTable($types, $columns, $actions, $lang['strnotypes']);
+ $misc->printTable($types, $columns, $actions, 'types-types', $lang['strnotypes']);
$navlinks = array (
array (
$actions = array(
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "users.php?action=edit&{$misc->href}&",
- 'vars' => array('username' => 'usename'),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'users.php',
+ 'urlvars' => array (
+ 'action' => 'edit',
+ 'username' => field('usename')
+ )
+ )
+ )
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "users.php?action=confirm_drop&{$misc->href}&",
- 'vars' => array('username' => 'usename'),
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'users.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'username' => field('usename')
+ )
+ )
+ )
),
);
- $misc->printTable($users, $columns, $actions, $lang['strnousers']);
+ $misc->printTable($users, $columns, $actions, 'users-users', $lang['strnousers']);
$misc->printNavLinks(array (array (
'attr'=> array (
$actions = array(
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "viewproperties.php?action=properties&{$misc->href}&view=".urlencode($_REQUEST['view'])."&",
- 'vars' => array('column' => 'attname'),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'viewproperties.php',
+ 'urlvars' => array (
+ 'action' => 'properties',
+ 'view' => $_REQUEST['view'],
+ 'column' => field('attname')
+ )
+ )
+ )
),
);
- $misc->printTable($attrs, $columns, $actions, null, 'attPre');
+ $misc->printTable($attrs, $columns, $actions, 'viewproperties-viewproperties', null, 'attPre');
echo "<br />\n";
'url' => 'views.php',
),
'browse' => array(
- 'title' => $lang['strbrowse'],
- 'url' => "display.php?{$misc->href}&subject=view&return=schema&",
- 'vars' => array('view' => 'relname'),
+ 'content' => $lang['strbrowse'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'display.php',
+ 'urlvars' => array (
+ 'action' => 'confselectrows',
+ 'subject' => 'view',
+ 'return' => 'schema',
+ 'view' => field('relname')
+ )
+ )
+ )
),
'select' => array(
- 'title' => $lang['strselect'],
- 'url' => "views.php?action=confselectrows&{$misc->href}&",
- 'vars' => array('view' => 'relname'),
+ 'content' => $lang['strselect'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'views.php',
+ 'urlvars' => array (
+ 'action' => 'confselectrows',
+ 'view' => field('relname')
+ )
+ )
+ )
),
-
+
// Insert is possible if the relevant rule for the view has been created.
// 'insert' => array(
// 'title' => $lang['strinsert'],
// ),
'alter' => array(
- 'title' => $lang['stralter'],
- 'url' => "viewproperties.php?action=confirm_alter&{$misc->href}&",
- 'vars' => array('view' => 'relname'),
+ 'content' => $lang['stralter'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'viewproperties.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_alter',
+ 'view' => field('relname')
+ )
+ )
+ )
),
'drop' => array(
- 'title' => $lang['strdrop'],
- 'url' => "views.php?action=confirm_drop&{$misc->href}&",
- 'vars' => array('view' => 'relname'),
'multiaction' => 'confirm_drop',
+ 'content' => $lang['strdrop'],
+ 'attr'=> array (
+ 'href' => array (
+ 'url' => 'views.php',
+ 'urlvars' => array (
+ 'action' => 'confirm_drop',
+ 'view' => field('relname')
+ )
+ )
+ )
),
);
- $misc->printTable($views, $columns, $actions, $lang['strnoviews']);
+ $misc->printTable($views, $columns, $actions, 'views-views', $lang['strnoviews']);
$navlinks = array (
array (