From: Jan Schneider Date: Wed, 3 Feb 2010 00:34:12 +0000 (+0100) Subject: Simplify X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=69a376b1b40b75c185c51280ea0a4a978f64f46a;p=horde.git Simplify --- diff --git a/horde/lib/Block/cloud.php b/horde/lib/Block/cloud.php index 33233fbe8..fede5dc2c 100644 --- a/horde/lib/Block/cloud.php +++ b/horde/lib/Block/cloud.php @@ -18,8 +18,6 @@ class Horde_Block_Horde_cloud extends Horde_Block { */ var $_app = 'horde'; - var $_tagapis = array('images', 'news'); - /** * The title to go in this block. * @@ -37,41 +35,29 @@ class Horde_Block_Horde_cloud extends Horde_Block { */ function _content() { - global $registry; Horde::addScriptFile('prototype.js', 'horde'); $cloud = new Horde_Ui_TagCloud(); - if (!is_a($cloud, 'PEAR_Error')) { - $tags = $this->_getTags(); - foreach ($tags as $tag) { - $cloud->addElement($tag['tag_name'], '#', $tag['total'], - null, - 'doSearch(\'' . $tag['tag_name'] . '\');'); - } - $html = Horde_Util::bufferOutput('include', - HORDE_TEMPLATES . '/block/cloud.inc'); - - $html .= '
 ' . - Horde::img('loading.gif', '', array('style' => 'display:none;', 'id' => 'cloudloadingimg')) . - '
' . $cloud->buildHTML() . - '
'; - } else { - $html = $cloud->getMessage(); + foreach ($this->_getTags() as $tag) { + $cloud->addElement($tag['tag_name'], '#', $tag['total'], + null, + 'doSearch(\'' . $tag['tag_name'] . '\');'); } - return $html; + return Horde_Util::bufferOutput('include', HORDE_TEMPLATES . '/block/cloud.inc') + . '
 ' + . Horde::img('loading.gif', '', array('style' => 'display:none;', 'id' => 'cloudloadingimg')) + . '
' . $cloud->buildHTML() + . '
'; } - function _getTags() { - global $registry; $results = array(); - - foreach ($this->_tagapis as $api) { - $methods = $registry->listMethods($api); - if (array_search($api . '/listTagInfo', $methods)) { - $result = $registry->call($api . '/listTagInfo', array()); + foreach ($GLOBALS['registry']->listAPIs() as $api) { + if ($GLOBALS['registry']->hasMethod($api . '/listTagInfo')) { + var_dump($api . '/listTagInfo'); + $result = $registry->call($api . '/listTagInfo'); if (!is_a($result, 'PEAR_Error')) { $results = array_merge($results, $result); }