From: Roland Häder Date: Tue, 5 Aug 2008 14:20:21 +0000 (+0000) Subject: generateUniqueId() and more useless/deprecated methods removed, code speed-up, link... X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=commitdiff_plain;h=ec23e72b16433ac136817f3ea78697fb70236e4a generateUniqueId() and more useless/deprecated methods removed, code speed-up, link helper improved --- diff --git a/.gitattributes b/.gitattributes index b3e2035..e66f03a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -137,7 +137,7 @@ application/ship-simu/main/drives/motor/class_Motor.php -text application/ship-simu/main/factories/.htaccess -text application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php -text application/ship-simu/main/goverment/.htaccess -text -application/ship-simu/main/goverment/class_SimpleGoverment.php -text +application/ship-simu/main/goverment/class_SimplifiedGoverment.php -text application/ship-simu/main/login/.htaccess -text application/ship-simu/main/login/class_ShipSimuGuestLogin.php -text application/ship-simu/main/login/class_ShipSimuUserLogin.php -text @@ -189,6 +189,7 @@ application/ship-simu/main/user/extended/class_ShipSimuGuest.php -text application/ship-simu/main/user/extended/class_ShipSimuMember.php -text application/ship-simu/main/wrapper/.htaccess -text application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php -text +application/ship-simu/main/wrapper/class_UserGovermentDatabaseWrapper.php -text application/ship-simu/starter.php -text application/ship-simu/templates/.htaccess -text application/ship-simu/templates/de/.htaccess -text @@ -225,6 +226,7 @@ application/ship-simu/templates/images/de/image/code_captcha.itp -text /clear-cache.sh -text db/.htaccess -text db/company_user/.htaccess -text +db/gov_user/.htaccess -text db/news/.htaccess -text db/user/.htaccess -text db/user_points/.htaccess -text @@ -280,6 +282,7 @@ inc/classes/exceptions/helper/class_FormClosedException.php -text inc/classes/exceptions/helper/class_FormGroupClosedException.php -text inc/classes/exceptions/helper/class_FormOpenedException.php -text inc/classes/exceptions/helper/class_InvalidFormNameException.php -text +inc/classes/exceptions/helper/class_NoGroupOpenedException.php -text inc/classes/exceptions/helper/class_UserInstanceMissingException.php -text inc/classes/exceptions/io/.htaccess -text inc/classes/exceptions/io/class_DirPointerNotOpenedException.php -text @@ -489,6 +492,7 @@ inc/classes/main/controller/web/class_WebLoginController.php -text inc/classes/main/controller/web/class_WebLoginFailedController.php -text inc/classes/main/controller/web/class_WebLogoutDoneController.php -text inc/classes/main/controller/web/class_WebRegisterController.php -text +inc/classes/main/controller/web/class_WebStatusController.php -text inc/classes/main/criteria/.htaccess -text inc/classes/main/criteria/class_DataSetCriteria.php -text inc/classes/main/criteria/class_SearchCriteria.php -text diff --git a/application/blog/class_ApplicationHelper.php b/application/blog/class_ApplicationHelper.php index 9944317..0746faa 100644 --- a/application/blog/class_ApplicationHelper.php +++ b/application/blog/class_ApplicationHelper.php @@ -79,14 +79,9 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica // Call parent constructor parent::__construct(__CLASS__); - // Set description - $this->setObjectDescription("Application-Helper"); - - // Create an unique ID - $this->generateUniqueId(); - // Tidy up a little $this->removeSystemArray(); + $this->removeNumberFormaters(); } /** diff --git a/application/blog/main/class_ b/application/blog/main/class_ index 4e1385b..df22004 100644 --- a/application/blog/main/class_ +++ b/application/blog/main/class_ @@ -31,12 +31,6 @@ class extends BaseFrameworkSystem { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription(""); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/application/selector/class_ApplicationHelper.php b/application/selector/class_ApplicationHelper.php index d7a8c20..aa297cc 100644 --- a/application/selector/class_ApplicationHelper.php +++ b/application/selector/class_ApplicationHelper.php @@ -74,14 +74,9 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica // Call parent constructor parent::__construct(__CLASS__); - // Set description - $this->setObjectDescription("Application-Helper"); - - // Create an unique ID - $this->generateUniqueId(); - // Tidy up a little $this->removeSystemArray(); + $this->removeNumberFormaters(); } /** diff --git a/application/selector/class_ApplicationSelector.php b/application/selector/class_ApplicationSelector.php index 007550f..ddae1d4 100644 --- a/application/selector/class_ApplicationSelector.php +++ b/application/selector/class_ApplicationSelector.php @@ -59,12 +59,6 @@ class ApplicationSelector extends BaseFrameworkSystem { // Call parent constructor parent::__construct(__CLASS__); - // Set description - $this->setObjectDescription("Applikationswechsler"); - - // Create unique ID number - $this->generateUniqueId(); - // Remove system array and thousand seperator $this->removeSystemArray(); $this->removeNumberFormaters(); diff --git a/application/ship-simu/class_ApplicationHelper.php b/application/ship-simu/class_ApplicationHelper.php index 1c86aa8..43cac88 100644 --- a/application/ship-simu/class_ApplicationHelper.php +++ b/application/ship-simu/class_ApplicationHelper.php @@ -79,14 +79,9 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica // Call parent constructor parent::__construct(__CLASS__); - // Set description - $this->setObjectDescription("Application-Helper"); - - // Create an unique ID - $this->generateUniqueId(); - // Tidy up a little $this->removeSystemArray(); + $this->removeNumberFormaters(); } /** diff --git a/application/ship-simu/config.php b/application/ship-simu/config.php index 51e2695..307310d 100644 --- a/application/ship-simu/config.php +++ b/application/ship-simu/config.php @@ -235,6 +235,9 @@ $cfg->setConfigEntry('company_db_wrapper_class', "CompanyDatabaseWrapper"); // CFG: USER-POINTS-DB-WRAPPER-CLASS $cfg->setConfigEntry('user_points_db_wrapper_class', "UserPointsDatabaseWrapper"); +// CFG: USER-GOVERMENT-WRAPPER +$cfg->setConfigEntry('user_gov_wrapper_class', "UserGovermentDatabaseWrapper"); + // CFG EMAIl-TPL-RESEND-LINK $cfg->setConfigEntry('email_tpl_resend_link', "text"); @@ -266,7 +269,7 @@ $cfg->setConfigEntry('write_applications_action_points', 10000); $cfg->setConfigEntry('user_ppints_class', "UserPoints"); // CFG: GOVERMENT-CLASS -$cfg->setConfigEntry('goverment_class', "SimpleGoverment"); +$cfg->setConfigEntry('goverment_class', "SimplifiedGoverment"); // CFG: BANK-CLASS $cfg->setConfigEntry('bank_class', "MoneyBank"); diff --git a/application/ship-simu/exceptions/class_InvalidContractPartnerException.php b/application/ship-simu/exceptions/class_InvalidContractPartnerException.php index 394ced8..3bf55f0 100644 --- a/application/ship-simu/exceptions/class_InvalidContractPartnerException.php +++ b/application/ship-simu/exceptions/class_InvalidContractPartnerException.php @@ -24,9 +24,8 @@ class InvalidContractPartnerException extends FrameworkException { public function __construct (FrameworkInterface $class, $code) { // Add a message around the missing class - $message = sprintf("[%s:] %s ist kein gütiger Vertragspartner.", - $class->__toString(), - $class->getObjectDescription() + $message = sprintf("[%s:] Kein gütiger Vertragspartner.", + $class->__toString() ); // Call parent constructor diff --git a/application/ship-simu/exceptions/class_ItemNotInPriceListException.php b/application/ship-simu/exceptions/class_ItemNotInPriceListException.php index 4f75ef6..798e18c 100644 --- a/application/ship-simu/exceptions/class_ItemNotInPriceListException.php +++ b/application/ship-simu/exceptions/class_ItemNotInPriceListException.php @@ -24,9 +24,8 @@ class ItemNotInPriceListException extends FrameworkException { public function __construct (FrameworkInterface $class, $code) { // Add a message around the missing class - $message = sprintf("[Merchant:] Preis für den Artikel %s %s nicht gefunden.", - $class->__toString(), - $class->getObjectDescription() + $message = sprintf("[Merchant:] Preis für den Artikel %s nicht gefunden.", + $class->__toString() ); // Call parent constructor diff --git a/application/ship-simu/exceptions/class_ItemNotTradeableException.php b/application/ship-simu/exceptions/class_ItemNotTradeableException.php index 2d031bc..2344c06 100644 --- a/application/ship-simu/exceptions/class_ItemNotTradeableException.php +++ b/application/ship-simu/exceptions/class_ItemNotTradeableException.php @@ -24,9 +24,8 @@ class ItemNotTradeableException extends FrameworkException { public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:] %s ist nicht handelbar!", - $classArray[0]->__toString(), - $classArray[1]->getObjectDescription() + $message = sprintf("[%s:] Object not tradeable.", + $classArray[0]->__toString() ); // Call parent constructor diff --git a/application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php b/application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php index 66a6878..26aa0e3 100644 --- a/application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php +++ b/application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php @@ -30,12 +30,6 @@ class ShipSimuLoginAction extends BaseAction implements PerformableAction { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Login welcome action"); - - // Generate unique key - $this->generateUniqueId(); } /** diff --git a/application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php b/application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php index 997ba0d..6c45260 100644 --- a/application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php +++ b/application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php @@ -30,12 +30,6 @@ class ShipSimuProfileAction extends BaseAction implements PerformableAction { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Profile action"); - - // Generate unique key - $this->generateUniqueId(); } /** diff --git a/application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php b/application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php index 30c6376..9cce441 100644 --- a/application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php +++ b/application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php @@ -30,12 +30,6 @@ class WebLoginCompanyAction extends BaseAction implements Commandable, Registera protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Shipping comany action"); - - // Generate unique key - $this->generateUniqueId(); } /** diff --git a/application/ship-simu/main/bank/class_MoneyBank.php b/application/ship-simu/main/bank/class_MoneyBank.php index 0436549..d4430ff 100644 --- a/application/ship-simu/main/bank/class_MoneyBank.php +++ b/application/ship-simu/main/bank/class_MoneyBank.php @@ -31,14 +31,7 @@ class MoneyBank extends BaseFrameworkSystem implements Registerable { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("A money bank class"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little - $this->removeNumberFormaters(); $this->removeSystemArray(); } diff --git a/application/ship-simu/main/class_ b/application/ship-simu/main/class_ index 2d6541c..634096c 100644 --- a/application/ship-simu/main/class_ +++ b/application/ship-simu/main/class_ @@ -31,12 +31,6 @@ class ??? extends BaseFrameworkSystem { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription(""); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/application/ship-simu/main/class_BasePersonell.php b/application/ship-simu/main/class_BasePersonell.php index a0baf63..1234767 100644 --- a/application/ship-simu/main/class_BasePersonell.php +++ b/application/ship-simu/main/class_BasePersonell.php @@ -52,8 +52,9 @@ class BasePersonell extends BaseFrameworkSystem implements Personellizer { // Call parent constructor parent::__construct($className); - // Set description - $this->setObjectDescription("Personal"); + // Tidy up a little + $this->removeSystemArray(); + $this->removeNumberFormaters(); } // Remove min/max ages diff --git a/application/ship-simu/main/class_BaseSimulator.php b/application/ship-simu/main/class_BaseSimulator.php index db7a1f2..63f9d53 100644 --- a/application/ship-simu/main/class_BaseSimulator.php +++ b/application/ship-simu/main/class_BaseSimulator.php @@ -46,10 +46,9 @@ class BaseSimulator extends BaseFrameworkSystem { // Call highest constructor parent::__construct($className); - // Set part description and class name - $this->setObjectDescription("Simulator-Basis-Einheit"); - // Clean up a little, dies sollte ganz zum Schluss erfolgen! + $this->removeSystemArray(); + $this->removeNumberFormaters(); $this->removeResizeFactorArray(); $this->removeCurrPart(); $this->removeCurrShip(); @@ -117,22 +116,8 @@ class BaseSimulator extends BaseFrameworkSystem { $this->currShip = $shipInstance; $this->currPart = $partInstance; - if (defined('DEBUG_CORE')) $this->debugOutput(sprintf("[%s:] Maschinenraum mit Motor %s wird fuer das Schiff %s konstruiert.", - $this->__toString(), - $this->getCurrPart()->getObjectDescription(), - $this->currShip->getShipName() - )); - // Passt ueberhaupt das Schiffsteil in's Schiff? if ($this->isShipPartSizeValid()) { - // Berechnungen fuer umliegendes Objekt anpassen - if (defined('DEBUG_CORE')) $this->debugOutput(sprintf("[%s:] Das Schiffsteil %s vom Typ %s passt in das Schiff %s hinein.", - $this->__toString(), - $this->getCurrPart()->getObjectDescription(), - $this->getCurrPart()->__toString(), - $this->currShip->getShipName() - )); - // Muessen die Masse angepasst werden? if ($this->isResizeFactorValid()) { // Neue Angaben berechnen (wir lassen etwas Lust fuer Kabelbaeume, Roehren, Maschinisten, etc.) @@ -143,11 +128,6 @@ class BaseSimulator extends BaseFrameworkSystem { // Passt dies nun immer noch? if ($this->isNewSizeValid()) { // Das passt auch, dann Werte setzen und Motor-Instanz merken - if (defined('DEBUG_CORE')) $this->debugOutput(sprintf("[%s:] Das Schiffsteil %s passt in das Schiff %s hinein.", - $this->__toString(), - $this->getObjectDescription(), - $this->currShip->getShipName() - )); $this->setWidth($this->newWidth); $this->setHeight($this->newHeight); $this->setLength($this->newLength); @@ -171,12 +151,6 @@ class BaseSimulator extends BaseFrameworkSystem { // Existiert ein Schiffsteil? if (!is_null($this->currPart)) { - // Debug-Meldung ausgeben - if (defined('DEBUG_CORE')) $this->debugOutput(sprintf("[%s:] Schiffsteil %s gefunden.", - $this->getCurrPart()->realClass, - $this->getCurrPart()->getObjectDescription() - )); - // Schiffsteil-Instanz setzen $this->setPartInstance($this->currPart); diff --git a/application/ship-simu/main/class_Merchant.php b/application/ship-simu/main/class_Merchant.php index 52f63c1..b0748e7 100644 --- a/application/ship-simu/main/class_Merchant.php +++ b/application/ship-simu/main/class_Merchant.php @@ -36,12 +36,6 @@ class Merchant extends BaseFrameworkSystem { // Call parent constructor parent::__construct(__CLASS__); - // Set description - $this->setObjectDescription("Händler"); - - // Generate unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeSystemArray(); } @@ -108,16 +102,6 @@ class Merchant extends BaseFrameworkSystem { // Secure pricing $price = (float) $price; - // Debug message - if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Der Händler %s kann nun das Schiffsteil %s "%s" zu %s verkaufen.", - __CLASS__, - __LINE__, - $this->getMerchantName(), - $itemInstance->__toString(), - $itemInstance->getObjectDescription(), - $this->formatCurrency($price) - )); - // Construct pricing item and add it to the list $this->priceList->append(array( 'item' => $itemInstance, diff --git a/application/ship-simu/main/class_WorksContract.php b/application/ship-simu/main/class_WorksContract.php index 4a60059..7f61096 100644 --- a/application/ship-simu/main/class_WorksContract.php +++ b/application/ship-simu/main/class_WorksContract.php @@ -45,14 +45,9 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { // Call parent constructor parent::__construct(__CLASS__); - // Set description - $this->setObjectDescription("Bauvertrag"); - - // Unique-ID generieren - $this->generateUniqueId(); - // Clean up a little $this->removeSystemArray(); + $this->removeNumberFormaters(); } // Neuen Bauvertrag generieren @@ -64,15 +59,6 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { // Get new instance $contractInstance = new WorksContract(); - // Debug-Meldung ausgeben - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $contractInstance->debugOutput(sprintf("[%s:%d] Neuer Bauvertrag wird für das Schiff %s mit der %s %s erstellt.", - __CLASS__, - __LINE__, - $shipName, - $partnerInstance->getObjectDescription(), - $partnerInstance->getCompanyName() - )); - // Schiffsnamen setzen $contractInstance->setShipName($shipName); @@ -166,23 +152,8 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { // Get price for this item $price = $this->getMerchantInstance()->getPriceFromList($partInstance); - // Final debug message - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] %s kostet %s.", - __CLASS__, - __LINE__, - $partInstance->getObjectDescription(), - $this->getMerchantInstance()->formatCurrency($price) - )); - // Add price $partInstance->setPrice($price); - - // Final debug message - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] %s wurde in den Bauvertrag aufgenommen.", - __CLASS__, - __LINE__, - $partInstance->getObjectDescription() - )); } // Setter for contract partner diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php index b936f47..b7f9924 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php @@ -31,12 +31,6 @@ class WebShipsimuGuestLoginCommand extends BaseCommand implements Commandable { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("User login handling command for Ship-Simu"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php index 2493fdc..ad5c6b8 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php @@ -55,12 +55,6 @@ class WebShipsimuProfileCommand extends BaseCommand implements Commandable { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Registration handling command for Ship-Simu"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php index 8ac3766..a6afca6 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php @@ -31,12 +31,6 @@ class WebShipsimuRegisterCommand extends BaseCommand implements Commandable { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Registration handling command for Ship-Simu"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php index de345a8..83ba7da 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php @@ -31,12 +31,6 @@ class WebShipsimuUserLoginCommand extends BaseCommand implements Commandable { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("User login handling command for Ship-Simu"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/application/ship-simu/main/companies/class_ShippingCompany.php b/application/ship-simu/main/companies/class_ShippingCompany.php index 971c578..7a00527 100644 --- a/application/ship-simu/main/companies/class_ShippingCompany.php +++ b/application/ship-simu/main/companies/class_ShippingCompany.php @@ -73,15 +73,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("A shipping company class"); - - // Generate unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** @@ -97,7 +88,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Does the given user owns a company? if ($companyInstance->ifUserParticipatesInCompany($userInstance)) { - // Then do some nastly caching here but don't throw an exception + // 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 @@ -345,7 +336,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Make this person employed and give him some money to work $employee->setEmployed(true); - $employee->setObjectDescription($dummy->getObjectDescription()); $employee->setRealClass($dummy->__toString()); $employee->increaseSalary((mt_rand(7, 14) * 100)); // Are 700 to 1400 EUR for the begin okay? @@ -487,14 +477,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner $shipType )); - // Debug message - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s baut in allen Werften bald Schiffe vom Typ %s.", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $shipInstance->getObjectDescription() - )); - // Iterate shipyard list for ($idx = $this->shipyardList->getIterator(); $idx->valid(); $idx->next()) { // Get current element @@ -519,13 +501,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Validate the requested ship type with the company if they can construct it public function validateWorksContractShipType (SignableContract $contractInstance) { - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s prüft den Bauauftrag der %s.", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $contractInstance->getShipName() - )); - // First get the ship type $shipInstance = $contractInstance->getShipInstance(); @@ -541,15 +516,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Get it's real class name $shipType = $shipInstance->__toString(); - // Debug message - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s prüft, ob die %s (Typ:%s) gebaut werden kann.", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $contractInstance->getShipName(), - $shipInstance->getObjectDescription() - )); - // Now check if the ship type is in any list and return the result return ($this->isShipTypeConstructable($shipType)); } @@ -608,13 +574,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // As a customer the shipping company can add new contracts public function addNewWorksContract (SignableContract $contractInstance) { - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s erstellt einen Bauauftrag für ein %s mit dem Namen %s.", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $contractInstance->getShipInstance()->getObjectDescription(), - $contractInstance->getShipInstance()->getShipName() - )); $this->contractList->append($contractInstance); } diff --git a/application/ship-simu/main/constructions/berths/class_Berth.php b/application/ship-simu/main/constructions/berths/class_Berth.php index f0a55c1..1978df5 100644 --- a/application/ship-simu/main/constructions/berths/class_Berth.php +++ b/application/ship-simu/main/constructions/berths/class_Berth.php @@ -32,12 +32,6 @@ class Berth extends BaseConstruction { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Liegeplatz"); - - // Generate unique ID number - $this->generateUniqueId(); } } diff --git a/application/ship-simu/main/constructions/class_BaseConstruction.php b/application/ship-simu/main/constructions/class_BaseConstruction.php index b1493e4..62275cb 100644 --- a/application/ship-simu/main/constructions/class_BaseConstruction.php +++ b/application/ship-simu/main/constructions/class_BaseConstruction.php @@ -29,12 +29,6 @@ class BaseConstruction extends BaseSimulator { protected function __construct ($className) { // Eltern-Konstrutor aufrufen parent::__construct($className); - - // Set description - $this->setObjectDescription("Namenlose Landkonstruktion"); - - // Clean up a little - $this->removeNumberFormaters(); } } diff --git a/application/ship-simu/main/constructions/docks/class_DryDock.php b/application/ship-simu/main/constructions/docks/class_DryDock.php index a8ce7e6..34984f0 100644 --- a/application/ship-simu/main/constructions/docks/class_DryDock.php +++ b/application/ship-simu/main/constructions/docks/class_DryDock.php @@ -29,12 +29,6 @@ class DryDock extends BaseConstruction { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Trockendock"); - - // Generate unique ID number - $this->generateUniqueId(); } } diff --git a/application/ship-simu/main/constructions/harbors/class_Harbor.php b/application/ship-simu/main/constructions/harbors/class_Harbor.php index 9cae1be..011dc6c 100644 --- a/application/ship-simu/main/constructions/harbors/class_Harbor.php +++ b/application/ship-simu/main/constructions/harbors/class_Harbor.php @@ -38,16 +38,6 @@ class Harbor extends BaseConstruction { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Hafen"); - - // Generate unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); - $this->removePartInstance(); } // Creates a harbor diff --git a/application/ship-simu/main/constructions/terminals/class_Terminal.php b/application/ship-simu/main/constructions/terminals/class_Terminal.php index 43c92dc..8063f81 100644 --- a/application/ship-simu/main/constructions/terminals/class_Terminal.php +++ b/application/ship-simu/main/constructions/terminals/class_Terminal.php @@ -29,12 +29,6 @@ class Terminal extends BaseConstruction { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Anlegebrücke"); - - // Generate unique ID number - $this->generateUniqueId(); } } diff --git a/application/ship-simu/main/constructions/yards/class_Shipyard.php b/application/ship-simu/main/constructions/yards/class_Shipyard.php index 474821a..36f85ed 100644 --- a/application/ship-simu/main/constructions/yards/class_Shipyard.php +++ b/application/ship-simu/main/constructions/yards/class_Shipyard.php @@ -49,15 +49,9 @@ class Shipyard extends BaseConstruction { // Call parent constructor parent::__construct(__CLASS__); - // Set description - $this->setObjectDescription("Werft"); - // Staff-Liste/Schiffstyp-Liste erzeugen $this->createStaffList(); $this->createShipTypeList(); - - // Generate unique ID number - $this->generateUniqueId(); } // Create a shipyard and notify it about it's owner diff --git a/application/ship-simu/main/drives/class_BaseDrive.php b/application/ship-simu/main/drives/class_BaseDrive.php index 0308f82..385a200 100644 --- a/application/ship-simu/main/drives/class_BaseDrive.php +++ b/application/ship-simu/main/drives/class_BaseDrive.php @@ -33,13 +33,6 @@ class BaseDrive extends BaseSimulator { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Set description - $this->setObjectDescription("Namenloser Antrieb"); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removePartInstance(); } // Setter-Methode fuert PS-Zahl diff --git a/application/ship-simu/main/drives/motor/class_Motor.php b/application/ship-simu/main/drives/motor/class_Motor.php index 8f8b61f..c1ed35b 100644 --- a/application/ship-simu/main/drives/motor/class_Motor.php +++ b/application/ship-simu/main/drives/motor/class_Motor.php @@ -26,15 +26,6 @@ class Motor extends BaseDrive implements TradeableItem, ConstructableShipPart { protected function __construct() { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Namenloser Motor"); - - // Generate unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } // Einen Motor erstellen @@ -43,7 +34,6 @@ class Motor extends BaseDrive implements TradeableItem, ConstructableShipPart { $motorInstance = new Motor(); // Beschreibung und Abmasse setzen - $motorInstance->setObjectDescription($descr); $motorInstance->setWidth($w); $motorInstance->setHeight($h); $motorInstance->setLength($l); diff --git a/application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php b/application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php index d2ecd37..f1c7919 100644 --- a/application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php +++ b/application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php @@ -31,12 +31,6 @@ class ShipSimuWebNewsFactory extends BaseFrameworkSystem { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("News-Objektefabrik für Ship-Simu"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/application/ship-simu/main/goverment/class_SimpleGoverment.php b/application/ship-simu/main/goverment/class_SimpleGoverment.php deleted file mode 100644 index 68882be..0000000 --- a/application/ship-simu/main/goverment/class_SimpleGoverment.php +++ /dev/null @@ -1,64 +0,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.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 . - */ -class SimpleGoverment extends BaseFrameworkSystem implements Registerable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A class for simplified goverment"); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); - } - - /** - * Creates an instance of this goverment class by given user instance - * - * @param $userInstance The user instance - * @return $govermentInstance Instance of the prepared goverment instance - */ - public final static function createSimpleGoverment (ManageableAccount $userInstance) { - // Get a new instance - $govermentInstance = new SimpleGoverment(); - - // Set the user instance - $govermentInstance->setUserInstance($userInstance); - - // Return the prepared instance - return $govermentInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/goverment/class_SimplifiedGoverment.php b/application/ship-simu/main/goverment/class_SimplifiedGoverment.php new file mode 100644 index 0000000..0f0c4ca --- /dev/null +++ b/application/ship-simu/main/goverment/class_SimplifiedGoverment.php @@ -0,0 +1,94 @@ + + * @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 + * @todo Find an interface for goverments + * + * 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 . + */ +class SimplifiedGoverment extends BaseFrameworkSystem implements Registerable { + // Constants + const STATUS_STARTER_HELP = "STARTER_HELP"; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Clean up a little + $this->removeSystemArray(); + $this->removeNumberFormaters(); + } + + /** + * Creates an instance of this goverment class by given user instance + * + * @param $userInstance The user instance + * @return $govermentInstance Instance of the prepared goverment instance + */ + public final static function createSimplifiedGoverment (ManageableAccount $userInstance) { + // Get a new instance + $govermentInstance = new SimplifiedGoverment(); + + // Set the user instance + $govermentInstance->setUserInstance($userInstance); + + // Return the prepared instance + return $govermentInstance; + } + + /** + * Checks wether the goverment has already payed a startup help to the + * current user + * + * @return $alreadyPayed Wether the goverment has already payed + */ + public function ifGovermentAlreadyPayedStartupHelp () { + // Default is not payed + $alreadyPayed = false; + + // Now get a search criteria and set the user's name as criteria + $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); + $criteriaInstance->addCriteria('gov_uid', $this->getUserInstance()->getUserName()); + $criteriaInstance->addCriteria('gov_activity_status', self::STATUS_STARTER_HELP); + $criteriaInstance->setLimit(1); + + // Get a wrapper instance + $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_gov_wrapper_class'); + + // Get result back + $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance); + + // Was the query fine? + if ($resultInstance->getAffectedRows() === 1) { + // Entry found! + $alreadyPayed = true; + } // END - if + + // Return the result + return $alreadyPayed; + } +} + +// [EOF] +?> diff --git a/application/ship-simu/main/login/class_ShipSimuGuestLogin.php b/application/ship-simu/main/login/class_ShipSimuGuestLogin.php index 24c44f6..ba7ac31 100644 --- a/application/ship-simu/main/login/class_ShipSimuGuestLogin.php +++ b/application/ship-simu/main/login/class_ShipSimuGuestLogin.php @@ -36,12 +36,6 @@ class ShipSimuGuestLogin extends BaseFrameworkSystem implements LoginableUser { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Guest login for Ship-Simu"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/application/ship-simu/main/login/class_ShipSimuUserLogin.php b/application/ship-simu/main/login/class_ShipSimuUserLogin.php index eced73d..e354040 100644 --- a/application/ship-simu/main/login/class_ShipSimuUserLogin.php +++ b/application/ship-simu/main/login/class_ShipSimuUserLogin.php @@ -36,12 +36,6 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Login for Ship-Simu"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/application/ship-simu/main/login/helper/class_ShipSimuLoginHelper.php b/application/ship-simu/main/login/helper/class_ShipSimuLoginHelper.php index 2f54e71..c4c01b0 100644 --- a/application/ship-simu/main/login/helper/class_ShipSimuLoginHelper.php +++ b/application/ship-simu/main/login/helper/class_ShipSimuLoginHelper.php @@ -46,12 +46,6 @@ class ShipSimuLoginHelper extends BaseLoginHelper implements HelpableLogin { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Login helper for Ship-Simu"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/application/ship-simu/main/parts/class_BaseShipPart.php b/application/ship-simu/main/parts/class_BaseShipPart.php index 8f34941..59ab439 100644 --- a/application/ship-simu/main/parts/class_BaseShipPart.php +++ b/application/ship-simu/main/parts/class_BaseShipPart.php @@ -29,12 +29,6 @@ class BaseShipPart extends BaseSimulator { protected function __construct($className) { // Call parent constructor parent::__construct($className); - - // Beschreibung - $this->setObjectDescription("Schiffsteil"); - - // Clean up a little - $this->removeNumberFormaters(); } // Setter for price diff --git a/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php b/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php index d332c5f..074f924 100644 --- a/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php +++ b/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php @@ -27,14 +27,9 @@ class MaschineRoom extends BaseShipPart { // Call parent constructor parent::__construct(__CLASS__); - // Set description - $this->setObjectDescription("Maschinenraum"); - - // Generate unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeSystemArray(); + $this->removeNumberFormaters(); } // Maschinenraum erstellen diff --git a/application/ship-simu/main/personell/class_SimulatorPersonell.php b/application/ship-simu/main/personell/class_SimulatorPersonell.php index 91916e5..1569708 100644 --- a/application/ship-simu/main/personell/class_SimulatorPersonell.php +++ b/application/ship-simu/main/personell/class_SimulatorPersonell.php @@ -39,15 +39,6 @@ class SimulatorPersonell extends BasePersonell { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Simulationspersonal"); - - // Create unique ID - $this->generateUniqueId(); - - // Clean-up a little - $this->removeSystemArray(); } /** diff --git a/application/ship-simu/main/personell/company/class_CompanyEmployee.php b/application/ship-simu/main/personell/company/class_CompanyEmployee.php index 52a4d24..3aee089 100644 --- a/application/ship-simu/main/personell/company/class_CompanyEmployee.php +++ b/application/ship-simu/main/personell/company/class_CompanyEmployee.php @@ -29,15 +29,6 @@ class CompanyEmployee extends SimulatorPersonell { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Firmenangestellte(r)"); - - // Create unique ID - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } // Generate a specified amount of personell diff --git a/application/ship-simu/main/registration/class_ShipSimuRegistration.php b/application/ship-simu/main/registration/class_ShipSimuRegistration.php index 60dc559..a043056 100644 --- a/application/ship-simu/main/registration/class_ShipSimuRegistration.php +++ b/application/ship-simu/main/registration/class_ShipSimuRegistration.php @@ -54,12 +54,6 @@ class ShipSimuRegistration extends BaseRegistration { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Ship-Simu registration class"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/application/ship-simu/main/ships/class_BaseShip.php b/application/ship-simu/main/ships/class_BaseShip.php index b72af8a..bdebb68 100644 --- a/application/ship-simu/main/ships/class_BaseShip.php +++ b/application/ship-simu/main/ships/class_BaseShip.php @@ -42,15 +42,11 @@ class BaseShip extends BaseSimulator { // Call parent constructor parent::__construct($className); - // Set object description - $this->setObjectDescription("Allgemeines Schiff"); - // Prepare array object for all structures $this->createStructuresArray(); // Clean-up a little $this->removePartInstance(); - $this->removeNumberFormaters(); } // Array-Objekt anlegen @@ -127,14 +123,6 @@ class BaseShip extends BaseSimulator { // Instanz im Aufbauten-Array vermerken $this->structures->append($partInstance); - // Debug-Meldung ausgeben - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff %s hat das Schiffsteil %s eingebaut bekommen.", - __CLASS__, - __LINE__, - $this->getShipName(), - $partInstance->getObjectDescription() - )); - // Alles klar! return true; } diff --git a/application/ship-simu/main/ships/passenger/class_PassengerShip.php b/application/ship-simu/main/ships/passenger/class_PassengerShip.php index 39f50db..8d71cd5 100644 --- a/application/ship-simu/main/ships/passenger/class_PassengerShip.php +++ b/application/ship-simu/main/ships/passenger/class_PassengerShip.php @@ -28,14 +28,9 @@ class PassengerShip extends BaseShip implements ConstructableShip { // Eltern-Kontruktor aufrufen parent::__construct(__CLASS__); - // Set description - $this->setObjectDescription("Passagier-Schiff"); - - // Generate unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeSystemArray(); + $this->removeNumberFormaters(); } // Passagier-Schiff erstellen diff --git a/application/ship-simu/main/structures/class_BaseStructure.php b/application/ship-simu/main/structures/class_BaseStructure.php index ebbc3fe..0fcb348 100644 --- a/application/ship-simu/main/structures/class_BaseStructure.php +++ b/application/ship-simu/main/structures/class_BaseStructure.php @@ -29,12 +29,6 @@ class BaseStructure extends BaseSimulator { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Set description - $this->setObjectDescription("Schiffsstrukturen"); - - // Clean up a little - $this->removeNumberFormaters(); } // Setter for price diff --git a/application/ship-simu/main/structures/extended/cabines/class_BaseCabin.php b/application/ship-simu/main/structures/extended/cabines/class_BaseCabin.php index e83b262..9425afa 100644 --- a/application/ship-simu/main/structures/extended/cabines/class_BaseCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/class_BaseCabin.php @@ -27,8 +27,9 @@ class BaseCabin extends BaseCabinStructure { // Call parent constructor parent::__construct($className); - // Set description - $this->setObjectDescription("Kabine"); + // Clean up a little + $this->removeSystemArray(); + $this->removeNumberFormaters(); } // Is this a cabin? diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php index 0951622..280f6f8 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php @@ -26,15 +26,6 @@ class EconomyCabin extends BaseCabin implements TradeableItem, ConstructableShip protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Economy-Class-Kabine"); - - // Generate unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } // Economy-Kabine erstellen diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php index 3678828..ee562a3 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php @@ -26,15 +26,6 @@ class LowCabin extends BaseCabin implements TradeableItem, ConstructableShipPart protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("2Star-Class-Kabine"); - - // Generate unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } // 2-Sterne-Klasse erstellen diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php index 3f181d8..1b52c2f 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php @@ -26,15 +26,6 @@ class LuxuryCabin extends BaseCabin implements TradeableItem, ConstructableShipP protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Luxuskabine"); - - // Generate unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } // Eine Luxuskabine erstellen diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php index 5a06df0..f0a4149 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php @@ -26,15 +26,6 @@ class PremierCabin extends BaseCabin implements TradeableItem, ConstructableShip protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Premier-Class-Kabine"); - - // Generate unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } // Premier-Kabine erstellen diff --git a/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php b/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php index d0c0aaa..f8e992e 100644 --- a/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php +++ b/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php @@ -36,20 +36,10 @@ class BaseCabinStructure extends BaseStructure { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Set description - $this->setObjectDescription("Kabinenstruktur"); } // Kabine hinzufuegen public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $cabinInstance) { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Kabine %s wird für das Schiff %s konstruiert.", - __CLASS__, - __LINE__, - $cabinInstance->getObjectDescription(), - $shipInstance->getShipName() - )); - // Eltern-Methode aufrufen parent::addShipPartToShip ($shipInstance, $cabinInstance); @@ -65,14 +55,6 @@ class BaseCabinStructure extends BaseStructure { // Instanz setzen $this->setDeckInstance($cabinInstance); - - // Einbaut-Meldung ausgeben - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Kabine %s wurde in das Schiff eingebaut.", - __CLASS__, - __LINE__, - $cabinInstance->getObjectDescription(), - $shipInstance->getShipName() - )); } // Wrapper fuer setDeckInstance->setPartInstance diff --git a/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php b/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php index 371a004..4ed75bb 100644 --- a/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php +++ b/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php @@ -29,33 +29,16 @@ class BaseDeckStructure extends BaseStructure { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Set description - $this->setObjectDescription("Deckstruktur"); } // Deckstruktur dem Schiff hinzufuegen public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $deckInstance) { - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Deck %s wird für das Schiff %s konstruiert.", - __CLASS__, - __LINE__, - $deckInstance->getObjectDescription(), - $shipInstance->getShipName() - )); - // Eltern-Methode aufrufen parent::addShipPartToShip($shipInstance, $deckInstance); // Andere Daten uebertragen und von der Quelle loeschen $this->setNumDecks($deckInstance->getNumDecks()); $deckInstance->removeNumDecks(); - - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Deck %s wurde in das Schiff %s eingebaut.", - __CLASS__, - __LINE__, - $deckInstance->getObjectDescription(), - $shipInstance->getShipName() - )); } // Deckanzahl entfernen diff --git a/application/ship-simu/main/structures/extended/class_BaseUpperStructure.php b/application/ship-simu/main/structures/extended/class_BaseUpperStructure.php index 5b2f1ed..a286017 100644 --- a/application/ship-simu/main/structures/extended/class_BaseUpperStructure.php +++ b/application/ship-simu/main/structures/extended/class_BaseUpperStructure.php @@ -24,13 +24,12 @@ class BaseUpperStructure extends BaseStructure { /** * Constructor for all super structures on a ship + * + * @return void */ protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Set description - $this->setObjectDescription("Aufbauten"); } } diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php index 4f7163d..b9fb2bf 100644 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php +++ b/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php @@ -26,15 +26,6 @@ class CarDeck extends BaseDeck implements TradeableItem, ConstructableShipPart { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Autodeck"); - - // Generate unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } // Autodeck erstellen diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php index 5fb92eb..059e5d0 100644 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php +++ b/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php @@ -26,15 +26,6 @@ class TrainDeck extends BaseDeck implements TradeableItem, ConstructableShipPart protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Zug-Deck"); - - // Generate unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } // LKW-Deck erstellen diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php index 75e342e..2da4fa4 100644 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php +++ b/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php @@ -27,15 +27,6 @@ class TruckDeck extends BaseDeck implements TradeableItem, ConstructableShipPart protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("LKW-Deck"); - - // Generate unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } // LKW-Deck erstellen diff --git a/application/ship-simu/main/structures/extended/decks/class_BaseDeck.php b/application/ship-simu/main/structures/extended/decks/class_BaseDeck.php index f806d61..aef2d45 100644 --- a/application/ship-simu/main/structures/extended/decks/class_BaseDeck.php +++ b/application/ship-simu/main/structures/extended/decks/class_BaseDeck.php @@ -24,13 +24,16 @@ class BaseDeck extends BaseDeckStructure { /** * Constructor for cargo decks in general + * + * @return void */ protected function __construct ($className) { // Call parent constructor parent::__construct($className); - // Set description - $this->setObjectDescription("Allgemeines Deck"); + // Clean up a little + $this->removeSystemArray(); + $this->removeNumberFormaters(); } } diff --git a/application/ship-simu/main/structures/extended/upper/class_Bridge.php b/application/ship-simu/main/structures/extended/upper/class_Bridge.php index ae3ca7d..3ce1d00 100644 --- a/application/ship-simu/main/structures/extended/upper/class_Bridge.php +++ b/application/ship-simu/main/structures/extended/upper/class_Bridge.php @@ -27,14 +27,9 @@ class Bridge extends BaseUpperStructure implements TradeableItem, ConstructableS // Call parent constructor parent::__construct(__CLASS__); - // Set description - $this->setObjectDescription("Brücke"); - - // Generate unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeSystemArray(); + $this->removeNumberFormaters(); $this->removePartInstance(); } diff --git a/application/ship-simu/main/user/class_ShipSimuBaseUser.php b/application/ship-simu/main/user/class_ShipSimuBaseUser.php index 911e91e..020d035 100644 --- a/application/ship-simu/main/user/class_ShipSimuBaseUser.php +++ b/application/ship-simu/main/user/class_ShipSimuBaseUser.php @@ -42,14 +42,14 @@ class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable { // Get max allowed companies to found $maxFound = $this->getConfigInstance()->readConfig('max_allowed_companies_found'); - // Get a company wrapper - $wrapperInstance = ObjectFactory::createObjectByConfiguredName('company_db_wrapper_class'); - // Now get a search criteria and set the user's name as criteria $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); $criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName()); $criteriaInstance->setLimit($maxFound); + // Get a company wrapper + $wrapperInstance = ObjectFactory::createObjectByConfiguredName('company_db_wrapper_class'); + // Do the count-select by criteria $totalRows = $wrapperInstance->doSelectCountByCriteria($criteriaInstance); @@ -83,7 +83,7 @@ class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable { } // END - if // Just forward this request to the user points class - $hasRequired = $pointsInstance->ifUserHasRequiredPoints ($action); + $hasRequired = $pointsInstance->ifUserHasRequiredPoints($action); // Return the result return $hasRequired; @@ -125,7 +125,7 @@ class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable { * * @return $bankLends Wether the money bank is able to lend money */ - public function ifUserAllowTakeCreditsFromMoneyBank () { + public function ifUserAllowedTakeCreditsFromMoneyBank () { // Per default the money bank cannot pay $bankLends = false; @@ -142,10 +142,12 @@ class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable { } // END - if // Does the money bank lend more money? + /** UNFINISHED PART! if ($bankInstance->ifBankLendsMoreMoney()) { // Okay, that they will do $bankLends = true; } // END - if + */ // Return result return $bankLends; @@ -175,10 +177,12 @@ class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable { } // END - if // Now check if the user has maximum credits + /** UNFINISHED PART! if ($bankInstance->ifUserHasMaxCredits()) { // Yes, he does! $hasMaxCredits = true; } // END - if + */ // Return the result return $hasMaxCredits; diff --git a/application/ship-simu/main/user/extended/class_ShipSimuGuest.php b/application/ship-simu/main/user/extended/class_ShipSimuGuest.php index 839e2d7..69d7763 100644 --- a/application/ship-simu/main/user/extended/class_ShipSimuGuest.php +++ b/application/ship-simu/main/user/extended/class_ShipSimuGuest.php @@ -33,18 +33,9 @@ class ShipSimuGuest extends ShipSimuBaseUser implements ManageableGuest { * @param $className Name of the class * @return void */ - protected function __construct ($className = "") { - // Is the class name empty? Then this is not a specialized user class - if (empty($className)) $className = __CLASS__; - + protected function __construct ($className = __CLASS__) { // Call parent constructor parent::__construct($className); - - // Set part description - $this->setObjectDescription("Special ship-simu class"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/application/ship-simu/main/user/extended/class_ShipSimuMember.php b/application/ship-simu/main/user/extended/class_ShipSimuMember.php index 25e76b7..a44718c 100644 --- a/application/ship-simu/main/user/extended/class_ShipSimuMember.php +++ b/application/ship-simu/main/user/extended/class_ShipSimuMember.php @@ -28,18 +28,22 @@ class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember { * @param $className Name of the class * @return void */ - protected function __construct ($className = "") { - // Is the class name empty? Then this is not a specialized user class - if (empty($className)) $className = __CLASS__; - + protected function __construct ($className = __CLASS__) { // Call parent constructor parent::__construct($className); + } - // Set part description - $this->setObjectDescription("Special member class for Ship-Simu"); + /** + * Destructor for e.g. flushing pending updates to the database + * + * @return void + */ + public function __destruct () { + // Flush any updated entries to the database + $this->flushPendingUpdates(); - // Create unique ID number - $this->generateUniqueId(); + // Call parent destructor + parent::__destruct(); } /** diff --git a/application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php b/application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php index 3f2ade6..752e409 100644 --- a/application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php +++ b/application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php @@ -39,12 +39,6 @@ class CompanyDatabaseWrapper extends BaseDatabaseWrapper { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A wrapper for database access to company data"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/application/ship-simu/main/wrapper/class_UserGovermentDatabaseWrapper.php b/application/ship-simu/main/wrapper/class_UserGovermentDatabaseWrapper.php new file mode 100644 index 0000000..8b668c3 --- /dev/null +++ b/application/ship-simu/main/wrapper/class_UserGovermentDatabaseWrapper.php @@ -0,0 +1,56 @@ +user data + * + * @author Roland Haeder + * @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 . + */ +class UserGovermentDatabaseWrapper extends BaseDatabaseWrapper { + // Constants for database tables + const DB_TABLE_USER_GOVERMENT = "gov_user"; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this wrapper class + * + * @return $wrapperInstance An instance of this wrapper class + */ + public final static function createUserGovermentDatabaseWrapper () { + // Create a new instance + $wrapperInstance = new UserGovermentDatabaseWrapper(); + + // Set (primary!) table name + $wrapperInstance->setTableName(self::DB_TABLE_USER_GOVERMENT); + + // Return the instance + return $wrapperInstance; + } +} + +// [EOF] +?> diff --git a/application/ship-simu/templates/de/code/action_login_company.ctp b/application/ship-simu/templates/de/code/action_login_company.ctp index 937cd44..584136f 100644 --- a/application/ship-simu/templates/de/code/action_login_company.ctp +++ b/application/ship-simu/templates/de/code/action_login_company.ctp @@ -2,32 +2,72 @@ // Get a link helper instance $linkInstance = WebLinkHelper::createWebLinkHelper($this, 'company_links', 'index.php?app=ship-simu&page=login_area'); -// Preftech the user data +// Prefetch the user data $linkInstance->prefetchValueInstance('user'); +// Add link group for company founder +$linkInstance->addLinkGroup('company_founder', "Vielleicht willst du eine virtuelle Reederei gründen, um dich virtuell selbstständig zu machen?"); + // Maximum of allowed companies reached? if ($linkInstance->getValueInstance()->ifUserCreatedMaximumAllowedCompanies()) { - // No more companies allowed to create + // No more companies allowed to found + $linkInstance->addLinkNote("Du hast zu viele Firmen gegründet. Bitte denke über eine Fusion (Zusammenlegung) nach."); } elseif ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('found_new_company')) { // Enough money to found company -} elseif ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('write_applications')) { + $linkInstance->addActionLink('company_found', "Gründe eine virtuelle Firma und mache dich (virtuell) selbstständig."); +} else { + // No more money left for founding company so place link here to refill page/money bank + if ($linkInstance->getValueInstance()->ifUserAllowedTakeCreditsFromMoneyBank()) { + // Display link to money bank page + $linkInstance->addActionLink('moneybank', "Jetzt deinen Kredit tilgen."); + } elseif ($linkInstance->getValueInstance()->ifUserHasMaximumCreditsWithMoneyBank()) { + // Maximum credits reached which a money bank can lent + $linkInstance->addLinkNote("Die Bank kann dir kein Geld mehr leihen, bitte zahle es auch wieder zurück."); + $linkInstance->addActionLink('moneybank&sub=payback_credits', "Jetzt deinen Kredit tilgen."); + } else { + // Money bank is closed! + $linkInstance->addLinkNote("Die Bank hat derzeit geschlossen. Bitte später nochmal versuchen."); + } +} + +// Add link group for goverment +$linkInstance->addLinkGroup('goverment', "Bewerbe dich bei anderen Firmen und hole dir eine Starthilfe vom Staat ab wenn du nicht flüssig bist!"); + +if ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('write_applications')) { // Enough money to write applications to other companies + $linkInstance->addActionLink('company_list', "Alle Firmen auflisten zum Bewerben."); } elseif ($linkInstance->getValueInstance()->ifGovermentPaysStartupHelp()) { // Display link to goverment for startup help -} // END - if + $linkInstance->addActionLink('goverment&sub=request&request=startup_help', "Direkt zum Antragsformular für deine Starthilfe."); +} else { + // Even goverment cannot help the gamer here + $linkInstance->addLinkNote("Leider kann dir der Staat nicht mehr weiterhelfen, dich zu bewerben, da du zu oft Starthilfen erhalten hast. Hier muss aber noch weiter am Spiel gearbeitet werden. :-)"); +} + +// Add link group for money bank +$linkInstance->addLinkGroup('moneybank', "Leihe dir zu günstigen Zinsen virtuelles Geld aus, wenn du mehr brauchst!"); -if ($linkInstance->getValueInstance()->ifUserAllowTakeCreditsFromMoneyBank()) { +if ($linkInstance->getValueInstance()->ifUserAllowedTakeCreditsFromMoneyBank()) { // Display link to money bank page + $linkInstance->addActionLink('moneybank', "Jetzt deinen Kredit tilgen."); } elseif ($linkInstance->getValueInstance()->ifUserHasMaximumCreditsWithMoneyBank()) { // Maximum credits reached which a money bank can lent + $linkInstance->addLinkNote("Die Bank kann dir kein Geld mehr leihen, bitte zahle es auch wieder zurück."); + $linkInstance->addActionLink('moneybank&sub=payback_credits', "Jetzt deinen Kredit tilgen."); } else { // Money bank is closed! + $linkInstance->addLinkNote("Die Bank hat derzeit geschlossen. Bitte später nochmal versuchen."); } +// Add link group for refill page +$linkInstance->addLinkGroup('refill_page', "Hole dir virtuelles Geld von uns zu fairen Preisen!"); + if ($linkInstance->ifRefillPageActive()) { // Display link to refill page + $linkInstance->addActionLink('money_refill', "Jetzt dein virtuelles Geld aufladen."); } else { // Refill page not active + $linkInstance->addLinkNote("Das Aufladen ist derzeit nicht möglich oder gestört und wurde von uns deaktiviert."); } // Flush content to the template @@ -35,14 +75,16 @@ $linkInstance->flushContent(); // End of PHP commands ?> -
- Auflistung der Reedereien, an denenen du dich beteiligst: -
+
+
+ Auflistung der Reedereien, an denenen du dich beteiligst: +
-
- {?company_list?} -
+
+ {?company_list?} +
- diff --git a/db/gov_user/.htaccess b/db/gov_user/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/db/gov_user/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/exceptions/helper/class_NoGroupOpenedException.php b/inc/classes/exceptions/helper/class_NoGroupOpenedException.php new file mode 100644 index 0000000..c650070 --- /dev/null +++ b/inc/classes/exceptions/helper/class_NoGroupOpenedException.php @@ -0,0 +1,46 @@ + + * @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 . + */ +class NoGroupOpenedException extends FrameworkException { + /** + * The constructor + * + * @param $msgArray Array containing exception data + * @param $code Code number for the exception + * @return void + */ + public function __construct (array $msgArray, $code) { + // Add a message around the missing class + $message = sprintf("[%s:%d] Group not opened before. Raw text follows: %s", + $msgArray[0]->__toString(), + $this->getLine(), + $msgArray[1] + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/inc/classes/exceptions/main/class_InvalidObjectException.php b/inc/classes/exceptions/main/class_InvalidObjectException.php index dc6cd4e..7a002d4 100644 --- a/inc/classes/exceptions/main/class_InvalidObjectException.php +++ b/inc/classes/exceptions/main/class_InvalidObjectException.php @@ -31,10 +31,9 @@ class InvalidObjectException extends FrameworkException { */ public function __construct (FrameworkInterface $class, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Objects of type %s are not allowed here.", + $message = sprintf("[%s:%d] Object is not allowed here.", $class->__toString(), - $this->getLine(), - $class->getObjectDescription() + $this->getLine() ); // Call parent constructor diff --git a/inc/classes/main/actions/class_ b/inc/classes/main/actions/class_ index 61e4cd2..a34ccda 100644 --- a/inc/classes/main/actions/class_ +++ b/inc/classes/main/actions/class_ @@ -30,12 +30,6 @@ class ???Action extends BaseAction implements Commandable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription(""); - - // Generate unique key - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php b/inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php index c079c92..068090e 100644 --- a/inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php +++ b/inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php @@ -30,12 +30,6 @@ class LoginAfterRegistrationAction extends BaseAction implements PerformableActi protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Post registration action for logging in"); - - // Generate unique key - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/actions/web/class_WebLoginLogoutAction.php b/inc/classes/main/actions/web/class_WebLoginLogoutAction.php index 4e2d69e..bf65545 100644 --- a/inc/classes/main/actions/web/class_WebLoginLogoutAction.php +++ b/inc/classes/main/actions/web/class_WebLoginLogoutAction.php @@ -30,12 +30,6 @@ class WebLoginLogoutAction extends BaseAction implements Commandable, Registerab protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Logout action"); - - // Generate unique key - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/actions/web/class_WebLoginProfileAction.php b/inc/classes/main/actions/web/class_WebLoginProfileAction.php index e7410e4..3ed47c0 100644 --- a/inc/classes/main/actions/web/class_WebLoginProfileAction.php +++ b/inc/classes/main/actions/web/class_WebLoginProfileAction.php @@ -30,12 +30,6 @@ class WebLoginProfileAction extends BaseAction implements Commandable, Registera protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Web profile action"); - - // Generate unique key - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/auth/class_CookieAuth.php b/inc/classes/main/auth/class_CookieAuth.php index c20727f..6ef5504 100644 --- a/inc/classes/main/auth/class_CookieAuth.php +++ b/inc/classes/main/auth/class_CookieAuth.php @@ -31,12 +31,6 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Cookie-based login"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/cache/class_MemoryCache.php b/inc/classes/main/cache/class_MemoryCache.php index dcf3783..840519d 100644 --- a/inc/classes/main/cache/class_MemoryCache.php +++ b/inc/classes/main/cache/class_MemoryCache.php @@ -36,12 +36,6 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Memory cache"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/class_ b/inc/classes/main/class_ index 4e1385b..df22004 100644 --- a/inc/classes/main/class_ +++ b/inc/classes/main/class_ @@ -31,12 +31,6 @@ class extends BaseFrameworkSystem { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription(""); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index e0716d7..198280b 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -83,16 +83,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ private $realClass = "FrameworkSystem"; - /** - * A human-readable description for this simulator part - */ - private $objectDescription = "Namenlose Framework-Einheit"; - - /** - * The unique ID string for identifying all type of classes - */ - private $uniqueID = ""; - /** * Thousands seperator */ @@ -218,9 +208,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Is this object already destroyed? if ($this->__toString() != 'DestructedObject') { // Destroy all informations about this class but keep some text about it alive - $this->setObjectDescription(sprintf("Removed object %s", $this->__toString())); $this->setRealClass('DestructedObject'); - $this->resetUniqueID(); } elseif ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) { // Already destructed object $this->debugOutput(sprintf("[%s:] The object %s is already destroyed.", @@ -563,172 +551,16 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $this->realClass = $realClass; } - /** - * Generate unique ID from a lot entropy - * - * @return void - */ - public final function generateUniqueId () { - // Is the id set for this class? - if (empty($this->uniqueID)) { - - // Correct missing class name - $corrected = false; - if ($this->__toString() == "") { - $this->setRealClass(__CLASS__); - $corrected = true; - } - - // Cache datbase instance - $db = $this->getDatabaseInstance(); - - // Generate new id - $tempID = false; - while (true) { - // Generate a unique ID number - $tempID = $this->generateIdNumber(); - $isUsed = false; - - // Try to figure out if the ID number is not yet used - try { - // Is this a registry? - if ($this->__toString() == "Registry") { - // Registry, then abort here - break; - } elseif (is_object($db)) { - $isUsed = $db->isUniqueIdUsed($tempID, true); - } - } catch (FrameworkException $e) { - // Catches all and ignores all ;-) - } - - if ( - ( - $tempID !== false - ) && ( - ( - $db === null - ) || ( - ( - is_object($db) - ) && ( - !$isUsed - ) - ) - ) - ) { - // Abort the loop - break; - } - } // END - while - - // Apply the new ID - $this->setUniqueID($tempID); - - // Revert maybe corrected class name - if ($corrected) { - $this->setRealClass(""); - } - - // Remove system classes if we are in a system class - if ((isset($this->systemClasses)) && (in_array($this->__toString(), $this->systemClasses))) { - // This may save some RAM... - $this->removeSystemArray(); - } - } - } - - /** - * Generates a new ID number for classes based from the class' real name, - * the description and some random data - * - * @return $tempID The new (temporary) ID number - */ - private final function generateIdNumber () { - return sprintf("%s@%s", - $this->__toString(), - md5(sprintf("%s:%s:%s:%s:%s:%s", - $this->__toString(), - $this->getObjectDescription(), - time(), - getenv('REMOTE_ADDR'), - getenv('SERVER_ADDR'), - mt_rand() - )) - ); - } - - /** - * Setter for unique ID - * - * @param $uniqueID The newly generated unique ID number - * @return void - */ - private final function setUniqueID ($uniqueID) { - // Cast to string - $uniqueID = (string) $uniqueID; - - // Set the ID number - $this->uniqueID = $uniqueID; - } - - /** - * Getter for unique ID - * - * @return $uniqueID The unique ID of this class - */ - public final function getUniqueID () { - return $this->uniqueID; - } - - /** - * Resets or recreates the unique ID number - * - * @return void - */ - public final function resetUniqueID() { - // Sweet and simple... ;-) - $newUniqueID = $this->generateIdNumber(); - $this->setUniqueID($newUniqueID); - } - - /** - * Getter for simulator description - * - * @return $objectDescription The description of this simulation part - */ - public final function getObjectDescription () { - return $this->objectDescription; - } - - /** - * Setter for simulation part description - * - * @param $objectDescription The description as string for this simulation part - * @return void - */ - public final function setObjectDescription ($objectDescription) { - $this->objectDescription = (String) $objectDescription; - } - - /** - * Validate if given object is the same as current - * - * @param $object An object instance for comparison with this class - * @return boolean The result of comparing both's unique ID - */ - public final function equals (FrameworkInterface $object) { - return ($this->getUniqueID() == $object->getUniqueID()); - } - /** * Compare if both simulation part description and class name matches * (shall be enough) * * @param $itemInstance An object instance to an other class * @return boolean The result of comparing class name simulation part description + * @deprecated */ public function itemMatches ($itemInstance) { + $this->partialStub("Deprecated!"); return ( ( $this->__toString() == $itemInstance->__toString() @@ -838,40 +670,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { unset($this->systemClasses); } - /** - * Create a file name and path name from the object's unique ID number. - * The left part of the ID shall always be a valid class name and the - * right part an ID number. - * - * @return $pfn The file name with a prepended path name - * @throws NoArrayCreatedException If explode() fails to create an array - * @throws InvalidArrayCountException If the array contains less or - * more than two elements - */ - public final function getPathFileNameFromObject () { - // Get the main object's unique ID. We use this as a path/filename combination - $pathFile = $this->getUniqueID(); - - // Split it up in path and file name - $pathFile = explode("@", $pathFile); - - // Are there two elements? Index 0 is the path, 1 the file name + global extension - if (!is_array($pathFile)) { - // No array found - throw new NoArrayCreatedException(array($this, 'pathFile'), self::EXCEPTION_ARRAY_EXPECTED); - } elseif (count($pathFile) != 2) { - // Invalid ID returned! - throw new InvalidArrayCountException(array($this, 'pathFile', count($pathFile), 2), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT); - } - - // Auto-append missing trailing slash - $pathFile[0] = $this->addMissingTrailingSlash($pathFile[0]); - - // Create the file name and return it - $pfn = ($pathFile[0] . $pathFile[1]); - return $pfn; - } - /** * Appends a trailing slash to a string * @@ -1089,11 +887,13 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $markedCode Marked PHP code */ public function markupCode ($phpCode) { + // Init marked code + $markedCode = ""; + // Get last error $errorArray = error_get_last(); // Init the code with error message - $markedCode = ""; if (is_array($errorArray)) { // Get error infos $markedCode = sprintf("
File: %s, Line: %s, Message: %s, Type: %s
", @@ -1108,7 +908,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { foreach (explode("\n", $phpCode) as $lineNo=>$code) { // Add line numbers $markedCode .= sprintf("%s: %s\n", - ($lineNo+1), + ($lineNo + 1), htmlentities($code, ENT_QUOTES) ); } // END - foreach @@ -1118,9 +918,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { } /** - * Filter a given timestamp to make it look more beatifull for web-based - * front-ends. If null is given a message id null_timestamp will be - * resolved and returned. + * Filter a given GMT timestamp (non Uni* stamp!) to make it look more + * beatiful for web-based front-ends. If null is given a message id + * null_timestamp will be resolved and returned. * * @param $timestamp Timestamp to prepare (filter) for display * @return $readable A readable timestamp @@ -1134,7 +934,28 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Get a message string $readable = $this->getLanguageInstance()->getMessage('null_timestamp'); } else { - $this->partialStub("Do further analysis on timestamp {$timestamp}."); + switch ($this->getLanguageInstance()->getLanguageCode()) { + case "de": // German format is a bit different to default + // Split the GMT stamp up + $dateTime = explode(" ", $timestamp); + $dateArray = explode("-", $dateTime[0]); + $timeArray = explode(":", $dateTime[1]); + + // Construct the timestamp + $readable = sprintf($this->getConfigInstance()->readConfig('german_date_time'), + $dateArray[0], + $dateArray[1], + $dateArray[2], + $timeArray[0], + $timeArray[1], + $timeArray[2] + ); + break; + + default: // Default is pass-through + $readable = $timestamp; + break; + } } // Return the stamp diff --git a/inc/classes/main/commands/class_ b/inc/classes/main/commands/class_ index ec58ecd..cac39ce 100644 --- a/inc/classes/main/commands/class_ +++ b/inc/classes/main/commands/class_ @@ -30,15 +30,6 @@ class ???Command extends BaseCommand implements Commandable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set special description - $this->setObjectDescription(""); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/commands/image/class_ImageCodeCaptchaCommand.php b/inc/classes/main/commands/image/class_ImageCodeCaptchaCommand.php index 1ece666..8c6794d 100644 --- a/inc/classes/main/commands/image/class_ImageCodeCaptchaCommand.php +++ b/inc/classes/main/commands/image/class_ImageCodeCaptchaCommand.php @@ -30,15 +30,6 @@ class ImageCodeCaptchaCommand extends BaseCommand implements Commandable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set special description - $this->setObjectDescription(""); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/commands/web/class_WebConfirmCommand.php b/inc/classes/main/commands/web/class_WebConfirmCommand.php index 5bfa866..db15067 100644 --- a/inc/classes/main/commands/web/class_WebConfirmCommand.php +++ b/inc/classes/main/commands/web/class_WebConfirmCommand.php @@ -30,15 +30,6 @@ class WebConfirmCommand extends BaseCommand implements Commandable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set special description - $this->setObjectDescription("Command for confirmation link handling"); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/commands/web/class_WebDoFormCommand.php b/inc/classes/main/commands/web/class_WebDoFormCommand.php index 03a6367..d34e16f 100644 --- a/inc/classes/main/commands/web/class_WebDoFormCommand.php +++ b/inc/classes/main/commands/web/class_WebDoFormCommand.php @@ -30,15 +30,6 @@ class WebDoFormCommand extends BaseCommand implements Commandable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set special description - $this->setObjectDescription("Command for handling forms on a centralized place"); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/commands/web/class_WebHomeCommand.php b/inc/classes/main/commands/web/class_WebHomeCommand.php index 577968e..14a7a9c 100644 --- a/inc/classes/main/commands/web/class_WebHomeCommand.php +++ b/inc/classes/main/commands/web/class_WebHomeCommand.php @@ -30,15 +30,6 @@ class WebHomeCommand extends BaseCommand implements Commandable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set special description - $this->setObjectDescription("Command for the "home" page"); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php index eae3413..9f2c1cf 100644 --- a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php @@ -35,15 +35,6 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set special description - $this->setObjectDescription("Command for the "login area" page"); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/commands/web/class_WebLoginCommand.php b/inc/classes/main/commands/web/class_WebLoginCommand.php index 6dbb59e..e02e2b5 100644 --- a/inc/classes/main/commands/web/class_WebLoginCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginCommand.php @@ -30,15 +30,6 @@ class WebLoginCommand extends BaseCommand implements Commandable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set special description - $this->setObjectDescription("Command for the login form page"); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/commands/web/class_WebLoginFailedCommand.php b/inc/classes/main/commands/web/class_WebLoginFailedCommand.php index a60bb8e..9981133 100644 --- a/inc/classes/main/commands/web/class_WebLoginFailedCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginFailedCommand.php @@ -30,15 +30,6 @@ class WebLoginFailedCommand extends BaseCommand implements Commandable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set special description - $this->setObjectDescription("Command for the "login failed" page"); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php b/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php index 73dd4d6..15ecb70 100644 --- a/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php +++ b/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php @@ -30,15 +30,6 @@ class WebLogoutDoneCommand extends BaseCommand implements Commandable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set special description - $this->setObjectDescription("Command for the "logout done" page"); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/commands/web/class_WebRegisterCommand.php b/inc/classes/main/commands/web/class_WebRegisterCommand.php index 5b4d0b1..42f9379 100644 --- a/inc/classes/main/commands/web/class_WebRegisterCommand.php +++ b/inc/classes/main/commands/web/class_WebRegisterCommand.php @@ -30,15 +30,6 @@ class WebRegisterCommand extends BaseCommand implements Commandable, Registerabl protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set special description - $this->setObjectDescription("Command for the registration form"); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/commands/web/class_WebResendLinkCommand.php b/inc/classes/main/commands/web/class_WebResendLinkCommand.php index 3c69b34..c6ba2a6 100644 --- a/inc/classes/main/commands/web/class_WebResendLinkCommand.php +++ b/inc/classes/main/commands/web/class_WebResendLinkCommand.php @@ -30,15 +30,6 @@ class WebResendLinkCommand extends BaseCommand implements Commandable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set special description - $this->setObjectDescription("Command for resending confirmation link"); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/compressor/class_Bzip2Compressor.php b/inc/classes/main/compressor/class_Bzip2Compressor.php index 6fe5d5c..50a4bad 100644 --- a/inc/classes/main/compressor/class_Bzip2Compressor.php +++ b/inc/classes/main/compressor/class_Bzip2Compressor.php @@ -30,12 +30,6 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor { protected function __construct () { // Call parent constructor! parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("BZIP2 compressor"); - - // Create an unique ID - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/compressor/class_GzipCompressor.php b/inc/classes/main/compressor/class_GzipCompressor.php index d2e7577..b4a3025 100644 --- a/inc/classes/main/compressor/class_GzipCompressor.php +++ b/inc/classes/main/compressor/class_GzipCompressor.php @@ -30,12 +30,6 @@ class GzipCompressor extends BaseFrameworkSystem implements Compressor { protected function __construct () { // Call parent constructor! parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("GZIP compressor"); - - // Create an unique ID - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/compressor/class_NullCompressor.php b/inc/classes/main/compressor/class_NullCompressor.php index 8e5bbd9..24128bc 100644 --- a/inc/classes/main/compressor/class_NullCompressor.php +++ b/inc/classes/main/compressor/class_NullCompressor.php @@ -30,12 +30,6 @@ class NullCompressor extends BaseFrameworkSystem implements Compressor { protected function __construct () { // Call parent constructor! parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Null compressor"); - - // Create an unique ID - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/console/class_ConsoleTools.php b/inc/classes/main/console/class_ConsoleTools.php index 80433e3..3b49f72 100644 --- a/inc/classes/main/console/class_ConsoleTools.php +++ b/inc/classes/main/console/class_ConsoleTools.php @@ -30,12 +30,6 @@ class ConsoleTools extends BaseFrameworkSystem { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("General console tools"); - - // Create an unique ID - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/captcha/class_ImageCodeCaptchaController.php b/inc/classes/main/controller/captcha/class_ImageCodeCaptchaController.php index f6ca911..e84fca7 100644 --- a/inc/classes/main/controller/captcha/class_ImageCodeCaptchaController.php +++ b/inc/classes/main/controller/captcha/class_ImageCodeCaptchaController.php @@ -30,12 +30,6 @@ class ImageCodeCaptchaController extends BaseController implements Controller { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription(""); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/class_ b/inc/classes/main/controller/class_ index 34c80ff..a6cea16 100644 --- a/inc/classes/main/controller/class_ +++ b/inc/classes/main/controller/class_ @@ -30,12 +30,6 @@ class ???Controller extends BaseController implements Controller { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription(""); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/form/class_WebDoFormController.php b/inc/classes/main/controller/form/class_WebDoFormController.php index a995bd2..e760492 100644 --- a/inc/classes/main/controller/form/class_WebDoFormController.php +++ b/inc/classes/main/controller/form/class_WebDoFormController.php @@ -30,12 +30,6 @@ class WebDoFormController extends BaseController implements Controller { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Controller for handling forms"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/image/class_ImageDefaultController.php b/inc/classes/main/controller/image/class_ImageDefaultController.php index ccd458e..689cee4 100644 --- a/inc/classes/main/controller/image/class_ImageDefaultController.php +++ b/inc/classes/main/controller/image/class_ImageDefaultController.php @@ -30,15 +30,6 @@ class ImageDefaultController extends BaseController implements Controller { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Default image controller"); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/controller/login/class_WebLoginAreaController.php b/inc/classes/main/controller/login/class_WebLoginAreaController.php index 7914e2e..1a1900c 100644 --- a/inc/classes/main/controller/login/class_WebLoginAreaController.php +++ b/inc/classes/main/controller/login/class_WebLoginAreaController.php @@ -30,12 +30,6 @@ class WebLoginAreaController extends BaseController implements Controller { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Default controller with news"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/web/class_WebConfirmController.php b/inc/classes/main/controller/web/class_WebConfirmController.php index 975d518..64c845d 100644 --- a/inc/classes/main/controller/web/class_WebConfirmController.php +++ b/inc/classes/main/controller/web/class_WebConfirmController.php @@ -30,12 +30,6 @@ class WebConfirmController extends BaseController implements Controller { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Controller for confirmation link handling"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/web/class_WebDefaultController.php b/inc/classes/main/controller/web/class_WebDefaultController.php index 2e9ac3f..37cf3d9 100644 --- a/inc/classes/main/controller/web/class_WebDefaultController.php +++ b/inc/classes/main/controller/web/class_WebDefaultController.php @@ -31,12 +31,6 @@ class WebDefaultController extends BaseController implements Controller { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Default controller for all other web requests"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/web/class_WebDefaultNewsController.php b/inc/classes/main/controller/web/class_WebDefaultNewsController.php index 5475572..1f6c0cc 100644 --- a/inc/classes/main/controller/web/class_WebDefaultNewsController.php +++ b/inc/classes/main/controller/web/class_WebDefaultNewsController.php @@ -30,12 +30,6 @@ class WebDefaultNewsController extends BaseController implements Controller { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Default controller with news"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/web/class_WebLoginController.php b/inc/classes/main/controller/web/class_WebLoginController.php index 4b10387..f4ce053 100644 --- a/inc/classes/main/controller/web/class_WebLoginController.php +++ b/inc/classes/main/controller/web/class_WebLoginController.php @@ -31,12 +31,6 @@ class WebLoginController extends BaseController implements Controller { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Controller for login form"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/web/class_WebLoginFailedController.php b/inc/classes/main/controller/web/class_WebLoginFailedController.php index ca49d89..5b39ab0 100644 --- a/inc/classes/main/controller/web/class_WebLoginFailedController.php +++ b/inc/classes/main/controller/web/class_WebLoginFailedController.php @@ -30,12 +30,6 @@ class WebLoginFailedController extends BaseController implements Controller { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Login failed controller"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/web/class_WebLogoutDoneController.php b/inc/classes/main/controller/web/class_WebLogoutDoneController.php index 061354a..58058b1 100644 --- a/inc/classes/main/controller/web/class_WebLogoutDoneController.php +++ b/inc/classes/main/controller/web/class_WebLogoutDoneController.php @@ -30,12 +30,6 @@ class WebLogoutDoneController extends BaseController implements Controller { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Controller for login form"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/web/class_WebRegisterController.php b/inc/classes/main/controller/web/class_WebRegisterController.php index bcbd69e..c848c47 100644 --- a/inc/classes/main/controller/web/class_WebRegisterController.php +++ b/inc/classes/main/controller/web/class_WebRegisterController.php @@ -30,12 +30,6 @@ class WebRegisterController extends BaseController implements Controller { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Controller for register form"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/web/class_WebStatusController.php b/inc/classes/main/controller/web/class_WebStatusController.php new file mode 100644 index 0000000..843e05c --- /dev/null +++ b/inc/classes/main/controller/web/class_WebStatusController.php @@ -0,0 +1,76 @@ + + * @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 + * @todo This controller shall still provide some headlines for sidebars + * + * 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 . + */ +class WebStatusController extends BaseController implements Controller { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @param $resolverInstance An instance of a command resolver class + * @return $controllerInstance A prepared instance of this class + */ + public final static function createWebStatusController (CommandResolver $resolverInstance) { + // Create the instance + $controllerInstance = new WebStatusController(); + + // Set the command resolver + $controllerInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $controllerInstance; + } + + /** + * Handles the given request and response + * + * @param $requestInstance An instance of a request class + * @param $responseInstance An instance of a response class + * @return void + */ + public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) { + // Get the command instance + $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance); + + // This request was valid! :-D + $requestInstance->requestIsValid(); + + // Execute the command + $commandInstance->execute($requestInstance, $responseInstance); + + // Flush the response out + $responseInstance->flushBuffer(); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/criteria/class_DataSetCriteria.php b/inc/classes/main/criteria/class_DataSetCriteria.php index 61bdb32..34715c5 100644 --- a/inc/classes/main/criteria/class_DataSetCriteria.php +++ b/inc/classes/main/criteria/class_DataSetCriteria.php @@ -52,12 +52,6 @@ class DataSetCriteria extends BaseFrameworkSystem implements StoreableCriteria { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Storeable data set for databases"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/criteria/class_SearchCriteria.php b/inc/classes/main/criteria/class_SearchCriteria.php index d6e2c1c..b9f27db 100644 --- a/inc/classes/main/criteria/class_SearchCriteria.php +++ b/inc/classes/main/criteria/class_SearchCriteria.php @@ -48,12 +48,6 @@ class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Search criteria class"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/criteria/class_UpdateCriteria.php b/inc/classes/main/criteria/class_UpdateCriteria.php index c5ba2ed..af3f6a5 100644 --- a/inc/classes/main/criteria/class_UpdateCriteria.php +++ b/inc/classes/main/criteria/class_UpdateCriteria.php @@ -48,12 +48,6 @@ class UpdateCriteria extends BaseFrameworkSystem implements LocalUpdateCriteria // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Update criteria class"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/crypto/class_CryptoHelper.php b/inc/classes/main/crypto/class_CryptoHelper.php index 4583bd7..2ebafd8 100644 --- a/inc/classes/main/crypto/class_CryptoHelper.php +++ b/inc/classes/main/crypto/class_CryptoHelper.php @@ -50,12 +50,6 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Cryptographical helper"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/database/class_ b/inc/classes/main/database/class_ index c97202d..1fdbd07 100644 --- a/inc/classes/main/database/class_ +++ b/inc/classes/main/database/class_ @@ -32,12 +32,6 @@ class extends BaseDatabaseFrontend { // Call parent constructor parent::__construct($class); - // Set part description - $this->setObjectDescription(""); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/database/class_BaseDatabaseWrapper.php b/inc/classes/main/database/class_BaseDatabaseWrapper.php index 7a4ee57..e406938 100644 --- a/inc/classes/main/database/class_BaseDatabaseWrapper.php +++ b/inc/classes/main/database/class_BaseDatabaseWrapper.php @@ -101,6 +101,29 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem { return $resultInstance; } + /** + * Count the numbers of rows we shall receive + * + * @param $criteriaInstance An instance of a Criteria class + * @return $numRows Numbers of rows of database entries + */ + public function doSelectCountByCriteria (Criteria $criteriaInstance) { + // Total numbers is zero by default + $numRows = 0; + + // Get the result from above method + $resultInstance = $this->doSelectByCriteria($criteriaInstance); + + // Was that query fine? + if ($resultInstance->ifStatusIsOkay()) { + // Then get the number of rows + $numRows = $resultInstance->getAffectedRows(); + } // END - if + + // Return the result + return $numRows; + } + /** * Setter for table name * diff --git a/inc/classes/main/database/databases/class_LocalFileDatabase.php b/inc/classes/main/database/databases/class_LocalFileDatabase.php index 60fb4d3..69ce662 100644 --- a/inc/classes/main/database/databases/class_LocalFileDatabase.php +++ b/inc/classes/main/database/databases/class_LocalFileDatabase.php @@ -80,13 +80,8 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend // Call parent constructor parent::__construct(__CLASS__); - // Set description - $this->setObjectDescription("Class for local file databases"); - - // Create unique ID - $this->generateUniqueId(); - // Clean up a little + $this->removeNumberFormaters(); $this->removeSystemArray(); } diff --git a/inc/classes/main/database/wrapper/class_NewsDatabaseWrapper.php b/inc/classes/main/database/wrapper/class_NewsDatabaseWrapper.php index f3753f3..9a87e6a 100644 --- a/inc/classes/main/database/wrapper/class_NewsDatabaseWrapper.php +++ b/inc/classes/main/database/wrapper/class_NewsDatabaseWrapper.php @@ -33,12 +33,6 @@ class NewsDatabaseWrapper extends BaseDatabaseWrapper { protected function __construct() { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Database wrapper for news objects"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php b/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php index 0669cb8..1bbbf03 100644 --- a/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php +++ b/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php @@ -42,12 +42,6 @@ class UserDatabaseWrapper extends BaseDatabaseWrapper { protected function __construct() { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Database wrapper for user objects"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/database/wrapper/class_UserPointsDatabaseWrapper.php b/inc/classes/main/database/wrapper/class_UserPointsDatabaseWrapper.php index c5490d3..0a8af18 100644 --- a/inc/classes/main/database/wrapper/class_UserPointsDatabaseWrapper.php +++ b/inc/classes/main/database/wrapper/class_UserPointsDatabaseWrapper.php @@ -33,12 +33,6 @@ class UserPointsDatabaseWrapper extends BaseDatabaseWrapper { protected function __construct() { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Database wrapper for user points objects"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/debug/class_DebugConsoleOutput.php b/inc/classes/main/debug/class_DebugConsoleOutput.php index 2d3305d..b9db256 100644 --- a/inc/classes/main/debug/class_DebugConsoleOutput.php +++ b/inc/classes/main/debug/class_DebugConsoleOutput.php @@ -30,12 +30,6 @@ class DebugConsoleOutput extends BaseFrameworkSystem implements Debugger, Output protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Debug output for the console"); - - // Create an unique ID - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/debug/class_DebugErrorLogOutput.php b/inc/classes/main/debug/class_DebugErrorLogOutput.php index d20093a..0d30d4f 100644 --- a/inc/classes/main/debug/class_DebugErrorLogOutput.php +++ b/inc/classes/main/debug/class_DebugErrorLogOutput.php @@ -30,12 +30,6 @@ class DebugErrorLogOutput extends BaseFrameworkSystem implements Debugger, Outpu protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Debug output to error_log()"); - - // Create an unique ID - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/debug/class_DebugWebOutput.php b/inc/classes/main/debug/class_DebugWebOutput.php index 353ccac..268738a 100644 --- a/inc/classes/main/debug/class_DebugWebOutput.php +++ b/inc/classes/main/debug/class_DebugWebOutput.php @@ -30,12 +30,6 @@ class DebugWebOutput extends BaseFrameworkSystem implements Debugger, OutputStre protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Debug output for webpages"); - - // Create an unique ID - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/factories/cache/class_CacheFactory.php b/inc/classes/main/factories/cache/class_CacheFactory.php index 94c037d..2938b87 100644 --- a/inc/classes/main/factories/cache/class_CacheFactory.php +++ b/inc/classes/main/factories/cache/class_CacheFactory.php @@ -35,12 +35,6 @@ class CacheFactory extends BaseFactory { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set object description - $this->setObjectDescription("Factory for cache objects"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/factories/objects/class_ObjectFactory.php b/inc/classes/main/factories/objects/class_ObjectFactory.php index 984bd25..06c73d8 100644 --- a/inc/classes/main/factories/objects/class_ObjectFactory.php +++ b/inc/classes/main/factories/objects/class_ObjectFactory.php @@ -35,12 +35,6 @@ class ObjectFactory extends BaseFactory { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set object description - $this->setObjectDescription("Simple generic object factory"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/factories/web/class_WebNewsFactory.php b/inc/classes/main/factories/web/class_WebNewsFactory.php index b904922..d7307ec 100644 --- a/inc/classes/main/factories/web/class_WebNewsFactory.php +++ b/inc/classes/main/factories/web/class_WebNewsFactory.php @@ -35,12 +35,6 @@ class WebNewsFactory extends BaseFactory { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Factory for webpages with news"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/auth/class_UserAuthFilter.php b/inc/classes/main/filter/auth/class_UserAuthFilter.php index 5c871cd..b08d0c2 100644 --- a/inc/classes/main/filter/auth/class_UserAuthFilter.php +++ b/inc/classes/main/filter/auth/class_UserAuthFilter.php @@ -38,12 +38,6 @@ class UserAuthFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A user authorization filter"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/change/class_EmailChangeFilter.php b/inc/classes/main/filter/change/class_EmailChangeFilter.php index c427fd6..e64c2f1 100644 --- a/inc/classes/main/filter/change/class_EmailChangeFilter.php +++ b/inc/classes/main/filter/change/class_EmailChangeFilter.php @@ -30,12 +30,6 @@ class EmailChangeFilter extends BaseFrameworkSystem implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for email changes"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/change/class_PasswordChangeFilter.php b/inc/classes/main/filter/change/class_PasswordChangeFilter.php index fd39880..078d294 100644 --- a/inc/classes/main/filter/change/class_PasswordChangeFilter.php +++ b/inc/classes/main/filter/change/class_PasswordChangeFilter.php @@ -30,12 +30,6 @@ class PasswordChangeFilter extends BaseFrameworkSystem implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for password change"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php b/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php index 434586b..85e945e 100644 --- a/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php +++ b/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php @@ -32,12 +32,6 @@ class RulesAcceptedFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for checking if rules where accepted"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/class_ b/inc/classes/main/filter/class_ index 78cfb6b..9027c5d 100644 --- a/inc/classes/main/filter/class_ +++ b/inc/classes/main/filter/class_ @@ -31,12 +31,6 @@ class ???Filter extends BaseFrameworkSystem implements Filterable { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("A concrete filter"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/filter/class_FilterChain.php b/inc/classes/main/filter/class_FilterChain.php index 79441bd..b3825da 100644 --- a/inc/classes/main/filter/class_FilterChain.php +++ b/inc/classes/main/filter/class_FilterChain.php @@ -36,12 +36,6 @@ class FilterChain extends BaseFrameworkSystem { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("A filter chain class"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php b/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php index 8ddbd16..b399a89 100644 --- a/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php +++ b/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php @@ -30,12 +30,6 @@ class CaptchaEncryptFilter extends BaseFrameworkSystem implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for checking encryption data"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/guest/class_UserNameIsGuestFilter.php b/inc/classes/main/filter/guest/class_UserNameIsGuestFilter.php index f6b1c33..fc11b73 100644 --- a/inc/classes/main/filter/guest/class_UserNameIsGuestFilter.php +++ b/inc/classes/main/filter/guest/class_UserNameIsGuestFilter.php @@ -31,12 +31,6 @@ class UserNameIsGuestFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for checking if username is the reserved guest login"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/news/class_NewsDownloadFilter.php b/inc/classes/main/filter/news/class_NewsDownloadFilter.php index 7ec79d8..1b57940 100644 --- a/inc/classes/main/filter/news/class_NewsDownloadFilter.php +++ b/inc/classes/main/filter/news/class_NewsDownloadFilter.php @@ -32,12 +32,6 @@ class NewsDownloadFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for downloading news"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/news/class_NewsProcessFilter.php b/inc/classes/main/filter/news/class_NewsProcessFilter.php index 5bec352..76ebf3d 100644 --- a/inc/classes/main/filter/news/class_NewsProcessFilter.php +++ b/inc/classes/main/filter/news/class_NewsProcessFilter.php @@ -31,12 +31,6 @@ class NewsProcessFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for processing news"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/null/class_NullFilter.php b/inc/classes/main/filter/null/class_NullFilter.php index 10a8536..9b145ba 100644 --- a/inc/classes/main/filter/null/class_NullFilter.php +++ b/inc/classes/main/filter/null/class_NullFilter.php @@ -31,12 +31,6 @@ class NullFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A null filter"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php b/inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php index c6da66e..7e30148 100644 --- a/inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php +++ b/inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php @@ -30,12 +30,6 @@ class UserStatusConfimedUpdateFilter extends BaseFrameworkSystem implements Filt protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("User status 'confirmed' update filter"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/update/class_UserUpdateFilter.php b/inc/classes/main/filter/update/class_UserUpdateFilter.php index e154928..be0c9a8 100644 --- a/inc/classes/main/filter/update/class_UserUpdateFilter.php +++ b/inc/classes/main/filter/update/class_UserUpdateFilter.php @@ -31,12 +31,6 @@ class UserUpdateFilter extends BaseFrameworkSystem implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("User update filter"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/validator/class_EmailValidatorFilter.php b/inc/classes/main/filter/validator/class_EmailValidatorFilter.php index 23dff14..feb819e 100644 --- a/inc/classes/main/filter/validator/class_EmailValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_EmailValidatorFilter.php @@ -33,12 +33,6 @@ class EmailValidatorFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for Email validation"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php b/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php index f8981e4..8944f35 100644 --- a/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php @@ -31,12 +31,6 @@ class PasswordValidatorFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for Password validation"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php b/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php index 4150d2c..522e77a 100644 --- a/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php @@ -33,12 +33,6 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for username validation"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php b/inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php index f28d181..eab77bd 100644 --- a/inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php @@ -31,12 +31,6 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for account password verification"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php b/inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php index e681df4..98fc1e6 100644 --- a/inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php @@ -30,12 +30,6 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for confirmation code verification"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/verifier/class_EmailValidatorFilter.php b/inc/classes/main/filter/verifier/class_EmailValidatorFilter.php index 23dff14..feb819e 100644 --- a/inc/classes/main/filter/verifier/class_EmailValidatorFilter.php +++ b/inc/classes/main/filter/verifier/class_EmailValidatorFilter.php @@ -33,12 +33,6 @@ class EmailValidatorFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for Email validation"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php b/inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php index a433932..8bb65a4 100644 --- a/inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php @@ -30,12 +30,6 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for verifying graphical code CAPTCHAs"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php b/inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php index a6b6ca7..f2a1520 100644 --- a/inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php @@ -31,12 +31,6 @@ class PasswordGuestVerifierFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for password verification"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php b/inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php index 1b576da..0bd5cce 100644 --- a/inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php @@ -31,12 +31,6 @@ class PasswordVerifierFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for password verification"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php index c223af9..839b1eb 100644 --- a/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php @@ -33,12 +33,6 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for username verification"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php index da4791c..7d0bde9 100644 --- a/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php @@ -33,12 +33,6 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for username verification"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php index 3b8fe72..79e0ace 100644 --- a/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php @@ -30,12 +30,6 @@ class UserStatusVerifierFilter extends BaseFrameworkSystem implements Filterable protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for email changes"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php index b2fc520..e36fa38 100644 --- a/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php @@ -30,12 +30,6 @@ class UserUnconfirmedVerifierFilter extends BaseFrameworkSystem implements Filte protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A filter for checking if the user account is unconfirmed"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/helper/captcha/class_ b/inc/classes/main/helper/captcha/class_ index 81a4bbb..758b205 100644 --- a/inc/classes/main/helper/captcha/class_ +++ b/inc/classes/main/helper/captcha/class_ @@ -30,12 +30,6 @@ class ???Captcha extends BaseCaptcha implements SolveableCaptcha { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A solveable CAPTCHA"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/helper/captcha/class_BaseCaptcha.php b/inc/classes/main/helper/captcha/class_BaseCaptcha.php index 50efc1a..8cb138e 100644 --- a/inc/classes/main/helper/captcha/class_BaseCaptcha.php +++ b/inc/classes/main/helper/captcha/class_BaseCaptcha.php @@ -41,10 +41,6 @@ class BaseCaptcha extends BaseHelper { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/helper/captcha/images/class_ImageHelper.php b/inc/classes/main/helper/captcha/images/class_ImageHelper.php index a29f5a1..0b5a76f 100644 --- a/inc/classes/main/helper/captcha/images/class_ImageHelper.php +++ b/inc/classes/main/helper/captcha/images/class_ImageHelper.php @@ -78,9 +78,6 @@ class ImageHelper extends BaseCaptcha implements HelpableTemplate { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A image helper class"); } /** diff --git a/inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php b/inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php index 3734bbc..37a206c 100644 --- a/inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php +++ b/inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php @@ -40,12 +40,6 @@ class GraphicalCodeCaptcha extends BaseCaptcha implements SolveableCaptcha { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A solveable graphical code CAPTCHA"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/helper/class_BaseHelper.php b/inc/classes/main/helper/class_BaseHelper.php index 94f48fb..ad0c6ca 100644 --- a/inc/classes/main/helper/class_BaseHelper.php +++ b/inc/classes/main/helper/class_BaseHelper.php @@ -22,20 +22,51 @@ * along with this program. If not, see . */ class BaseHelper extends BaseFrameworkSystem { + /** + * Instance to the class which provides field values + */ + private $valueInstance = null; + /** * Rendered content created by the helper class */ private $content = ""; /** - * Instance to the class which provides field values + * Wether the group is opened or not */ - private $valueInstance = null; + private $groupOpened = false; + + /** + * Wether the sub group is opened or not + */ + private $subGroupOpened = false; + + /** + * Name of the group + */ + private $groupName = ""; + + /** + * Name of the sub group + */ + private $subGroupId = ""; + + /** + * Previously opened group + */ + private $previousGroupId = ""; + + /** + * Previously opened sub group + */ + private $previousSubGroupId = ""; // Exception constants const EXCEPTION_XML_PARSER_ERROR = 0x1e0; const EXCEPTION_XML_NODE_UNKNOWN = 0x1e1; const EXCEPTION_XML_NODE_MISMATCH = 0x1e2; + const EXCEPTION_GROUP_NOT_OPENED = 0x1e3; /** * Protected constructor @@ -59,7 +90,7 @@ class BaseHelper extends BaseFrameworkSystem { * @return void */ protected final function addContent ($newContent) { - $this->content .= (string) trim($newContent)."\r\n"; + $this->content .= (string) trim($newContent) . "\r\n"; } /** @@ -82,7 +113,7 @@ class BaseHelper extends BaseFrameworkSystem { $fieldValue = $this->getValueField($fieldName); // Assign it with a template variable - $this->getTemplateInstance()->assignVariable("block_" . $fieldName, $fieldValue); + $this->getTemplateInstance()->assignVariable('block_' . $fieldName, $fieldValue); } /** @@ -99,10 +130,10 @@ class BaseHelper extends BaseFrameworkSystem { $fieldValue = $this->getValueField($fieldName); // Now filter it through the value through the filter method - $filteredValue = call_user_func_array(array($this, "doFilter" . $this->convertToClassName($filterMethod)), array($fieldValue)); + $filteredValue = call_user_func_array(array($this, 'doFilter' . $this->convertToClassName($filterMethod)), array($fieldValue)); // Assign it with a template variable - $this->getTemplateInstance()->assignVariable("block_" . $fieldName, $filteredValue); + $this->getTemplateInstance()->assignVariable('block_' . $fieldName, $filteredValue); } /** @@ -161,6 +192,64 @@ class BaseHelper extends BaseFrameworkSystem { public final function getValueInstance () { return $this->valueInstance; } + + /** + * Check wether a group was opened previously + * + * @return $groupOpened Wether any group was opened before + */ + protected final function ifGroupOpenedPreviously () { + $groupOpened = (!empty($this->previousGroupId)); + return $groupOpened; + } + + /** + * Check wether a group was opened previously + * + * @return $subGroupOpened Wether any group was opened before + */ + protected final function ifSubGroupOpenedPreviously () { + $subGroupOpened = (!empty($this->previousSubGroupId)); + return $subGroupOpened; + } + + /** + * Getter for previous group id + * + * @return $previousGroupId Id of previously opened group + */ + protected final function getPreviousGroupId () { + return $this->previousGroupId; + } + + /** + * Setter for previous group id + * + * @param $previousGroupId Id of previously opened group + * @return void + */ + protected final function setPreviousGroupId ($previousGroupId) { + $this->previousGroupId = (string) $previousGroupId; + } + + /** + * Getter for previous sub group id + * + * @return $previousSubGroupId Id of previously opened sub group + */ + protected final function getPreviousSubGroupId () { + return $this->previousSubGroupId; + } + + /** + * Setter for previous sub group id + * + * @param $previousSubGroupId Id of previously opened sub group + * @return void + */ + protected final function setPreviousSubGroupId ($previousSubGroupId) { + $this->previousSubGroupId = (string) $previousSubGroupId; + } } // [EOF] diff --git a/inc/classes/main/helper/web/blocks/class_WebBlockHelper.php b/inc/classes/main/helper/web/blocks/class_WebBlockHelper.php index 5f1c43b..48b32d8 100644 --- a/inc/classes/main/helper/web/blocks/class_WebBlockHelper.php +++ b/inc/classes/main/helper/web/blocks/class_WebBlockHelper.php @@ -35,9 +35,6 @@ class WebBlockHelper extends BaseWebHelper implements HelpableTemplate { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A helper for generating web blocks"); } /** diff --git a/inc/classes/main/helper/web/forms/class_WebFormHelper.php b/inc/classes/main/helper/web/forms/class_WebFormHelper.php index 12c01b8..d167768 100644 --- a/inc/classes/main/helper/web/forms/class_WebFormHelper.php +++ b/inc/classes/main/helper/web/forms/class_WebFormHelper.php @@ -33,26 +33,6 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { */ private $formName = ""; - /** - * Wether the group is opened or not - */ - private $groupOpened = false; - - /** - * Wether the sub group is opened or not - */ - private $subGroupOpened = false; - - /** - * Name of the group - */ - private $groupName = ""; - - /** - * Name of the sub group - */ - private $subGroupName = ""; - /** * Wether form tag is enabled (default: true) */ @@ -72,12 +52,6 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Helper class for HTML forms"); - - // Create unique ID number - $this->generateUniqueId(); } /** @@ -104,6 +78,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { // Set form name $helperInstance->setFormName($formName); + // A form-less field may say "false" here... if ($withForm === true) { // Create the form @@ -162,7 +137,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { $this->addInputHiddenField('form', $this->getFormName()); // Is a group open? - if ($this->groupOpened === true) { + if ($this->ifGroupOpenedPreviously()) { // Then automatically close it here $this->addFormGroup(); } // END - if @@ -221,8 +196,8 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { * Add a password input tag to the form or throw an exception if it is not * yet opened. The field's name will be set as id. * - * @param $fieldName Input field name - * @param $fieldValue Input default value (default: empty) + * @param $fieldName Input field name + * @param $fieldValue Input default value (default: empty) * @return void * @throws FormClosedException If the form is not yet opened */ @@ -248,8 +223,8 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { * Add a hidden input tag to the form or throw an exception if it is not * yet opened. The field's name will be set as id. * - * @param $fieldName Input field name - * @param $fieldValue Input default value (default: empty) + * @param $fieldName Input field name + * @param $fieldValue Input default value (default: empty) * @return void * @throws FormClosedException If the form is not yet opened */ @@ -305,8 +280,8 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { * Add a checkbox input tag to the form or throw an exception if it is not * yet opened. The field's name will be set as id. * - * @param $fieldName Input field name - * @param $fieldChecked Wether the field is checked (defaut: checked) + * @param $fieldName Input field name + * @param $fieldChecked Wether the field is checked (defaut: checked) * @return void * @throws FormClosedException If the form is not yet opened */ @@ -361,7 +336,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { * Add a reset input tag to the form or throw an exception if it is not * yet opened. The field's name will be set as id. * - * @param $buttonText Text displayed on the button + * @param $buttonText Text displayed on the button * @return void * @throws FormClosedException If the form is not yet opened */ @@ -386,30 +361,30 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { /** * Add a form group or close an already opened and open a new one * - * @param $groupName Name of the group or last opened if empty + * @param $groupId Name of the group or last opened if empty * @param $groupText Text including HTML to show above this group * @return void * @throws FormClosedException If no form has been opened before - * @throws EmptyVariableException If $groupName is not set + * @throws EmptyVariableException If $groupId is not set */ - public function addFormGroup ($groupName = "", $groupText = "") { + public function addFormGroup ($groupId = "", $groupText = "") { // Is a form opened? if (($this->formOpened === false) && ($this->formEnabled === true)) { // Throw exception here - throw new FormClosedException(array($this, $groupName), self::EXCEPTION_CLOSED_FORM); + throw new FormClosedException(array($this, $groupId), self::EXCEPTION_CLOSED_FORM); } // END - if // At least the group name should be set - if ((empty($groupName)) && ($this->groupOpened === false)) { + if ((empty($groupId)) && (!$this->ifGroupOpenedPreviously())) { // Throw exception here - throw new EmptyVariableException(array($this, 'groupName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif (empty($groupName)) { + throw new EmptyVariableException(array($this, 'groupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + } elseif (empty($groupId)) { // Close the last opened - $groupName = $this->groupName; + $groupId = $this->getPreviousGroupId(); } // Same group to open? - if (($this->groupOpened === false) && ($groupName == $this->groupName)) { + if ((!$this->ifGroupOpenedPreviously()) && ($groupId == $this->getPreviousGroupId())) { // Abort here silently return false; } // END - if @@ -418,7 +393,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { $content = "
\n"; // Is this group opened? - if ($this->groupOpened === false) { + if (!$this->ifGroupOpenedPreviously()) { // Begin the div/span blocks $content = sprintf("
@@ -426,35 +401,28 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { %s
", - $groupName, - $groupName, - $groupName, + $groupId, + $groupId, + $groupId, $groupText, - $groupName + $groupId ); - // Add the content - $this->addContent($content); - // Switch the state - $this->groupName = $groupName; - $this->groupOpened = true; + $this->openGroupByIdContent($groupId, $content); } else { // Is a sub group opened? - if ($this->subGroupOpened === true) { + if ($this->ifSubGroupOpenedPreviously()) { // Close it here $this->addFormSubGroup(); } // END - if - // Add the content - $this->addContent($content); - // Switch the state - $this->groupOpened = false; + $this->closePreviousGroupByContent($content); // All call it again if the group name is not empty - if (!empty($groupName)) { - $this->addFormGroup($groupName, $groupText); + if (!empty($groupId)) { + $this->addFormGroup($groupId, $groupText); } // END - if } } @@ -464,30 +432,30 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { * throws an exception if no group has been opened before or if the sub * group name is empty. * - * @param $subGroupName Name of the group or last opened if empty + * @param $subGroupId Name of the group or last opened if empty * @param $subGroupText Text including HTML to show above this group * @return void - * @throws FormGroupClosedException If no group has been opened before - * @throws EmptyVariableException If $subGroupName is not set + * @throws FormFormClosedException If no group has been opened before + * @throws EmptyVariableException If $subGroupId is not set */ - public function addFormSubGroup ($subGroupName = "", $subGroupText = "") { + public function addFormSubGroup ($subGroupId = "", $subGroupText = "") { // Is a group opened? - if ($this->groupOpened === false) { + if (!$this->ifGroupOpenedPreviously()) { // Throw exception here - throw new FormGroupClosedException(array($this, $subGroupName), self::EXCEPTION_UNEXPECTED_CLOSED_GROUP); + throw new FormFormClosedException(array($this, $subGroupId), self::EXCEPTION_UNEXPECTED_CLOSED_GROUP); } // END - if // At least the sub group name should be set - if ((empty($subGroupName)) && ($this->subGroupOpened === false)) { + if ((empty($subGroupId)) && (!$this->ifSubGroupOpenedPreviously())) { // Throw exception here - throw new EmptyVariableException(array($this, 'groupName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif (empty($subGroupName)) { + throw new EmptyVariableException(array($this, 'subGroupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + } elseif (empty($subGroupId)) { // Close the last opened - $subGroupName = $this->subGroupName; + $subGroupId = $this->getSubGroupId(); } // Same sub group to open? - if (($this->subGroupOpened === false) && ($subGroupName == $this->subGroupName)) { + if ((!$this->ifSubGroupOpenedPreviously()) && ($subGroupId == $this->getSubGroupId())) { // Abort here silently return false; } // END - if @@ -496,7 +464,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { $content = "
\n
"; // Is this group opened? - if ($this->subGroupOpened === false) { + if (!$this->ifSubGroupOpenedPreviously()) { // Begin the span block $content = sprintf("
@@ -504,29 +472,22 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { %s
", - $subGroupName, - $subGroupName, - $subGroupName, + $subGroupId, + $subGroupId, + $subGroupId, $subGroupText, - $subGroupName + $subGroupId ); - // Add the content - $this->addContent($content); - // Switch the state and remeber the name - $this->subGroupOpened = true; - $this->subGroupName = $subGroupName; + $this->openSubGroupByIdContent($subGroupId, $content); } else { - // Add the content - $this->addContent($content); - // Switch the state - $this->subGroupOpened = false; + $this->closePreviousSubGroupByContent($content); // All call it again if sub group name is not empty - if (!empty($subGroupName)) { - $this->addFormSubGroup($subGroupName, $subGroupText); + if (!empty($subGroupId)) { + $this->addFormSubGroup($subGroupId, $subGroupText); } // END - if } } @@ -549,7 +510,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { // Set the block type $block = "div"; - if ($this->groupOpened === true) $block = "span"; + if ($this->ifGroupOpenedPreviously()) $block = "span"; // Generate the content $inputContent = sprintf(" <%s id=\"%s_text\"> @@ -582,7 +543,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { } // END - if // Is a group open? - if ($this->groupOpened === true) { + if ($this->ifGroupOpenedPreviously()) { // Then automatically close it here $this->addFormGroup(); } // END - if @@ -629,7 +590,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { $extraInstance = Registry::getRegistry()->getInstance('extra'); // Get a configured instance - $captchaInstance = ObjectFactory::createObjectByConfiguredName($this->getFormName()."_captcha", array($this, $extraInstance)); + $captchaInstance = ObjectFactory::createObjectByConfiguredName($this->getFormName().'_captcha', array($this, $extraInstance)); // Initiate the CAPTCHA $captchaInstance->initiateCaptcha(); @@ -693,10 +654,10 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { // Close the form automatically $this->addFormTag(); } elseif ($this->formEnabled === false) { - if ($this->subGroupOpened === true) { + if ($this->ifSubGroupOpenedPreviously()) { // Close sub group $this->addFormSubGroup(); - } elseif ($this->groupOpened === true) { + } elseif ($this->ifGroupOpenedPreviously()) { // Close group $this->addFormGroup(); } diff --git a/inc/classes/main/helper/web/links/class_WebLinkHelper.php b/inc/classes/main/helper/web/links/class_WebLinkHelper.php index 4121cd2..f906367 100644 --- a/inc/classes/main/helper/web/links/class_WebLinkHelper.php +++ b/inc/classes/main/helper/web/links/class_WebLinkHelper.php @@ -35,9 +35,6 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A helper for generating web links"); } /** @@ -84,9 +81,45 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { * Flush the content out,e g. to a template variable * * @return void + * @todo Completely unimplemented */ public function flushContent () { - $this->partialStub("Please implement this method."); + // Needed to be implemented! + } + + /** + * Adds a link group (like the form group is) with some raw language to the + * helper. + * + * @param $groupId Id string of the group + * @param $groupText Text for this group to add + * @return void + */ + public function addLinkGroup ($groupId, $groupText) { + // Is a group with that name open? + if ($this->ifGroupIsOpened($groupId)) { + // Then close it here + $this->closeGroupById($groupId); + } else { + // Open the new group + $this->openGroupByIdText($groupId, $groupText); + } + } + + /** + * Adds text (note) to the previously opened group or throws an exception + * if no previous group was opened. + * + * @param $groupNote Note to be added to a group + * @return void + * @throws NoGroupOpenedException If no previous group was opened + */ + public function addLinkNote ($groupNote) { + // Check if a previous group was opened + if (!$this->ifGroupOpenedPreviously()) { + // No group was opened before! + throw new NoGroupOpenedException(array($this, $groupNote), self::EXCEPTION_GROUP_NOT_OPENED); + } } } diff --git a/inc/classes/main/images/class_ b/inc/classes/main/images/class_ index 989f546..69b4100 100644 --- a/inc/classes/main/images/class_ +++ b/inc/classes/main/images/class_ @@ -30,12 +30,6 @@ class ???Image extends BaseImage { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription(""); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/images/extended/class_PngImage.php b/inc/classes/main/images/extended/class_PngImage.php index fe28225..f8ee28b 100644 --- a/inc/classes/main/images/extended/class_PngImage.php +++ b/inc/classes/main/images/extended/class_PngImage.php @@ -30,12 +30,6 @@ class PngImage extends BaseImage { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("PNG image"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/io/class_FileIoStream.php b/inc/classes/main/io/class_FileIoStream.php index 4c97338..7e257be 100644 --- a/inc/classes/main/io/class_FileIoStream.php +++ b/inc/classes/main/io/class_FileIoStream.php @@ -29,12 +29,6 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Universal file I/O stream system"); - - // Create unique ID - $this->generateUniqueId(); - // Clean-up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/io/class_FrameworkDirectoryPointer.php b/inc/classes/main/io/class_FrameworkDirectoryPointer.php index fbfebc0..e19b067 100644 --- a/inc/classes/main/io/class_FrameworkDirectoryPointer.php +++ b/inc/classes/main/io/class_FrameworkDirectoryPointer.php @@ -39,14 +39,9 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Helper for handling directories"); - - // Create unique ID - $this->generateUniqueId(); - // Clean-up a little $this->removeNumberFormaters(); + $this->removeSystemArray(); } /** diff --git a/inc/classes/main/io/class_FrameworkFileInputPointer.php b/inc/classes/main/io/class_FrameworkFileInputPointer.php index 4cefaaf..172c02f 100644 --- a/inc/classes/main/io/class_FrameworkFileInputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileInputPointer.php @@ -41,14 +41,9 @@ class FrameworkFileInputPointer extends BaseFrameworkSystem { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Handler for reading from files"); - - // Create unique ID - $this->generateUniqueId(); - // Clean-up a little $this->removeNumberFormaters(); + $this->removeSystemArray(); } /** diff --git a/inc/classes/main/io/class_FrameworkFileOutputPointer.php b/inc/classes/main/io/class_FrameworkFileOutputPointer.php index e196450..37c2285 100644 --- a/inc/classes/main/io/class_FrameworkFileOutputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileOutputPointer.php @@ -39,14 +39,9 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Handler for writing to files"); - - // Create unique ID - $this->generateUniqueId(); - // Clean-up a little $this->removeNumberFormaters(); + $this->removeSystemArray(); } /** diff --git a/inc/classes/main/language/class_LanguageSystem.php b/inc/classes/main/language/class_LanguageSystem.php index 491f5fd..befccdb 100644 --- a/inc/classes/main/language/class_LanguageSystem.php +++ b/inc/classes/main/language/class_LanguageSystem.php @@ -52,12 +52,6 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Language sub-system"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/mailer/class_ b/inc/classes/main/mailer/class_ index d1bbd53..b3181c5 100644 --- a/inc/classes/main/mailer/class_ +++ b/inc/classes/main/mailer/class_ @@ -30,12 +30,6 @@ class ???Mailer extends BaseMailer implements DeliverableMail { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription(""); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/mailer/debug/class_DebugMailer.php b/inc/classes/main/mailer/debug/class_DebugMailer.php index 171c565..ffc3fc6 100644 --- a/inc/classes/main/mailer/debug/class_DebugMailer.php +++ b/inc/classes/main/mailer/debug/class_DebugMailer.php @@ -31,12 +31,6 @@ class DebugMailer extends BaseMailer implements DeliverableMail { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("A mailer for debugging purposes"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/output/class_ConsoleOutput.php b/inc/classes/main/output/class_ConsoleOutput.php index ff2ad10..b1cae5c 100644 --- a/inc/classes/main/output/class_ConsoleOutput.php +++ b/inc/classes/main/output/class_ConsoleOutput.php @@ -41,12 +41,6 @@ class ConsoleOutput extends BaseFrameworkSystem implements OutputStreamer { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Console output class"); - - // Create an unique ID - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/output/class_WebOutput.php b/inc/classes/main/output/class_WebOutput.php index d6419cf..7a50805 100644 --- a/inc/classes/main/output/class_WebOutput.php +++ b/inc/classes/main/output/class_WebOutput.php @@ -36,12 +36,6 @@ class WebOutput extends BaseFrameworkSystem implements OutputStreamer, Registera protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Class for web output e.g. XHTML code"); - - // Create an unique ID - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/points/class_UserPoints.php b/inc/classes/main/points/class_UserPoints.php index 7a2aa20..6a9d88f 100644 --- a/inc/classes/main/points/class_UserPoints.php +++ b/inc/classes/main/points/class_UserPoints.php @@ -31,12 +31,6 @@ class UserPoints extends BaseFrameworkSystem implements Registerable { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Class for handling user points"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/reader/class_DefaultNewsReader.php b/inc/classes/main/reader/class_DefaultNewsReader.php index ef423ca..4e5dbb1 100644 --- a/inc/classes/main/reader/class_DefaultNewsReader.php +++ b/inc/classes/main/reader/class_DefaultNewsReader.php @@ -31,12 +31,6 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Default news reader"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/registry/class_Registry.php b/inc/classes/main/registry/class_Registry.php index f7d385f..2ca0382 100644 --- a/inc/classes/main/registry/class_Registry.php +++ b/inc/classes/main/registry/class_Registry.php @@ -46,12 +46,6 @@ class Registry extends BaseFrameworkSystem implements Register { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Registry class"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/request/class_HttpRequest.php b/inc/classes/main/request/class_HttpRequest.php index 3104792..a046f18 100644 --- a/inc/classes/main/request/class_HttpRequest.php +++ b/inc/classes/main/request/class_HttpRequest.php @@ -43,12 +43,6 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("HTTP request"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/resolver/action/web/class_WebActionResolver.php b/inc/classes/main/resolver/action/web/class_WebActionResolver.php index 664f1f0..83f5ddd 100644 --- a/inc/classes/main/resolver/action/web/class_WebActionResolver.php +++ b/inc/classes/main/resolver/action/web/class_WebActionResolver.php @@ -36,12 +36,6 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Resolver for local web actions"); - - // Create unique ID number - $this->generateUniqueId(); - // Set prefix to "Web" $this->setActionPrefix("Web"); } diff --git a/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php b/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php index 0bb1dd5..ed8492c 100644 --- a/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php +++ b/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php @@ -36,12 +36,6 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Resolver for local image commands"); - - // Create unique ID number - $this->generateUniqueId(); - // Set prefix to "Image" $this->setCommandPrefix("Image"); } diff --git a/inc/classes/main/resolver/command/web/class_WebCommandResolver.php b/inc/classes/main/resolver/command/web/class_WebCommandResolver.php index 7b3388a..165d2f7 100644 --- a/inc/classes/main/resolver/command/web/class_WebCommandResolver.php +++ b/inc/classes/main/resolver/command/web/class_WebCommandResolver.php @@ -36,12 +36,6 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Resolver for local web commands"); - - // Create unique ID number - $this->generateUniqueId(); - // Set prefix to "Web" $this->setCommandPrefix("Web"); } diff --git a/inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php b/inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php index c10a4c6..157a98c 100644 --- a/inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php +++ b/inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php @@ -41,12 +41,6 @@ class ImageControllerResolver extends BaseControllerResolver implements Controll // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Resolver for local web controllers"); - - // Create unique ID number - $this->generateUniqueId(); - // Set prefix to "Image" $this->setControllerPrefix("Image"); } diff --git a/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php b/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php index a2f11e2..2446e6d 100644 --- a/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php +++ b/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php @@ -41,12 +41,6 @@ class WebControllerResolver extends BaseControllerResolver implements Controller // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Resolver for local web controllers"); - - // Create unique ID number - $this->generateUniqueId(); - // Set prefix to "Web" $this->setControllerPrefix("Web"); } diff --git a/inc/classes/main/response/class_HttpResponse.php b/inc/classes/main/response/class_HttpResponse.php index 6882981..869d358 100644 --- a/inc/classes/main/response/class_HttpResponse.php +++ b/inc/classes/main/response/class_HttpResponse.php @@ -64,12 +64,6 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("HTTP response"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/response/class_ImageResponse.php b/inc/classes/main/response/class_ImageResponse.php index 7112907..2329af7 100644 --- a/inc/classes/main/response/class_ImageResponse.php +++ b/inc/classes/main/response/class_ImageResponse.php @@ -64,12 +64,6 @@ class ImageResponse extends BaseFrameworkSystem implements Responseable { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("HTTP response"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); diff --git a/inc/classes/main/result/class_DatabaseResult.php b/inc/classes/main/result/class_DatabaseResult.php index 45412dc..694f13a 100644 --- a/inc/classes/main/result/class_DatabaseResult.php +++ b/inc/classes/main/result/class_DatabaseResult.php @@ -60,12 +60,6 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("Database result"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); @@ -129,14 +123,11 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up $nextValid = false; // Is the result valid? - if ($this->resultArray['status'] === "ok") { - // The status is fine so let's have a look for the next entry - if ($this->valid()) { - // Next entry found, so count one up and cache it - $this->currentPos++; - $this->currentRow = $this->resultArray['rows'][$this->currentPos]; - $nextValid = true; - } // END - if + if ($this->valid()) { + // Next entry found, so count one up and cache it + $this->currentPos++; + $this->currentRow = $this->resultArray['rows'][$this->currentPos]; + $nextValid = true; } // END - if // Return the result @@ -189,7 +180,7 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up $isValid = false; // Check if - if ((isset($this->resultArray['rows'][($this->currentPos + 1)])) && (isset($this->resultArray['rows'][0]))) { + if (($this->ifStatusIsOkay()) && (isset($this->resultArray['rows'][($this->currentPos + 1)])) && (isset($this->resultArray['rows'][0]))) { // All fine! $isValid = true; } // END - if @@ -198,6 +189,15 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up return $isValid; } + /** + * Determines wether the status of the query was fine ("ok") + * + * @return $ifStatusOkay Wether the status of the query was okay + */ + public function ifStatusIsOkay () { + return ((isset($this->resultArray['status'])) && ($this->resultArray['status'] === "ok")); + } + /** * Gets the current key of iteration * diff --git a/inc/classes/main/rng/class_RandomNumberGenerator.php b/inc/classes/main/rng/class_RandomNumberGenerator.php index 89a887d..93ba398 100644 --- a/inc/classes/main/rng/class_RandomNumberGenerator.php +++ b/inc/classes/main/rng/class_RandomNumberGenerator.php @@ -57,12 +57,6 @@ class RandomNumberGenerator extends BaseFrameworkSystem { // Call parent constructor parent::__construct($className); - // Set part description - $this->setObjectDescription("Standard random number generator"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); @@ -115,7 +109,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem { // Yet-another fixed salt. This is not dependend on server software or date if ($extraInstance instanceof FrameworkInterface) { // With extra instance information - $this->fixedSalt = sha1($serverIp . ":" . $extraInstance->__toString() . ":" . serialize($this->getDatabaseInstance()->getConnectionData()) . ":" . $extraInstance->getObjectDescription()); + $this->fixedSalt = sha1($serverIp . ":" . $extraInstance->__toString() . ":" . serialize($this->getDatabaseInstance()->getConnectionData())); } else { // Without extra information $this->fixedSalt = sha1($serverIp . ":" . serialize($this->getDatabaseInstance()->getConnectionData())); diff --git a/inc/classes/main/template/image/class_ImageTemplateEngine.php b/inc/classes/main/template/image/class_ImageTemplateEngine.php index eeb62ed..210002f 100644 --- a/inc/classes/main/template/image/class_ImageTemplateEngine.php +++ b/inc/classes/main/template/image/class_ImageTemplateEngine.php @@ -50,12 +50,6 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Image template engine"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/template/mail/class_MailTemplateEngine.php b/inc/classes/main/template/mail/class_MailTemplateEngine.php index 84a24f4..948dd60 100644 --- a/inc/classes/main/template/mail/class_MailTemplateEngine.php +++ b/inc/classes/main/template/mail/class_MailTemplateEngine.php @@ -50,12 +50,6 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Mail template engine"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/template/web/class_WebTemplateEngine.php b/inc/classes/main/template/web/class_WebTemplateEngine.php index f4cb42e..d166f9f 100644 --- a/inc/classes/main/template/web/class_WebTemplateEngine.php +++ b/inc/classes/main/template/web/class_WebTemplateEngine.php @@ -31,12 +31,6 @@ class WebTemplateEngine extends BaseTemplateEngine implements CompileableTemplat protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Web template engine"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/user/guest/class_Guest.php b/inc/classes/main/user/guest/class_Guest.php index 7aed624..84405dc 100644 --- a/inc/classes/main/user/guest/class_Guest.php +++ b/inc/classes/main/user/guest/class_Guest.php @@ -35,12 +35,6 @@ class Guest extends BaseUser implements ManageableGuest, Registerable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Generic guest class"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/main/user/member/class_Member.php b/inc/classes/main/user/member/class_Member.php index b523f50..cdb98c1 100644 --- a/inc/classes/main/user/member/class_Member.php +++ b/inc/classes/main/user/member/class_Member.php @@ -30,12 +30,6 @@ class Member extends BaseUser implements ManageableMember, Registerable, Updatea protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Generic user class"); - - // Create unique ID number - $this->generateUniqueId(); } /** diff --git a/inc/classes/middleware/compressor/class_CompressorChannel.php b/inc/classes/middleware/compressor/class_CompressorChannel.php index 4f02144..266cf6f 100644 --- a/inc/classes/middleware/compressor/class_CompressorChannel.php +++ b/inc/classes/middleware/compressor/class_CompressorChannel.php @@ -35,12 +35,6 @@ class CompressorChannel extends BaseMiddleware implements Registerable { protected function __construct () { // Call parent constructor! parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Komprimierungshandler"); - - // Create an unique ID - $this->generateUniqueId(); } /** diff --git a/inc/classes/middleware/database/class_DatabaseConnection.php b/inc/classes/middleware/database/class_DatabaseConnection.php index 736ece5..1d9fe9b 100644 --- a/inc/classes/middleware/database/class_DatabaseConnection.php +++ b/inc/classes/middleware/database/class_DatabaseConnection.php @@ -46,12 +46,6 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re protected function __construct() { // Call parent constructor parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Datenbank-Mittelschicht"); - - // Create an unique ID - $this->generateUniqueId(); } // Create new database connection layer diff --git a/inc/classes/middleware/debug/class_DebugMiddleware.php b/inc/classes/middleware/debug/class_DebugMiddleware.php index 6e53821..8ee7e08 100644 --- a/inc/classes/middleware/debug/class_DebugMiddleware.php +++ b/inc/classes/middleware/debug/class_DebugMiddleware.php @@ -43,12 +43,6 @@ class DebugMiddleware extends BaseMiddleware implements Registerable { // Call parent constructor parent::__construct(__CLASS__); - // Set description - $this->setObjectDescription("Debug-Ausgabe-Instance"); - - // Create an unique ID - $this->generateUniqueId(); - // Set own instance self::$thisInstance = $this; } diff --git a/inc/classes/middleware/io/class_FileIoHandler.php b/inc/classes/middleware/io/class_FileIoHandler.php index f1d85e6..db57979 100644 --- a/inc/classes/middleware/io/class_FileIoHandler.php +++ b/inc/classes/middleware/io/class_FileIoHandler.php @@ -47,12 +47,6 @@ class FileIoHandler extends BaseMiddleware { // Call parent constructor parent::__construct(__CLASS__); - // Set description - $this->setObjectDescription("Datei-Ein-/Ausgabe-Handler"); - - // Create an unique ID - $this->generateUniqueId(); - // Set own instance self::$thisInstance = $this; } diff --git a/inc/config.php b/inc/config.php index e49f94b..4c73950 100644 --- a/inc/config.php +++ b/inc/config.php @@ -284,5 +284,8 @@ $cfg->setConfigEntry('crypt_fixed_salt', "N"); // CFG: DB-UPDATE-PRIMARY-FORCED $cfg->setConfigEntry('db_update_primary_forced', "Y"); +// CFG: GERMAN-DATE-TIME +$cfg->setConfigEntry('german_date_time', "%3\$s.%2\$s.%1\$s, %4\$s:%5\$s:%6\$s"); + // [EOF] ?> diff --git a/package.sh b/package.sh index 4dc4714..ec1462d 100755 --- a/package.sh +++ b/package.sh @@ -1,12 +1,11 @@ #!/bin/sh -echo "$0: Cleaning up..." -rm -f shipsimu_dev*.zip +sh ./clear-cache.sh echo "$0: Packaging..." zip -9 shipsimu_dev.zip docs/* Doxyfile *.php *.sh > /dev/null 2>&1 zip -9r shipsimu_dev.zip application/ db/ devel/ Doxyfile inc/ templates/ tests/ > /dev/null 2>&1 -zip -d shipsimu_dev.zip docs/warn.log db/user/*.serialized templates/images/_cache/*.png application/ship-simu/templates/images/_cache/*.png > /dev/null 2>&1 +zip -d shipsimu_dev.zip docs/warn.log db/*/*.serialized > /dev/null 2>&1 echo "$0: Renaming..." mv shipsimu_dev.zip shipsimu_dev_`date +%Y%m%d_%H%M%S`.zip