示例#1
0
 /**
  * Trying to process MODX pages with Fenom template engine
  *
  * @param string $parentTag
  * @param string $content
  * @param bool $processUncacheable
  * @param bool $removeUnprocessed
  * @param string $prefix
  * @param string $suffix
  * @param array $tokens
  * @param int $depth
  *
  * @return int
  */
 public function processElementTags($parentTag, &$content, $processUncacheable = false, $removeUnprocessed = false, $prefix = "[[", $suffix = "]]", $tokens = array(), $depth = 0)
 {
     if (is_string($content) && empty($parentTag) && $processUncacheable && !empty($this->pdoTools->config['useFenomParser'])) {
         $content = $this->pdoTools->fenom($content, $this->modx->placeholders);
     }
     return parent::processElementTags($parentTag, $content, $processUncacheable, $removeUnprocessed, $prefix, $suffix, $tokens, $depth);
 }
 /**
  * Trying to process MODX pages with Fenom template engine
  *
  * @param string $parentTag
  * @param string $content
  * @param bool $processUncacheable
  * @param bool $removeUnprocessed
  * @param string $prefix
  * @param string $suffix
  * @param array $tokens
  * @param int $depth
  *
  * @return int
  */
 public function processElementTags($parentTag, &$content, $processUncacheable = false, $removeUnprocessed = false, $prefix = "[[", $suffix = "]]", $tokens = array(), $depth = 0)
 {
     if (is_string($content) && $processUncacheable && !empty($this->pdoTools->config['useFenomParser']) && preg_match('#\\{(\\$|\\/|\\w+\\s)#', $content)) {
         $content = $this->pdoTools->fenom($content, $this->modx->placeholders);
         if (!empty($this->modx->resource) && is_object($this->modx->resource)) {
             $this->modx->resource->_jscripts = $this->modx->jscripts;
             $this->modx->resource->_sjscripts = $this->modx->sjscripts;
             $this->modx->resource->_loadedjscripts = $this->modx->loadedjscripts;
         }
     }
     return parent::processElementTags($parentTag, $content, $processUncacheable, $removeUnprocessed, $prefix, $suffix, $tokens, $depth);
 }
示例#3
0
 /**
  * @param string $parentTag
  * @param string $content
  * @param bool   $processUncacheable
  * @param bool   $removeUnprocessed
  * @param string $prefix
  * @param string $suffix
  * @param array  $tokens
  * @param int    $depth
  *
  * @return int
  */
 public function processElementTags($parentTag, &$content, $processUncacheable = false, $removeUnprocessed = false, $prefix = "[[", $suffix = "]]", $tokens = array(), $depth = 0)
 {
     if (is_string($content) and $processUncacheable and preg_match('#\\{.*\\}#', $content)) {
         $content = $this->twiggy->process($content, $this->modx->placeholders);
     }
     if ($processUncacheable and $removeUnprocessed and !empty($this->modx->resource) and is_object($this->modx->resource)) {
         if ($this->modx->resource->get('_jscripts')) {
             $this->modx->jscripts = $this->modx->resource->get('_jscripts');
         }
     }
     return parent::processElementTags($parentTag, $content, $processUncacheable, $removeUnprocessed, $prefix, $suffix, $tokens, $depth);
 }
示例#4
0
    /**
     * Adds the legacy tag translation and legacy OnParseDocument event support.
     */
    public function processElementTags($parentTag, & $content, $processUncacheable= false, $removeUnprocessed= false, $prefix= "[[", $suffix= "]]", $tokens= array (), $echo= false) {
        // invoke OnParseDocument event
        $this->modx->documentOutput = $content;      // store source code so plugins can
        $this->modx->invokeEvent('OnParseDocument');    // work on it via $modx->documentOutput
        $content = $this->modx->documentOutput;
        $ignoretokens= array ();
//        if (!$processUncacheable) {
//            $ignoretokens[]= '+';
//            $ignoretokens[]= '++';
//        }
//        if (!$processUncacheable || ($processUncacheable && !$removeUnprocessed)) {
//            $ignoretokens[]= '!';
//        }
        while ($this->translate($content, $ignoretokens, $echo)) {}
        return parent :: processElementTags($parentTag, $content, $processUncacheable, $removeUnprocessed, $prefix, $suffix, $tokens);
    }