/** * Event: core.index_modify_page_title */ public function index_modify_page_title($event) { if ($this->config[prefixes::CONFIG . '_display_tagcloud_on_index']) { $this->template->assign_vars(array('RH_TOPICTAGS_DISPLAY_TAGCLOUD_ON_INDEX' => true, 'RH_TOPICTAGS_TAGCLOUD_LINK' => $this->helper->route('robertheim_topictags_controller'))); $this->tagcloud_manager->assign_tagcloud_to_template(); } }
public function test_assign_tagcloud_to_template5() { // all tags should be shown $limit = -1; $show_count = 'Display all tags.'; $this->user->expects($this->once())->method('lang')->with('RH_TOPICTAGS_DISPLAYING_TOTAL_ALL')->willReturn($show_count); $this->template->expects($this->once())->method('assign_vars')->with($this->equalTo(array('S_RH_TOPICTAGS_INCLUDE_CSS' => true, 'RH_TOPICTAGS_TAGCLOUD_SHOW_COUNT' => true, 'RH_TOPICTAGS_TAGCLOUD_TAG_COUNT' => $show_count)))->willReturn(true); $this->template->expects($this->exactly(3))->method('assign_block_vars')->withConsecutive(array('rh_topictags_tags', $this->callback(function ($o) { $diff = array_diff_assoc(array('NAME' => 'tag1', 'COUNT' => 2), $o); return sizeof($diff) == 0; })), array('rh_topictags_tags', $this->callback(function ($o) { $diff = array_diff_assoc(array('NAME' => 'anothertag3', 'COUNT' => 1), $o); return sizeof($diff) == 0; })), array('rh_topictags_tags', $this->callback(function ($o) { $diff = array_diff_assoc(array('NAME' => 'tag2', 'COUNT' => 0), $o); return sizeof($diff) == 0; })))->willReturn(true); $this->tagcloud_manager->assign_tagcloud_to_template($limit); }
/** * Controller for route /tags * * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object */ public function show() { $this->tagcloud_manager->assign_tagcloud_to_template(-1); return $this->helper->render('tags.html', 'Tags'); }