From: chriskl Date: Thu, 2 Jun 2005 15:21:39 +0000 (+0000) Subject: All property pages finished. Now we can move onto actual actions. X-Git-Url: http://git.postgresql.org/gitweb/delmail?a=commitdiff_plain;h=b0b658f1b14ae48ed58483ac38a1f31c121d10db;p=phppgadmin.git All property pages finished. Now we can move onto actual actions. --- diff --git a/classes/Misc.php b/classes/Misc.php index e627a5b1..c0b48a36 100644 --- a/classes/Misc.php +++ b/classes/Misc.php @@ -2,7 +2,7 @@ /** * 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 { @@ -589,15 +589,7 @@ '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'; diff --git a/classes/plugins/Slony.php b/classes/plugins/Slony.php index b63c49fc..7ea0bc68 100755 --- a/classes/plugins/Slony.php +++ b/classes/plugins/Slony.php @@ -3,7 +3,7 @@ /** * 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'); @@ -66,21 +66,18 @@ class Slony extends Plugin { 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 diff --git a/database.php b/database.php index 466cda9f..298b8a08 100755 --- a/database.php +++ b/database.php @@ -3,7 +3,7 @@ /** * 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 @@ -747,7 +747,7 @@ $tabs['slony'] = array ( 'title' => 'Slony', 'url' => 'plugin_slony.php', - 'urlvars' => array('subject' => 'slony'), + 'urlvars' => array('action' => 'clusters_properties'), 'hide' => (!$slony->isEnabled()), 'help' => '' ); diff --git a/plugin_slony.php b/plugin_slony.php index 57420d9d..3c1b458a 100755 --- a/plugin_slony.php +++ b/plugin_slony.php @@ -3,7 +3,7 @@ /** * 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 @@ -384,6 +384,43 @@ 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 */ @@ -828,6 +865,9 @@ case 'subscription_properties': doSubscription(); break; + case 'clusters_properties': + doClusters(); + break; case 'cluster_properties': doCluster(); break;