예제 #1
0
 /**
  * Renders the container.
  * @see XenForo_ViewRenderer_Abstract::renderContainer()
  *
  * @param string
  * @param array
  *
  * @return string
  */
 public function renderContainer($contents, array $params = array())
 {
     $options = XenForo_Application::get('options');
     $params['debugMode'] = XenForo_Application::debugMode();
     $params['debugFormBackground'] = $options->debugFormBackground;
     if (!empty($params['adminNavigation']['sideLinks'])) {
         $params['sideNav'] = $this->_renderSideNav($params['adminNavigation']['sideLinksRoot'], $params['adminNavigation']['sideLinks']);
     } else {
         $params['sideNav'] = array();
     }
     $params['serverTimeInfo'] = XenForo_Locale::getDayStartTimestamps();
     $params['publicUrl'] = $options->useFriendlyUrls ? './' : 'index.php';
     if (!isset($params['allowManualDeferredRun'])) {
         $params['allowManualDeferredRun'] = true;
     }
     $params['hasManualDeferred'] = XenForo_ViewRenderer_Abstract::hasManualDeferredToRun($params['allowManualDeferredRun']) || !empty($params['hasManualDeferred']);
     $templateName = !empty($params['containerTemplate']) ? $params['containerTemplate'] : 'PAGE_CONTAINER';
     $template = $this->createTemplateObject($templateName, $params);
     if ($contents instanceof XenForo_Template_Abstract) {
         $contents = $contents->render();
     }
     $template->setParams($this->_dependencies->getExtraContainerData());
     $template->setParam('contents', $contents);
     if ($params['debugMode']) {
         $template->setParams(XenForo_Debug::getDebugTemplateParams());
     }
     $rendered = $template->render();
     $rendered = $this->replaceRequiredExternalPlaceholders($template, $rendered);
     $language = XenForo_Visitor::getInstance()->getLanguage();
     if (isset($language['text_direction']) && $language['text_direction'] == 'RTL') {
         $rendered = XenForo_Template_Helper_RightToLeft::replaceRtlEntities($rendered);
     }
     return $rendered;
 }
예제 #2
0
 /**
  * Renders the container.
  * @see XenForo_ViewRenderer_Abstract::renderContainer()
  *
  * @param string
  * @param array
  *
  * @return string
  */
 public function renderContainer($contents, array $params = array())
 {
     $params['contentTemplate'] = $this->_contentTemplate;
     $params['debugMode'] = XenForo_Application::debugMode();
     $params['serverTimeInfo'] = XenForo_Locale::getDayStartTimestamps();
     if (!empty($params['extraTabs'])) {
         foreach ($params['extraTabs'] as &$group) {
             foreach ($group as &$extraTab) {
                 if (!empty($extraTab['linksTemplate'])) {
                     $extraTab['linksTemplate'] = $this->createTemplateObject($extraTab['linksTemplate'], $extraTab + $params);
                 }
             }
         }
     }
     $templateName = !empty($params['containerTemplate']) ? $params['containerTemplate'] : 'PAGE_CONTAINER';
     $template = $this->createTemplateObject($templateName, $params);
     if ($contents instanceof XenForo_Template_Abstract) {
         $contents = $contents->render();
     }
     $containerData = $this->_dependencies->getExtraContainerData();
     $containerData['notices'] = $this->_getNoticesContainerParams($template, $containerData);
     $template->setParams($containerData);
     $template->setParam('contents', $contents);
     $template->setParam('noH1', isset($containerData['h1']) && $containerData['h1'] === '');
     if ($params['debugMode']) {
         $template->setParams(XenForo_Debug::getDebugTemplateParams());
     }
     $rendered = $template->render();
     $rendered = $this->replaceRequiredExternalPlaceholders($template, $rendered);
     $language = XenForo_Visitor::getInstance()->getLanguage();
     if (isset($language['text_direction']) && $language['text_direction'] == 'RTL') {
         $rendered = XenForo_Template_Helper_RightToLeft::replaceRtlEntities($rendered);
     }
     return $rendered;
 }