]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/template/menu/class_MenuTemplateEngine.php
New XML nodes added
[core.git] / inc / classes / main / template / menu / class_MenuTemplateEngine.php
index 0c4f317ad3760cb3ae95e4135e679ddb201505cb..fdcaf207a81cf70a74892afa27fd279c5bb3bf35 100644 (file)
@@ -27,23 +27,33 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         */
        private $mainNodes = array(
                'block-list',
-               'header',
-               'entry-list',
-               'footer',
        );
 
        /**
         * Sub nodes in the XML tree
         */
        private $subNodes = array(
-               'block',
+               'entry-list',
+               'entry',
                'entries-content',
+               'header',
+               'footer',
+               'footer-id',
+               'footer-class',
+               'footer-text',
+               'block',
                'title',
-               'entry',
-               'anchor',
+               'title-id',
+               'title-class',
+               'title-text',
                'design',
                'text',
                'advert',
+               'anchor',
+               'anchor-id',
+               'anchor-text',
+               'anchor-title',
+               'anchor-href',
        );
 
        /**
@@ -206,13 +216,13 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                //* DEBUG: */ echo "START: &gt;".$element."&lt;<br />\n";
                if (in_array($element, $this->getMainNodes())) {
                        // Okay, main node found!
-                       $methodName = 'startMenu' . $this->convertToClassName($element);
+                       $methodName = 'start' . $this->convertToClassName($element);
 
                        // Set it
                        $this->setCurrMainNode($element);
                } elseif (in_array($element, $this->getSubNodes())) {
                        // Sub node found
-                       $methodName = 'startMenu' . $this->convertToClassName($element);
+                       $methodName = 'start' . $this->convertToClassName($element);
                } elseif ($element != 'menu') {
                        // Invalid node name found
                        throw new InvalidXmlNodeException(array($this, $element, $attributes), XmlParser::EXCEPTION_XML_NODE_UNKNOWN);
@@ -342,7 +352,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @param       $templateDepency        A template to load to satisfy depencies
         * @return      void
         */
-       private function startMenuEntries ($templateDepency = '') {
+       private function startEntryList ($templateDepency = '') {
                // Handle the depency template
                $this->handleTemplateDepency('entries', $templateDepency);
 
@@ -361,7 +371,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         *
         * @return      void
         */
-       private function finishEntries () {
+       private function finishEntryList () {
                // Load the header template for this page
                $this->getTemplateInstance()->loadCodeTemplate('menu_entries_end');
 
@@ -377,7 +387,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         *
         * @return      void
         */
-       private function startMenuHeader () {
+       private function startHeader () {
                // Do we have a template instance?
                if (is_null($this->getTemplateInstance())) {
                        // Init template instance for underlaying web templates
@@ -418,7 +428,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         *
         * @return      void
         */
-       private function startMenuFooter () {
+       private function startFooter () {
                // Do we have a template instance?
                if (is_null($this->getTemplateInstance())) {
                        // Init template instance for underlaying web templates
@@ -457,22 +467,10 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
        /**
         * Starts the menu property 'title'
         *
-        * @param       $id             Id of the menu
-        * @param       $class  The title to add to the menu
         * @return      void
         */
-       private function startMenuTitle ($id, $class) {
-               // Set id as current
-               $this->curr['id'] = $id;
-
-               // Load the title template for this page
-               $this->getTemplateInstance()->loadCodeTemplate('menu_title_' . $id . '_start');
-
-               // Set the variable group to page
-               $this->setVariableGroup('menu');
-
-               // Set its content in this template instance
-               $this->assignVariable('title_start_' . $this->curr['id'], $this->getTemplateInstance()->getRawTemplateData());
+       private function startTitle () {
+               $this->partialStub('Cleared due to XML rewrite.');
        }
 
        /**
@@ -481,14 +479,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @return      void
         */
        private function finishTitle () {
-               // Load the title template for this page
-               $this->getTemplateInstance()->loadCodeTemplate('menu_title_' . $this->curr['id'] . '_end');
-
-               // Set the variable group to page
-               $this->setVariableGroup('menu');
-
-               // Set its content in this template instance
-               $this->assignVariable('title_end_' . $this->curr['id'], $this->getTemplateInstance()->getRawTemplateData());
+               $this->partialStub('Cleared due to XML rewrite.');
        }
 
        /**
@@ -496,7 +487,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         *
         * @return      void
         */
-       private function startMenuText () {
+       private function startText () {
                // Do we have a template instance?
                if (is_null($this->getTemplateInstance())) {
                        // Init template instance for underlaying web templates
@@ -538,7 +529,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @param       $id             Id of the menu
         * @return      void
         */
-       private function startMenuEntry ($id) {
+       private function startEntry ($id) {
                // Set id as current
                $this->curr['entry_id'] = $id;
 
@@ -575,8 +566,8 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @param       $title  Link title of the anchor
         * @return      void
         */
-       private function startMenuAnchor ($id, $link, $title) {
-               $this->partialStub('id='.$id.',link='.$link.',title='.$title);
+       private function startAnchor () {
+               $this->partialStub('Please implement this method.');
        }
 
        /**