Browse Source

#454 Studio launcher: don't use includes in if statements in templates

Alex Trofimov 10 years ago
parent
commit
550b6365fc
2 changed files with 6 additions and 11 deletions
  1. 0 3
      studio/template/launcher.html
  2. 6 8
      studio/template/scripts/BxBaseStudioLauncher.php

+ 0 - 3
studio/template/launcher.html

@@ -8,6 +8,3 @@ var __js_object__ = new BxDolStudioLauncher({
 __includes__
 <div class="bx-std-launcher">__items__</div>
 <div class="bx-std-cb"></div>
-<bx_if:show_tour>
-	<bx_include_auto:launcher_tour.html />
-</bx_if:show_tour>

+ 6 - 8
studio/template/scripts/BxBaseStudioLauncher.php

@@ -73,18 +73,16 @@ class BxBaseStudioLauncher extends BxDolStudioLauncher
         foreach($this->aIncludes as $sName => $oInclude)
             $sIncludes .= $oInclude->getJsCode();
 
-        return BxDolStudioTemplate::getInstance()->parseHtmlByName('launcher.html', array(
+        $s = BxDolStudioTemplate::getInstance()->parseHtmlByName('launcher.html', array(
             'js_object' => $this->getPageJsObject(),
             'includes' => $sIncludes,
             'items' => parent::getPageCode($bHidden),
-        	'tour_theme' => $this->_sTourTheme,
-        	'bx_if:show_tour' => array(
-        		'condition' => getParam('site_tour_studio') == 'on',
-        		'content' => array(
-        			'tour_theme' => $this->_sTourTheme,
-        		)
-        	)
         ));
+
+        if (getParam('site_tour_studio') == 'on')
+            $s .= BxDolStudioTemplate::getInstance()->parseHtmlByName('launcher_tour.html', array('tour_theme' => $this->_sTourTheme));
+
+        return $s;
     }
 
 	public function serviceGetCacheUpdater()