I assume you never passed the $addedLinks to the template.
For instance when you do this:
PHP:
$addedLinks = array();
return $this->responseView('XX_ViewPublic_Forum', 'xx', array('addedLinks' => $addedLinks));
If you'll do the above you won't see the error you see right now. but you'll have to do what ever you need to do in order to get $addedLinks populated with data.