From: Roland Häder Date: Sat, 1 Nov 2008 20:29:25 +0000 (+0000) Subject: Code cleanup in application selector. TODO: Application 'admin' needs to be excluded... X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=commitdiff_plain;h=4a86a97464975305c05d2771abfe31586bc37055 Code cleanup in application selector. TODO: Application 'admin' needs to be excluded from app list --- diff --git a/.gitattributes b/.gitattributes index acf6931..e7f65a8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -48,7 +48,7 @@ application/admin/templates/de/emails/.htaccess -text application/admin/templates/de/emails/text_resend_link.tpl -text application/admin/templates/de/html/.htaccess -text application/admin/templates/de/html/nav_advert.tpl -text -application/admin/templates/de/html/selector_ship-simu.tpl -text +application/admin/templates/de/html/selector_admin.tpl -text application/admin/templates/images/.htaccess -text application/admin/templates/images/_cache/.htaccess -text application/admin/templates/images/de/.htaccess -text diff --git a/application/admin/templates/de/html/selector_admin.tpl b/application/admin/templates/de/html/selector_admin.tpl new file mode 100644 index 0000000..36f9cd1 --- /dev/null +++ b/application/admin/templates/de/html/selector_admin.tpl @@ -0,0 +1,3 @@ +
+ TODO: Diese Anwendung sollte eigentlich nicht auswählbar sein. +
diff --git a/application/admin/templates/de/html/selector_ship-simu.tpl b/application/admin/templates/de/html/selector_ship-simu.tpl deleted file mode 100644 index b96640e..0000000 --- a/application/admin/templates/de/html/selector_ship-simu.tpl +++ /dev/null @@ -1,17 +0,0 @@ -
-
- Gründen Sie eine virtuelle Reederei an den bedeutestens - Welthäfen! Oder treten Sie einer Reederei als Angestellter bei und - arbeiten Sie sich bis in die Chef-Etagge hoch! -
- -
- Oder fangen Sie als Matrose auf einem Passagierschiff (virtuell) an zu - arbeiten und werden Sie nach wenigen Kreuzfahrten bald Kapitän! -
- -
- Oder buchen Sie eine virtuelle Kreuzfahrt durch die bekannten Meeren in - {!POINTS!} in einer Luxus-Suite! -
-
diff --git a/application/selector/class_ApplicationSelector.php b/application/selector/class_ApplicationSelector.php index f52b50a..3c4b256 100644 --- a/application/selector/class_ApplicationSelector.php +++ b/application/selector/class_ApplicationSelector.php @@ -35,11 +35,6 @@ class ApplicationSelector extends BaseFrameworkSystem { */ private $loadedTemplates = null; - /** - * The application selector's own template engine handler - */ - private $selectorTplEngine = null; - /** * A list of items we shall ignore while reading from directories */ @@ -124,29 +119,9 @@ class ApplicationSelector extends BaseFrameworkSystem { // Add the current instance to the list $this->foundApps->append($app); - } // END - if ((is_file(... } - /** - * Setter for the selector's template engine instance - * - * @param $templateInstance An instance of TemplateEngine - * @return void - */ - private final function setSelectorTemplateEngine (CompileableTemplate $templateInstance) { - $this->selectorTplEngine = $templateInstance; - } - - /** - * Getter for the selector's template engine instance - * - * @return $selectTplEngine The selector's template engine - */ - private final function getSelectorTemplateEngine () { - return $this->selectorTplEngine; - } - /** * Getter for the $loadedTemplates array object * @@ -175,8 +150,7 @@ class ApplicationSelector extends BaseFrameworkSystem { */ public function addDirIgnoreList ($ignoreItem) { // Cast and add it - $ignoreItem = (string) $ignoreItem; - $this->dirIgnoreList[] = $ignoreItem; + $this->dirIgnoreList[] = (string) $ignoreItem; } /** @@ -195,10 +169,6 @@ class ApplicationSelector extends BaseFrameworkSystem { // Get a directory pointer for the application path $dirInstance = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($appBasePath); - // Backup and remove the 'app' from local name space - /*$appBackup = $app; - unset($app);*/ - // Read all directories&files except some parts while ($appName = $dirInstance->readDirectoryExcept($this->dirIgnoreList)) { // Generate FQFN for the application name (or better directory name) @@ -217,9 +187,6 @@ class ApplicationSelector extends BaseFrameworkSystem { // Close directory pointer $dirInstance->closeDirectory(); - - // Restore old 'app' from backup - //$app = $appBackup; } /** @@ -275,8 +242,8 @@ class ApplicationSelector extends BaseFrameworkSystem { // Load the selector's template $templateInstance->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_main_tpl')); - // Now store it in the class - $this->setSelectorTemplateEngine($templateInstance); + // Now store it in the class, we need this later on final compilation of available applications + $this->setTemplateInstance($templateInstance); } /** @@ -289,6 +256,7 @@ class ApplicationSelector extends BaseFrameworkSystem { * unexpected count of elements * @throws MissingArrayElementsException If $curr is missing expected * array elements + * @todo Finish handling all applications here */ public function insertApplicationTemplates () { // First prepare the instance @@ -317,8 +285,9 @@ class ApplicationSelector extends BaseFrameworkSystem { // Expected entries missing throw new MissingArrayElementsException(array($this, "curr", array("template_class", "app_instance")), self::EXCEPTION_ARRAY_ELEMENTS_MISSING); } - die("
".print_r($curr, true)."
"); + // Debug output + die(__METHOD__."()
".print_r($curr, true)."
"); } // END - for } } diff --git a/application/selector/starter.php b/application/selector/starter.php index 7fd2509..dde690e 100644 --- a/application/selector/starter.php +++ b/application/selector/starter.php @@ -50,7 +50,8 @@ if ((empty($app)) || (is_null($app))) { try { // Call user function call_user_func_array(array($app, FrameworkConfiguration::getInstance()->readConfig('entry_method')), array()); -} catch (FrameworkException $e) { +} catch (FrameworkException $e) { + die($e->getMessage()); ApplicationEntryPoint::app_die(sprintf("[Main:] The application %s has been terminated due to a thrown exception: %s - %s", $application, $e->__toString(),