All property pages finished. Now we can move onto actual actions.
authorchriskl <chriskl>
Thu, 2 Jun 2005 15:21:39 +0000 (15:21 +0000)
committerchriskl <chriskl>
Thu, 2 Jun 2005 15:21:39 +0000 (15:21 +0000)
classes/Misc.php
classes/plugins/Slony.php
database.php
plugin_slony.php

index e627a5b12b165c4d1bcae4a72eecf90974a3f02d..c0b48a367b9eda3c5a31992f1de0f97e6366e1e1 100644 (file)
@@ -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 {
                                                        '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';
index b63c49fc084713425e0688c4f06eacaf53a60255..7ea0bc6825cda834c0e6121458c58094406fac47 100755 (executable)
@@ -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
index 466cda9f8db587e115c161c57840d8ad930872c4..298b8a0873c777048008e33c78c12c87221a6579 100755 (executable)
@@ -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
                $tabs['slony'] = array (
                                                                'title' => 'Slony',
                                                                'url'   => 'plugin_slony.php',
-                                                               'urlvars' => array('subject' => 'slony'),
+                                                               'urlvars' => array('action' => 'clusters_properties'),
                                                                'hide'  => (!$slony->isEnabled()),
                                                                'help'  => ''
                                                        );
index 57420d9d35d05486dabc8ac3ce933a049b37c2a5..3c1b458ae42ab34f6dd3bb993c18eff324fa9246 100755 (executable)
@@ -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
                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}&amp;action=cluster_properties&amp;",
+                               '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;