Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Simplify ApplicationAbstracts

  • Loading branch information...
commit e22448f3aa21729e9b2f9a062fa43a2db875d9c0 1 parent 7290bfb
@haraldpdl haraldpdl authored
View
8 osCommerce/OM/Core/ApplicationAbstract.php
@@ -2,7 +2,7 @@
/**
* osCommerce Online Merchant
*
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
+ * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
@@ -13,7 +13,11 @@
protected $_page_title;
protected $_ignored_actions = array();
- abstract protected function initialize();
+ public function __construct() {
+ $this->initialize();
+
+ $this->runActions();
+ }
public function getPageTitle() {
return $this->_page_title;
View
7 osCommerce/OM/Core/Site/Admin/ApplicationAbstract.php
@@ -2,14 +2,12 @@
/**
* osCommerce Online Merchant
*
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
+ * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
namespace osCommerce\OM\Core\Site\Admin;
- use osCommerce\OM\Core\HTML;
- use osCommerce\OM\Core\OSCOM;
use osCommerce\OM\Core\Registry;
abstract class ApplicationAbstract extends \osCommerce\OM\Core\ApplicationAbstract {
@@ -19,6 +17,9 @@
protected $_title;
protected $_sort_order;
+ abstract protected function initialize();
+ abstract protected function process();
+
public function __construct($process = true) {
$this->ignoreAction(Registry::get('Session')->getName());
View
4 osCommerce/OM/Core/Site/Setup/ApplicationAbstract.php
@@ -2,7 +2,7 @@
/**
* osCommerce Online Merchant
*
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
+ * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
@@ -12,6 +12,8 @@
use osCommerce\OM\Core\OSCOM;
abstract class ApplicationAbstract extends \osCommerce\OM\Core\ApplicationAbstract {
+ abstract protected function initialize();
+
public function __construct() {
$this->initialize();
View
6 osCommerce/OM/Core/Site/Shop/Application/Account/Controller.php
@@ -2,7 +2,7 @@
/**
* osCommerce Online Merchant
*
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
+ * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
@@ -12,9 +12,7 @@
use osCommerce\OM\Core\OSCOM;
class Controller extends \osCommerce\OM\Core\Site\Shop\ApplicationAbstract {
- protected function initialize() {}
-
- protected function process() {
+ protected function initialize() {
$OSCOM_Language = Registry::get('Language');
$OSCOM_Service = Registry::get('Service');
$OSCOM_Breadcrumb = Registry::get('Breadcrumb');
View
6 osCommerce/OM/Core/Site/Shop/Application/Cart/Controller.php
@@ -2,7 +2,7 @@
/**
* osCommerce Online Merchant
*
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
+ * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
@@ -13,9 +13,7 @@
use osCommerce\OM\Core\Site\Shop\Product;
class Controller extends \osCommerce\OM\Core\Site\Shop\ApplicationAbstract {
- protected function initialize() {}
-
- protected function process() {
+ protected function initialize() {
$OSCOM_Language = Registry::get('Language');
$OSCOM_ShoppingCart = Registry::get('ShoppingCart');
$OSCOM_Service = Registry::get('Service');
View
6 osCommerce/OM/Core/Site/Shop/Application/Checkout/Controller.php
@@ -2,7 +2,7 @@
/**
* osCommerce Online Merchant
*
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
+ * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
@@ -15,9 +15,7 @@
use osCommerce\OM\Core\Site\Shop\Product;
class Controller extends \osCommerce\OM\Core\Site\Shop\ApplicationAbstract {
- protected function initialize() {}
-
- protected function process() {
+ protected function initialize() {
$OSCOM_ShoppingCart = Registry::get('ShoppingCart');
$OSCOM_Customer = Registry::get('Customer');
$OSCOM_Language = Registry::get('Language');
View
7 osCommerce/OM/Core/Site/Shop/Application/Index/Controller.php
@@ -2,7 +2,7 @@
/**
* osCommerce Online Merchant
*
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
+ * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
@@ -13,10 +13,7 @@
use osCommerce\OM\Core\Site\Shop\Products;
class Controller extends \osCommerce\OM\Core\Site\Shop\ApplicationAbstract {
-
- protected function initialize() {}
-
- protected function process() {
+ protected function initialize() {
$OSCOM_Category = Registry::get('Category');
$OSCOM_Service = Registry::get('Service');
$OSCOM_PDO = Registry::get('PDO');
View
6 osCommerce/OM/Core/Site/Shop/Application/Info/Controller.php
@@ -2,7 +2,7 @@
/**
* osCommerce Online Merchant
*
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
+ * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
@@ -12,9 +12,7 @@
use osCommerce\OM\Core\OSCOM;
class Controller extends \osCommerce\OM\Core\Site\Shop\ApplicationAbstract {
- protected function initialize() {}
-
- protected function process() {
+ protected function initialize() {
$OSCOM_Language = Registry::get('Language');
$OSCOM_Service = Registry::get('Service');
$OSCOM_Breadcrumb = Registry::get('Breadcrumb');
View
6 osCommerce/OM/Core/Site/Shop/Application/Products/Controller.php
@@ -2,7 +2,7 @@
/**
* osCommerce Online Merchant
*
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
+ * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
@@ -13,9 +13,7 @@
use osCommerce\OM\Core\OSCOM;
class Controller extends \osCommerce\OM\Core\Site\Shop\ApplicationAbstract {
- protected function initialize() {}
-
- protected function process() {
+ protected function initialize() {
$OSCOM_Language = Registry::get('Language');
$OSCOM_Session = Registry::get('Session');
$OSCOM_Template = Registry::get('Template');
View
6 osCommerce/OM/Core/Site/Shop/Application/Search/Controller.php
@@ -2,7 +2,7 @@
/**
* osCommerce Online Merchant
*
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
+ * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
@@ -13,9 +13,7 @@
use osCommerce\OM\Core\Site\Shop\Search;
class Controller extends \osCommerce\OM\Core\Site\Shop\ApplicationAbstract {
- protected function initialize() {}
-
- protected function process() {
+ protected function initialize() {
$OSCOM_Language = Registry::get('Language');
$OSCOM_Template = Registry::get('Template');
$OSCOM_Service = Registry::get('Service');
View
16 osCommerce/OM/Core/Site/Shop/ApplicationAbstract.php
@@ -2,27 +2,21 @@
/**
* osCommerce Online Merchant
*
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
+ * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
namespace osCommerce\OM\Core\Site\Shop;
- use osCommerce\OM\Core\HTML;
- use osCommerce\OM\Core\OSCOM;
use osCommerce\OM\Core\Registry;
abstract class ApplicationAbstract extends \osCommerce\OM\Core\ApplicationAbstract {
- public function __construct($process = true) {
- $this->ignoreAction(Registry::get('Session')->getName());
-
- $this->initialize();
+ abstract protected function initialize();
- if ( $process === true ) {
- $this->process();
+ public function __construct() {
+ $this->ignoreAction(Registry::get('Session')->getName());
- $this->runActions();
- }
+ parent::__construct();
}
}
?>
Please sign in to comment.
Something went wrong with that request. Please try again.