Exemplo n.º 1
0
 public static function template_post_render($templateName, &$output, array &$containerData, XenForo_Template_Abstract $template)
 {
     if (defined('WIDGET_FRAMEWORK_LOADED')) {
         if ($templateName != 'wf_widget_wrapper') {
             WidgetFramework_Core::getInstance()->renderWidgetsFor($templateName, $template->getParams(), $template, $containerData);
             // get a copy of container data for widget rendered
             $positionCode = $template->getParam(WidgetFramework_WidgetRenderer::PARAM_POSITION_CODE);
             if ($positionCode !== null) {
                 $widget = $template->getParam('widget');
                 WidgetFramework_WidgetRenderer::setContainerData($template->getParam('widget'), $containerData);
             }
         }
         if ($templateName === 'PAGE_CONTAINER') {
             WidgetFramework_Template_Extended::WidgetFramework_processLateExtraData($output, $containerData, $template);
             if (!empty(self::$_navigationTabsForums)) {
                 $output = str_replace('<!-- navigation_tabs_forums for wf_home_navtab_links -->', self::$_navigationTabsForums, $output);
             }
         }
     }
 }
Exemplo n.º 2
0
 public static function template_post_render($templateName, &$output, array &$containerData, XenForo_Template_Abstract $template)
 {
     if (defined('WIDGET_FRAMEWORK_LOADED')) {
         if ($templateName != 'wf_widget_wrapper') {
             $rendered = WidgetFramework_Core::getInstance()->renderWidgetsFor($templateName, $template->getParams(), $template, $containerData);
             if ($rendered) {
                 // get a copy of container data for widget rendered
                 $positionCode = $template->getParam(WidgetFramework_Core::PARAM_POSITION_CODE);
                 if ($positionCode !== null) {
                     WidgetFramework_WidgetRenderer::setContainerData($template->getParam('widget'), $containerData);
                 }
                 if (!isset($containerData[WidgetFramework_Core::PARAM_TEMPLATE_OBJECTS])) {
                     $containerData[WidgetFramework_Core::PARAM_TEMPLATE_OBJECTS] = array();
                 }
                 $containerData[WidgetFramework_Core::PARAM_TEMPLATE_OBJECTS][$templateName] = $template;
             }
         }
         if (self::$_saveLayoutEditorRendered) {
             switch ($templateName) {
                 case 'wf_widget_wrapper':
                 case 'wf_layout_editor_widget_wrapper':
                     $normalizedGroupId = $template->getParam('normalizedGroupId');
                     if (!empty($normalizedGroupId)) {
                         self::$_layoutEditorRendered[$normalizedGroupId] = $output;
                     }
                     $tabs = $template->getParam('tabs');
                     foreach ($tabs as $tab) {
                         if (!empty($normalizedGroupId)) {
                             self::$_layoutEditorRendered[$tab['widget_id']] = array('normalizedGroupId' => $normalizedGroupId);
                         } else {
                             self::$_layoutEditorRendered[$tab['widget_id']] = $output;
                         }
                     }
                     break;
                 case 'wf_layout_editor_widget':
                     $widget = $template->getParam('widget');
                     self::$_layoutEditorRendered[$widget['widget_id']] = $output;
                     break;
             }
         }
         if ($templateName === 'PAGE_CONTAINER') {
             WidgetFramework_Template_Extended::WidgetFramework_processLateExtraData($output, $containerData, $template);
             if (!empty(self::$_navigationTabsForums)) {
                 $output = str_replace('<!-- navigation_tabs_forums for wf_home_navtab_links -->', self::$_navigationTabsForums, $output);
             }
         }
     }
 }