Hylax: Fix warnings
authorBen Klang <ben@alkaloid.net>
Fri, 8 Jan 2010 15:54:37 +0000 (10:54 -0500)
committerBen Klang <ben@alkaloid.net>
Fri, 8 Jan 2010 15:54:37 +0000 (10:54 -0500)
* Get rid of getInbox() in favor of a public getFolder()
* Return an empty array if we can return a real list (SpanDSP for now...)

hylax/folder.php
hylax/lib/Driver/hylafax.php
hylax/lib/Driver/spandsp.php
hylax/summary.php

index c0e6adb..d41da19 100644 (file)
@@ -15,7 +15,7 @@ $path = Horde_Util::getFormData('path');
 $base_folders = Hylax::getBaseFolders();
 
 /* Get the list of faxes in folder. */
-$folder_list = $hylax_storage->listFaxes($folder);
+$folder_list = $hylax->storage->listFaxes($folder);
 
 /* Set up URLs which will be used in the list. */
 $view_url  = Horde::applicationUrl('view.php');
index 8cedc81..5c30918 100644 (file)
@@ -20,7 +20,7 @@ class Hylax_Driver_hylafax extends Hylax_Driver {
 
     public function __construct($params)
     {
-        parent::Hylax_Driver($params);
+        parent::__construct($params);
 
         $this->_states = Hylax::getStates();
         $this->_stat_cols = Hylax::getStatCols();
@@ -71,12 +71,7 @@ class Hylax_Driver_hylafax extends Hylax_Driver {
         //return count($outbox);
     }
 
-    public function getInbox()
-    {
-        return $this->_getFolder('inbox');
-    }
-
-    public function _getFolder($folder, $path = null)
+    public function getFolder($folder, $path = null)
     {
         switch ($folder) {
         case 'inbox':
index 2c74780..37e72c7 100644 (file)
@@ -20,7 +20,7 @@ class Hylax_Driver_spandsp extends Hylax_Driver {
 
     public function __construct($params)
     {
-        parent::Hylax_Driver($params);
+        parent::__construct($params);
 
         $this->_states = Hylax::getStates();
         $this->_stat_cols = Hylax::getStatCols();
@@ -71,28 +71,27 @@ class Hylax_Driver_spandsp extends Hylax_Driver {
         //return count($outbox);
     }
 
-    public function getInbox()
-    {
-        // return $this->_getFolder('inbox');
-    }
-
-    protected function _getFolder($folder, $path = null)
+    public function getFolder($folder, $path = null)
     {
+        // FIXME: This method is intended to return an array of items in the
+        // specified folder.
+        // Need to figure out how to make this work with SpanDSP.
         switch ($folder) {
         case 'inbox':
-            // return $this->_parseFaxStat($this->_exec('faxstat -r'));
+            return array();
             break;
 
         case 'outbox':
-            // return $this->_parseFaxStat($this->_exec('faxstat -s'));
+            return array();
             break;
 
         case 'sent':
-            // return $this->_parseFaxStat($this->_exec('faxstat -d'));
+            return array();
             break;
 
         case 'archive':
             //return $GLOBALS['storage']->getFolder($path);
+            return array();
             break;
         }
     }
index 5c7f6e4..aa85868 100644 (file)
@@ -12,13 +12,13 @@ require_once dirname(__FILE__) . '/lib/Application.php';
 $hylax = new Hylax_Application(array('init' => true));
 
 $fmt_inbox = array();
-$inbox = $hylax->gateway->getInbox();
+$inbox = $hylax->gateway->getFolder('inbox');
 foreach ($inbox as $item) {
     $fmt_inbox[] = array('owner' => $item[2]);
 }
 
 $fmt_outbox = array();
-//$outbox = $fax->getOutbox();
+$outbox = $hylax->gateway->getFolder('outbox');
 foreach ($outbox as $item) {
     $fmt_outbox[] = array(//'time' => $item
                           'owner' => $item[2],