+= array in XenForo_CodeEvent::fire('notices_prepare')

Marcus

Well-known member
In XenForo_ViewRenderer_HtmlPublic change placement of XenForo_CodeEvent::fire('notices_prepare') to the end, so developers can add fields to notices.

PHP:
         foreach ($noticeList AS $noticeId => $notice)
         {
           $notices[$noticeId] = array(
             'title' => $notice['title'],
             'message' => str_replace(array_keys($noticeTokens), $noticeTokens, $notice['message']),
             'wrap' => $notice['wrap'],
             'dismissible' => ($notice['dismissible'] && XenForo_Visitor::getUserId())
           );
         }

        XenForo_CodeEvent::fire('notices_prepare', array(&$notices, &$noticeTokens, $template, $containerData));
 
Last edited:
Update: Of course you can render the message in an additional template with the current implementation. So there is no real need of a change here.

XenForo is really very powerful.
 
Top Bottom