application/ship-simu/loader.php -text
application/ship-simu/main/.htaccess -text
application/ship-simu/main/actions/.htaccess -text
-application/ship-simu/main/actions/class_ShipSimuLoginAction.php -text
-application/ship-simu/main/actions/class_ShipSimuProfileAction.php -text
+application/ship-simu/main/actions/ship-simu/.htaccess -text
+application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php -text
+application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php -text
+application/ship-simu/main/actions/web/.htaccess -text
+application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php -text
application/ship-simu/main/class_ -text
application/ship-simu/main/class_BasePersonell.php -text
application/ship-simu/main/class_BaseSimulator.php -text
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/action_login_company.ctp -text
application/ship-simu/templates/de/code/action_login_logout.ctp -text
application/ship-simu/templates/de/code/action_login_profile.ctp -text
application/ship-simu/templates/de/code/action_login_status_problem.ctp -text
/**
* Create a prepared instance of ApplicationSelector
*
- * @param $langInstance The language sub-system: LanguageSystem
- * @param $fileIOInstance The file I/O instance
- * @return $selInstance An instance of ApplicationSelector
+ * @param $langInstance The language sub-system: LanguageSystem
+ * @param $fileIOInstance The file I/O instance
+ * @return $selInstance An instance of ApplicationSelector
*/
public final static function createApplicationSelector (ManageableLanguage $langInstance, FileIoHandler $fileIOInstance) {
// Get a new instance
* Load the init.php script of an application and append the application
* instance to $foundApps
*
- * @param $initScript The FQFN of init.php
- * @param $appName The application's Uni* name
+ * @param $initScript The FQFN of init.php
+ * @param $appName The application's Uni* name
* @return void
*/
private function loadInitScript ($initScript, $appName) {
/**
* Setter for the selector's template engine instance
*
- * @param $tplEngine An instance of TemplateEngine
+ * @param $templateInstance An instance of TemplateEngine
+ * @return void
*/
- private final function setSelectorTemplateEngine (CompileableTemplate $tplEngine) {
- $this->selectorTplEngine = $tplEngine;
+ private final function setSelectorTemplateEngine (CompileableTemplate $templateInstance) {
+ $this->selectorTplEngine = $templateInstance;
}
/**
}
/**
- * Method for compatiblity with prepareTemplateEngine()
+ * Method for compatiblity with prepareTemplateInstance()
*
* @return $shortName This selector's short name
*/
$appInstance = $idx->current();
// Prepare the template engine for the current template
- $tplEngine = $this->prepareTemplateEngine($appInstance);
+ $templateInstance = $this->prepareTemplateInstance($appInstance);
// Try to load the web template
- $tplEngine->loadWebTemplate(sprintf("%s_%s",
+ $templateInstance->loadWebTemplate(sprintf("%s_%s",
$this->getConfigInstance()->readConfig('tpl_selector_prefix'),
strtolower($appInstance->getAppShortName())
));
// Remember this template and the application for later usage
$this->loadedTemplates->append(array(
- 'template_class' => $tplEngine,
+ 'template_class' => $templateInstance,
'app_instance' => $appInstance
));
}
*/
public function loadSelectorTemplate () {
// Prepare the template engine
- $tplEngine = $this->prepareTemplateEngine($this);
+ $templateInstance = $this->prepareTemplateInstance($this);
// Load the selector's template
- $tplEngine->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_main_tpl'));
+ $templateInstance->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_main_tpl'));
// Now store it in the class
- $this->setSelectorTemplateEngine($tplEngine);
+ $this->setSelectorTemplateEngine($templateInstance);
}
/**
*/
public function insertApplicationTemplates () {
// First prepare the instance
- $tplEngine = $this->prepareTemplateEngine($this);
+ $templateInstance = $this->prepareTemplateInstance($this);
// Load template which shall later hold all application templates
- $tplEngine->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_apps_tpl'));
+ $templateInstance->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_apps_tpl'));
// Add all loaded application templates together
$dummy = "";
+++ /dev/null
-<?php
-/**
- * An action class for the login welcome page
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @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.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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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/>.
- */
-class ShipSimuLoginAction extends BaseAction implements PerformableAction {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
-
- // Set description
- $this->setObjectDescription("Login welcome action");
-
- // Generate unique key
- $this->generateUniqueId();
- }
-
- /**
- * Creates an instance of this action
- *
- * @return $actionInstance An instance of this action class
- */
- public final static function createShipSimuLoginAction () {
- // Get a new instance
- $actionInstance = new ShipSimuLoginAction();
-
- // Return the instance
- return $actionInstance;
- }
-
- /**
- * Executes the command with given request and response objects
- *
- * @param $requestInstance An instance of a class with an Requestable interface
- * @param $responseInstance An instance of a class with an Responseable interface
- * @return void
- * @todo Maybe we need to do something later here
- */
- public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- }
-}
-
-// [EOF]
-?>
+++ /dev/null
-<?php
-/**
- * An action class for the profile page
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @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.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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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/>.
- */
-class ShipSimuProfileAction extends BaseAction implements PerformableAction {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
-
- // Set description
- $this->setObjectDescription("Profile action");
-
- // Generate unique key
- $this->generateUniqueId();
- }
-
- /**
- * Creates an instance of this action
- *
- * @return $actionInstance An instance of this action class
- */
- public final static function createShipSimuProfileAction () {
- // Get a new instance
- $actionInstance = new ShipSimuProfileAction();
-
- // Return the instance
- return $actionInstance;
- }
-
- /**
- * Executes the command with given request and response objects
- *
- * @param $requestInstance An instance of a class with an Requestable interface
- * @param $responseInstance An instance of a class with an Responseable interface
- * @return void
- */
- public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- /* @TODO Maybe we need to do something later here */
- }
-}
-
-// [EOF]
-?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An action class for the login welcome page
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @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.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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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/>.
+ */
+class ShipSimuLoginAction extends BaseAction implements PerformableAction {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set description
+ $this->setObjectDescription("Login welcome action");
+
+ // Generate unique key
+ $this->generateUniqueId();
+ }
+
+ /**
+ * Creates an instance of this action
+ *
+ * @return $actionInstance An instance of this action class
+ */
+ public final static function createShipSimuLoginAction () {
+ // Get a new instance
+ $actionInstance = new ShipSimuLoginAction();
+
+ // Return the instance
+ return $actionInstance;
+ }
+
+ /**
+ * Executes the command with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @todo Maybe we need to do something later here
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * An action class for the profile page
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @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.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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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/>.
+ */
+class ShipSimuProfileAction extends BaseAction implements PerformableAction {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set description
+ $this->setObjectDescription("Profile action");
+
+ // Generate unique key
+ $this->generateUniqueId();
+ }
+
+ /**
+ * Creates an instance of this action
+ *
+ * @return $actionInstance An instance of this action class
+ */
+ public final static function createShipSimuProfileAction () {
+ // Get a new instance
+ $actionInstance = new ShipSimuProfileAction();
+
+ // Return the instance
+ return $actionInstance;
+ }
+
+ /**
+ * Executes the command with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ /* @TODO Maybe we need to do something later here */
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An action for shipping company page
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @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.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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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/>.
+ */
+class WebLoginCompanyAction extends BaseAction implements Commandable, Registerable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set description
+ $this->setObjectDescription("Shipping comany action");
+
+ // Generate unique key
+ $this->generateUniqueId();
+ }
+
+ /**
+ * Creates an instance of this action
+ *
+ * @param $resolverInstance An instance of an action resolver
+ * @return $actionInstance An instance of this action class
+ */
+ public final static function createWebLoginCompanyAction (ActionResolver $resolverInstance) {
+ // Get a new instance
+ $actionInstance = new WebLoginCompanyAction();
+
+ // Set the resolver instance
+ $actionInstance->setResolverInstance($resolverInstance);
+
+ // Return the instance
+ return $actionInstance;
+ }
+
+ /**
+ * Executes the command with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ $this->partialStub("Maybe add fetching company list here.");
+ }
+
+ /**
+ * Adds extra filters to the given controller instance
+ *
+ * @param $controllerInstance A controller instance
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @return void
+ */
+ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+ // Add user status filter here
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class'));
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<div class="table_header" id="list_company_header">
+ Auflistung der Reedereien, an denenen du dich beteiligst:
+</div>
+
+<div class="table_list">
+ {?company_list?}
+</div>
+
+<div class="table_footer">
+ [<a href="$config[base_url]/index.php?app=ship-simu&page=login_area&action=new_company" title="Hier kannst du mit ausreichend Guthaben eine neue Reederei gründen.">Neue Reederei gründen</a>] -
+ [<a href="$config[base_url]/index.php?app=ship-simu&page=login_area&action=list_companies" title="Wenn du dich bei einer Reederei bewerben willst, versuche mal hier dein Glück.">Reedereien auflisten</a>] -
+ [<a href="$config[base_url]/index.php?app=ship-simu&page=login_area&action=search_companies" title="Suche hier direkt nach einer Reederei anhand des Namens oder Firmenkürzels.">Reederei suchen</a>]
+</div>
*
* @param $appInstance An application helper instance or
* null if we shall use the default
- * @return $tplEngine The template engine instance
+ * @return $templateInstance The template engine instance
* @throws NullPointerException If the template engine could not
* be initialized
- * @throws UnsupportedTemplateEngineException If $tplEngine is an
+ * @throws UnsupportedTemplateEngineException If $templateInstance is an
* unsupported template engine
* @throws MissingLanguageHandlerException If the language sub-system
* is not yet initialized
* @throws NullPointerException If the discovered application
* instance is still null
*/
- protected function prepareTemplateEngine (BaseFrameworkSystem $appInstance=null) {
+ protected function prepareTemplateInstance (BaseFrameworkSystem $appInstance=null) {
// Is the application instance set?
if (is_null($appInstance)) {
// Get the current instance
}
// Initialize the template engine
- $tplEngine = ObjectFactory::createObjectByConfiguredName('template_class', array($fqfn, $appInstance->getLanguageInstance(), $appInstance->getFileIoInstance()));
+ $templateInstance = ObjectFactory::createObjectByConfiguredName('template_class', array($fqfn, $appInstance->getLanguageInstance(), $appInstance->getFileIoInstance()));
// Return the prepared instance
- return $tplEngine;
+ return $templateInstance;
}
/**
$appInstance = $this->getResolverInstance()->getApplicationInstance();
// Prepare a template instance
- $templateInstance = $this->prepareTemplateEngine($appInstance);
+ $templateInstance = $this->prepareTemplateInstance($appInstance);
// Assign variable
$templateInstance->assignVariable('decrypted_code', $decryptedCode);
$appInstance = $this->getResolverInstance()->getApplicationInstance();
// Prepare a template instance
- $templateInstance = $this->prepareTemplateEngine($appInstance);
+ $templateInstance = $this->prepareTemplateInstance($appInstance);
// Load the master template
$masterTemplate = $appInstance->getMasterTemplate();
$appInstance = $this->getResolverInstance()->getApplicationInstance();
// Prepare a template instance
- $templateInstance = $this->prepareTemplateEngine($appInstance);
+ $templateInstance = $this->prepareTemplateInstance($appInstance);
// Assign base URL
$templateInstance->assignConfigVariable('base_url');
$appInstance = $this->getResolverInstance()->getApplicationInstance();
// Prepare a template instance
- $templateInstance = $this->prepareTemplateEngine($appInstance);
+ $templateInstance = $this->prepareTemplateInstance($appInstance);
// Assign application data with template engine
$templateInstance->assignApplicationData($appInstance);
$appInstance = $this->getResolverInstance()->getApplicationInstance();
// Prepare a template instance
- $templateInstance = $this->prepareTemplateEngine($appInstance);
+ $templateInstance = $this->prepareTemplateInstance($appInstance);
// Load the master template
$masterTemplate = $appInstance->getMasterTemplate();
$appInstance = $this->getResolverInstance()->getApplicationInstance();
// Prepare a template instance
- $templateInstance = $this->prepareTemplateEngine($appInstance);
+ $templateInstance = $this->prepareTemplateInstance($appInstance);
// Load the master template
$masterTemplate = $appInstance->getMasterTemplate();
$appInstance = $this->getResolverInstance()->getApplicationInstance();
// Prepare a template instance
- $templateInstance = $this->prepareTemplateEngine($appInstance);
+ $templateInstance = $this->prepareTemplateInstance($appInstance);
// Assign all the application's data with template variables
$templateInstance->assignApplicationData($appInstance);
* @return void
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Get a user instance from registry
- $userInstance = Registry::getRegistry()->getInstance('user');
+ // Get template instance
+ $templateInstance = $responseInstance->getTemplateInstance();
// Get a mailer class
- $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class');
+ $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class', array($templateInstance));
// Load the mail template
$mailerInstance->loadTemplate('resend_link');
+ // Get a user instance from registry
+ $userInstance = Registry::getRegistry()->getInstance('user');
+
// Add the recipient
- $mailerInstance->addRecipientByUser($userInstance);
+ $mailerInstance->addRecipientByUserInstance($userInstance);
// Set subject line from template
$mailerInstance->setSubjectFromTemplate();
<?php
/**
- *
+ * A mailer class for debugging purposes only. This class will print the
+ * prepared mail out and will not send it to the recipient.
*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
/**
* Creates an instance of this mailer class
*
+ * @param $templateInstance A template instance
* @return $mailerInstance An instance of this mailer class
*/
- public final static function createDebugMailer () {
+ public final static function createDebugMailer (CompileableTemplate $templateInstance) {
// Get a new instance
$mailerInstance = new DebugMailer();
+ // Set template instance
+ $mailerInstance->setTemplateInstance($templateInstance);
+
// Return the instance
return $mailerInstance;
}
/**
* Instance of the template engine
*/
- private $templateEngine = null;
+ private $templateInstance = null;
/**
* Fatal resolved messages from filters and so on
* @return void
*/
public final function initTemplateEngine (ManageableApplication $appInstance) {
- $this->templateEngine = $this->prepareTemplateEngine($appInstance);
- }
-
- /**
- * Getter for the template engine instance
- *
- * @return $templateEngine An instance of the used template engine
- */
- public final function getTemplateEngine () {
- return $this->templateEngine;
+ $this->setTemplateInstance($this->prepareTemplateInstance($appInstance));
}
/**
*/
private $responseBody = "";
- /**
- * Instance of the template engine
- */
- private $templateEngine = null;
-
/**
* Fatal resolved messages from filters and so on
*/
$cfg->setConfigEntry('code_template_type' , "image");
// Get a prepared instance
- $this->templateEngine = $this->prepareTemplateEngine($appInstance);
- }
-
- /**
- * Getter for the template engine instance
- *
- * @return $templateEngine An instance of the used template engine
- */
- public final function getTemplateEngine () {
- return $this->templateEngine;
+ $this->setTemplateInstance($this->prepareTemplateInstance($appInstance));
}
/**