PHP5-ify application blocks
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 19 Jul 2010 15:33:43 +0000 (11:33 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 19 Jul 2010 15:33:43 +0000 (11:33 -0400)
56 files changed:
agora/lib/Block/forums.php
agora/lib/Block/thread.php
agora/lib/Block/threads.php
ansel/lib/Block/cloud.php
ansel/lib/Block/gallery.php
ansel/lib/Block/my_galleries.php
ansel/lib/Block/random_photo.php
ansel/lib/Block/recent_comments.php
ansel/lib/Block/recent_faces.php
ansel/lib/Block/recently_added.php
ansel/lib/Block/recently_added_geodata.php
gollem/lib/Block/tree_menu.php
hermes/lib/Block/tree_menu.php
hermes/lib/Block/tree_stopwatch.php
horde/lib/Block/account.php
horde/lib/Block/cloud.php
horde/lib/Block/fb_stream.php
horde/lib/Block/feed.php
horde/lib/Block/fortune.php
horde/lib/Block/google.php
horde/lib/Block/iframe.php
horde/lib/Block/metar.php
horde/lib/Block/moon.php
horde/lib/Block/sunrise.php
horde/lib/Block/time.php
horde/lib/Block/twitter_timeline.php
horde/lib/Block/vatid.php
horde/lib/Block/weatherdotcom.php
ingo/lib/Block/overview.php
kronolith/lib/Block/month.php
kronolith/lib/Block/monthlist.php
kronolith/lib/Block/prevmonthlist.php
kronolith/lib/Block/summary.php
kronolith/lib/Block/tree_alarms.php
kronolith/lib/Block/tree_menu.php
mnemo/lib/Block/note.php
mnemo/lib/Block/summary.php
mnemo/lib/Block/tree_menu.php
nag/lib/Block/summary.php
nag/lib/Block/tree_alarms.php
nag/lib/Block/tree_menu.php
trean/lib/Block/bookmarks.php
trean/lib/Block/highestrated.php
trean/lib/Block/mostclicked.php
trean/lib/Block/tree_menu.php
turba/lib/Block/minisearch.php
turba/lib/Block/tree_menu.php
whups/lib/Block/myqueries.php
whups/lib/Block/myrequests.php
whups/lib/Block/mytickets.php
whups/lib/Block/query.php
whups/lib/Block/queuecontents.php
whups/lib/Block/queuesummary.php
whups/lib/Block/tree_menu.php
whups/lib/Block/unassigned.php
wicked/lib/Block/page.php

index e6c97a2..3fee37d 100644 (file)
@@ -17,16 +17,21 @@ $block_name = _("Forums");
  * @author  Jan Schneider <jan@horde.org>
  * @package Horde_Block
  */
-class Horde_Block_agora_forums extends Horde_Block {
+class Horde_Block_agora_forums extends Horde_Block
+{
 
-    var $_app = 'agora';
+    protected $_app = 'agora';
 
-    function _title()
+    protected function _title()
     {
-        return Horde::link(Horde::applicationUrl('forums.php', true)) . _("Forums") . '</a>';
+        return Horde::applicationUrl('forums.php', true)->link() . _("Formus") . '</a>';
     }
 
-    function _params()
+    /**
+     *
+     * @return array
+     */
+    protected function _params()
     {
         /* Display the last X number of threads. */
         $forum_display = array();
@@ -38,7 +43,7 @@ class Horde_Block_agora_forums extends Horde_Block {
         return array('forum_display' => $forum_display);
     }
 
-    function _content()
+    protected function _content()
     {
         global $registry;
 
@@ -89,4 +94,5 @@ class Horde_Block_agora_forums extends Horde_Block {
 
         return $view->render('block/forums.html.php');
     }
+
 }
index 52d5e89..03af430 100644 (file)
@@ -16,11 +16,19 @@ $block_name = _("Single Thread");
  * @author  Marko Djukic <marko@oblo.com>
  * @package Horde_Block
  */
-class Horde_Block_agora_thread extends Horde_Block {
-
-    var $_app = 'agora';
-
-    function _params()
+class Horde_Block_agora_thread extends Horde_Block
+{
+    /**
+     *
+     * @var string
+     */
+    protected $_app = 'agora';
+
+    /**
+     *
+     * @return array
+     */
+    protected function _params()
     {
         $forumOb = &Agora_Messages::singleton();
         $forums_list = $forumOb->getForums(0, true, 'forum_name', 0, true);
@@ -43,11 +51,20 @@ class Horde_Block_agora_thread extends Horde_Block {
         return array('thread_id' => $threads);
     }
 
+    /**
+     *
+     * @return string
+     */
     function _title()
     {
         return _("Single Thread");
     }
 
+    /**
+     *
+     * @return string
+     * @throws Horde_Block_Exception
+     */
     function _content()
     {
         /* Return empty if we don't have a thread set. */
@@ -61,7 +78,7 @@ class Horde_Block_agora_thread extends Horde_Block {
 
         /* Check if valid thread, otherwise show forum list. */
         if ($messages instanceof PEAR_Error || empty($messages)) {
-            return PEAR::raiseError(_("Unable to fetch selected thread."));
+            throw new Horde_Block_Exception(_("Unable to fetch selected thread."));
         }
 
         /* Get the sorting. */
@@ -85,4 +102,5 @@ class Horde_Block_agora_thread extends Horde_Block {
 
         return $view->render('block/thread.html.php');
     }
+
 }
index e07558f..0fdae31 100644 (file)
@@ -17,22 +17,22 @@ $block_name = _("Threads");
  * @author  Jan Schneider <jan@horde.org>
  * @package Horde_Block
  */
-class Horde_Block_agora_threads extends Horde_Block {
-
+class Horde_Block_agora_threads extends Horde_Block
+{
     /**
      * @var array
      */
-    var $_threads = array();
+    private $_threads = array();
 
     /**
      * @var string
      */
-    var $_app = 'agora';
+    protected $_app = 'agora';
 
     /**
      * @return array
      */
-    function _params()
+    protected function _params()
     {
         $forums = Agora_Messages::singleton();
 
@@ -58,7 +58,7 @@ class Horde_Block_agora_threads extends Horde_Block {
     /**
      * @return string
      */
-    function _title()
+    protected function _title()
     {
         if (!isset($this->_params['forum_id'])) {
             return _("Threads");
@@ -76,23 +76,25 @@ class Horde_Block_agora_threads extends Horde_Block {
         if (!empty($scope)) {
             $url = Horde_Util::addParameter($url, 'scope', $scope);
         }
+
         return Horde::link(Agora::setAgoraId($this->_params['forum_id'], null, $url))
             . $title . '</a>';
     }
 
     /**
      * @return string
+     * @throws Horde_Block_Exception
      */
-    function _content()
+    protected function _content()
     {
         if (!isset($this->_params['forum_id'])) {
-            return _("No forum selected");
+            throw new Horde_Block_Exception(_("No forum selected"));
         }
 
         if (empty($this->_threads)) {
             $this->_threads = &Agora_Messages::singleton('agora', $this->_params['forum_id']);
             if ($this->_threads instanceof PEAR_Error) {
-                return PEAR::raiseError(_("Unable to fetch threads for selected forum."));
+                throw new Horde_Block_Exception(_("Unable to fetch threads for selected forum."));
             }
         }
 
@@ -121,4 +123,5 @@ class Horde_Block_agora_threads extends Horde_Block {
 
         return $view->render('block/threads.html.php');
     }
+
 }
index cec6253..676bf3a 100644 (file)
@@ -13,11 +13,19 @@ $block_name = _("Tag Cloud");
  * @author  Michael Rubinsky <mrubinsk@horde.org>
  * @package Horde_Block
  */
-class Horde_Block_ansel_cloud extends Horde_Block {
+class Horde_Block_ansel_cloud extends Horde_Block
+{
+    /**
+     *
+     * @var string
+     */
+    protected $_app = 'ansel';
 
-    var $_app = 'ansel';
-
-    function _params()
+    /**
+     *
+     * @return array
+     */
+    protected function _params()
     {
         $params = array('count' => array(
                             'name' => _("Number of tags to display"),
@@ -26,12 +34,21 @@ class Horde_Block_ansel_cloud extends Horde_Block {
         return $params;
     }
 
-    function _title()
+    /**
+     *
+     * @return string
+     */
+    protected function _title()
     {
         return _("Tag Cloud");
     }
 
-    function _content()
+    /**
+     *
+     * @global Horde_Registry $registry
+     * @return string
+     */
+    protected function _content()
     {
         global $registry;
 
index eab51a0..7294f69 100644 (file)
@@ -17,10 +17,23 @@ $block_name = _("Gallery");
  */
 class Horde_Block_ansel_gallery extends Horde_Block
 {
-    var $_app = 'ansel';
-    var $_gallery = null;
-
-    function _params()
+    /**
+     *
+     * @var string
+     */
+    protected $_app = 'ansel';
+    
+    /**
+     *
+     * @var Ansel_Gallery
+     */
+    private $_gallery = null;
+
+    /**
+     *
+     * @return array
+     */
+    protected function _params()
     {
         $params = array('gallery' => array(
                             'name' => _("Gallery"),
@@ -35,6 +48,7 @@ class Horde_Block_ansel_gallery extends Horde_Block
                             'name' => _("Use a lightbox to view photos"),
                             'type' => 'checkbox',
                             'default' => true));
+
         $storage = $GLOBALS['injector']->getInstance('Ansel_Storage')->getScope();
         if ($storage->countGalleries($GLOBALS['registry']->getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
             foreach ($storage->listGalleries() as $gal) {
@@ -45,7 +59,11 @@ class Horde_Block_ansel_gallery extends Horde_Block
         return $params;
     }
 
-    function _title()
+    /**
+     *
+     * @return string
+     */
+    protected function _title()
     {
         try {
             $gallery = $this->_getGallery();
@@ -67,12 +85,17 @@ class Horde_Block_ansel_gallery extends Horde_Block
                   'gallery' => $gallery->id,
                   'slug' => $gallery->get('slug')),
             true);
+
         return $viewurl->link()
                . @htmlspecialchars($name, ENT_COMPAT, $GLOBALS['registry']->getCharset())
                . '</a>';
-
     }
-    function _content()
+
+    /**
+     *
+     * @return string
+     */
+    protected function _content()
     {
         try {
            $gallery = $this->_getGallery();
@@ -107,7 +130,12 @@ class Horde_Block_ansel_gallery extends Horde_Block
         return $html . '</a></noscript>';
     }
 
-    function _getGallery($retry = false)
+    /**
+     *
+     * @param boolean $retry
+     * @return Ansel_Gallery
+     */
+    private function _getGallery($retry = false)
     {
         // Make sure we haven't already selected a gallery.
         if ($this->_gallery instanceof Ansel_Gallery) {
index e612bfb..be3e6e7 100644 (file)
@@ -13,11 +13,19 @@ $block_name = _("My Galleries");
  * @author  Michael Rubinsky <mrubinsk@horde.org>
  * @package Horde_Block
  */
-class Horde_Block_ansel_my_galleries extends Horde_Block {
-
-    var $_app = 'ansel';
+class Horde_Block_ansel_my_galleries extends Horde_Block
+{
+    /**
+     *
+     * @var string
+     */
+    protected $_app = 'ansel';
 
-    function _params()
+    /**
+     *
+     * @return array
+     */
+    protected function _params()
     {
         $params = array('limit' => array(
                             'name' => _("Maximum number of galleries"),
@@ -26,7 +34,11 @@ class Horde_Block_ansel_my_galleries extends Horde_Block {
         return $params;
     }
 
-    function _title()
+    /**
+     *
+     * @return string
+     */
+    protected function _title()
     {
         return Ansel::getUrlFor('view',
                                 array('groupby' => 'owner',
@@ -35,9 +47,14 @@ class Horde_Block_ansel_my_galleries extends Horde_Block {
             . _("My Galleries") . '</a>';
     }
 
-    function _content()
+    /**
+     *
+     * @return string
+     */
+    protected function _content()
     {
         Horde::addScriptFile('tooltips.js', 'horde');
+
         /* Get the top level galleries */
         try {
             $galleries = $GLOBALS['injector']->getInstance('Ansel_Storage')
index e4a1afe..50e8c22 100644 (file)
@@ -15,18 +15,34 @@ $block_name = _("Random photo");
  * @author  Ben Chavet <ben@horde.org>
  * @package Horde_Block
  */
-class Horde_Block_ansel_random_photo extends Horde_Block {
+class Horde_Block_ansel_random_photo extends Horde_Block
+{
+    /**
+     *
+     * @var string
+     */
+    protected $_app = 'ansel';
 
-    var $_app = 'ansel';
+    /**
+     *
+     * @var boolean
+     */
+    public $updateable = true;
 
-    var $updateable = true;
-
-    function _title()
+    /**
+     *
+     * @return string
+     */
+    protected function _title()
     {
         return _("Random photo");
     }
 
-    function _content()
+    /**
+     *
+     * @return string
+     */
+    protected function _content()
     {
         $gallery = $GLOBALS['injector']->getInstance('Ansel_Storage')->getScope()->getRandomGallery();
         if (!$gallery) {
@@ -47,6 +63,7 @@ class Horde_Block_ansel_random_photo extends Horde_Block {
         } else {
             $img = Horde::img('thumb-error.png');
         }
+
         return $viewurl->link(array('title' => _("View Photo"))) . $img . '</a>';
     }
 
index c263442..58d76db 100644 (file)
@@ -18,11 +18,22 @@ if ($GLOBALS['registry']->images->hasComments() &&
  */
 class Horde_Block_ansel_recent_comments extends Horde_Block
 {
+    /**
+     * @var string
+     */
+    protected $_app = 'ansel';
+    
+    /**
+     *
+     * @var Ansel_Gallery
+     */
+    private $_gallery = null;
 
-    var $_app = 'ansel';
-    var $_gallery = null;
-
-    function _params()
+    /**
+     *
+     * @return array
+     */
+    protected function _params()
     {
         $params = array('gallery' => array(
                         'name' => _("Gallery"),
@@ -39,7 +50,11 @@ class Horde_Block_ansel_recent_comments extends Horde_Block
         return $params;
     }
 
-    function _title()
+    /**
+     *
+     * @return string
+     */
+    protected function _title()
     {
         if ($this->_params['gallery'] != 'all') {
             try {
@@ -67,7 +82,12 @@ class Horde_Block_ansel_recent_comments extends Horde_Block
         return sprintf(_("Recent Comments In %s"), $viewurl->link() . $name . '</a>');
     }
 
-    function _content()
+    /**
+     *
+     * @global Horde_Registry $registry
+     * @return string
+     */
+    protected function _content()
     {
         global $registry;
 
@@ -130,7 +150,13 @@ class Horde_Block_ansel_recent_comments extends Horde_Block
         return $html;
     }
 
-    function _getGallery()
+    /**
+     *
+     * @return Ansel_Gallery
+     * @throws Horde_Exception_NotFound
+     * @throws Horde_Exception_PermissionDenied
+     */
+    private function _getGallery()
     {
         // Make sure we haven't already selected a gallery.
         if ($this->_gallery instanceof Ansel_Gallery) {
@@ -146,7 +172,7 @@ class Horde_Block_ansel_recent_comments extends Horde_Block
         }
 
         if (empty($this->_gallery)) {
-            throw new Horde_Exception_NotFount(_("Gallery does not exist."));
+            throw new Horde_Exception_NotFound(_("Gallery does not exist."));
         } elseif (!$this->_gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
             throw new Horde_Exception_PermissionDenied(_("Access denied viewing this gallery."));
         }
@@ -165,7 +191,7 @@ class Horde_Block_ansel_recent_comments extends Horde_Block
      * @param string $index      The index that contains the numerical value
      *                           to sort by.
      */
-    function _asortbyindex ($sortarray, $index) {
+    private function _asortbyindex ($sortarray, $index) {
         $lastindex = count ($sortarray) - 1;
         for ($subindex = 0; $subindex < $lastindex; $subindex++) {
             $lastiteration = $lastindex - $subindex;
index 9552acc..7dad7da 100644 (file)
@@ -17,9 +17,15 @@ if (!empty($GLOBALS['conf']['faces']['driver'])) {
  */
 class Horde_Block_ansel_recent_faces extends Horde_Block
 {
-    var $_app = 'ansel';
+    /**
+     * @var string
+     */
+    protected $_app = 'ansel';
 
-    function _params()
+    /**
+     * @return array
+     */
+    protected function _params()
     {
         return array('limit' => array(
                         'name' => _("Maximum number of faces"),
@@ -27,12 +33,20 @@ class Horde_Block_ansel_recent_faces extends Horde_Block
                         'default' => 10));
     }
 
-    function _title()
+    /**
+     *
+     * @return string
+     */
+    protected function _title()
     {
         return _("Recent faces");
     }
 
-    function _content()
+    /**
+     *
+     * @return string
+     */
+    protected function _content()
     {
         $faces = $GLOBALS['injector']->getInstance('Ansel_Faces');
         $results = $faces->allFaces(0, $this->_params['limit']);
index 6f3d441..00b2a6d 100644 (file)
@@ -15,10 +15,23 @@ $block_name = _("Recently Added Photos");
  */
 class Horde_Block_ansel_recently_added extends Horde_Block
 {
-    var $_app = 'ansel';
-    var $_gallery = null;
-
-    function _params()
+    /**
+     *
+     * @var string
+     */
+    protected $_app = 'ansel';
+
+    /**
+     *
+     * @var Ansel_Gallery
+     */
+    private $_gallery = null;
+
+    /**
+     *
+     * @return array
+     */
+    protected function _params()
     {
         $params = array('gallery' => array(
                             'name' => _("Gallery"),
@@ -42,7 +55,11 @@ class Horde_Block_ansel_recently_added extends Horde_Block
         return $params;
     }
 
-    function _title()
+    /**
+     *
+     * @return string
+     */
+    protected function _title()
     {
         if ($this->_params['gallery'] != 'all') {
             try {
@@ -67,10 +84,15 @@ class Horde_Block_ansel_recently_added extends Horde_Block
             $viewurl = Ansel::getUrlFor('view', array('view' => 'List'), true);
             $name = _("All Galleries");
         }
+
         return sprintf(_("Recently Added Photos From %s"), $viewurl->link() . $name . '</a>');
     }
 
-    function _content()
+    /**
+     *
+     * @return string
+     */
+    protected function _content()
     {
         if ($this->_params['gallery'] == 'all') {
             $galleries = array();
@@ -80,8 +102,7 @@ class Horde_Block_ansel_recently_added extends Horde_Block
             $galleries = $this->_params['gallery'];
         }
 
-        // Retrieve the images, but protect against very large values for
-        // limit.
+        // Retrieve the images, but protect against very large values for limit.
         try {
             $results = $GLOBALS['injector']->getInstance('Ansel_Storage')->getScope()->getRecentImages(
             $galleries, min($this->_params['limit'], 100));
@@ -156,12 +177,16 @@ HEADER;
                     ENT_COMPAT, $GLOBALS['registry']->getCharset())
                 . '</a></td><td class="nowrap">' . $galleryLink . '</td></tr>';
         }
-
         $html .= '</tbody></table>';
+
         return $html;
     }
 
-    function _getGallery()
+    /**
+     *
+     * @return Ansel_Gallery
+     */
+    private function _getGallery()
     {
         /* Make sure we haven't already selected a gallery. */
         if ($this->_gallery instanceof Ansel_Gallery) {
index 8cd6b43..66d33ff 100644 (file)
@@ -13,12 +13,24 @@ $block_name = _("Recently Geotagged");
  * @author  Michael Rubinsky <mrubinsk@horde.org>
  * @package Horde_Block
  */
-class Horde_Block_ansel_recently_added_geodata extends Horde_Block {
-
-    var $_app = 'ansel';
-    var $_gallery = null;
-
-    function _params()
+class Horde_Block_ansel_recently_added_geodata extends Horde_Block
+{
+    /**
+     * @var string
+     */
+    protected $_app = 'ansel';
+    
+    /**
+     *
+     * @var Ansel_Gallery
+     */
+    private $_gallery = null;
+
+    /**
+     *
+     * @return array
+     */
+    protected function _params()
     {
         $params = array('gallery' => array(
                             'name' => _("Gallery"),
@@ -46,7 +58,11 @@ class Horde_Block_ansel_recently_added_geodata extends Horde_Block {
         return $params;
     }
 
-    function _title()
+    /**
+     *
+     * @return string
+     */
+    protected function _title()
     {
         Horde::addScriptFile('http://maps.google.com/maps?file=api&v=2&sensor=false&key=' . $GLOBALS['conf']['api']['googlemaps'], 'ansel', array('external' => true));
         Horde::addScriptFile('http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/1.1/src/markermanager.js', 'ansel', array('external' => true));
@@ -73,10 +89,15 @@ class Horde_Block_ansel_recently_added_geodata extends Horde_Block {
             $viewurl = Ansel::getUrlFor('view', array('view' => 'List'), true);
             $name = _("All Galleries");
         }
+
         return sprintf(_("Recently Geotagged Photos From %s"), $viewurl->link() . $name . '</a>');
     }
 
-    function _content()
+    /**
+     *
+     * @return string
+     */
+    protected function _content()
     {
         if ($this->_params['gallery'] == 'all') {
             $galleries = array();
@@ -134,10 +155,15 @@ class Horde_Block_ansel_recently_added_geodata extends Horde_Block {
         Event.observe(window, "load", function() {doMap(pageImages);});
         </script>
 EOT;
+
         return $html;
     }
 
-    function _getGallery()
+    /**
+     *
+     * @return Ansel_Gallery
+     */
+    protected function _getGallery()
     {
         if ($this->_gallery instanceof Ansel_Gallery) {
             return $this->_gallery;
index 80f92be..5f73266 100644 (file)
@@ -14,11 +14,11 @@ $block_type = 'tree';
  * @author  Michael Slusarz <slusarz@horde.org>
  * @package Gollem
  */
-class Horde_Block_gollem_tree_menu extends Horde_Block {
+class Horde_Block_gollem_tree_menu extends Horde_Block
+{
+    protected $_app = 'gollem';
 
-    var $_app = 'gollem';
-
-    function _buildTree(&$tree, $indent = 0, $parent = null)
+    protected function _buildTree(&$tree, $indent = 0, $parent = null)
     {
         // TODO
         return;
index cbfc207..98e5bc4 100644 (file)
@@ -6,11 +6,11 @@ $block_type = 'tree';
 /**
  * @package Horde_Block
  */
-class Horde_Block_hermes_tree_menu extends Horde_Block {
+class Horde_Block_hermes_tree_menu extends Horde_Block
+{
+    protected $_app = 'hermes';
 
-    var $_app = 'hermes';
-
-    function _buildTree(&$tree, $indent = 0, $parent = null)
+    protected function _buildTree(&$tree, $indent = 0, $parent = null)
     {
         $tree->addNode($parent . '__add',
                        $parent,
index dc95099..85a5789 100644 (file)
@@ -6,11 +6,11 @@ $block_type = 'tree';
 /**
  * @package Horde_Block
  */
-class Horde_Block_hermes_tree_stopwatch extends Horde_Block {
+class Horde_Block_hermes_tree_stopwatch extends Horde_Block
+{
+    protected $_app = 'hermes';
 
-    var $_app = 'hermes';
-
-    function _buildTree(&$tree, $indent = 0, $parent = null)
+    protected function _buildTree(&$tree, $indent = 0, $parent = null)
     {
         global $registry, $prefs;
 
index 6d10df4..db40696 100644 (file)
@@ -12,16 +12,17 @@ $block_name = _("Account Information");
  * @author  Jan Schneider <jan@horde.org>
  * @package Horde_Block
  */
-class Horde_Block_Horde_account extends Horde_Block {
+class Horde_Block_Horde_account extends Horde_Block
+{
 
-    var $_app = 'horde';
+    protected $_app = 'horde';
 
     /**
      * The title to go in this block.
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         return _("My Account Information");
     }
@@ -31,7 +32,7 @@ class Horde_Block_Horde_account extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         global $registry, $conf;
 
@@ -105,17 +106,19 @@ class Horde_Block_Horde_account extends Horde_Block {
 
         if ($registry->get('status', 'forwards') != 'inactive' &&
             $registry->hasMethod('summary', 'forwards')) {
-            $summary = $registry->callByPackage('forwards', 'summary');
-            if (!is_a($summary, 'PEAR_Error')) {
+            try {
+                $summary = $registry->callByPackage('forwards', 'summary');
                 $output .= '<br />' . $summary . "\n";
-            }
+            } catch (Exception $e) {}
         }
+
         if ($registry->get('status', 'vacation') != 'inactive' &&
             $registry->hasMethod('summary', 'vacation')) {
-            $summary = $registry->callByPackage('vacation', 'summary');
-            if (!is_a($summary, 'PEAR_Error')) {
+            
+            try {
+                $summary = $registry->callByPackage('vacation', 'summary');
                 $output .= '<br />' . $summary . "\n";
-            }
+            } catch (Exception $e) {}
         }
 
         return $output;
index 6f564b3..d991560 100644 (file)
@@ -6,24 +6,19 @@ $block_name = _("Tag Cloud");
  * @author Michael J. Rubinsky <mrubinsk@horde.org>
  * @package Horde_Block
  */
-class Horde_Block_Horde_cloud extends Horde_Block {
-
-    /**
-     * Whether this block has changing content.
-     */
-    var $updateable = false;
-
+class Horde_Block_Horde_cloud extends Horde_Block
+{
     /**
      * @var string
      */
-    var $_app = 'horde';
+    protected $_app = 'horde';
 
     /**
      * The title to go in this block.
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         return _("Tag Cloud");
     }
@@ -33,7 +28,7 @@ class Horde_Block_Horde_cloud extends Horde_Block {
      *
      * @return string   The content.
      */
-    function _content()
+    protected function _content()
     {
         Horde::addScriptFile('prototype.js', 'horde');
 
@@ -54,7 +49,11 @@ class Horde_Block_Horde_cloud extends Horde_Block {
             . '<div id="cloudsearch"></div>';
     }
 
-    function _getTags()
+    /**
+     *
+     * @return array
+     */
+    private function _getTags()
     {
         $results = array();
         foreach ($GLOBALS['registry']->listAPIs() as $api) {
@@ -65,6 +64,7 @@ class Horde_Block_Horde_cloud extends Horde_Block {
                 }
             }
         }
+
         return $results;
     }
 
index b13dd93..156fd14 100644 (file)
@@ -13,19 +13,19 @@ if (!empty($GLOBALS['conf']['facebook']['enabled'])) {
  * @author Michael J. Rubinsky <mrubinsk@horde.org>
  * @package Horde_Block
  */
-class Horde_Block_Horde_fb_stream extends Horde_Block {
-
+class Horde_Block_Horde_fb_stream extends Horde_Block
+{
     /**
      * Whether this block has changing content.
      *
      * Set this to false, since we handle the updates via AJAX on our own.
      */
-    var $updateable = false;
+    public $updateable = false;
 
     /**
      * @var string
      */
-    var $_app = 'horde';
+    protected $_app = 'horde';
 
     /**
      * @var Horde_Service_Facebook
@@ -62,7 +62,7 @@ class Horde_Block_Horde_fb_stream extends Horde_Block {
      *
      * @return array
      */
-    function _params()
+    protected function _params()
     {
         $filters = array();
 
@@ -100,7 +100,7 @@ class Horde_Block_Horde_fb_stream extends Horde_Block {
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         return Horde::externalUrl('http://facebook.com', true) . _("My Facebook Stream") . '</a>';
     }
@@ -110,7 +110,7 @@ class Horde_Block_Horde_fb_stream extends Horde_Block {
      *
      * @return string   The content.
      */
-    function _content()
+    protected function _content()
     {
         $instance = md5(mt_rand());
         $csslink = $GLOBALS['registry']->get('themesuri', 'horde') . '/facebook.css';
index d9cbceb..55bf598 100644 (file)
@@ -5,13 +5,13 @@ $block_name = _("Syndicated Feed");
 /**
  * @package Horde_Block
  */
-class Horde_Block_Horde_feed extends Horde_Block {
+class Horde_Block_Horde_feed extends Horde_Block
+{
+    protected $_app = 'horde';
 
-    var $_app = 'horde';
+    private $_feed = null;
 
-    var $_feed = null;
-
-    function _params()
+    protected function _params()
     {
         return array('uri' => array('type' => 'text',
                                     'name' => _("Feed Address")),
@@ -31,7 +31,7 @@ class Horde_Block_Horde_feed extends Horde_Block {
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         $this->_read();
         if (is_a($this->_feed, 'Horde_Feed_Base')) {
@@ -46,7 +46,7 @@ class Horde_Block_Horde_feed extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         $this->_read();
         if (is_a($this->_feed, 'Horde_Feed_Base')) {
@@ -74,7 +74,7 @@ class Horde_Block_Horde_feed extends Horde_Block {
         }
     }
 
-    function _read()
+    private function _read()
     {
         if (empty($this->_params['uri'])) {
             return;
index 01b3b4d..ec8a40e 100644 (file)
@@ -9,26 +9,26 @@ if (isset($GLOBALS['conf']['fortune']['exec_path']) &&
 /**
  * @package Horde_Block
  */
-class Horde_Block_Horde_fortune extends Horde_Block {
-
+class Horde_Block_Horde_fortune extends Horde_Block
+{
     /**
      * Whether this block has changing content.
      */
-    var $updateable = true;
+    public $updateable = true;
 
-    var $_app = 'horde';
+    protected $_app = 'horde';
 
     /**
      * The title to go in this block.
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         return _("Fortune");
     }
 
-    function _params()
+    protected function _params()
     {
         global $conf;
 
@@ -113,7 +113,7 @@ class Horde_Block_Horde_fortune extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         global $conf;
 
index 055b9ba..fddeaf8 100644 (file)
@@ -5,16 +5,16 @@ $block_name = _("Google Search");
 /**
  * @package Horde_Block
  */
-class Horde_Block_Horde_google extends Horde_Block {
-
-    var $_app = 'horde';
+class Horde_Block_Horde_google extends Horde_Block
+{
+    protected $_app = 'horde';
 
     /**
      * The title to go in this block.
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         return _("Google Search");
     }
@@ -24,13 +24,13 @@ class Horde_Block_Horde_google extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         if (empty($GLOBALS['conf']['api']['googlesearch'])) {
             return '<p><em>' . _("Google search is not enabled.") . '</em></p>';
         }
 
-        ob_start();
+        Horde::startBuffer();
 ?>
 <link href="http://www.google.com/uds/css/gsearch.css" type="text/css" rel="stylesheet"/>
 <div id="googlesearch">...</div>
@@ -60,7 +60,7 @@ GSearch.setOnLoadCallback(GoogleSearchSetup);
 //]]>
 </script>
 <?php
-        return ob_get_clean();
+        return Horde::endBuffer();
     }
 
 }
index 222243a..5c1dc74 100644 (file)
@@ -5,11 +5,15 @@ $block_name = _("View an external web page");
 /**
  * @package Horde_Block
  */
-class Horde_Block_Horde_iframe extends Horde_Block {
+class Horde_Block_Horde_iframe extends Horde_Block
+{
+    protected $_app = 'horde';
 
-    var $_app = 'horde';
-
-    function _params()
+    /**
+     *
+     * @return array
+     */
+    protected function _params()
     {
         return array('iframe' => array('type' => 'text',
                                        'name' => _("URL"),
@@ -30,14 +34,15 @@ class Horde_Block_Horde_iframe extends Horde_Block {
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         global $registry;
 
         $title = !empty($this->_params['title']) ? $this->_params['title'] : $this->_params['iframe'];
-        return htmlspecialchars($title) .
-            Horde::link($this->_params['iframe'], _("Open in a new window"), '', '_blank') .
-            Horde::img('external.png', '', array('style' => 'vertical-align:middle;padding-left:.3em')) . '</a>';
+        $url = new Horde_Url(Horde::externalUrl($this->_params['iframe']));
+        
+        return htmlspecialchars($title) . $url->link(array('target' => '_blank'))
+            . Horde::img('external.png', '', array('style' => 'vertical-align:middle;padding-left:.3em')) . '</a>';
     }
 
     /**
@@ -45,7 +50,7 @@ class Horde_Block_Horde_iframe extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         global $browser;
 
index baadcde..f6f2012 100644 (file)
@@ -12,26 +12,26 @@ if ((@include_once 'Services/Weather.php') &&
  *
  * @package Horde_Block
  */
-class Horde_Block_Horde_metar extends Horde_Block {
-
+class Horde_Block_Horde_metar extends Horde_Block
+{
     /**
      * Whether this block has changing content.
      */
-    var $updateable = true;
+    public $updateable = true;
 
-    var $_app = 'horde';
+    protected $_app = 'horde';
 
     /**
      * The title to go in this block.
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         return _("Current Weather");
     }
 
-    function _params()
+    protected function _params()
     {
         if (!class_exists('Services_Weather')) {
             Horde::logMessage('The metar block will not work without Services_Weather from PEAR. Run pear install Services_Weather.', 'ERR');
@@ -88,12 +88,12 @@ class Horde_Block_Horde_metar extends Horde_Block {
         }
     }
 
-    function _row($label, $content)
+    private function _row($label, $content)
     {
         return '<br /><strong>' . $label . ':</strong> ' . $content;
     }
 
-    function _sameRow($label, $content)
+    private function _sameRow($label, $content)
     {
         return ' <strong>' . $label . ':</strong> ' . $content;
     }
@@ -103,22 +103,22 @@ class Horde_Block_Horde_metar extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         if (!@include_once 'Services/Weather.php') {
             Horde::logMessage('The metar block will not work without Services_Weather from PEAR. Run pear install Services_Weather.', 'ERR');
-            return _("Metar block not available. Details have been logged for the administrator.");
+            throw new Horde_Block_Exception(_("Metar block not available. Details have been logged for the administrator."));
         }
 
         global $conf;
         static $metarLocs;
 
         if (!isset($conf['sql'])) {
-            return _("A database backend is required for this block.");
+            throw new Horde_Block_Exception(_("A database backend is required for this block."));
         }
 
         if (empty($this->_params['location'])) {
-            return _("No location is set.");
+            throw new Horde_Block_Exception(_("No location is set."));
         }
 
         if (!is_array($metarLocs)) {
index 6f59296..bc8da6a 100644 (file)
@@ -5,16 +5,16 @@ $block_name = _("Moon Phases");
 /**
  * @package Horde_Block
  */
-class Horde_Block_Horde_moon extends Horde_Block {
+class Horde_Block_Horde_moon extends Horde_Block
+{
+    protected $_app = 'horde';
 
-    var $_app = 'horde';
-
-    function _title()
+    protected function _title()
     {
         return _("Moon Phases");
     }
 
-    function _params()
+    protected function _params()
     {
         return array(
             'phase' => array(
@@ -32,7 +32,7 @@ class Horde_Block_Horde_moon extends Horde_Block {
             );
     }
 
-    function _content()
+    protected function _content()
     {
         $phases = $this->_calculateMoonPhases(date('Y'));
         $now = time();
@@ -106,7 +106,7 @@ class Horde_Block_Horde_moon extends Horde_Block {
      *
      * @return array    The moon phases.
      */
-    function _calculateMoonPhases($Y)
+    private function _calculateMoonPhases($Y)
     {
         $R1 = 3.14159265 / 180;
         $U  = false;
@@ -188,7 +188,7 @@ class Horde_Block_Horde_moon extends Horde_Block {
      *
      * @return string m/d/Y
      */
-    function _jdtogregorian($julian)
+    private function _jdtogregorian($julian)
     {
         if (function_exists('jdtogregorian')) {
             return jdtogregorian($julian);
index aa08441..aaf2e14 100644 (file)
@@ -5,16 +5,16 @@ $block_name = _("Sunrise/Sunset");
 /**
  * @package Horde_Block
  */
-class Horde_Block_Horde_sunrise extends Horde_Block {
+class Horde_Block_Horde_sunrise extends Horde_Block
+{
+    protected $_app = 'horde';
 
-    var $_app = 'horde';
-
-    function _title()
+    protected function _title()
     {
         return _("Sunrise/Sunset");
     }
 
-    function _params()
+    protected function _params()
     {
         $params = array('location' => array('type' => 'mlenum',
                                             'name' => _("Location"),
@@ -32,10 +32,10 @@ class Horde_Block_Horde_sunrise extends Horde_Block {
         return $params;
     }
 
-    function _content()
+    protected function _content()
     {
         if (empty($this->_params['location'])) {
-            return _("No location is set.");
+            throw new Horde_Block_Exception(_("No location is set."));
         }
 
         // Set the timezone variable, if available.
@@ -70,7 +70,7 @@ class Horde_Block_Horde_sunrise extends Horde_Block {
     /**
      * http://www.zend.com/codex.php?id=135&single=1
      */
-    function _calculateSunset($date, $latitude, $longitude, $sunset = true, $timezone)
+    private function _calculateSunset($date, $latitude, $longitude, $sunset = true, $timezone)
     {
         $yday = date('z', $date);
         $mon = date('n', $date);
index be544f2..0cebee4 100644 (file)
@@ -5,19 +5,19 @@ $block_name = _("Current Time");
 /**
  * @package Horde_Block
  */
-class Horde_Block_Horde_time extends Horde_Block {
-
+class Horde_Block_Horde_time extends Horde_Block
+{
     /**
      * Whether this block has changing content.
      */
-    var $updateable = true;
+    public $updateable = true;
 
     /**
      * @var string
      */
-    var $_app = 'horde';
+    protected $_app = 'horde';
 
-    function _params()
+    protected function _params()
     {
         return array('time' => array('type' => 'enum',
                                      'name' => _("Time format"),
@@ -31,7 +31,7 @@ class Horde_Block_Horde_time extends Horde_Block {
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         return _("Current Time");
     }
@@ -41,7 +41,7 @@ class Horde_Block_Horde_time extends Horde_Block {
      *
      * @return string   The content.
      */
-    function _content()
+    protected function _content()
     {
         if (empty($this->_params['time'])) {
             $this->_params['time'] = '24-hour';
index b6322bb..d4512c6 100644 (file)
@@ -30,33 +30,33 @@ class Horde_Block_Horde_twitter_timeline extends Horde_Block
      * handle the updates via AJAX on our own.
      *
      */
-    var $updateable = false;
+    public $updateable = false;
 
     /**
      *
      * @ Horde_Service_Twitter
      */
-    var $_twitter;
+    private $_twitter;
 
     /**
      * Twitter profile information returned from verify_credentials
      *
      * @var Object
      */
-    var $_profile;
+    private $_profile;
 
     /**
      *
      * @var string
      */
-    var $_app = 'horde';
+    protected $_app = 'horde';
 
     /**
      * The title to go in this block.
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         try {
             $twitter = $this->_getTwitterObject();
@@ -80,7 +80,7 @@ class Horde_Block_Horde_twitter_timeline extends Horde_Block
 
     /**
      */
-    function _params()
+    protected function _params()
     {
         return array(
             'height' => array(
@@ -99,7 +99,7 @@ class Horde_Block_Horde_twitter_timeline extends Horde_Block
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         global $conf;
 
@@ -107,7 +107,7 @@ class Horde_Block_Horde_twitter_timeline extends Horde_Block
         try {
             $twitter = $this->_getTwitterObject();
         }  catch (Horde_Exception $e) {
-            return sprintf(_("There was an error contacting Twitter: %s"), $e->getMessage());
+            throw new Horde_Block_Exception(sprintf(_("There was an error contacting Twitter: %s"), $e->getMessage()));
         }
 
         /* Get a unique ID in case we have multiple Twitter blocks. */
index 6a1a23c..fc5be38 100644 (file)
@@ -5,16 +5,16 @@ $block_name = _("EU VAT identification");
 /**
  * @package Horde_Block
  */
-class Horde_Block_Horde_vatid extends Horde_Block {
-
-    var $_app = 'horde';
+class Horde_Block_Horde_vatid extends Horde_Block
+{
+    protected $_app = 'horde';
 
     /**
      * The title to go in this block.
      *
      * @return string  The title text.
      */
-    function _title()
+    protected function _title()
     {
         return _("VAT id number verification");
     }
@@ -24,7 +24,7 @@ class Horde_Block_Horde_vatid extends Horde_Block {
      *
      * @return string  The content.
      */
-    function _content()
+    protected function _content()
     {
         $vatid = str_replace(' ', '', Horde_Util::getFormData('vatid', ''));
         $block_name = 'block_' . $this->_row . '_' . $this->_col;
@@ -108,7 +108,7 @@ class Horde_Block_Horde_vatid extends Horde_Block {
         return $html;
     }
 
-    function _error($text)
+    private function _error($text)
     {
         return '<span style="color:red;font-weight:bold">' . $text . '</span>';
     }
index 10d0c6a..7c36d03 100644 (file)
@@ -13,21 +13,21 @@ if (!empty($GLOBALS['conf']['weatherdotcom']['partner_id']) &&
  *
  * @package Horde_Block
  */
-class Horde_Block_Horde_weatherdotcom extends Horde_Block {
-
+class Horde_Block_Horde_weatherdotcom extends Horde_Block
+{
     /**
      * Whether this block has changing content.
      */
-    var $updateable = true;
+    public $updateable = true;
 
-    var $_app = 'horde';
+    protected $_app = 'horde';
 
     /**
      * The title to go in this block.
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         return _("Weather Forecast");
     }
@@ -37,7 +37,7 @@ class Horde_Block_Horde_weatherdotcom extends Horde_Block {
      *
      * @return array  An array containing the parameters.
      */
-    function _params()
+    protected function _params()
     {
         if (!(@include_once 'Services/Weather.php') ||
             !(@include_once 'Cache.php') ||
@@ -97,13 +97,13 @@ class Horde_Block_Horde_weatherdotcom extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         if (!(@include_once 'Services/Weather.php') ||
             !(@include_once 'Cache.php') ||
             !ini_get('allow_url_fopen')) {
             Horde::logMessage('The weather.com block will not work without the PEARServices_Weather and Cache packages, and allow_url_fopen enabled. Run pear install Services_Weather Cache, and ensure that allow_url_fopen_wrappers is enabled in php.ini.', 'ERR');
-            return _("The weather.com block is not available.");
+            throw new Horde_Block_Exception(_("The weather.com block is not available."));
         }
 
         global $conf, $prefs;
index 44037a2..8dfe732 100644 (file)
@@ -12,18 +12,18 @@ $block_name = _("Overview");
  * @author  Oliver Kuhl <okuhl@netcologne.de>
  * @package Horde_Block
  */
-class Horde_Block_ingo_overview extends Horde_Block {
-
-    var $_app = 'ingo';
+class Horde_Block_ingo_overview extends Horde_Block
+{
+    protected $_app = 'ingo';
 
     /**
      * The title to go in this block.
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
-        return Horde::link(Horde::url($GLOBALS['registry']->getInitialPage(), true)) . $GLOBALS['registry']->get('name') . '</a>';
+        return Horde::url($GLOBALS['registry']->getInitialPage(), true)->link() . $GLOBALS['registry']->get('name') . '</a>';
     }
 
     /**
@@ -31,7 +31,7 @@ class Horde_Block_ingo_overview extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         /* Get list of filters */
         $filters = $GLOBALS['ingo_storage']->retrieve(Ingo_Storage::ACTION_FILTERS);
@@ -51,7 +51,7 @@ class Horde_Block_ingo_overview extends Horde_Block {
                     $html .= $html_pre .
                         Horde::img('vacation.png', _("Vacation")) .
                         '</td><td>' .
-                        Horde::link(Horde::applicationUrl('vacation.php'), _("Edit")) .
+                        Horde::applicationUrl('vacation.php')->link(array('title' => _("Edit"))) .
                         _("Vacation") . '</a> ' . $active . $html_post;
                 }
                 break;
@@ -60,7 +60,7 @@ class Horde_Block_ingo_overview extends Horde_Block {
                 if (in_array(Ingo_Storage::ACTION_FORWARD, $_SESSION['ingo']['script_categories'])) {
                     $html .= $html_pre .
                         Horde::img('forward.png', _("Forward")) . '</td><td>' .
-                        Horde::link(Horde::applicationUrl('forward.php'), _("Edit")) .
+                        Horde::applicationUrl('forward.php')->link(array('title' => _("Edit"))) .
                         _("Forward") . '</a> ' . $active;
                     $data = unserialize($GLOBALS['prefs']->getValue('forward'));
                     if (!empty($data['a'])) {
@@ -75,7 +75,7 @@ class Horde_Block_ingo_overview extends Horde_Block {
                     $html .= $html_pre .
                         Horde::img('whitelist.png', _("Whitelist")) .
                         '</td><td>' .
-                        Horde::link(Horde::applicationUrl('whitelist.php'), _("Edit")) .
+                        Horde::applicationUrl('whitelist.php')->link(array('title' => _("Edit"))) .
                         _("Whitelist") . '</a> ' . $active . $html_post;
                 }
                 break;
@@ -85,7 +85,7 @@ class Horde_Block_ingo_overview extends Horde_Block {
                     $html .= $html_pre .
                         Horde::img('blacklist.png', _("Blacklist")) .
                         '</td><td>' .
-                        Horde::link(Horde::applicationUrl('blacklist.php'), _("Edit")) .
+                        Horde::applicationUrl('blacklist.php')->link(array('title' => _("Edit"))) .
                         _("Blacklist") . '</a> ' . $active . $html_post;
                 }
                 break;
@@ -95,7 +95,7 @@ class Horde_Block_ingo_overview extends Horde_Block {
                     $html .= $html_pre .
                         Horde::img('spam.png', _("Spam Filter")) .
                         '</td><td>' .
-                        Horde::link(Horde::applicationUrl('spam.php'), _("Edit")) .
+                        Horde::applicationUrl('spam.php')->link(array('title' => _("Edit"))) .
                         _("Spam Filter") . '</a> ' . $active . $html_post;
                 }
                 break;
index 2df4191..62aa9b1 100644 (file)
@@ -8,12 +8,12 @@ $block_name = _("This Month");
  *
  * @package Horde_Block
  */
-class Horde_Block_Kronolith_month extends Horde_Block {
+class Horde_Block_Kronolith_month extends Horde_Block
+{
+    protected $_app = 'kronolith';
+    private $_share = null;
 
-    var $_app = 'kronolith';
-    var $_share = null;
-
-    function _params()
+    protected function _params()
     {
         $params = array('calendar' => array('name' => _("Calendar"),
                                             'type' => 'enum',
@@ -37,6 +37,7 @@ class Horde_Block_Kronolith_month extends Horde_Block {
                 }
             }
         }
+
         return $params;
     }
 
@@ -45,7 +46,7 @@ class Horde_Block_Kronolith_month extends Horde_Block {
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         $title = _("All Calendars");
         $url = Horde::url($GLOBALS['registry']->getInitialPage(), true);
@@ -73,7 +74,7 @@ class Horde_Block_Kronolith_month extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         global $prefs;
 
@@ -83,7 +84,7 @@ class Horde_Block_Kronolith_month extends Horde_Block {
                 try {
                     $this->_share = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']);
                 } catch (Exception $e) {
-                    return _(sprintf("There was an error accessing the calendar: %s", $e->getMessage()));
+                    throw new Horde_Block_Exception(_(sprintf("There was an error accessing the calendar: %s", $e->getMessage())));
                 }
             }
             if (!$this->_share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) {
index 36db981..acbb93c 100644 (file)
@@ -8,11 +8,11 @@ $block_name = _("Upcoming Events");
  *
  * @package Horde_Block
  */
-class Horde_Block_Kronolith_monthlist extends Horde_Block {
+class Horde_Block_Kronolith_monthlist extends Horde_Block
+{
+    protected $_app = 'kronolith';
 
-    var $_app = 'kronolith';
-
-    function _params()
+    protected function _params()
     {
         $params = array('calendar' => array('name' => _("Calendar"),
                                             'type' => 'enum',
@@ -53,7 +53,7 @@ class Horde_Block_Kronolith_monthlist extends Horde_Block {
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         $url = Horde::url($GLOBALS['registry']->getInitialPage(), true);
         if (isset($this->_params['calendar']) &&
@@ -68,7 +68,7 @@ class Horde_Block_Kronolith_monthlist extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         global $registry, $prefs;
 
index 1e18a8d..2261e4c 100644 (file)
@@ -8,11 +8,11 @@ $block_name = _("Prior Events");
  *
  * @package Horde_Block
  */
-class Horde_Block_Kronolith_prevmonthlist extends Horde_Block {
+class Horde_Block_Kronolith_prevmonthlist extends Horde_Block
+{
+    protected $_app = 'kronolith';
 
-    var $_app = 'kronolith';
-
-    function _params()
+    protected function _params()
     {
         $params = array('calendar' => array('name' => _("Calendar"),
                                             'type' => 'enum',
@@ -41,13 +41,14 @@ class Horde_Block_Kronolith_prevmonthlist extends Horde_Block {
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         $url = Horde::url($GLOBALS['registry']->getInitialPage(), true);
         if (isset($this->_params['calendar']) &&
             $this->_params['calendar'] != '__all') {
             $url->add('display_cal', $this->_params['calendar']);
         }
+
         return $url->link() . _("Prior Events") . '</a>';
     }
 
@@ -56,7 +57,7 @@ class Horde_Block_Kronolith_prevmonthlist extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         global $registry, $prefs;
 
index b982c08..224bb03 100644 (file)
@@ -8,11 +8,11 @@ $block_name = _("Calendar Summary");
  *
  * @package Horde_Block
  */
-class Horde_Block_Kronolith_summary extends Horde_Block {
+class Horde_Block_Kronolith_summary extends Horde_Block
+{
+    protected $_app = 'kronolith';
 
-    var $_app = 'kronolith';
-
-    function __construct($params = array(), $row = null, $col = null)
+    protected function __construct($params = array(), $row = null, $col = null)
     {
         parent::__construct($params, $row, $col);
         if (!isset($this->_params['days'])) {
@@ -20,7 +20,7 @@ class Horde_Block_Kronolith_summary extends Horde_Block {
         }
     }
 
-    function _params()
+    protected function _params()
     {
         $params = array('calendar' => array('name' => _("Calendar"),
                                             'type' => 'enum',
@@ -72,7 +72,7 @@ class Horde_Block_Kronolith_summary extends Horde_Block {
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         $url = Horde::url($GLOBALS['registry']->getInitialPage(), true);
         if (isset($this->_params['calendar']) &&
index f4c0dea..e3ea9e5 100644 (file)
@@ -6,11 +6,11 @@ $block_type = 'tree';
 /**
  * @package Horde_Block
  */
-class Horde_Block_kronolith_tree_alarms extends Horde_Block {
+class Horde_Block_kronolith_tree_alarms extends Horde_Block
+{
+    protected $_app = 'kronolith';
 
-    var $_app = 'kronolith';
-
-    function _buildTree(&$tree, $indent = 0, $parent = null)
+    protected function _buildTree(&$tree, $indent = 0, $parent = null)
     {
         $horde_alarm = $GLOBALS['injector']->getInstance('Horde_Alarm');
 
index f6bf6d5..b8cff44 100644 (file)
@@ -6,11 +6,11 @@ $block_type = 'tree';
 /**
  * @package Horde_Block
  */
-class Horde_Block_kronolith_tree_menu extends Horde_Block {
+class Horde_Block_kronolith_tree_menu extends Horde_Block
+{
+    protected $_app = 'kronolith';
 
-    var $_app = 'kronolith';
-
-    function _buildTree(&$tree, $indent = 0, $parent = null)
+    protected function _buildTree(&$tree, $indent = 0, $parent = null)
     {
         global $registry;
 
index 4c1ff44..6ee76e5 100644 (file)
@@ -29,6 +29,7 @@ class Horde_Block_Mnemo_note extends Horde_Block
             ),
             'note_name' => array(
                 'type' => 'hidden',
+                'name' => 'note_name'
             ),
         );
     }
@@ -41,7 +42,6 @@ class Horde_Block_Mnemo_note extends Horde_Block
     protected function _content()
     {
         $memo = $this->_getNote();
-
         $html = '<div class="noteBody">';
         $body = Horde_Text_Filter::filter($memo['body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null));
         try {
index f9fd7f7..d71f169 100644 (file)
@@ -5,27 +5,26 @@ $block_name = _("Notes Summary");
 /**
  * Implementation of Horde_Block api to show notes summary.
  *
- * $Horde: mnemo/lib/Block/summary.php,v 1.39 2009/12/04 17:42:25 jan Exp $
  *
  * @package Horde_Block
  */
-class Horde_Block_Mnemo_summary extends Horde_Block {
+class Horde_Block_Mnemo_summary extends Horde_Block
+{
+    protected $_app = 'mnemo';
 
-    var $_app = 'mnemo';
-
-    function _title()
+    protected function _title()
     {
         global $registry;
        
        $label = !empty($this->_params['block_title'])
             ? $this->_params['block_title']
             : $registry->get('name');
-        return Horde::link(Horde::applicationUrl($registry->getInitialPage(),
-                                                true))
+
+        return Horde::link(Horde::applicationUrl($registry->getInitialPage(), true))
             . htmlspecialchars($label) . '</a>';
     }
 
-    function _params()
+    protected function _params()
     {
         $cManager = new Horde_Prefs_CategoryManager();
         $categories = array();
@@ -48,7 +47,7 @@ class Horde_Block_Mnemo_summary extends Horde_Block {
                          'values' => $categories));
     }
 
-    function _content()
+    protected function _content()
     {
         global $registry, $prefs;
 
@@ -110,6 +109,7 @@ class Horde_Block_Mnemo_summary extends Horde_Block {
         if (!$memos) {
             return '<p><em>' . _("No notes to display") . '</em></p>';
         }
+        
         return '<link href="'
             . htmlspecialchars(Horde::applicationUrl('themes/categoryCSS.php',
                                                      true))
index b9edcca..7bea433 100644 (file)
@@ -4,20 +4,19 @@ $block_name = _("Menu List");
 $block_type = 'tree';
 
 /**
- * $Horde: mnemo/lib/Block/tree_menu.php,v 1.6 2009/06/10 03:46:19 chuck Exp $
  *
  * @package Horde_Block
  */
-class Horde_Block_mnemo_tree_menu extends Horde_Block {
+class Horde_Block_mnemo_tree_menu extends Horde_Block
+{
+    protected $_app = 'mnemo';
 
-    var $_app = 'mnemo';
-
-    function _buildTree(&$tree, $indent = 0, $parent = null)
+    protected function _buildTree(&$tree, $indent = 0, $parent = null)
     {
         global $registry;
 
         $add = Horde::applicationUrl('memo.php')->add('actionID', 'add_memo');
-       $icondir = (string)Horde_Themes::img();
+        $icondir = (string)Horde_Themes::img();
 
         $tree->addNode($parent . '__new',
                        $parent,
@@ -29,11 +28,13 @@ class Horde_Block_mnemo_tree_menu extends Horde_Block {
                              'url' => $add));
 
         foreach (Mnemo::listNotepads() as $name => $notepad) {
-           if ($notepad->get('owner') != $GLOBALS['registry']->getAuth() &&
-               !empty($GLOBALS['conf']['share']['hidden']) &&
-               !in_array($notepad->getName(), $GLOBALS['display_notepads'])) {
-               continue;
-           }
+            if ($notepad->get('owner') != $GLOBALS['registry']->getAuth() &&
+                !empty($GLOBALS['conf']['share']['hidden']) &&
+                !in_array($notepad->getName(), $GLOBALS['display_notepads'])) {
+
+                continue;
+            }
+
             $tree->addNode($parent . $name . '__new',
                            $parent . '__new',
                            sprintf(_("in %s"), $notepad->get('name')),
index c8d707d..3631ae7 100644 (file)
@@ -5,23 +5,23 @@ $block_name = _("Tasks Summary");
 /**
  * @package Horde_Block
  */
-class Horde_Block_nag_summary extends Horde_Block {
+class Horde_Block_nag_summary extends Horde_Block
+{
+    protected $_app = 'nag';
 
-    var $_app = 'nag';
-
-    function _title()
+    protected function _title()
     {
         global $registry;
 
         $label = !empty($this->_params['block_title'])
             ? $this->_params['block_title']
             : $registry->get('name');
-        return Horde::link(Horde::applicationUrl($registry->getInitialPage(),
-                                                 true))
+
+        return Horde::applicationUrl($registry->getInitialPage(), true)->link()
             . htmlspecialchars($label) . '</a>';
     }
 
-    function _params()
+    protected function _params()
     {
         $cManager = new Horde_Prefs_CategoryManager();
         $categories = array();
@@ -88,7 +88,7 @@ class Horde_Block_nag_summary extends Horde_Block {
                          'values' => $categories));
     }
 
-    function _content()
+    protected function _content()
     {
         global $registry, $prefs;
 
index ffe4cb2..740f650 100644 (file)
@@ -6,11 +6,11 @@ $block_type = 'tree';
 /**
  * @package Horde_Block
  */
-class Horde_Block_nag_tree_alarms extends Horde_Block {
+class Horde_Block_nag_tree_alarms extends Horde_Block
+{
+    protected$_app = 'nag';
 
-    var $_app = 'nag';
-
-    function _buildTree(&$tree, $indent = 0, $parent = null)
+    protected function _buildTree(&$tree, $indent = 0, $parent = null)
     {
         $horde_alarm = $GLOBALS['injector']->getInstance('Horde_Alarm');
 
index 5bd1737..ced9c55 100644 (file)
@@ -6,11 +6,11 @@ $block_type = 'tree';
 /**
  * @package Horde_Block
  */
-class Horde_Block_nag_tree_menu extends Horde_Block {
+class Horde_Block_nag_tree_menu extends Horde_Block
+{
+    protected $_app = 'nag';
 
-    var $_app = 'nag';
-
-    function _buildTree(&$tree, $indent = 0, $parent = null)
+    protected function _buildTree(&$tree, $indent = 0, $parent = null)
     {
         global $registry;
 
index 85564d2..10cbc91 100644 (file)
@@ -5,9 +5,7 @@ $block_name = _("Bookmarks");
 /**
  * Implementation of Horde_Block api to show bookmarks.
  *
- * $Horde: trean/lib/Block/bookmarks.php,v 1.39 2009-11-29 15:51:42 chuck Exp $
- *
- * Copyright 2004-2009 The Horde Project (http://www.horde.org/)
+ * Copyright 2004-2010 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file LICENSE for license information (BSD). If you
  * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
@@ -16,12 +14,12 @@ $block_name = _("Bookmarks");
  * @since   Trean 1.0
  * @package Horde_Block
  */
-class Horde_Block_Trean_bookmarks extends Horde_Block {
-
-    var $_app = 'trean';
-    var $_folder = null;
+class Horde_Block_Trean_bookmarks extends Horde_Block
+{
+    protected $_app = 'trean';
+    private $_folder = null;
 
-    function _params()
+    protected  function _params()
     {
         require_once dirname(__FILE__) . '/../base.php';
 
@@ -68,7 +66,7 @@ class Horde_Block_Trean_bookmarks extends Horde_Block {
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         global $registry;
 
@@ -82,7 +80,7 @@ class Horde_Block_Trean_bookmarks extends Horde_Block {
             }
         }
 
-        return Horde::link(Horde::url($registry->getInitialPage(), true)) . $name . '</a>';
+        return Horde::url($registry->getInitialPage(), true)->link() . $name . '</a>';
     }
 
     /**
@@ -90,7 +88,7 @@ class Horde_Block_Trean_bookmarks extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         require_once dirname(__FILE__) . '/../base.php';
         require_once TREAN_TEMPLATES . '/star_rating_helper.php';
@@ -131,7 +129,7 @@ class Horde_Block_Trean_bookmarks extends Horde_Block {
         return $html;
     }
 
-    function _getFolder()
+    private function _getFolder()
     {
         require_once dirname(__FILE__) . '/../base.php';
 
index 961683a..511e3db 100644 (file)
@@ -5,9 +5,7 @@ $block_name = _("Highest-rated Bookmarks");
 /**
  * Implementation of Horde_Block api to show the highest-rated bookmarks.
  *
- * $Horde: trean/lib/Block/highestrated.php,v 1.4 2009/01/06 18:02:13 jan Exp $
- *
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
+ * Copyright 2007-2010 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file LICENSE for license information (BSD). If you
  * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
@@ -15,14 +13,14 @@ $block_name = _("Highest-rated Bookmarks");
  * @author  Chuck Hagenbuch <chuck@horde.org>
  * @package Horde_Block
  */
-class Horde_Block_Trean_highestrated extends Horde_Block {
-
-    var $_app = 'trean';
+class Horde_Block_Trean_highestrated extends Horde_Block
+{
+    protected $_app = 'trean';
 
     /**
      * Block configuration.
      */
-    function _params()
+    protected function _params()
     {
         return array('rows' => array('name' => _("Number of bookmarks to show"),
                                      'type' => 'enum',
@@ -43,10 +41,9 @@ class Horde_Block_Trean_highestrated extends Horde_Block {
      *
      * @return string The title text.
      */
-    function _title()
+    protected function _title()
     {
-        global $registry;
-        return Horde::link(Horde::url($registry->getInitialPage(), true)) . _("Highest-rated Bookmarks") . '</a>';
+        return Horde::url($GLOBALS['registry']->getInitialPage(), true)->link() . _("Highest-rated Bookmarks") . '</a>';
     }
 
     /**
@@ -54,7 +51,7 @@ class Horde_Block_Trean_highestrated extends Horde_Block {
      *
      * @return string The content.
      */
-    function _content()
+    protected function _content()
     {
         require_once dirname(__FILE__) . '/../base.php';
         require_once TREAN_TEMPLATES . '/star_rating_helper.php';
index ca8ab0a..95caad5 100644 (file)
@@ -5,9 +5,7 @@ $block_name = _("Most-clicked Bookmarks");
 /**
  * Implementation of Horde_Block api to show the most-clicked bookmarks.
  *
- * $Horde: trean/lib/Block/mostclicked.php,v 1.4 2009/01/06 18:02:13 jan Exp $
- *
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
+ * Copyright 2007-2010 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file LICENSE for license information (BSD). If you
  * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
@@ -15,14 +13,14 @@ $block_name = _("Most-clicked Bookmarks");
  * @author  Chuck Hagenbuch <chuck@horde.org>
  * @package Horde_Block
  */
-class Horde_Block_Trean_mostclicked extends Horde_Block {
-
-    var $_app = 'trean';
+class Horde_Block_Trean_mostclicked extends Horde_Block
+{
+    protected $_app = 'trean';
 
     /**
      * Block configuration.
      */
-    function _params()
+    protected function _params()
     {
         return array('rows' => array('name' => _("Number of bookmarks to show"),
                                      'type' => 'enum',
@@ -43,10 +41,9 @@ class Horde_Block_Trean_mostclicked extends Horde_Block {
      *
      * @return string The title text.
      */
-    function _title()
+    protected function _title()
     {
-        global $registry;
-        return Horde::link(Horde::url($registry->getInitialPage(), true)) . _("Most-clicked Bookmarks") . '</a>';
+        return Horde::url($GLOBALS['registry']->getInitialPage(), true)->link() . _("Most-clicked Bookmarks") . '</a>';
     }
 
     /**
@@ -54,7 +51,7 @@ class Horde_Block_Trean_mostclicked extends Horde_Block {
      *
      * @return string The content.
      */
-    function _content()
+    protected function _content()
     {
         require_once dirname(__FILE__) . '/../base.php';
         require_once TREAN_TEMPLATES . '/star_rating_helper.php';
index d76e7ac..f3a4047 100644 (file)
@@ -4,13 +4,12 @@ $block_name = _("Menu List");
 $block_type = 'tree';
 
 /**
- * $Horde: trean/lib/Block/tree_menu.php,v 1.9 2009/12/22 03:44:05 mrubinsk Exp $
  */
-class Horde_Block_trean_tree_menu extends Horde_Block {
+class Horde_Block_trean_tree_menu extends Horde_Block
+{
+    protected $_app = 'trean';
 
-    var $_app = 'trean';
-
-    function _buildTree(&$tree, $indent = 0, $parent = null)
+    protected function _buildTree(&$tree, $indent = 0, $parent = null)
     {
         global $registry;
 
index 32ca38c..7a10533 100644 (file)
@@ -8,19 +8,18 @@ $block_name = _("Contact Search");
  *
  * @package Horde_Block
  */
-class Horde_Block_turba_minisearch extends Horde_Block {
-
-    var $_app = 'turba';
+class Horde_Block_turba_minisearch extends Horde_Block
+{
+    protected $_app = 'turba';
 
     /**
      * The title to go in this block.
      *
      * @return string  The title text.
      */
-    function _title()
+    protected function _title()
     {
-        return Horde::link(Horde::url($GLOBALS['registry']->getInitialPage(),
-                                      true))
+        return Horde::url($GLOBALS['registry']->getInitialPage(), true)->link()
             . _("Contact Search") . '</a>';
     }
 
@@ -29,7 +28,7 @@ class Horde_Block_turba_minisearch extends Horde_Block {
      *
      * @return string  The block content.
      */
-    function _content()
+    protected function _content()
     {
         if ($GLOBALS['browser']->hasFeature('iframes')) {
             Horde::addScriptFile('prototype.js', 'horde');
index 6e526a2..0b12378 100644 (file)
@@ -6,11 +6,11 @@ $block_type = 'tree';
 /**
  * @package Horde_Block
  */
-class Horde_Block_turba_tree_menu extends Horde_Block {
+class Horde_Block_turba_tree_menu extends Horde_Block
+{
+    protected $_app = 'turba';
 
-    var $_app = 'turba';
-
-    function _buildTree(&$tree, $indent = 0, $parent = null)
+    protected function _buildTree(&$tree, $indent = 0, $parent = null)
     {
         global $registry;
 
index a5a54a7..25d6d9c 100644 (file)
@@ -8,16 +8,16 @@ $block_name = _("My Queries");
  *
  * @package Horde_Block
  */
-class Horde_Block_Whups_myqueries extends Horde_Block {
-
-    var $_app = 'whups';
+class Horde_Block_Whups_myqueries extends Horde_Block
+{
+    protected $_app = 'whups';
 
     /**
      * The title to go in this block.
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         return _("My Queries");
     }
@@ -27,7 +27,7 @@ class Horde_Block_Whups_myqueries extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         require_once WHUPS_BASE . '/lib/Query.php';
 
index f1b64ef..16e148f 100644 (file)
@@ -8,16 +8,16 @@ $block_name = _("My Requests");
  *
  * @package Horde_Block
  */
-class Horde_Block_Whups_myrequests extends Horde_Block {
-
-    var $_app = 'whups';
+class Horde_Block_Whups_myrequests extends Horde_Block
+{
+    protected $_app = 'whups';
 
     /**
      * The title to go in this block.
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         return _("My Requests");
     }
@@ -27,7 +27,7 @@ class Horde_Block_Whups_myrequests extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         global $whups_driver, $prefs;
 
@@ -63,6 +63,7 @@ class Horde_Block_Whups_myrequests extends Horde_Block {
         }
 
         Horde::addScriptFile('tables.js', 'horde', true);
+
         return '<table id="whups_block_myrequests" cellspacing="0" class="tickets striped sortable">' . $html . '</tbody></table>';
    }
 
index 40deb1e..0e3327a 100644 (file)
@@ -8,16 +8,16 @@ $block_name = _("My Tickets");
  *
  * @package Horde_Block
  */
-class Horde_Block_Whups_mytickets extends Horde_Block {
-
-    var $_app = 'whups';
+class Horde_Block_Whups_mytickets extends Horde_Block
+{
+    protected $_app = 'whups';
 
     /**
      * The title to go in this block.
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         return _("My Tickets");
     }
@@ -27,7 +27,7 @@ class Horde_Block_Whups_mytickets extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         global $whups_driver, $prefs;
 
@@ -62,6 +62,7 @@ class Horde_Block_Whups_mytickets extends Horde_Block {
         }
 
         Horde::addScriptFile('tables.js', 'horde', true);
+
         return '<table id="whups_block_mytickets" cellspacing="0" class="tickets striped sortable">' . $html . '</tbody></table>';
     }
 
index fa64bf7..e560d09 100644 (file)
@@ -8,11 +8,11 @@ $block_name = _("Query Results");
  *
  * @package Horde_Block
  */
-class Horde_Block_Whups_query extends Horde_Block {
+class Horde_Block_Whups_query extends Horde_Block
+{
+    protected $_app = 'whups';
 
-    var $_app = 'whups';
-
-    function _params()
+    protected function _params()
     {
         require_once WHUPS_BASE . '/lib/Query.php';
 
@@ -37,12 +37,13 @@ class Horde_Block_Whups_query extends Horde_Block {
      *
      * @return string The title text.
      */
-    function _title()
+    protected function _title()
     {
         if (($query = $this->_getQuery()) && $query->name) {
             return Horde::link(Whups::urlFor('query', empty($query->slug) ? array('id' => $query->id) : array('slug' => $query->slug)))
                 . htmlspecialchars($query->name) . '</a>';
         }
+
         return _("Query Results");
     }
 
@@ -51,7 +52,7 @@ class Horde_Block_Whups_query extends Horde_Block {
      *
      * @return string The content.
      */
-    function _content()
+    protected function _content()
     {
         global $whups_driver, $prefs;
 
@@ -83,10 +84,11 @@ class Horde_Block_Whups_query extends Horde_Block {
         }
 
         Horde::addScriptFile('tables.js', 'horde', true);
+
         return '<table id="whups_block_query_' . $query->id . '" cellspacing="0" class="tickets striped sortable">' . $html . '</tbody></table>';
     }
 
-    function _getQuery()
+    private function _getQuery()
     {
         if (empty($this->_params['query'])) {
             return false;
index 6f3261c..c8d76dc 100644 (file)
@@ -7,11 +7,11 @@ $block_name = _("Queue Contents");
  *
  * @package Horde_Block
  */
-class Horde_Block_Whups_queuecontents extends Horde_Block {
+class Horde_Block_Whups_queuecontents extends Horde_Block
+{
+    protected $_app = 'whups';
 
-    var $_app = 'whups';
-
-    function _params()
+    protected function _params()
     {
         global $whups_driver;
 
@@ -38,7 +38,7 @@ class Horde_Block_Whups_queuecontents extends Horde_Block {
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         if ($queue = $this->_getQueue()) {
             return sprintf(_("Open Tickets in %s"), htmlspecialchars($queue['name']));
@@ -51,7 +51,7 @@ class Horde_Block_Whups_queuecontents extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         global $whups_driver, $prefs;
 
@@ -88,10 +88,11 @@ class Horde_Block_Whups_queuecontents extends Horde_Block {
         }
 
         Horde::addScriptFile('tables.js', 'horde', true);
+
         return '<table id="whups_block_queue_' . htmlspecialchars($this->_params['queue']) . '" cellspacing="0" class="tickets striped sortable">' . $html . '</tbody></table>';
     }
 
-    function _getQueue()
+    private function _getQueue()
     {
         global $whups_driver;
 
@@ -105,6 +106,7 @@ class Horde_Block_Whups_queuecontents extends Horde_Block {
         if (is_a($queue, 'PEAR_Error')) {
             return false;
         }
+
         return $queue;
     }
 
index 11b05a9..3bbeeb6 100644 (file)
@@ -8,16 +8,16 @@ $block_name = _("Queue Summary");
  *
  * @package Horde_Block
  */
-class Horde_Block_Whups_queuesummary extends Horde_Block {
-
-    var $_app = 'whups';
+class Horde_Block_Whups_queuesummary extends Horde_Block
+{
+    protected $_app = 'whups';
 
     /**
      * The title to go in this block.
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         return _("Queue Summary");
     }
@@ -27,7 +27,7 @@ class Horde_Block_Whups_queuesummary extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         global $whups_driver;
 
@@ -54,6 +54,7 @@ class Horde_Block_Whups_queuesummary extends Horde_Block {
         }
 
         Horde::addScriptFile('tables.js', 'horde', true);
+
         return '<table id="whups_block_queuesummary" cellspacing="0" class="tickets striped sortable">' . $html . '</tbody></table>';
     }
 
index 33dca7b..b82096e 100644 (file)
@@ -6,11 +6,11 @@ $block_type = 'tree';
 /**
  * @package Horde_Block
  */
-class Horde_Block_whups_tree_menu extends Horde_Block {
+class Horde_Block_whups_tree_menu extends Horde_Block
+{
+    protected $_app = 'whups';
 
-    var $_app = 'whups';
-
-    function _buildTree(&$tree, $indent = 0, $parent = null)
+    protected function _buildTree(&$tree, $indent = 0, $parent = null)
     {
         global $registry;
 
index cbf55b9..d3a9ada 100644 (file)
@@ -8,16 +8,16 @@ $block_name = _("Unassigned Tickets");
  *
  * @package Horde_Block
  */
-class Horde_Block_Whups_unassigned extends Horde_Block {
-
-    var $_app = 'whups';
+class Horde_Block_Whups_unassigned extends Horde_Block
+{
+    protected $_app = 'whups';
 
     /**
      * The title to go in this block.
      *
      * @return string   The title text.
      */
-    function _title()
+    protected function _title()
     {
         return _("Unassigned Tickets");
     }
@@ -27,7 +27,7 @@ class Horde_Block_Whups_unassigned extends Horde_Block {
      *
      * @return string   The content
      */
-    function _content()
+    protected function _content()
     {
         global $whups_driver, $prefs;
 
@@ -62,6 +62,7 @@ class Horde_Block_Whups_unassigned extends Horde_Block {
         }
 
         Horde::addScriptFile('tables.js', 'horde', true);
+
         return '<table id="whups_block_mytickets" cellspacing="0" class="tickets striped sortable">' . $html . '</tbody></table>';
     }
 
index a6d078b..676833b 100644 (file)
@@ -13,23 +13,23 @@ $block_name = _("Wiki page");
  * @author  Jason Felice <jason.m.felice@gmail.com>
  * @package Horde_Block
  */
-class Horde_Block_Wicked_page extends Horde_Block {
+class Horde_Block_Wicked_page extends Horde_Block
+{
+    protected $_app = 'wicked';
 
-    var $_app = 'wicked';
-
-    function _title()
+    protected function _title()
     {
         $page = Page::getPage($this->_params['page']);
         return htmlspecialchars($page->pageName());
     }
 
-    function _content()
+    protected function _content()
     {
         $page = Page::getPage($this->_params['page']);
         return $page->render(WICKED_MODE_BLOCK);
     }
 
-    function _params()
+    protected function _params()
     {
         return array('page' => array('type' => 'text',
                                      'name' => _("Name of wiki page to display"),