3 * An RequestNodeListEntry template engine class for XML templates
5 * @author Roland Haeder <webmaster@shipsimu.org>
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.shipsimu.org
10 * @todo This template engine does not make use of setTemplateType()
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.
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.
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/>.
25 class XmlRequestNodeListEntryTemplateEngine extends BaseXmlTemplateEngine implements CompileableTemplate, Registerable {
27 * Protected constructor
31 protected function __construct () {
32 // Call parent constructor
33 parent::__construct(__CLASS__);
37 * Creates an instance of the class TemplateEngine and prepares it for usage
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
47 public static final function createXmlRequestNodeListEntryTemplateEngine () {
49 $templateInstance = new XmlRequestNodeListEntryTemplateEngine();
51 // Init template instannce
52 $templateInstance->initXmlTemplateEngine('node', 'request_node_list_entry');
54 // Return the prepared instance
55 return $templateInstance;
61 * @param $resource XML parser resource (currently ignored)
62 * @param $characters Characters to handle
64 * @todo Find something useful with this!
66 public function characterHandler ($resource, $characters) {
67 // Trim all spaces away
68 $characters = trim($characters);
70 // Is this string empty?
71 if (empty($characters)) {
72 // Then skip it silently
76 // Assign data with matching variable here
77 parent::assignVariable($this->getStackInstance()->getNamed('node_request_node_list_entry'), $characters);
81 * Getter for cache file (FQFN)
83 * @return $fqfn Full-qualified file name of the menu cache
85 public function getRequestNodeListEntryCacheFqfn () {
86 $this->partialStub('Please implement this method.');
90 * Starts the request-node-list-entry
94 protected function startRequestNodeListEntry () {
95 // Push the node name on the stacker
96 $this->getStackInstance()->pushNamed('node_request_node_list_entry', 'request-node-list-entry');
100 * Finishes the request-node-list-entry
104 protected function finishRequestNodeListEntry () {
105 // Pop the last entry
106 $this->getStackInstance()->popNamed('node_request_node_list_entry');