// Check if the current user has the 'create' permission for this node type.
if(node_access('create',$type)){
// Fetch the "General" name of the content type;
// Push the link with title and url to the array.
$forum_types[$type]=array('title'=>t('Add new @node_type',array('@node_type'=>node_type_get_name($type))),'href'=>'node/add/'.str_replace('_','-',$type).'/'.$variables['tid']);
}
}
if(empty($forum_types)){
// The user is logged-in; but denied access to create any new forum content type.
if($user->uid){
$forum_types['disallowed']=array('title'=>t('You are not allowed to post new content in the forum.'));
}
// The user is not logged-in; and denied access to create any new forum content type.
else{
$forum_types['login']=array('title'=>t('<a href="@login">Login</a> to post new content in the forum.',array('@login'=>url('user/login',array('query'=>drupal_get_destination())))),'html'=>TRUE);
'#markup'=>theme('links',array('links'=>array(array('title'=>t('Add new content'),'href'=>'node/add')),'attributes'=>array('class'=>array('action-links')))),