/**
* Pre-cache the xfcom_page_wrapper template.
* Listens to 'template_create' code event.
*
* @param string $templateName
* @param array $params
* @param XenForo_Template_Abstract $template
*/
public static function templateCreate($templateName, array &$params, XenForo_Template_Abstract $template)
{
if ($templateName == 'PAGE_CONTAINER')
{
$template->preloadTemplate('xfcom_page_wrapper');
}
}
/**
* Wrap the xfcom_page_wrapper template around the page.
* Listens to 'template_hook' code event.
*
* @param string $hookName
* @param string $content
* @param string $hookParams
* @param XenForo_Template_Abstract $template
*/
public static function templateHook($hookName, &$content, array $hookParams, XenForo_Template_Abstract $template)
{
if ($hookName == 'body')
{
$params = $template->getParams();
$params['HTML'] = $content;
$content = $template->create('xfcom_page_wrapper', $params);
}
}