Configuration data is now being inserted as same as other data.
[core.git] / inc / classes / main / template / menu / class_MenuTemplateEngine.php
index e11548fb5f7b5bbf698f7b32c266cbc8d024988c..62997fa86258deb1507480cd99bc8a86ef558af2 100644 (file)
@@ -762,7 +762,6 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * Renders this menu entry, as every block all variables got overwritten
         * with data from next entry.
         *
-        * @todo        'anchor_href' may needs expanding with full URL
         * @return      void
         */
        private function renderMenuEntry () {
@@ -777,6 +776,12 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                        // Copy variable
                        $variableValue = $this->readVariable($variableName);
 
+                       // Is the key 'anchor-href'?
+                       if ($variableName == 'anchor-href') {
+                               // Expand variable with URL then
+                               $variableValue = '{?base_url?}/' . $variableValue;
+                       } // END - if
+
                        // ... into the instance
                        $templateInstance->assignVariable($variableName, $variableValue);
                } // END - foreach
@@ -828,6 +833,22 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                $this->menuEntries = array();
        }
 
+       /**
+        * "Getter" for menu content
+        *
+        * @return      $menuContent    Returned menu content
+        */
+       public function getMenuContent () {
+               // Implode menuBlocks
+               $menuContent = implode('', $this->menuBlocks);
+
+               // Clean variable
+               $this->menuBlocks = array();
+
+               // And return it
+               return $menuContent;
+       }
+
        /**
         * Getter for menu cache file (FQFN)
         *