]> git.mxchange.org Git - hub.git/blob - application/hub/main/template/entries/class_XmlRequestNodeListEntryTemplateEngine.php
0f88fc80cc3fa22c0269fa72fecc71c47965acd3
[hub.git] / application / hub / main / template / entries / class_XmlRequestNodeListEntryTemplateEngine.php
1 <?php
2 /**
3  * An RequestNodeListEntry template engine class for XML templates
4  *
5  * @author              Roland Haeder <webmaster@ship-simu.org>
6  * @version             0.0.0
7  * @copyright   Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
8  * @license             GNU GPL 3.0 or any newer version
9  * @link                http://www.ship-simu.org
10  * @todo                This template engine does not make use of setTemplateType()
11  *
12  * This program is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <http://www.gnu.org/licenses/>.
24  */
25 die('YOU NEED TO REPLACE RequestNodeListEntry, request_node_list_entry AND request-node-list-entry IN THIS CLASS BEFORE YOU CAN USE IT.');
26 class XmlRequestNodeListEntryTemplateEngine extends BaseXmlTemplateEngine implements CompileableTemplate, Registerable {
27         /**
28          * Protected constructor
29          *
30          * @return      void
31          */
32         protected function __construct () {
33                 // Call parent constructor
34                 parent::__construct(__CLASS__);
35         }
36
37         /**
38          * Creates an instance of the class TemplateEngine and prepares it for usage
39          *
40          * @return      $templateInstance               An instance of TemplateEngine
41          * @throws      BasePathIsEmptyException                If the provided $templateBasePath is empty
42          * @throws      InvalidBasePathStringException  If $templateBasePath is no string
43          * @throws      BasePathIsNoDirectoryException  If $templateBasePath is no
44          *                                                                                      directory or not found
45          * @throws      BasePathReadProtectedException  If $templateBasePath is
46          *                                                                                      read-protected
47          */
48         public static final function createXmlRequestNodeListEntryTemplateEngine () {
49                 // Get a new instance
50                 $templateInstance = new XmlRequestNodeListEntryTemplateEngine();
51
52                 // Init template instannce
53                 $templateInstance->initXmlTemplateEngine('node', 'request_node_list_entry');
54
55                 // Return the prepared instance
56                 return $templateInstance;
57         }
58
59         /**
60          * Currently not used
61          *
62          * @param       $resource               XML parser resource (currently ignored)
63          * @param       $characters             Characters to handle
64          * @return      void
65          * @todo        Find something useful with this!
66          */
67         public function characterHandler ($resource, $characters) {
68                 // Trim all spaces away
69                 $characters = trim($characters);
70
71                 // Is this string empty?
72                 if (empty($characters)) {
73                         // Then skip it silently
74                         return false;
75                 } // END - if
76
77                 // Assign data with matching variable here
78                 parent::assignVariable($this->getStackerInstance()->getNamed('node_request_node_list_entry'), $characters);
79         }
80
81         /**
82          * Getter for cache file (FQFN)
83          *
84          * @return      $fqfn   Full-qualified file name of the menu cache
85          */
86         public function getRequestNodeListEntryCacheFqfn () {
87                 $this->partialStub('Please implement this method.');
88         }
89
90         /**
91          * Starts the request-node-list-entry
92          *
93          * @return      void
94          */
95         protected function startRequestNodeListEntry () {
96                 // Push the node name on the stacker
97                 $this->getStackerInstance()->pushNamed('node_request_node_list_entry', 'request-node-list-entry');
98         }
99
100         /**
101          * Finishes the request-node-list-entry
102          *
103          * @return      void
104          */
105         protected function finishRequestNodeListEntry () {
106                 // Pop the last entry
107                 $this->getStackerInstance()->popNamed('node_request_node_list_entry');
108         }
109 }
110
111 // [EOF]
112 ?>