/** * @todo Implement testReplace(). */ public function testReplace() { // test data $array = array(array('title' => 'modulenameA', 'link' => 'index.php?mod=modulenameA'), array('title' => 'modulenameC', 'link' => '/index.php?mod=modulenameC')); // add array[0] $this->object->add($array[0]['title'], $array[0]['link']); // replace array[0] $this->object->replace($array[1]['title'], $array[1]['link'], 0); $t_array = $this->object->getTrail(false); $this->assertIdentical('ModulenameC', $t_array[0]['title']); $this->assertIdentical(WWW_ROOT . 'index.php?mod=modulenameC', $t_array[0]['link']); }
/** * module news action_showone() * * Show one single news with comments */ public function action_showone($params) { // Get Render Engine $view = $this->getView(); #Clansuite_Debug::firebug($params); $news_id = (int) $params['id']; #(int) $this->request->getParameterFromGet('id'); if ($news_id === null) { $news_id = 1; } // fetch the news to update by news_id // $news = $this->getModel()->find($data['news_id']); $news = $this->getModel()->fetchSingleNews($news_id); Clansuite_Debug::printR($news); // if a news was found if (!empty($news) && is_array($news)) { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::replace(_('Show News'), '/news/show', 1); Clansuite_Breadcrumb::add(_('Viewing Single News: ') . $news['news_title'], '/index.php?mod=news&action=show'); $view->assign('news', $news); } else { // no news found for this id $view->setTemplate('newsnotfound.tpl'); } // Prepare Output $this->display(); }