public static function template_create(&$templateName, array &$params, XenForo_Template_Abstract $template) { if (defined('WIDGET_FRAMEWORK_LOADED')) { WidgetFramework_Core::getInstance()->prepareWidgetsFor($templateName, $params, $template); WidgetFramework_Core::getInstance()->prepareWidgetsForHooksIn($templateName, $params, $template); if ($templateName === 'PAGE_CONTAINER') { $template->preloadTemplate('wf_hook_moderator_bar'); $template->preloadTemplate('wf_revealer'); if (WidgetFramework_Option::get('indexNodeId')) { // preload our links template for performance $template->preloadTemplate('wf_home_navtab_links'); } WidgetFramework_Template_Extended::WidgetFramework_setPageContainer($template); if (isset($params['contentTemplate']) and $params['contentTemplate'] === 'wf_widget_page_index' and empty($params['selectedTabId'])) { // make sure a navtab is selected if user is viewing our (as index) widget page if (!XenForo_Template_Helper_Core::styleProperty('wf_homeNavTab')) { // oh, our "Home" navtab has been disable... // try something from $params['tabs'] OR $params['extraTabs'] if (isset($params['tabs']) and isset($params['extraTabs'])) { WidgetFramework_Helper_Index::setNavtabSelected($params['tabs'], $params['extraTabs']); } } } } } }