application/ship-simu/starter.php -text
application/ship-simu/templates/.htaccess -text
application/ship-simu/templates/de/.htaccess -text
+application/ship-simu/templates/de/code/footer.ctp -text
application/ship-simu/templates/de/code/shipsimu_main.ctp -text
application/ship-simu/templates/de/html/.htaccess -text
application/ship-simu/templates/de/html/home.tpl -text
+application/ship-simu/templates/de/html/nav_advert.tpl -text
application/ship-simu/templates/de/html/selector_ship-simu.tpl -text
db/.htaccess -text
devel/.htaccess -text
{?header:title=[WELCOME_APPLICATION_SELECTOR]?}
-{?navigation:nav_row=home;imprint;contact?}
+{?navigation?}
<div id="main_header">
[HEADER_APPLICATION_SELECTOR]
--- /dev/null
+</div> <!-- masterbox //-->
+
+</body>
+</html>
{?header:title=[WELCOME_SHIP_SIMU]?}
+<div id="main_header">
+[HEADER_SHIP_SIMU]
+</div>
+
<div id="navigation">
-{?navigation:nav_row=home;imprint;contact?}
+{?navigation?}
</div>
-<div id="main_header">
- [HEADER_SHIP_SIMU]
+<div id="advert">
+{?nav_advert?}
</div>
<div id="main_content">
- {?content?}
+{?content?}
</div>
<div id="main_footer">
- [FOOTER_SHIP_SIMU]
+[FOOTER_SHIP_SIMU]
</div>
-{?footer_msg:footer_msg=[FOOTER_SHIP_SIMU]?}
+{?footer?}
--- /dev/null
+<!-- Put your ads code here which shall be shown below the navigation //-->
// Return the prepared instance
return $tplEngine;
}
+
+ /**
+ * Debugs this instance by putting out it's full content
+ *
+ * @return void
+ */
+ public final function debugInstance () {
+ // Generate the output
+ $content = "<pre>".trim(print_r($this, true))."</pre>";
+
+ // Output it
+ ApplicationEntryPoint::app_die("<strong>Debug output:</strong>".$content);
+ }
}
// [EOF]
));
// Run it
- @eval($eval);
+ eval($eval);
// Add this item to the container list
$containerInstance->append(array(
private function addVariable ($var, $value) {
// Add it to the stack
$this->varStack->append(array(
- 'name' => $var,
- 'value' => $value
+ 'name' => trim($var),
+ 'value' => trim($value)
));
}
if ((substr($varMatches[2][$key], 0, 1) == "\"") && (substr($varMatches[2][$key], -1, 1) == "\"")) {
// Free string detected! Which we can assign directly
$this->assignVariable($var, $varMatches[3][$key]);
- } else {
+ } elseif (!empty($varMatches[2][$key])) {
// Non-string found so we need some deeper analysis...
// @TODO Unfinished work or don't die here.
die("Deeper analysis not yet implemented!");
} // END - if (count($this->loadedRawData) ...
}
+ /**
+ * Inserts all raw templates into their respective variables
+ *
+ * @return void
+ */
+ private function insertRawTemplates () {
+ // Load all templates
+ foreach ($this->rawTemplates as $template=>$content) {
+ // Set the template as a variable with the content
+ $this->assignVariable($template, $content);
+ }
+ }
+
/**
* Getter for raw template data
*
throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->readConfig("code_template_type")), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
}
- // Get the raw data. Thanks to Flobee(R) for given me a hint using the
- // modifier "m" in regular expressions. I had implemented a regex here
- // like this: (\n|\r)
+ // Get the raw data.
$rawData = $this->getRawTemplateData();
// Remove double spaces and trim leading/trailing spaces
//
// The main analysis
$this->analyzeTemplate($templateMatches);
+ $this->debugInstance();
// Compile raw template data
$this->compileRawTemplateData($templateMatches);
// Are some raw templates found and loaded?
if (count($this->rawTemplates) > 0) {
- die("NOT YET IMPLEMENTED");
+ // Insert all raw templates
+ $this->insertRawTemplates();
}
+
} // END - if($templateMatches ...
}
break;
default: // Unknown type found
+ // Construct message
+ $msg = sprintf("[%s:] Unknown/unsupported template type <strong>%s</strong> detected.",
+ $this->__toString(),
+ $this->getTemplateType()
+ );
+
if ((is_object($this->getDebugInstance())) && (method_exists($this->getDebugInstance(), 'output'))) {
// Use debug output handler
- $this->getDebugInstance()->output(sprintf("[%s:] Unbekannter Template-Typ <strong>%s</strong> erkannt.",
- $this->__toString(),
- $this->getTemplateType()
- ));
+ $this->getDebugInstance()->output($msg);
die();
} else {
// Put directly out
// DO NOT REWRITE THIS TO app_die() !!!
- die(sprintf("[%s:] Unbekannter Template-Typ <strong>%s</strong> erkannt.",
- $this->__toString(),
- $this->getTemplateType()
- ));
+ die($msg);
}
break;
}
);
// Run the code
- @eval($eval);
+ eval($eval);
}
// Return the requested instance
);
// Run the constructed name
- @eval($eval);
+ eval($eval);
// Was this successfull?
if ((is_object($debuggerClass)) && (method_exists($debuggerClass, "outputStream"))) {
* But good little boys and girls would always initialize their variables... ;-)
*
* @author Roland Haeder <webmaster@mxchange.org>
- * @version 0.3.0
+ * @version 0.0.0
* @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software
* @license GNU GPL 3.0 or any newer version
- * @link http://www.mxchange.org
+ * @link http://www.ship-simu.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class ApplicationEntryPoint {
/**
* @return void
*/
public static function app_die ($message = "") {
+ // Is this method already called?
+ if (defined('EMERGENCY_EXIT_CALLED')) {
+ // Then output the text directly
+ die($message);
+ }
+
+ // This method shall not be called twice
+ define('EMERGENCY_EXIT_CALLED', true);
+
// Is a message set?
if (empty($message)) {
// No message provided
));
}
- // Assign message
+ // Backtrace holen und aufbereiten
+ $backtraceArray = debug_backtrace();
+ $backtrace = "";
+ foreach ($backtraceArray as $key=>$trace) {
+ if (!isset($trace['file'])) $trace['file'] = __FILE__;
+ if (!isset($trace['line'])) $trace['line'] = 5;
+ if (!isset($trace['args'])) $trace['args'] = array();
+ $backtrace .= "<span class=\"backtrace_file\">".basename($trace['file'])."</span>:".$trace['line'].", <span class=\"backtrace_function\">".$trace['function']."(".count($trace['args']).")</span><br />";
+ }
+
+ // Assign variables
$tplEngine->assignVariable("message", $message);
+ $tplEngine->assignVariable("backtrace", $backtrace);
// Load the template
$tplEngine->loadCodeTemplate("emergency_exit");
exit();
} else {
// Output message and die
- die(sprintf("[Main:] Emergency exit reached: <strong>%s</strong>",
+ die(sprintf("[Main:] Emergency exit reached: <span class=\"emergency_span\">%s</span>",
$message
));
}
{?navigation:nav_row=home;imprint;contact?}
- <div class="emergency_exit message_box">
+ <div id="emergency_exit message_box">
$content[message]
</div>
- <div class="emergency_exit backtrace_box">
- <div class="backtrace_header">
+ <div id="emergency_exit backtrace_box">
+ <div id="backtrace_header">
Backtrace:
</div>
- <div class="backtrace_content">
+ <div id="backtrace_content">
$content[backtrace]
</div>
</div>
- <div class="footer_message message_box">
+ <div id="footer_message message_box">
$content[footer_msg]
</div>
</head>
<body>
-<div class="masterbox">
+<div id="masterbox">