فهرست منبع

ZF-8917: Fixed problems with the context-awereness.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20631 44c647ce-9c0f-0410-b52a-842ac1e357ba
kokx 16 سال پیش
والد
کامیت
bccd19014b
1فایلهای تغییر یافته به همراه31 افزوده شده و 26 حذف شده
  1. 31 26
      library/Zend/Markup/Renderer/RendererAbstract.php

+ 31 - 26
library/Zend/Markup/Renderer/RendererAbstract.php

@@ -295,19 +295,6 @@ abstract class Zend_Markup_Renderer_RendererAbstract
     {
         $return    = '';
 
-        // save old values to reset them after the work is done
-        $oldFilter = $this->_filter;
-        $oldGroup  = $this->_group;
-
-        // check filter and group usage in this tag
-        if (isset($this->_markups[$token->getName()])) {
-            $this->_filter = $this->getFilter($token->getName());
-
-            if ($group = $this->_getGroup($token)) {
-                $this->_group = $group;
-            }
-        }
-
         $this->_token = $token;
 
         // if this tag has children, execute them
@@ -317,10 +304,6 @@ abstract class Zend_Markup_Renderer_RendererAbstract
             }
         }
 
-        // reset to the old values
-        $this->_filter = $oldFilter;
-        $this->_group  = $oldGroup;
-
         return $return;
     }
 
@@ -378,8 +361,8 @@ abstract class Zend_Markup_Renderer_RendererAbstract
 
         // check for the context
         if (is_array($markup) && !in_array($markup['group'], $this->_groups[$this->_group])) {
-            $oldToken  = $this->_token;
-            $return    = $this->_filter($token->getTag()) . $this->_render($token) . $token->getStopper();
+            $oldToken = $this->_token;
+            $return   = $this->_filter($token->getTag()) . $this->_render($token) . $token->getStopper();
             $this->_token = $oldToken;
             return $return;
         }
@@ -390,6 +373,19 @@ abstract class Zend_Markup_Renderer_RendererAbstract
             $this->_markups[$name]['filter'] = $this->getDefaultFilter();
         }
 
+        // save old values to reset them after the work is done
+        $oldFilter = $this->_filter;
+        $oldGroup  = $this->_group;
+
+        $return = '';
+
+        // set the filter and the group
+        $this->_filter = $this->getFilter($name);
+
+        if ($group = $this->_getGroup($token)) {
+            $this->_group = $group;
+        }
+
         // callback
         if (is_array($markup) && ($markup['type'] & self::TYPE_CALLBACK)) {
             // load the callback if the tag doesn't exist
@@ -408,15 +404,24 @@ abstract class Zend_Markup_Renderer_RendererAbstract
                 }
             }
             if ($markup['type'] && !$empty) {
-                return $markup['callback']->convert($token, $this->_render($token));
+                $return = $markup['callback']->convert($token, $this->_render($token));
+            } else {
+                $return = $markup['callback']->convert($token, null);
+            }
+        } else {
+            // replace
+            if ($markup['type'] && !$empty) {
+                $return = $this->_executeReplace($token, $markup);
+            } else {
+                $return = $this->_executeSingleReplace($token, $markup);
             }
-            return $markup['callback']->convert($token, null);
-        }
-        // replace
-        if ($markup['type'] && !$empty) {
-            return $this->_executeReplace($token, $markup);
         }
-        return $this->_executeSingleReplace($token, $markup);
+
+        // reset to the old values
+        $this->_filter = $oldFilter;
+        $this->_group  = $oldGroup;
+
+        return $return;
     }
 
     /**