Marcus
Well-known member
I want to display watched Forums on top of forum_list. $response->params['watchedForums'] = $this->responseView does not work, do you have an idea for a workaround?
PHP:
class WatchedContent_ControllerPublic_Forum extends XFCP_WatchedContent_ControllerPublic_Forum
{
public function actionIndex()
{
$response = parent::actionIndex();
$visitor = XenForo_Visitor::getInstance();
if($visitor['user_id'])
{
$nodeModel = $this->getModelFromCache('XenForo_Model_Node');
$forumWatchModel = $this->_getForumWatchModel();
$visitor = XenForo_Visitor::getInstance();
$forumsWatched = $forumWatchModel->getUserForumWatchByUser($visitor['user_id']);
$viewParams = array(
'nodeList' => $nodeModel->getNodeDataForListDisplay(false, 0),
'forumsWatched' => $forumsWatched
);
$response->params['watchedForums'] = $this->responseView('XenForo_ViewPublic_Watched_Forums', 'watch_forums', $viewParams);
}
return $response;
}