/** * Return a tag cloud * * @return string */ public function getTagCloud() { global $_LANGID, $objInit; $tpl = new \Cx\Core\Html\Sigma(); \Cx\Core\Csrf\Controller\Csrf::add_placeholder($tpl); $tpl->setErrorHandling(PEAR_ERROR_DIE); $template = $this->settings->formatTemplate($this->settings->get("tag_cloud_sidebar_template")); $tpl->setTemplate($template); $highestFontSize = 20; $lowestFontSize = 10; try { $tags_pop = $this->tags->getAllOrderByPopularity($_LANGID, true); $tags = $this->tags->getAll($_LANGID, true); } catch (DatabaseError $e) { echo $e->plain(); } $tagCloud = new TagCloud(); $tagCloud->setTags($tags); $tagCloud->setTagVals($tags_pop[0]['popularity'], $tags_pop[count($tags_pop) - 1]['popularity']); $tagCloud->setFont(20, 10); $tagCloud->setUrlFormat("index.php?section=Knowledge" . MODULE_INDEX . "&tid=%id"); $tpl->setVariable("CLOUD", $tagCloud->getCloud()); //$tpl->parse("cloud"); return $tpl->get(); }