1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Implemented Add a method to fetch noticeTokens or an eventlistener

Discussion in 'Closed Suggestions' started by ragtek, Nov 16, 2011.

  1. ragtek

    ragtek Guest

    It would be much easier to include own vars in the noticeTokens if we would have an event listener with an reference to the noticeTokens or if a method would return the array.

    that's the part i mean:
    $noticeTokens = array(
    '{name}' => $user['username'] !== '' $user['username'] : new XenForo_Phrase('guest'),
    '{user_id}' => $user['user_id'],

                    foreach (
    XenForo_Application::get('notices') AS $noticeId => $notice)
                        if (!
    XenForo_Helper_Criteria::userMatchesCriteria($notice['user_criteria'], true$user)
    XenForo_Helper_Criteria::pageMatchesCriteria($notice['page_criteria'], true$template->getParams(), $containerData))
    $notices[$noticeId] = array(
    'title' => $notice['title'],
    'message' => str_replace(array_keys($noticeTokens), $noticeTokens$notice['message']),
    'wrap' => $notice['wrap'],
    'dismissible' => ($notice['dismissible'] && XenForo_Visitor::getUserId())
  2. Fuhrmann

    Fuhrmann Well-Known Member

    Agree. That would be good.
  3. xf_phantom

    xf_phantom Well-Known Member

  4. Mike

    Mike XenForo Developer Staff Member

    There's a listener for this in 1.2, which also lets you modify the notices that will be prepared/displayed as well.
    Pereira likes this.

Share This Page