Kaynağa Gözat

#53 - some code clean-up, profiler call for menu generation timings

Alex Trofimov 12 yıl önce
ebeveyn
işleme
d8572b0da9

+ 1 - 1
template/scripts/BxBaseFormView.php

@@ -284,7 +284,7 @@ BLAH;
 
         return <<<EOS
             <div class="bx-form-row-view-wrapper bx-form-row-view-wrapper-{$aInput['type']} bx-def-padding-sec-top">
-                <div class="bx-form-row-view-caption bx-def-margin-sec-right">{$sCaption}:</div> <!-- TODO: temporary ':' - replace with lang key -->
+                <div class="bx-form-row-view-caption bx-def-margin-sec-right">{$sCaption}:</div>
                 <div class="bx-form-row-view-value">{$sValue}</div>
             </div>
 EOS;

+ 0 - 1
template/scripts/BxBaseFunctions.php

@@ -270,7 +270,6 @@ class BxBaseFunctions extends BxDol implements iBxDolSingleton
             'title' => $sTitle,            
             'designbox_content' => $sContent,
             'caption_item' => $this->designBoxMenu ($mixedMenu, array (array('menu' => 1))),
-            'bottom_item' => '', // TODO: remove or implement somehow
         ));
     }
 

+ 11 - 6
template/scripts/BxBaseMenu.php

@@ -34,14 +34,19 @@ class BxBaseMenu extends BxDolMenu {
      */
     public function getCode () {
 
-        $aVars = $this->_getTemplateVars ();
+        $sMenuTitle = isset($this->_aObject['title']) ? _t($this->_aObject['title']) : 'Menu-' . rand(0, PHP_INT_MAX);
+        if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->beginMenu($sMenuTitle);
 
-        if (empty($aVars['bx_repeat:menu_items']))
-            return false;
+        $s = '';
+        $aVars = $this->_getTemplateVars ();
+        if (!empty($aVars['bx_repeat:menu_items'])) {
+            $this->_addJsCss();
+            $s = $this->_oTemplate->parseHtmlByName($this->_aObject['template'], $aVars);
+        }
 
-        $this->_addJsCss();
+        if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->endMenu($sMenuTitle);
 
-        return $this->_oTemplate->parseHtmlByName($this->_aObject['template'], $aVars);
+        return $s;
     }
 
     /** 
@@ -126,7 +131,7 @@ class BxBaseMenu extends BxDolMenu {
                 if (false === strpos($a['icon'], '.')) // font icons
                     $sIcon = $a['icon'];
                 else
-                    $sIconUrl = $this->_oTemplate->getIconUrl($a['icon']); // TODO: it is used in studio only, so move this line of code to studio or maybe all studio icons will use font icons too ?!
+                    $sIconUrl = $this->_oTemplate->getIconUrl($a['icon']);
             }
         }
         return array ($sIcon, $sIconUrl);

+ 0 - 2
template/scripts/BxBasePage.php

@@ -54,8 +54,6 @@ class BxBasePage extends BxDolPage {
 
         $this->_selectMenu();
 
-        // TODO: insert profiler call here 
-
         if (!getParam('sys_page_cache_enable') || !$this->_aObject['cache_lifetime'])
             return $this->_getPageCode();
         

+ 0 - 4
template/scripts/BxBaseServices.php

@@ -15,10 +15,6 @@ class BxBaseServices extends BxDol implements iBxDolProfileService {
         parent::__construct();
     }
 
-    public function serviceProfilesSearch ($sTerm, $iLimit) {
-        // TODO: profiles search 
-    }
-
     public function serviceProfileUnit ($iContentId) {
         return $this->_serviceProfileFunc('getUnit', $iContentId);
     }