Updated 'core' + renamed 'main' -> 'classes'.
[hub.git] / application / hub / classes / template / class_
1 <?php
2 /**
3  * An ??? 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 - 2015 Hub 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 class Xml???TemplateEngine extends BaseXmlTemplateEngine implements CompileableTemplate, Registerable {
26         /**
27          * Protected constructor
28          *
29          * @return      void
30          */
31         protected function __construct () {
32                 // Call parent constructor
33                 parent::__construct(__CLASS__);
34         }
35
36         /**
37          * Creates an instance of the class TemplateEngine and prepares it for usage
38          *
39          * @return      $templateInstance               An instance of TemplateEngine
40          * @throws      BasePathIsEmptyException                If the provided $templateBasePath is empty
41          * @throws      InvalidBasePathStringException  If $templateBasePath is no string
42          * @throws      BasePathIsNoDirectoryException  If $templateBasePath is no
43          *                                                                                      directory or not found
44          * @throws      BasePathReadProtectedException  If $templateBasePath is
45          *                                                                                      read-protected
46          */
47         public static final function createXml???TemplateEngine () {
48                 // Get a new instance
49                 $templateInstance = new Xml???TemplateEngine();
50
51                 // Init template instannce
52                 $templateInstance->initXmlTemplateEngine('PREFIX', '!!!');
53
54                 // Return the prepared instance
55                 return $templateInstance;
56         }
57
58         /**
59          * Currently not used
60          *
61          * @param       $resource               XML parser resource (currently ignored)
62          * @param       $characters             Characters to handle
63          * @return      void
64          */
65         public function characterHandler ($resource, $characters) {
66                 // Trim all spaces away
67                 $characters = trim($characters);
68
69                 // Is this string empty?
70                 if (empty($characters)) {
71                         // Then skip it silently
72                         return false;
73                 } // END - if
74
75                 // Assign data with matching variable here
76                 parent::assignVariable($this->getStackInstance()->getNamed('!!!'), $characters);
77         }
78
79         /**
80          * Getter for cache file (FQFN)
81          *
82          * @return      $fqfn   Full-qualified file name of the menu cache
83          */
84         public function get???CacheFqfn () {
85                 $this->partialStub('Please implement this method.');
86         }
87
88         /**
89          * Starts the |||
90          *
91          * @return      void
92          */
93         protected function start??? () {
94                 // Push the node name on the stacker
95                 $this->getStackInstance()->pushNamed('!!!', '|||');
96         }
97
98         /**
99          * Finishes the |||
100          *
101          * @return      void
102          */
103         protected function finish??? () {
104                 // Pop the last entry
105                 $this->getStackInstance()->popNamed('!!!');
106         }
107 }
108
109 // [EOF]
110 ?>