// Is the instance there?
if (is_null(self::$selfInstance)) {
self::$selfInstance = new ApplicationHelper();
- } // END - if
+ }
// Return the instance
return self::$selfInstance;
// Then use it
$response = strtolower($requestInstance->getRequestElement('request'));
$responseType = $response;
- } // END - if
+ }
// ... and a new response object
$responseClass = sprintf('%sResponse', self::convertToClassName($response));
// Set it in request
$requestInstance->setRequestElement('command', $commandName);
- } // END - if
+ }
// Get a controller resolver
$resolverClass = self::convertToClassName($this->getAppShortName() . '_' . $responseType . '_controller_resolver');
// Add the current instance to the list
$this->foundApps->append($app);
- } // END - if ((is_file(...
+ } ((is_file(...
}
/**
// Load the application's data.php script and append the
// application to the ArrayObject
$this->loadApplicationData($appData, $appName);
- } // END - if
+ }
} // END - while
// Close directory pointer
// Empty code?
if (empty($code)) {
$code = '<em>Unknown</em>';
- } // END - if
+ }
// Create message
$message = sprintf('File: <span class="debug_file">%s</span>, Line: <span class="debug_line">%s</span>, Code: <span class="debug_code">%s</span>',
* @return $lendsMoreMoney Wether this bank lends more money to the user
*/
public function ifBankLendsMoreMoney () {
- $this->partialStub();
+ DebugMiddleware::getSelfInstance()->partialStub();
}
/**
* @return $hasMaximumCredits Wether the user has maximum allowed credits
*/
public function ifUserHasMaxCredits () {
- $this->partialStub();
+ DebugMiddleware::getSelfInstance()->partialStub();
}
/**
// Then we simply "ask" the opening time instance if the user asks within the opening time
$hasOpened = $openingInstance->ifWithinOpeningTimes();
- } // END - if
+ }
// Return status
return $hasOpened;
unset($this->allowedData);
// Unfinished!
- $this->partialStub("Unfinished work.");
+ DebugMiddleware::getSelfInstance()->partialStub('Unfinished work.');
$this->debugBackTrace();
}
if ($actionInstance instanceof PerformableAction) {
// Execute the action (shall not output anything, see below why)
$actionInstance->execute($requestInstance, $responseInstance);
- } // END - if
+ }
// Get the application instance
$appInstance = $this->getResolverInstance()->getApplicationInstance();
if ($actionInstance instanceof PerformableAction) {
// Execute the action (shall not output anything, see below why)
$actionInstance->execute($requestInstance, $responseInstance);
- } // END - if
+ }
// Get the application instance
$appInstance = $this->getResolverInstance()->getApplicationInstance();
// Then do some nasty caching here but don't throw an exception
// because then you will hurt our web helpers... :/
$companyInstance->partialStub("Don't throw exceptions here.");
- } // END - if
+ }
// Init all lists
$companyInstance->initCompanyLists();
if ($resultInstance instanceof SearchableResult) {
// Set the result instance
$this->setResultInstance($resultInstance);
- } // END - if
+ }
// Return result
return $participates;
// Is it set?
if ($resultInstance instanceof SearchableResult) {
// Result found so analyse it
- $this->partialStub("Check if user is company founder.");
- } // END - if
+ DebugMiddleware::getSelfInstance()->partialStub('Check if user is company founder.');
+ }
// Return result
return $isFounder;
// Is it set?
if ($resultInstance instanceof SearchableResult) {
// Result found so analyse it
- $this->partialStub("Check if user is company owner.");
- } // END - if
+ DebugMiddleware::getSelfInstance()->partialStub('heck if user is company owner.');
+ }
// Return result
return $isOwner;
if ($resultInstance instanceof SearchableResult) {
// Result found so he is employee
$isEmployee = true;
- } // END - if
+ }
// Return result
return $isEmployee;
$dummy = explode(" ", $this->getCompanyName());
foreach ($dummy as $part) {
$this->shortName .= substr($part, 0, 1);
- } // END - if
+ }
}
// Reedereien Werften bauen lassen
if ($totalUnemployed < $amount) {
// Reichte nicht aus!
throw new ToMuchEmployeesException(array($amount, $personellInstance->getAllUnemployed()), self::EXCEPTION_NOT_ENOUGTH_UNEMPLOYEES);
- } // END - if
+ }
// Get list for all unemployed people
$list = $personellInstance->getSpecialPersonellList(false); // Should be cached
if ($iterator->valid() === false) {
// Should normally not happen... :(
throw new StructuresOutOfBoundsException($idx, self::EXCEPTION_INDEX_OUT_OF_BOUNDS);
- } // END - if
+ }
// Get current element
$employee = $iterator->current();
if ($shipyardIter->valid() === false) {
// Rewind to first position
$shipyardIter->seek(0);
- } // END - if
+ }
// Get Shipyard object
$shipyard = $shipyardIter->current();
if ($partnerInstance->isContractPartner($contractInstance) === false) {
// Invalid contract partner!
throw new InvalidContractPartnerException($partnerInstance, self::EXCEPTION_CONTRACT_PARTNER_INVALID);
- } // END - if
+ }
// Determine if company "signs" own contract (must be done) or with an other party
if ($this->equals($partnerInstance)) {
// Stop processing here
exit;
- } // END - if
+ }
}
}
// Stop processing here
exit;
- } // END - if
+ }
}
}
// Abort here
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
- } // END - if
+ }
}
}
// Abort here
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
- } // END - if
+ }
}
}
// Stop processing here
exit;
- } // END - if
+ }
}
}
// Entry was found so the government can no more pay a training
$alreadyPayed = true;
- } // END - if
+ }
// Return the result
return $alreadyPayed;
// Entry found, so lets have a look if this government wants to again...
$maximumPayed = true;
- } // END - if
+ }
// Return the result
return $maximumPayed;
if ($userInstance->ifPasswordHashMatches($requestInstance) === false) {
// Mismatching password
throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH);
- } // END - if
+ }
// Now do the real login. This can be cookie- or session-based login
// which depends on the admins setting then on the user's taste.
// Store the hash back in request
$this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword);
- } // END - if
+ }
}
}
if ($userInstance->ifPasswordHashMatches($requestInstance) === false) {
// Mismatching password
throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH);
- } // END - if
+ }
// ToDo place
// Store the hash back in request
$this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword);
- } // END - if
+ }
}
}
if (!$userInstance instanceof ManageableAccount) {
// Thrown an exception here
throw new UserInstanceMissingException (array($helperInstance, 'user'), self::EXCEPTION_INVALID_USER_INSTANCE);
- } // END - if
+ }
// Set default login method from config
$helperInstance->setDefaultAuthMethod();
if ($this->personelllList instanceof FrameworkArrayObject) {
// Throw an exception
throw new PersonellListAlreadyCreatedException($this, self::EXCEPTION_DIMENSION_ARRAY_INVALID);
- } // END - if
+ }
// Initialize the array
- $this->personellList = new FrameworkArrayObject("FakedPersonellList");
+ $this->personellList = new FrameworkArrayObject('FakedPersonellList');
}
// Remove the personell list
*
* @return $cacheList A list of cached personells
*/
- function getSpecialPersonellList ($isEmployed = null, $isMarried = null, $hasGender = "") {
+ function getSpecialPersonellList ($isEmployed = null, $isMarried = null, $hasGender = '') {
// Serialize the conditions for checking if we can take the cache
$serialized = serialize(array($isEmployed, $isMarried, $hasGender));
// Set typical family name
parent::setFamily("Smith");
- } // END - if
+ }
// Return surname
return $surname;
if ($personellInstance->isDateValid($year, $month, $day) === false) {
// Something is wrong ...
throw new BirthdayInvalidException(array($year, $month, $day), self::EXCEPTION_BIRTH_DATE_IS_INVALID);
- } // END - if
+ }
// Set birthday
$personellInstance->setBirthday($year, $month, $day);
if ($this->getConfigInstance()->getConfigEntry('confirm_email_enabled') === 'N') {
// No confirmation of email needed
$configEntry = 'user_status_confirmed';
- } // END - if
+ }
// Add a lot elements to the dataset criteria
foreach ($this->criteriaElements as $alias => $element) {
if ((($element == 'username') || ($alias == 'username')) && ($this->getRequestInstance()->getRequestElement($element) == $this->getConfigInstance()->getConfigEntry('guest_login_user'))) {
// Yes, then set the config entry to guest status
$configEntry = 'user_status_guest';
- } // END - if
+ }
} // END - foreach
// Mark the username as unique key
if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) {
// This command has an invalid instance!
throw new InvalidControllerInstanceException(array($this, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
- } // END - if
+ }
// Set last controller
$this->setResolvedInstance($controllerInstance);
if (!class_exists($partClass)) {
// Nicht vorhanden, dann Ausnahme werfen!
throw new NoClassException($partClass, self::EXCEPTION_CLASS_NOT_FOUND);
- } // END - if
+ }
// Get an instance back from our object factory
$partInstance = ObjectFactory::createObjectByName($partClass);
// STUB: Getter-Methode Anzahl Betten
public function calcTotalBeds () {
- $this->partialStub("Please implement this stub in your ship!");
+ DebugMiddleware::getSelfInstance()->partialStub('Please implement this stub in your ship!');
}
// Setter-Methode fuer Schiffsnamen
if (is_null($struct)) {
// Empty structures list!
throw new EmptyStructuresListException($this, self::EXCEPTION_EMPTY_STRUCTURES_ARRAY);
- } // END - if
+ }
// Anzahl Betten auf 0 setzen
$numBeds = 0;
if (!is_null($cab)) {
// Kabinenbeschreibung holen
$cabType = $cab->getObjectDescription();
- } // END - if
- } // END - if
- } // END - if
+ }
+ }
+ }
} // END - for
// Anzahl zurueckliefern
// Store it in registry
Registry::getRegistry()->addInstance('money_bank', $bankInstance);
- } // END - if
+ }
// Return the instance
return $bankInstance;
// Store it in registry
Registry::getRegistry()->addInstance('government', $governmentInstance);
- } // END - if
+ }
// Return the prepared instance
return $governmentInstance;
// And store it in registry
Registry::getRegistry()->addInstance('points', $pointsInstance);
- } // END - if
+ }
// Just forward this request to the user points class
$hasRequired = $pointsInstance->ifUserHasRequiredPoints($action);
if ($userInstance->ifUsernameExists() === false) {
// Throw an exception here
throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
- } // END - if
+ }
// Return the instance
return $userInstance;
if ($userInstance->ifUsernameExists() === false) {
// Throw an exception here
throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
- } // END - if
+ }
// Return the instance
return $userInstance;
// If there is no action use the default on
if (is_null($lastAction)) {
$lastAction = $this->getConfigInstance()->getConfigEntry('login_default_action');
- } // END - if
+ }
// Get a critieria instance
$searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
// And store it in registry
Registry::getRegistry()->addInstance('points', $pointsInstance);
- } // END - if
+ }
// Get the amount
$amount = $requestInstance->getRequestElement('amount');
if (!$this->getResultInstance() instanceof SearchableResult) {
// Abort here
return;
- } // END - if
+ }
// Do we have data to update?
if ($this->getResultInstance()->ifDataNeedsFlush()) {
// Yes, then send the whole result to the database layer
$wrapperInstance->doUpdateByResult($this->getResultInstance());
- } // END - if
+ }
}
}
// Set the company instance if not null
if (!is_null($companyInstance)) {
$wrapperInstance->setCompanyInstance($companyInstance);
- } // END - if
+ }
// Return the instance
return $wrapperInstance;
// Entry found for further analysis/processing
$participates = true;
- } // END - if
+ }
// Return the result
return $participates;
$message = sprintf("[%s:] Keine Werften gefunden!",
$class->__toString()
);
- } // END - if
+ }
// Call parent constructor
parent::__construct($message, $code);
// Display link to government for startup help
$linkInstance->addActionLinkById('government_startup_help', 'apply_startup_help_government');
- } // END - if
+ }
} elseif ($linkInstance->getValueInstance()->ifGovernmentPaysStartupHelp()) {
// Display link to government for startup help
$linkInstance->addActionLinkById('government_startup_help', 'apply_startup_help_government');
if ($helperInstance->ifFormSecuredWithCaptcha()) {
$helperInstance->addFormGroup('captcha_user', "Die virtuelle Beantragung von Starthilfe ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du die Starthilfe beantragen kannst.");
$helperInstance->addCaptcha();
-} // END - if
+}
// Final notices
$helperInstance->addFormGroup('buttons', "Sind alle Daten nun korrekt eingegeben? Dann sende sie mit einem Klick einfach ab!");
if ($helperInstance->ifFormSecuredWithCaptcha()) {
$helperInstance->addFormGroup('captcha_user', "Die virtuelle Beantragung eines Trainingkursus ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, um den Trainingskursus zu beantragen.");
$helperInstance->addCaptcha();
-} // END - if
+}
// Final notices
$helperInstance->addFormGroup('buttons', "Sind alle Daten nun korrekt eingegeben? Dann sende sie mit einem Klick einfach ab!");
if ($helperInstance->ifEmailMustBeUnique()) {
$helperInstance->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein.");
- } // END - if
+ }
if ($helperInstance->ifEmailChangeRequireConfirmation()) {
$helperInstance->addFormNote('confirm', "Es wird ein Bestätigungslink an deine neue Email-Adresse gesendet. Bitte klicke diesen dann möglichst schnell an.");
- } // END - if
-} // END - if
+ }
+}
// Add form group for user profile
$helperInstance->addFormGroup('profile', "Hier kannst du deine Profildaten ändern.");
$helperInstance->addInputTextField('birth_month');
$helperInstance->addFieldText('birth_day', ".");
$helperInstance->addInputTextField('birth_year');
- } // END - if
-} // END - if
+ }
+}
// Add sub group for zip code
$helperInstance->addFormSubGroup('zip', "Magst du uns auch deine Postleitzahl verraten?");
if ($helperInstance->ifChatEnabled('icq')) {
$helperInstance->addFieldText('icq', "ICQ-Nummer:");
$helperInstance->addInputTextFieldWithDefault('icq');
-} // END - if
+}
// Add Jabber chat?
if ($helperInstance->ifChatEnabled('jabber')) {
$helperInstance->addFieldText('jabber', "Jabber:");
$helperInstance->addInputTextFieldWithDefault('jabber');
-} // END - if
+}
// Add Yahoo! chat?
if ($helperInstance->ifChatEnabled('yahoo')) {
$helperInstance->addFieldText('yahoo', "Yahoo!:");
$helperInstance->addInputTextFieldWithDefault('yahoo');
-} // END - if
+}
// Add AOL chat?
if ($helperInstance->ifChatEnabled('aol')) {
$helperInstance->addFieldText('aol', "AOL-Screenname:");
$helperInstance->addInputTextFieldWithDefault('aol');
-} // END - if
+}
// Add MSN chat?
if ($helperInstance->ifChatEnabled('msn')) {
$helperInstance->addFieldText('msn', "MSN:");
$helperInstance->addInputTextFieldWithDefault('msn');
-} // END - if
+}
if (!$helperInstance->ifRegisterRequiresEmailVerification()) {
$helperInstance->addFormExtraNote(1, "Die Benachrichtigungen per Email sind im Loginbereich verfeinerbar, welche du genau haben willst.");
-} // END - if
+}
// Rules already accepted?
if ($helperInstance->ifRulesHaveChanged()) {
if ($helperInstance->ifFormSecuredWithCaptcha()) {
$helperInstance->addFormGroup('captcha_user', "Das Ändern von Profildaten ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit deine Änderungen gespeichert werden können.");
$helperInstance->addCaptcha();
-} // END - if
+}
// Ask again for current account password
$helperInstance->addFormGroup('pass_old', "Bitte gebe zur Bestätigung der Änderungen dein derzeitiges Passwort ein.");
if ($helperInstance->ifFormSecuredWithCaptcha()) {
$helperInstance->addFormGroup('captcha_refill', "Bitte wiederhole den angezeigten Code:");
$helperInstance->addCaptcha();
-} // END - if
+}
// Submit button
$helperInstance->addFormGroup('buttons_refill', "Mit Absenden des Formulars wird deine Nachbestellung verbindlich!");
if ($blockInstance->ifIncludeRegistrationStamp()) {
// Then assign it as well!
$blockInstance->assignFieldWithFilter('registered', 'formatTimestamp');
-} // END - if
+}
// Flush the content out to a template variable
$blockInstance->flushContent();
if ($helperInstance->ifFormSecuredWithCaptcha()) {
$helperInstance->addFormGroup('captcha_user', "Das Benutzer-Login ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du dich einloggen kannst.");
$helperInstance->addCaptcha();
- } // END - if
+ }
// Submit buttons
$helperInstance->addFormGroup('buttons_user', "Alles richtig eingegeben?");
if ($helperInstance->ifFormSecuredWithCaptcha()) {
$helperInstance->addFormGroup('captcha_guest', "Unser Gast-Login ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du dich einloggen kannst.");
$helperInstance->addCaptcha();
- } // END - if
+ }
// Submit button
$helperInstance->addFormGroup('buttons_guest', "Gastlogins sind in der Funkionsweise eingeschränkt. Mehr dazu unter "Gastlogin".");
if ($blockInstance->ifIncludeRegistrationStamp()) {
// Then assign it as well!
$blockInstance->assignFieldWithFilter('registered', 'format_timestamp');
-} // END - if
+}
// Flush the content out to a template variable
$blockInstance->flushContent();
// Must the email address be unique in this system?
if ($helperInstance->ifEmailMustBeUnique()) {
$helperInstance->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein.");
- } // END - if
-} // END - if
+ }
+}
// Shall we also ask some personal data to complete the profile?
if ($helperInstance->ifRegisterIncludesProfile()) {
// Must the email address be unique in this system?
if ($helperInstance->ifEmailMustBeUnique()) {
$helperInstance->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein.");
- } // END - if
- } // END - if
+ }
+ }
// Persoenliche Daten mit in der Anmeldung abfragen?
if ($helperInstance->ifRegisterIncludesPersonaData()) {
$helperInstance->addInputTextField('birth_month');
$helperInstance->addFieldText('birth_day', ".");
$helperInstance->addInputTextField('birth_year');
- } // END - if
- } // END - if
+ }
+ }
$helperInstance->addFormSubGroup('zip', "Magst du uns auch deine Postleitzahl verraten?");
$helperInstance->addFieldText('zip', "Postleitzahl:");
if ($helperInstance->ifChatEnabled('icq')) {
$helperInstance->addFieldText('icq', "ICQ-Nummer:");
$helperInstance->addInputTextField('icq');
- } // END - if
+ }
if ($helperInstance->ifChatEnabled('jabber')) {
$helperInstance->addFieldText('jabber', "Jabber:");
$helperInstance->addInputTextField('jabber');
- } // END - if
+ }
if ($helperInstance->ifChatEnabled('yahoo')) {
$helperInstance->addFieldText('yahoo', "Yahoo!:");
$helperInstance->addInputTextField('yahoo');
- } // END - if
+ }
if ($helperInstance->ifChatEnabled('aol')) {
$helperInstance->addFieldText('aol', "AOL-Screenname:");
$helperInstance->addInputTextField('aol');
- } // END - if
+ }
if ($helperInstance->ifChatEnabled('msn')) {
$helperInstance->addFieldText('msn', "MSN:");
$helperInstance->addInputTextField('msn');
- } // END - if
+ }
if (!$helperInstance->ifRegisterRequiresEmailVerification()) {
$helperInstance->addFormExtraNote(1, "Die Benachrichtigungen per sind im Loginbereich verfeinerbar, welche du genau haben willst.");
if ($helperInstance->ifFormSecuredWithCaptcha()) {
$helperInstance->addFormGroup('captcha', "Bitte wiederhole den angezeigten Code damit die Anmeldung abgeschlossen werden kann.");
$helperInstance->addCaptcha();
-} // END - if
+}
// Final note and submit buttons
$helperInstance->addFormGroup('buttons', "Wenn du alle benötigten Felder korrekt ausgefüt hast, kannst du die Anmeldung abschliessen.");
-Subproject commit ba76f1380ebef3021b78d122cbabd6fe3173cd47
+Subproject commit 3e492b83a49b96805aff4f46882773f2bcf1fad9