class_ApplicationHelper.php

Go to the documentation of this file.
00001 <?php
00042 class ApplicationHelper extends BaseApplication implements ManageableApplication, Registerable {
00046         private $appVersion = "";
00047 
00051         private $appName = "";
00052 
00056         private $shortName = "";
00057 
00061         private $masterTemplate = "";
00062 
00066         private static $thisInstance = null;
00067 
00073         protected function __construct () {
00074                 // Call parent constructor
00075                 parent::__construct(__CLASS__);
00076         }
00077 
00083         public final static function getInstance () {
00084                 // Is the instance there?
00085                 if (is_null(self::$thisInstance)) {
00086                         self::$thisInstance = new ApplicationHelper();
00087                 }
00088 
00089                 // Return the instance
00090                 return self::$thisInstance;
00091         }
00092 
00098         public final function getAppVersion () {
00099                 return $this->appVersion;
00100         }
00101 
00108         public final function setAppVersion ($appVersion) {
00109                 // Cast and set it
00110                 $appVersion = (string) $appVersion;
00111                 $this->appVersion = $appVersion;
00112         }
00113 
00119         public final function getAppName () {
00120                 return $this->appName;
00121         }
00122 
00129         public final function setAppName ($appName) {
00130                 // Cast and set it
00131                 $appName = (string) $appName;
00132                 $this->appName = $appName;
00133         }
00134 
00140         public final function getAppShortName () {
00141                 return $this->shortName;
00142         }
00143 
00150         public final function setAppShortName ($shortName) {
00151                 // Cast and set it
00152                 $shortName = (string) $shortName;
00153                 $this->shortName = $shortName;
00154         }
00155 
00161         public final function getMasterTemplate () {
00162                 return $this->masterTemplate;
00163         }
00164 
00171         public final function entryPoint () {
00172                 // Get a prepared instance of ApplicationSelector
00173                 $selInstance = ApplicationSelector::createApplicationSelector(LanguageSystem::getInstance(), FileIoHandler::getInstance());
00174 
00175                 // Remove the ignore list from the object
00176                 $selInstance->removeDirIgnoreList();
00177 
00178                 // Next load all templates for the respective short app names
00179                 $selInstance->loadApplicationTemplates();
00180 
00181                 // Then load the selector's own template
00182                 $selInstance->loadSelectorTemplate();
00183 
00184                 // Insert all application templates
00185                 $selInstance->insertApplicationTemplates();
00186         }
00187 
00195         public function handleFatalMessages (array $messageList) {
00196                 die("<pre>".print_r($messageList, true)."</pre>");
00197         }
00198 
00205         public function assignExtraTemplateData (CompileableTemplate $templateInstance) {
00206                 // Assign charset
00207                 $templateInstance->assignConfigVariable('header_charset');
00208         }
00209 }
00210 
00211 // [EOF]
00212 ?>

Generated on Mon Dec 8 01:06:44 2008 for Ship-Simulator by  doxygen 1.5.6