示例#1
0
 /**
  * Replaces the matched tags.
  *
  * @param	array	An array of matches (see preg_match_all)
  * @return	string
  */
 protected function _replace(&$matches)
 {
     static $rwEngine;
     include_once JPATH_ROOT . "/components/com_acctexp/acctexp.class.php";
     if (empty($rwEngine->rewrite)) {
         $user = JFactory::getUser();
         $rwEngine = new reWriteEngine();
         $metaUser = new metaUser($user->id);
         $request = new stdClass();
         $request->metaUser = $metaUser;
         $rwEngine->resolveRequest($request);
     }
     return $rwEngine->resolve($matches[1]);
 }
示例#2
0
 static function rewriteEngineRQ($content, $request, $metaUser = null, $subscriptionPlan = null, $invoice = null)
 {
     if (!is_object($request)) {
         $request = new stdClass();
     }
     if (!empty($metaUser)) {
         $request->metaUser = $metaUser;
     }
     if (!empty($subscriptionPlan)) {
         $request->plan = $subscriptionPlan;
     }
     if (!empty($invoice)) {
         $request->invoice = $invoice;
     }
     $rwEngine = new reWriteEngine();
     $rwEngine->resolveRequest($request);
     if (is_array($content)) {
         foreach ($content as $k => $v) {
             if (is_string($v)) {
                 $content[$k] = $rwEngine->resolve($v);
             }
         }
         return $content;
     } else {
         return $rwEngine->resolve($content);
     }
 }