Пример #1
0
 /**
  *
  */
 protected function _otherthings()
 {
     // overlays
     // browser sniffing, because "&" should be escaped in a xul-overlay PI in gecko 1.9+
     $escape = false;
     if (preg_match('!^Mozilla/5.0 \\(.* rv:(\\d)\\.(\\d).*\\) Gecko/\\d+.*$!', $_SERVER["HTTP_USER_AGENT"], $m)) {
         if (version_compare($m[1] . '.' . $m[2], '1.9') >= 0) {
             $escape = true;
         }
     }
     if ($this->fetchOverlays) {
         $sel = new jSelectorTpl($this->bodyTpl);
         $eventresp = jEvent::notify('FetchXulOverlay', array('tpl' => $sel->toString()));
         foreach ($eventresp->getResponse() as $rep) {
             if (is_array($rep)) {
                 $this->_overlays[jUrl::get($rep[0], $rep[1])] = true;
             } elseif (is_string($rep)) {
                 $this->_overlays[jUrl::get($rep)] = true;
             }
         }
     }
     foreach ($this->_overlays as $src => $ok) {
         echo '<?xul-overlay href="', $escape ? htmlspecialchars($src) : $src, '" ?>', "\n";
     }
     $this->rootAttributes['title'] = $this->title;
 }
Пример #2
0
 /**
  * return the generated content from the given template
  * @param string $tpl template selector
  * @param string $outputtype the type of output (html, text etc..)
  * @param boolean $trusted  says if the template file is trusted or not
  * @param boolean $callMeta false if meta should not be called
  * @return string the generated content
  */
 public function fetch($tpl, $outputtype = '', $trusted = true, $callMeta = true)
 {
     $sel = new jSelectorTpl($tpl, $outputtype, $trusted);
     $tpl = $sel->toString();
     return $this->_fetch($tpl, $sel, $outputtype, $trusted, $callMeta);
 }
Пример #3
0
 /**
  * return the generated content from the given template
  * @param string $tpl template selector
  * @param string $outputtype the type of output (html, text etc..)
  * @param boolean $trusted  says if the template file is trusted or not
  * @param boolean $callMeta false if meta should not be called
  * @return string the generated content
  */
 public function fetch($tpl, $outputtype = '', $trusted = true, $callMeta = true)
 {
     $content = '';
     ob_start();
     try {
         #ifnot JTPL_STANDALONE
         $sel = new jSelectorTpl($tpl, $outputtype, $trusted);
         $tpl = $sel->toString();
         #endif
         $previousTpl = $this->_templateName;
         $this->_templateName = $tpl;
         $this->processedMeta[] = $tpl;
         $this->recursiveTpl[] = $tpl;
         #ifnot JTPL_STANDALONE
         $md = $this->getTemplate($sel, $outputtype, $trusted);
         #else
         $md = $this->getTemplate($tpl, $outputtype, $trusted);
         #endif
         if ($callMeta) {
             $fct = 'template_meta_' . $md;
             $fct($this);
         }
         $fct = 'template_' . $md;
         $fct($this);
         array_pop($this->recursiveTpl);
         $this->_templateName = $previousTpl;
         $content = ob_get_clean();
     } catch (Exception $e) {
         ob_end_clean();
         throw $e;
     }
     return $content;
 }