Render Alerts

silence

Well-known member
Yes it's me again :C
This function in the Alert model:
PHP:
    public function getAlertsForUser($userId, $fetchMode, array $fetchOptions = array(), array $viewingUser = null)
It get's the alerts for a user, however how exactly is the alert rendered on the controller?
I was looking in one of the alert templates and it was being called simply with one variable ($alert.template) so which function renders an alert into a single string?

Thanks!
 
Alright I got a bit further with this, I'm attempting to grab the template and render it, then use a regex to remove all html content and leave me with just the raw text of the template. However, I can't figure out how to get said template and view it raw! Here is what I have so far.

PHP:
<?php

class Teamspeak_Model_Alert extends XFCP_Teamspeak_Model_Alert
{
    public function renderAlert($alert)
    {
        $template = $this->_getAlertTemplate($alert['content_type'], $alert['action']);
    }

    protected function _getAlertTemplate($contentType, $action)
    {
        return 'alert_' . $contentType . '_' . $action;
    }
}
 
Bump I still am a bit confused about this D:
I saw the plugin 'Pushover Integration' by @xfrocks but am confused as to how they achieved it :(
 
Well, you need the XenForo_View object to render the template. Take a look at XenForo_ViewPublic_Account_AlertsPopup ;)
 
Back
Top Bottom