* @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();
return array('forum_display' => $forum_display);
}
- function _content()
+ protected function _content()
{
global $registry;
return $view->render('block/forums.html.php');
}
+
}
* @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);
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. */
/* 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. */
return $view->render('block/thread.html.php');
}
+
}
* @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();
/**
* @return string
*/
- function _title()
+ protected function _title()
{
if (!isset($this->_params['forum_id'])) {
return _("Threads");
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."));
}
}
return $view->render('block/threads.html.php');
}
+
}
* @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"),
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;
*/
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"),
'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) {
return $params;
}
- function _title()
+ /**
+ *
+ * @return string
+ */
+ protected function _title()
{
try {
$gallery = $this->_getGallery();
'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();
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) {
* @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"),
return $params;
}
- function _title()
+ /**
+ *
+ * @return string
+ */
+ protected function _title()
{
return Ansel::getUrlFor('view',
array('groupby' => 'owner',
. _("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')
* @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) {
} else {
$img = Horde::img('thumb-error.png');
}
+
return $viewurl->link(array('title' => _("View Photo"))) . $img . '</a>';
}
*/
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"),
return $params;
}
- function _title()
+ /**
+ *
+ * @return string
+ */
+ protected function _title()
{
if ($this->_params['gallery'] != 'all') {
try {
return sprintf(_("Recent Comments In %s"), $viewurl->link() . $name . '</a>');
}
- function _content()
+ /**
+ *
+ * @global Horde_Registry $registry
+ * @return string
+ */
+ protected function _content()
{
global $registry;
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) {
}
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."));
}
* @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;
*/
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"),
'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']);
*/
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"),
return $params;
}
- function _title()
+ /**
+ *
+ * @return string
+ */
+ protected function _title()
{
if ($this->_params['gallery'] != 'all') {
try {
$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();
$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));
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) {
* @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"),
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));
$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();
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;
* @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;
/**
* @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,
/**
* @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;
* @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");
}
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
global $registry, $conf;
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;
* @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");
}
*
* @return string The content.
*/
- function _content()
+ protected function _content()
{
Horde::addScriptFile('prototype.js', 'horde');
. '<div id="cloudsearch"></div>';
}
- function _getTags()
+ /**
+ *
+ * @return array
+ */
+ private function _getTags()
{
$results = array();
foreach ($GLOBALS['registry']->listAPIs() as $api) {
}
}
}
+
return $results;
}
* @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
*
* @return array
*/
- function _params()
+ protected function _params()
{
$filters = array();
*
* @return string The title text.
*/
- function _title()
+ protected function _title()
{
return Horde::externalUrl('http://facebook.com', true) . _("My Facebook Stream") . '</a>';
}
*
* @return string The content.
*/
- function _content()
+ protected function _content()
{
$instance = md5(mt_rand());
$csslink = $GLOBALS['registry']->get('themesuri', 'horde') . '/facebook.css';
/**
* @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")),
*
* @return string The title text.
*/
- function _title()
+ protected function _title()
{
$this->_read();
if (is_a($this->_feed, 'Horde_Feed_Base')) {
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
$this->_read();
if (is_a($this->_feed, 'Horde_Feed_Base')) {
}
}
- function _read()
+ private function _read()
{
if (empty($this->_params['uri'])) {
return;
/**
* @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;
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
global $conf;
/**
* @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");
}
*
* @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>
//]]>
</script>
<?php
- return ob_get_clean();
+ return Horde::endBuffer();
}
}
/**
* @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"),
*
* @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>';
}
/**
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
global $browser;
*
* @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');
}
}
- 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;
}
*
* @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)) {
/**
* @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(
);
}
- function _content()
+ protected function _content()
{
$phases = $this->_calculateMoonPhases(date('Y'));
$now = time();
*
* @return array The moon phases.
*/
- function _calculateMoonPhases($Y)
+ private function _calculateMoonPhases($Y)
{
$R1 = 3.14159265 / 180;
$U = false;
*
* @return string m/d/Y
*/
- function _jdtogregorian($julian)
+ private function _jdtogregorian($julian)
{
if (function_exists('jdtogregorian')) {
return jdtogregorian($julian);
/**
* @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"),
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.
/**
* 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);
/**
* @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"),
*
* @return string The title text.
*/
- function _title()
+ protected function _title()
{
return _("Current Time");
}
*
* @return string The content.
*/
- function _content()
+ protected function _content()
{
if (empty($this->_params['time'])) {
$this->_params['time'] = '24-hour';
* 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();
/**
*/
- function _params()
+ protected function _params()
{
return array(
'height' => array(
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
global $conf;
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. */
/**
* @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");
}
*
* @return string The content.
*/
- function _content()
+ protected function _content()
{
$vatid = str_replace(' ', '', Horde_Util::getFormData('vatid', ''));
$block_name = 'block_' . $this->_row . '_' . $this->_col;
return $html;
}
- function _error($text)
+ private function _error($text)
{
return '<span style="color:red;font-weight:bold">' . $text . '</span>';
}
*
* @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");
}
*
* @return array An array containing the parameters.
*/
- function _params()
+ protected function _params()
{
if (!(@include_once 'Services/Weather.php') ||
!(@include_once 'Cache.php') ||
*
* @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;
* @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>';
}
/**
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
/* Get list of filters */
$filters = $GLOBALS['ingo_storage']->retrieve(Ingo_Storage::ACTION_FILTERS);
$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;
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'])) {
$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;
$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;
$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;
*
* @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',
}
}
}
+
return $params;
}
*
* @return string The title text.
*/
- function _title()
+ protected function _title()
{
$title = _("All Calendars");
$url = Horde::url($GLOBALS['registry']->getInitialPage(), true);
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
global $prefs;
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)) {
*
* @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',
*
* @return string The title text.
*/
- function _title()
+ protected function _title()
{
$url = Horde::url($GLOBALS['registry']->getInitialPage(), true);
if (isset($this->_params['calendar']) &&
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
global $registry, $prefs;
*
* @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',
*
* @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>';
}
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
global $registry, $prefs;
*
* @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'])) {
}
}
- function _params()
+ protected function _params()
{
$params = array('calendar' => array('name' => _("Calendar"),
'type' => 'enum',
*
* @return string The title text.
*/
- function _title()
+ protected function _title()
{
$url = Horde::url($GLOBALS['registry']->getInitialPage(), true);
if (isset($this->_params['calendar']) &&
/**
* @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');
/**
* @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;
),
'note_name' => array(
'type' => 'hidden',
+ 'name' => 'note_name'
),
);
}
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 {
/**
* 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();
'values' => $categories));
}
- function _content()
+ protected function _content()
{
global $registry, $prefs;
if (!$memos) {
return '<p><em>' . _("No notes to display") . '</em></p>';
}
+
return '<link href="'
. htmlspecialchars(Horde::applicationUrl('themes/categoryCSS.php',
true))
$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,
'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')),
/**
* @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();
'values' => $categories));
}
- function _content()
+ protected function _content()
{
global $registry, $prefs;
/**
* @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');
/**
* @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;
/**
* 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.
* @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';
*
* @return string The title text.
*/
- function _title()
+ protected function _title()
{
global $registry;
}
}
- return Horde::link(Horde::url($registry->getInitialPage(), true)) . $name . '</a>';
+ return Horde::url($registry->getInitialPage(), true)->link() . $name . '</a>';
}
/**
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
require_once dirname(__FILE__) . '/../base.php';
require_once TREAN_TEMPLATES . '/star_rating_helper.php';
return $html;
}
- function _getFolder()
+ private function _getFolder()
{
require_once dirname(__FILE__) . '/../base.php';
/**
* 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.
* @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',
*
* @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>';
}
/**
*
* @return string The content.
*/
- function _content()
+ protected function _content()
{
require_once dirname(__FILE__) . '/../base.php';
require_once TREAN_TEMPLATES . '/star_rating_helper.php';
/**
* 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.
* @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',
*
* @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>';
}
/**
*
* @return string The content.
*/
- function _content()
+ protected function _content()
{
require_once dirname(__FILE__) . '/../base.php';
require_once TREAN_TEMPLATES . '/star_rating_helper.php';
$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;
*
* @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>';
}
*
* @return string The block content.
*/
- function _content()
+ protected function _content()
{
if ($GLOBALS['browser']->hasFeature('iframes')) {
Horde::addScriptFile('prototype.js', 'horde');
/**
* @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;
*
* @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");
}
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
require_once WHUPS_BASE . '/lib/Query.php';
*
* @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");
}
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
global $whups_driver, $prefs;
}
Horde::addScriptFile('tables.js', 'horde', true);
+
return '<table id="whups_block_myrequests" cellspacing="0" class="tickets striped sortable">' . $html . '</tbody></table>';
}
*
* @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");
}
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
global $whups_driver, $prefs;
}
Horde::addScriptFile('tables.js', 'horde', true);
+
return '<table id="whups_block_mytickets" cellspacing="0" class="tickets striped sortable">' . $html . '</tbody></table>';
}
*
* @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';
*
* @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");
}
*
* @return string The content.
*/
- function _content()
+ protected function _content()
{
global $whups_driver, $prefs;
}
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;
*
* @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;
*
* @return string The title text.
*/
- function _title()
+ protected function _title()
{
if ($queue = $this->_getQueue()) {
return sprintf(_("Open Tickets in %s"), htmlspecialchars($queue['name']));
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
global $whups_driver, $prefs;
}
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;
if (is_a($queue, 'PEAR_Error')) {
return false;
}
+
return $queue;
}
*
* @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");
}
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
global $whups_driver;
}
Horde::addScriptFile('tables.js', 'horde', true);
+
return '<table id="whups_block_queuesummary" cellspacing="0" class="tickets striped sortable">' . $html . '</tbody></table>';
}
/**
* @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;
*
* @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");
}
*
* @return string The content
*/
- function _content()
+ protected function _content()
{
global $whups_driver, $prefs;
}
Horde::addScriptFile('tables.js', 'horde', true);
+
return '<table id="whups_block_mytickets" cellspacing="0" class="tickets striped sortable">' . $html . '</tbody></table>';
}
* @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"),