示例#1
0
 protected function printTraceEntry($entry)
 {
     global $store_config;
     $templatesRoot = $store_config['files'] . 'templates';
     $file = substr($entry['file'], strlen($templatesRoot) + 1);
     $template = substr($file, strrpos($file, '/') + 2, -4);
     $idPath = substr($file, 0, -(strlen($template) + 6));
     $id = $this->getTemplateId($idPath);
     $language = substr($template, strrpos($template, '.') + 1);
     $subtype = substr($template, 0, strpos($template, '.', 2));
     $type = substr($template, 0, strpos($template, '.'));
     if (!isset($this->scope[$id])) {
         $this->scope[$id] = current(ar::get('/')->find('object.id=' . $id)->call('system.get.phtml'));
     }
     $object = $this->scope[$id];
     if (!isset($object->config->pinp[$subtype])) {
         $subtype = $type;
     }
     $template = substr($template, strlen($subtype) + 1, -(strlen($language) + 1));
     $path = $this->scope[$id]->path;
     $heleneTemplate = $path . $subtype . '::' . $template . '.' . $language;
     $options = [];
     if (!$object->data->config->templates[$subtype][$template][$language]) {
         $options[] = 'local';
     }
     if ($object->data->config->privatetemplates[$subtype][$template]) {
         $options[] = 'private';
     }
     if (count($options)) {
         $heleneTemplate .= '[' . join(',', $options) . ']';
     }
     $this->write("<div class=\"unity-trace-line\">");
     if (ar_pinp::exists('helene.template.html')) {
         $closeLink = true;
         $this->write("<a target=\"_blank\" href=\"helene.template.html?heleneTemplate=" . RawURLEncode($heleneTemplate) . "\">");
     }
     $this->write("<span class=\"unity-trace-path\" title=\"{$path}\">{$path}</span>:<span class=\"unity-trace-type\">{$type}</span>::<span class=\"unity-trace-template\">{$template}</span>");
     if ($language != 'any') {
         $this->write("(<span class=\"unity-trace-language\">{$language}</span>)");
     }
     if ($closeLink) {
         $this->write("</a>");
     }
     $this->write(" line <span class=\"unity-trace-line-nr\">{$entry['line']}</span>");
     $this->write("</div>");
 }