示例#1
0
 /**
  * Prepare template display
  *
  * @param string $template Template short path
  *
  * @return array
  */
 protected function prepareTemplateDisplay($template)
 {
     $result = parent::prepareTemplateDisplay($template);
     if ($this->isMarkTemplates()) {
         $templateId = static::$templateId++;
         $localPath = substr($template, strlen(LC_DIR_SKINS));
         $current = new \XLite\Core\CommonGraph($localPath);
         $data = new \XLite\Core\CommonCell();
         $data->class = get_class($this);
         $data->templateId = $templateId;
         $current->setData($data);
         static::$current->addChild($current);
         static::$current = $current;
         $templateWrapperText = get_class($this) . ' : ' . $localPath . ' (' . $templateId . ')' . ($this->viewListName ? ' [\'' . $this->viewListName . '\' list child]' : '');
         echo '<!-- ' . $templateWrapperText . ' {' . '{{ -->';
         $result['templateWrapperText'] = $templateWrapperText;
     }
     return $result;
 }
示例#2
0
 /**
  * Prepare template display
  *
  * @param string $template Template short path
  *
  * @return array
  */
 protected function prepareTemplateDisplay($template)
 {
     $result = parent::prepareTemplateDisplay($template);
     $cnt = static::$profilerInfo['countDeep']++;
     $cntLevel = static::$profilerInfo['countLevel']++;
     if (static::$profilerInfo['isEnabled']) {
         $timePoint = str_repeat('+', $cntLevel) . '[TPL ' . str_repeat('0', 4 - strlen((string) $cnt)) . $cnt . '] ' . get_class($this) . ' :: ' . substr($template, strlen(LC_DIR_SKINS));
         \XLite\Module\XC\WebmasterKit\Core\Profiler::getInstance()->log($timePoint);
         $result['timePoint'] = $timePoint;
     }
     if (static::$profilerInfo['markTemplates']) {
         $template = substr($template, strlen(LC_DIR_SKINS));
         $markTplText = get_class($this) . ' : ' . $template . ' (' . $cnt . ')' . ($this->viewListName ? ' [\'' . $this->viewListName . '\' list child]' : '');
         echo '<!-- ' . $markTplText . ' {' . '{{ -->';
         $result['markTplText'] = $markTplText;
     }
     return $result;
 }