public static function add_notice(array &$noticeList, array &$noticeTokens, XenForo_Template_Abstract $template, array $containerData)
{
$visitor = XenForo_Visitor::getInstance();
$options = XenForo_Application::getOptions();
$bbCodeMode = false;
/* @var $progressModel Apantic_UserProfileProgress_Model_UserProfileProgress */
$progressModel = XenForo_Model::create('Apantic_UserProfileProgress_Model_UserProfileProgress');
$tasks = $progressModel->getTasks(array('active' => 1));
if($options->auppEnableViewHook)
{
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array(
'view' => self::$_view
)));
$bbCodeMode = true;
}
if(!empty($visitor['user_id'])
&& $visitor['aupp_percent_completed'] < 100
/* && $visitor->hasPermission('', '')*/
)
{
$completed = $progressModel->getTasksCompletedByUser($visitor);
if(empty($tasks))
{
return;
}
if($bbCodeMode)
{
foreach($tasks as $task)
{
$tasks[$task['task_id']]['title'] = $bbCodeParser->render($task['title']);
}
}
$template->setParam('tasks', $tasks);
$template->setParam('completed', $completed);
$noticeList['auppPendingTasks'] = array(
'title' => new XenForo_Phrase('aupp_notice_title'),
'message' => $template->create('aupp_notice_tasks', $template->getParams()),
'wrap' => true,
'dismissible' => false,
'delay_duration' => '',
'display_duration' => '',
'auto_dismiss' => false,
'display_image' => '',
'display_style' => 'primary',
'css_class' => '',
'visibility' => '',
'notice_type' => ($options->auppNoticeLocation == 'floating' ? 'floating' : 'block')
);
$tokens = array(
'{progress}' => $visitor['aupp_percent_completed'],
);
$noticeTokens = array_merge($noticeTokens, $tokens);
}
}