/**
* Class to hold various commonly used functions
*
- * $Id: Misc.php,v 1.100.2.2 2005/05/20 10:14:12 jollytoad Exp $
+ * $Id: Misc.php,v 1.100.2.3 2005/06/02 15:21:47 chriskl Exp $
*/
class Misc {
'tree' => false,
),
);
- // Add plugin tabs
- global $plugins;
- foreach ($plugins as $v) {
- $tab = $v->getDatabaseTab();
- if ($tab !== null) {
- $tabs[$tab['id']] = $tab;
- }
- }
-
+
return $tabs;
case 'schema':
# $vars = $servervar . $databasevar . $schemavar . '&subject=schema';
/**
* A class that implements the Slony 1.0.x support plugin
*
- * $Id: Slony.php,v 1.1.2.9 2005/06/02 14:51:46 chriskl Exp $
+ * $Id: Slony.php,v 1.1.2.10 2005/06/02 15:21:48 chriskl Exp $
*/
include_once('./classes/plugins/Plugin.php');
else return false;
}
+ // CLUSTER
+
/**
- * Gets the database tab details
- * @return array The array of tab details, null for none
+ * Gets the clusters in this database
*/
- function getDatabaseTab() {
- return array(
- 'id' => 'slony',
- 'title' => 'Slony',
- 'url' => 'plugin_slony.php',
- 'urlvars' => array('subject' => 'database', 'action' => 'slony'),
- 'hide' => false
- );
- }
+ function getClusters() {
+ include_once('classes/ArrayRecordSet.php');
- // CLUSTER
+ $clusters = array(array('cluster' => $this->slony_cluster, 'comment' => ''));
+
+ return new ArrayRecordSet($clusters);
+ }
/**
* Gets a single cluster
/**
* Manage schemas within a database
*
- * $Id: database.php,v 1.66.2.3 2005/05/20 10:14:12 jollytoad Exp $
+ * $Id: database.php,v 1.66.2.4 2005/06/02 15:21:39 chriskl Exp $
*/
// Include application functions
$tabs['slony'] = array (
'title' => 'Slony',
'url' => 'plugin_slony.php',
- 'urlvars' => array('subject' => 'slony'),
+ 'urlvars' => array('action' => 'clusters_properties'),
'hide' => (!$slony->isEnabled()),
'help' => ''
);
/**
* Slony database tab plugin
*
- * $Id: plugin_slony.php,v 1.1.2.8 2005/06/02 14:51:45 chriskl Exp $
+ * $Id: plugin_slony.php,v 1.1.2.9 2005/06/02 15:21:47 chriskl Exp $
*/
// Include application functions
exit;
}
+ /**
+ * Display the slony clusters (we only support one)
+ */
+ function doClusters($msg = '') {
+ global $slony, $misc;
+ global $lang;
+
+ $misc->printTrail('database');
+ $misc->printMsg($msg);
+
+ $clusters = $slony->getClusters();
+
+ $columns = array(
+ 'no_name' => array(
+ 'title' => $lang['strcluster'],
+ 'field' => 'cluster'
+ ),
+ 'actions' => array(
+ 'title' => $lang['stractions'],
+ ),
+ 'no_comment' => array(
+ 'title' => $lang['strcomment'],
+ 'field' => 'comment'
+ )
+ );
+
+ $actions = array (
+ 'detail' => array(
+ 'title' => $lang['strproperties'],
+ 'url' => "plugin_slony.php?{$misc->href}&action=cluster_properties&",
+ 'vars' => array()
+ )
+ );
+
+ $misc->printTable($clusters, $columns, $actions, 'No clusters found.');
+ }
+
/**
* Display the properties of a slony cluster
*/
case 'subscription_properties':
doSubscription();
break;
+ case 'clusters_properties':
+ doClusters();
+ break;
case 'cluster_properties':
doCluster();
break;