diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index eb982bfa3ef6b..2b452a20c253a 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -1,9 +1,59 @@ +2.0.0.0-dev30 +============= +* Framework changes + * Added dependency injection of framework capability + * Adopted Zend\Di component of Zend Framework 2 library + * Implemented object manager in Magento application + * Refactored multiple base classes to dependency injection principle (dependencies are declared in constructor) + * Themes/View + * Implemented storing themes registry in database, basic CRUD of themes, automatic registration of themes in database from file system out of the box + * Renamed `Mage_Core_Model_Layout_Update` into `Mage_Core_Model_Layout_Merge`, the former becomes an entity domain model. Similar changes with `Mage_Core_Model_Resource_Layout` -> `Mage_Core_Model_Resource_Layout_Update`, `Mage_Core_Model_Layout_Data` -> `Mage_Core_Model_Layout_Update` +* Performance tests + * Improved indexers running script `dev/shell/indexer.php` to return appropriate exit code upon success/failure + * Implemented running the same performance scenario file with different parameters + * Slightly refactored framework class `Magento_Performance_Testsuite_Optimizer` for better visibility of algorithm +* Visual design editor + * Added ability to remove elements in editor UI + * Revised history of changes VDE toolbar and algorithm of "compacting" operations (moving, removing elements) as a layout update XML + * Added selection of themes to VDE launcher page +* Refactored JavaScript of some UI elements to jQuery: + * "Simple" and "configurable" product view pages + * "Create Account" page + * "Shopping Cart" page + * CAPTCHA + * Newsletter subscription +* Tax management UX improvements + * Split Basic and Advanced Settings for Tax Rule Management UI + * Moved the Import/Export functionality to Tax Rate page + * Moved Tax menu to System from Sales +* Implemented the editable multiselect JavaScript component +* Added mentioning sitemap in `robots.txt` after generation +* Removed creation of DB backup in integration testing framework +* Fixed logic of order of loading ACL resources in backend +* Fixed JavaScript error during installation when one of files in `pub/media` is not writable +* Fixed structure of legacy test fixtures that allowed ambiguous keys in declaration +* Fixed inability to restore admin password when CAPTCHA is enabled +* Various minor UX fixes (labels, buttons, redirects, etc...) +* GitHub requests: + * [#59](https://github.com/magento/magento2/issues/59) -- implemented handling of unexpected situations in admin/dashboard/tunnel action + * [#66](https://github.com/magento/magento2/issues/66) + * refactored ImageMagick adapter unit test to avoid system operation + * simplified unit testing framework -- removed unused classes, simplified handling logic of directory `dev/tests/unit/tmp` and removed it from VCS + * [#73](https://github.com/magento/magento2/pull/73), [#74](https://github.com/magento/magento2/pull/74) -- fixes in docblock tags + * [#75](https://github.com/magento/magento2/pull/75), [#96](https://github.com/magento/magento2/pull/96) -- fixed translation module contexts in a few places + * [#80](https://github.com/magento/magento2/issues/80) -- fixed some runtime errors in import/export module + * [#81](https://github.com/magento/magento2/issues/81) -- removed usage of "remove" directive in places where it is overridden by setting root template anyway + * [#87](https://github.com/magento/magento2/issues/87) -- changed paths of files to include from relative into absolute in `dev/shell/indexer.php` and `log.php` + * [#88](https://github.com/magento/magento2/issues/88) -- provided comments for values that can be configured in `app/etc/local.xml` file + * [#90](https://github.com/magento/magento2/issues/90) -- slightly optimized logic of implementation of loading configurable product attributes + 2.0.0.0-dev29 ============= -* Implemented and verified ability to upgrade DB from CE 1.7 (EE 1.12) to 2.x +* Added scripts that allow upgrading database from CE 1.7 (EE 1.12) to 2.x * Replaced calendar UI component with jQuery calendar +* Removed store scope selector from backend customers management +* Renamed `pub/js` (was known as `js` in Magento 1.x) into `pub/lib` * Restored back the public access to `pub/cron.php` entry point (in the previous patch it was denied by mistake) -* Fixed typo in label of "Catalog Search" index in UI 2.0.0.0-dev28 ============= @@ -525,10 +575,10 @@ 2.0.0.0-dev02 ============= Deprecated code & minor fixes update: -* Eliminated remnants of `htmlescape` implementation -* Eliminated usage of `pub/js/index.php` entry point (used to be `js/index.php`) -* Disbanded the shell root directory: moved scripts into `dev/shell` and classes into app -* Minor refactoring of data fixtures rollback capability in integration testing framework +* eliminated remnants of `htmlescape` implementation +* eliminated usage of `pub/js/index.php` entry point (used to be `js/index.php`) +* disbanded the shell root directory: moved scripts into `dev/shell` and classes into app +* minor refactoring of data fixtures rollback capability in integration testing framework 2.0.0.0-dev01 ============= diff --git a/app/Mage.php b/app/Mage.php index ea98d1155c1b9..a4825eb48a8fc 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -64,6 +64,13 @@ final class Mage */ static private $_events; + /** + * Object manager interface + * + * @var Magento_ObjectManager + */ + static private $_objectManager; + /** * Object cache instance * @@ -106,6 +113,13 @@ final class Mage */ static private $_loggers = array(); + /** + * Design object + * + * @var Mage_Core_Model_Design_Package + */ + protected static $_design; + /** * Magento edition constants */ @@ -122,6 +136,13 @@ final class Mage */ static private $_currentEdition = self::EDITION_COMMUNITY; + /** + * Check if we need to use __sleep and __wakeup serialization methods in models + * + * @var bool + */ + static private $_isSerializable = true; + /** * Gets the current Magento version string * @link http://www.magentocommerce.com/blog/new-community-edition-release-process/ @@ -149,7 +170,7 @@ public static function getVersionInfo() 'revision' => '0', 'patch' => '0', 'stability' => 'dev', - 'number' => '29', + 'number' => '30', ); } @@ -161,7 +182,7 @@ public static function getVersionInfo() */ public static function getEdition() { - return self::$_currentEdition; + return self::$_currentEdition; } /** @@ -170,7 +191,8 @@ public static function getEdition() */ public static function reset() { - self::$_registry = array(); + self::resetRegistry(); + self::$_appRoot = null; self::$_app = null; self::$_config = null; @@ -180,9 +202,23 @@ public static function reset() self::$_isDeveloperMode = false; self::$_isInstalled = null; self::$_loggers = array(); + self::$_design = null; // do not reset $headersSentThrowsException } + /** + * Reset registry + */ + public static function resetRegistry() + { + /** @var $value */ + foreach (self::$_registry as $key => $value) { + self::unregister($key); + } + + self::$_registry = array(); + } + /** * Register a new variable * @@ -250,7 +286,7 @@ public static function setRoot($appRoot = '') $appRoot = realpath($appRoot); - if (is_dir($appRoot) and is_readable($appRoot)) { + if (is_dir($appRoot) && is_readable($appRoot)) { self::$_appRoot = $appRoot; } else { self::throwException($appRoot . ' is not a directory or not readable by this user'); @@ -368,7 +404,8 @@ public static function getBaseUrl($type = Mage_Core_Model_Store::URL_TYPE_LINK, */ public static function getUrl($route = '', $params = array()) { - return self::getModel('Mage_Core_Model_Url')->getUrl($route, $params); + return self::getObjectManager()->create('Mage_Core_Model_Url', array('data' => array())) + ->getUrl($route, $params); } /** @@ -378,7 +415,10 @@ public static function getUrl($route = '', $params = array()) */ public static function getDesign() { - return self::getSingleton('Mage_Core_Model_Design_Package'); + if (!self::$_design) { + self::$_design = self::getObjectManager()->get('Mage_Core_Model_Design_Package'); + } + return self::$_design; } /** @@ -388,6 +428,9 @@ public static function getDesign() */ public static function getConfig() { + if (!self::$_config) { + self::$_config = self::getObjectManager()->get('Mage_Core_Model_Config'); + } return self::$_config; } @@ -396,15 +439,17 @@ public static function getConfig() * * @param string $eventName * @param callback $callback - * @param array $arguments + * @param array $data * @param string $observerName + * @param string $observerClass + * @return Varien_Event_Collection */ public static function addObserver($eventName, $callback, $data = array(), $observerName = '', $observerClass = '') { if ($observerClass == '') { $observerClass = 'Varien_Event_Observer'; } - $observer = new $observerClass(); + $observer = self::getObjectManager()->create($observerClass); $observer->setName($observerName)->addData($data)->setEventName($eventName)->setCallback($callback); return self::getEvents()->addObserver($observer); } @@ -437,7 +482,10 @@ public static function dispatchEvent($name, array $data = array()) */ public static function getModel($modelClass = '', $arguments = array()) { - return self::getConfig()->getModelInstance($modelClass, $arguments); + if (!is_array($arguments)) { + $arguments = array($arguments); + } + return self::getObjectManager()->create($modelClass, $arguments, false); } /** @@ -447,39 +495,56 @@ public static function getModel($modelClass = '', $arguments = array()) * @param array $arguments * @return Mage_Core_Model_Abstract */ - public static function getSingleton($modelClass='', array $arguments=array()) + public static function getSingleton($modelClass = '', array $arguments=array()) { $registryKey = '_singleton/'.$modelClass; if (!self::registry($registryKey)) { - self::register($registryKey, self::getModel($modelClass, $arguments)); + self::register($registryKey, self::getObjectManager()->get($modelClass, $arguments)); } return self::registry($registryKey); } /** - * Retrieve object of resource model + * Initialize object manager with definitions file * - * @param string $modelClass - * @param array $arguments - * @return Object + * @static + * @param string $definitionsFile + * @param Magento_ObjectManager $objectManager */ - public static function getResourceModel($modelClass, $arguments = array()) + public static function initializeObjectManager( + $definitionsFile = null, + Magento_ObjectManager $objectManager = null + ) { + self::$_objectManager = $objectManager ?: new Magento_ObjectManager_Zend($definitionsFile); + } + + /** + * Retrieve object manager + * + * @static + * @return Magento_ObjectManager + */ + public static function getObjectManager() { - return self::getConfig()->getResourceModelInstance($modelClass, $arguments); + if (!self::$_objectManager) { + self::initializeObjectManager(); + } + return self::$_objectManager; } /** - * Retrieve Controller instance by ClassName + * Retrieve object of resource model * - * @param string $class - * @param Mage_Core_Controller_Request_Http $request - * @param Mage_Core_Controller_Response_Http $response - * @param array $invokeArgs - * @return Mage_Core_Controller_Front_Action + * @param string $modelClass + * @param array $arguments + * @return Object */ - public static function getControllerInstance($class, $request, $response, array $invokeArgs = array()) + public static function getResourceModel($modelClass, $arguments = array()) { - return new $class($request, $response, $invokeArgs); + if (!is_array($arguments)) { + $arguments = array($arguments); + } + return self::getObjectManager()->create($modelClass, $arguments); } /** @@ -493,11 +558,29 @@ public static function getResourceSingleton($modelClass = '', array $arguments = { $registryKey = '_resource_singleton/'.$modelClass; if (!self::registry($registryKey)) { - self::register($registryKey, self::getResourceModel($modelClass, $arguments)); + self::register($registryKey, self::getObjectManager()->get($modelClass, $arguments)); } return self::registry($registryKey); } + /** + * Retrieve Controller instance by ClassName + * + * @param string $class + * @param Mage_Core_Controller_Request_Http $request + * @param Mage_Core_Controller_Response_Http $response + * @param array $invokeArgs + * @return Mage_Core_Controller_Front_Action + */ + public static function getControllerInstance($class, $request, $response, array $invokeArgs = array()) + { + return self::getObjectManager()->create($class, array( + 'request' => $request, + 'response' => $response, + 'invokeArgs' => $invokeArgs + )); + } + /** * Returns block singleton instance, if current action exists. Otherwise returns FALSE. * @@ -526,7 +609,7 @@ public static function helper($name) $registryKey = '_helper/' . $name; if (!self::registry($registryKey)) { $helperClass = self::getConfig()->getHelperClassName($name); - self::register($registryKey, new $helperClass); + self::register($registryKey, self::getObjectManager()->get($helperClass)); } return self::registry($registryKey); } @@ -539,13 +622,14 @@ public static function helper($name) */ public static function getResourceHelper($moduleName) { - $registryKey = '_resource_helper/' . $moduleName; - if (!self::registry($registryKey)) { - $helperClass = self::getConfig()->getResourceHelper($moduleName); - self::register($registryKey, $helperClass); - } + $connectionModel = self::getConfig()->getResourceConnectionModel('core'); - return self::registry($registryKey); + $helperClassName = $moduleName . '_Model_Resource_Helper_' . ucfirst($connectionModel); + $connection = strtolower($moduleName); + if (substr($moduleName, 0, 5) == 'Mage_') { + $connection = substr($connection, 5); + } + return self::getObjectManager()->get($helperClassName, array('modulePrefix' => $connection)); } /** @@ -588,8 +672,8 @@ public static function throwException($message, $messageStorage = null) public static function app($code = '', $type = 'store', $options = array()) { if (null === self::$_app) { - self::$_app = new Mage_Core_Model_App(); self::setRoot(); + self::$_app = self::getObjectManager()->get('Mage_Core_Model_App'); self::$_events = new Varien_Event_Collection(); self::_setIsInstalled($options); self::_setConfigModel($options); @@ -602,6 +686,15 @@ public static function app($code = '', $type = 'store', $options = array()) return self::$_app; } + /** + * @static + * @param string $areaCode + */ + public static function setCurrentArea($areaCode) + { + self::getObjectManager()->loadAreaConfiguration($areaCode); + } + /** * @static * @param string $code @@ -613,7 +706,7 @@ public static function init($code = '', $type = 'store', $options = array(), $mo { try { self::setRoot(); - self::$_app = new Mage_Core_Model_App(); + self::$_app = self::getObjectManager()->create('Mage_Core_Model_App'); self::_setIsInstalled($options); self::_setConfigModel($options); @@ -649,7 +742,7 @@ public static function run($code = '', $type = 'store', $options = array()) if (isset($options['edition'])) { self::$_currentEdition = $options['edition']; } - self::$_app = new Mage_Core_Model_App(); + self::$_app = self::getObjectManager()->get('Mage_Core_Model_App'); if (isset($options['request'])) { self::$_app->setRequest($options['request']); } @@ -658,7 +751,6 @@ public static function run($code = '', $type = 'store', $options = array()) } self::$_events = new Varien_Event_Collection(); self::_setIsInstalled($options); - self::_setConfigModel($options); self::$_app->run(array( 'scope_code' => $code, 'scope_type' => $type, @@ -704,7 +796,7 @@ protected static function _setConfigModel($options = array()) if (!is_null($alternativeConfigModel) && ($alternativeConfigModel instanceof Mage_Core_Model_Config)) { self::$_config = $alternativeConfigModel; } else { - self::$_config = new Mage_Core_Model_Config($options); + self::$_config = self::getObjectManager()->get('Mage_Core_Model_Config'); } } @@ -901,8 +993,8 @@ public static function printException(Exception $e, $extra = '') try { $storeCode = self::app()->getStore()->getCode(); $reportData['skin'] = $storeCode; + } catch (Exception $e) { } - catch (Exception $e) {} require_once(self::getBaseDir() . DS . 'pub' . DS . 'errors' . DS . 'report.php'); } @@ -969,4 +1061,26 @@ public static function setIsDownloader($flag = true) { self::$_isDownloader = $flag; } + + /** + * Set is serializable flag + * + * @static + * @param bool $value + */ + public static function setIsSerializable($value = true) + { + self::$_isSerializable = !empty($value); + } + + /** + * Get is serializable flag + * + * @static + * @return bool + */ + public static function getIsSerializable() + { + return self::$_isSerializable; + } } diff --git a/app/bootstrap.php b/app/bootstrap.php index 4ebb9d3cfba5d..d572c6fb23ca1 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -89,6 +89,12 @@ Magento_Autoload::getInstance()->addFilesMap($classMapPath); } +$definitionsFile = BP . DS . 'var/di/definitions.php'; +if (file_exists($definitionsFile)) { + Mage::setRoot(); + Mage::initializeObjectManager($definitionsFile); +} + if (isset($_SERVER['MAGE_PROFILER'])) { switch ($_SERVER['MAGE_PROFILER']) { case 'firebug': diff --git a/app/code/community/Phoenix/Moneybookers/Block/Form.php b/app/code/community/Phoenix/Moneybookers/Block/Form.php index e47da3411e118..12e2ea41bac21 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Form.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Form.php @@ -39,14 +39,7 @@ class Phoenix_Moneybookers_Block_Form extends Mage_Payment_Block_Form */ protected $_defaultInfoLocale = 'en'; - /** - * Constructor. Set template. - */ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('form.phtml'); - } + protected $_template = 'form.phtml'; /** * Return payment logo image src diff --git a/app/code/community/Phoenix/Moneybookers/Block/Info.php b/app/code/community/Phoenix/Moneybookers/Block/Info.php index d418a6828c0c4..9b309e076e47b 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Info.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Info.php @@ -25,14 +25,7 @@ */ class Phoenix_Moneybookers_Block_Info extends Mage_Payment_Block_Info { - /** - * Constructor. Set template. - */ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('info.phtml'); - } + protected $_template = 'info.phtml'; /** * Returns code of payment method diff --git a/app/code/community/Phoenix/Moneybookers/Block/Jsinit.php b/app/code/community/Phoenix/Moneybookers/Block/Jsinit.php index b408034982273..4f259781cd24e 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Jsinit.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Jsinit.php @@ -30,7 +30,7 @@ class Phoenix_Moneybookers_Block_Jsinit extends Mage_Adminhtml_Block_Template */ protected function _prepareLayout() { - $section = $this->getAction()->getRequest()->getParam('section', false); + $section = $this->getRequest()->getParam('section', false); if ($section == 'moneybookers') { $this->getLayout() ->getBlock('head') @@ -45,7 +45,7 @@ protected function _prepareLayout() */ protected function _toHtml() { - $section = $this->getAction()->getRequest()->getParam('section', false); + $section = $this->getRequest()->getParam('section', false); if ($section == 'moneybookers') { return parent::_toHtml(); } else { diff --git a/app/code/core/Mage/Admin/Model/Config.php b/app/code/core/Mage/Admin/Model/Config.php index e560b3ece33bc..0420cdef7721f 100644 --- a/app/code/core/Mage/Admin/Model/Config.php +++ b/app/code/core/Mage/Admin/Model/Config.php @@ -64,14 +64,14 @@ class Mage_Admin_Model_Config extends Varien_Simplexml_Config /** * Load config from merged adminhtml.xml files - * @param array $arguments + * @param array $data */ - public function __construct(array $arguments = array()) + public function __construct(array $data = array()) { - $this->_app = isset($arguments['app']) ? $arguments['app'] : Mage::app(); - $this->_appConfig = isset($arguments['appConfig']) ? $arguments['appConfig'] : Mage::getConfig(); - if (isset($arguments['helpers'])) { - $this->_helpers = $arguments['helpers']; + $this->_app = isset($data['app']) ? $data['app'] : Mage::app(); + $this->_appConfig = isset($data['appConfig']) ? $data['appConfig'] : Mage::getConfig(); + if (isset($data['helpers'])) { + $this->_helpers = $data['helpers']; } diff --git a/app/code/core/Mage/AdminNotification/Model/Survey.php b/app/code/core/Mage/AdminNotification/Model/Survey.php index 60c9c050a77c3..54e663f1c3c96 100644 --- a/app/code/core/Mage/AdminNotification/Model/Survey.php +++ b/app/code/core/Mage/AdminNotification/Model/Survey.php @@ -77,7 +77,9 @@ public static function getSurveyUrl() protected static function _getFlagModel() { if (self::$_flagModel === null) { - self::$_flagModel = Mage::getModel('Mage_Core_Model_Flag', array('flag_code' => self::$_flagCode))->loadSelf(); + self::$_flagModel = Mage::getModel('Mage_Core_Model_Flag', + array('data' => array('flag_code' => self::$_flagCode))) + ->loadSelf(); } return self::$_flagModel; } diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Buttons.php b/app/code/core/Mage/Adminhtml/Block/Api/Buttons.php index d519b6f5c60ba..f01587786b37b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Buttons.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Buttons.php @@ -27,11 +27,7 @@ class Mage_Adminhtml_Block_Api_Buttons extends Mage_Adminhtml_Block_Template { - public function __construct() - { - parent::__construct(); - $this->setTemplate('api/userinfo.phtml'); - } + protected $_template = 'api/userinfo.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php b/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php index 35fda6fe972bb..01f61ee0c2a37 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php @@ -25,9 +25,9 @@ */ class Mage_Adminhtml_Block_Api_Editroles extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('role_info_tabs'); $this->setDestElementId('role_edit_form'); $this->setTitle(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Role Information')); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php b/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php index a1c429c4c3db4..a39646e3df26d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php @@ -33,9 +33,9 @@ */ class Mage_Adminhtml_Block_Api_Grid_Role extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('roleGrid'); $this->setSaveParametersInSession(true); $this->setDefaultSort('role_id'); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Role.php b/app/code/core/Mage/Adminhtml/Block/Api/Role.php index 233c1cb740344..b5cc1e0a37053 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Role.php @@ -35,12 +35,12 @@ class Mage_Adminhtml_Block_Api_Role extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'api_role'; $this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Roles'); $this->_addButtonLabel = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add New Role'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php index 2631695500ace..d07ed92addac2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Api_Role_Grid_User extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setDefaultSort('role_user_id'); $this->setDefaultDir('asc'); $this->setId('roleUserGrid'); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Roles.php b/app/code/core/Mage/Adminhtml/Block/Api/Roles.php index 808487f9f4865..5ff580d5e3e3c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Roles.php @@ -33,11 +33,8 @@ */ class Mage_Adminhtml_Block_Api_Roles extends Mage_Adminhtml_Block_Template { - public function __construct() - { - parent::__construct(); - $this->setTemplate('api/roles.phtml'); - } + + protected $_template = 'api/roles.phtml'; public function getAddNewUrl() { diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Roleinfo.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Roleinfo.php index e44c43ebfb16a..691925cd9a46a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Roleinfo.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Roleinfo.php @@ -30,11 +30,6 @@ */ class Mage_Adminhtml_Block_Api_Tab_Roleinfo extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() - { - parent::__construct(); - } - public function _beforeToHtml() { $this->_initForm(); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php index 2975b5b897072..9f1a871f2360c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php @@ -26,8 +26,11 @@ class Mage_Adminhtml_Block_Api_Tab_Rolesedit extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() { - parent::__construct(); + protected $_template = 'api/rolesedit.phtml'; + + + protected function _construct() { + parent::_construct(); $rid = Mage::app()->getRequest()->getParam('rid', false); @@ -48,7 +51,7 @@ public function __construct() { $this->setSelectedResources($selrids); - $this->setTemplate('api/rolesedit.phtml'); + //->assign('resources', $resources); //->assign('checkedResources', join(',', $selrids)); } diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php index 80e8b428b9294..68e3c855f5805 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php @@ -26,9 +26,9 @@ class Mage_Adminhtml_Block_Api_Tab_Rolesusers extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $roleId = $this->getRequest()->getParam('rid', false); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User.php b/app/code/core/Mage/Adminhtml/Block/Api/User.php index f7178573d2f3f..b34e02f5ad570 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User.php @@ -34,12 +34,12 @@ class Mage_Adminhtml_Block_Api_User extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'api_user'; $this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Users'); $this->_addButtonLabel = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add New User'); - parent::__construct(); + parent::_construct(); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit.php index 4a16f75a3a7d0..52ea4d40d5782 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit.php @@ -34,12 +34,12 @@ class Mage_Adminhtml_Block_Api_User_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_objectId = 'user_id'; $this->_controller = 'api_user'; - parent::__construct(); + parent::_construct(); $this->_updateButton('save', 'label', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Save User')); $this->_updateButton('delete', 'label', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete User')); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php index 24540a34d6ff5..9650f33f15bb1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php @@ -27,9 +27,9 @@ class Mage_Adminhtml_Block_Api_User_Edit_Tab_Roles extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('permissionsUserRolesGrid'); $this->setDefaultSort('sort_order'); $this->setDefaultDir('asc'); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tabs.php index 2b8da75ce3824..353a3dfaec14a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tabs.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Api_User_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('page_tabs'); $this->setDestElementId('edit_form'); $this->setTitle(Mage::helper('Mage_Adminhtml_Helper_Data')->__('User Information')); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User/Grid.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Grid.php index 97f58f6afe422..36238b8dbfd32 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Api_User_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('permissionsUserGrid'); $this->setDefaultSort('username'); $this->setDefaultDir('asc'); diff --git a/app/code/core/Mage/Adminhtml/Block/Cache.php b/app/code/core/Mage/Adminhtml/Block/Cache.php index cd98aacd9c520..41b95355d1348 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cache.php +++ b/app/code/core/Mage/Adminhtml/Block/Cache.php @@ -29,11 +29,11 @@ class Mage_Adminhtml_Block_Cache extends Mage_Adminhtml_Block_Widget_Grid_Contai /** * Class constructor */ - public function __construct() + protected function _construct() { $this->_controller = 'cache'; $this->_headerText = Mage::helper('Mage_Core_Helper_Data')->__('Cache Storage Management'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); $this->_addButton('flush_magento', array( 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Flush Magento Cache'), diff --git a/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php b/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php index 261a268b2621d..d7cfbe7516671 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php @@ -30,9 +30,9 @@ class Mage_Adminhtml_Block_Cache_Grid extends Mage_Adminhtml_Block_Widget_Grid /** * Class constructor */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('cache_grid'); $this->_filterVisibility = false; $this->_pagerVisibility = false; diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php index d1f31abad59e8..a0c8babd34e61 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php @@ -33,12 +33,6 @@ */ class Mage_Adminhtml_Block_Catalog_Category_Abstract extends Mage_Adminhtml_Block_Template { - - public function __construct() - { - parent::__construct(); - } - /** * Retrieve current category instance * diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php index 9b42349804a6c..696c535df999d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php @@ -33,13 +33,16 @@ */ class Mage_Adminhtml_Block_Catalog_Category_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + /** + * @var string + */ + protected $_template = 'catalog/category/edit.phtml'; + + protected function _construct() { $this->_objectId = 'entity_id'; $this->_controller = 'catalog_category'; $this->_mode = 'edit'; - - parent::__construct(); - $this->setTemplate('catalog/category/edit.phtml'); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit/Form.php index a0e008f2a1082..1bea6e3ad8f9c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit/Form.php @@ -40,11 +40,10 @@ class Mage_Adminhtml_Block_Catalog_Category_Edit_Form extends Mage_Adminhtml_Blo */ protected $_additionalButtons = array(); - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/category/edit/form.phtml'); - } + /** + * @var string + */ + protected $_template = 'catalog/category/edit/form.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php index f95592d9cfab4..fd05eb3bf646b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php @@ -48,8 +48,8 @@ public function getCategory() * Initialize tab * */ - public function __construct() { - parent::__construct(); + protected function _construct() { + parent::_construct(); $this->setShowGlobalIcon(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Design.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Design.php index 223c90e8a69b6..302571d21bdaf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Design.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Design.php @@ -25,9 +25,9 @@ */ class Mage_Adminhtml_Block_Catalog_Category_Tab_Design extends Mage_Adminhtml_Block_Catalog_Form { - public function __construct() + public function _construct() { - parent::__construct(); + parent::_construct(); $this->setShowGlobalIcon(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php index 866972f700c69..b15f19b2c976e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php @@ -36,9 +36,9 @@ class Mage_Adminhtml_Block_Catalog_Category_Tab_General extends Mage_Adminhtml_B protected $_category; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setShowGlobalIcon(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php index 0645b1182b24f..396b2c924d62c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Catalog_Category_Tab_Product extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('catalog_category_products'); $this->setDefaultSort('entity_id'); $this->setUseAjax(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php index 75a39fa2d56ce..727274e276945 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php @@ -40,17 +40,19 @@ class Mage_Adminhtml_Block_Catalog_Category_Tabs extends Mage_Adminhtml_Block_Wi */ protected $_attributeTabBlock = 'Mage_Adminhtml_Block_Catalog_Category_Tab_Attributes'; + protected $_template = 'widget/tabshoriz.phtml'; + /** * Initialize Tabs * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('category_info_tabs'); $this->setDestElementId('category_tab_content'); $this->setTitle(Mage::helper('Mage_Catalog_Helper_Data')->__('Category Data')); - $this->setTemplate('widget/tabshoriz.phtml'); + } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php index 7a3cba2fb5a0d..0b22819175bc7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php @@ -37,10 +37,12 @@ class Mage_Adminhtml_Block_Catalog_Category_Tree extends Mage_Adminhtml_Block_Ca protected $_withProductCount; - public function __construct() + protected $_template = 'catalog/category/tree.phtml'; + + + protected function _construct() { - parent::__construct(); - $this->setTemplate('catalog/category/tree.phtml'); + parent::_construct(); $this->setUseAjax(true); $this->_withProductCount = true; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Widget/Chooser.php index 8795d35ed9b2c..0b87170ad4978 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Widget/Chooser.php @@ -39,10 +39,13 @@ class Mage_Adminhtml_Block_Catalog_Category_Widget_Chooser extends Mage_Adminhtm * Block construction * Defines tree template and init tree params */ - public function __construct() + + protected $_template = 'catalog/category/widget/tree.phtml'; + + protected function _construct() { - parent::__construct(); - $this->setTemplate('catalog/category/widget/tree.phtml'); + parent::_construct(); + $this->_withProductCount = false; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php index a0f4a29436d77..906049621bb3f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php @@ -37,10 +37,8 @@ class Mage_Adminhtml_Block_Catalog_Form_Renderer_Fieldset_Element /** * Initialize block template */ - protected function _construct() - { - $this->setTemplate('Mage_Adminhtml::catalog/form/renderer/fieldset/element.phtml'); - } + + protected $_template = 'Mage_Adminhtml::catalog/form/renderer/fieldset/element.phtml'; /** * Retrieve data object related with form diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php index 2134d61802a93..48c5fb6613c65 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php @@ -33,14 +33,7 @@ */ class Mage_Adminhtml_Block_Catalog_Product extends Mage_Adminhtml_Block_Widget_Container { - /** - * Set template - */ - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/product.phtml'); - } + protected $_template = 'catalog/product.phtml'; /** * Prepare button and grid diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute.php index f8394342e0527..cab10808f9338 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute.php @@ -35,12 +35,12 @@ class Mage_Adminhtml_Block_Catalog_Product_Attribute extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'catalog_product_attribute'; $this->_headerText = Mage::helper('Mage_Catalog_Helper_Data')->__('Manage Attributes'); $this->_addButtonLabel = Mage::helper('Mage_Catalog_Helper_Data')->__('Add New Attribute'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php index 4fd6c1b161d01..261356118eec1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php @@ -34,15 +34,13 @@ class Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - /** - * Update block controls - */ - public function __construct() + + protected function _construct() { $this->_objectId = 'attribute_id'; $this->_controller = 'catalog_product_attribute'; - parent::__construct(); + parent::_construct(); if($this->getRequest()->getParam('popup')) { $this->_removeButton('back'); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tabs.php index 47db2e05ba444..246527d6684cd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tabs.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('product_attribute_tabs'); $this->setDestElementId('edit_form'); $this->setTitle(Mage::helper('Mage_Catalog_Helper_Data')->__('Attribute Information')); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php index fe3eaeb951d9c..b87510e32022d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php @@ -33,14 +33,8 @@ */ class Mage_Adminhtml_Block_Catalog_Product_Attribute_New_Product_Created extends Mage_Adminhtml_Block_Widget { - /** - * Set block template - */ - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/product/attribute/new/created.phtml'); - } + + protected $_template = 'catalog/product/attribute/new/created.phtml'; /** * Add additional blocks to layout diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Grid.php index a344771694de3..4a34a526f4891 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('setGrid'); $this->setDefaultSort('set_name'); $this->setDefaultDir('ASC'); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php index 10b54834259ba..8cfb1c01baf35 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php @@ -33,14 +33,7 @@ */ class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main extends Mage_Adminhtml_Block_Template { - /** - * Initialize template - * - */ - protected function _construct() - { - $this->setTemplate('catalog/product/attribute/set/main.phtml'); - } + protected $_template = 'catalog/product/attribute/set/main.phtml'; /** * Prepare Global Layout diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formattribute.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formattribute.php index 9f4d406311284..f0f49a57e52d8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formattribute.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formattribute.php @@ -32,11 +32,6 @@ class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main_Formattribute extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() - { - parent::__construct(); - } - protected function _prepareForm() { $form = new Varien_Data_Form(); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formgroup.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formgroup.php index 99bc887bd0096..aab73fd99e178 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formgroup.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formgroup.php @@ -32,10 +32,6 @@ class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main_Formgroup extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() - { - parent::__construct(); - } protected function _prepareForm() { diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php index 9bc9872ebfebe..db4256b632759 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php @@ -32,10 +32,6 @@ class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main_Formset extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() - { - parent::__construct(); - } /** * Prepares attribute set form diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Attribute.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Attribute.php index f8076dbd39394..4db76acc62a8f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Attribute.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Attribute.php @@ -32,8 +32,5 @@ class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main_Tree_Attribute extends Mage_Adminhtml_Block_Template { - protected function _construct() - { - $this->setTemplate('catalog/product/attribute/set/main/tree/attribute.phtml'); - } + protected $_template = 'catalog/product/attribute/set/main/tree/attribute.phtml'; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Group.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Group.php index 64054a1d636bf..9aa47f65db861 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Group.php @@ -32,8 +32,5 @@ class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main_Tree_Group extends Mage_Adminhtml_Block_Template { - protected function _construct() - { - $this->setTemplate('catalog/product/attribute/set/main/tree/group.phtml'); - } + protected $_template = 'catalog/product/attribute/set/main/tree/group.phtml'; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php index dc7ff43382c64..1c0c7fc2e5cb6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php @@ -33,10 +33,8 @@ */ class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Toolbar_Add extends Mage_Adminhtml_Block_Template { - protected function _construct() - { - $this->setTemplate('catalog/product/attribute/set/toolbar/add.phtml'); - } + + protected $_template = 'catalog/product/attribute/set/toolbar/add.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main.php index 3cf2d2ba318a8..71ae96b2b1865 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main.php @@ -34,11 +34,10 @@ class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Toolbar_Main extends Mage_Adminhtml_Block_Template { - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/product/attribute/set/toolbar/main.phtml'); - } + /** + * @var string + */ + protected $_template = 'catalog/product/attribute/set/toolbar/main.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main/Filter.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main/Filter.php index f7ccf2cc16c16..75ac2d3107e3b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main/Filter.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main/Filter.php @@ -32,10 +32,6 @@ class Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Toolbar_Main_Filter extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() - { - parent::__construct(); - } protected function _prepareForm() { diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php index 9c0d3e22610f5..5f779dd8d3e09 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php @@ -35,13 +35,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Composite_Configure extends Mage_Admi { protected $_product; - /** - * Set template - */ - protected function _construct() - { - $this->setTemplate('catalog/product/composite/configure.phtml'); - } + protected $_template = 'catalog/product/composite/configure.phtml'; /** * Retrieve product object diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php index 4c0ed1e572c1a..3a9d870c6fc1f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php @@ -38,9 +38,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Composite_Fieldset_Options extends Ma * * @return void */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->addOptionRenderer( 'default', 'Mage_Catalog_Block_Product_View_Options_Type_Default', diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php index 022bf5e9720a2..de214ca7f5a54 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php @@ -36,12 +36,10 @@ class Mage_Adminhtml_Block_Catalog_Product_Created extends Mage_Adminhtml_Block_ protected $_configurableProduct; protected $_product; - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/product/created.phtml'); - } - + /** + * @var string + */ + protected $_template = 'catalog/product/created.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php index bca95ec2cc366..d983531284a17 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php @@ -33,10 +33,11 @@ */ class Mage_Adminhtml_Block_Catalog_Product_Edit extends Mage_Adminhtml_Block_Widget { - public function __construct() + protected $_template = 'catalog/product/edit.phtml'; + + protected function _construct() { - parent::__construct(); - $this->setTemplate('catalog/product/edit.phtml'); + parent::_construct(); $this->setId('product_edit'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts.php index 7cd8cadd3b605..1245e18098332 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts.php @@ -35,11 +35,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts extends Mage_Adminhtml_Block_Template { - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/product/tab/alert.phtml'); - } + protected $_template = 'catalog/product/tab/alert.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php index 816c19d7c05f3..73435d2dd9354 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php @@ -34,9 +34,9 @@ */ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Price extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('alertPrice'); $this->setDefaultSort('add_date'); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php index 3f7dc31b18995..c3cdad95f994a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php @@ -34,9 +34,9 @@ */ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Stock extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('alertStock'); $this->setDefaultSort('add_date'); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php index 27fa1d50a530b..7ddc729f85696 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php @@ -101,7 +101,8 @@ protected function _prepareForm() if (!$form->getElement('media_gallery') && Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Catalog::attributes_attributes') ) { - $headerBar = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes_Create'); + $headerBar = $this->getLayout() + ->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes_Create'); $headerBar->getConfig() ->setTabId('group_' . $group->getId()) @@ -154,12 +155,23 @@ protected function _prepareForm() protected function _getAdditionalElementTypes() { $result = array( - 'price' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price'), - 'weight' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight'), - 'gallery' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery'), - 'image' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image'), - 'boolean' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean'), - 'textarea' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Helper_Form_Wysiwyg') + 'price' => Mage::getConfig()->getBlockClassName( + 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price' + ), + 'weight' => Mage::getConfig()->getBlockClassName( + 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight' + ), + 'gallery' => Mage::getConfig()->getBlockClassName( + 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery' + ), + 'image' => Mage::getConfig()->getBlockClassName( + 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image' + ), + 'boolean' => Mage::getConfig()->getBlockClassName( + 'Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean'), + 'textarea' => Mage::getConfig()->getBlockClassName( + 'Mage_Adminhtml_Block_Catalog_Helper_Form_Wysiwyg' + ) ); $response = new Varien_Object(); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php index a3584bac8d2a7..6036e58c6b879 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php @@ -36,14 +36,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Categories extends Mage_Admi protected $_categoryIds; protected $_selectedNodes = null; - /** - * Specify template to use - */ - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/product/edit/categories.phtml'); - } + protected $_template = 'catalog/product/edit/categories.phtml'; /** * Retrieve currently edited product diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php index aa7cdacd65e93..2637fd980f8c3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php @@ -37,9 +37,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Crosssell extends Mage_Admin * Set grid params * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('cross_sell_product_grid'); $this->setDefaultSort('entity_id'); $this->setUseAjax(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php index 88a1953bea4a6..434af73a65acb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php @@ -31,11 +31,7 @@ */ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Inventory extends Mage_Adminhtml_Block_Widget { - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/product/tab/inventory.phtml'); - } + protected $_template = 'catalog/product/tab/inventory.phtml'; public function getBackordersOption() { diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options.php index 42c3187477280..8b5ad3dd9c6a8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options.php @@ -34,12 +34,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options extends Mage_Adminhtml_Block_Widget { - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/product/edit/options.phtml'); - } - + protected $_template = 'catalog/product/edit/options.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php index fc7292cd1cf9a..5e4717872e898 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php @@ -42,13 +42,15 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option extends Mage_ protected $_itemCount = 1; + protected $_template = 'catalog/product/edit/options/option.phtml'; + /** * Class constructor */ - public function __construct() + protected function _construct() { - parent::__construct(); - $this->setTemplate('catalog/product/edit/options/option.phtml'); + parent::_construct(); + $this->setCanReadPrice(true); $this->setCanEditPrice(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Date.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Date.php index 1c589e59ea7b4..76c430b3b6a67 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Date.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Date.php @@ -35,10 +35,5 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Date extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Abstract { - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/product/edit/options/type/date.phtml'); - } - + protected $_template = 'catalog/product/edit/options/type/date.phtml'; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/File.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/File.php index 0ed86370b05d0..38e8553cc849f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/File.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/File.php @@ -35,9 +35,5 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_File extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Abstract { - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/product/edit/options/type/file.phtml'); - } + protected $_template = 'catalog/product/edit/options/type/file.phtml'; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Select.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Select.php index 9eeef21a6e864..556ab6260c747 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Select.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Select.php @@ -35,13 +35,15 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Select extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Abstract { + + protected $_template = 'catalog/product/edit/options/type/select.phtml'; /** * Class constructor */ - public function __construct() + protected function _construct() { - parent::__construct(); - $this->setTemplate('catalog/product/edit/options/type/select.phtml'); + parent::_construct(); + $this->setCanEditPrice(true); $this->setCanReadPrice(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Text.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Text.php index 6692161ea78c2..9683c7a59e951 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Text.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Text.php @@ -35,10 +35,5 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Text extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Abstract { - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/product/edit/options/type/text.phtml'); - } - + protected $_template = 'catalog/product/edit/options/type/text.phtml'; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php index 289b2fc9de5bc..15b8f325a39bc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php @@ -35,13 +35,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract { - /** - * Initialize block - */ - public function __construct() - { - $this->setTemplate('catalog/product/edit/price/group.phtml'); - } + protected $_template = 'catalog/product/edit/price/group.phtml'; /** * Sort values diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php index a663bb93d4eca..e7c9da1876e98 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php @@ -35,13 +35,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract { - /** - * Initialize block - */ - public function __construct() - { - $this->setTemplate('catalog/product/edit/price/tier.phtml'); - } + protected $_template = 'catalog/product/edit/price/tier.phtml'; /** * Retrieve list of initial customer groups diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php index d08609e190363..de1ff00b1bc0b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php @@ -37,9 +37,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Related extends Mage_Adminht * Set grid params * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('related_product_grid'); $this->setDefaultSort('entity_id'); $this->setUseAjax(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php index fb7b0127cc84e..40252148a0405 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php @@ -35,15 +35,18 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config extends Mage_Adminhtml_Block_Widget implements Mage_Adminhtml_Block_Widget_Tab_Interface { + + protected $_template = 'catalog/product/edit/super/config.phtml'; + /** * Initialize block * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setProductId($this->getRequest()->getParam('id')); - $this->setTemplate('catalog/product/edit/super/config.phtml'); + $this->setId('config_super_product'); $this->setCanEditPrice(true); $this->setCanReadPrice(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php index 50e98d66eee72..cbff371331ab9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setUseAjax(true); $this->setId('super_product_links'); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php index 4633b7522709d..898977acbf01c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group extends Mage_Adminhtml_Block_Widget_Grid implements Mage_Adminhtml_Block_Widget_Tab_Interface { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('super_product_grid'); $this->setDefaultSort('entity_id'); $this->setSkipGenerateContent(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php index 561657d2f991d..e6f2a4daed4f2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php @@ -38,9 +38,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Upsell extends Mage_Adminhtm * Set grid params * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('up_sell_product_grid'); $this->setDefaultSort('entity_id'); $this->setUseAjax(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Websites.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Websites.php index a767c223c5a1f..b33c38202c9af 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Websites.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Websites.php @@ -35,14 +35,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Websites extends Mage_Adminh { protected $_storeFromHtml; - /** - * Constructor - */ - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/product/edit/websites.phtml'); - } + protected $_template = 'catalog/product/edit/websites.phtml'; /** * Retrieve edited product model instance diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php index 74a2c9b744a8c..5da169c93b0de 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs extends Mage_Adminhtml_Bloc { protected $_attributeTabBlock = 'Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes'; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('product_info_tabs'); $this->setDestElementId('product_edit_form'); $this->setTitle(Mage::helper('Mage_Catalog_Helper_Data')->__('Product Information')); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php index 6af8c9ec4b944..9dbf65b498c18 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('productGrid'); $this->setDefaultSort('entity_id'); $this->setDefaultDir('DESC'); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Boolean.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Boolean.php index c5e7c79daccbf..ea95639048bee 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Boolean.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Boolean.php @@ -33,9 +33,9 @@ */ class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean extends Varien_Data_Form_Element_Select { - public function __construct($attributes=array()) + protected function _construct() { - parent::__construct($attributes); + parent::_construct(); $this->setValues(array( array( 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('No'), diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php index 7702cfb509fab..bfd423319d238 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php @@ -34,12 +34,7 @@ */ class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery_Content extends Mage_Adminhtml_Block_Widget { - - public function __construct() - { - parent::__construct(); - $this->setTemplate('catalog/product/helper/gallery.phtml'); - } + protected $_template = 'catalog/product/helper/gallery.phtml'; protected function _prepareLayout() { @@ -97,12 +92,12 @@ public function getAddImagesButton() public function getImagesJson() { - if(is_array($this->getElement()->getValue())) { + if (is_array($this->getElement()->getValue())) { $value = $this->getElement()->getValue(); - if(count($value['images'])>0) { + if (is_array($value['images']) && count($value['images']) > 0) { foreach ($value['images'] as &$image) { $image['url'] = Mage::getSingleton('Mage_Catalog_Model_Product_Media_Config') - ->getMediaUrl($image['file']); + ->getMediaUrl($image['file']); } return Mage::helper('Mage_Core_Helper_Data')->jsonEncode($value['images']); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php index 1f6a85c983630..d14ec393bd1ff 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price extends Varien_Data_Form_Element_Text { - public function __construct($attributes=array()) + protected function _construct() { - parent::__construct($attributes); + parent::_construct(); $this->addClass('validate-zero-or-greater'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php index fe682362a6213..9cffcb9418151 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php @@ -35,12 +35,10 @@ class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight extends Varien_Dat { /** * Validation classes for weight field which corresponds to DECIMAL(12,4) SQL type - * - * @param array $attributes */ - public function __construct(array $attributes = array()) + protected function _construct() { - parent::__construct($attributes); + parent::_construct(); $this->addClass('validate-number validate-zero-or-greater validate-number-range number-range-0-99999999.9999'); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php index ac05ed6a54f3c..51591c2fb9a7f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php @@ -37,12 +37,10 @@ class Mage_Adminhtml_Block_Catalog_Product_Widget_Chooser extends Mage_Adminhtml /** * Block construction, prepare grid params - * - * @param array $arguments Object data */ - public function __construct($arguments=array()) + protected function _construct() { - parent::__construct($arguments); + parent::_construct(); $this->setDefaultSort('name'); $this->setUseAjax(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser/Container.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser/Container.php index d5b5f47ea2e27..204721a100cf2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser/Container.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser/Container.php @@ -33,14 +33,5 @@ */ class Mage_Adminhtml_Block_Catalog_Product_Widget_Chooser_Container extends Mage_Adminhtml_Block_Template { - /** - * Block construction - * - * @param array $arguments Object data - */ - public function __construct($arguments=array()) - { - parent::__construct($arguments); - $this->setTemplate('catalog/product/widget/chooser/container.phtml'); - } + protected $_template = 'catalog/product/widget/chooser/container.phtml'; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Search.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search.php index b4fc9e5971f87..ca52ea2ed4d39 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Search.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Search.php @@ -35,12 +35,12 @@ class Mage_Adminhtml_Block_Catalog_Search extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'catalog_search'; $this->_headerText = Mage::helper('Mage_Catalog_Helper_Data')->__('Search'); $this->_addButtonLabel = Mage::helper('Mage_Catalog_Helper_Data')->__('Add New Search Term'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit.php index 8f74dc337ee34..53066861712fa 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit.php @@ -35,12 +35,12 @@ class Mage_Adminhtml_Block_Catalog_Search_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_objectId = 'id'; $this->_controller = 'catalog_search'; - parent::__construct(); + parent::_construct(); $this->_updateButton('save', 'label', Mage::helper('Mage_Catalog_Helper_Data')->__('Save Search')); $this->_updateButton('delete', 'label', Mage::helper('Mage_Catalog_Helper_Data')->__('Delete Search')); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php index 144944b1bcaf4..484e9dac7534d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php @@ -38,9 +38,9 @@ class Mage_Adminhtml_Block_Catalog_Search_Edit_Form extends Mage_Adminhtml_Block * Init Form properties * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('catalog_search_form'); $this->setTitle(Mage::helper('Mage_Catalog_Helper_Data')->__('Search Information')); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Grid.php index 50fcd748bdb5e..4cb2b1b209378 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Grid.php @@ -38,9 +38,9 @@ class Mage_Adminhtml_Block_Catalog_Search_Grid extends Mage_Adminhtml_Block_Widg * Init Grid default properties * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('catalog_search_grid'); $this->setDefaultSort('name'); $this->setDefaultDir('ASC'); diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php index 285182d782a87..952438fa482c3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Checkout_Agreement extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'checkout_agreement'; $this->_headerText = Mage::helper('Mage_Checkout_Helper_Data')->__('Manage Terms and Conditions'); $this->_addButtonLabel = Mage::helper('Mage_Checkout_Helper_Data')->__('Add New Condition'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit.php index c3d82f468fbaf..6246b3405e0a5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit.php @@ -38,12 +38,12 @@ class Mage_Adminhtml_Block_Checkout_Agreement_Edit extends Mage_Adminhtml_Block_ * Init class * */ - public function __construct() + protected function _construct() { $this->_objectId = 'id'; $this->_controller = 'checkout_agreement'; - parent::__construct(); + parent::_construct(); $this->_updateButton('save', 'label', Mage::helper('Mage_Checkout_Helper_Data')->__('Save Condition')); $this->_updateButton('delete', 'label', Mage::helper('Mage_Checkout_Helper_Data')->__('Delete Condition')); diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit/Form.php index 04e804cad71ec..ec57fe49561b7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit/Form.php @@ -38,9 +38,9 @@ class Mage_Adminhtml_Block_Checkout_Agreement_Edit_Form extends Mage_Adminhtml_B * Init class * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('checkoutAgreementForm'); $this->setTitle(Mage::helper('Mage_Checkout_Helper_Data')->__('Terms and Conditions Information')); diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Grid.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Grid.php index 60b18d512988a..04b5435e5bd5e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Grid.php @@ -26,9 +26,9 @@ class Mage_Adminhtml_Block_Checkout_Agreement_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setDefaultSort('agreement_id'); $this->setId('agreementGrid'); $this->setDefaultDir('asc'); diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Block.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block.php index 98817622fbad9..7cecf1ca0d3e6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block.php @@ -34,12 +34,12 @@ class Mage_Adminhtml_Block_Cms_Block extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'cms_block'; $this->_headerText = Mage::helper('Mage_Cms_Helper_Data')->__('Static Blocks'); $this->_addButtonLabel = Mage::helper('Mage_Cms_Helper_Data')->__('Add New Block'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php index 74105ce18fdf6..b7cb71517ec07 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php @@ -34,12 +34,12 @@ */ class Mage_Adminhtml_Block_Cms_Block_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_objectId = 'block_id'; $this->_controller = 'cms_block'; - parent::__construct(); + parent::_construct(); $this->_updateButton('save', 'label', Mage::helper('Mage_Cms_Helper_Data')->__('Save Block')); $this->_updateButton('delete', 'label', Mage::helper('Mage_Cms_Helper_Data')->__('Delete Block')); diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit/Form.php index 3ea98e5a48f9c..72a09c8fa5bd0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit/Form.php @@ -38,9 +38,9 @@ class Mage_Adminhtml_Block_Cms_Block_Edit_Form extends Mage_Adminhtml_Block_Widg /** * Init form */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('block_form'); $this->setTitle(Mage::helper('Mage_Cms_Helper_Data')->__('Block Information')); } diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Grid.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Grid.php index f536fc6958902..38273520fc094 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Cms_Block_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('cmsBlockGrid'); $this->setDefaultSort('block_identifier'); $this->setDefaultDir('ASC'); diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Widget/Chooser.php index 64d196d5a5552..7fe7a3aa3579a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Widget/Chooser.php @@ -35,12 +35,10 @@ class Mage_Adminhtml_Block_Cms_Block_Widget_Chooser extends Mage_Adminhtml_Block { /** * Block construction, prepare grid params - * - * @param array $arguments Object data */ - public function __construct($arguments=array()) + protected function _construct() { - parent::__construct($arguments); + parent::_construct(); $this->setDefaultSort('block_identifier'); $this->setDefaultDir('ASC'); $this->setUseAjax(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page.php index 027a5314d6c4a..b06442fc7353c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page.php @@ -38,12 +38,12 @@ class Mage_Adminhtml_Block_Cms_Page extends Mage_Adminhtml_Block_Widget_Grid_Con /** * Block constructor */ - public function __construct() + protected function _construct() { $this->_controller = 'cms_page'; $this->_headerText = Mage::helper('Mage_Cms_Helper_Data')->__('Manage Pages'); - parent::__construct(); + parent::_construct(); if ($this->_isAllowedAction('Mage_Cms::save')) { $this->_updateButton('add', 'label', Mage::helper('Mage_Cms_Helper_Data')->__('Add New Page')); diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php index b57d0095c88b6..7026aceefd159 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php @@ -38,12 +38,12 @@ class Mage_Adminhtml_Block_Cms_Page_Edit extends Mage_Adminhtml_Block_Widget_For * * @return void */ - public function __construct() + protected function _construct() { $this->_objectId = 'page_id'; $this->_controller = 'cms_page'; - parent::__construct(); + parent::_construct(); if ($this->_isAllowedAction('Mage_Cms::save')) { $this->_updateButton('save', 'label', Mage::helper('Mage_Cms_Helper_Data')->__('Save Page')); diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php index 6486f76be2fd2..24fcc1ced1b14 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php @@ -27,9 +27,9 @@ class Mage_Adminhtml_Block_Cms_Page_Edit_Tab_Design extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setShowGlobalIcon(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php index 60c0431c803f2..218acc6ad8bf7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php @@ -35,10 +35,6 @@ class Mage_Adminhtml_Block_Cms_Page_Edit_Tab_Meta extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface { - public function __construct() - { - parent::__construct(); - } protected function _prepareForm() { diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tabs.php index b75241e2dbb9a..0fafcdf4628da 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tabs.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Cms_Page_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('page_tabs'); $this->setDestElementId('edit_form'); $this->setTitle(Mage::helper('Mage_Cms_Helper_Data')->__('Page Information')); diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid.php index b3694b8d1fd3f..cfa7fb40dc3c7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Cms_Page_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('cmsPageGrid'); $this->setDefaultSort('identifier'); $this->setDefaultDir('ASC'); diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Widget/Chooser.php index cfc1c1cf5a3c8..e5d3c7aef4202 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Widget/Chooser.php @@ -38,9 +38,9 @@ class Mage_Adminhtml_Block_Cms_Page_Widget_Chooser extends Mage_Adminhtml_Block_ * * @param array $arguments Object data */ - public function __construct($arguments=array()) + protected function _construct() { - parent::__construct($arguments); + parent::_construct(); //$this->setDefaultSort('name'); $this->setUseAjax(true); $this->setDefaultFilter(array('chooser_is_active' => '1')); diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content.php b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content.php index 12049ea816364..1a86c0ed4e602 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content.php @@ -36,9 +36,9 @@ class Mage_Adminhtml_Block_Cms_Wysiwyg_Images_Content extends Mage_Adminhtml_Blo /** * Block construction */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_headerText = $this->helper('Mage_Cms_Helper_Data')->__('Media Storage'); $this->_removeButton('back')->_removeButton('edit'); $this->_addButton('newfolder', array( diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Uploader.php b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Uploader.php index e166fc285bd8a..c989c783d5b1d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Uploader.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Uploader.php @@ -33,9 +33,9 @@ */ class Mage_Adminhtml_Block_Cms_Wysiwyg_Images_Content_Uploader extends Mage_Adminhtml_Block_Media_Uploader { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $params = $this->getConfig()->getParams(); $type = $this->_getMediaType(); $allowed = Mage::getSingleton('Mage_Cms_Model_Wysiwyg_Images_Storage')->getAllowedExtensions($type); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer.php b/app/code/core/Mage/Adminhtml/Block/Customer.php index 055c081bc411d..af7904a9f999d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer.php @@ -35,12 +35,12 @@ class Mage_Adminhtml_Block_Customer extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'customer'; $this->_headerText = Mage::helper('Mage_Customer_Helper_Data')->__('Manage Customers'); $this->_addButtonLabel = Mage::helper('Mage_Customer_Helper_Data')->__('Add New Customer'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit.php index f1219490e98af..660e9bd80ebee 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit.php @@ -33,7 +33,7 @@ */ class Mage_Adminhtml_Block_Customer_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_objectId = 'id'; $this->_controller = 'customer'; @@ -47,7 +47,7 @@ public function __construct() ), 0); } - parent::__construct(); + parent::_construct(); $this->_updateButton('save', 'label', Mage::helper('Mage_Customer_Helper_Data')->__('Save Customer')); $this->_updateButton('delete', 'label', Mage::helper('Mage_Customer_Helper_Data')->__('Delete Customer')); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Attribute/Group.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Attribute/Group.php index 335b153fd910a..b0988103a23f8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Attribute/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Attribute/Group.php @@ -34,14 +34,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Renderer_Attribute_Group extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element { - /** - * Override parent constructor just for setting custom template - */ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('customer/edit/tab/account/form/renderer/group.phtml'); - } + protected $_template = 'customer/edit/tab/account/form/renderer/group.phtml'; /** * Retrieve disable auto group change element HTML ID diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php index 6024338e9f97c..dbc8a1d0d3741 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php @@ -39,14 +39,6 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Bloc */ const DISABLE_ATTRIBUTE_NAME = 'disable_auto_group_change'; - /** - * Initialize block - */ - public function __construct() - { - parent::__construct(); - } - /** * Initialize form * diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php index 1f8bf2295e081..51e0e7a93f060 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php @@ -33,11 +33,7 @@ */ class Mage_Adminhtml_Block_Customer_Edit_Tab_Addresses extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() - { - parent::__construct(); - $this->setTemplate('customer/tab/addresses.phtml'); - } + protected $_template = 'customer/tab/addresses.phtml'; public function getRegionsUrl() { diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php index 56c59b009d603..c9ca66512a0c6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php @@ -34,12 +34,14 @@ */ class Mage_Adminhtml_Block_Customer_Edit_Tab_Cart extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct($attributes=array()) + protected $_template = 'customer/tab/cart.phtml'; + + protected function _construct() { - parent::__construct($attributes); + parent::_construct(); $this->setUseAjax(true); $this->_parentTemplate = $this->getTemplate(); - $this->setTemplate('customer/tab/cart.phtml'); + } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php index a89fa69e28723..47b2c6796f709 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php @@ -33,12 +33,7 @@ */ class Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter extends Mage_Adminhtml_Block_Widget_Form { - - public function __construct() - { - parent::__construct(); - $this->setTemplate('customer/tab/newsletter.phtml'); - } + protected $_template = 'customer/tab/newsletter.phtml'; public function initForm() { diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid.php index 7cd5e2656dda6..868c0956fa23c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('queueGrid'); $this->setDefaultSort('start_at'); $this->setDefaultDir('desc'); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php index d8d3925f416cb..4bdf6c2625888 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php @@ -36,7 +36,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter_Grid_Filter_Status exten protected static $_statuses; - public function __construct() + protected function _construct() { self::$_statuses = array( null => null, @@ -46,7 +46,7 @@ public function __construct() Mage_Newsletter_Model_Queue::STATUS_SENDING => Mage::helper('Mage_Customer_Helper_Data')->__('Sending'), Mage_Newsletter_Model_Queue::STATUS_PAUSE => Mage::helper('Mage_Customer_Helper_Data')->__('Paused'), ); - parent::__construct(); + parent::_construct(); } protected function _getOptions() diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Status.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Status.php index faa9f535f3224..d47334decddf5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Status.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Status.php @@ -36,7 +36,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter_Grid_Renderer_Status ext protected static $_statuses; - public function __construct() + protected function _construct() { self::$_statuses = array( Mage_Newsletter_Model_Queue::STATUS_SENT => Mage::helper('Mage_Customer_Helper_Data')->__('Sent'), @@ -45,7 +45,7 @@ public function __construct() Mage_Newsletter_Model_Queue::STATUS_SENDING => Mage::helper('Mage_Customer_Helper_Data')->__('Sending'), Mage_Newsletter_Model_Queue::STATUS_PAUSE => Mage::helper('Mage_Customer_Helper_Data')->__('Paused'), ); - parent::__construct(); + parent::_construct(); } public function render(Varien_Object $row) diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php index f59e6312901db..b3dcf804c7c5c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Orders extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('customer_orders_grid'); $this->setDefaultSort('created_at', 'desc'); $this->setUseAjax(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Cart.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Cart.php index 8d3db643da2d5..25d50f1b52e8a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Cart.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Cart.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_View_Cart extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('customer_view_cart_grid'); $this->setDefaultSort('added_at', 'desc'); $this->setSortable(false); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Grid/Renderer/Item.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Grid/Renderer/Item.php index 739fcc0b490dd..3865789a6ff81 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Grid/Renderer/Item.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Grid/Renderer/Item.php @@ -33,17 +33,7 @@ */ class Mage_Adminhtml_Block_Customer_Edit_Tab_View_Grid_Renderer_Item extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { - /** - * Constructor to set default template - * - * @return Mage_Adminhtml_Block_Customer_Edit_Tab_View_Grid_Renderer_Item - */ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('customer/edit/tab/view/grid/item.phtml'); - return $this; - } + protected $_template = 'customer/edit/tab/view/grid/item.phtml'; /** * Returns helper for product type diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Orders.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Orders.php index 54852514128d0..30d15f1ebc5b1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Orders.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Orders.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_View_Orders extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('customer_view_orders_grid'); $this->setDefaultSort('created_at', 'desc'); $this->setSortable(false); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php index 24d3387ff4e52..8139a6e45b518 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php @@ -51,9 +51,9 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_View_Sales extends Mage_Adminhtml_B */ protected $_currency; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('customer_view_sales_grid'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php index 293bcf3c9a899..9a96f15fc5b36 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php @@ -38,9 +38,9 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_View_Wishlist extends Mage_Adminhtm * * @return void */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('customer_view_wishlist_grid'); $this->setSortable(false); $this->setPagerVisibility(false); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php index 20516d0bee4ea..84fe24682cd3f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Customer_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('customer_info_tabs'); $this->setDestElementId('edit_form'); $this->setTitle(Mage::helper('Mage_Customer_Helper_Data')->__('Customer Information')); @@ -111,7 +111,6 @@ protected function _beforeToHtml() } $this->_updateActiveTab(); - Magento_Profiler::stop('customer/tabs'); return parent::_beforeToHtml(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Boolean.php b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Boolean.php index e296fec73ca76..e9265f7f602c2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Boolean.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Boolean.php @@ -36,12 +36,10 @@ class Mage_Adminhtml_Block_Customer_Form_Element_Boolean extends Varien_Data_For { /** * Prepare default SELECT values - * - * @param array $attributes */ - public function __construct($attributes=array()) + protected function _construct() { - parent::__construct($attributes); + parent::_construct(); $this->setValues(array( array( 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('No'), diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php index 02b71d3804d92..312bca2e0767b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php @@ -37,11 +37,10 @@ class Mage_Adminhtml_Block_Customer_Form_Element_File extends Varien_Data_Form_E /** * Initialize Form Element * - * @param array $attributes */ - public function __construct($attributes = array()) + protected function _construct() { - parent::__construct($attributes); + parent::_construct(); $this->setType('file'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Grid.php index bd30f6ed525b0..a555d5c96f831 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Customer_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('customerGrid'); $this->setUseAjax(true); $this->setDefaultSort('entity_id'); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group.php index a681e699e3357..17112438ce02a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group.php @@ -38,12 +38,12 @@ class Mage_Adminhtml_Block_Customer_Group extends Mage_Adminhtml_Block_Widget_Gr * Modify header & button labels * */ - public function __construct() + protected function _construct() { $this->_controller = 'customer_group'; $this->_headerText = Mage::helper('Mage_Customer_Helper_Data')->__('Customer Groups'); $this->_addButtonLabel = Mage::helper('Mage_Customer_Helper_Data')->__('Add New Customer Group'); - parent::__construct(); + parent::_construct(); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php index 0db3c67f36908..1b82295fe74ac 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Customer_Group_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_objectId = 'id'; $this->_controller = 'customer_group'; diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Grid.php index f343754b86fd6..b6db77614fb9a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Customer_Group_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('customerGroupGrid'); $this->setDefaultSort('type'); $this->setDefaultDir('asc'); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online.php index 2400891890774..10bcd3aa34a6f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online.php @@ -34,11 +34,7 @@ class Mage_Adminhtml_Block_Customer_Online extends Mage_Adminhtml_Block_Template { - public function __construct() - { - parent::__construct(); - $this->setTemplate('customer/online.phtml'); - } + protected $_template = 'customer/online.phtml'; public function _beforeToHtml() { diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Filter.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Filter.php index 95e7e382f34f9..714f253afab9e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Filter.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Filter.php @@ -34,10 +34,6 @@ class Mage_Adminhtml_Block_Customer_Online_Filter extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() - { - parent::__construct(); - } protected function _prepareForm() { diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php index bcd08de6f5105..8bfb575e25c8b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php @@ -37,9 +37,9 @@ class Mage_Adminhtml_Block_Customer_Online_Grid extends Mage_Adminhtml_Block_Wid * Initialize Grid block * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('onlineGrid'); $this->setSaveParametersInSession(true); $this->setDefaultSort('last_activity'); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php index d812974cc16c5..a94f1a16fbdc4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php @@ -41,13 +41,7 @@ class Mage_Adminhtml_Block_Customer_Sales_Order_Address_Form_Renderer_Vat */ protected $_validateButton = null; - /** - * Set custom template for 'VAT number' - */ - protected function _construct() - { - $this->setTemplate('customer/sales/order/create/address/form/renderer/vat.phtml'); - } + protected $_template = 'customer/sales/order/create/address/form/renderer/vat.phtml'; /** * Retrieve validate button block diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard.php b/app/code/core/Mage/Adminhtml/Block/Dashboard.php index 9b1de1bb9f004..be52a4cc2e6f6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard.php @@ -33,12 +33,7 @@ class Mage_Adminhtml_Block_Dashboard extends Mage_Adminhtml_Block_Template */ const XML_PATH_ENABLE_CHARTS = 'admin/dashboard/enable_charts'; - public function __construct() - { - parent::__construct(); - $this->setTemplate('dashboard/index.phtml'); - - } + protected $_template = 'dashboard/index.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Abstract.php index 1f134e5e0c179..6928fa5011ade 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Abstract.php @@ -36,11 +36,6 @@ abstract class Mage_Adminhtml_Block_Dashboard_Abstract extends Mage_Adminhtml_Bl { protected $_dataHelperName = null; - public function __construct($attributes=array()) - { - parent::__construct($attributes); - } - public function getCollection() { return $this->getDataHelper()->getCollection(); diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Diagrams.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Diagrams.php index 0de6169097d4d..cf2834b517763 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Diagrams.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Diagrams.php @@ -34,12 +34,14 @@ class Mage_Adminhtml_Block_Dashboard_Diagrams extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + + protected $_template = 'widget/tabshoriz.phtml'; + + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('diagram_tab'); $this->setDestElementId('diagram_tab_content'); - $this->setTemplate('widget/tabshoriz.phtml'); } protected function _prepareLayout() diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php index 0f94d2acecd99..748f5764870fd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php @@ -109,16 +109,7 @@ class Mage_Adminhtml_Block_Dashboard_Graph extends Mage_Adminhtml_Block_Dashboar */ protected $_htmlId = ''; - /** - * Initialize object - * - * @return void - */ - public function __construct() - { - parent::__construct(); - $this->setTemplate('dashboard/graph.phtml'); - } + protected $_template = 'dashboard/graph.phtml'; /** * Get tab template @@ -195,7 +186,7 @@ public function getChartUrl($directUrl = true) $this->_allSeries = $this->getRowsData($this->_dataRows); - foreach ($this->_axisMaps as $axis => $attr){ + foreach ($this->_axisMaps as $axis => $attr) { $this->setAxisLabels($axis, $this->getRowsData($attr, true)); } @@ -210,7 +201,7 @@ public function getChartUrl($directUrl = true) $dates = array(); $datas = array(); - while($dateStart->compare($dateEnd) < 0){ + while ($dateStart->compare($dateEnd) < 0) { switch ($this->getDataHelper()->getParam('period')) { case '7d': case '1m': @@ -241,7 +232,7 @@ public function getChartUrl($directUrl = true) */ if (count($dates) > 8 && count($dates) < 15) { $c = 1; - } else if (count($dates) >= 15){ + } else if (count($dates) >= 15) { $c = 2; } else { $c = 0; @@ -332,9 +323,9 @@ public function getChartUrl($directUrl = true) $currentvalue = $thisdataarray[$j]; if (is_numeric($currentvalue)) { if ($yrange) { - $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange); + $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange); } else { - $ylocation = 0; + $ylocation = 0; } $firstchar = floor($ylocation / 64); $secondchar = $ylocation % 64; @@ -364,7 +355,7 @@ public function getChartUrl($directUrl = true) if (sizeof($this->_axisLabels) > 0) { $params['chxt'] = implode(',', array_keys($this->_axisLabels)); $indexid = 0; - foreach ($this->_axisLabels as $idx=>$labels){ + foreach ($this->_axisLabels as $idx=>$labels) { if ($idx == 'x') { /** * Format date @@ -453,11 +444,11 @@ protected function getRowsData($attributes, $single = false) { $items = $this->getCollection()->getItems(); $options = array(); - foreach ($items as $item){ + foreach ($items as $item) { if ($single) { $options[] = max(0, $item->getData($attributes)); } else { - foreach ((array)$attributes as $attr){ + foreach ((array)$attributes as $attr) { $options[$attr][] = max(0, $item->getData($attr)); } } @@ -541,11 +532,12 @@ protected function getHeight() */ protected function _prepareData() { - $availablePeriods = array_keys($this->helper('Mage_Adminhtml_Helper_Dashboard_Data')->getDatePeriods()); - $period = $this->getRequest()->getParam('period'); - - $this->getDataHelper()->setParam('period', - ($period && in_array($period, $availablePeriods)) ? $period : '24h' - ); + if (!is_null($this->getDataHelperName())) { + $availablePeriods = array_keys($this->helper('Mage_Adminhtml_Helper_Dashboard_Data')->getDatePeriods()); + $period = $this->getRequest()->getParam('period'); + $this->getDataHelper()->setParam('period', + ($period && in_array($period, $availablePeriods)) ? $period : '24h' + ); + } } } diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Grid.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Grid.php index 17abc4ddcb73b..12926bbdc4825 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Grid.php @@ -32,19 +32,17 @@ * @author Magento Core Team */ - class Mage_Adminhtml_Block_Dashboard_Grid extends Mage_Adminhtml_Block_Widget_Grid - { +class Mage_Adminhtml_Block_Dashboard_Grid extends Mage_Adminhtml_Block_Widget_Grid +{ + protected $_template = 'dashboard/grid.phtml'; /** * Setting default for every grid on dashboard - * */ - - public function __construct() + protected function _construct() { - parent::__construct(); - $this->setTemplate('dashboard/grid.phtml'); + parent::_construct(); + $this->setDefaultLimit(5); } - } - +} diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Grids.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Grids.php index 09f70ee1028fa..de88f5f167552 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Grids.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Grids.php @@ -34,12 +34,14 @@ class Mage_Adminhtml_Block_Dashboard_Grids extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + + protected $_template = 'widget/tabshoriz.phtml'; + + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('grid_tab'); $this->setDestElementId('grid_tab_content'); - $this->setTemplate('widget/tabshoriz.phtml'); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php index 9df2dc29f336b..f104ea4d2fdb1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php @@ -34,10 +34,9 @@ class Mage_Adminhtml_Block_Dashboard_Orders_Grid extends Mage_Adminhtml_Block_Dashboard_Grid { - - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('lastOrdersGrid'); } @@ -51,13 +50,13 @@ protected function _prepareCollection() ->joinCustomerName('customer') ->orderByCreatedAt(); - if($this->getParam('store') || $this->getParam('website') || $this->getParam('group')) { + if ($this->getParam('store') || $this->getParam('website') || $this->getParam('group')) { if ($this->getParam('store')) { $collection->addAttributeToFilter('store_id', $this->getParam('store')); - } else if ($this->getParam('website')){ + } else if ($this->getParam('website')) { $storeIds = Mage::app()->getWebsite($this->getParam('website'))->getStoreIds(); $collection->addAttributeToFilter('store_id', array('in' => $storeIds)); - } else if ($this->getParam('group')){ + } else if ($this->getParam('group')) { $storeIds = Mage::app()->getGroup($this->getParam('group'))->getStoreIds(); $collection->addAttributeToFilter('store_id', array('in' => $storeIds)); } diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php index 76cc1dc213407..aee2680c95d77 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php @@ -34,13 +34,8 @@ class Mage_Adminhtml_Block_Dashboard_Sales extends Mage_Adminhtml_Block_Dashboard_Bar { - protected function _construct() - { - parent::_construct(); - $this->setTemplate('dashboard/salebar.phtml'); - - } + protected $_template = 'dashboard/salebar.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php index 531ad5a8731fa..2677f8f832051 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php @@ -36,9 +36,9 @@ class Mage_Adminhtml_Block_Dashboard_Searches_Last extends Mage_Adminhtml_Block_ { protected $_collection; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('lastSearchGrid'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php index 4f18eaa23fecb..805d5a364b37a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php @@ -36,9 +36,9 @@ class Mage_Adminhtml_Block_Dashboard_Searches_Top extends Mage_Adminhtml_Block_D { protected $_collection; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('topSearchGrid'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php index ad5169c640cf7..3260d9c93c877 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php @@ -39,10 +39,10 @@ class Mage_Adminhtml_Block_Dashboard_Tab_Amounts extends Mage_Adminhtml_Block_Da * * @return void */ - public function __construct() + protected function _construct() { $this->setHtmlId('amounts'); - parent::__construct(); + parent::_construct(); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Most.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Most.php index 61e93f6d1aef7..0fd6792385a78 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Most.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Most.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Dashboard_Tab_Customers_Most extends Mage_Adminhtml_Block_Dashboard_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('customersMostGrid'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Newest.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Newest.php index 38ef358038f91..a23b0a1ec353c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Newest.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Newest.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Dashboard_Tab_Customers_Newest extends Mage_Adminhtml_Block_Dashboard_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('customersNewestGrid'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php index 89cd862654941..fa0a8fa0d6789 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php @@ -39,10 +39,10 @@ class Mage_Adminhtml_Block_Dashboard_Tab_Orders extends Mage_Adminhtml_Block_Das * * @return void */ - public function __construct() + protected function _construct() { $this->setHtmlId('orders'); - parent::__construct(); + parent::_construct(); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php index f5ff92b2682f4..e07a041c4a27c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Dashboard_Tab_Products_Ordered extends Mage_Adminhtml_Block_Dashboard_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('productsOrderedGrid'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Viewed.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Viewed.php index 0a1eef69dd862..6fcf5b1968970 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Viewed.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Viewed.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Dashboard_Tab_Products_Viewed extends Mage_Adminhtml_Block_Dashboard_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('productsReviewedGrid'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php index 3c24ab0e44bb1..a8ffc1cd41d2a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php @@ -34,11 +34,7 @@ */ class Mage_Adminhtml_Block_Dashboard_Totals extends Mage_Adminhtml_Block_Dashboard_Bar { - protected function _construct() - { - parent::_construct(); - $this->setTemplate('dashboard/totalbar.phtml'); - } + protected $_template = 'dashboard/totalbar.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php b/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php index e4c0bded3f46e..45b41388563b6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php +++ b/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php @@ -36,11 +36,13 @@ class Mage_Adminhtml_Block_Media_Uploader extends Mage_Adminhtml_Block_Widget protected $_config; - public function __construct() + protected $_template = 'media/uploader.phtml'; + + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId($this->getId() . '_Uploader'); - $this->setTemplate('media/uploader.phtml'); + $this->getConfig()->setUrl(Mage::getModel('Mage_Adminhtml_Model_Url')->addSessionParam()->getUrl('*/*/upload')); $this->getConfig()->setParams(array('form_key' => $this->getFormKey())); $this->getConfig()->setFileField('file'); diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem.php index 74f73e4a7f3f6..780ca3a3f6e72 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem.php @@ -34,10 +34,13 @@ class Mage_Adminhtml_Block_Newsletter_Problem extends Mage_Adminhtml_Block_Template { - public function __construct() + protected $_template = 'newsletter/problem/list.phtml'; + + + protected function _construct() { - parent::__construct(); - $this->setTemplate('newsletter/problem/list.phtml'); + parent::_construct(); + $collection = Mage::getResourceSingleton('Mage_Newsletter_Model_Resource_Problem_Collection') ->addSubscriberInfo() ->addQueueInfo(); diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid.php index faa1ababdb815..fb91c3baa1400 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid.php @@ -33,9 +33,9 @@ */ class Mage_Adminhtml_Block_Newsletter_Problem_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('problemGrid'); $this->setSaveParametersInSession(true); $this->setMessageBlockVisibility(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue.php index 80d8a5826d6c0..bcf0eb581a1b6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue.php @@ -33,10 +33,8 @@ */ class Mage_Adminhtml_Block_Newsletter_Queue extends Mage_Adminhtml_Block_Template { - public function __construct() - { - $this->setTemplate('newsletter/queue/list.phtml'); - } + + protected $_template = 'newsletter/queue/list.phtml'; protected function _beforeToHtml() { diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php index 9e7ed5eaf1654..fa33901e175fe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php @@ -34,10 +34,8 @@ class Mage_Adminhtml_Block_Newsletter_Queue_Edit extends Mage_Adminhtml_Block_Template { - /** - * Check for template Id in request - * - */ + protected $_template = 'newsletter/queue/edit.phtml'; + protected function _construct() { parent::_construct(); @@ -59,7 +57,7 @@ public function getQueue() protected function _beforeToHtml() { - $this->setTemplate('newsletter/queue/edit.phtml'); + $this->setChild('form', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Newsletter_Queue_Edit_Form','form') diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php index 811e5c9e2275b..b8f5e4f8e004d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Newsletter_Queue_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('queueGrid'); $this->setDefaultSort('start_at'); $this->setDefaultDir('desc'); diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php index 07f5668aacbd3..e21d127d6dbe3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php @@ -41,15 +41,7 @@ class Mage_Adminhtml_Block_Newsletter_Subscriber extends Mage_Adminhtml_Block_Te */ protected $_queueCollection = null; - /** - * Constructor - * - * Initializes block - */ - public function __construct() - { - $this->setTemplate('newsletter/subscriber/list.phtml'); - } + protected $_template = 'newsletter/subscriber/list.phtml'; /** * Prepares block to render diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid.php index 39c73d05bcbd5..9837819ed6c46 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid.php @@ -44,18 +44,12 @@ class Mage_Adminhtml_Block_Newsletter_Subscriber_Grid extends Mage_Adminhtml_Blo * Constructor * * Set main configuration of grid - * - * @param array $attributes - * @throws InvalidArgumentException */ - public function __construct(array $attributes = array()) + protected function _construct() { - $this->_app = isset($attributes['app']) ? $attributes['app'] : Mage::app(); + $this->_app = Mage::app(); - if (!($this->_app instanceof Mage_Core_Model_App)) { - throw new InvalidArgumentException('Required application object is invalid'); - } - parent::__construct($attributes); + parent::_construct(); $this->setId('subscriberGrid'); $this->setUseAjax(true); $this->setDefaultSort('subscriber_id', 'desc'); diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template.php index dd1967206bd96..90382077d20c8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template.php @@ -34,12 +34,7 @@ class Mage_Adminhtml_Block_Newsletter_Template extends Mage_Adminhtml_Block_Template { - public function __construct() - { - parent::__construct(); - $this->setTemplate('newsletter/template/list.phtml'); - } - + protected $_template = 'newsletter/template/list.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit/Form.php index e4cddbed458e3..bf14fbc4a179c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit/Form.php @@ -34,14 +34,6 @@ */ class Mage_Adminhtml_Block_Newsletter_Template_Edit_Form extends Mage_Adminhtml_Block_Widget_Form { - /** - * Define Form settings - * - */ - public function __construct() - { - parent::__construct(); - } /** * Retrieve template object diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Inbox.php b/app/code/core/Mage/Adminhtml/Block/Notification/Inbox.php index 44d65654385f9..2f23d8d94d0f9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Inbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Inbox.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Notification_Inbox extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'notification'; $this->_headerText = Mage::helper('Mage_AdminNotification_Helper_Data')->__('Messages Inbox'); - parent::__construct(); + parent::_construct(); } protected function _prepareLayout() diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php b/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php index a906da0d6fafa..34222e31c9d90 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php @@ -34,12 +34,6 @@ */ class Mage_Adminhtml_Block_Notification_Toolbar extends Mage_Adminhtml_Block_Template { - /** - * Initialize Toolbar block - * - */ - protected function _construct() - {} /** * Retrieve helper diff --git a/app/code/core/Mage/Adminhtml/Block/Page.php b/app/code/core/Mage/Adminhtml/Block/Page.php index 4b4e66d360e99..506598944edc3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page.php +++ b/app/code/core/Mage/Adminhtml/Block/Page.php @@ -34,14 +34,16 @@ class Mage_Adminhtml_Block_Page extends Mage_Adminhtml_Block_Template { + protected $_template = 'admin/page.phtml'; + /** * Class constructor * */ - public function __construct() + protected function _construct() { - parent::__construct(); - $this->setTemplate('admin/page.phtml'); + parent::_construct(); + $action = Mage::app()->getFrontController()->getAction(); if ($action) { $this->addBodyClass($action->getFullActionName('-')); diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Footer.php b/app/code/core/Mage/Adminhtml/Block/Page/Footer.php index 9a7282f0570c8..c57877dd86235 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Footer.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Footer.php @@ -38,9 +38,10 @@ class Mage_Adminhtml_Block_Page_Footer extends Mage_Adminhtml_Block_Template const LOCALE_CACHE_KEY = 'footer_locale'; const LOCALE_CACHE_TAG = 'adminhtml'; + protected $_template = 'page/footer.phtml'; + protected function _construct() { - $this->setTemplate('page/footer.phtml'); $this->setShowProfiler(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Head.php b/app/code/core/Mage/Adminhtml/Block/Page/Head.php index b654a150f9403..e964a36dbe286 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Head.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Head.php @@ -33,14 +33,8 @@ */ class Mage_Adminhtml_Block_Page_Head extends Mage_Page_Block_Html_Head { - /** - * Initialize template - * - */ - protected function _construct() - { - $this->setTemplate('page/head.phtml'); - } + protected $_template = 'page/head.phtml'; + /** * Enter description here... * diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Header.php b/app/code/core/Mage/Adminhtml/Block/Page/Header.php index d66e29938a1e5..8a33f772d5711 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Header.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Header.php @@ -33,11 +33,7 @@ */ class Mage_Adminhtml_Block_Page_Header extends Mage_Adminhtml_Block_Template { - public function __construct() - { - parent::__construct(); - $this->setTemplate('page/header.phtml'); - } + protected $_template = 'page/header.phtml'; public function getHomeLink() { diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit.php b/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit.php index 6743578dc20f0..39f3c25722ae7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Poll_Answer_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_objectId = 'id'; $this->_controller = 'poll_answer'; diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit.php index eac54f7fbd89d..6f76a21fdd69c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Poll_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_objectId = 'id'; $this->_controller = 'poll'; diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Grid.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Grid.php index 93a7eb8fa307c..b0f577bd4ebdd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Poll_Edit_Tab_Answers_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('answersGrid'); $this->setDefaultSort('answer_id'); $this->setDefaultDir('ASC'); diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/List.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/List.php index 1252b5c72809e..9ad5d9e2af5ad 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/List.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/List.php @@ -32,10 +32,7 @@ class Mage_Adminhtml_Block_Poll_Edit_Tab_Answers_List extends Mage_Adminhtml_Block_Template { - public function __construct() - { - $this->setTemplate('poll/answers/list.phtml'); - } + protected $_template = 'poll/answers/list.phtml'; protected function _toHtml() { diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tabs.php index 5686acbb97376..22cb651908603 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tabs.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Poll_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('poll_tabs'); $this->setDestElementId('edit_form'); $this->setTitle(Mage::helper('Mage_Poll_Helper_Data')->__('Poll Information')); diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php b/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php index 8babe4ac50c4b..781ab1f815e6e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Poll_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('pollGrid'); $this->setDefaultSort('poll_title'); $this->setDefaultDir('ASC'); diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Poll.php b/app/code/core/Mage/Adminhtml/Block/Poll/Poll.php index 719c660028823..8b63efa2b09fc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Poll.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Poll.php @@ -34,12 +34,12 @@ class Mage_Adminhtml_Block_Poll_Poll extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'poll'; $this->_headerText = Mage::helper('Mage_Poll_Helper_Data')->__('Poll Manager'); $this->_addButtonLabel = Mage::helper('Mage_Poll_Helper_Data')->__('Add New Poll'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog.php index ddd75e0a051b3..8f7c86766586e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog.php @@ -35,7 +35,7 @@ class Mage_Adminhtml_Block_Promo_Catalog extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_addButton('apply_rules', array( 'label' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Apply Rules'), @@ -46,7 +46,7 @@ public function __construct() $this->_controller = 'promo_catalog'; $this->_headerText = Mage::helper('Mage_CatalogRule_Helper_Data')->__('Catalog Price Rules'); $this->_addButtonLabel = Mage::helper('Mage_CatalogRule_Helper_Data')->__('Add New Rule'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php index aaeb523be9f69..569a149da3b76 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php @@ -36,12 +36,12 @@ class Mage_Adminhtml_Block_Promo_Catalog_Edit extends Mage_Adminhtml_Block_Widge * Add "Save and Apply" button * Add "Save and Continue" button */ - public function __construct() + protected function _construct() { $this->_objectId = 'id'; $this->_controller = 'promo_catalog'; - parent::__construct(); + parent::_construct(); $this->_addButton('save_apply', array( 'class' => 'save', diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Form.php index a8d3203f3cff0..aac51eb3a4f1e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Form.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Promo_Catalog_Edit_Form extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('promo_catalog_form'); $this->setTitle(Mage::helper('Mage_CatalogRule_Helper_Data')->__('Rule Information')); } diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tabs.php index acaa5dc92b6b6..11df50dd6bfd4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tabs.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Promo_Catalog_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('promo_catalog_edit_tabs'); $this->setDestElementId('edit_form'); $this->setTitle(Mage::helper('Mage_CatalogRule_Helper_Data')->__('Catalog Price Rule')); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php index d942195fbf5b1..06a477a748edb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php @@ -37,9 +37,9 @@ class Mage_Adminhtml_Block_Promo_Catalog_Grid extends Mage_Adminhtml_Block_Widge * Initialize grid * Set sort settings */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('promo_catalog_grid'); $this->setDefaultSort('name'); $this->setDefaultDir('ASC'); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote.php index d18fdd616e57b..e762938f028ad 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote.php @@ -35,12 +35,12 @@ class Mage_Adminhtml_Block_Promo_Quote extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'promo_quote'; $this->_headerText = Mage::helper('Mage_SalesRule_Helper_Data')->__('Shopping Cart Price Rules'); $this->_addButtonLabel = Mage::helper('Mage_SalesRule_Helper_Data')->__('Add New Rule'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php index 39b76c15d2142..32349f6524365 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php @@ -36,12 +36,12 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit extends Mage_Adminhtml_Block_Widget_ * Add standard buttons * Add "Save and Continue" button */ - public function __construct() + protected function _construct() { $this->_objectId = 'id'; $this->_controller = 'promo_quote'; - parent::__construct(); + parent::_construct(); $this->_addButton('save_and_continue_edit', array( 'class' => 'save', diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Form.php index 468c63a2714fb..0c6ab4f3c623c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Form.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Form extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('promo_quote_form'); $this->setTitle(Mage::helper('Mage_SalesRule_Helper_Data')->__('Rule Information')); } diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php index 0cc6bf1c3cb9b..e3eccc45ab53d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php @@ -37,9 +37,9 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Grid extends Mage_Adminh /** * Constructor */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('couponCodesGrid'); $this->setUseAjax(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php index 6f46171ffbed4..7658e2325dc23 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php @@ -25,7 +25,7 @@ */ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Labels - extends Mage_Adminhtml_Block_Widget_Form + extends Mage_Backend_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface { /** @@ -38,17 +38,34 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Labels /** * Class constructor * + * @param Mage_Core_Controller_Request_Http $request + * @param Mage_Core_Model_Layout $layout + * @param Mage_Core_Model_Event_Manager $eventManager + * @param Mage_Core_Model_Translate $translator + * @param Mage_Core_Model_Cache $cache + * @param Mage_Core_Model_Design_Package $designPackage + * @param Mage_Core_Model_Session $session + * @param Mage_Core_Model_Store_Config $storeConfig + * @param Mage_Core_Controller_Varien_Front $frontController + * @param Mage_Core_Model_App $app * @param array $data - * @throws InvalidArgumentException */ - public function __construct(array $data = array()) - { - $this->_app = isset($data['app']) ? $data['app'] : Mage::app(); - - if (!($this->_app instanceof Mage_Core_Model_App)) { - throw new InvalidArgumentException('Required application object is invalid'); - } - parent::__construct($data); + public function __construct(Mage_Core_Controller_Request_Http $request, + Mage_Core_Model_Layout $layout, + Mage_Core_Model_Event_Manager $eventManager, + Mage_Core_Model_Translate $translator, + Mage_Core_Model_Cache $cache, + Mage_Core_Model_Design_Package $designPackage, + Mage_Core_Model_Session $session, + Mage_Core_Model_Store_Config $storeConfig, + Mage_Core_Controller_Varien_Front $frontController, + Mage_Core_Model_App $app, + array $data = array() + ) { + $this->_app = $app; + parent::__construct($request, $layout, $eventManager, $translator, $cache, $designPackage, $session, + $storeConfig, $frontController, $data + ); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tabs.php index 181bc26fa88a4..01938b5a0eb3f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tabs.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('promo_catalog_edit_tabs'); $this->setDestElementId('edit_form'); $this->setTitle(Mage::helper('Mage_SalesRule_Helper_Data')->__('Shopping Cart Price Rule')); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php index 09039f564a211..9ae92900109dd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php @@ -37,9 +37,9 @@ class Mage_Adminhtml_Block_Promo_Quote_Grid extends Mage_Adminhtml_Block_Widget_ * Initialize grid * Set sort settings */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('promo_quote_grid'); $this->setDefaultSort('sort_order'); $this->setDefaultDir('ASC'); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php index d70740a5e163c..1d382109fa22e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php @@ -31,12 +31,10 @@ class Mage_Adminhtml_Block_Promo_Widget_Chooser extends Mage_Adminhtml_Block_Wid { /** * Block constructor, prepare grid params - * - * @param array $arguments */ - public function __construct($arguments=array()) + protected function _construct() { - parent::__construct($arguments); + parent::_construct(); $this->setDefaultSort('rule_id'); $this->setDefaultDir('ASC'); $this->setUseAjax(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php index f6be73d220028..8eecf4f26fcad 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Promo_Widget_Chooser_Sku extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct($arguments=array()) + protected function _construct() { - parent::__construct($arguments); + parent::_construct(); if ($this->getRequest()->getParam('current_grid_id')) { $this->setId($this->getRequest()->getParam('current_grid_id')); diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php index 6cb2d330fa8c2..b0dc50b1fb37a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Rating_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_objectId = 'id'; $this->_controller = 'rating'; diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php index ec94f36ddbf1b..69553ed5d9aec 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php @@ -32,7 +32,7 @@ * @author Magento Core Team */ -class Mage_Adminhtml_Block_Rating_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form +class Mage_Adminhtml_Block_Rating_Edit_Tab_Form extends Mage_Backend_Block_Widget_Form { /** * Application instance @@ -44,17 +44,34 @@ class Mage_Adminhtml_Block_Rating_Edit_Tab_Form extends Mage_Adminhtml_Block_Wid /** * Class constructor * + * @param Mage_Core_Controller_Request_Http $request + * @param Mage_Core_Model_Layout $layout + * @param Mage_Core_Model_Event_Manager $eventManager + * @param Mage_Core_Model_Translate $translator + * @param Mage_Core_Model_Cache $cache + * @param Mage_Core_Model_Design_Package $designPackage + * @param Mage_Core_Model_Session $session + * @param Mage_Core_Model_Store_Config $storeConfig + * @param Mage_Core_Controller_Varien_Front $frontController + * @param Mage_Core_Model_App $app * @param array $data - * @throws InvalidArgumentException */ - public function __construct(array $data = array()) - { - $this->_app = isset($data['app']) ? $data['app'] : Mage::app(); - - if (!($this->_app instanceof Mage_Core_Model_App)) { - throw new InvalidArgumentException('Required app object is invalid'); - } - parent::__construct($data); + public function __construct( + Mage_Core_Controller_Request_Http $request, + Mage_Core_Model_Layout $layout, + Mage_Core_Model_Event_Manager $eventManager, + Mage_Core_Model_Translate $translator, + Mage_Core_Model_Cache $cache, + Mage_Core_Model_Design_Package $designPackage, + Mage_Core_Model_Session $session, + Mage_Core_Model_Store_Config $storeConfig, + Mage_Core_Controller_Varien_Front $frontController, + Mage_Core_Model_App $app, + array $data = array() + ) { + $this->_app = $app; + parent::__construct($request, $layout, $eventManager, $translator, $cache, $designPackage, $session, + $storeConfig, $frontController, $data); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tabs.php index bd103b980e366..cce0e3c2ba145 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tabs.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Rating_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('rating_tabs'); $this->setDestElementId('edit_form'); $this->setTitle(Mage::helper('Mage_Rating_Helper_Data')->__('Rating Information')); diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Grid.php b/app/code/core/Mage/Adminhtml/Block/Rating/Grid.php index b1e09e4e923e2..f1424c7e7d8ef 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Rating_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('ratingsGrid'); $this->setDefaultSort('rating_code'); $this->setDefaultDir('ASC'); diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php b/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php index e967b81f8eccc..6bb11884f1bfe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Rating_Rating extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'rating'; $this->_headerText = Mage::helper('Mage_Rating_Helper_Data')->__('Manage Ratings'); $this->_addButtonLabel = Mage::helper('Mage_Rating_Helper_Data')->__('Add New Rating'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts.php index 47a237f87e823..2f31db394267c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts.php @@ -35,11 +35,11 @@ class Mage_Adminhtml_Block_Report_Customer_Accounts extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'report_customer_accounts'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('New Accounts'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts/Grid.php index 0c608c302e155..1eedcb425bb06 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Report_Customer_Accounts_Grid extends Mage_Adminhtml_Block_Report_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('gridAccounts'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders.php index 509b8abc47ad2..80c3b259b0847 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Report_Customer_Orders extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'report_customer_orders'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Customers by number of orders'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders/Grid.php index 9ee9c64ab1c86..84e317e1794fb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Report_Customer_Orders_Grid extends Mage_Adminhtml_Block_Report_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('gridOrdersCustomer'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals.php index 3ed8fa38db786..d779b20bc7146 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Report_Customer_Totals extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'report_customer_totals'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Customers by Orders Total'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php index 2b4ac463f476d..2a4c456fd4449 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Report_Customer_Totals_Grid extends Mage_Adminhtml_Block_Report_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('gridTotalsCustomer'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid.php index bfa34eb7017a2..61b485a3b0d3c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid.php @@ -43,11 +43,6 @@ class Mage_Adminhtml_Block_Report_Grid extends Mage_Adminhtml_Block_Widget_Grid protected $_filters = array(); - /** - * @var Mage_Core_Model_Locale - */ - protected $_locale; - protected $_defaultFilters = array( 'report_from' => '', 'report_to' => '', @@ -65,12 +60,28 @@ class Mage_Adminhtml_Block_Report_Grid extends Mage_Adminhtml_Block_Widget_Grid */ protected $_currentCurrencyCode = null; - public function __construct() + protected $_template = 'Mage_Adminhtml::report/grid.phtml'; + + /** + * Filter values array + * + * @var array + */ + protected $_filterValues; + + /** + * Locale instance + * + * @var Mage_Core_Model_Locale + */ + protected $_locale; + + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setFilterVisibility(false); $this->setPagerVisibility(false); - $this->setTemplate('Mage_Adminhtml::report/grid.phtml'); + $this->setUseAjax(false); $this->setCountTotals(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php index 6de83e6e06041..2c9c33b4dbd86 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php @@ -32,9 +32,9 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid protected $_storeIds = array(); protected $_aggregatedColumns = null; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setFilterVisibility(false); $this->setPagerVisibility(false); $this->setUseAjax(false); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product.php b/app/code/core/Mage/Adminhtml/Block/Report/Product.php index 449973aeac136..43473aaa83feb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Report_Product extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'report_product'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Products Report'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads.php index 4f76093eb96c8..5b1da85698465 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Report_Product_Downloads extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'report_product_downloads'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Downloads'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Grid.php index e2cba3fd031da..bfe3e9578dedb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Grid.php @@ -33,9 +33,9 @@ */ class Mage_Adminhtml_Block_Report_Product_Downloads_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('downloadsGrid'); $this->setUseAjax(false); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Grid.php index 1cc0007e8e734..b917c0647c788 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Report_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('productsReportGrid'); $this->setDefaultSort('entity_id'); $this->setDefaultDir('desc'); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock.php index ce636758120fe..96ef4e5bae842 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Report_Product_Lowstock extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'report_product_lowstock'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Low stock'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock/Grid.php index 5fbd939c57355..66e4a7e79e5f7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock/Grid.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Report_Product_Lowstock_Grid extends Mage_Adminhtml_B { // protected $_saveParametersInSession = true; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('gridLowstock'); $this->setUseAjax(false); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold.php index cff4cd59ce056..3ac0a5f58bde4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold.php @@ -38,11 +38,11 @@ class Mage_Adminhtml_Block_Report_Product_Sold extends Mage_Adminhtml_Block_Widg * Initialize container block settings * */ - public function __construct() + protected function _construct() { $this->_controller = 'report_product_sold'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Products Ordered'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php index ffb05118922ed..c8c19acea19df 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php @@ -45,9 +45,9 @@ class Mage_Adminhtml_Block_Report_Product_Sold_Grid extends Mage_Adminhtml_Block * Initialize Grid settings * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('gridProductsSold'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php index d0416921e860f..8187e588d5dcb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php @@ -34,12 +34,14 @@ class Mage_Adminhtml_Block_Report_Product_Viewed extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected $_template = 'report/grid/container.phtml'; + + protected function _construct() { $this->_controller = 'report_product_viewed'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Most Viewed'); - parent::__construct(); - $this->setTemplate('report/grid/container.phtml'); + parent::_construct(); + $this->_removeButton('add'); $this->addButton('filter_form_submit', array( 'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'), diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php index 73b80875ba618..8d64a1246c1cf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php @@ -50,9 +50,9 @@ class Mage_Adminhtml_Block_Report_Product_Viewed_Grid extends Mage_Adminhtml_Blo /** * Init grid parameters */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setCountTotals(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics.php b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics.php index 196c6988e524c..0810ea0c1dede 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Report_Refresh_Statistics extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'report_refresh_statistics'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Refresh Statistics'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php index 9b375d6192f04..d69c68730e59e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php @@ -33,9 +33,9 @@ */ class Mage_Adminhtml_Block_Report_Refresh_Statistics_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setFilterVisibility(false); $this->setPagerVisibility(false); $this->setUseAjax(false); @@ -160,7 +160,7 @@ protected function _prepareMassaction() $this->getMassactionBlock()->addItem('refresh_recent', array( 'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Refresh Statistics for the Last Day'), 'url' => $this->getUrl('*/*/refreshRecent'), - 'confirm' => Mage::helper('Mage_Reports_Helper_Data')->__('Are you sure?'), + 'confirm' => Mage::helper('Mage_Reports_Helper_Data')->__('Are you sure you want to refresh statistics for last day?'), 'selected' => true )); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer.php index 0bb956516b49c..f5edf9ee71817 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer.php @@ -35,11 +35,11 @@ class Mage_Adminhtml_Block_Report_Review_Customer extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'report_review_customer'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Customers Reviews'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer/Grid.php index 26e1d3c9e692a..2a647bd63f430 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Report_Review_Customer_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('customers_grid'); $this->setDefaultSort('review_cnt'); $this->setDefaultDir('desc'); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php index acb8f2b9a3ce5..a9d6e06cc354d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php @@ -35,14 +35,14 @@ class Mage_Adminhtml_Block_Report_Review_Detail extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'report_review_detail'; $product = Mage::getModel('Mage_Catalog_Model_Product')->load($this->getRequest()->getParam('id')); $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Reviews for %s', $product->getName()); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); $this->setBackUrl($this->getUrl('*/report_review/product/')); $this->_addBackButton(); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail/Grid.php index 6e1e82c1fc691..877eff4358d91 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Report_Review_Detail_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('reviews_grid'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Product.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Product.php index c57fc871f857d..8df2e449f39fc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Product.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Report_Review_Product extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'report_review_product'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Products Reviews'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Product/Grid.php index 4afc2bb6b3f9e..e2bb59087936c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Product/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Report_Review_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('gridProducts'); $this->setDefaultSort('review_cnt'); $this->setDefaultDir('desc'); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php index ae10b5da67ca5..62367f3fbedfb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php @@ -34,13 +34,14 @@ class Mage_Adminhtml_Block_Report_Sales_Bestsellers extends Mage_Adminhtml_Block_Widget_Grid_Container { + protected $_template = 'report/grid/container.phtml'; - public function __construct() + protected function _construct() { $this->_controller = 'report_sales_bestsellers'; $this->_headerText = Mage::helper('Mage_Sales_Helper_Data')->__('Products Bestsellers Report'); - parent::__construct(); - $this->setTemplate('report/grid/container.phtml'); + parent::_construct(); + $this->_removeButton('add'); $this->addButton('filter_form_submit', array( 'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'), diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php index b45547a81a167..12fc7d0ce3a42 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Report_Sales_Bestsellers_Grid extends Mage_Adminhtml_ { protected $_columnGroupBy = 'period'; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setCountTotals(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php index 44c5f28f567a3..002ac57e27be6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php @@ -34,12 +34,14 @@ class Mage_Adminhtml_Block_Report_Sales_Coupons extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected $_template = 'report/grid/container.phtml'; + + protected function _construct() { $this->_controller = 'report_sales_coupons'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Coupons Usage Report'); - parent::__construct(); - $this->setTemplate('report/grid/container.phtml'); + parent::_construct(); + $this->_removeButton('add'); $this->addButton('filter_form_submit', array( 'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'), diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php index a3cc27901235b..d0cb6d94e5e01 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Report_Sales_Coupons_Grid extends Mage_Adminhtml_Bloc { protected $_columnGroupBy = 'period'; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setCountTotals(true); $this->setCountSubTotals(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php index 84bc0cb5e2ec7..da71a34850c4a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php @@ -34,12 +34,14 @@ class Mage_Adminhtml_Block_Report_Sales_Invoiced extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected $_template = 'report/grid/container.phtml'; + + protected function _construct() { $this->_controller = 'report_sales_invoiced'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Total Invoiced vs. Paid Report'); - parent::__construct(); - $this->setTemplate('report/grid/container.phtml'); + parent::_construct(); + $this->_removeButton('add'); $this->addButton('filter_form_submit', array( 'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'), diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php index 5797984df029c..8e92ea9b479ab 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Report_Sales_Invoiced_Grid extends Mage_Adminhtml_Blo { protected $_columnGroupBy = 'period'; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setCountTotals(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php index 1005f3489f57e..a66ded922f740 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php @@ -34,12 +34,14 @@ class Mage_Adminhtml_Block_Report_Sales_Refunded extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected $_template = 'report/grid/container.phtml'; + + protected function _construct() { $this->_controller = 'report_sales_refunded'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Total Refunded Report'); - parent::__construct(); - $this->setTemplate('report/grid/container.phtml'); + parent::_construct(); + $this->_removeButton('add'); $this->addButton('filter_form_submit', array( 'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'), diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php index a6ead9d286096..0b8fcc79fa1de 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Report_Sales_Refunded_Grid extends Mage_Adminhtml_Blo { protected $_columnGroupBy = 'period'; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setCountTotals(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php index 5453ce4d97e92..788b8217409c0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php @@ -34,13 +34,14 @@ class Mage_Adminhtml_Block_Report_Sales_Sales extends Mage_Adminhtml_Block_Widget_Grid_Container { + protected $_template = 'report/grid/container.phtml'; - public function __construct() + protected function _construct() { $this->_controller = 'report_sales_sales'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Total Ordered Report'); - parent::__construct(); - $this->setTemplate('report/grid/container.phtml'); + parent::_construct(); + $this->_removeButton('add'); $this->addButton('filter_form_submit', array( 'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'), diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php index 9288f97e78d5b..aff8d8aeefb46 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Report_Sales_Sales_Grid extends Mage_Adminhtml_Block_ { protected $_columnGroupBy = 'period'; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setCountTotals(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php index dc3bca9836bff..68726db057457 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php @@ -34,12 +34,15 @@ class Mage_Adminhtml_Block_Report_Sales_Shipping extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + + protected $_template = 'report/grid/container.phtml'; + + protected function _construct() { $this->_controller = 'report_sales_shipping'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Total Shipped Report'); - parent::__construct(); - $this->setTemplate('report/grid/container.phtml'); + parent::_construct(); + $this->_removeButton('add'); $this->addButton('filter_form_submit', array( 'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'), diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php index 37bc997b4b34e..1142cafcd6073 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Report_Sales_Shipping_Grid extends Mage_Adminhtml_Blo { protected $_columnGroupBy = 'period'; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setCountTotals(true); $this->setCountSubTotals(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php index 9ce1f72896f3b..a2749e8a6361f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php @@ -34,12 +34,15 @@ class Mage_Adminhtml_Block_Report_Sales_Tax extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + + protected $_template = 'report/grid/container.phtml'; + + protected function _construct() { $this->_controller = 'report_sales_tax'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Order Taxes Report Grouped by Tax Rate'); - parent::__construct(); - $this->setTemplate('report/grid/container.phtml'); + parent::_construct(); + $this->_removeButton('add'); $this->addButton('filter_form_submit', array( 'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'), diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php index b68c9ca514cbe..3bc87043552b6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Report_Sales_Tax_Grid extends Mage_Adminhtml_Block_Re { protected $_columnGroupBy = 'period'; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setCountTotals(true); $this->setCountSubTotals(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Search.php b/app/code/core/Mage/Adminhtml/Block/Report/Search.php index fd4e6e9f32ff9..95cfc35bbe890 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Search.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Search.php @@ -38,11 +38,11 @@ class Mage_Adminhtml_Block_Report_Search extends Mage_Adminhtml_Block_Widget_Gri * Initialize Grid Container * */ - public function __construct() + protected function _construct() { $this->_controller = 'report_search'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Search Terms'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Search/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Search/Grid.php index de5cb6a32dafb..d33b2551c2470 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Search/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Search/Grid.php @@ -37,9 +37,9 @@ class Mage_Adminhtml_Block_Report_Search_Grid extends Mage_Adminhtml_Block_Widge * Initialize Grid Properties * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('searchReportGrid'); $this->setDefaultSort('query_id'); $this->setDefaultDir('desc'); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned.php index 74534f9c42ac4..67945630c805c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Report_Shopcart_Abandoned extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'report_shopcart_abandoned'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Abandoned carts'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php index b148285d05678..fdc3b5a978cf3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Report_Shopcart_Abandoned_Grid extends Mage_Adminhtml_Block_Report_Grid_Shopcart { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('gridAbandoned'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer.php index adf338ef44d31..89a03edb6dfdd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Report_Shopcart_Customer extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'report_shopcart_customer'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Customers'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php index 00cea8f443aab..bef98ee289837 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Report_Shopcart_Customer_Grid extends Mage_Adminhtml_Block_Report_Grid_Shopcart { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('grid'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product.php index d53272dc0c5bb..432f741b7924c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Report_Shopcart_Product extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'report_shopcart_product'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Products in carts'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php index 1ccb4542187f3..d76c73f340f38 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Report_Shopcart_Product_Grid extends Mage_Adminhtml_Block_Report_Grid_Shopcart { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('gridProducts'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Wishlist.php b/app/code/core/Mage/Adminhtml/Block/Report/Wishlist.php index f1a9f41284b9c..4ac3c2d87b2f0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Wishlist.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Wishlist.php @@ -41,11 +41,7 @@ class Mage_Adminhtml_Block_Report_Wishlist extends Mage_Adminhtml_Block_Template public $conversions_count; public $customer_with_wishlist; - public function __construct() - { - parent::__construct(); - $this->setTemplate('report/wishlist.phtml'); - } + protected $_template = 'report/wishlist.phtml'; public function _beforeToHtml() { diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Wishlist/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Wishlist/Grid.php index 254e39c280a01..c527ef5eab12a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Wishlist/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Wishlist/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Report_Wishlist_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('wishlistReportGrid'); $this->setDefaultSort('entity_id'); $this->setDefaultDir('desc'); diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Add.php b/app/code/core/Mage/Adminhtml/Block/Review/Add.php index 5096863702c5a..118c3d5d4064d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Add.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Add.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Review_Add extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_controller = 'review'; $this->_mode = 'add'; diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Edit.php b/app/code/core/Mage/Adminhtml/Block/Review/Edit.php index 1fcad0b9f0e94..95712d84e87dd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Edit.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Review_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_objectId = 'id'; $this->_controller = 'review'; diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Grid.php b/app/code/core/Mage/Adminhtml/Block/Review/Grid.php index 6df5ce6ee7085..1bce154c7d932 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Grid.php @@ -42,9 +42,9 @@ class Mage_Adminhtml_Block_Review_Grid extends Mage_Backend_Block_Widget_Grid_Ex /** * Initialize grid */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('reviwGrid'); $this->setDefaultSort('created_at'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Main.php b/app/code/core/Mage/Adminhtml/Block/Review/Main.php index 043d1adebb18d..3d24f3e56924a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Main.php @@ -34,10 +34,10 @@ class Mage_Adminhtml_Block_Review_Main extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_addButtonLabel = Mage::helper('Mage_Review_Helper_Data')->__('Add New Review'); - parent::__construct(); + parent::_construct(); $this->_controller = 'review'; diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Review/Product/Grid.php index 00512541127af..e5e6269cb1c09 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Product/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Review_Product_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setRowClickCallback('review.gridRowClick'); $this->setUseAjax(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php b/app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php index e2f21e47fae98..770e7771d77a3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php @@ -35,10 +35,13 @@ class Mage_Adminhtml_Block_Review_Rating_Detailed extends Mage_Adminhtml_Block_Template { protected $_voteCollection = false; - public function __construct() + + protected $_template = 'rating/detailed.phtml'; + + protected function _construct() { - parent::__construct(); - $this->setTemplate('rating/detailed.phtml'); + parent::_construct(); + if( Mage::registry('review_data') ) { $this->setReviewId(Mage::registry('review_data')->getReviewId()); } diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Rating/Summary.php b/app/code/core/Mage/Adminhtml/Block/Review/Rating/Summary.php index 03595184c74fb..26b3b73888849 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Rating/Summary.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Rating/Summary.php @@ -34,9 +34,10 @@ class Mage_Adminhtml_Block_Review_Rating_Summary extends Mage_Adminhtml_Block_Template { - public function __construct() + protected $_template = 'rating/stars/summary.phtml'; + + protected function _construct() { - $this->setTemplate('rating/stars/summary.phtml'); if (Mage::registry('review_data')) { $this->setReviewId(Mage::registry('review_data')->getId()); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo.php b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo.php index a0c606f32b863..56daab412cf98 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo.php @@ -35,11 +35,11 @@ class Mage_Adminhtml_Block_Sales_Creditmemo extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'sales_creditmemo'; $this->_headerText = Mage::helper('Mage_Sales_Helper_Data')->__('Credit Memos'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php index 7579cd3e99050..b9d8d641b74b2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php @@ -32,9 +32,9 @@ class Mage_Adminhtml_Block_Sales_Creditmemo_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_creditmemo_grid'); $this->setDefaultSort('created_at'); $this->setDefaultDir('DESC'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice.php b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice.php index 5ac099b9e756b..47d7453b41e8c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice.php @@ -35,11 +35,11 @@ class Mage_Adminhtml_Block_Sales_Invoice extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'sales_invoice'; $this->_headerText = Mage::helper('Mage_Sales_Helper_Data')->__('Invoices'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php index 92c79d40cd47a..f93ae808697dc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php @@ -32,9 +32,9 @@ class Mage_Adminhtml_Block_Sales_Invoice_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_invoice_grid'); $this->setUseAjax(true); $this->setDefaultSort('created_at'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order.php index b2d25b8a4b520..e9ec062d183de 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order.php @@ -33,16 +33,12 @@ */ class Mage_Adminhtml_Block_Sales_Order extends Mage_Adminhtml_Block_Widget_Grid_Container { - /** - * @param array $data - */ - public function __construct(array $data = array()) + protected function _construct() { - $this->_controller = 'sales_order'; $this->_headerText = Mage::helper('Mage_Sales_Helper_Data')->__('Orders'); $this->_addButtonLabel = Mage::helper('Mage_Sales_Helper_Data')->__('Create New Order'); - parent::__construct(); + parent::_construct(); if (!Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Sales::create')) { $this->_removeButton('add'); } @@ -57,5 +53,4 @@ public function getCreateUrl() { return $this->getUrl('*/sales_order_create/start'); } - } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address.php index f2da47b838f35..436987207a476 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address.php @@ -30,11 +30,11 @@ class Mage_Adminhtml_Block_Sales_Order_Address extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_controller = 'sales_order'; $this->_mode = 'address'; - parent::__construct(); + parent::_construct(); $this->_updateButton('save', 'label', Mage::helper('Mage_Sales_Helper_Data')->__('Save Order Address')); $this->_removeButton('delete'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address/Form.php index 6397dd7239d27..7e4908d2c9304 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address/Form.php @@ -35,11 +35,7 @@ class Mage_Adminhtml_Block_Sales_Order_Address_Form extends Mage_Adminhtml_Block_Sales_Order_Create_Form_Address { - protected function _construct() - { - parent::_construct(); - $this->setTemplate('sales/order/address/form.phtml'); - } + protected $_template = 'sales/order/address/form.phtml'; /** * Order address getter diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php index 33c7984ff868c..cb7d52712d994 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php @@ -34,13 +34,13 @@ class Mage_Adminhtml_Block_Sales_Order_Create extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_objectId = 'order_id'; $this->_controller = 'sales_order'; $this->_mode = 'create'; - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method.php index b342f5faf1ef0..9fb6991b4cb9a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Billing_Method extends Mage_Adminhtml_Block_Sales_Order_Create_Abstract { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_billing_method'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons.php index 93ce6e82c134e..c104ef4e9adb0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Coupons extends Mage_Adminhtml_Block_Sales_Order_Create_Abstract { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_coupons_form'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons/Form.php index ac37cfe6efc1f..210abb0f70804 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons/Form.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Coupons_Form extends Mage_Adminhtml_Block_Sales_Order_Create_Abstract { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_coupons_form'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php index 81903b3b289ad..f0cd34bc5568e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Customer extends Mage_Adminhtml_Block_Sales_Order_Create_Abstract { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_customer'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer/Grid.php index ea55e7b62f95a..aaa35f23a7144 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer/Grid.php @@ -32,9 +32,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Customer_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_customer_grid'); $this->setRowClickCallback('order.selectCustomer.bind(order)'); $this->setUseAjax(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php index 007d0f70ebacd..8b56165058936 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Form extends Mage_Adminhtml_Block_Sales_Order_Create_Abstract { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_form'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items.php index 6916e636e341b..21bb5a6d5195b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items.php @@ -43,9 +43,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Items extends Mage_Adminhtml_Block /** * Define block ID */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_items'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php index b65bb42151f33..5ca71dfda6e5b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php @@ -40,9 +40,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Items_Grid extends Mage_Adminhtml_ */ protected $_moveToCustomerStorage = true; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_search_grid'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter.php index b84e140f8b0dd..c4b092ab5487a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Newsletter extends Mage_Adminhtml_Block_Sales_Order_Create_Abstract { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_newsletter'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter/Form.php index e2bebac3e4327..0c1a62a0e609b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter/Form.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Newsletter_Form extends Mage_Adminhtml_Block_Widget { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_newsletter_form'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search.php index f49908d5e987c..699c13f9d50d3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Search extends Mage_Adminhtml_Block_Sales_Order_Create_Abstract { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_search'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid.php index 647959a771ec9..051b0edc13bc2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_search_grid'); $this->setRowClickCallback('order.productGridRowClick.bind(order)'); $this->setCheckboxCheckCallback('order.productGridCheckboxCheck.bind(order)'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method.php index 7e3aa7e706136..dafb5fedc15ef 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Method extends Mage_Adminhtml_Block_Sales_Order_Create_Abstract { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_shipping_method'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method/Form.php index fb67af04aa091..f7a4f063e76af 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method/Form.php @@ -36,9 +36,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Method_Form { protected $_rates; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_shipping_method_form'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store.php index 4d3a1ef1923e7..67c3658d73540 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Store extends Mage_Adminhtml_Block_Sales_Order_Create_Abstract { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_store'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store/Select.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store/Select.php index 323f0d1710a27..c78c65b76f112 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store/Select.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store/Select.php @@ -32,9 +32,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Store_Select extends Mage_Adminhtml_Block_Store_Switcher { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sc_store_select'); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php index b287f80c49fcf..5f17878356be7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php @@ -37,9 +37,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Totals extends Mage_Adminhtml_Bloc protected $_totalRenderers; protected $_defaultRenderer = 'Mage_Adminhtml_Block_Sales_Order_Create_Totals_Default'; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_totals'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Default.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Default.php index 954752fa4d979..e74a7c607860a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Default.php @@ -34,11 +34,6 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Totals_Default extends Mage_Adminh { protected $_template = 'Mage_Adminhtml::sales/order/create/totals/default.phtml'; - protected function _construct() - { - $this->setTemplate($this->_template); - } - /** * Retrieve quote session object * diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Table.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Table.php index c21d1eec121f1..dbdde39afe55a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Table.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Table.php @@ -37,9 +37,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Totals_Table extends Mage_Adminhtm protected $_websiteCollection = null; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_create_totals_table'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php index b158afce4bb69..a42ca67716fdb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php @@ -34,13 +34,13 @@ class Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_objectId = 'order_id'; $this->_controller = 'sales_order_creditmemo'; $this->_mode = 'create'; - parent::__construct(); + parent::_construct(); $this->_removeButton('delete'); $this->_removeButton('save'); @@ -83,4 +83,4 @@ public function getBackUrl() array('order_id' => $this->getCreditmemo() ? $this->getCreditmemo()->getOrderId() : null) ); } -} \ No newline at end of file +} diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php index 0672e14faa74c..a56ab82fae720 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php @@ -38,13 +38,13 @@ class Mage_Adminhtml_Block_Sales_Order_Creditmemo_View extends Mage_Adminhtml_Bl * Add & remove control buttons * */ - public function __construct() + protected function _construct() { $this->_objectId = 'creditmemo_id'; $this->_controller = 'sales_order_creditmemo'; $this->_mode = 'view'; - parent::__construct(); + parent::_construct(); $this->_removeButton('save'); $this->_removeButton('reset'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php index f0cbb24f17526..902c1bb18e674 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php @@ -34,13 +34,13 @@ class Mage_Adminhtml_Block_Sales_Order_Invoice_Create extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_objectId = 'order_id'; $this->_controller = 'sales_order_invoice'; $this->_mode = 'create'; - parent::__construct(); + parent::_construct(); $this->_removeButton('save'); $this->_removeButton('delete'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php index 3049d74fd084e..91b389f514130 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php @@ -40,14 +40,14 @@ class Mage_Adminhtml_Block_Sales_Order_Invoice_View extends Mage_Adminhtml_Block */ protected $_session; - public function __construct() + protected function _construct() { $this->_objectId = 'invoice_id'; $this->_controller = 'sales_order_invoice'; $this->_mode = 'view'; $this->_session = Mage::getSingleton('Mage_Backend_Model_Auth_Session'); - parent::__construct(); + parent::_construct(); $this->_removeButton('save'); $this->_removeButton('reset'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php index 49dffcb542c50..1006e48b3e851 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php @@ -34,13 +34,13 @@ class Mage_Adminhtml_Block_Sales_Order_Shipment_Create extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_objectId = 'order_id'; $this->_controller = 'sales_order_shipment'; $this->_mode = 'create'; - parent::__construct(); + parent::_construct(); //$this->_updateButton('save', 'label', Mage::helper('Mage_Sales_Helper_Data')->__('Submit Shipment')); $this->_removeButton('save'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging/Grid.php index 9dea4d955afb6..6647e477b3ad3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging/Grid.php @@ -33,14 +33,8 @@ */ class Mage_Adminhtml_Block_Sales_Order_Shipment_Packaging_Grid extends Mage_Adminhtml_Block_Template { - /** - * Constructor - */ - public function __construct() - { - parent::__construct(); - $this->setTemplate('sales/order/shipment/packaging/grid.phtml'); - } + + protected $_template = 'sales/order/shipment/packaging/grid.phtml'; /** * Return collection of shipment items diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php index aeae658c07737..5d1d9b6241e79 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php @@ -33,9 +33,6 @@ */ class Mage_Adminhtml_Block_Sales_Order_Shipment_Tracking_Info extends Mage_Adminhtml_Block_Template { - protected function _construct() - { - parent::_construct(); - $this->setTemplate('sales/order/shipment/tracking/info.phtml'); - } + + protected $_template = 'sales/order/shipment/tracking/info.phtml'; } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php index 702546e09e570..8132af4230d72 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php @@ -34,13 +34,13 @@ class Mage_Adminhtml_Block_Sales_Order_Shipment_View extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_objectId = 'shipment_id'; $this->_controller = 'sales_order_shipment'; $this->_mode = 'view'; - parent::__construct(); + parent::_construct(); $this->_removeButton('reset'); $this->_removeButton('delete'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status.php index 79b1703fe12ab..cd84d21ce37d8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status.php @@ -36,7 +36,7 @@ class Mage_Adminhtml_Block_Sales_Order_Status extends Mage_Adminhtml_Block_Widge /** * Class constructor */ - public function __construct() + protected function _construct() { $this->_controller = 'sales_order_status'; $this->_headerText = Mage::helper('Mage_Sales_Helper_Data')->__('Order Statuses'); @@ -46,7 +46,7 @@ public function __construct() 'onclick' => 'setLocation(\'' . $this->getAssignUrl() .'\')', 'class' => 'add', )); - parent::__construct(); + parent::_construct(); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign.php index 31667725049b5..80be131889d64 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign.php @@ -27,11 +27,11 @@ class Mage_Adminhtml_Block_Sales_Order_Status_Assign extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_controller = 'sales_order_status'; $this->_mode = 'assign'; - parent::__construct(); + parent::_construct(); $this->_updateButton('save', 'label', Mage::helper('Mage_Sales_Helper_Data')->__('Save Status Assignment')); $this->_removeButton('delete'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign/Form.php index 2bd5cc4672ba5..a854e38f76f99 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign/Form.php @@ -29,9 +29,9 @@ */ class Mage_Adminhtml_Block_Sales_Order_Status_Assign_Form extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('order_status_state'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit.php index cc2535138ceee..a2a2c08e3d28c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit.php @@ -26,9 +26,9 @@ class Mage_Adminhtml_Block_Sales_Order_Status_Edit extends Mage_Adminhtml_Block_Sales_Order_Status_New { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_mode = 'edit'; } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit/Form.php index b6b8dbe862849..147fcd44485d4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit/Form.php @@ -29,9 +29,9 @@ */ class Mage_Adminhtml_Block_Sales_Order_Status_Edit_Form extends Mage_Adminhtml_Block_Sales_Order_Status_New_Form { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('new_order_status'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php index 00d17b8357bac..d274dd28bd9a2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Sales_Order_Status_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_status_grid'); //$this->setFilterVisibility(false); $this->setPagerVisibility(false); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New.php index 3a0b65aa7fed5..6752e57c12589 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New.php @@ -27,13 +27,13 @@ class Mage_Adminhtml_Block_Sales_Order_Status_New extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_objectId = 'status'; $this->_controller = 'sales_order_status'; $this->_mode = 'new'; - parent::__construct(); + parent::_construct(); $this->_updateButton('save', 'label', Mage::helper('Mage_Sales_Helper_Data')->__('Save Status')); $this->_removeButton('delete'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New/Form.php index d8cc4e7f95077..0f5e93fdfbffa 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New/Form.php @@ -29,9 +29,9 @@ */ class Mage_Adminhtml_Block_Sales_Order_Status_New_Form extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('new_order_status'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php index 034c7ced525b1..ae40c04b9cafd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php @@ -34,13 +34,13 @@ class Mage_Adminhtml_Block_Sales_Order_View extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_objectId = 'order_id'; $this->_controller = 'sales_order'; $this->_mode = 'view'; - parent::__construct(); + parent::_construct(); $this->_removeButton('delete'); $this->_removeButton('reset'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Form.php index 6eedbaa4a2fa8..4e96f9617a865 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Form.php @@ -34,9 +34,6 @@ class Mage_Adminhtml_Block_Sales_Order_View_Form extends Mage_Adminhtml_Block_Template { - protected function _construct() - { - parent::_construct(); - $this->setTemplate('sales/order/view/form.phtml'); - } + + protected $_template = 'sales/order/view/form.phtml'; } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php index 5487b05b6065b..dbbd1d8c82a84 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Sales_Order_View_Tab_Creditmemos extends Mage_Adminhtml_Block_Widget_Grid implements Mage_Adminhtml_Block_Widget_Tab_Interface { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('order_creditmemos'); $this->setUseAjax(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php index b88dfe21739d3..741e7e8a2ac09 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php @@ -35,11 +35,8 @@ class Mage_Adminhtml_Block_Sales_Order_View_Tab_History extends Mage_Adminhtml_Block_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface { - protected function _construct() - { - parent::_construct(); - $this->setTemplate('sales/order/view/tab/history.phtml'); - } + + protected $_template = 'sales/order/view/tab/history.phtml'; /** * Retrieve order model instance diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php index c29481f2241bb..a99229a9d5c9c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Sales_Order_View_Tab_Invoices extends Mage_Adminhtml_Block_Widget_Grid implements Mage_Adminhtml_Block_Widget_Tab_Interface { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('order_invoices'); $this->setUseAjax(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php index 04a41b14224c1..af598e381c003 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Sales_Order_View_Tab_Shipments extends Mage_Adminhtml_Block_Widget_Grid implements Mage_Adminhtml_Block_Widget_Tab_Interface { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('order_shipments'); $this->setUseAjax(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tabs.php index 9fb61ff9b2b2e..a3d07a7070356 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tabs.php @@ -52,9 +52,9 @@ public function getOrder() Mage::throwException(Mage::helper('Mage_Sales_Helper_Data')->__('Cannot get the order instance.')); } - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_order_view_tabs'); $this->setDestElementId('sales_order_view'); $this->setTitle(Mage::helper('Mage_Sales_Helper_Data')->__('Order View')); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment.php b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment.php index 41c0518bdc20f..d83bd69c0b9d1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment.php @@ -35,11 +35,11 @@ class Mage_Adminhtml_Block_Sales_Shipment extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'sales_shipment'; $this->_headerText = Mage::helper('Mage_Sales_Helper_Data')->__('Shipments'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php index 1aa3ed4c14ac4..2a50330230147 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_Sales_Shipment_Grid extends Mage_Adminhtml_Block_Widg /** * Initialization */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sales_shipment_grid'); $this->setDefaultSort('created_at'); $this->setDefaultDir('DESC'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions.php index f06e8c9053d2a..7864eab873f93 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions.php @@ -33,11 +33,11 @@ */ class Mage_Adminhtml_Block_Sales_Transactions extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'sales_transactions'; $this->_headerText = Mage::helper('Mage_Sales_Helper_Data')->__('Transactions'); - parent::__construct(); + parent::_construct(); $this->_removeButton('add'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php index 8ad17f2feecf8..818c3b2f6f722 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php @@ -44,9 +44,9 @@ class Mage_Adminhtml_Block_Sales_Transactions_Child_Grid extends Mage_Adminhtml_ * Disable pager and filter * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('transactionChildGrid'); $this->setDefaultSort('created_at'); $this->setPagerVisibility(false); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php index 2ba5da7b01f01..de02156c27a45 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php @@ -44,9 +44,9 @@ class Mage_Adminhtml_Block_Sales_Transactions_Detail extends Mage_Adminhtml_Bloc * Add control buttons * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_txn = Mage::registry('current_transaction'); if (!$this->_txn) { diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php index 6500065dc4811..fcda54df9b6b7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php @@ -37,9 +37,9 @@ class Mage_Adminhtml_Block_Sales_Transactions_Grid extends Mage_Adminhtml_Block_ * Set grid params * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('order_transactions'); $this->setUseAjax(true); $this->setDefaultSort('created_at'); diff --git a/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php b/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php index 272811022f899..d492a5e659979 100644 --- a/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php @@ -53,9 +53,9 @@ class Mage_Adminhtml_Block_Shipping_Carrier_Tablerate_Grid extends Mage_Adminhtm * * @return void */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('shippingTablerateGrid'); $this->_exportPageSize = 10000; } diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap.php b/app/code/core/Mage/Adminhtml/Block/Sitemap.php index c17e9810a7d80..409bb5357ceaf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap.php @@ -36,12 +36,12 @@ class Mage_Adminhtml_Block_Sitemap extends Mage_Adminhtml_Block_Widget_Grid_Cont /** * Block constructor */ - public function __construct() + protected function _construct() { $this->_controller = 'sitemap'; $this->_headerText = Mage::helper('Mage_Sitemap_Helper_Data')->__('XML Sitemap'); $this->_addButtonLabel = Mage::helper('Mage_Sitemap_Helper_Data')->__('Add Sitemap'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit.php index bb9e211a23d8f..6f012e39abbc3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit.php @@ -38,12 +38,12 @@ class Mage_Adminhtml_Block_Sitemap_Edit extends Mage_Adminhtml_Block_Widget_Form /** * Init container */ - public function __construct() + protected function _construct() { $this->_objectId = 'sitemap_id'; $this->_controller = 'sitemap'; - parent::__construct(); + parent::_construct(); $this->_addButton('generate', array( 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Save & Generate'), diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php index 2643fb99a167b..1246299348131 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php @@ -38,9 +38,9 @@ class Mage_Adminhtml_Block_Sitemap_Edit_Form extends Mage_Adminhtml_Block_Widget /** * Init form */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sitemap_form'); $this->setTitle(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Sitemap Information')); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php index 6beaf53884ea5..64667643a0cae 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Sitemap_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('sitemapGrid'); $this->setDefaultSort('sitemap_id'); diff --git a/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php b/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php index 15de0ce811803..8ba2115b84346 100644 --- a/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php +++ b/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php @@ -62,10 +62,12 @@ class Mage_Adminhtml_Block_Store_Switcher extends Mage_Adminhtml_Block_Template */ protected $_hasDefaultOption = true; - public function __construct() + protected $_template = 'Mage_Adminhtml::store/switcher.phtml'; + + protected function _construct() { - parent::__construct(); - $this->setTemplate('Mage_Adminhtml::store/switcher.phtml'); + parent::_construct(); + $this->setUseConfirm(true); $this->setUseAjax(true); $this->setDefaultStoreName($this->__('All Store Views')); diff --git a/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset.php index f5ce3250ab5e4..6c8c89ba83868 100644 --- a/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset.php +++ b/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset.php @@ -41,13 +41,7 @@ class Mage_Adminhtml_Block_Store_Switcher_Form_Renderer_Fieldset */ protected $_element; - /** - * Constructor - */ - protected function _construct() - { - $this->setTemplate('store/switcher/form/renderer/fieldset.phtml'); - } + protected $_template = 'store/switcher/form/renderer/fieldset.phtml'; /** * Retrieve an element diff --git a/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset/Element.php b/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset/Element.php index e34e3c9a03adf..721687a00ed98 100644 --- a/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset/Element.php +++ b/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset/Element.php @@ -42,13 +42,7 @@ class Mage_Adminhtml_Block_Store_Switcher_Form_Renderer_Fieldset_Element */ protected $_element; - /** - * Constructor - */ - protected function _construct() - { - $this->setTemplate('store/switcher/form/renderer/fieldset/element.phtml'); - } + protected $_template = 'store/switcher/form/renderer/fieldset/element.phtml'; /** * Retrieve an element diff --git a/app/code/core/Mage/Adminhtml/Block/System/Account/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Account/Edit.php index 5b13145fc57ac..159ead507c252 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Account/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Account/Edit.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_System_Account_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_controller = 'system_account'; $this->_updateButton('save', 'label', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Save Account')); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php index ddf1c1272e21a..96c64bd35eb33 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php @@ -33,10 +33,13 @@ */ class Mage_Adminhtml_Block_System_Cache_Edit extends Mage_Adminhtml_Block_Widget { - public function __construct() + + protected $_template = 'system/cache/edit.phtml'; + + protected function _construct() { - parent::__construct(); - $this->setTemplate('system/cache/edit.phtml'); + parent::_construct(); + $this->setTitle('Cache Management'); } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Dwstree.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Dwstree.php index db2339f17f3a4..45b560e0b4857 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Dwstree.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Dwstree.php @@ -33,10 +33,13 @@ */ class Mage_Adminhtml_Block_System_Config_Dwstree extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + + protected $_template = 'widget/tabs.phtml'; + + protected function _construct() { - parent::__construct(); - #$this->setTemplate('widget/tabs.phtml'); + parent::_construct(); + # $this->setId('system_config_dwstree'); $this->setDestElementId('system_config_form'); } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php index 3a5b3fd0bc2fc..d0f44ddc946d9 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php @@ -37,10 +37,12 @@ class Mage_Adminhtml_Block_System_Config_Edit extends Mage_Adminhtml_Block_Widge protected $_section; - public function __construct() + protected $_template = 'system/config/edit.phtml'; + + + protected function _construct() { - parent::__construct(); - $this->setTemplate('system/config/edit.phtml'); + parent::_construct(); $sectionCode = $this->getRequest()->getParam('section'); $sections = Mage::getSingleton('Mage_Adminhtml_Model_Config')->getSections(); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php index e447e6de992fc..244189946373a 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php @@ -99,9 +99,9 @@ class Mage_Adminhtml_Block_System_Config_Form extends Mage_Adminhtml_Block_Widge * Enter description here... * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_scopeLabels = array( self::SCOPE_DEFAULT => Mage::helper('Mage_Adminhtml_Helper_Data')->__('[GLOBAL]'), self::SCOPE_WEBSITES => Mage::helper('Mage_Adminhtml_Helper_Data')->__('[WEBSITE]'), diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php index d6c9001e60623..1e8f6994343ba 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php @@ -69,18 +69,20 @@ abstract class Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract */ protected $_isPreparedToRender = false; + protected $_template = 'Mage_Adminhtml::system/config/form/field/array.phtml'; + /** * Check if columns are defined, set template * */ - public function __construct() + protected function _construct() { if (!$this->_addButtonLabel) { $this->_addButtonLabel = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add'); } - parent::__construct(); + parent::_construct(); if (!$this->getTemplate()) { - $this->setTemplate('Mage_Adminhtml::system/config/form/field/array.phtml'); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Import.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Import.php index a70f81b0807bf..91e5f6cf0eb2b 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Import.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Import.php @@ -35,14 +35,9 @@ class Mage_Adminhtml_Block_System_Config_Form_Field_Import extends Varien_Data_Form_Element_Abstract { - /** - * Enter description here... - * - * @param array $data - */ - public function __construct($data = array()) + protected function _construct() { - parent::__construct($data); + parent::_construct(); $this->setType('file'); } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Regexceptions.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Regexceptions.php index fae00ccbaa264..1c9d16933a2ba 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Regexceptions.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Regexceptions.php @@ -33,7 +33,7 @@ */ class Mage_Adminhtml_Block_System_Config_Form_Field_Regexceptions extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract { - public function __construct() + protected function _construct() { $this->addColumn('search', array( 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Search String'), @@ -45,7 +45,7 @@ public function __construct() )); $this->_addAfter = false; $this->_addButtonLabel = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add Exception'); - parent::__construct(); + parent::_construct(); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/System/Storage/Media/Synchronize.php b/app/code/core/Mage/Adminhtml/Block/System/Config/System/Storage/Media/Synchronize.php index c43bc232d9aac..19b27810fbb06 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/System/Storage/Media/Synchronize.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/System/Storage/Media/Synchronize.php @@ -35,14 +35,8 @@ class Mage_Adminhtml_Block_System_Config_System_Storage_Media_Synchronize extends Mage_Adminhtml_Block_System_Config_Form_Field { - /* - * Set template - */ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('system/config/system/storage/media/synchronize.phtml'); - } + + protected $_template = 'system/config/system/storage/media/synchronize.phtml'; /** * Remove scope label diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php index 1cc46e41f3d5f..0d460a17f53b2 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php @@ -42,15 +42,12 @@ class Mage_Adminhtml_Block_System_Config_Tabs extends Mage_Adminhtml_Block_Widge */ protected $_tabs; - /** - * Enter description here... - * - */ + protected $_template = 'system/config/tabs.phtml'; + protected function _construct() { $this->setId('system_config_tabs'); $this->setTitle(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Configuration')); - $this->setTemplate('system/config/tabs.phtml'); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui.php index 9720b100b706f..9818f7753f2df 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui.php @@ -34,12 +34,12 @@ class Mage_Adminhtml_Block_System_Convert_Gui extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'system_convert_gui'; $this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Profiles'); $this->_addButtonLabel = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add New Profile'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php index 3e4d29a612970..43d2d5f580a71 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php @@ -33,12 +33,12 @@ */ class Mage_Adminhtml_Block_System_Convert_Gui_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_objectId = 'id'; $this->_controller = 'system_convert_gui'; - parent::__construct(); + parent::_construct(); $this->_updateButton('save', 'label', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Save Profile')); $this->_updateButton('delete', 'label', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete Profile')); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Upload.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Upload.php index f3fcc1400943a..5482a988fc8bd 100755 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Upload.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Upload.php @@ -34,11 +34,7 @@ class Mage_Adminhtml_Block_System_Convert_Gui_Edit_Tab_Upload extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() - { - parent::__construct(); - $this->setTemplate('system/convert/profile/upload.phtml'); - } + protected $_template = 'system/convert/profile/upload.phtml'; public function getPostMaxSize() { diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php index b887142920f5f..4f0cb66ce38b0 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php @@ -40,11 +40,7 @@ class Mage_Adminhtml_Block_System_Convert_Gui_Edit_Tab_Wizard extends Mage_Admin protected $_removeMapButtonHtml; protected $_shortDateFormat; - public function __construct() - { - parent::__construct(); - $this->setTemplate('system/convert/profile/wizard.phtml'); - } + protected $_template = 'system/convert/profile/wizard.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tabs.php index 2bb3d75326b61..a00891011c61b 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tabs.php @@ -33,9 +33,9 @@ */ class Mage_Adminhtml_Block_System_Convert_Gui_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('convert_profile_tabs'); $this->setDestElementId('edit_form'); $this->setTitle(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Import/Export Profile')); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Grid.php index 3cfc301450bf6..18cc34906a33f 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_System_Convert_Gui_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('convertProfileGrid'); $this->setDefaultSort('profile_id'); } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile.php index af280f7a45f3f..789d47f62a162 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile.php @@ -34,13 +34,13 @@ class Mage_Adminhtml_Block_System_Convert_Profile extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'system_convert_profile'; $this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Advanced Profiles'); $this->_addButtonLabel = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add New Profile'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php index 0026ed341354e..5393910e07cc7 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php @@ -33,12 +33,12 @@ */ class Mage_Adminhtml_Block_System_Convert_Profile_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - public function __construct() + protected function _construct() { $this->_objectId = 'id'; $this->_controller = 'system_convert_profile'; - parent::__construct(); + parent::_construct(); $this->_updateButton('save', 'label', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Save Profile')); $this->_updateButton('delete', 'label', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete Profile')); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php index 2b13324913167..386df146d4293 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php @@ -33,9 +33,9 @@ */ class Mage_Adminhtml_Block_System_Convert_Profile_Edit_Tab_History extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('history_grid'); $this->setDefaultSort('performed_at', 'desc'); $this->setUseAjax(true); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Run.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Run.php index 10b18855f6ab6..7d421f97ae268 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Run.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Run.php @@ -33,11 +33,8 @@ */ class Mage_Adminhtml_Block_System_Convert_Profile_Edit_Tab_Run extends Mage_Adminhtml_Block_Template { - public function __construct() - { - parent::__construct(); - $this->setTemplate('system/convert/profile/run.phtml'); - } + + protected $_template = 'system/convert/profile/run.phtml'; public function getRunButtonHtml() { diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tabs.php index bea1e3ef1a3c6..0fbbac22215d3 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tabs.php @@ -33,9 +33,9 @@ */ class Mage_Adminhtml_Block_System_Convert_Profile_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('convert_profile_tabs'); $this->setDestElementId('edit_form'); $this->setTitle(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Import/Export Profile')); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Grid.php index 24ff410a659bb..bab062239eb31 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_System_Convert_Profile_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('convertProfileGrid'); $this->setDefaultSort('profile_id'); } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency.php b/app/code/core/Mage/Adminhtml/Block/System/Currency.php index 90becf8122361..9c6d1475bd004 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency.php @@ -35,10 +35,7 @@ class Mage_Adminhtml_Block_System_Currency extends Mage_Adminhtml_Block_Template { - protected function _construct() - { - $this->setTemplate('system/currency/rates.phtml'); - } + protected $_template = 'system/currency/rates.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Form.php index baeaa6ba12508..c2a181085e525 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Form.php @@ -33,9 +33,9 @@ */ class Mage_Adminhtml_Block_System_Currency_Edit_Form extends Mage_Adminhtml_Block_Widget_Form { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('currency_edit_form'); $this->setTitle(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Currency Information')); } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tabs.php index 30669ce4a56b7..f3a7cfdcd99a6 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tabs.php @@ -33,9 +33,9 @@ */ class Mage_Adminhtml_Block_System_Currency_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('currency_edit_tabs'); $this->setDestElementId('currency_edit_form'); $this->setTitle(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Currency')); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php index c2eeef9176d3d..afb8df478c62e 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php @@ -33,10 +33,8 @@ */ class Mage_Adminhtml_Block_System_Currency_Rate_Matrix extends Mage_Adminhtml_Block_Template { - public function __construct() - { - $this->setTemplate('system/currency/rate/matrix.phtml'); - } + + protected $_template = 'system/currency/rate/matrix.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Services.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Services.php index 6a955ceb21ed2..bba83cf6b82dd 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Services.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Services.php @@ -34,16 +34,7 @@ */ class Mage_Adminhtml_Block_System_Currency_Rate_Services extends Mage_Adminhtml_Block_Template { - - /** - * Set import services template - * - */ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('system/currency/rate/services.phtml'); - } + protected $_template = 'system/currency/rate/services.phtml'; /** * Create import services form select element diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php index 175b53848ae2a..42fbbe218bdff 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php @@ -26,10 +26,13 @@ class Mage_Adminhtml_Block_System_Design_Edit extends Mage_Adminhtml_Block_Widget { - public function __construct() + + protected $_template = 'system/design/edit.phtml'; + + protected function _construct() { - parent::__construct(); - $this->setTemplate('system/design/edit.phtml'); + parent::_construct(); + $this->setId('design_edit'); } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tabs.php index bd4c59f2c0566..7fa45a23887e7 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tabs.php @@ -26,9 +26,9 @@ class Mage_Adminhtml_Block_System_Design_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('design_tabs'); $this->setDestElementId('design_edit_form'); $this->setTitle(Mage::helper('Mage_Core_Helper_Data')->__('Design Change')); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php index 9f7d1c8dcdb3c..c55a76f4872e5 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php @@ -37,9 +37,9 @@ class Mage_Adminhtml_Block_System_Design_Grid extends Mage_Adminhtml_Block_Widge /** * Class constructor */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('designGrid'); $this->setSaveParametersInSession(true); $this->setUseAjax(true); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template.php index 4a7cc366b54d8..d4231bbb2275c 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template.php @@ -34,15 +34,8 @@ class Mage_Adminhtml_Block_System_Email_Template extends Mage_Adminhtml_Block_Template { - /** - * Set transactional emails grid template - * - */ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('system/email/template/list.phtml'); - } + + protected $_template = 'system/email/template/list.phtml'; /** * Create add button and grid blocks diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit.php index 5c2e3befdb877..f316a1f98bf13 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit.php @@ -35,12 +35,7 @@ class Mage_Adminhtml_Block_System_Email_Template_Edit extends Mage_Adminhtml_Block_Widget { - - public function __construct() - { - parent::__construct(); - $this->setTemplate('system/email/template/edit.phtml'); - } + protected $_template = 'system/email/template/edit.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php index 7061011f6c704..6df208a543b65 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php @@ -39,13 +39,13 @@ class Mage_Adminhtml_Block_System_Store_Delete extends Mage_Adminhtml_Block_Widg * Class constructor * */ - public function __construct() + protected function _construct() { $this->_objectId = 'item_id'; $this->_mode = 'delete'; $this->_controller = 'system_store'; - parent::__construct(); + parent::_construct(); $this->_removeButton('save'); $this->_removeButton('reset'); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Form.php index 51c29058078e8..6eb3a2ff86f70 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Form.php @@ -38,9 +38,9 @@ class Mage_Adminhtml_Block_System_Store_Delete_Form extends Mage_Adminhtml_Block /** * Init form */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('store_delete_form'); $this->setTitle(Mage::helper('Mage_Cms_Helper_Data')->__('Block Information')); } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php index 6d7ad57f24445..a3aec37638ca9 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php @@ -38,7 +38,7 @@ class Mage_Adminhtml_Block_System_Store_Edit extends Mage_Adminhtml_Block_Widget * Init class * */ - public function __construct() + protected function _construct() { switch (Mage::registry('store_type')) { case 'website': @@ -75,7 +75,7 @@ public function __construct() } $this->_controller = 'system_store'; - parent::__construct(); + parent::_construct(); $this->_updateButton('save', 'label', $saveLabel); $this->_updateButton('delete', 'label', $deleteLabel); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit/FormAbstract.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit/FormAbstract.php index ed39808769c3e..c013e4154b39a 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit/FormAbstract.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit/FormAbstract.php @@ -38,9 +38,9 @@ abstract class Mage_Adminhtml_Block_System_Store_Edit_FormAbstract extends Mage_ * Class constructor * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('coreStoreForm'); } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid.php index 20393ceea748c..7613686653775 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid.php @@ -35,9 +35,9 @@ class Mage_Adminhtml_Block_System_Store_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('storeGrid'); $this->setSaveParametersInSession(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Store.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Store.php index 20ab308d32f95..99c4f7381bb8e 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Store.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Store.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_System_Store_Store extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'system_store'; $this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Manage Stores'); - parent::__construct(); + parent::_construct(); } protected function _prepareLayout() diff --git a/app/code/core/Mage/Adminhtml/Block/System/Variable.php b/app/code/core/Mage/Adminhtml/Block/System/Variable.php index df71cb899e835..88c8ed438a3eb 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Variable.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Variable.php @@ -37,11 +37,11 @@ class Mage_Adminhtml_Block_System_Variable extends Mage_Adminhtml_Block_Widget_G /** * Block constructor */ - public function __construct() + protected function _construct() { $this->_controller = 'system_variable'; $this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Custom Variables'); - parent::__construct(); + parent::_construct(); $this->_updateButton('add', 'label', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add New Variable')); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Class.php b/app/code/core/Mage/Adminhtml/Block/Tax/Class.php deleted file mode 100644 index 0bf887bbb3841..0000000000000 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Class.php +++ /dev/null @@ -1,59 +0,0 @@ - - */ - -class Mage_Adminhtml_Block_Tax_Class extends Mage_Adminhtml_Block_Widget_Grid_Container -{ - public function __construct() - { - $this->_controller = 'tax_class'; - parent::__construct(); - } - - public function setClassType($classType) - { - if ($classType == Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT) { - $this->_headerText = Mage::helper('Mage_Tax_Helper_Data')->__('Product Tax Classes'); - $this->_addButtonLabel = Mage::helper('Mage_Tax_Helper_Data')->__('Add New Class'); - } - elseif ($classType == Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER) { - $this->_headerText = Mage::helper('Mage_Tax_Helper_Data')->__('Customer Tax Classes'); - $this->_addButtonLabel = Mage::helper('Mage_Tax_Helper_Data')->__('Add New Class'); - } - - $this->getChildBlock('grid')->setClassType($classType); - $this->setData('class_type', $classType); - - return $this; - } -} diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit.php b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit.php deleted file mode 100644 index d9ab9a882e3fa..0000000000000 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit.php +++ /dev/null @@ -1,63 +0,0 @@ - - */ - -class Mage_Adminhtml_Block_Tax_Class_Edit extends Mage_Adminhtml_Block_Widget_Form_Container -{ - public function __construct() - { - $this->_objectId = 'id'; - $this->_controller = 'tax_class'; - - parent::__construct(); - - $this->_updateButton('save', 'label', Mage::helper('Mage_Tax_Helper_Data')->__('Save Class')); - $this->_updateButton('delete', 'label', Mage::helper('Mage_Tax_Helper_Data')->__('Delete Class')); - } - - public function getHeaderText() - { - if (Mage::registry('tax_class')->getId()) { - return Mage::helper('Mage_Tax_Helper_Data')->__("Edit Class '%s'", $this->escapeHtml(Mage::registry('tax_class')->getClassName())); - } - else { - return Mage::helper('Mage_Tax_Helper_Data')->__('New Class'); - } - } - - public function setClassType($classType) - { - $this->getChildBlock('form')->setClassType($classType); - return $this; - } -} diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit/Form.php deleted file mode 100644 index 647900de26b4a..0000000000000 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit/Form.php +++ /dev/null @@ -1,100 +0,0 @@ - - */ - -class Mage_Adminhtml_Block_Tax_Class_Edit_Form extends Mage_Adminhtml_Block_Widget_Form -{ - public function __construct() - { - parent::__construct(); - - $this->setId('taxClassForm'); - } - - protected function _prepareForm() - { - $model = Mage::registry('tax_class'); - $form = new Varien_Data_Form(array( - 'id' => 'edit_form', - 'action' => $this->getData('action'), - 'method' => 'post' - )); - - $classType = $this->getClassType(); - - $this->setTitle($classType == Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER - ? Mage::helper('Mage_Cms_Helper_Data')->__('Customer Tax Class Information') - : Mage::helper('Mage_Cms_Helper_Data')->__('Product Tax Class Information') - ); - - $fieldset = $form->addFieldset('base_fieldset', array( - 'legend' => $classType == Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER - ? Mage::helper('Mage_Tax_Helper_Data')->__('Customer Tax Class Information') - : Mage::helper('Mage_Tax_Helper_Data')->__('Product Tax Class Information') - )); - - $fieldset->addField('class_name', 'text', - array( - 'name' => 'class_name', - 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Class Name'), - 'class' => 'required-entry', - 'value' => $model->getClassName(), - 'required' => true, - ) - ); - - $fieldset->addField('class_type', 'hidden', - array( - 'name' => 'class_type', - 'value' => $classType, - 'no_span' => true - ) - ); - - if ($model->getId()) { - $fieldset->addField('class_id', 'hidden', - array( - 'name' => 'class_id', - 'value' => $model->getId(), - 'no_span' => true - ) - ); - } - - $form->setAction($this->getUrl('*/tax_class/save')); - $form->setUseContainer(true); - $this->setForm($form); - - return parent::_prepareForm(); - } -} diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Grid.php deleted file mode 100644 index 61b72885fc768..0000000000000 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Grid.php +++ /dev/null @@ -1,72 +0,0 @@ - - */ -class Mage_Adminhtml_Block_Tax_Class_Grid extends Mage_Adminhtml_Block_Widget_Grid -{ - - public function __construct() - { - parent::__construct(); - $this->setId('taxClassGrid'); - $this->setDefaultSort('class_name'); - $this->setDefaultDir('ASC'); - } - - protected function _prepareCollection() - { - $collection = Mage::getModel('Mage_Tax_Model_Class') - ->getCollection() - ->setClassTypeFilter($this->getClassType()); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - protected function _prepareColumns() - { - $this->addColumn('class_name', - array( - 'header' => Mage::helper('Mage_Tax_Helper_Data')->__('Class Name'), - 'align' => 'left', - 'index' => 'class_name' - ) - ); - - return parent::_prepareColumns(); - } - - public function getRowUrl($row) - { - return $this->getUrl('*/*/edit', array('id' => $row->getId())); - } - -} diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php index 42c1bdb713d7e..a50c8cf585928 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php @@ -36,11 +36,14 @@ class Mage_Adminhtml_Block_Tax_Rate_Form extends Mage_Adminhtml_Block_Widget_For { protected $_titles = null; - public function __construct() + protected $_template = 'tax/rate/form.phtml'; + + + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setDestElementId('rate_form'); - $this->setTemplate('tax/rate/form.phtml'); + } protected function _prepareForm() diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid.php index f36a16eadce45..ca78929c0af38 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid.php @@ -26,9 +26,9 @@ class Mage_Adminhtml_Block_Tax_Rate_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setDefaultSort('region_name'); $this->setDefaultDir('asc'); $this->setId('tax_rate_grid'); diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/ImportExport.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/ImportExport.php index d0a2d48898e09..2da55f946d35e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/ImportExport.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/ImportExport.php @@ -27,10 +27,5 @@ class Mage_Adminhtml_Block_Tax_Rate_ImportExport extends Mage_Adminhtml_Block_Widget { - public function __construct() - { - parent::__construct(); - $this->setTemplate('tax/importExport.phtml'); - } - + protected $_template = 'tax/importExport.phtml'; } diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php index 983b82e8eeb0a..37e1be5268eda 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php @@ -34,10 +34,7 @@ class Mage_Adminhtml_Block_Tax_Rate_Title extends Mage_Core_Block_Template { protected $_titles; - protected function _construct() - { - $this->setTemplate('tax/rate/title.phtml'); - } + protected $_template = 'tax/rate/title.phtml'; public function getTitles() { diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title/Fieldset.php index 783e0d303f91b..395847ae1f04b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title/Fieldset.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title/Fieldset.php @@ -32,7 +32,7 @@ */ class Mage_Adminhtml_Block_Tax_Rate_Title_Fieldset extends Varien_Data_Form_Element_Fieldset { - public function getChildrenHtml() + public function getBasicChildrenHtml() { return Mage::getBlockSingleton('Mage_Adminhtml_Block_Tax_Rate_Title')->toHtml(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Add.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Add.php index 861c07bbc34c9..bc2737e5cf51d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Add.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Add.php @@ -34,11 +34,8 @@ class Mage_Adminhtml_Block_Tax_Rate_Toolbar_Add extends Mage_Adminhtml_Block_Template { - public function __construct() - { - parent::__construct(); - $this->setTemplate('tax/toolbar/rate/add.phtml'); - } + + protected $_template = 'tax/toolbar/rate/add.phtml'; protected function _prepareLayout() { diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Save.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Save.php index 35e56195b9d7b..3d0d9014146fc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Save.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Save.php @@ -34,11 +34,14 @@ class Mage_Adminhtml_Block_Tax_Rate_Toolbar_Save extends Mage_Adminhtml_Block_Template { - public function __construct() + + protected $_template = 'tax/toolbar/rate/save.phtml'; + + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->assign('createUrl', $this->getUrl('*/tax_rate/save')); - $this->setTemplate('tax/toolbar/rate/save.phtml'); + } protected function _prepareLayout() diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule.php index 10b6c1d8fe783..4a7b5590535b3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule.php @@ -34,11 +34,11 @@ class Mage_Adminhtml_Block_Tax_Rule extends Mage_Adminhtml_Block_Widget_Grid_Container { - public function __construct() + protected function _construct() { $this->_controller = 'tax_rule'; $this->_headerText = Mage::helper('Mage_Tax_Helper_Data')->__('Manage Tax Rules'); $this->_addButtonLabel = Mage::helper('Mage_Tax_Helper_Data')->__('Add New Tax Rule'); - parent::__construct(); + parent::_construct(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php index 11402c15de524..383f3f1d526a1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php @@ -38,12 +38,12 @@ class Mage_Adminhtml_Block_Tax_Rule_Edit extends Mage_Adminhtml_Block_Widget_For * Init class * */ - public function __construct() + protected function _construct() { $this->_objectId = 'rule'; $this->_controller = 'tax_rule'; - parent::__construct(); + parent::_construct(); $this->_updateButton('save', 'label', Mage::helper('Mage_Tax_Helper_Data')->__('Save Rule')); $this->_updateButton('delete', 'label', Mage::helper('Mage_Tax_Helper_Data')->__('Delete Rule')); diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit/Form.php index 1845f84358ec2..079c71976ac4c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit/Form.php @@ -38,9 +38,9 @@ class Mage_Adminhtml_Block_Tax_Rule_Edit_Form extends Mage_Backend_Block_Widget_ * Init class * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('taxRuleForm'); $this->setTitle(Mage::helper('Mage_Tax_Helper_Data')->__('Tax Rule Information')); @@ -60,24 +60,14 @@ protected function _prepareForm() )); $fieldset = $form->addFieldset('base_fieldset', array( - 'legend' => Mage::helper('Mage_Tax_Helper_Data')->__('Tax Rule Information') + 'legend' => Mage::helper('Mage_Tax_Helper_Data')->__('Tax Rule Information') )); - $productClasses = Mage::getModel('Mage_Tax_Model_Class') - ->getCollection() - ->setClassTypeFilter(Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT) - ->toOptionArray(); - - $customerClasses = Mage::getModel('Mage_Tax_Model_Class') - ->getCollection() - ->setClassTypeFilter(Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER) - ->toOptionArray(); - $rates = Mage::getModel('Mage_Tax_Model_Calculation_Rate') ->getCollection() ->toOptionArray(); - $fieldset->addField('code', 'text', + $fieldset->addField('code', 'text', array( 'name' => 'code', 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Name'), @@ -87,62 +77,59 @@ protected function _prepareForm() ); // Editable multiselect for customer tax class - $selectConfigJson = Mage::helper('Mage_Core_Helper_Data')->jsonEncode( - $this->getTaxClassSelectConfig(Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER) - ); - $selectAfterHtml = ''; + $selectConfig = $this->getTaxClassSelectConfig(Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER); + $selectedCustomerTax = $model->getId() + ? $model->getCustomerTaxClasses() + : $model->getCustomerTaxClassWithDefault(); $fieldset->addField($this->getTaxClassSelectHtmlId(Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER), - 'multiselect', + 'editablemultiselect', array( 'name' => $this->getTaxClassSelectHtmlId(Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER), 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Customer Tax Class'), 'class' => 'required-entry', - 'values' => $customerClasses, - 'value' => $model->getCustomerTaxClasses(), + 'values' => $model->getAllOptionsForClass(Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER), + 'value' => $selectedCustomerTax, 'required' => true, - 'after_element_html' => $selectAfterHtml, - ) + 'select_config' => $selectConfig, + ), + false, + true ); // Editable multiselect for product tax class - $selectConfigJson = Mage::helper('Mage_Core_Helper_Data')->jsonEncode( - $this->getTaxClassSelectConfig(Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT) - ); - $selectAfterHtml = ''; - $fieldset->addField($this->getTaxClassSelectHtmlId(Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT), 'multiselect', + $selectConfig = $this->getTaxClassSelectConfig(Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT); + $selectedProductTax = $model->getId() + ? $model->getProductTaxClasses() + : $model->getProductTaxClassWithDefault(); + $fieldset->addField($this->getTaxClassSelectHtmlId(Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT), + 'editablemultiselect', array( 'name' => $this->getTaxClassSelectHtmlId(Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT), 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Product Tax Class'), 'class' => 'required-entry', - 'values' => $productClasses, - 'value' => $model->getProductTaxClasses(), + 'values' => $model->getAllOptionsForClass(Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT), + 'value' => $selectedProductTax, 'required' => true, - 'after_element_html' => $selectAfterHtml, - ) + 'select_config' => $selectConfig + ), + false, + true ); - $fieldset->addField('tax_rate', 'multiselect', + $fieldset->addField('tax_rate', + 'editablemultiselect', array( - 'name' => 'tax_rate', - 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Tax Rate'), - 'class' => 'required-entry', - 'values' => $rates, - 'value' => $model->getRates(), - 'required' => true, + 'name' => 'tax_rate', + 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Tax Rate'), + 'class' => 'required-entry', + 'values' => $rates, + 'value' => $model->getRates(), + 'required' => true, + 'element_js_class' => 'TaxRateEditableMultiselect', + 'select_config' => array('is_entity_editable' => true), ) ); + $fieldset->addField('priority', 'text', array( 'name' => 'priority', @@ -151,7 +138,9 @@ protected function _prepareForm() 'value' => (int) $model->getPriority(), 'required' => true, 'note' => Mage::helper('Mage_Tax_Helper_Data')->__('Tax rates at the same priority are added, others are compounded.'), - ) + ), + false, + true ); $fieldset->addField('position', 'text', array( @@ -160,7 +149,9 @@ protected function _prepareForm() 'class' => 'validate-not-negative-number', 'value' => (int) $model->getPosition(), 'required' => true, - ) + ), + false, + true ); if ($model->getId() > 0 ) { @@ -202,32 +193,23 @@ public function getTaxClassSelectHtmlId($classType) public function getTaxClassSelectConfig($classType) { $config = array( - 'class_type' => $classType, 'new_url' => $this->getUrl('*/tax_class/ajaxSave/'), 'save_url' => $this->getUrl('*/tax_class/ajaxSave/'), - 'delete_url' => $this->getTaxClassDeleteUrl($classType), + 'delete_url' => $this->getUrl('*/tax_class/ajaxDelete/'), 'delete_confirm_message' => Mage::helper('Mage_Tax_Helper_Data')->__('Do you really want to delete this tax class?'), 'target_select_id' => $this->getTaxClassSelectHtmlId($classType), 'add_button_caption' => Mage::helper('Mage_Tax_Helper_Data')->__('Add New Tax Class'), + 'submit_data' => array( + 'class_type' => $classType, + 'form_key' => Mage::getSingleton('Mage_Core_Model_Session')->getFormKey(), + ), + 'entity_id_name' => 'class_id', + 'entity_value_name' => 'class_name', + 'is_entity_editable' => true ); return $config; } - /** - * Retrieve tax class delete URL - * - * @param string $classType - * @return string - */ - public function getTaxClassDeleteUrl($classType) - { - $url = $this->getUrl('*/tax_class_product/ajaxDelete/'); - if ($classType == Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER) { - $url = $this->getUrl('*/tax_class_customer/ajaxDelete/'); - } - return $url; - } - /** * Retrieve Tax Rate delete URL * diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Grid.php index 1f80a2b28279c..4b3e6aab478ad 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Grid.php @@ -26,9 +26,9 @@ class Mage_Adminhtml_Block_Tax_Rule_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setDefaultSort('tax_rule_id'); $this->setId('taxRuleGrid'); $this->setDefaultDir('asc'); diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite.php index 4f87997dc19c2..5bd09aca470db 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite.php @@ -47,11 +47,11 @@ class Mage_Adminhtml_Block_Urlrewrite extends Mage_Adminhtml_Block_Widget_Grid_C * Set custom labels and headers * */ - public function __construct() + protected function _construct() { $this->_headerText = Mage::helper('Mage_Adminhtml_Helper_Data')->__('URL Rewrite Management'); $this->_addButtonLabel = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add URL Rewrite'); - parent::__construct(); + parent::_construct(); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php index 5e6dec17419ea..a7ad9fc5bf560 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php @@ -40,14 +40,7 @@ class Mage_Adminhtml_Block_Urlrewrite_Catalog_Category_Tree extends Mage_Adminht */ protected $_allowedCategoryIds = null; - /** - * Set custom template for the block - */ - public function __construct() - { - parent::__construct(); - $this->setTemplate('urlrewrite/categories.phtml'); - } + protected $_template = 'urlrewrite/categories.phtml'; /** * Get categories tree as recursive array diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Cms/Page/Grid.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Cms/Page/Grid.php index 633b8fb350a13..c644eea0eb95c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Cms/Page/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Cms/Page/Grid.php @@ -36,9 +36,9 @@ class Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Grid extends Mage_Adminhtml_Block /** * Constructor */ - public function __construct() + public function _construct() { - parent::__construct(); + parent::_construct(); $this->setUseAjax(true); } diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php index 2e3c77b911881..00dd305a55f61 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php @@ -60,9 +60,9 @@ class Mage_Adminhtml_Block_Urlrewrite_Edit_Form extends Mage_Adminhtml_Block_Wid * Set form id and title * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('urlrewrite_form'); $this->setTitle(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Block Information')); } diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php index 7bc4c4011ebad..1e32a013121d9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php @@ -34,9 +34,9 @@ class Mage_Adminhtml_Block_Urlrewrite_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('urlrewriteGrid'); $this->setDefaultSort('url_rewrite_id'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Selector.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Selector.php index 971bd38dac58b..da1be88c60115 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Selector.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Selector.php @@ -41,13 +41,15 @@ class Mage_Adminhtml_Block_Urlrewrite_Selector extends Mage_Core_Block_Template */ protected $_modes; + protected $_template = 'urlrewrite/selector.phtml'; + /** * Set block template and get available modes * */ - public function __construct() + protected function _construct() { - $this->setTemplate('urlrewrite/selector.phtml'); + $this->_modes = array( 'category' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('For category'), 'product' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('For product'), diff --git a/app/code/core/Mage/Adminhtml/Controller/Action.php b/app/code/core/Mage/Adminhtml/Controller/Action.php index 85a9782a2def7..b8d72ce794b8e 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Action.php +++ b/app/code/core/Mage/Adminhtml/Controller/Action.php @@ -52,13 +52,17 @@ class Mage_Adminhtml_Controller_Action extends Mage_Backend_Controller_ActionAbs * * @param Zend_Controller_Request_Abstract $request * @param Zend_Controller_Response_Abstract $response + * @param Magento_ObjectManager $objectManager + * @param Mage_Core_Controller_Varien_Front $frontController * @param array $invokeArgs */ public function __construct(Zend_Controller_Request_Abstract $request, - Zend_Controller_Response_Abstract $response, - array $invokeArgs = array() + Zend_Controller_Response_Abstract $response, + Magento_ObjectManager $objectManager, + Mage_Core_Controller_Varien_Front $frontController, + array $invokeArgs = array() ) { - parent::__construct($request, $response, $invokeArgs); + parent::__construct($request, $response, $objectManager, $frontController, $invokeArgs); $this->_translator = isset($invokeArgs['translator']) ? $invokeArgs['translator'] : $this->_getTranslator(); } diff --git a/app/code/core/Mage/Adminhtml/Model/Extension.php b/app/code/core/Mage/Adminhtml/Model/Extension.php index e791ee7479052..f91ccd872da7a 100644 --- a/app/code/core/Mage/Adminhtml/Model/Extension.php +++ b/app/code/core/Mage/Adminhtml/Model/Extension.php @@ -24,8 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -require_once 'Varien/Pear/Package.php'; - class Mage_Adminhtml_Model_Extension extends Varien_Object { protected $_roles; diff --git a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php index 2a33cb6ba91c0..1335ae0bc0136 100644 --- a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php @@ -1500,7 +1500,7 @@ public function createOrder() $this->_prepareQuoteItems(); /** @var $service Mage_Sales_Model_Service_Quote */ - $service = Mage::getModel('Mage_Sales_Model_Service_Quote', $quote); + $service = Mage::getModel('Mage_Sales_Model_Service_Quote', array('quote' => $quote)); if ($this->getSession()->getOrder()->getId()) { $oldOrder = $this->getSession()->getOrder(); $originalId = $oldOrder->getOriginalIncrementId(); diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php index 39864b4de5327..80127a40c1e96 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php @@ -75,7 +75,9 @@ public function toOptionArray() */ protected function _getMenuIterator(Mage_Backend_Model_Menu $menu) { - return $this->_objectFactory->getModelInstance('Mage_Backend_Model_Menu_Filter_Iterator', $menu->getIterator()); + return $this->_objectFactory->getModelInstance('Mage_Backend_Model_Menu_Filter_Iterator', + array('iterator' => $menu->getIterator()) + ); } /** diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Package.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Package.php index dba7cb508eca8..b9b0e7f08c2f0 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Package.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Package.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Mage_Adminhtml_Model_System_Config_Source_Package +class Mage_Adminhtml_Model_System_Config_Source_Design_Package { public function toOptionArray() diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Class/Customer.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Class/Customer.php new file mode 100644 index 0000000000000..0a4b4d5df9503 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Class/Customer.php @@ -0,0 +1,34 @@ +toOptionArray(); + array_unshift($taxClasses, array('value' => '0', 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('None'))); + return $taxClasses; + } +} diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Taxclass.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Class/Product.php similarity index 77% rename from app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Taxclass.php rename to app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Class/Product.php index 649085ff44cc9..bcd5c7c6ed995 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Taxclass.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Class/Product.php @@ -23,13 +23,10 @@ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Mage_Adminhtml_Model_System_Config_Source_Shipping_Taxclass +class Mage_Adminhtml_Model_System_Config_Source_Tax_Class_Product { public function toOptionArray() { - $options = Mage::getModel('Mage_Tax_Model_Class_Source_Product')->toOptionArray(); - //array_unshift($options, array('value'=>'', 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('None'))); - return $options; + return Mage::getModel('Mage_Tax_Model_Class_Source_Product')->toOptionArray(); } - } diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php index 514c515fe6a63..1d8e23604d8b5 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php @@ -1103,3 +1103,5 @@ public function customOptionsAction() $this->renderLayout(); } } + + diff --git a/app/code/core/Mage/Adminhtml/controllers/DashboardController.php b/app/code/core/Mage/Adminhtml/controllers/DashboardController.php index 01a70282e0874..5fb8d11f32473 100644 --- a/app/code/core/Mage/Adminhtml/controllers/DashboardController.php +++ b/app/code/core/Mage/Adminhtml/controllers/DashboardController.php @@ -89,25 +89,37 @@ public function ajaxBlockAction() public function tunnelAction() { $httpClient = new Varien_Http_Client(); + $error = $this->__('invalid request'); + $httpCode = 400; $gaData = $this->getRequest()->getParam('ga'); $gaHash = $this->getRequest()->getParam('h'); if ($gaData && $gaHash) { $newHash = Mage::helper('Mage_Adminhtml_Helper_Dashboard_Data')->getChartDataHash($gaData); if ($newHash == $gaHash) { if ($params = unserialize(base64_decode(urldecode($gaData)))) { - $response = $httpClient->setUri(Mage_Adminhtml_Block_Dashboard_Graph::API_URL) + try { + $response = $httpClient->setUri(Mage_Adminhtml_Block_Dashboard_Graph::API_URL) ->setParameterGet($params) ->setConfig(array('timeout' => 5)) ->request('GET'); - $headers = $response->getHeaders(); + $headers = $response->getHeaders(); - $this->getResponse() - ->setHeader('Content-type', $headers['Content-type']) - ->setBody($response->getBody()); + $this->getResponse() + ->setHeader('Content-type', $headers['Content-type']) + ->setBody($response->getBody()); + return; + } catch (Exception $e) { + Mage::logException($e); + $error = $this->__('see error log for details'); + $httpCode = 503; + } } } } + $this->getResponse()->setBody($this->__('Service unavailable: %s', $error)) + ->setHeader('Content-Type', 'text/plain; charset=UTF-8') + ->setHttpResponseCode($httpCode); } protected function _isAllowed() diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php index 8021b0dbc0b7c..ac40db7943b54 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php @@ -131,7 +131,7 @@ protected function _initCreditmemo($update = false) } $data['qtys'] = $qtys; - $service = Mage::getModel('Mage_Sales_Model_Service_Order', $order); + $service = Mage::getModel('Mage_Sales_Model_Service_Order', array('order' => $order)); if ($invoice) { $creditmemo = $service->prepareInvoiceCreditmemo($invoice, $data); } else { diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php index 5cd3552f2193f..5788c0b09dffd 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php @@ -83,7 +83,8 @@ protected function _initInvoice($update = false) return false; } $savedQtys = $this->_getItemQtys(); - $invoice = Mage::getModel('Mage_Sales_Model_Service_Order', $order)->prepareInvoice($savedQtys); + $invoice = Mage::getModel('Mage_Sales_Model_Service_Order', array('order' => $order)) + ->prepareInvoice($savedQtys); if (!$invoice->getTotalQty()) { Mage::throwException($this->__('Cannot create an invoice without products.')); } @@ -119,7 +120,8 @@ protected function _saveInvoice($invoice) protected function _prepareShipment($invoice) { $savedQtys = $this->_getItemQtys(); - $shipment = Mage::getModel('Mage_Sales_Model_Service_Order', $invoice->getOrder())->prepareShipment($savedQtys); + $shipment = Mage::getModel('Mage_Sales_Model_Service_Order', array('order' => $invoice->getOrder())) + ->prepareShipment($savedQtys); if (!$shipment->getTotalQty()) { return false; } diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php index 60fa60fbe9652..7965d71b3fe38 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php @@ -86,7 +86,8 @@ protected function _initShipment() return false; } $savedQtys = $this->_getItemQtys(); - $shipment = Mage::getModel('Mage_Sales_Model_Service_Order', $order)->prepareShipment($savedQtys); + $shipment = Mage::getModel('Mage_Sales_Model_Service_Order', array('order' => $order)) + ->prepareShipment($savedQtys); $tracks = $this->getRequest()->getPost('tracking'); if ($tracks) { diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php deleted file mode 100644 index 1232a75a74dff..0000000000000 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php +++ /dev/null @@ -1,245 +0,0 @@ - - */ - -class Mage_Adminhtml_Tax_Class_CustomerController extends Mage_Adminhtml_Controller_Action -{ - /** - * grid view - * - */ - public function indexAction() - { - $this->_title($this->__('Sales')) - ->_title($this->__('Tax')) - ->_title($this->__('Customer Tax Classes')); - - $this->_initAction() - ->_addContent( - $this->getLayout() - ->createBlock('Mage_Adminhtml_Block_Tax_Class') - ->setClassType(Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER) - ) - ->renderLayout(); - } - - /** - * new class action - * - */ - public function newAction() - { - $this->_forward('edit'); - } - - /** - * edit class action - * - */ - public function editAction() - { - $this->_title($this->__('Sales')) - ->_title($this->__('Tax')) - ->_title($this->__('Customer Tax Classes')); - - $classId = $this->getRequest()->getParam('id'); - $model = Mage::getModel('Mage_Tax_Model_Class'); - if ($classId) { - $model->load($classId); - if (!$model->getId() || $model->getClassType() != Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER) { - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError(Mage::helper('Mage_Tax_Helper_Data')->__('This class no longer exists')); - $this->_redirect('*/*/'); - return; - } - } - - $this->_title($model->getId() ? $model->getClassName() : $this->__('New Class')); - - $data = Mage::getSingleton('Mage_Adminhtml_Model_Session')->getClassData(true); - if (!empty($data)) { - $model->setData($data); - } - - Mage::register('tax_class', $model); - - $this->_initAction() - ->_addBreadcrumb( - $classId ? Mage::helper('Mage_Tax_Helper_Data')->__('Edit Class') : Mage::helper('Mage_Tax_Helper_Data')->__('New Class'), - $classId ? Mage::helper('Mage_Tax_Helper_Data')->__('Edit Class') : Mage::helper('Mage_Tax_Helper_Data')->__('New Class') - ) - ->_addContent( - $this->getLayout() - ->createBlock('Mage_Adminhtml_Block_Tax_Class_Edit') - ->setData('action', $this->getUrl('*/tax_class/save')) - ->setClassType(Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER) - ) - ->renderLayout(); - } - - /** - * delete class action - * - */ - public function deleteAction() - { - $classId = $this->getRequest()->getParam('id'); - $session = Mage::getSingleton('Mage_Adminhtml_Model_Session'); - $classModel = Mage::getModel('Mage_Tax_Model_Class') - ->load($classId); - - if (!$classModel->getId() || $classModel->getClassType() != Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER) { - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError(Mage::helper('Mage_Tax_Helper_Data')->__('This class no longer exists')); - $this->_redirect('*/*/'); - return; - } - - $ruleCollection = Mage::getModel('Mage_Tax_Model_Calculation_Rule') - ->getCollection() - ->setClassTypeFilter(Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER, $classId); - - if ($ruleCollection->getSize() > 0) { - $session->addError(Mage::helper('Mage_Tax_Helper_Data')->__('You cannot delete this tax class as it is used in Tax Rules. You have to delete the rules it is used in first.')); - $this->_redirect('*/*/edit/',array('id'=>$classId)); - return; - } - - $customerGroupCollection = Mage::getModel('Mage_Customer_Model_Group') - ->getCollection() - ->addFieldToFilter('tax_class_id', $classId); - $groupCount = $customerGroupCollection->getSize(); - - if ($groupCount > 0) { - $session->addError(Mage::helper('Mage_Tax_Helper_Data')->__('You cannot delete this tax class as it is used for %d customer groups.', $groupCount)); - $this->_redirect('*/*/edit/',array('id'=>$classId)); - return; - } - - try { - $classModel->delete(); - - $session->addSuccess(Mage::helper('Mage_Tax_Helper_Data')->__('The tax class has been deleted.')); - $this->getResponse()->setRedirect($this->getUrl("*/*/")); - return ; - } catch (Mage_Core_Exception $e) { - $session->addError($e->getMessage()); - } catch (Exception $e) { - $session->addException($e, Mage::helper('Mage_Tax_Helper_Data')->__('An error occurred while deleting this tax class.')); - } - - $this->_redirect('*/*/edit/',array('id'=>$classId)); - } - - /** - * Delete Tax Class via AJAX - */ - public function ajaxDeleteAction() - { - $responseContent = ''; - $classId = (int)$this->getRequest()->getParam('class_id'); - try { - $classModel = Mage::getModel('Mage_Tax_Model_Class')->load($classId); - $this->_checkCustomerTaxClassUsage($classModel); - $classModel->delete(); - $responseContent = Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array( - 'success' => true, - 'error' => false, - 'error_message' => '' - )); - } catch (Mage_Core_Exception $e) { - $responseContent = Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array( - 'success' => false, - 'error' => true, - 'error_message' => $e->getMessage() - )); - } catch (Exception $e) { - $responseContent = Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array( - 'success' => false, - 'error' => true, - 'error_message' => Mage::helper('Mage_Tax_Helper_Data')->__('An error occurred while deleting this tax class.') - )); - } - $this->getResponse()->setBody($responseContent); - } - - /** - * Check if customer tax class exists and has not been used yet (in Tax Rules or Customer Groups) - * - * @param Mage_Tax_Model_Class $classModel - */ - protected function _checkCustomerTaxClassUsage(Mage_Tax_Model_Class $classModel) - { - if (!$classModel->getId() || $classModel->getClassType() != Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER) { - Mage::throwException(Mage::helper('Mage_Tax_Helper_Data')->__('This class no longer exists.')); - } - - $ruleCollection = Mage::getModel('Mage_Tax_Model_Calculation_Rule')->getCollection() - ->setClassTypeFilter(Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER, $classModel->getId()); - - if ($ruleCollection->getSize() > 0) { - Mage::throwException(Mage::helper('Mage_Tax_Helper_Data')->__('You cannot delete this tax class as it is used in Tax Rules. You have to delete the rules it is used in first.')); - } - - $customerGroupCollection = Mage::getModel('Mage_Customer_Model_Group')->getCollection() - ->addFieldToFilter('tax_class_id', $classModel->getId()); - $groupCount = $customerGroupCollection->getSize(); - if ($groupCount > 0) { - Mage::throwException(Mage::helper('Mage_Tax_Helper_Data')->__('You cannot delete this tax class as it is used for %d customer groups.', $groupCount)); - } - } - - /** - * Initialize action - * - * @return Mage_Adminhtml_Controller_Action - */ - protected function _initAction() - { - $this->loadLayout() - ->_setActiveMenu('Mage_Tax::sales_tax_classes_customer') - ->_addBreadcrumb(Mage::helper('Mage_Tax_Helper_Data')->__('Sales'), Mage::helper('Mage_Tax_Helper_Data')->__('Sales')) - ->_addBreadcrumb(Mage::helper('Mage_Tax_Helper_Data')->__('Tax'), Mage::helper('Mage_Tax_Helper_Data')->__('Tax')) - ->_addBreadcrumb(Mage::helper('Mage_Tax_Helper_Data')->__('Manage Customer Tax Classes'), Mage::helper('Mage_Tax_Helper_Data')->__('Manage Customer Tax Classes')) - ; - return $this; - } - - /** - * Check current user permission on resource and privilege - * - * @return bool - */ - protected function _isAllowed() - { - return Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::classes_customer'); - } -} diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php deleted file mode 100644 index 3fb67d2d50d54..0000000000000 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php +++ /dev/null @@ -1,245 +0,0 @@ - - */ -class Mage_Adminhtml_Tax_Class_ProductController extends Mage_Adminhtml_Controller_Action -{ - /** - * view grid - * - */ - public function indexAction() - { - $this->_title($this->__('Sales')) - ->_title($this->__('Tax')) - ->_title($this->__('Product Tax Classes')); - - $this->_initAction() - ->_addContent( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_Tax_Class') - ->setClassType(Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT) - ) - ->renderLayout(); - } - - /** - * new class action - * - */ - public function newAction() - { - $this->_forward('edit'); - } - - /** - * edit class action - * - */ - public function editAction() - { - $this->_title($this->__('Sales')) - ->_title($this->__('Tax')) - ->_title($this->__('Product Tax Classes')); - - $classId = $this->getRequest()->getParam('id'); - $model = Mage::getModel('Mage_Tax_Model_Class'); - if ($classId) { - $model->load($classId); - if (!$model->getId() || $model->getClassType() != Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT) { - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError( - Mage::helper('Mage_Tax_Helper_Data')->__('This class no longer exists') - ); - $this->_redirect('*/*/'); - return; - } - } - - $this->_title($model->getId() ? $model->getClassName() : $this->__('New Class')); - - $data = Mage::getSingleton('Mage_Adminhtml_Model_Session')->getClassData(true); - if (!empty($data)) { - $model->setData($data); - } - - Mage::register('tax_class', $model); - - $this->_initAction() - ->_addBreadcrumb( - $classId ? Mage::helper('Mage_Tax_Helper_Data')->__('Edit Class') : Mage::helper('Mage_Tax_Helper_Data')->__('New Class'), - $classId ? Mage::helper('Mage_Tax_Helper_Data')->__('Edit Class') : Mage::helper('Mage_Tax_Helper_Data')->__('New Class') - ) - ->_addContent( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_Tax_Class_Edit') - ->setData('action', $this->getUrl('*/tax_class/save')) - ->setClassType(Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT) - ) - ->renderLayout(); - } - - /** - * delete class action - * - */ - public function deleteAction() - { - $classId = $this->getRequest()->getParam('id'); - $session = Mage::getSingleton('Mage_Adminhtml_Model_Session'); - $classModel = Mage::getModel('Mage_Tax_Model_Class') - ->load($classId); - - if (!$classModel->getId() || $classModel->getClassType() != Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT) { - $session->addError(Mage::helper('Mage_Tax_Helper_Data')->__('This class no longer exists')); - $this->_redirect('*/*/'); - return; - } - - $ruleCollection = Mage::getModel('Mage_Tax_Model_Calculation_Rule') - ->getCollection() - ->setClassTypeFilter(Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT, $classId); - - if ($ruleCollection->getSize() > 0) { - $session->addError(Mage::helper('Mage_Tax_Helper_Data')->__('You cannot delete this tax class as it is used in Tax Rules. You have to delete the rules it is used in first.')); - $this->_redirect('*/*/edit/', array('id' => $classId)); - return; - } - - $productCollection = Mage::getModel('Mage_Catalog_Model_Product') - ->getCollection() - ->addAttributeToFilter('tax_class_id', $classId); - $productCount = $productCollection->getSize(); - - if ($productCount > 0) { - $session->addError(Mage::helper('Mage_Tax_Helper_Data')->__('You cannot delete this tax class as it is used for %d products.', $productCount)); - $this->_redirect('*/*/edit/', array('id' => $classId)); - return; - } - - try { - $classModel->delete(); - - $session->addSuccess(Mage::helper('Mage_Tax_Helper_Data')->__('The tax class has been deleted.')); - $this->getResponse()->setRedirect($this->getUrl("*/*/")); - return; - } catch (Mage_Core_Exception $e) { - $session->addError($e->getMessage()); - } catch (Exception $e) { - $session->addException($e, Mage::helper('Mage_Tax_Helper_Data')->__('An error occurred while deleting this tax class.')); - } - - $this->_redirect('*/*/edit/', array('id' => $classId)); - } - - /** - * Delete Tax Class via AJAX - */ - public function ajaxDeleteAction() - { - $responseContent = ''; - $classId = (int)$this->getRequest()->getParam('class_id'); - try { - $classModel = Mage::getModel('Mage_Tax_Model_Class')->load($classId); - $this->_checkProductTaxClassUsage($classModel); - $classModel->delete(); - $responseContent = Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array( - 'success' => true, - 'error' => false, - 'error_message' => '' - )); - } catch (Mage_Core_Exception $e) { - $responseContent = Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array( - 'success' => false, - 'error' => true, - 'error_message' => $e->getMessage() - )); - } catch (Exception $e) { - $responseContent = Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array( - 'success' => false, - 'error' => true, - 'error_message' => Mage::helper('Mage_Tax_Helper_Data')->__('An error occurred while deleting this tax class.') - )); - } - $this->getResponse()->setBody($responseContent); - } - - /** - * Check if product tax class exists and has not been used yet (in Tax Rules or Products) - * - * @param Mage_Tax_Model_Class $classModel - */ - protected function _checkProductTaxClassUsage(Mage_Tax_Model_Class $classModel) - { - if (!$classModel->getId() || $classModel->getClassType() != Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT) { - Mage::throwException(Mage::helper('Mage_Tax_Helper_Data')->__('This class no longer exists.')); - } - - $ruleCollection = Mage::getModel('Mage_Tax_Model_Calculation_Rule')->getCollection() - ->setClassTypeFilter(Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT, $classModel->getId()); - - if ($ruleCollection->getSize() > 0) { - Mage::throwException(Mage::helper('Mage_Tax_Helper_Data')->__('You cannot delete this tax class as it is used in Tax Rules. You have to delete the rules it is used in first.')); - } - - $productCollection = Mage::getModel('Mage_Catalog_Model_Product')->getCollection() - ->addAttributeToFilter('tax_class_id', $classModel->getId()); - $productCount = $productCollection->getSize(); - if ($productCount > 0) { - Mage::throwException(Mage::helper('Mage_Tax_Helper_Data')->__('You cannot delete this tax class as it is used for %d products.', $productCount)); - } - } - - /** - * Initialize action - * - * @return Mage_Adminhtml_Controller_Action - */ - protected function _initAction() - { - $this->loadLayout() - ->_setActiveMenu('Mage_Tax::sales_tax_classes_product') - ->_addBreadcrumb(Mage::helper('Mage_Tax_Helper_Data')->__('Sales'), Mage::helper('Mage_Tax_Helper_Data')->__('Sales')) - ->_addBreadcrumb(Mage::helper('Mage_Tax_Helper_Data')->__('Tax'), Mage::helper('Mage_Tax_Helper_Data')->__('Tax')) - ->_addBreadcrumb(Mage::helper('Mage_Tax_Helper_Data')->__('Manage Product Tax Classes'), Mage::helper('Mage_Tax_Helper_Data')->__('Manage Product Tax Classes')) - ; - return $this; - } - - /** - * Check current user permission on resource and privilege - * - * @return bool - */ - protected function _isAllowed() - { - return Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::classes_product'); - } - -} diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/ClassController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/ClassController.php index e77aadcc1904f..21f33e0fd5dc9 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/ClassController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/ClassController.php @@ -33,46 +33,6 @@ */ class Mage_Adminhtml_Tax_ClassController extends Mage_Adminhtml_Controller_Action { - /** - * save class action - * - */ - public function saveAction() - { - if ($postData = $this->getRequest()->getPost()) { - - $model = Mage::getModel('Mage_Tax_Model_Class')->setData($postData); - - try { - $model->save(); - $classId = $model->getId(); - $classType = $model->getClassType(); - $classUrl = '*/tax_class_' . strtolower($classType); - - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Tax_Helper_Data')->__('The tax class has been saved.') - ); - $this->_redirect($classUrl); - - return ; - } catch (Mage_Core_Exception $e) { - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); - Mage::getSingleton('Mage_Adminhtml_Model_Session')->setClassData($postData); - $this->_redirectReferer(); - } catch (Exception $e) { - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError( - Mage::helper('Mage_Tax_Helper_Data')->__('An error occurred while saving this tax class.') - ); - Mage::getSingleton('Mage_Adminhtml_Model_Session')->setClassData($postData); - $this->_redirectReferer(); - } - - $this->_redirectReferer(); - return; - } - $this->getResponse()->setRedirect($this->getUrl('*/tax_class')); - } - /** * Save Tax Class via AJAX */ @@ -115,6 +75,38 @@ public function ajaxSaveAction() $this->getResponse()->setBody($responseContent); } + /** + * Delete Tax Class via AJAX + */ + public function ajaxDeleteAction() + { + $classId = (int)$this->getRequest()->getParam('class_id'); + try { + $classModel = Mage::getModel('Mage_Tax_Model_Class')->load($classId); + Mage::register('tax_class_model', $classModel); + $this->_checkTaxClassUsage($classModel); + $classModel->delete(); + $responseContent = Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array( + 'success' => true, + 'error' => false, + 'error_message' => '' + )); + } catch (Mage_Core_Exception $e) { + $responseContent = Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array( + 'success' => false, + 'error' => true, + 'error_message' => $e->getMessage() + )); + } catch (Exception $e) { + $responseContent = Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array( + 'success' => false, + 'error' => true, + 'error_message' => Mage::helper('Mage_Tax_Helper_Data')->__('An error occurred while deleting this tax class.') + )); + } + $this->getResponse()->setBody($responseContent); + } + /** * Validate/Filter Tax Class Type * @@ -151,20 +143,30 @@ protected function _processClassName($className) } /** - * Initialize action + * Check if customer tax class exists and has not been used yet (in Tax Rules or Customer Groups) * - * @return Mage_Adminhtml_Controller_Action + * @param Mage_Tax_Model_Class $classModel + * @throws Mage_Core_Exception */ - protected function _initAction() + protected function _checkTaxClassUsage(Mage_Tax_Model_Class $classModel) { - $classType = strtolower($this->getRequest()->getParam('classType')); - $this->loadLayout() - ->_setActiveMenu('sales/tax/tax_classes_' . $classType) - ->_addBreadcrumb(Mage::helper('Mage_Tax_Helper_Data')->__('Sales'), Mage::helper('Mage_Tax_Helper_Data')->__('Sales')) - ->_addBreadcrumb(Mage::helper('Mage_Tax_Helper_Data')->__('Tax'), Mage::helper('Mage_Tax_Helper_Data')->__('Tax')) - ; + if (!$classModel->getId()) { + Mage::throwException(Mage::helper('Mage_Tax_Helper_Data')->__('This class no longer exists.')); + } + + $ruleCollection = Mage::getModel('Mage_Tax_Model_Calculation_Rule')->getCollection() + ->setClassTypeFilter($classModel->getClassType(), $classModel->getId()); - return $this; + if ($ruleCollection->getSize() > 0) { + Mage::throwException(Mage::helper('Mage_Tax_Helper_Data')->__('You cannot delete this tax class as it is used in Tax Rules. You have to delete the rules it is used in first.')); + } + + $customerGroupCollection = Mage::getModel('Mage_Customer_Model_Group')->getCollection() + ->addFieldToFilter('tax_class_id', $classModel->getId()); + $groupCount = $customerGroupCollection->getSize(); + if ($groupCount > 0) { + Mage::throwException(Mage::helper('Mage_Tax_Helper_Data')->__('You cannot delete this tax class as it is used for %d customer groups.', $groupCount)); + } } /** @@ -174,7 +176,6 @@ protected function _initAction() */ protected function _isAllowed() { - return Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::classes_product') - || Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::classes_customer'); + return Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::manage_tax'); } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php index d195e504f62ee..31b07ea2dbc51 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php @@ -357,11 +357,10 @@ public function importPostAction() } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError(Mage::helper('Mage_Tax_Helper_Data')->__('Invalid file upload attempt')); } - } - else { + } else { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError(Mage::helper('Mage_Tax_Helper_Data')->__('Invalid file upload attempt')); } - $this->_redirect('*/*/importExport'); + $this->_redirectReferer(); } protected function _importRates() @@ -550,17 +549,25 @@ public function exportPostAction() protected function _isAllowed() { - switch ($this->getRequest()->getActionName()) { case 'importExport': return Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::import_export'); break; + case 'index': - return Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::tax_rates'); + return Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::manage_tax'); break; + + case 'importPost': + case 'exportPost': + return Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::manage_tax') + || Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::import_export'); + break; + default: - return Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::tax_rates'); + return Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::manage_tax'); break; } + } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php index 289ef9d4021d1..58cda5e73b96d 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php @@ -79,7 +79,6 @@ public function editAction() $this->_initAction() ->_addBreadcrumb($taxRuleId ? Mage::helper('Mage_Tax_Helper_Data')->__('Edit Rule') : Mage::helper('Mage_Tax_Helper_Data')->__('New Rule'), $taxRuleId ? Mage::helper('Mage_Tax_Helper_Data')->__('Edit Rule') : Mage::helper('Mage_Tax_Helper_Data')->__('New Rule')) - ->loadLayout() ->renderLayout(); } @@ -163,6 +162,6 @@ protected function _initAction() protected function _isAllowed() { - return Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::rules'); + return Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Tax::manage_tax'); } } diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax.xml index 03e17de91eb67..e4d7e67cbed01 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tax.xml @@ -31,7 +31,7 @@ jquery/editableMultiselect/js/jquery.editable.js jquery/editableMultiselect/js/jquery.multiselect.js - Mage_Adminhtml::tax/class/editablemultiselect.js + mage/backend/editablemultiselect.js jquery/jquery-ui-1.8.18.custom.min.js jquery/editableMultiselect/css/jquery.multiselect.css Mage_Adminhtml::css/ui-lightness/jquery-ui-1.8.21.custom.css @@ -40,6 +40,7 @@ + diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/importExport.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/importExport.phtml index 9e09822fd30e5..3e3539c077cb2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/importExport.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/importExport.phtml @@ -24,17 +24,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -
- - - - -

__('Import / Export Tax Rates') ?>

-
getIsReadonly()): ?>
-
+ getBlockHtml('formkey')?>

__('Import Tax Rates') ?>

@@ -42,16 +35,35 @@
__('Import Tax Rates') ?> - getButtonHtml('Import Tax Rates', "this.form.submit()") ?> + getButtonHtml('Import Tax Rates', '', 'import-submit') ?>
-
+ getBlockHtml('formkey')?>

__('Export Tax Rates') ?>

diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rule/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rule/edit.phtml index 3594ead5121e0..faa039ab60a54 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rule/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rule/edit.phtml @@ -86,153 +86,172 @@ } }); - $().ready(function () { - var options = { + TaxRateEditableMultiselect = function (settings) { + this.settings = settings || {}; + this.isEntityEditable = this.settings.is_entity_editable || false; + + TaxRateEditableMultiselect.prototype.init = function () { + var options = { toggleAddButton:false, addText: '__('Add New Tax Rate'); ?>', parse: null, mselectInputSubmitCallback: function (value, options) { var select = $('#tax_rate'); - select.append(''); + select.append(''); var mselectItemHtml = $(options.item.replace(/%value%|%label%/gi, value) - .replace(/%mselectDisabledClass%|%iseditable%|%isremovable%/gi, '') - .replace(/%mselectListItemClass%/gi, options.mselectListItemClass)) - .find('[type=checkbox]') - .attr('checked', true) - .addClass(options.mselectCheckedClass) - .end(); + .replace(/%mselectDisabledClass%|%iseditable%|%isremovable%/gi, '') + .replace(/%mselectListItemClass%/gi, options.mselectListItemClass)) + .find('[type=checkbox]') + .attr('checked', true) + .addClass(options.mselectCheckedClass) + .end(); var itemsWrapper = select.next().find('.' + options.mselectItemsWrapperClass + ''); itemsWrapper.children('.' + options.mselectListItemClass + '').length - ? itemsWrapper.children('.' + options.mselectListItemClass + ':last').after(mselectItemHtml) - : itemsWrapper.prepend(mselectItemHtml); - } - }, - taxRateField = $('#tax_rate').parent(), - taxRateForm = $('#tax-rate-form'); - - $('#tax_rate').multiselect(options); - - taxRateField.find('.mselect-button-add').off('click'); - - taxRateField.find('.mselect-list') - .on('click.mselect-edit', '.mselect-edit', function () { - var that = $(this), - index = that.parent().index(), - select = that.closest('.mselect-list').prev(), - id = select.find('option').eq(index).attr('value'), - item; - - for(var i = 0, c = taxRateCollection.length; i < c; i++) { - if (taxRateCollection[i].tax_calculation_rate_id == id) { - item = taxRateCollection[i]; - break; - } - } - item.itemElement = that.prev(); - taxRateForm - .dialogRates({itemRate: item}) - .dialogRates('open'); - }) - .on("click.mselect-delete", ".mselect-delete", function () { - if (!confirm('__('Do you really want to delete this tax rate'); ?>')) { - return; + ? itemsWrapper.children('.' + options.mselectListItemClass + ':last').after(mselectItemHtml) + : itemsWrapper.prepend(mselectItemHtml); } + }; + var taxRateField = $('#tax_rate').parent(), + taxRateForm = $('#tax-rate-form'); + + if (!this.isEntityEditable) { + // Override default layout of editable multiselect + options['layout'] = '
' + + '
' + + '%items%' + + '
' + + '
' + + '' + + '' + + '' + + '
' + + '
'; + options['mselectInputSubmitCallback'] = null; + } + + $('#tax_rate').multiselect(options); + + taxRateField.find('.mselect-button-add').off('click'); - var that = $(this), - index = that.parent().index(), - select = that.closest('.mselect-list').prev(); - - var ajaxOptions = { - type: 'POST', - data: { - tax_calculation_rate_id: select.find('option').eq(index).val(), - form_key: $('input[name="form_key"]').val() - }, - dataType: 'json', - url: 'getTaxRateDeleteUrl()?>', - success: function(result, status) { - if (result.success) { - that.parent().remove(); - select.find('option').eq(index).remove(); - } else { - alert(result.error_message); + taxRateField.find('.mselect-list') + .on('click.mselect-edit', '.mselect-edit', function () { + var that = $(this), + index = that.parent().index(), + select = that.closest('.mselect-list').prev(), + id = select.find('option').eq(index).attr('value'), + item; + + for(var i = 0, c = taxRateCollection.length; i < c; i++) { + if (taxRateCollection[i].tax_calculation_rate_id == id) { + item = taxRateCollection[i]; + break; } } - }; - $.ajax(ajaxOptions); - - }) - .on('click.mselectAdd', '.mselect-button-add', function () { - taxRateForm - .dialogRates({itemRate: {}}) - .dialogRates('open'); - }) - .on('click.mselect-checked', '.mselect-list-item input', function (event) { - var el = $(this), - checkedClassName = 'mselect-checked'; - el[el.is(':checked') ? 'addClass' : 'removeClass'](checkedClassName); - }); - - taxRateForm.dialogRates({ - title: '__('Tax Rate'); ?>', - autoOpen: false, - id: 'getJsId() ?>', - minWidth: 560, - modal: true, - resizable: false, - buttons: [{ - text: '__('Cancel'); ?>', - id: 'getJsId('close-button') ?>', - click: function() { - $(this).dialogRates("close"); - } - }, { - text: '__('Save'); ?>', - id: 'getJsId('apply-button') ?>', - click: function() { - $(this).dialogRates('updateItemRate'); - var itemRate = $(this).dialogRates('option').itemRate, - itemRateData = $.extend({}, itemRate); - if (itemRateData.itemElement) { - delete itemRateData.itemElement; + item.itemElement = that.prev(); + taxRateForm + .dialogRates({itemRate: item}) + .dialogRates('open'); + }) + .on("click.mselect-delete", ".mselect-delete", function () { + if (!confirm('__('Do you really want to delete this tax rate'); ?>')) { + return; } - toggleLoadingMask(); + var that = $(this), + index = that.parent().index(), + select = that.closest('.mselect-list').prev(); var ajaxOptions = { type: 'POST', - data: itemRateData, + data: { + tax_calculation_rate_id: select.find('option').eq(index).val(), + form_key: $('input[name="form_key"]').val() + }, dataType: 'json', - url: 'getTaxRateSaveUrl()?>', + url: 'getTaxRateDeleteUrl()?>', success: function(result, status) { if (result.success) { - itemRate.code = result.code; - if (itemRate.tax_calculation_rate_id) { - itemRate.itemElement.find('span').html(itemRate.code); - var index = itemRate.itemElement.parent().index(); - itemRate.itemElement.closest('.mselect-list').prev().find('option').eq(index) - .html(itemRate.code) - .val(itemRate.tax_calculation_rate_id); - } else { - itemRate.tax_calculation_rate_id = result.tax_calculation_rate_id; - taxRateField.find('.mselect-input').val(itemRate.code); - taxRateField.find('.mselect-save').trigger('mousedown'); - taxRateField.find('option[value=""]:last') - .val(itemRate.tax_calculation_rate_id); - } - taxRateForm.dialogRates("close"); - taxRateCollection.push(itemRate); + that.parent().remove(); + select.find('option').eq(index).remove(); } else { alert(result.error_message); } - toggleLoadingMask(); } }; $.ajax(ajaxOptions); - } - }] - }); - }) + + }) + .on('click.mselectAdd', '.mselect-button-add', function () { + taxRateForm + .dialogRates({itemRate: {}}) + .dialogRates('open'); + }) + .on('click.mselect-checked', '.mselect-list-item input', function (event) { + var el = $(this), + checkedClassName = 'mselect-checked'; + el[el.is(':checked') ? 'addClass' : 'removeClass'](checkedClassName); + }); + + taxRateForm.dialogRates({ + title: '__('Tax Rate'); ?>', + autoOpen: false, + id: 'getJsId() ?>', + minWidth: 560, + modal: true, + resizable: false, + buttons: [{ + text: '__('Cancel'); ?>', + id: 'getJsId('close-button') ?>', + click: function() { + $(this).dialogRates("close"); + } + }, { + text: '__('Save'); ?>', + id: 'getJsId('apply-button') ?>', + click: function() { + $(this).dialogRates('updateItemRate'); + var itemRate = $(this).dialogRates('option').itemRate, + itemRateData = $.extend({}, itemRate); + if (itemRateData.itemElement) { + delete itemRateData.itemElement; + } + + toggleLoadingMask(); + + var ajaxOptions = { + type: 'POST', + data: itemRateData, + dataType: 'json', + url: 'getTaxRateSaveUrl()?>', + success: function(result, status) { + if (result.success) { + itemRate.code = result.code; + if (itemRate.tax_calculation_rate_id) { + itemRate.itemElement.find('span').html(itemRate.code); + var index = itemRate.itemElement.parent().index(); + itemRate.itemElement.closest('.mselect-list').prev().find('option').eq(index) + .html(itemRate.code) + .val(itemRate.tax_calculation_rate_id); + } else { + itemRate.tax_calculation_rate_id = result.tax_calculation_rate_id; + taxRateField.find('.mselect-input').val(itemRate.code); + taxRateField.find('.mselect-save').trigger('mousedown'); + taxRateField.find('option[value=""]:last') + .val(itemRate.tax_calculation_rate_id); + } + taxRateForm.dialogRates("close"); + taxRateCollection.push(itemRate); + } else { + alert(result.error_message); + } + toggleLoadingMask(); + } + }; + $.ajax(ajaxOptions); + } + }] + }); + } + } })(jQuery); diff --git a/app/code/core/Mage/Api/Model/Config.php b/app/code/core/Mage/Api/Model/Config.php index fc3699c5fca81..a2640a295125a 100644 --- a/app/code/core/Mage/Api/Model/Config.php +++ b/app/code/core/Mage/Api/Model/Config.php @@ -180,7 +180,7 @@ public function loadAclResources(Mage_Api_Model_Acl $acl, $resource=null, $paren $resource = $this->getNode('acl/resources'); } else { $resourceName = (is_null($parentName) ? '' : $parentName.'/').$resource->getName(); - $acl->add(Mage::getModel('Mage_Api_Model_Acl_Resource', $resourceName), $parentName); + $acl->add(Mage::getModel('Mage_Api_Model_Acl_Resource', array('resourceId' => $resourceName)), $parentName); } $children = $resource->children(); diff --git a/app/code/core/Mage/Api/Model/Resource/Acl.php b/app/code/core/Mage/Api/Model/Resource/Acl.php index 9fefdc2c91bb5..060f5cd279730 100755 --- a/app/code/core/Mage/Api/Model/Resource/Acl.php +++ b/app/code/core/Mage/Api/Model/Resource/Acl.php @@ -88,13 +88,15 @@ public function loadRoles(Mage_Api_Model_Acl $acl, array $rolesArr) switch ($role['role_type']) { case Mage_Api_Model_Acl::ROLE_TYPE_GROUP: $roleId = $role['role_type'].$role['role_id']; - $acl->addRole(Mage::getModel('Mage_Api_Model_Acl_Role_Group', $roleId), $parent); + $acl->addRole(Mage::getModel('Mage_Api_Model_Acl_Role_Group', array('roleId' => $roleId)), + $parent); break; case Mage_Api_Model_Acl::ROLE_TYPE_USER: $roleId = $role['role_type'].$role['user_id']; if (!$acl->hasRole($roleId)) { - $acl->addRole(Mage::getModel('Mage_Api_Model_Acl_Role_User', $roleId), $parent); + $acl->addRole(Mage::getModel('Mage_Api_Model_Acl_Role_User', array('roleId' => $roleId)), + $parent); } else { $acl->addRoleParent($roleId, $parent); } diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute.php b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute.php index cef6808740b88..4dd274c7e5288 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute.php @@ -36,9 +36,9 @@ class Mage_Api2_Block_Adminhtml_Attribute extends Mage_Adminhtml_Block_Widget_Gr /** * Construct grid container */ - public function __construct() + public function _construct() { - parent::__construct(); + parent::_construct(); $this->_blockGroup = 'Mage_Api2'; $this->_controller = 'adminhtml_attribute'; diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit.php b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit.php index b4e0f1d038711..3d43ba083ede2 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Edit.php @@ -36,13 +36,13 @@ class Mage_Api2_Block_Adminhtml_Attribute_Edit extends Mage_Adminhtml_Block_Widg /** * Initialize edit form container */ - public function __construct() + public function _construct() { $this->_objectId = 'id'; $this->_blockGroup = 'Mage_Api2'; $this->_controller = 'adminhtml_attribute'; - parent::__construct(); + parent::_construct(); $this->_updateButton('save', 'label', $this->__('Save')) ->_removeButton('delete'); diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Grid.php b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Grid.php index be7cb0f46b99c..2a1690f261851 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Grid.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Grid.php @@ -38,9 +38,9 @@ class Mage_Api2_Block_Adminhtml_Attribute_Grid extends Mage_Adminhtml_Block_Widg * * @param array $attributes */ - public function __construct($attributes = array()) + public function _construct() { - parent::__construct($attributes); + parent::_construct(); $this->setId('api2_attributes'); } diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tab/Resource.php b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tab/Resource.php index 61d8eafef5aac..283d3604e7d5a 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tab/Resource.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tab/Resource.php @@ -46,9 +46,9 @@ class Mage_Api2_Block_Adminhtml_Attribute_Tab_Resource extends Mage_Adminhtml_Bl /** * Constructor */ - public function __construct() + public function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('api2_attribute_section_resources') ->setData('default_dir', Varien_Db_Select::SQL_ASC) @@ -56,9 +56,11 @@ public function __construct() ->setData('title', $this->__('Attribute Rules Information')) ->setData('use_ajax', true); + $options = array('type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_ATTRIBUTE); $this->_treeModel = Mage::getModel( 'Mage_Api2_Model_Acl_Global_Rule_Tree', - array('type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_ATTRIBUTE)); + array('options' => $options) + ); /** @var $permissions Mage_Api2_Model_Acl_Filter_Attribute_ResourcePermission */ $permissions = Mage::getModel('Mage_Api2_Model_Acl_Filter_Attribute_ResourcePermission'); diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tabs.php b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tabs.php index a5bb693cf46b5..0eb5f5348558c 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tabs.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Attribute/Tabs.php @@ -36,9 +36,9 @@ class Mage_Api2_Block_Adminhtml_Attribute_Tabs extends Mage_Adminhtml_Block_Widg /** * Constructor */ - public function __construct() + public function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('api2_attribute_section_main') ->setDestElementId('edit_form') diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Permissions/User/Edit/Tab/Roles.php b/app/code/core/Mage/Api2/Block/Adminhtml/Permissions/User/Edit/Tab/Roles.php index f2b8634f6c47e..81f3274b5543f 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Permissions/User/Edit/Tab/Roles.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Permissions/User/Edit/Tab/Roles.php @@ -46,9 +46,9 @@ class Mage_Api2_Block_Adminhtml_Permissions_User_Edit_Tab_Roles * Constructor * Prepare grid parameters */ - public function __construct() + public function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('api2_roles_section') ->setDefaultSort('sort_order') diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles.php index 47e3c383856b6..445ed9d05b073 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Roles.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles.php @@ -36,9 +36,9 @@ class Mage_Api2_Block_Adminhtml_Roles extends Mage_Adminhtml_Block_Widget_Grid_C /** * Construct grid container */ - public function __construct() + public function _construct() { - parent::__construct(); + parent::_construct(); $this->_blockGroup = 'Mage_Api2'; $this->_controller = 'adminhtml_roles'; diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Buttons.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Buttons.php index 2e88648f41b40..05aee04f2a179 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Buttons.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Buttons.php @@ -38,9 +38,9 @@ class Mage_Api2_Block_Adminhtml_Roles_Buttons extends Mage_Adminhtml_Block_Templ /** * Construct */ - public function __construct() + public function _construct() { - parent::__construct(); + parent::_construct(); $this->setTemplate('role/buttons.phtml'); } diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php index ea94b91ebf2f1..fed7f40b047a8 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php @@ -36,9 +36,9 @@ class Mage_Api2_Block_Adminhtml_Roles_Grid extends Mage_Adminhtml_Block_Widget_G /** * Construct grid block */ - public function __construct() + public function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('rolesGrid'); $this->setUseAjax(true); $this->setSaveParametersInSession(true); diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Resources.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Resources.php index c6f252c87daeb..619f9bd389e0d 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Resources.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Resources.php @@ -53,9 +53,9 @@ class Mage_Api2_Block_Adminhtml_Roles_Tab_Resources extends Mage_Adminhtml_Block /** * Constructor */ - public function __construct() + public function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('api2_role_section_resources') ->setData('default_dir', Varien_Db_Select::SQL_ASC) @@ -63,8 +63,9 @@ public function __construct() ->setData('title', Mage::helper('Mage_Api2_Helper_Data')->__('Api Rules Information')) ->setData('use_ajax', true); + $options = array('type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_PRIVILEGE); $this->_treeModel = Mage::getModel( - 'Mage_Api2_Model_Acl_Global_Rule_Tree', array('type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_PRIVILEGE) + 'Mage_Api2_Model_Acl_Global_Rule_Tree', array('options' => $options) ); } diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Users.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Users.php index 393426b2773ae..9715e27cbdfc6 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Users.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tab/Users.php @@ -41,9 +41,9 @@ class Mage_Api2_Block_Adminhtml_Roles_Tab_Users extends Mage_Adminhtml_Block_Wid /** * Construct grid block */ - public function __construct() + public function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('roleUsersGrid'); $this->setData('use_ajax', true); $this->setSaveParametersInSession(true); diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tabs.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tabs.php index 9060280b41fce..5ce2223257fed 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tabs.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Tabs.php @@ -39,9 +39,9 @@ class Mage_Api2_Block_Adminhtml_Roles_Tabs extends Mage_Adminhtml_Block_Widget_T /** * Constructor */ - public function __construct() + public function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('role_info_tabs'); $this->setDestElementId('role_edit_form'); $this->setData('title', Mage::helper('Mage_Api2_Helper_Data')->__('Role Information')); diff --git a/app/code/core/Mage/Api2/Model/Acl/Global.php b/app/code/core/Mage/Api2/Model/Acl/Global.php index 45fafb70b5918..bcce035507324 100644 --- a/app/code/core/Mage/Api2/Model/Acl/Global.php +++ b/app/code/core/Mage/Api2/Model/Acl/Global.php @@ -51,7 +51,7 @@ public function isAllowed(Mage_Api2_Model_Auth_User_Abstract $apiUser, $resource /** @var $aclInstance Mage_Api2_Model_Acl */ $aclInstance = Mage::getSingleton( 'Mage_Api2_Model_Acl', - array('resource_type' => $resourceType, 'operation' => $operation) + array('options' => array('resource_type' => $resourceType, 'operation' => $operation)) ); if (!$aclInstance->hasRole($apiUser->getRole())) { diff --git a/app/code/core/Mage/Api2/Model/Acl/Global/Rule/Tree.php b/app/code/core/Mage/Api2/Model/Acl/Global/Rule/Tree.php index 55831bd46e964..fdc485366a246 100644 --- a/app/code/core/Mage/Api2/Model/Acl/Global/Rule/Tree.php +++ b/app/code/core/Mage/Api2/Model/Acl/Global/Rule/Tree.php @@ -121,8 +121,9 @@ class Mage_Api2_Model_Acl_Global_Rule_Tree extends Mage_Core_Helper_Abstract * Privileges for tree with resources and privileges. * * @param array $options + * @throws Exception */ - public function __construct($options) + public function __construct($options = array()) { $this->_type = $options['type']; diff --git a/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php b/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php index 6c8946ea4dac9..4a7bfeecc27c7 100644 --- a/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php +++ b/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php @@ -44,7 +44,7 @@ class Mage_Api2_Model_Auth_Adapter_Oauth extends Mage_Api2_Model_Auth_Adapter_Ab public function getUserParams(Mage_Api2_Model_Request $request) { /** @var $oauthServer Mage_Oauth_Model_Server */ - $oauthServer = Mage::getModel('Mage_Oauth_Model_Server', $request); + $oauthServer = Mage::getModel('Mage_Oauth_Model_Server', array('request' => $request)); $userParamsObj = (object) array('type' => null, 'id' => null); try { diff --git a/app/code/core/Mage/Api2/Model/Renderer/Xml.php b/app/code/core/Mage/Api2/Model/Renderer/Xml.php index 036ea78791a01..3d9349eeb8ace 100644 --- a/app/code/core/Mage/Api2/Model/Renderer/Xml.php +++ b/app/code/core/Mage/Api2/Model/Renderer/Xml.php @@ -81,9 +81,9 @@ class Mage_Api2_Model_Renderer_Xml implements Mage_Api2_Model_Renderer_Interface public function render($data) { /* @var $writer Mage_Api2_Model_Renderer_Xml_Writer */ - $writer = Mage::getModel('Mage_Api2_Model_Renderer_Xml_Writer', array( + $writer = Mage::getModel('Mage_Api2_Model_Renderer_Xml_Writer', array('options' => array( 'config' => new Zend_Config($this->_prepareData($data, true)) - )); + ))); return $writer->render(); } diff --git a/app/code/core/Mage/Api2/Model/Resource.php b/app/code/core/Mage/Api2/Model/Resource.php index 73856f04ab71e..846e5dd98846b 100644 --- a/app/code/core/Mage/Api2/Model/Resource.php +++ b/app/code/core/Mage/Api2/Model/Resource.php @@ -452,7 +452,7 @@ public function getFilter() { if (!$this->_filter) { /** @var $filter Mage_Api2_Model_Acl_Filter */ - $filter = Mage::getModel('Mage_Api2_Model_Acl_Filter', $this); + $filter = Mage::getModel('Mage_Api2_Model_Acl_Filter', array('resource' => $this)); $this->setFilter($filter); } return $this->_filter; diff --git a/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/AttributeController.php b/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/AttributeController.php index 67faba015776e..9a02c0e81123a 100644 --- a/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/AttributeController.php +++ b/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/AttributeController.php @@ -102,7 +102,7 @@ public function saveAction() /** @var $ruleTree Mage_Api2_Model_Acl_Global_Rule_Tree */ $ruleTree = Mage::getSingleton( 'Mage_Api2_Model_Acl_Global_Rule_Tree', - array('type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_ATTRIBUTE) + array('options' => array('type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_ATTRIBUTE)) ); /** @var $attribute Mage_Api2_Model_Acl_Filter_Attribute */ diff --git a/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php b/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php index 89f71a62a7372..07f5d720582fd 100644 --- a/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php +++ b/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php @@ -207,7 +207,7 @@ public function saveAction() /** @var $ruleTree Mage_Api2_Model_Acl_Global_Rule_Tree */ $ruleTree = Mage::getSingleton( 'Mage_Api2_Model_Acl_Global_Rule_Tree', - array('type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_PRIVILEGE) + array('options' => array('type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_PRIVILEGE)) ); $resources = $ruleTree->getPostResources(); $id = $role->getId(); diff --git a/app/code/core/Mage/Authorizenet/Block/Directpost/Form.php b/app/code/core/Mage/Authorizenet/Block/Directpost/Form.php index 355e2422e066e..fd3816d4ee63a 100644 --- a/app/code/core/Mage/Authorizenet/Block/Directpost/Form.php +++ b/app/code/core/Mage/Authorizenet/Block/Directpost/Form.php @@ -33,16 +33,7 @@ */ class Mage_Authorizenet_Block_Directpost_Form extends Mage_Payment_Block_Form_Cc { - /** - * Internal constructor - * Set info template for payment step - * - */ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('directpost/info.phtml'); - } + protected $_template = 'directpost/info.phtml'; /** * Render block HTML diff --git a/app/code/core/Mage/Backend/Block/Menu.php b/app/code/core/Mage/Backend/Block/Menu.php index 17a41125e4ea9..fe0cc39d8d6cd 100644 --- a/app/code/core/Mage/Backend/Block/Menu.php +++ b/app/code/core/Mage/Backend/Block/Menu.php @@ -195,7 +195,7 @@ protected function _renderAnchor($menuItem, $level) */ protected function _getMenuIterator($menu) { - return Mage::getModel('Mage_Backend_Model_Menu_Filter_Iterator', $menu->getIterator()); + return Mage::getModel('Mage_Backend_Model_Menu_Filter_Iterator', array('iterator' => $menu->getIterator())); } /** diff --git a/app/code/core/Mage/Backend/Block/Widget.php b/app/code/core/Mage/Backend/Block/Widget.php index d7577f3a88ab9..933b97fe8917c 100644 --- a/app/code/core/Mage/Backend/Block/Widget.php +++ b/app/code/core/Mage/Backend/Block/Widget.php @@ -86,8 +86,7 @@ protected function _addBreadcrumb($label, $title=null, $link=null) * @return string */ public function getButtonHtml($label, $onclick, $class='', $id=null) { - //@todo: Add UI id to button - return $this->getLayout()->createBlock('Mage_Backend_Block_Widget_Button', $this->getNameInLayout() .'.'. '-button') + return $this->getLayout()->createBlock('Mage_Backend_Block_Widget_Button') ->setData(array( 'label' => $label, 'onclick' => $onclick, diff --git a/app/code/core/Mage/Backend/Block/Widget/Accordion.php b/app/code/core/Mage/Backend/Block/Widget/Accordion.php index 1046bfcc074f5..211611390d4f9 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Accordion.php +++ b/app/code/core/Mage/Backend/Block/Widget/Accordion.php @@ -34,12 +34,12 @@ class Mage_Backend_Block_Widget_Accordion extends Mage_Backend_Block_Widget { protected $_items = array(); - public function __construct() - { - parent::__construct(); - $this->setTemplate('Mage_Backend::widget/accordion.phtml'); - } - + + /** + * @var string + */ + protected $_template = 'Mage_Backend::widget/accordion.phtml'; + public function getItems() { return $this->_items; diff --git a/app/code/core/Mage/Backend/Block/Widget/Accordion/Item.php b/app/code/core/Mage/Backend/Block/Widget/Accordion/Item.php index 6b25ab3ac87db..1683aee55d2e5 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Accordion/Item.php +++ b/app/code/core/Mage/Backend/Block/Widget/Accordion/Item.php @@ -35,11 +35,6 @@ class Mage_Backend_Block_Widget_Accordion_Item extends Mage_Backend_Block_Widget { protected $_accordion; - public function __construct() - { - parent::__construct(); - } - public function setAccordion($accordion) { $this->_accordion = $accordion; diff --git a/app/code/core/Mage/Backend/Block/Widget/Breadcrumbs.php b/app/code/core/Mage/Backend/Block/Widget/Breadcrumbs.php index 0166cd77eb78f..0144224ae547c 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Breadcrumbs.php +++ b/app/code/core/Mage/Backend/Block/Widget/Breadcrumbs.php @@ -40,9 +40,12 @@ class Mage_Backend_Block_Widget_Breadcrumbs extends Mage_Backend_Block_Template */ protected $_links = array(); - public function __construct() + protected $_template = 'Mage_Backend::widget/breadcrumbs.phtml'; + + + protected function _construct() { - $this->setTemplate('Mage_Backend::widget/breadcrumbs.phtml'); + $this->addLink(Mage::helper('Mage_Backend_Helper_Data')->__('Home'), Mage::helper('Mage_Backend_Helper_Data')->__('Home'), $this->getUrl('*')); } diff --git a/app/code/core/Mage/Backend/Block/Widget/Form.php b/app/code/core/Mage/Backend/Block/Widget/Form.php index 149f5627b0871..0fc5a243d7ac1 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Form.php +++ b/app/code/core/Mage/Backend/Block/Widget/Form.php @@ -41,6 +41,8 @@ class Mage_Backend_Block_Widget_Form extends Mage_Backend_Block_Widget */ protected $_form; + protected $_template = 'Mage_Backend::widget/form.phtml'; + /** * Class constructor * @@ -48,7 +50,7 @@ class Mage_Backend_Block_Widget_Form extends Mage_Backend_Block_Widget protected function _construct() { parent::_construct(); - $this->setTemplate('Mage_Backend::widget/form.phtml'); + $this->setDestElementId('edit_form'); $this->setShowGlobalIcon(false); } @@ -134,7 +136,7 @@ protected function _prepareForm() /** * This method is called before rendering HTML * - * @return Mage_Backend_Block_Widget_Form + * @return Mage_Backend_Block_Widget_Form|Mage_Core_Block_Abstract */ protected function _beforeToHtml() { diff --git a/app/code/core/Mage/Backend/Block/Widget/Form/Container.php b/app/code/core/Mage/Backend/Block/Widget/Form/Container.php index 449223d692af8..6399842b6142b 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Form/Container.php +++ b/app/code/core/Mage/Backend/Block/Widget/Form/Container.php @@ -40,13 +40,12 @@ class Mage_Backend_Block_Widget_Form_Container extends Mage_Backend_Block_Widget protected $_mode = 'edit'; protected $_blockGroup = 'Mage_Backend'; - public function __construct() - { - parent::__construct(); + protected $_template = 'Mage_Backend::widget/form/container.phtml'; - if (!$this->hasData('template')) { - $this->setTemplate('Mage_Backend::widget/form/container.phtml'); - } + + protected function _construct() + { + parent::_construct(); $this->_addButton('back', array( 'label' => Mage::helper('Mage_Backend_Helper_Data')->__('Back'), diff --git a/app/code/core/Mage/Backend/Block/Widget/Form/Element.php b/app/code/core/Mage/Backend/Block/Widget/Form/Element.php index 416d8f9ad14a6..d781c9eb56e31 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Form/Element.php +++ b/app/code/core/Mage/Backend/Block/Widget/Form/Element.php @@ -37,11 +37,7 @@ class Mage_Backend_Block_Widget_Form_Element extends Mage_Backend_Block_Template protected $_form; protected $_formBlock; - public function __construct() - { - parent::__construct(); - $this->setTemplate('Mage_Backend::widget/form/element.phtml'); - } + protected $_template = 'Mage_Backend::widget/form/element.phtml'; public function setElement($element) { diff --git a/app/code/core/Mage/Backend/Block/Widget/Form/Element/Gallery.php b/app/code/core/Mage/Backend/Block/Widget/Form/Element/Gallery.php index 3ad257c9316e2..47f7a851f589b 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Form/Element/Gallery.php +++ b/app/code/core/Mage/Backend/Block/Widget/Form/Element/Gallery.php @@ -37,10 +37,7 @@ class Mage_Backend_Block_Widget_Form_Element_Gallery extends Mage_Backend_Block_ protected $_element = null; - public function __construct() - { - $this->setTemplate('Mage_Backend::widget/form/element/gallery.phtml'); - } + protected $_template = 'Mage_Backend::widget/form/element/gallery.phtml'; public function render(Varien_Data_Form_Element_Abstract $element) { diff --git a/app/code/core/Mage/Backend/Block/Widget/Form/Renderer/Element.php b/app/code/core/Mage/Backend/Block/Widget/Form/Renderer/Element.php index c1665f2583d41..8d14542c1f798 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Form/Renderer/Element.php +++ b/app/code/core/Mage/Backend/Block/Widget/Form/Renderer/Element.php @@ -36,10 +36,7 @@ class Mage_Backend_Block_Widget_Form_Renderer_Element extends Mage_Backend_Block { protected $_element; - protected function _construct() - { - $this->setTemplate('Mage_Backend::widget/form/renderer/element.phtml'); - } + protected $_template = 'Mage_Backend::widget/form/renderer/element.phtml'; public function getElement() { diff --git a/app/code/core/Mage/Backend/Block/Widget/Form/Renderer/Fieldset.php b/app/code/core/Mage/Backend/Block/Widget/Form/Renderer/Fieldset.php index 1aef1a19cda38..4f5e290920fc5 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Form/Renderer/Fieldset.php +++ b/app/code/core/Mage/Backend/Block/Widget/Form/Renderer/Fieldset.php @@ -36,10 +36,7 @@ class Mage_Backend_Block_Widget_Form_Renderer_Fieldset extends Mage_Backend_Bloc { protected $_element; - protected function _construct() - { - $this->setTemplate('Mage_Backend::widget/form/renderer/fieldset.phtml'); - } + protected $_template = 'Mage_Backend::widget/form/renderer/fieldset.phtml'; public function getElement() { diff --git a/app/code/core/Mage/Backend/Block/Widget/Form/Renderer/Fieldset/Element.php b/app/code/core/Mage/Backend/Block/Widget/Form/Renderer/Fieldset/Element.php index 751b80adf8aa0..b6983eb781aed 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Form/Renderer/Fieldset/Element.php +++ b/app/code/core/Mage/Backend/Block/Widget/Form/Renderer/Fieldset/Element.php @@ -36,10 +36,7 @@ class Mage_Backend_Block_Widget_Form_Renderer_Fieldset_Element extends Mage_Back { protected $_element; - protected function _construct() - { - $this->setTemplate('Mage_Backend::widget/form/renderer/fieldset/element.phtml'); - } + protected $_template = 'Mage_Backend::widget/form/renderer/fieldset/element.phtml'; public function getElement() { diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid.php b/app/code/core/Mage/Backend/Block/Widget/Grid.php index 8da4ae8123089..8f29673d9a399 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid.php @@ -29,7 +29,10 @@ * * @category Mage * @package Mage_Backend - * @author Magento Core Team + * @author Magento Core Team + * + * @method string getRowClickCallback() getRowClickCallback() + * @method Mage_Backend_Block_Widget_Grid setRowClickCallback() setRowClickCallback(string $value) */ class Mage_Backend_Block_Widget_Grid extends Mage_Backend_Block_Widget { @@ -106,14 +109,41 @@ class Mage_Backend_Block_Widget_Grid extends Mage_Backend_Block_Widget */ protected $_rssLists = array(); + protected $_template = 'Mage_Backend::widget/grid.phtml'; + /** + * @param Mage_Core_Controller_Request_Http $request + * @param Mage_Core_Model_Layout $layout + * @param Mage_Core_Model_Event_Manager $eventManager + * @param Mage_Core_Model_Translate $translator + * @param Mage_Core_Model_Cache $cache + * @param Mage_Core_Model_Design_Package $designPackage + * @param Mage_Core_Model_Session $session + * @param Mage_Core_Model_Store_Config $storeConfig + * @param Mage_Core_Controller_Varien_Front $frontController * @param array $data - */ - public function __construct(array $data = array()) - { - parent::__construct($data); - $this->setTemplate('Mage_Backend::widget/grid.phtml'); - $this->setRowClickCallback('openGridRow'); + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) + */ + public function __construct( + Mage_Core_Controller_Request_Http $request, + Mage_Core_Model_Layout $layout, + Mage_Core_Model_Event_Manager $eventManager, + Mage_Core_Model_Translate $translator, + Mage_Core_Model_Cache $cache, + Mage_Core_Model_Design_Package $designPackage, + Mage_Core_Model_Session $session, + Mage_Core_Model_Store_Config $storeConfig, + Mage_Core_Controller_Varien_Front $frontController, + array $data = array() + ) { + parent::__construct($request, $layout, $eventManager, $translator, $cache, $designPackage, $session, + $storeConfig, $frontController, $data + ); + + if (!$this->getRowClickCallback()) { + $this->setRowClickCallback('openGridRow'); + } $this->setData( 'filter_visibility', diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column.php index f9036759ae83d..1dc3737d3b5f8 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column.php @@ -63,7 +63,7 @@ class Mage_Backend_Block_Widget_Grid_Column extends Mage_Backend_Block_Widget /** * Renderer types - * + * * @var array */ protected $_rendererTypes; @@ -75,12 +75,7 @@ class Mage_Backend_Block_Widget_Grid_Column extends Mage_Backend_Block_Widget */ protected $_filterTypes; - /** - * Block constructor - * - * @param array $data - */ - public function __construct($data = array()) + public function _construct() { $this->_rendererTypes = array( 'date' => 'Mage_Backend_Block_Widget_Grid_Column_Renderer_Date', @@ -120,7 +115,7 @@ public function __construct($data = array()) 'default' => 'Mage_Backend_Block_Widget_Grid_Column_Filter_Text', ); - parent::__construct($data); + parent::_construct(); } /** diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Multistore.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Multistore.php index 7c4d29ac84446..85f6e3385c080 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Multistore.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Multistore.php @@ -1,5 +1,5 @@ - - */ -class Mage_Backend_Block_Widget_Grid_Column_Multistore extends Mage_Backend_Block_Widget_Grid_Column -{ - /** - * Application - * - * @var Mage_Core_Model_App - */ - protected $_app; - - /** - * @param array $data - */ - public function __construct(array $data = array()) - { - $this->_app = isset($data['app']) ? $data['app'] : Mage::app(); - parent::__construct($data); - } - - /** - * Get header css class name - * - * @return string - */ - public function isDisplayed() - { - return !$this->_app->isSingleStoreMode(); - } -} + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backend + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Grid column block that is displayed only in multistore mode + * + * @category Mage + * @package Mage_Backend + * @author Magento Core Team + */ +class Mage_Backend_Block_Widget_Grid_Column_Multistore extends Mage_Backend_Block_Widget_Grid_Column +{ + /** + * Application + * + * @var Mage_Core_Model_App + */ + protected $_app; + + /** + * @param Mage_Core_Controller_Request_Http $request + * @param Mage_Core_Model_Layout $layout + * @param Mage_Core_Model_Event_Manager $eventManager + * @param Mage_Core_Model_Translate $translator + * @param Mage_Core_Model_Cache $cache + * @param Mage_Core_Model_Design_Package $designPackage + * @param Mage_Core_Model_Session $session + * @param Mage_Core_Model_Store_Config $storeConfig + * @param Mage_Core_Controller_Varien_Front $frontController + * @param Mage_Core_Model_App $app + * @param array $data + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) + */ + public function __construct( + Mage_Core_Controller_Request_Http $request, + Mage_Core_Model_Layout $layout, + Mage_Core_Model_Event_Manager $eventManager, + Mage_Core_Model_Translate $translator, + Mage_Core_Model_Cache $cache, + Mage_Core_Model_Design_Package $designPackage, + Mage_Core_Model_Session $session, + Mage_Core_Model_Store_Config $storeConfig, + Mage_Core_Controller_Varien_Front $frontController, + Mage_Core_Model_App $app, + array $data = array() + ) { + parent::__construct($request, $layout, $eventManager, $translator, $cache, $designPackage, $session, + $storeConfig, $frontController, $data + ); + + $this->_app = $app; + } + + /** + * Get header css class name + * + * @return string + */ + public function isDisplayed() + { + return !$this->_app->isSingleStoreMode(); + } +} diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/ColumnSet.php b/app/code/core/Mage/Backend/Block/Widget/Grid/ColumnSet.php index ff8b333fe8ef8..e6afd670b98fd 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/ColumnSet.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/ColumnSet.php @@ -24,6 +24,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +/** + * + * @category Mage + * @package Mage_Core + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class Mage_Backend_Block_Widget_Grid_ColumnSet extends Mage_Core_Block_Template { /** @@ -98,47 +104,60 @@ class Mage_Backend_Block_Widget_Grid_ColumnSet extends Mage_Core_Block_Template protected $_isCollapsed; /** - * @SuppressWarnings(PHPMD.NPathComplexity) - * @throws InvalidArgumentException - * @param array $data + * Path to template file in theme + * + * @var string */ - public function __construct(array $data = array()) - { - $this->_helper = isset($data['helper']) ? $data['helper'] : Mage::helper('Mage_Backend_Helper_Data'); - unset($data['helper']); - - if (false === ($this->_helper instanceof Mage_Core_Helper_Abstract)) { - throw new InvalidArgumentException('Passed wrong parameters'); - } + protected $_template = 'Mage_Backend::widget/grid/column_set.phtml'; + /** + * @param Mage_Core_Controller_Request_Http $request + * @param Mage_Core_Model_Layout $layout + * @param Mage_Core_Model_Event_Manager $eventManager + * @param Mage_Core_Model_Translate $translator + * @param Mage_Core_Model_Cache $cache + * @param Mage_Core_Model_Design_Package $designPackage + * @param Mage_Core_Model_Session $session + * @param Mage_Core_Model_Store_Config $storeConfig + * @param Mage_Core_Controller_Varien_Front $frontController + * @param Mage_Backend_Helper_Data $helper + * @param Mage_Backend_Model_Widget_Grid_Row_UrlGeneratorFactory $generatorFactory + * @param array $data + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) + */ + public function __construct( + Mage_Core_Controller_Request_Http $request, + Mage_Core_Model_Layout $layout, + Mage_Core_Model_Event_Manager $eventManager, + Mage_Core_Model_Translate $translator, + Mage_Core_Model_Cache $cache, + Mage_Core_Model_Design_Package $designPackage, + Mage_Core_Model_Session $session, + Mage_Core_Model_Store_Config $storeConfig, + Mage_Core_Controller_Varien_Front $frontController, + Mage_Backend_Helper_Data $helper, + Mage_Backend_Model_Widget_Grid_Row_UrlGeneratorFactory $generatorFactory, + array $data = array() + ) { + $this->_helper = $helper; + + $generatorClassName = 'Mage_Backend_Model_Widget_Grid_Row_UrlGenerator'; if (isset($data['rowUrl'])) { $rowUrlParams = $data['rowUrl']; - if (isset($rowUrlParams['generator'])) { - $this->_rowUrlGenerator = $rowUrlParams['generator']; - } else { - $generatorClassName = 'Mage_Backend_Model_Widget_Grid_Row_UrlGenerator'; - if (isset($data['generatorClass'])) { - $generatorClassName = $rowUrlParams['generatorClass']; - } - $objectFactory = isset($data['objectFactory']) ? $data['objectFactory'] : Mage::app()->getConfig(); - if (false === ($objectFactory instanceof Mage_Core_Model_Config)) { - throw new InvalidArgumentException('Passed wrong parameters'); - } - unset($data['objectFactory']); - $this->_rowUrlGenerator = $objectFactory->getModelInstance($generatorClassName, $rowUrlParams); - } - - if (false === ($this->_rowUrlGenerator instanceof Mage_Backend_Model_Widget_Grid_Row_UrlGenerator)) { - throw new InvalidArgumentException('Passed wrong parameters'); + if (isset($rowUrlParams['generatorClass'])) { + $generatorClassName = $rowUrlParams['generatorClass']; } + $this->_rowUrlGenerator + = $generatorFactory->createUrlGenerator($generatorClassName, array('args' => $rowUrlParams)); } - parent::__construct($data); - $this->setTemplate('Mage_Backend::widget/grid/column_set.phtml'); + parent::__construct($request, $layout, $eventManager, $translator, $cache, $designPackage, $session, + $storeConfig, $frontController, $data + ); $this->setEmptyText($this->_helper->__('No records found.')); } - /** * Retrieve the list of columns * diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Container.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Container.php index cfb1142468ad8..655d0b440e22f 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Container.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Container.php @@ -39,7 +39,10 @@ class Mage_Backend_Block_Widget_Grid_Container extends Mage_Backend_Block_Widget protected $_backButtonLabel; protected $_blockGroup = 'Mage_Backend'; - public function __construct() + protected $_template = 'Mage_Backend::widget/grid/container.phtml'; + + + protected function _construct() { if (is_null($this->_addButtonLabel)) { $this->_addButtonLabel = $this->__('Add New'); @@ -48,9 +51,9 @@ public function __construct() $this->_backButtonLabel = $this->__('Back'); } - parent::__construct(); + parent::_construct(); + - $this->setTemplate('Mage_Backend::widget/grid/container.phtml'); $this->_addButton('add', array( 'label' => $this->getAddButtonLabel(), diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Export.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Export.php index 401e5eddd0dea..ae863f8714802 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Export.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Export.php @@ -24,6 +24,9 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class Mage_Backend_Block_Widget_Grid_Export extends Mage_Backend_Block_Widget implements Mage_Backend_Block_Widget_Grid_ExportInterface @@ -50,10 +53,35 @@ class Mage_Backend_Block_Widget_Grid_Export protected $_template = "Mage_Backend::widget/grid/export.phtml"; /** + * @param Mage_Core_Controller_Request_Http $request + * @param Mage_Core_Model_Layout $layout + * @param Mage_Core_Model_Event_Manager $eventManager + * @param Mage_Core_Model_Translate $translator + * @param Mage_Core_Model_Cache $cache + * @param Mage_Core_Model_Design_Package $designPackage + * @param Mage_Core_Model_Session $session + * @param Mage_Core_Model_Store_Config $storeConfig + * @param Mage_Core_Controller_Varien_Front $frontController * @param array $data + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ - public function __construct(array $data = array()) - { + public function __construct( + Mage_Core_Controller_Request_Http $request, + Mage_Core_Model_Layout $layout, + Mage_Core_Model_Event_Manager $eventManager, + Mage_Core_Model_Translate $translator, + Mage_Core_Model_Cache $cache, + Mage_Core_Model_Design_Package $designPackage, + Mage_Core_Model_Session $session, + Mage_Core_Model_Store_Config $storeConfig, + Mage_Core_Controller_Varien_Front $frontController, + array $data = array() + ) { + parent::__construct($request, $layout, $eventManager, $translator, $cache, $designPackage, $session, + $storeConfig, $frontController, $data + ); + if (isset($data['exportTypes'])) { foreach ($data['exportTypes'] as $type) { if (!isset($type['urlPath']) || !isset($type['label'])) { @@ -62,7 +90,6 @@ public function __construct(array $data = array()) $this->addExportType($type['urlPath'], $type['label']); } } - parent::__construct($data); } /** diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Extended.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Extended.php index 2cecaae60905b..19a6fe3c51391 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Extended.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Extended.php @@ -152,7 +152,7 @@ class Mage_Backend_Block_Widget_Grid_Extended /* * @var boolean */ - public $_isCollapsed; + protected $_isCollapsed; /** * Count subtotals @@ -168,13 +168,14 @@ class Mage_Backend_Block_Widget_Grid_Extended */ protected $_subtotals = array(); - public function __construct(array $data = array()) + protected $_template = 'Mage_Backend::widget/grid/extended.phtml'; + + protected function _construct() { - parent::__construct($data); - $this->setTemplate('Mage_Backend::widget/grid/extended.phtml'); + parent::_construct(); $this->_emptyText = Mage::helper('Mage_Backend_Helper_Data')->__('No records found.'); } - + /** * Initialize child blocks * @@ -185,25 +186,25 @@ protected function _prepareLayout() $this->setChild('export_button', $this->getLayout()->createBlock('Mage_Backend_Block_Widget_Button') ->setData(array( - 'label' => Mage::helper('Mage_Backend_Helper_Data')->__('Export'), - 'onclick' => $this->getJsObjectName().'.doExport()', - 'class' => 'task' - )) + 'label' => Mage::helper('Mage_Backend_Helper_Data')->__('Export'), + 'onclick' => $this->getJsObjectName().'.doExport()', + 'class' => 'task' + )) ); $this->setChild('reset_filter_button', $this->getLayout()->createBlock('Mage_Backend_Block_Widget_Button') ->setData(array( - 'label' => Mage::helper('Mage_Backend_Helper_Data')->__('Reset Filter'), - 'onclick' => $this->getJsObjectName().'.resetFilter()', - )) + 'label' => Mage::helper('Mage_Backend_Helper_Data')->__('Reset Filter'), + 'onclick' => $this->getJsObjectName().'.resetFilter()', + )) ); $this->setChild('search_button', $this->getLayout()->createBlock('Mage_Backend_Block_Widget_Button') ->setData(array( - 'label' => Mage::helper('Mage_Backend_Helper_Data')->__('Search'), - 'onclick' => $this->getJsObjectName().'.doFilter()', - 'class' => 'task' - )) + 'label' => Mage::helper('Mage_Backend_Helper_Data')->__('Search'), + 'onclick' => $this->getJsObjectName().'.doFilter()', + 'class' => 'task' + )) ); return parent::_prepareLayout(); } @@ -407,14 +408,14 @@ protected function _prepareMassactionColumn() { $columnId = 'massaction'; $massactionColumn = $this->getLayout()->createBlock('Mage_Backend_Block_Widget_Grid_Column') - ->setData(array( - 'index' => $this->getMassactionIdField(), - 'filter_index' => $this->getMassactionIdFilter(), - 'type' => 'massaction', - 'name' => $this->getMassactionBlock()->getFormFieldName(), - 'align' => 'center', - 'is_system' => true - )); + ->setData(array( + 'index' => $this->getMassactionIdField(), + 'filter_index' => $this->getMassactionIdFilter(), + 'type' => 'massaction', + 'name' => $this->getMassactionBlock()->getFormFieldName(), + 'align' => 'center', + 'is_system' => true + )); if ($this->getNoFilterMassactionColumn()) { $massactionColumn->setData('filter', false); diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Massaction/Abstract.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Massaction/Abstract.php index 109539c78f4b6..179b285989db6 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Massaction/Abstract.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Massaction/Abstract.php @@ -35,6 +35,13 @@ */ abstract class Mage_Backend_Block_Widget_Grid_Massaction_Abstract extends Mage_Backend_Block_Widget { + /** + * Backend data helper + * + * @var Mage_Backend_Helper_Data + */ + protected $_backendHelper; + /** * Massaction items * @@ -42,26 +49,48 @@ abstract class Mage_Backend_Block_Widget_Grid_Massaction_Abstract extends Mage_B */ protected $_items = array(); + protected $_template = 'Mage_Backend::widget/grid/massaction.phtml'; + /** - * Backend helper + * @param Mage_Core_Controller_Request_Http $request + * @param Mage_Core_Model_Layout $layout + * @param Mage_Core_Model_Event_Manager $eventManager + * @param Mage_Core_Model_Translate $translator + * @param Mage_Core_Model_Cache $cache + * @param Mage_Core_Model_Design_Package $designPackage + * @param Mage_Core_Model_Session $session + * @param Mage_Core_Model_Store_Config $storeConfig + * @param Mage_Core_Controller_Varien_Front $frontController + * @param Mage_Backend_Helper_Data $backendHelper + * @param array $data * - * @var Mage_Backend_Helper_Data + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ - protected $_helper; + public function __construct( + Mage_Core_Controller_Request_Http $request, + Mage_Core_Model_Layout $layout, + Mage_Core_Model_Event_Manager $eventManager, + Mage_Core_Model_Translate $translator, + Mage_Core_Model_Cache $cache, + Mage_Core_Model_Design_Package $designPackage, + Mage_Core_Model_Session $session, + Mage_Core_Model_Store_Config $storeConfig, + Mage_Core_Controller_Varien_Front $frontController, + Mage_Backend_Helper_Data $backendHelper, + array $data = array() + ) { + $this->_backendHelper = $backendHelper; + + parent::__construct($request, $layout, $eventManager, $translator, $cache, $designPackage, $session, + $storeConfig, $frontController, $data + ); + } - /** - * Sets Massaction template - */ - public function __construct(array $data = array()) + protected function _construct() { - parent::__construct($data); - $this->setTemplate('Mage_Backend::widget/grid/massaction.phtml'); + parent::_construct(); - $this->_helper = isset($data['helper'])? $data['helper'] : Mage::helper('Mage_Backend_Helper_Data'); - if (!($this->_helper instanceof Mage_Backend_Helper_Data)) { - throw new InvalidArgumentException('Helper must be instance of Mage_Backend_Helper_Data'); - } - $this->setErrorText($this->_helper->jsQuoteEscape($this->_helper->__('Please select items.'))); + $this->setErrorText($this->_backendHelper->jsQuoteEscape($this->_backendHelper->__('Please select items.'))); if (null !== $this->getOptions()) { foreach ($this->getOptions() as $optionId => $option) { @@ -109,7 +138,7 @@ public function addItem($itemId, $item) */ public function getItem($itemId) { - if(isset($this->_items[$itemId])) { + if (isset($this->_items[$itemId])) { return $this->_items[$itemId]; } @@ -208,7 +237,7 @@ public function getGridJsObjectName() */ public function getSelectedJson() { - if($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) { + if ($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) { $selected = explode(',', $selected); return join(',', $selected); } else { @@ -223,7 +252,7 @@ public function getSelectedJson() */ public function getSelected() { - if($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) { + if ($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) { $selected = explode(',', $selected); return $selected; } else { @@ -244,13 +273,13 @@ public function getApplyButtonHtml() public function getJavaScript() { return " var {$this->getJsObjectName()} = new varienGridMassaction('{$this->getHtmlId()}', " - . "{$this->getGridJsObjectName()}, '{$this->getSelectedJson()}'" - . ", '{$this->getFormFieldNameInternal()}', '{$this->getFormFieldName()}');" - . "{$this->getJsObjectName()}.setItems({$this->getItemsJson()}); " - . "{$this->getJsObjectName()}.setGridIds('{$this->getGridIdsJson()}');" - . ($this->getUseAjax() ? "{$this->getJsObjectName()}.setUseAjax(true);" : '') - . ($this->getUseSelectAll() ? "{$this->getJsObjectName()}.setUseSelectAll(true);" : '') - . "{$this->getJsObjectName()}.errorText = '{$this->getErrorText()}';"; + . "{$this->getGridJsObjectName()}, '{$this->getSelectedJson()}'" + . ", '{$this->getFormFieldNameInternal()}', '{$this->getFormFieldName()}');" + . "{$this->getJsObjectName()}.setItems({$this->getItemsJson()}); " + . "{$this->getJsObjectName()}.setGridIds('{$this->getGridIdsJson()}');" + . ($this->getUseAjax() ? "{$this->getJsObjectName()}.setUseAjax(true);" : '') + . ($this->getUseSelectAll() ? "{$this->getJsObjectName()}.setUseSelectAll(true);" : '') + . "{$this->getJsObjectName()}.errorText = '{$this->getErrorText()}';"; } public function getGridIdsJson() @@ -261,7 +290,7 @@ public function getGridIdsJson() $gridIds = $this->getParentBlock()->getCollection()->getAllIds(); - if(!empty($gridIds)) { + if (!empty($gridIds)) { return join(",", $gridIds); } return ''; diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Massaction/Extended.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Massaction/Extended.php index cafd04227cb22..70b8a44225bd3 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Massaction/Extended.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Massaction/Extended.php @@ -43,14 +43,23 @@ class Mage_Backend_Block_Widget_Grid_Massaction_Extended extends Mage_Backend_Bl */ protected $_items = array(); + /** + * Path to template file in theme + * + * @var string + */ + protected $_template = 'Mage_Backend::widget/grid/massaction_extended.phtml'; + /** * Sets Massaction template */ - public function __construct() + public function _construct() { - parent::__construct(); - $this->setTemplate('Mage_Backend::widget/grid/massaction_extended.phtml'); - $this->setErrorText(Mage::helper('Mage_Backend_Helper_Data')->jsQuoteEscape(Mage::helper('Mage_Backend_Helper_Data')->__('Please select items.'))); + parent::_construct(); + $this->setErrorText( + Mage::helper('Mage_Backend_Helper_Data') + ->jsQuoteEscape(Mage::helper('Mage_Backend_Helper_Data')->__('Please select items.')) + ); } /** diff --git a/app/code/core/Mage/Backend/Block/Widget/Tabs.php b/app/code/core/Mage/Backend/Block/Widget/Tabs.php index 9049f838b9ec7..9e4c4cb18ddd0 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Tabs.php +++ b/app/code/core/Mage/Backend/Block/Widget/Tabs.php @@ -54,10 +54,7 @@ class Mage_Backend_Block_Widget_Tabs extends Mage_Backend_Block_Widget */ protected $_destElementId = 'content'; - protected function _construct() - { - $this->setTemplate('Mage_Backend::widget/tabs.phtml'); - } + protected $_template = 'Mage_Backend::widget/tabs.phtml'; /** * retrieve destination html element id diff --git a/app/code/core/Mage/Backend/Block/Widget/View/Container.php b/app/code/core/Mage/Backend/Block/Widget/View/Container.php index d69d66265b7f4..1f4caf2de2753 100644 --- a/app/code/core/Mage/Backend/Block/Widget/View/Container.php +++ b/app/code/core/Mage/Backend/Block/Widget/View/Container.php @@ -39,11 +39,12 @@ class Mage_Backend_Block_Widget_View_Container extends Mage_Backend_Block_Widget protected $_blockGroup = 'Mage_Backend'; - public function __construct() - { - parent::__construct(); + protected $_template = 'Mage_Backend::widget/view/container.phtml'; + - $this->setTemplate('Mage_Backend::widget/view/container.phtml'); + protected function _construct() + { + parent::_construct(); $this->_addButton('back', array( 'label' => Mage::helper('Mage_Backend_Helper_Data')->__('Back'), diff --git a/app/code/core/Mage/Backend/Controller/ActionAbstract.php b/app/code/core/Mage/Backend/Controller/ActionAbstract.php index a803177dfb6e0..9c4640c9f85c1 100644 --- a/app/code/core/Mage/Backend/Controller/ActionAbstract.php +++ b/app/code/core/Mage/Backend/Controller/ActionAbstract.php @@ -72,13 +72,17 @@ abstract class Mage_Backend_Controller_ActionAbstract extends Mage_Core_Controll * * @param Zend_Controller_Request_Abstract $request * @param Zend_Controller_Response_Abstract $response + * @param Magento_ObjectManager $objectManager + * @param Mage_Core_Controller_Varien_Front $frontController * @param array $invokeArgs */ public function __construct(Zend_Controller_Request_Abstract $request, - Zend_Controller_Response_Abstract $response, - array $invokeArgs = array() + Zend_Controller_Response_Abstract $response, + Magento_ObjectManager $objectManager, + Mage_Core_Controller_Varien_Front $frontController, + array $invokeArgs = array() ) { - parent::__construct($request, $response, $invokeArgs); + parent::__construct($request, $response, $objectManager, $frontController, $invokeArgs); $this->_helper = isset($invokeArgs['helper']) ? $invokeArgs['helper'] : diff --git a/app/code/core/Mage/Backend/Controller/Router/Default.php b/app/code/core/Mage/Backend/Controller/Router/Default.php index 8df4b0aa06bad..542ccdbb2556e 100644 --- a/app/code/core/Mage/Backend/Controller/Router/Default.php +++ b/app/code/core/Mage/Backend/Controller/Router/Default.php @@ -52,9 +52,9 @@ class Mage_Backend_Controller_Router_Default extends Mage_Core_Controller_Varien * @param array $options * @throws InvalidArgumentException */ - public function __construct(array $options = array()) + public function __construct(Magento_ObjectManager $objectManager, array $options = array()) { - parent::__construct($options); + parent::__construct($objectManager, $options); $this->_areaFrontName = Mage::helper('Mage_Backend_Helper_Data')->getAreaFrontName(); if (empty($this->_areaFrontName)) { throw new InvalidArgumentException('Area Front Name should be defined'); diff --git a/app/code/core/Mage/Backend/Helper/Data.php b/app/code/core/Mage/Backend/Helper/Data.php index 34a7798ffeb07..05154cad0390c 100644 --- a/app/code/core/Mage/Backend/Helper/Data.php +++ b/app/code/core/Mage/Backend/Helper/Data.php @@ -44,13 +44,9 @@ class Mage_Backend_Helper_Data extends Mage_Core_Helper_Abstract /** * @param array $data */ - public function __construct(array $data = array()) + public function __construct(Mage_Core_Model_Config $applicationConfig) { - $this->_config = isset($data['config']) ? $data['config'] : Mage::getConfig(); - - if (false == ($this->_config instanceof Mage_Core_Model_Config)) { - throw new InvalidArgumentException("Required config object is invalid"); - } + $this->_config = $applicationConfig; } public function getPageHelpUrl() diff --git a/app/code/core/Mage/Backend/Model/Acl/Config.php b/app/code/core/Mage/Backend/Model/Acl/Config.php index 0ccf9fb08a011..45f73385103ec 100644 --- a/app/code/core/Mage/Backend/Model/Acl/Config.php +++ b/app/code/core/Mage/Backend/Model/Acl/Config.php @@ -80,7 +80,9 @@ protected function _getReader() { if (null === $this->_reader) { $aclResourceFiles = $this->_getAclResourceFiles(); - $this->_reader = $this->_config->getModelInstance('Magento_Acl_Config_Reader', $aclResourceFiles); + $this->_reader = $this->_config->getModelInstance('Magento_Acl_Config_Reader', + array('configFiles' => $aclResourceFiles) + ); } return $this->_reader; } @@ -88,7 +90,7 @@ protected function _getReader() /** * Return ACL Resources loaded from cache if enabled or from files merged previously * - * @return DOMDocument + * @return DOMNodeList */ public function getAclResources() { diff --git a/app/code/core/Mage/Backend/Model/Acl/Loader/Resource.php b/app/code/core/Mage/Backend/Model/Acl/Loader/Resource.php index 24b787108738f..dcff1fdc19aba 100644 --- a/app/code/core/Mage/Backend/Model/Acl/Loader/Resource.php +++ b/app/code/core/Mage/Backend/Model/Acl/Loader/Resource.php @@ -76,7 +76,7 @@ protected function _addResourceTree(Magento_Acl $acl, DOMNodeList $resources, Ma /** @var $resource Magento_Acl_Resource */ $resource = $this->_objectFactory->getModelInstance( 'Magento_Acl_Resource', - $resourceConfig->getAttribute('id') + array('resourceId' => $resourceConfig->getAttribute('id')) ); $acl->addResource($resource, $parent); if ($resourceConfig->hasChildNodes()) { diff --git a/app/code/core/Mage/Backend/Model/Auth.php b/app/code/core/Mage/Backend/Model/Auth.php index ea6cfca12de0b..5cd0b75e0b8b7 100644 --- a/app/code/core/Mage/Backend/Model/Auth.php +++ b/app/code/core/Mage/Backend/Model/Auth.php @@ -44,6 +44,18 @@ class Mage_Backend_Model_Auth */ protected $_credentialStorage = null; + /** + * @param Mage_Backend_Model_Auth_StorageInterface $authStorage + * @param Mage_Backend_Model_Auth_Credential_StorageInterface $credentialStorage + */ + public function __construct( + Mage_Backend_Model_Auth_StorageInterface $authStorage, + Mage_Backend_Model_Auth_Credential_StorageInterface $credentialStorage + ) { + $this->_authStorage = $authStorage; + $this->_credentialStorage = $credentialStorage; + } + /** * Set auth storage if it is instance of Mage_Backend_Model_Auth_StorageInterface * @@ -68,9 +80,6 @@ public function setAuthStorage($storage) */ public function getAuthStorage() { - if (is_null($this->_authStorage)) { - $this->_authStorage = Mage::getSingleton('Mage_Backend_Model_Auth_Session'); - } return $this->_authStorage; } @@ -113,9 +122,6 @@ protected function _initCredentialStorage() */ public function getCredentialStorage() { - if (is_null($this->_credentialStorage)) { - $this->_initCredentialStorage(); - } return $this->_credentialStorage; } diff --git a/app/code/core/Mage/Backend/Model/Auth/Session.php b/app/code/core/Mage/Backend/Model/Auth/Session.php index 4f15cd63bfd29..fff8e59bd5305 100644 --- a/app/code/core/Mage/Backend/Model/Auth/Session.php +++ b/app/code/core/Mage/Backend/Model/Auth/Session.php @@ -62,8 +62,7 @@ public function __construct(array $data = array()) } else { $areaConfig = Mage::getConfig()->getAreaConfig(Mage::helper('Mage_Backend_Helper_Data')->getAreaCode()); $this->_aclBuilder = Mage::getSingleton('Mage_Core_Model_Acl_Builder', array( - 'areaConfig' => $areaConfig, - 'objectFactory' => Mage::getConfig() + 'data' => array('areaConfig' => $areaConfig, 'objectFactory' => Mage::getConfig()) )); } $this->init('admin'); diff --git a/app/code/core/Mage/Backend/Model/Menu.php b/app/code/core/Mage/Backend/Model/Menu.php index b169e69630668..1558de26b045c 100644 --- a/app/code/core/Mage/Backend/Model/Menu.php +++ b/app/code/core/Mage/Backend/Model/Menu.php @@ -42,22 +42,16 @@ class Mage_Backend_Model_Menu extends ArrayObject protected $_logger; /** - * @param array $array + * @param Mage_Core_Model_Logger $logger + * @param string $pathInMenuStructure */ - public function __construct($array = array()) + public function __construct(Mage_Core_Model_Logger $logger, $pathInMenuStructure = '') { - if (isset($array['path'])) { - $this->_path = $array['path'] . '/'; - unset($array['path']); - } - if (isset($array['logger'])) { - $this->_logger = $array['logger']; - unset($array['logger']); - } else { - throw new InvalidArgumentException('Logger object is a required parameter'); + if ($pathInMenuStructure) { + $this->_path = $pathInMenuStructure . '/'; } + $this->_logger = $logger; $this->setIteratorClass('Mage_Backend_Model_Menu_Iterator'); - parent::__construct($array); } /** diff --git a/app/code/core/Mage/Backend/Model/Menu/Builder.php b/app/code/core/Mage/Backend/Model/Menu/Builder.php index b0e561e67208b..74e9eb7b88e30 100644 --- a/app/code/core/Mage/Backend/Model/Menu/Builder.php +++ b/app/code/core/Mage/Backend/Model/Menu/Builder.php @@ -48,20 +48,15 @@ class Mage_Backend_Model_Menu_Builder protected $_menu; /** - * @param array $data - * @throws InvalidArgumentException + * @param Mage_Backend_Model_Menu_Item_Factory $menuItemFactory + * @param Mage_Backend_Model_Menu $menu */ - public function __construct(array $data = array()) - { - if (!isset($data['itemFactory']) || !($data['itemFactory'] instanceof Mage_Backend_Model_Menu_Item_Factory)) { - throw new InvalidArgumentException('Wrong item factory provided'); - } - $this->_itemFactory = $data['itemFactory']; - - if (!isset($data['menu']) || !($data['menu'] instanceof Mage_Backend_Model_Menu)) { - throw new InvalidArgumentException(); - } - $this->_menu = $data['menu']; + public function __construct( + Mage_Backend_Model_Menu_Item_Factory $menuItemFactory, + Mage_Backend_Model_Menu $menu + ) { + $this->_itemFactory = $menuItemFactory; + $this->_menu = $menu; } /** diff --git a/app/code/core/Mage/Backend/Model/Menu/Config.php b/app/code/core/Mage/Backend/Model/Menu/Config.php index 449a38218abaf..6bfc5e0f2c10d 100644 --- a/app/code/core/Mage/Backend/Model/Menu/Config.php +++ b/app/code/core/Mage/Backend/Model/Menu/Config.php @@ -33,6 +33,11 @@ class Mage_Backend_Model_Menu_Config */ protected $_cache; + /** + * @var Magento_ObjectManager + */ + protected $_factory; + /** * @var Mage_Core_Model_Config */ @@ -59,20 +64,28 @@ class Mage_Backend_Model_Menu_Config */ protected $_logger; - public function __construct(array $arguments = array()) - { - $this->_cache = isset($arguments['cache']) ? $arguments['cache'] : Mage::app()->getCacheInstance(); - $this->_appConfig = isset($arguments['appConfig']) ? $arguments['appConfig'] : Mage::getConfig(); - $this->_eventManager = isset($arguments['eventManager']) - ? $arguments['eventManager'] - : Mage::getSingleton('Mage_Core_Model_Event_Manager'); - - $this->_logger = isset($arguments['logger']) - ? $arguments['logger'] - : Mage::getSingleton('Mage_Backend_Model_Menu_Logger'); - - $this->_menuFactory = isset($arguments['menuFactory']) ? $arguments['menuFactory'] : - Mage::getSingleton('Mage_Backend_Model_Menu_Factory'); + /** + * @param Mage_Core_Model_Cache $cache + * @param Magento_ObjectManager $factory + * @param Mage_Core_Model_Config $config + * @param Mage_Core_Model_Event_Manager $eventManager + * @param Mage_Backend_Model_Menu_Logger $menuLogger + * @param Mage_Backend_Model_Menu_Factory $menuFactory + */ + public function __construct( + Mage_Core_Model_Cache $cache, + Magento_ObjectManager $factory, + Mage_Core_Model_Config $config, + Mage_Core_Model_Event_Manager $eventManager, + Mage_Backend_Model_Menu_Logger $menuLogger, + Mage_Backend_Model_Menu_Factory $menuFactory + ) { + $this->_cache = $cache; + $this->_factory = $factory; + $this->_appConfig = $config; + $this->_eventManager = $eventManager; + $this->_logger = $menuLogger; + $this->_menuFactory = $menuFactory; } /** @@ -119,18 +132,18 @@ protected function _initMenu() } /* @var $director Mage_Backend_Model_Menu_Builder */ - $menuBuilder = $this->_appConfig->getModelInstance('Mage_Backend_Model_Menu_Builder', array( + $menuBuilder = $this->_factory->create('Mage_Backend_Model_Menu_Builder', array( 'menu' => $this->_menu, - 'itemFactory' => $this->_appConfig->getModelInstance('Mage_Backend_Model_Menu_Item_Factory'), + 'menuItemFactory' => $this->_factory->get('Mage_Backend_Model_Menu_Item_Factory'), )); /* @var $director Mage_Backend_Model_Menu_Director_Dom */ - $director = $this->_appConfig->getModelInstance( + $director = $this->_factory->create( 'Mage_Backend_Model_Menu_Director_Dom', array( - 'config' => $this->_getDom(), - 'factory' => $this->_appConfig, - 'logger' => $this->_logger + 'menuConfig' => $this->_getDom(), + 'factory' => $this->_factory, + 'menuLogger' => $this->_logger ) ); $director->buildMenu($menuBuilder); @@ -158,8 +171,9 @@ protected function _getDom() $mergedConfig->loadXML($mergedConfigXml); } else { $fileList = $this->getMenuConfigurationFiles(); - $mergedConfig = $this->_appConfig - ->getModelInstance('Mage_Backend_Model_Menu_Config_Menu', $fileList)->getMergedConfig(); + $mergedConfig = $this->_factory + ->create('Mage_Backend_Model_Menu_Config_Menu', array('configFiles' => $fileList)) + ->getMergedConfig(); $this->_saveCache($mergedConfig->saveXML()); } return $mergedConfig; diff --git a/app/code/core/Mage/Backend/Model/Menu/Director/Dom.php b/app/code/core/Mage/Backend/Model/Menu/Director/Dom.php index ba42ba13d3dee..afdd7eb84aa34 100644 --- a/app/code/core/Mage/Backend/Model/Menu/Director/Dom.php +++ b/app/code/core/Mage/Backend/Model/Menu/Director/Dom.php @@ -37,26 +37,17 @@ class Mage_Backend_Model_Menu_Director_Dom extends Mage_Backend_Model_Menu_Direc protected $_logger; /** - * @param array $data - * @throws InvalidArgumentException if config storage is not present in $data array + * @param DOMDocument $menuConfig + * @param Magento_ObjectManager $factory + * @param Mage_Backend_Model_Menu_Logger $menuLogger */ - public function __construct(array $data = array()) - { - parent::__construct($data); - if (false == ($this->_configModel instanceof DOMDocument)) { - throw new InvalidArgumentException('Configuration storage model is not instance of DOMDocument'); - } - - if (isset($data['logger'])) { - $this->_logger = $data['logger']; - } else { - throw new InvalidArgumentException("Logger model is required parameter"); - } - - if (false == ($this->_logger instanceof Mage_Backend_Model_Menu_Logger)) { - throw new InvalidArgumentException('Logger model is not an instance of Mage_Core_Model_Log'); - } - + public function __construct( + DOMDocument $menuConfig, + Magento_ObjectManager $factory, + Mage_Backend_Model_Menu_Logger $menuLogger + ) { + parent::__construct($menuConfig, $factory); + $this->_logger = $menuLogger; $this->_extractData(); } @@ -111,25 +102,25 @@ protected function _getCommand($data) { switch ($data['type']) { case 'update': - $command = $this->_factory->getModelInstance( + $command = $this->_factory->create( 'Mage_Backend_Model_Menu_Builder_Command_Update', - $data + array('data' => $data) ); $this->_logger->log(sprintf('Update on item with id %s was processed', $command->getId())); break; case 'remove': - $command = $this->_factory->getModelInstance( + $command = $this->_factory->create( 'Mage_Backend_Model_Menu_Builder_Command_Remove', - $data + array('data' => $data) ); $this->_logger->log(sprintf('Remove on item with id %s was processed', $command->getId())); break; default: - $command = $this->_factory->getModelInstance( + $command = $this->_factory->create( 'Mage_Backend_Model_Menu_Builder_Command_Add', - $data + array('data' => $data) ); break; } diff --git a/app/code/core/Mage/Backend/Model/Menu/DirectorAbstract.php b/app/code/core/Mage/Backend/Model/Menu/DirectorAbstract.php index ee252525e331a..03e9d96a1e574 100644 --- a/app/code/core/Mage/Backend/Model/Menu/DirectorAbstract.php +++ b/app/code/core/Mage/Backend/Model/Menu/DirectorAbstract.php @@ -33,27 +33,20 @@ abstract class Mage_Backend_Model_Menu_DirectorAbstract /** * Factory model - * @var Mage_Core_Model_Config + * @var Magento_ObjectManager */ protected $_factory; /** - * @param array $data - * @throws InvalidArgumentException if config storage is not present in $data array + * @param $menuConfig + * @param Magento_ObjectManager $factory */ - public function __construct(array $data = array()) - { - if (isset($data['config'])) { - $this->_configModel = $data['config']; - } else { - throw new InvalidArgumentException('Configuration storage model is required parameter'); - } - - if (isset($data['factory'])) {//} && $data['factory'] instanceof Mage_Core_Model_Config) { - $this->_factory = $data['factory']; - } else { - throw new InvalidArgumentException('Configuration factory model is required parameter'); - } + public function __construct( + $menuConfig, + Magento_ObjectManager $factory + ) { + $this->_configModel = $menuConfig; + $this->_factory = $factory; } /** diff --git a/app/code/core/Mage/Backend/Model/Menu/Factory.php b/app/code/core/Mage/Backend/Model/Menu/Factory.php index efbab6de6cebe..690acb75ed8b9 100644 --- a/app/code/core/Mage/Backend/Model/Menu/Factory.php +++ b/app/code/core/Mage/Backend/Model/Menu/Factory.php @@ -26,14 +26,34 @@ class Mage_Backend_Model_Menu_Factory { /** - * Retrieve menu object - * - * @param array $arguments - * @return false|Mage_Core_Model_Abstract + * @var Mage_Backend_Model_Menu_Logger */ - public function getMenuInstance(array $arguments = array()) + protected $_logger; + + /** + * @var Magento_ObjectManager + */ + protected $_factory; + + /** + * @param Magento_ObjectManager $factory + * @param Mage_Backend_Model_Menu_Logger $menuLogger + */ + public function __construct(Magento_ObjectManager $factory, Mage_Backend_Model_Menu_Logger $menuLogger) + { + $this->_factory = $factory; + $this->_logger = $menuLogger; + } + + /** + * Retrieve menu model + * @param string $path + * @return Mage_Backend_Model_Menu + */ + public function getMenuInstance($path = '') { - $arguments = array_merge(array('logger' => Mage::getSingleton('Mage_Backend_Model_Menu_Logger')), $arguments); - return Mage::getModel('Mage_Backend_Model_Menu', $arguments); + return $this->_factory->create( + 'Mage_Backend_Model_Menu', array('menuLogger' => $this->_logger, 'pathInMenuStructure' => $path) + ); } } diff --git a/app/code/core/Mage/Backend/Model/Menu/Item.php b/app/code/core/Mage/Backend/Model/Menu/Item.php index 91c274572ff0e..331a19514ab01 100644 --- a/app/code/core/Mage/Backend/Model/Menu/Item.php +++ b/app/code/core/Mage/Backend/Model/Menu/Item.php @@ -49,7 +49,7 @@ class Mage_Backend_Model_Menu_Item * @var Mage_Core_Helper_Abstract */ protected $_moduleHelper; - + /** * Module helper name * @@ -160,29 +160,37 @@ class Mage_Backend_Model_Menu_Item protected $_serializedSubmenu; /** + * @param Mage_Backend_Model_Menu_Item_Validator $validator + * @param Mage_Core_Model_Authorization $authorization + * @param Mage_Core_Model_Config $applicationConfig + * @param Mage_Core_Model_Store_Config $storeConfig + * @param Mage_Backend_Model_Menu_Factory $menuFactory + * @param Mage_Backend_Model_Url $urlModel + * @param Mage_Core_Helper_Abstract $helper * @param array $data - * @throws InvalidArgumentException - * @throws BadMethodCallException */ - public function __construct(array $data = array()) - { - if (!isset($data['validator']) - || !$data['validator'] instanceof Mage_Backend_Model_Menu_Item_Validator) { - throw new InvalidArgumentException('Wrong validator object provided'); - } - - $this->_validator = $data['validator']; + public function __construct( + Mage_Backend_Model_Menu_Item_Validator $validator, + Mage_Core_Model_Authorization $authorization, + Mage_Core_Model_Config $applicationConfig, + Mage_Core_Model_Store_Config $storeConfig, + Mage_Backend_Model_Menu_Factory $menuFactory, + Mage_Backend_Model_Url $urlModel, + Mage_Core_Helper_Abstract $helper, + array $data = array() + ) { + $this->_validator = $validator; $this->_validator->validate($data); - $this->_acl = $data['acl']; - $this->_appConfig = $data['appConfig']; - $this->_storeConfig = $data['storeConfig']; - $this->_menuFactory = $data['menuFactory']; - $this->_urlModel = $data['urlModel']; + $this->_acl = $authorization; + $this->_appConfig = $applicationConfig; + $this->_storeConfig = $storeConfig; + $this->_menuFactory = $menuFactory; + $this->_urlModel = $urlModel; + $this->_moduleHelper = $helper; $this->_id = $data['id']; $this->_title = $data['title']; - $this->_moduleHelper = $data['module']; $this->_action = isset($data['action']) ? $data['action'] : null; $this->_resource = isset($data['resource']) ? $data['resource'] : null; $this->_dependsOnModule = isset($data['dependsOnModule']) ? $data['dependsOnModule'] : null; @@ -451,38 +459,44 @@ public function isAllowed() public function __sleep() { - $this->_moduleHelperName = get_class($this->_moduleHelper); - if ($this->_submenu) { - $this->_serializedSubmenu = $this->_submenu->serialize(); + if (Mage::getIsSerializable()) { + $this->_moduleHelperName = get_class($this->_moduleHelper); + if ($this->_submenu) { + $this->_serializedSubmenu = $this->_submenu->serialize(); + } + return array( + '_parentId', + '_moduleHelperName', + '_sortIndex', + '_dependsOnConfig', + '_id', + '_resource', + '_path', + '_action', + '_dependsOnModule', + '_tooltip', + '_title', + '_serializedSubmenu' + ); + } else { + return array_keys(get_object_vars($this)); } - return array( - '_parentId', - '_moduleHelperName', - '_sortIndex', - '_dependsOnConfig', - '_id', - '_resource', - '_path', - '_action', - '_dependsOnModule', - '_tooltip', - '_title', - '_serializedSubmenu' - ); } public function __wakeup() { - $this->_moduleHelper = Mage::helper($this->_moduleHelperName); - $this->_validator = Mage::getSingleton('Mage_Backend_Model_Menu_Item_Validator'); - $this->_acl = Mage::getSingleton('Mage_Core_Model_Authorization'); - $this->_appConfig = Mage::getConfig(); - $this->_storeConfig = Mage::getSingleton('Mage_Core_Model_Store_Config'); - $this->_menuFactory = Mage::getSingleton('Mage_Backend_Model_Menu_Factory'); - $this->_urlModel = Mage::getSingleton('Mage_Backend_Model_Url'); - if ($this->_serializedSubmenu) { - $this->_submenu = $this->_menuFactory->getMenuInstance(); - $this->_submenu->unserialize($this->_serializedSubmenu); + if (Mage::getIsSerializable()) { + $this->_moduleHelper = Mage::helper($this->_moduleHelperName); + $this->_validator = Mage::getSingleton('Mage_Backend_Model_Menu_Item_Validator'); + $this->_acl = Mage::getSingleton('Mage_Core_Model_Authorization'); + $this->_appConfig = Mage::getConfig(); + $this->_storeConfig = Mage::getSingleton('Mage_Core_Model_Store_Config'); + $this->_menuFactory = Mage::getSingleton('Mage_Backend_Model_Menu_Factory'); + $this->_urlModel = Mage::getSingleton('Mage_Backend_Model_Url'); + if ($this->_serializedSubmenu) { + $this->_submenu = $this->_menuFactory->getMenuInstance(); + $this->_submenu->unserialize($this->_serializedSubmenu); + } } } } diff --git a/app/code/core/Mage/Backend/Model/Menu/Item/Factory.php b/app/code/core/Mage/Backend/Model/Menu/Item/Factory.php index 470122aca6541..86ca943cd1701 100644 --- a/app/code/core/Mage/Backend/Model/Menu/Item/Factory.php +++ b/app/code/core/Mage/Backend/Model/Menu/Item/Factory.php @@ -74,51 +74,32 @@ class Mage_Backend_Model_Menu_Item_Factory protected $_validator; /** + * @param Magento_ObjectManager $factory + * @param Mage_Core_Model_Authorization $authorization + * @param Mage_Backend_Model_Menu_Factory $menuFactory + * @param Mage_Core_Model_Config $applicationConfig + * @param Mage_Core_Model_Store_Config $storeConfig + * @param Mage_Backend_Model_Url $urlModel + * @param Mage_Backend_Model_Menu_Item_Validator $menuItemValidator * @param array $data - * @throws InvalidArgumentException */ - public function __construct(array $data = array()) - { - $this->_acl = isset($data['acl']) ? $data['acl'] : Mage::getSingleton('Mage_Core_Model_Authorization'); - if (!($this->_acl instanceof Mage_Core_Model_Authorization)) { - throw new InvalidArgumentException('Wrong acl object provided'); - } - - $this->_objectFactory = isset($data['objectFactory']) ? $data['objectFactory'] : Mage::getConfig(); - if (!($this->_objectFactory instanceof Mage_Core_Model_Config)) { - throw new InvalidArgumentException('Wrong object factory provided'); - } - - $this->_menuFactory = isset($data['menuFactory']) - ? $data['menuFactory'] - : Mage::getModel('Mage_Backend_Model_Menu_Factory'); - if (!($this->_menuFactory instanceof Mage_Backend_Model_Menu_Factory)) { - throw new InvalidArgumentException('Wrong menu factory provided'); - } - - $this->_appConfig = isset($data['appConfig']) ? $data['appConfig']: Mage::getConfig(); - if (!($this->_appConfig instanceof Mage_Core_Model_Config)) { - throw new InvalidArgumentException('Wrong application config provided'); - } - - $this->_storeConfig = isset($data['storeConfig']) - ? $data['storeConfig'] - : Mage::getSingleton('Mage_Core_Model_Store_Config'); - if (!($this->_storeConfig instanceof Mage_Core_Model_Store_Config)) { - throw new InvalidArgumentException('Wrong store config provided'); - } - - $this->_urlModel = isset($data['urlModel']) ? $data['urlModel'] : Mage::getSingleton('Mage_Backend_Model_Url'); - if (!($this->_urlModel instanceof Mage_Backend_Model_Url)) { - throw new InvalidArgumentException('Wrong url model provided'); - } - - $this->_validator = isset($data['validator']) - ? $data['validator'] - : Mage::getSingleton('Mage_Backend_Model_Menu_Item_Validator'); - if (!($this->_validator instanceof Mage_Backend_Model_Menu_Item_Validator)) { - throw new InvalidArgumentException('Wrong item validator model provided'); - } + public function __construct( + Magento_ObjectManager $factory, + Mage_Core_Model_Authorization $authorization, + Mage_Backend_Model_Menu_Factory $menuFactory, + Mage_Core_Model_Config $applicationConfig, + Mage_Core_Model_Store_Config $storeConfig, + Mage_Backend_Model_Url $urlModel, + Mage_Backend_Model_Menu_Item_Validator $menuItemValidator, + array $data = array() + ) { + $this->_acl = $authorization; + $this->_objectFactory = $factory; + $this->_menuFactory = $menuFactory; + $this->_appConfig = $applicationConfig; + $this->_storeConfig = $storeConfig; + $this->_urlModel = $urlModel; + $this->_validator = $menuItemValidator; if (isset($data['helpers'])) { $this->_helpers = $data['helpers']; @@ -136,15 +117,18 @@ public function createFromArray(array $data = array()) $module = 'Mage_Backend_Helper_Data'; if (isset($data['module'])) { $module = $data['module']; + unset($data['module']); } - $data['module'] = isset($this->_helpers[$module]) ? $this->_helpers[$module] : Mage::helper($module); - $data['acl'] = $this->_acl; - $data['appConfig'] = $this->_appConfig; + $data = array('data' => $data); + + $data['authorization'] = $this->_acl; + $data['applicationConfig'] = $this->_appConfig; $data['storeConfig'] = $this->_storeConfig; $data['menuFactory'] = $this->_menuFactory; $data['urlModel'] = $this->_urlModel; $data['validator'] = $this->_validator; - return $this->_objectFactory->getModelInstance('Mage_Backend_Model_Menu_Item', $data); + $data['helper'] = isset($this->_helpers[$module]) ? $this->_helpers[$module] : Mage::helper($module); + return $this->_objectFactory->create('Mage_Backend_Model_Menu_Item', $data); } } diff --git a/app/code/core/Mage/Backend/Model/Menu/Item/Validator.php b/app/code/core/Mage/Backend/Model/Menu/Item/Validator.php index c65b3108b7938..f5323b154db58 100644 --- a/app/code/core/Mage/Backend/Model/Menu/Item/Validator.php +++ b/app/code/core/Mage/Backend/Model/Menu/Item/Validator.php @@ -31,21 +31,7 @@ class Mage_Backend_Model_Menu_Item_Validator * @var array */ protected $_required = array( - 'acl', 'appConfig', 'menuFactory', 'urlModel', 'storeConfig', 'id', 'title', 'module', 'resource' - ); - - /** - * The list of required param types - * - * @var array - */ - protected $_requiredTypes = array( - 'acl' => 'Mage_Core_Model_Authorization', - 'appConfig' => 'Mage_Core_Model_Config', - 'menuFactory' => 'Mage_Backend_Model_Menu_Factory', - 'urlModel' => 'Mage_Backend_Model_Url', - 'storeConfig' => 'Mage_Core_Model_Store_Config', - 'module' => 'Mage_Core_Helper_Abstract' + 'id', 'title', 'resource' ); /** @@ -71,7 +57,7 @@ public function __construct() $resourceValidator = new Zend_Validate(); $resourceValidator->addValidator(new Zend_Validate_StringLength(array('min' => 8))); $resourceValidator->addValidator( - new Zend_Validate_Regex('/^[A-Z]+[a-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}$/') + new Zend_Validate_Regex('/^[A-Z][A-Za-z0-9]+_[A-Z][A-Za-z0-9]+::[A-Za-z_0-9]+$/') ); $attributeValidator = new Zend_Validate(); @@ -111,12 +97,7 @@ public function validate($data) } foreach ($data as $param => $value) { - if (isset($this->_requiredTypes[$param]) && !($data[$param] instanceof $this->_requiredTypes[$param])) { - throw new InvalidArgumentException( - 'Wrong param ' . $param . ': Expected ' . $this->_requiredTypes[$param] . ', received ' - . get_class($data[$param]) - ); - } elseif (!is_null($data[$param]) + if (!is_null($data[$param]) && isset($this->_validators[$param]) && !$this->_validators[$param]->isValid($value) ) { diff --git a/app/code/core/Mage/Backend/Model/Widget/Grid/Row/UrlGeneratorFactory.php b/app/code/core/Mage/Backend/Model/Widget/Grid/Row/UrlGeneratorFactory.php new file mode 100644 index 0000000000000..b60293b6acf8b --- /dev/null +++ b/app/code/core/Mage/Backend/Model/Widget/Grid/Row/UrlGeneratorFactory.php @@ -0,0 +1,67 @@ + + */ +class Mage_Backend_Model_Widget_Grid_Row_UrlGeneratorFactory +{ + /** + * @var Magento_ObjectManager + */ + protected $_objectManager; + + /** + * @param Magento_ObjectManager $objectManager + */ + public function __construct(Magento_ObjectManager $objectManager) + { + $this->_objectManager = $objectManager; + } + + /** + * Create new url generator instance + * + * @param string $generatorClassName + * @param array $arguments + * @return Mage_Backend_Model_Widget_Grid_Row_UrlGenerator + * @throws InvalidArgumentException + */ + public function createUrlGenerator($generatorClassName, array $arguments = array()) + { + $rowUrlGenerator = $this->_objectManager->create($generatorClassName, $arguments, false); + if (false === ($rowUrlGenerator instanceof Mage_Backend_Model_Widget_Grid_Row_UrlGenerator)) { + throw new InvalidArgumentException('Passed wrong parameters'); + } + + return $rowUrlGenerator; + } +} diff --git a/app/code/core/Mage/Backend/etc/config.xml b/app/code/core/Mage/Backend/etc/config.xml index 6cc7011fb4a9f..b6e688bfa7697 100644 --- a/app/code/core/Mage/Backend/etc/config.xml +++ b/app/code/core/Mage/Backend/etc/config.xml @@ -71,6 +71,11 @@ + + + Mage_Backend_Model_Auth_Session + + diff --git a/app/code/core/Mage/Backend/view/adminhtml/widget/form/renderer/fieldset.phtml b/app/code/core/Mage/Backend/view/adminhtml/widget/form/renderer/fieldset.phtml index 617496fe3e8c9..c341ea58e4497 100644 --- a/app/code/core/Mage/Backend/view/adminhtml/widget/form/renderer/fieldset.phtml +++ b/app/code/core/Mage/Backend/view/adminhtml/widget/form/renderer/fieldset.phtml @@ -49,9 +49,37 @@ - getChildrenHtml(); ?> + getBasicChildrenHtml(); ?>
+ hasAdvanced()): ?> +
+

getAdvancedLabel() ?>

+
+ + + getAdvancedChildrenHtml(); ?> + +
+
+
+ +
getSubFieldsetHtml() ?> diff --git a/app/code/core/Mage/Backend/view/adminhtml/widget/tabs.phtml b/app/code/core/Mage/Backend/view/adminhtml/widget/tabs.phtml index 57d398e490a6b..3a5f6800f8b81 100644 --- a/app/code/core/Mage/Backend/view/adminhtml/widget/tabs.phtml +++ b/app/code/core/Mage/Backend/view/adminhtml/widget/tabs.phtml @@ -40,6 +40,6 @@ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php index 7df542e3d627e..da44cbcf565f2 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php @@ -35,15 +35,7 @@ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Checkbox extends Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Checkbox { - /** - * Set template - * - * @return void - */ - protected function _construct() - { - $this->setTemplate('product/composite/fieldset/options/type/checkbox.phtml'); - } + protected $_template = 'product/composite/fieldset/options/type/checkbox.phtml'; /** * @param string $elementId diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php index 4a056642300c5..827896a299c95 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php @@ -35,15 +35,7 @@ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Multi extends Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Multi { - /** - * Set template - * - * @return void - */ - protected function _construct() - { - $this->setTemplate('product/composite/fieldset/options/type/multi.phtml'); - } + protected $_template = 'product/composite/fieldset/options/type/multi.phtml'; /** * @param string $elementId diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php index 5069b9aaeb88f..10e0a4231754c 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php @@ -35,15 +35,7 @@ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Radio extends Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio { - /** - * Set template - * - * @return void - */ - protected function _construct() - { - $this->setTemplate('product/composite/fieldset/options/type/radio.phtml'); - } + protected $_template = 'product/composite/fieldset/options/type/radio.phtml'; /** * @param string $elementId diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php index 734c579532695..be5f124318fbb 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php @@ -35,15 +35,7 @@ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Select extends Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select { - /** - * Set template - * - * @return void - */ - protected function _construct() - { - $this->setTemplate('product/composite/fieldset/options/type/select.phtml'); - } + protected $_template = 'product/composite/fieldset/options/type/select.phtml'; /** * @param string $elementId diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php index 41911a42978e5..8ece165c76c41 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php @@ -40,9 +40,9 @@ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes_Extend /** * Class constructor */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setCanEditPrice(true); $this->setCanReadPrice(true); } diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php index 4d79a9aa19772..a517b7bc61af1 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php @@ -35,11 +35,14 @@ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle extends Mage_A implements Mage_Adminhtml_Block_Widget_Tab_Interface { protected $_product = null; - public function __construct() + + protected $_template = 'product/edit/bundle.phtml'; + + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setSkipGenerateContent(true); - $this->setTemplate('product/edit/bundle.phtml'); + } public function getTabUrl() diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php index 6f73eeff88566..babc09a578b98 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php @@ -63,14 +63,16 @@ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option extends */ protected $_options = null; + protected $_template = 'product/edit/bundle/option.phtml'; + /** * Bundle option renderer class constructor * * Sets block template and necessary data */ - public function __construct() + protected function _construct() { - $this->setTemplate('product/edit/bundle/option.phtml'); + $this->setCanReadPrice(true); $this->setCanEditPrice(true); } diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php index 935b803048f0a..babec6569b123 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php @@ -34,10 +34,13 @@ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option_Search extends Mage_Adminhtml_Block_Widget { + + protected $_template = 'product/edit/bundle/option/search.phtml'; + protected function _construct() { $this->setId('bundle_option_selection_search'); - $this->setTemplate('product/edit/bundle/option/search.phtml'); + } public function getHeaderText() diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php index f6a13fd727230..e306ac8a783b1 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php @@ -34,9 +34,9 @@ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option_Search_Grid extends Mage_Adminhtml_Block_Widget_Grid { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->setId('bundle_selection_search_grid'); $this->setRowClickCallback('bSelection.productGridRowClick.bind(bSelection)'); $this->setCheckboxCheckCallback('bSelection.productGridCheckboxCheck.bind(bSelection)'); diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php index 860c52261e961..6a25fe5292184 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php @@ -33,12 +33,14 @@ */ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option_Selection extends Mage_Adminhtml_Block_Widget { + protected $_template = 'product/edit/bundle/option/selection.phtml'; + /** * Initialize bundle option selection block */ - public function __construct() + protected function _construct() { - $this->setTemplate('product/edit/bundle/option/selection.phtml'); + $this->setCanReadPrice(true); $this->setCanEditPrice(true); } diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php index 384b2b9c6fa5d..4ebca9d1f4651 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php @@ -35,13 +35,5 @@ class Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Checkbox extends Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option { - /** - * Set template - * - * @return void - */ - protected function _construct() - { - $this->setTemplate('catalog/product/view/type/bundle/option/checkbox.phtml'); - } + protected $_template = 'catalog/product/view/type/bundle/option/checkbox.phtml'; } diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php index 09773dc91d4d6..2fa040a9a1fa2 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php @@ -35,13 +35,6 @@ class Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Multi extends Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option { - /** - * Set template - * - * @return void - */ - protected function _construct() - { - $this->setTemplate('catalog/product/view/type/bundle/option/multi.phtml'); - } + protected $_template = 'catalog/product/view/type/bundle/option/multi.phtml'; + } diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php index dfd7bddd0e6a9..6c9b51f54394f 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php @@ -35,13 +35,5 @@ class Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio extends Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option { - /** - * Set template - * - * @return void - */ - protected function _construct() - { - $this->setTemplate('catalog/product/view/type/bundle/option/radio.phtml'); - } + protected $_template = 'catalog/product/view/type/bundle/option/radio.phtml'; } diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php index 745276925158a..f55b079ed7272 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php @@ -35,13 +35,5 @@ class Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select extends Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option { - /** - * Set template - * - * @return void - */ - protected function _construct() - { - $this->setTemplate('catalog/product/view/type/bundle/option/select.phtml'); - } + protected $_template = 'catalog/product/view/type/bundle/option/select.phtml'; } diff --git a/app/code/core/Mage/Bundle/Block/Checkout/Cart/Item/Renderer.php b/app/code/core/Mage/Bundle/Block/Checkout/Cart/Item/Renderer.php index c512923e1be76..5faecad3bf22f 100644 --- a/app/code/core/Mage/Bundle/Block/Checkout/Cart/Item/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Checkout/Cart/Item/Renderer.php @@ -35,9 +35,9 @@ class Mage_Bundle_Block_Checkout_Cart_Item_Renderer extends Mage_Checkout_Block_ { protected $_configurationHelper = null; - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_configurationHelper = Mage::helper('Mage_Bundle_Helper_Catalog_Product_Configuration'); } diff --git a/app/code/core/Mage/Captcha/Helper/Data.php b/app/code/core/Mage/Captcha/Helper/Data.php index a44f380aa0cc1..bdaf1844f74b7 100755 --- a/app/code/core/Mage/Captcha/Helper/Data.php +++ b/app/code/core/Mage/Captcha/Helper/Data.php @@ -183,7 +183,9 @@ public function getCaptcha($formId) $type = ucfirst($this->getConfigNode('type')); $this->_captcha[$formId] = $this->getConfig()->getModelInstance( 'Mage_Captcha_Model_' . $type, - array('formId' => $formId, 'helper' => $this) + array( + 'params' => array('formId' => $formId, 'helper' => $this) + ) ); } return $this->_captcha[$formId]; diff --git a/app/code/core/Mage/Captcha/view/frontend/captcha.js b/app/code/core/Mage/Captcha/view/frontend/captcha.js new file mode 100644 index 0000000000000..7ed3ecbc921b2 --- /dev/null +++ b/app/code/core/Mage/Captcha/view/frontend/captcha.js @@ -0,0 +1,55 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category mage + * @package captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/*jshint browser:true jquery:true*/ +(function ($, undefined) { + $.widget('mage.captcha', { + options: { + refreshClass: 'refreshing' + }, + _create: function () { + this.element.on('click', $.proxy(this.refresh, this)); + }, + refresh: function () { + this.element.addClass(this.options.refreshClass); + $.ajax({ + url: this.options.url, + type: 'post', + dataType: 'json', + context: this, + data: {'formId': this.options.formSelector.replace(/^(#|.)/, "")}, + success: function (response) { + if (response.imgSrc) { + $(this.options.formSelector).attr('src', response.imgSrc); + } + this.element.removeClass(this.options.refreshClass); + }, + error: function () { + this.element.removeClass(this.options.refreshClass); + } + }); + } + }); +})(jQuery); + diff --git a/app/code/core/Mage/Captcha/view/frontend/zend.phtml b/app/code/core/Mage/Captcha/view/frontend/zend.phtml index 2eb9620dd6290..64af9f3326b87 100644 --- a/app/code/core/Mage/Captcha/view/frontend/zend.phtml +++ b/app/code/core/Mage/Captcha/view/frontend/zend.phtml @@ -31,12 +31,12 @@
  • - +
  • - <?php echo $this->__('Reload captcha') ?> + <?php echo $this->__('Reload captcha') ?> isCaseSensitive()) :?>
    @@ -45,6 +45,13 @@
  • diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php index a8de488a8a4e4..a3e4764231e1f 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php @@ -57,11 +57,8 @@ abstract class Mage_Catalog_Block_Layer_Filter_Abstract extends Mage_Core_Block_ * Initialize filter template * */ - public function __construct() - { - parent::__construct(); - $this->setTemplate('Mage_Catalog::layer/filter.phtml'); - } + + protected $_template = 'Mage_Catalog::layer/filter.phtml'; /** * Initialize filter model object diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Attribute.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Attribute.php index fe03b2493db54..e94923ba0e3c3 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Attribute.php @@ -33,9 +33,9 @@ */ class Mage_Catalog_Block_Layer_Filter_Attribute extends Mage_Catalog_Block_Layer_Filter_Abstract { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_filterModelName = 'Mage_Catalog_Model_Layer_Filter_Attribute'; } diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Category.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Category.php index 46207e73de6fe..2505b7cd4dd30 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Category.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Category.php @@ -33,9 +33,9 @@ */ class Mage_Catalog_Block_Layer_Filter_Category extends Mage_Catalog_Block_Layer_Filter_Abstract { - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_filterModelName = 'Mage_Catalog_Model_Layer_Filter_Category'; } } diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Decimal.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Decimal.php index 60e16e8ebb9d9..6dfeedf38dad9 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Decimal.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Decimal.php @@ -38,9 +38,9 @@ class Mage_Catalog_Block_Layer_Filter_Decimal extends Mage_Catalog_Block_Layer_F * Initialize Decimal Filter Model * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_filterModelName = 'Mage_Catalog_Model_Layer_Filter_Decimal'; } diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Price.php index bc89dc30bb006..1178aaa32bf95 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Price.php @@ -37,9 +37,9 @@ class Mage_Catalog_Block_Layer_Filter_Price extends Mage_Catalog_Block_Layer_Fil * Initialize Price filter module * */ - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->_filterModelName = 'Mage_Catalog_Model_Layer_Filter_Price'; } diff --git a/app/code/core/Mage/Catalog/Block/Layer/State.php b/app/code/core/Mage/Catalog/Block/Layer/State.php index 2fbfa9486c9df..ae17a3999f11e 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/State.php +++ b/app/code/core/Mage/Catalog/Block/Layer/State.php @@ -33,15 +33,7 @@ */ class Mage_Catalog_Block_Layer_State extends Mage_Core_Block_Template { - /** - * Initialize Layer State template - * - */ - public function __construct() - { - parent::__construct(); - $this->setTemplate('layer/state.phtml'); - } + protected $_template = 'layer/state.phtml'; /** * Retrieve active filters diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php b/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php index fd1ce252b11f2..5fb1f2203c18d 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php @@ -144,6 +144,10 @@ class Mage_Catalog_Block_Product_List_Toolbar extends Mage_Core_Block_Template */ protected $_paramsMemorizeAllowed = true; + + protected $_template = 'product/list/toolbar.phtml'; + + /** * Retrieve Catalog Config object * @@ -184,7 +188,7 @@ protected function _construct() $this->_availableMode = array('list' => $this->__('List'), 'grid' => $this->__('Grid')); break; } - $this->setTemplate('product/list/toolbar.phtml'); + } /** diff --git a/app/code/core/Mage/Catalog/Block/Product/Send.php b/app/code/core/Mage/Catalog/Block/Product/Send.php index b141a1c27068a..f6e46050dd01f 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Send.php +++ b/app/code/core/Mage/Catalog/Block/Product/Send.php @@ -34,16 +34,12 @@ */ class Mage_Catalog_Block_Product_Send extends Mage_Catalog_Block_Product_Abstract { - public function __construct(){ - parent::__construct(); - } /** * Retrieve username for form field * * @return string */ - public function getUserName() { return Mage::getSingleton('Mage_Customer_Model_Session')->getCustomer()->getName(); diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Additional.php b/app/code/core/Mage/Catalog/Block/Product/View/Additional.php index ce4edffaaf200..3b56b70cd51c5 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Additional.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Additional.php @@ -37,11 +37,8 @@ class Mage_Catalog_Block_Product_View_Additional extends Mage_Core_Block_Templat protected $_list; - public function __construct() - { - parent::__construct(); - $this->setTemplate('product/view/additional.phtml'); - } + protected $_template = 'product/view/additional.phtml'; + public function getChildHtmlList() { diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options.php b/app/code/core/Mage/Catalog/Block/Product/View/Options.php index 9f7c34416b70d..03bb30ae55bae 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options.php @@ -38,9 +38,9 @@ class Mage_Catalog_Block_Product_View_Options extends Mage_Core_Block_Template protected $_optionRenders = array(); - public function __construct() + protected function _construct() { - parent::__construct(); + parent::_construct(); $this->addOptionRenderer( 'default', 'Mage_Catalog_Block_Product_View_Options_Type_Default', diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php index 554a56b4b0d05..4e92d20850c20 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php @@ -84,24 +84,18 @@ public function getCalendarDateHtml() $option = $this->getOption(); $value = $this->getProduct()->getPreconfiguredValues()->getData('options/' . $option->getId() . '/date'); - //$require = $this->getOption()->getIsRequire() ? ' required-entry' : ''; - $require = ''; - $yearStart = Mage::getSingleton('Mage_Catalog_Model_Product_Option_Type_Date')->getYearStart(); $yearEnd = Mage::getSingleton('Mage_Catalog_Model_Product_Option_Type_Date')->getYearEnd(); $calendar = $this->getLayout() - ->createBlock('Mage_Core_Block_Html_Date_Jquery_Calendar') + ->createBlock('Mage_Core_Block_Html_Date') ->setId('options_'.$this->getOption()->getId().'_date') ->setName('options['.$this->getOption()->getId().'][date]') - ->setClass('product-custom-option datetime-picker input-text' . $require) + ->setClass('product-custom-option datetime-picker input-text') ->setImage($this->getSkinUrl('Mage_Core::calendar.gif')) ->setDateFormat(Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT)) ->setValue($value) ->setYearsRange($yearStart . ':' . $yearEnd); - if (!$this->getSkipJsReloadPrice()) { - $calendar->setExtraParams('onchange="opConfig.reloadPrice()"'); - } return $calendar->getHtml(); } diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php index efa36049637df..5b645c6272600 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php @@ -46,9 +46,11 @@ public function getValuesHtml() $configValue = $this->getProduct()->getPreconfiguredValues()->getData('options/' . $_option->getId()); $store = $this->getProduct()->getStore(); + $this->setSkipJsReloadPrice(1); // Remove inline prototype onclick and onchange events + if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_DROP_DOWN || $_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_MULTIPLE) { - $require = ($_option->getIsRequire()) ? ' required-entry' : ''; + $require = ($_option->getIsRequire()) ? ' required' : ''; $extraParams = ''; $select = $this->getLayout()->createBlock('Mage_Core_Block_Html_Select') ->setData(array( @@ -98,7 +100,7 @@ public function getValuesHtml() || $_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_CHECKBOX ) { $selectHtml = '
      '; - $require = ($_option->getIsRequire()) ? ' validate-one-required-by-name' : ''; + $require = ($_option->getIsRequire()) ? ' required' : ''; $arraySign = ''; switch ($_option->getType()) { case Mage_Catalog_Model_Product_Option::OPTION_TYPE_RADIO: @@ -142,12 +144,6 @@ public function getValuesHtml() . $this->helper('Mage_Core_Helper_Data')->currencyByStore($_value->getPrice(true), $store, false) . '" />' . ''; - if ($_option->getIsRequire()) { - $selectHtml .= ''; - } $selectHtml .= ''; } $selectHtml .= '
    '; diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest/Admin/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest/Admin/V1.php index c770013e91888..2c80d2fe88268 100644 --- a/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest/Admin/V1.php +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Category/Rest/Admin/V1.php @@ -42,7 +42,10 @@ class Mage_Catalog_Model_Api2_Product_Category_Rest_Admin_V1 extends Mage_Catalo protected function _create(array $data) { /* @var $validator Mage_Api2_Model_Resource_Validator_Fields */ - $validator = Mage::getResourceModel('Mage_Api2_Model_Resource_Validator_Fields', array('resource' => $this)); + $validator = Mage::getResourceModel('Mage_Api2_Model_Resource_Validator_Fields', + array('options' => + array('resource' => $this) + )); if (!$validator->isValidData($data)) { foreach ($validator->getErrors() as $error) { $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST); diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php index 50ce96b36354e..cec113d550789 100644 --- a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php @@ -134,9 +134,11 @@ protected function _delete() protected function _create(array $data) { /* @var $validator Mage_Catalog_Model_Api2_Product_Validator_Product */ - $validator = Mage::getModel('Mage_Catalog_Model_Api2_Product_Validator_Product', array( - 'operation' => self::OPERATION_CREATE - )); + $validator = Mage::getModel('Mage_Catalog_Model_Api2_Product_Validator_Product', + array('options' => + array( + 'operation' => self::OPERATION_CREATE + ))); if (!$validator->isValidData($data)) { foreach ($validator->getErrors() as $error) { @@ -192,10 +194,12 @@ protected function _update(array $data) /** @var $product Mage_Catalog_Model_Product */ $product = $this->_getProduct(); /* @var $validator Mage_Catalog_Model_Api2_Product_Validator_Product */ - $validator = Mage::getModel('Mage_Catalog_Model_Api2_Product_Validator_Product', array( - 'operation' => self::OPERATION_UPDATE, - 'product' => $product - )); + $validator = Mage::getModel('Mage_Catalog_Model_Api2_Product_Validator_Product', + array('options' => + array( + 'operation' => self::OPERATION_UPDATE, + 'product' => $product + ))); if (!$validator->isValidData($data)) { foreach ($validator->getErrors() as $error) { diff --git a/app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php b/app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php index 66b69b8f51cc2..8eb59b36a03b9 100644 --- a/app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php +++ b/app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php @@ -255,6 +255,140 @@ public function getAttribute($code) return $this->_attributes[$code]; } + /** + * @deprecated not used anymore + */ + public function parse() + { + $data = $this->getData(); + $entityTypeId = Mage::getSingleton('Mage_Eav_Model_Config')->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getId(); + $inventoryFields = array(); + + foreach ($data as $i=>$row) { + $this->setPosition('Line: '.($i+1)); + try { + // validate SKU + if (empty($row['sku'])) { + $this->addException( + Mage::helper('Mage_Catalog_Helper_Data')->__('Missing SKU, skipping the record.'), + Mage_Dataflow_Model_Convert_Exception::ERROR + ); + continue; + } + $this->setPosition('Line: '.($i+1).', SKU: '.$row['sku']); + + // try to get entity_id by sku if not set + if (empty($row['entity_id'])) { + $row['entity_id'] = $this->getResource()->getProductIdBySku($row['sku']); + } + + // if attribute_set not set use default + if (empty($row['attribute_set'])) { + $row['attribute_set'] = 'Default'; + } + // get attribute_set_id, if not throw error + $row['attribute_set_id'] = $this->getAttributeSetId($entityTypeId, $row['attribute_set']); + if (!$row['attribute_set_id']) { + $this->addException( + Mage::helper('Mage_Catalog_Helper_Data')->__('Invalid attribute set specified, skipping the record.'), + Mage_Dataflow_Model_Convert_Exception::ERROR + ); + continue; + } + + if (empty($row['type'])) { + $row['type'] = 'Simple'; + } + // get product type_id, if not throw error + $row['type_id'] = $this->getProductTypeId($row['type']); + if (!$row['type_id']) { + $this->addException( + Mage::helper('Mage_Catalog_Helper_Data')->__('Invalid product type specified, skipping the record.'), + Mage_Dataflow_Model_Convert_Exception::ERROR + ); + continue; + } + + // get store ids + $storeIds = $this->getStoreIds(isset($row['store']) ? $row['store'] : $this->getVar('store')); + if (!$storeIds) { + $this->addException( + Mage::helper('Mage_Catalog_Helper_Data')->__('Invalid store specified, skipping the record.'), + Mage_Dataflow_Model_Convert_Exception::ERROR + ); + continue; + } + + // import data + $rowError = false; + foreach ($storeIds as $storeId) { + $collection = $this->getCollection($storeId); + $entity = $collection->getEntity(); + + $model = Mage::getModel('Mage_Catalog_Model_Product'); + $model->setStoreId($storeId); + if (!empty($row['entity_id'])) { + $model->load($row['entity_id']); + } + foreach ($row as $field=>$value) { + $attribute = $entity->getAttribute($field); + + if (!$attribute) { + //$inventoryFields[$row['sku']][$field] = $value; + + if (in_array($field, $this->_inventoryFields)) { + $inventoryFields[$row['sku']][$field] = $value; + } + continue; +// $this->addException( +// Mage::helper('Mage_Catalog_Helper_Data')->__('Unknown attribute: %s.', $field), +// Mage_Dataflow_Model_Convert_Exception::ERROR +// ); + } + if ($attribute->usesSource()) { + $source = $attribute->getSource(); + $optionId = $this->getSourceOptionId($source, $value); + if (is_null($optionId)) { + $rowError = true; + $this->addException( + Mage::helper('Mage_Catalog_Helper_Data')->__('Invalid attribute option specified for attribute %s (%s), skipping the record.', $field, $value), + Mage_Dataflow_Model_Convert_Exception::ERROR + ); + continue; + } + $value = $optionId; + } + $model->setData($field, $value); + + }//foreach ($row as $field=>$value) + + //echo 'Before **********************
    ';
    +                    //print_r($model->getData());
    +                    if (!$rowError) {
    +                        $collection->addItem($model);
    +                    }
    +                    unset($model);
    +                } //foreach ($storeIds as $storeId)
    +            } catch (Exception $e) {
    +                if (!$e instanceof Mage_Dataflow_Model_Convert_Exception) {
    +                    $this->addException(
    +                        Mage::helper('Mage_Catalog_Helper_Data')->__('Error during retrieval of option value: %s', $e->getMessage()),
    +                        Mage_Dataflow_Model_Convert_Exception::FATAL
    +                    );
    +                }
    +            }
    +        }
    +
    +        // set importinted to adaptor
    +        if (sizeof($inventoryFields) > 0) {
    +            Mage::register('current_imported_inventory', $inventoryFields);
    +            //$this->setInventoryItems($inventoryFields);
    +        } // end setting imported to adaptor
    +
    +        $this->setData($this->_collections);
    +        return $this;
    +    }
    +
         public function setInventoryItems($items)
         {
             $this->_inventoryItems = $items;
    diff --git a/app/code/core/Mage/Catalog/Model/Product.php b/app/code/core/Mage/Catalog/Model/Product.php
    index 06685efd1ce8f..6be2e3025f9f2 100644
    --- a/app/code/core/Mage/Catalog/Model/Product.php
    +++ b/app/code/core/Mage/Catalog/Model/Product.php
    @@ -107,21 +107,20 @@ class Mage_Catalog_Model_Product extends Mage_Catalog_Model_Abstract
         protected $_calculatePrice = true;
     
         /**
    -     * Resource instance
    -     *
    -     * @var Mage_Catalog_Model_Resource_Product
    -     */
    -    protected $_resource;
    -
    -    /**
    -     * Initialize data
    -     *
    +     * @param Mage_Core_Model_Event_Manager $eventDispatcher
    +     * @param Mage_Core_Model_Cache $cacheManager
          * @param array $data
    +     * @param Mage_Catalog_Model_Resource_Product $resource
    +     * @param Mage_Catalog_Model_Resource_Product_Collection $resourceCollection
          */
    -    public function __construct(array $data = array())
    -    {
    -        $this->_resource = isset($data['resource']) ? $data['resource'] : null;
    -        parent::__construct($data);
    +    public function __construct(
    +        Mage_Core_Model_Event_Manager $eventDispatcher,
    +        Mage_Core_Model_Cache $cacheManager,
    +        Mage_Catalog_Model_Resource_Product $resource,
    +        Mage_Catalog_Model_Resource_Product_Collection $resourceCollection,
    +        array $data = array()
    +    ) {  
    +        parent::__construct($eventDispatcher, $cacheManager, $resource, $resourceCollection, $data);
         }
     
         /**
    @@ -152,10 +151,7 @@ public function getStoreId()
          */
         public function getResourceCollection()
         {
    -        if (empty($this->_resourceCollectionName)) {
    -            Mage::throwException(Mage::helper('Mage_Catalog_Helper_Data')->__('The model collection resource name is not defined.'));
    -        }
    -        $collection = Mage::getResourceModel($this->_resourceCollectionName);
    +        $collection = parent::getResourceCollection();
             $collection->setStoreId($this->getStoreId());
             return $collection;
         }
    @@ -591,19 +587,6 @@ protected function _afterLoad()
             return $this;
         }
     
    -    /**
    -     * Retrieve resource instance wrapper
    -     *
    -     * @return Mage_Catalog_Model_Resource_Product
    -     */
    -    protected function _getResource()
    -    {
    -        if (is_null($this->_resource)) {
    -            return parent::_getResource();
    -        }
    -        return $this->_resource;
    -    }
    -
         /**
          * Clear cache related with product id
          *
    diff --git a/app/code/core/Mage/Catalog/Model/Product/Option.php b/app/code/core/Mage/Catalog/Model/Product/Option.php
    index 49370f3384d71..af314c8d9d8b4 100644
    --- a/app/code/core/Mage/Catalog/Model/Product/Option.php
    +++ b/app/code/core/Mage/Catalog/Model/Product/Option.php
    @@ -78,13 +78,6 @@ class Mage_Catalog_Model_Product_Option extends Mage_Core_Model_Abstract
     
         protected $_values = array();
     
    -    /**
    -     * Resource instance
    -     *
    -     * @var Mage_Catalog_Model_Resource_Product_Option
    -     */
    -    protected $_resource;
    -
         /**
          * Translate instance
          *
    @@ -92,17 +85,6 @@ class Mage_Catalog_Model_Product_Option extends Mage_Core_Model_Abstract
          */
         protected $_translate;
     
    -    /**
    -     * Initialize data
    -     *
    -     * @param array $data
    -     */
    -    public function __construct(array $data = array())
    -    {
    -        $this->_resource = isset($data['resource']) ? $data['resource'] : null;
    -        parent::__construct($data);
    -    }
    -
         /**
          * Get resource instance
          *
    diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Option/Api/V2.php
    index 4380c13c998dd..c0054c715ce30 100644
    --- a/app/code/core/Mage/Catalog/Model/Product/Option/Api/V2.php
    +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Api/V2.php
    @@ -69,7 +69,7 @@ public function update($optionId, $data, $store = null)
          * @param int|string|null $store
          * @return array
          */
    -    public function items($productId, $store)
    +    public function items($productId, $store = null)
         {
             $result = parent::items($productId, $store);
             foreach ($result as $key => $option) {
    diff --git a/app/code/core/Mage/Catalog/Model/Resource/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Abstract.php
    index 3616a387a72cd..d1b98dfca5f96 100755
    --- a/app/code/core/Mage/Catalog/Model/Resource/Abstract.php
    +++ b/app/code/core/Mage/Catalog/Model/Resource/Abstract.php
    @@ -455,7 +455,7 @@ protected function _deleteAttributes($object, $table, $info)
         protected function _getOrigObject($object)
         {
             $className  = get_class($object);
    -        $origObject = new $className();
    +        $origObject = Mage::getModel($className);
             $origObject->setData(array());
             $origObject->setStoreId($object->getStoreId());
             $this->load($origObject, $object->getData($this->getEntityIdField()));
    diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php
    index 29d59fa6c1a4d..010e0a1fdb560 100755
    --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php
    +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php
    @@ -241,38 +241,36 @@ protected function _loadPrices()
                 }
     
                 $values = array();
    -
    -            foreach ($this->_items as $item) {
    -               $productAttribute = $item->getProductAttribute();
    -               if (!($productAttribute instanceof Mage_Eav_Model_Entity_Attribute_Abstract)) {
    -                   continue;
    -               }
    -               $options = $productAttribute->getFrontend()->getSelectOptions();
    -               foreach ($options as $option) {
    -                   $usedProducts = $this->getProduct()
    -                       ->getTypeInstance()
    -                       ->getUsedProducts($this->getProduct());
    -                   foreach ($usedProducts as $associatedProduct) {
    -                        if (!empty($option['value'])
    -                            && $option['value'] == $associatedProduct->getData(
    -                                                        $productAttribute->getAttributeCode())) {
    -                            // If option available in associated product
    -                            if (!isset($values[$item->getId() . ':' . $option['value']])) {
    -                                // If option not added, we will add it.
    -                                $values[$item->getId() . ':' . $option['value']] = array(
    -                                    'product_super_attribute_id' => $item->getId(),
    -                                    'value_index'                => $option['value'],
    -                                    'label'                      => $option['label'],
    -                                    'default_label'              => $option['label'],
    -                                    'store_label'                => $option['label'],
    -                                    'is_percent'                 => 0,
    -                                    'pricing_value'              => null,
    -                                    'use_default_value'          => true
    -                                );
    +            $usedProducts = $this->getProduct()->getTypeInstance()->getUsedProducts($this->getProduct());
    +            if ($usedProducts) {
    +                foreach ($this->_items as $item) {
    +                    $productAttribute = $item->getProductAttribute();
    +                    if (!($productAttribute instanceof Mage_Eav_Model_Entity_Attribute_Abstract)) {
    +                        continue;
    +                    }
    +                    $itemId = $item->getId();
    +                    $options = $productAttribute->getFrontend()->getSelectOptions();
    +                    foreach ($options as $option) {
    +                        foreach ($usedProducts as $associatedProduct) {
    +                            $attributeCodeValue = $associatedProduct->getData($productAttribute->getAttributeCode());
    +                            if (!empty($option['value']) && $option['value'] == $attributeCodeValue) {
    +                                // If option available in associated product
    +                                if (!isset($values[$item->getId() . ':' . $option['value']])) {
    +                                    $values[$itemId . ':' . $option['value']] = array(
    +                                        'product_super_attribute_id' => $itemId,
    +                                        'value_index'                => $option['value'],
    +                                        'label'                      => $option['label'],
    +                                        'default_label'              => $option['label'],
    +                                        'store_label'                => $option['label'],
    +                                        'is_percent'                 => 0,
    +                                        'pricing_value'              => null,
    +                                        'use_default_value'          => true
    +                                    );
    +                                }
                                 }
                             }
    -                   }
    -               }
    +                    }
    +                }
                 }
     
                 foreach ($pricings[0] as $pricing) {
    diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.16-1.6.0.0.17.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.16-1.6.0.0.17.php
    index b70409fbc1c66..9bac7e7a5cf2a 100644
    --- a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.16-1.6.0.0.17.php
    +++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.16-1.6.0.0.17.php
    @@ -27,7 +27,7 @@
     /** @var $this Mage_Catalog_Model_Resource_Setup */
     
     /** @var $installer Mage_Core_Model_Resource_Setup_Migration */
    -$installer = Mage::getResourceModel('Mage_Core_Model_Resource_Setup_Migration', 'core_setup');
    +$installer = Mage::getResourceModel('Mage_Core_Model_Resource_Setup_Migration', array('resourceName' => 'core_setup'));
     $installer->startSetup();
     
     $attributeData = $this->getAttribute('catalog_category', 'custom_layout_update');
    diff --git a/app/code/core/Mage/Install/view/install/js/locale.js b/app/code/core/Mage/Catalog/view/frontend/js/compare.js
    similarity index 55%
    rename from app/code/core/Mage/Install/view/install/js/locale.js
    rename to app/code/core/Mage/Catalog/view/frontend/js/compare.js
    index ffea04fc42949..02f16fea0d7a9 100644
    --- a/app/code/core/Mage/Install/view/install/js/locale.js
    +++ b/app/code/core/Mage/Catalog/view/frontend/js/compare.js
    @@ -17,22 +17,33 @@
      * versions in the future. If you wish to customize Magento for your
      * needs please refer to http://www.magentocommerce.com for more information.
      *
    - * @category    install locale
    + * @category    mage compare list
      * @package     mage
      * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
      * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
      */
    -/*jshint browser:true jquery:true */
    -/*global location:true */
    +/*jshint browser:true jquery:true*/
    +/*global confirm:true*/
     (function ($) {
         $(document).ready(function () {
    -        // Trigger initialize event
    -        var installData = { changeUrl: null };
    -        $.mage.event.trigger("mage.install.initialize", installData);
    -        // Setting php session for locale, timezone and currency
    -        $('#locale').on('change', function () {
    -            var url = installData.changeUrl + 'locale/' + $('#locale').val() + '/?timezone=' + $('#timezone').val() + '&currency=' + $('#currency').val();
    -            $(location).attr('href', url);
    -        });
    +        var _compare = {
    +            listSelector: null,
    +            removeConfirmMessage: null,
    +            removeSelector: null,
    +            clearAllConfirmMessage: null,
    +            clearAllSelector: null
    +        };
    +
    +        $.mage.event.trigger('mage.compare.initialize', _compare);
    +        $(_compare.listSelector).decorate('list', true);
    +
    +        function _confirmMessage(selector, message) {
    +            $(selector).on('click', function () {
    +                return confirm(message);
    +            });
    +        }
    +
    +        _confirmMessage(_compare.removeSelector, _compare.removeConfirmMessage);
    +        _confirmMessage(_compare.clearAllSelector, _compare.clearAllConfirmMessage);
         });
    -})(jQuery);
    +})(jQuery);
    \ No newline at end of file
    diff --git a/app/code/core/Mage/Catalog/view/frontend/js/configurable.js b/app/code/core/Mage/Catalog/view/frontend/js/configurable.js
    new file mode 100644
    index 0000000000000..41a2d9ae03593
    --- /dev/null
    +++ b/app/code/core/Mage/Catalog/view/frontend/js/configurable.js
    @@ -0,0 +1,257 @@
    +/**
    + * Magento
    + *
    + * NOTICE OF LICENSE
    + *
    + * This source file is subject to the Academic Free License (AFL 3.0)
    + * that is bundled with this package in the file LICENSE_AFL.txt.
    + * It is also available through the world-wide-web at this URL:
    + * http://opensource.org/licenses/afl-3.0.php
    + * If you did not receive a copy of the license and are unable to
    + * obtain it through the world-wide-web, please send an email
    + * to license@magentocommerce.com so we can send you a copy immediately.
    + *
    + * DISCLAIMER
    + *
    + * Do not edit or add to this file if you wish to upgrade Magento to newer
    + * versions in the future. If you wish to customize Magento for your
    + * needs please refer to http://www.magentocommerce.com for more information.
    + *
    + * @category    frontend configurable product price option
    + * @package     mage
    + * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
    + * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
    + */
    +/*jshint evil:true browser:true jquery:true*/
    +
    +(function ($, undefined) {
    +    $.widget('mage.configurable', {
    +        options: {
    +            state: {}
    +        },
    +        _create: function () {
    +            this.options.taxConfig = this.options.spConfig.taxConfig;
    +            if (this.options.containerId) {
    +                this.options.setings = $('#' + this.options.spConfig.containerId + ' ' + '.super-attribute-select');
    +            } else {
    +                this.options.setings = $('.super-attribute-select');
    +            }
    +            // Overwrite defaults by url
    +            if (this.options.spConfig.defaultValues) {
    +                this.options.values = this.options.spConfig.defaultValues;
    +            }
    +            var separatorIndex = window.location.href.indexOf('#');
    +            if (separatorIndex !== -1) {
    +                var paramsStr = window.location.href.substr(separatorIndex + 1);
    +                var urlValues = paramsStr.toQueryParams();
    +                if (!this.options.spConfig.defaultValues) {
    +                    this.options.values = {};
    +                }
    +                for (var i = 0; i < urlValues.length; i++) {
    +                    this.options.values[i] = urlValues[i];
    +                }
    +            }
    +            // Overwrite defaults by inputs values if needed
    +            if (this.options.spConfig.inputsInitialized) {
    +                this.options.values = {};
    +                $.each(this.options.setings, $.proxy(function (index, element) {
    +                    if (element.value) {
    +                        var attributeId = element.id.replace(/[a-z]*/, '');
    +                        this.options.values[attributeId] = element.value;
    +                    }
    +                }, this));
    +            }
    +            // Put events to check select reloads
    +            $.each(this.options.setings, $.proxy(function (index, element) {
    +                $(element).on('change', this, this._configure);
    +            }, this));
    +            // fill state
    +            $.each(this.options.setings, $.proxy(function (index, element) {
    +                var attributeId = element.id.replace(/[a-z]*/, '');
    +                if (attributeId && this.options.spConfig.attributes[attributeId]) {
    +                    element.config = this.options.spConfig.attributes[attributeId];
    +                    element.attributeId = attributeId;
    +                    this.options.state[attributeId] = false;
    +                }
    +            }, this));
    +            var childSettings = [];
    +            for (var j = this.options.setings.length - 1; j >= 0; j--) {
    +                var prevSetting = this.options.setings[j - 1] ? this.options.setings[j - 1] : false;
    +                var nextSetting = this.options.setings[j + 1] ? this.options.setings[j + 1] : false;
    +                if (j === 0) {
    +                    this._fillSelect(this.options.setings[j]);
    +                } else {
    +                    this.options.setings[j].disabled = true;
    +                }
    +                this.options.setings[j].childsetings = childSettings.slice(0);
    +                this.options.setings[j].prevSetting = prevSetting;
    +                this.options.setings[j].nextSetting = nextSetting;
    +                childSettings.push(this.options.setings[j]);
    +            }
    +            // Set values to inputs
    +            this._configureForValues();
    +        },
    +        _configureForValues: function () {
    +            if (this.options.values) {
    +                this.options.setings.each($.proxy(function (index, element) {
    +                    var attributeId = element.attributeId;
    +                    element.value = (typeof(this.options.values[attributeId]) === 'undefined') ? '' : this.options.values[attributeId];
    +                    this._configureElement(element);
    +                }, this));
    +            }
    +        },
    +        _configure: function (event) {
    +            event.data._configureElement(this);
    +        },
    +        _configureElement: function (element) {
    +            this._reloadOptionLabels(element);
    +            if (element.value) {
    +                this.options.state[element.config.id] = element.value;
    +                if (element.nextSetting) {
    +                    element.nextSetting.disabled = false;
    +                    this._fillSelect(element.nextSetting);
    +                    this._resetChildren(element.nextSetting);
    +                }
    +            }
    +            else {
    +                this._resetChildren(element);
    +            }
    +            this._reloadPrice();
    +        },
    +        _reloadOptionLabels: function (element) {
    +            var selectedPrice = 0;
    +            if (element.options[element.selectedIndex].config && !this.options.spConfig.stablePrices) {
    +                selectedPrice = parseFloat(element.options[element.selectedIndex].config.price);
    +            }
    +            for (var i = 0; i < element.options.length; i++) {
    +                if (element.options[i].config) {
    +                    element.options[i].text = this._getOptionLabel(element.options[i].config, element.options[i].config.price - selectedPrice);
    +                }
    +            }
    +        },
    +        _resetChildren: function (element) {
    +            if (element.childsetings) {
    +                for (var i = 0; i < element.childsetings.length; i++) {
    +                    element.childsetings[i].selectedIndex = 0;
    +                    element.childsetings[i].disabled = true;
    +                    if (element.config) {
    +                        this.options.state[element.config.id] = false;
    +                    }
    +                }
    +            }
    +        },
    +        _fillSelect: function (element) {
    +            var attributeId = element.id.replace(/[a-z]*/, '');
    +            var options = this._getAttributeOptions(attributeId);
    +            this._clearSelect(element);
    +            element.options[0] = new Option('', '');
    +            element.options[0].innerHTML = this.options.spConfig.chooseText;
    +
    +            var prevConfig = false;
    +            if (element.prevSetting) {
    +                prevConfig = element.prevSetting.options[element.prevSetting.selectedIndex];
    +            }
    +            if (options) {
    +                var index = 1;
    +                for (var i = 0; i < options.length; i++) {
    +                    var allowedProducts = [];
    +                    if (prevConfig) {
    +                        for (var j = 0; j < options[i].products.length; j++) {
    +                            if (prevConfig.config.allowedProducts && prevConfig.config.allowedProducts.indexOf(options[i].products[j]) > -1) {
    +                                allowedProducts.push(options[i].products[j]);
    +                            }
    +                        }
    +                    } else {
    +                        allowedProducts = options[i].products.slice(0);
    +                    }
    +                    if (allowedProducts.size() > 0) {
    +                        options[i].allowedProducts = allowedProducts;
    +                        element.options[index] = new Option(this._getOptionLabel(options[i], options[i].price), options[i].id);
    +                        if (typeof options[i].price !== 'undefined') {
    +                            element.options[index].setAttribute('price', options[i].price);
    +                        }
    +                        element.options[index].config = options[i];
    +                        index++;
    +                    }
    +                }
    +            }
    +        },
    +        _getOptionLabel: function (option, price) {
    +            price = parseFloat(price);
    +            var tax, incl, excl;
    +            if (this.options.taxConfig.includeTax) {
    +                tax = price / (100 + this.options.taxConfig.defaultTax) * this.options.taxConfig.defaultTax;
    +                excl = price - tax;
    +                incl = excl * (1 + (this.options.taxConfig.currentTax / 100));
    +            } else {
    +                tax = price * (this.options.taxConfig.currentTax / 100);
    +                excl = price;
    +                incl = excl + tax;
    +            }
    +
    +            if (this.options.taxConfig.showIncludeTax || this.options.taxConfig.showBothPrices) {
    +                price = incl;
    +            } else {
    +                price = excl;
    +            }
    +
    +            var str = option.label;
    +            if (price) {
    +                if (this.options.taxConfig.showBothPrices) {
    +                    str += ' ' + this._formatPrice(excl, true) + ' (' + this._formatPrice(price, true) + ' ' + this.options.taxConfig.inclTaxTitle + ')';
    +                } else {
    +                    str += ' ' + this._formatPrice(price, true);
    +                }
    +            }
    +            return str;
    +        },
    +        _formatPrice: function (price, showSign) {
    +            var str = '';
    +            price = parseFloat(price);
    +            if (showSign) {
    +                if (price < 0) {
    +                    str += '-';
    +                    price = -price;
    +                }
    +                else {
    +                    str += '+';
    +                }
    +            }
    +            var roundedPrice = (Math.round(price * 100) / 100).toString();
    +            if (this.options.spConfig.prices && this.options.spConfig.prices[roundedPrice]) {
    +                str += this.options.spConfig.prices[roundedPrice];
    +            }
    +            else {
    +                str += this.options.spConfig.template.replace(/#\{(.*?)\}/, price.toFixed(2));
    +            }
    +            return str;
    +        },
    +        _clearSelect: function (element) {
    +            for (var i = element.options.length - 1; i >= 0; i--) {
    +                element.remove(i);
    +            }
    +        },
    +        _getAttributeOptions: function (attributeId) {
    +            if (this.options.spConfig.attributes[attributeId]) {
    +                return this.options.spConfig.attributes[attributeId].options;
    +            }
    +        },
    +        _reloadPrice: function () {
    +            if (this.options.spConfig.disablePriceReload) {
    +                return true;
    +            }
    +            var price = 0;
    +            var oldPrice = 0;
    +            for (var i = this.options.setings.length - 1; i >= 0; i--) {
    +                var selected = this.options.setings[i].options[this.options.setings[i].selectedIndex];
    +                if (selected.config) {
    +                    price += parseFloat(selected.config.price);
    +                    oldPrice += parseFloat(selected.config.oldPrice);
    +                }
    +            }
    +            this.options.priceOptionInstance.changePrice('config', {'price': price, 'oldPrice': oldPrice});
    +            this.options.priceOptionInstance.reloadPrice();
    +            return price;
    +        }
    +    });
    +})(jQuery);
    \ No newline at end of file
    diff --git a/app/code/core/Mage/Catalog/view/frontend/js/file-option.js b/app/code/core/Mage/Catalog/view/frontend/js/file-option.js
    new file mode 100644
    index 0000000000000..cf7963d0cf4a9
    --- /dev/null
    +++ b/app/code/core/Mage/Catalog/view/frontend/js/file-option.js
    @@ -0,0 +1,63 @@
    +/**
    + * Magento
    + *
    + * NOTICE OF LICENSE
    + *
    + * This source file is subject to the Academic Free License (AFL 3.0)
    + * that is bundled with this package in the file LICENSE_AFL.txt.
    + * It is also available through the world-wide-web at this URL:
    + * http://opensource.org/licenses/afl-3.0.php
    + * If you did not receive a copy of the license and are unable to
    + * obtain it through the world-wide-web, please send an email
    + * to license@magentocommerce.com so we can send you a copy immediately.
    + *
    + * DISCLAIMER
    + *
    + * Do not edit or add to this file if you wish to upgrade Magento to newer
    + * versions in the future. If you wish to customize Magento for your
    + * needs please refer to http://www.magentocommerce.com for more information.
    + *
    + * @category    mage file change/delete
    + * @package     mage
    + * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
    + * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
    + */
    +/*jshint browser:true jquery:true*/
    +(function($) {
    +    $.widget('mage.fileOption', {
    +        options: {
    +        },
    +
    +        _create: function() {
    +            this.fileDeleteFlag = this.fileChangeFlag = false;
    +            this.inputField = this.element.find('input[name=' + this.options.fileName + ']')[0];
    +            this.inputFieldAction = this.element.find('input[name=' + this.options.fieldNameAction + ']')[0];
    +            this.fileNameSpan = this.element.parent('dd').find('.' + this.options.fileNamed);
    +
    +            $(this.options.changeFileSelector).on('click', $.proxy(function() {
    +                this._toggleFileChange();
    +            }, this));
    +            $(this.options.deleteFileSelector).on('click', $.proxy(function() {
    +                this._toggleFileDelete();
    +            }, this));
    +        },
    +
    +        _toggleFileChange: function() {
    +            this.element.toggle();
    +            this.fileChangeFlag = !this.fileChangeFlag;
    +            if (!this.fileDeleteFlag) {
    +                $(this.inputFieldAction).attr('value', this.fileChangeFlag ? 'save_new' : 'save_old');
    +                this.inputField.disabled = !this.fileChangeFlag;
    +            }
    +        },
    +
    +        _toggleFileDelete: function() {
    +            this.fileDeleteFlag = $(this.options.deleteFileSelector + ':checked').val();
    +            $(this.inputFieldAction).attr('value',
    +                this.fileDeleteFlag ? '' : this.fileChangeFlag ? 'save_new' : 'save_old');
    +            this.inputField.disabled = this.fileDeleteFlag || !this.fileChangeFlag;
    +            this.fileNameSpan.css('text-decoration', this.fileDeleteFlag ? 'line-through' : 'none');
    +        }
    +    });
    +})(jQuery);
    +
    diff --git a/app/code/core/Mage/Catalog/view/frontend/js/grid.js b/app/code/core/Mage/Catalog/view/frontend/js/grid.js
    index 6d5a0901aa961..eacd190b26971 100644
    --- a/app/code/core/Mage/Catalog/view/frontend/js/grid.js
    +++ b/app/code/core/Mage/Catalog/view/frontend/js/grid.js
    @@ -24,26 +24,23 @@
      */
     /*jshint browser:true jquery:true*/
     (function ($) {
    -    // Default fields to initialize for grid
         var gridInit = {
    -        listId: null,
    -        decoratorParams: null,
    -        genericSelector: null
    +        listId: undefined,
    +        decoratorParams: undefined,
    +        genericSelector: undefined
         };
     
         $(document).ready(function () {
    -        // Trigger initalize event
             $.mage.event.trigger("mage.grid.initialize", gridInit);
    -
             if (gridInit.listId) {
    -            $.mage.decorator.list(gridInit.listId);
    +            $(gridInit.listId).decorate('list');
             }
             if (gridInit.genericSelector) {
                 if (gridInit.decoratorParams) {
    -                $.mage.decorator.general($(gridInit.genericSelector), gridInit.decoratorParams);
    +                $(gridInit.genericSelector).decorate('generic', gridInit.decoratorParams);
                 }
                 else {
    -                $.mage.decorator.general($(gridInit.genericSelector));
    +                $(gridInit.genericSelector).decorate('generic');
                 }
             }
         });
    diff --git a/app/code/core/Mage/Catalog/view/frontend/js/list.js b/app/code/core/Mage/Catalog/view/frontend/js/list.js
    new file mode 100644
    index 0000000000000..4b689bc970757
    --- /dev/null
    +++ b/app/code/core/Mage/Catalog/view/frontend/js/list.js
    @@ -0,0 +1,86 @@
    +/**
    + * Magento
    + *
    + * NOTICE OF LICENSE
    + *
    + * This source file is subject to the Academic Free License (AFL 3.0)
    + * that is bundled with this package in the file LICENSE_AFL.txt.
    + * It is also available through the world-wide-web at this URL:
    + * http://opensource.org/licenses/afl-3.0.php
    + * If you did not receive a copy of the license and are unable to
    + * obtain it through the world-wide-web, please send an email
    + * to license@magentocommerce.com so we can send you a copy immediately.
    + *
    + * DISCLAIMER
    + *
    + * Do not edit or add to this file if you wish to upgrade Magento to newer
    + * versions in the future. If you wish to customize Magento for your
    + * needs please refer to http://www.magentocommerce.com for more information.
    + *
    + * @category    mage compare list
    + * @package     mage
    + * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
    + * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
    + */
    +/*jshint browser:true jquery:true*/
    +
    +(function ($) {
    +    $(document).ready(function () {
    +        var _compareList = {
    +            productSelector: null,
    +            productImageSelector: null,
    +            productAddToCartSelector: null,
    +            productWishListSelector: null,
    +            productRemoveSelector: null,
    +            productFormSelector: null,
    +            ajaxSpinner: null,
    +            windowCloseSelector: null,
    +            printSelector: null
    +        };
    +
    +        $.mage.event.trigger('mage.compare-list.initialize', _compareList);
    +        $(_compareList.productFormSelector).decorate('table');
    +
    +        function _setParentWindow(selector) {
    +            $(selector).on('click', function (e) {
    +                e.preventDefault();
    +                window.opener.focus();
    +                window.opener.location.href = $(this).data('url');
    +            });
    +        }
    +
    +        // Window close
    +        $(_compareList.windowCloseSelector).on('click', function () {
    +            window.close();
    +        });
    +        // Window print
    +        $(_compareList.printSelector).on('click', function (e) {
    +            e.preventDefault();
    +            window.print();
    +        });
    +
    +        $(_compareList.productRemoveSelector).on('click', function (e) {
    +            e.preventDefault();
    +            // Send remove item request, after that reload windows
    +            $.ajax({
    +                url: $(_compareList.productRemoveSelector).data('url'),
    +                type: 'POST',
    +                beforeSend: function () {
    +                    $(_compareList.ajaxSpinner).show();
    +                }
    +            }).done(function () {
    +                $(_compareList.ajaxSpinner).hide();
    +                window.location.reload();
    +                window.opener.location.reload();
    +            });
    +        });
    +
    +        $.each(_compareList, function (index, prop) {
    +            // Removed properties that doesn't need to call _setParentWindow
    +            var notAllowedProp = ['windowCloseSelector', 'printSelector', 'productRemoveSelector', 'ajaxSpinner','productFormSelector'];
    +            if ($.inArray(index, notAllowedProp) === -1) {
    +                _setParentWindow(prop);
    +            }
    +        });
    +    });
    +})(jQuery);
    \ No newline at end of file
    diff --git a/app/code/core/Mage/Catalog/view/frontend/js/msrp.js b/app/code/core/Mage/Catalog/view/frontend/js/msrp.js
    new file mode 100644
    index 0000000000000..6089cbd3b7e0b
    --- /dev/null
    +++ b/app/code/core/Mage/Catalog/view/frontend/js/msrp.js
    @@ -0,0 +1,144 @@
    +/**
    + * Magento
    + *
    + * NOTICE OF LICENSE
    + *
    + * This source file is subject to the Academic Free License (AFL 3.0)
    + * that is bundled with this package in the file LICENSE_AFL.txt.
    + * It is also available through the world-wide-web at this URL:
    + * http://opensource.org/licenses/afl-3.0.php
    + * If you did not receive a copy of the license and are unable to
    + * obtain it through the world-wide-web, please send an email
    + * to license@magentocommerce.com so we can send you a copy immediately.
    + *
    + * DISCLAIMER
    + *
    + * Do not edit or add to this file if you wish to upgrade Magento to newer
    + * versions in the future. If you wish to customize Magento for your
    + * needs please refer to http://www.magentocommerce.com for more information.
    + *
    + * @category    frontend product msrp
    + * @package     mage
    + * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
    + * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
    + */
    +
    +/*jshint browser:true jquery:true*/
    +(function ($) {
    +
    +    var _clickForPrice = {
    +        helpLink: []
    +    };
    +    var _popupCloseData = {
    +        closeButtonId: ''
    +    };
    +
    +    var _helpLinkData = {
    +        helpText: []
    +    };
    +
    +    var _popupCartData = {
    +        cartData: []
    +    };
    +
    +    var _cartData = {
    +        cartFormData: []
    +    };
    +
    +    $(document).ready(function () {
    +        $.mage.event.trigger("mage.price.helplink", _clickForPrice);
    +        $.mage.event.trigger("map.popup.close", _popupCloseData);
    +        $.mage.event.trigger("mage.popup.whatsthislink", _helpLinkData);
    +        $.mage.event.trigger("map.popup.button", _popupCartData);
    +        $.mage.event.trigger("product.addtocart.button", _cartData);
    +        $.mage.event.trigger("product.updatecart.button", _cartData);
    +
    +        $.each(_clickForPrice.helpLink, function (index, value) {
    +
    +            $(value.popupId).on('click', function (e) {
    +                if(value.submitUrl){
    +                    location.href=value.submitUrl;
    +                } else {
    +                    $('#map-popup-heading').text(value.productName);
    +                    $('#map-popup-price').html($(value.realPrice));
    +                    $('#map-popup-msrp').html(value.msrpPrice);
    +
    +                    var width = $('#map-popup').width();
    +                    var offsetX = e.pageX - (width / 2) + "px";
    +                    $('#map-popup').css({left: offsetX, top: e.pageY}).show();
    +                    $('#map-popup-content').show();
    +                    $('#map-popup-text').addClass('map-popup-only-text').show();
    +                    $('#map-popup-text-what-this').hide();
    +                    return false;
    +                }
    +            });
    +
    +        });
    +
    +        $.each(_helpLinkData.helpText, function (index, value) {
    +            $(value.helpLinkId).on('click', function (e) {
    +                $('#map-popup-heading').text(value.productName);
    +                var width = $('#map-popup').width();
    +                var offsetX = e.pageX - (width / 2) + "px";
    +                $('#map-popup').css({left: offsetX, top: e.pageY}).show();
    +                $('#map-popup-content').hide();
    +                $('#map-popup-text').hide();
    +                $('#map-popup-text-what-this').show();
    +                return false;
    +            });
    +        });
    +
    +        $(_popupCloseData.closeButtonId).on('click', function () {
    +            $('#map-popup').hide();
    +            return false;
    +        });
    +
    +        $.each($.merge(_cartData.cartFormData, _popupCartData.cartData), function (index, value) {
    +            $(value.cartButtonId).on('click', function () {
    +
    +                if(value.cartForm){
    +                    $(value.cartForm).mage().validate({
    +                        errorPlacement: function (error, element) {
    +                            if (element.is(':radio') || element.is(':checkbox')) {
    +                                element.closest('ul').after(error);
    +                            } else {
    +                                element.after(error);
    +                            }
    +                        },
    +                        highlight: function (element) {
    +                            if ($(element).is(':radio') || $(element).is(':checkbox')) {
    +                                $(element).closest('ul').addClass('mage-error');
    +                            } else {
    +                                $(element).addClass('mage-error');
    +                            }
    +                        },
    +                        unhighlight: function (element) {
    +                            if ($(element).is(':radio') || $(element).is(':checkbox')) {
    +                                $(element).closest('ul').removeClass('mage-error');
    +                            } else {
    +                                $(element).removeClass('mage-error');
    +                            }
    +                        }
    +                    });
    +                }
    +                if(value.addToCartUrl) {
    +                    if($('#map-popup')){
    +                        $('#map-popup').hide();
    +                    }
    +                    if(opener !== null){
    +                        opener.location.href=value.addToCartUrl;
    +                    } else {
    +                        location.href=value.addToCartUrl;
    +                    }
    +
    +                }else if(value.cartForm){
    +                    $(value.cartForm).submit();
    +                }
    +
    +            });
    +        });
    +
    +    });
    +
    +})(jQuery);
    +
    diff --git a/app/code/core/Mage/Catalog/view/frontend/js/price-option.js b/app/code/core/Mage/Catalog/view/frontend/js/price-option.js
    new file mode 100644
    index 0000000000000..6d248efa511e2
    --- /dev/null
    +++ b/app/code/core/Mage/Catalog/view/frontend/js/price-option.js
    @@ -0,0 +1,204 @@
    +/**
    + * Magento
    + *
    + * NOTICE OF LICENSE
    + *
    + * This source file is subject to the Academic Free License (AFL 3.0)
    + * that is bundled with this package in the file LICENSE_AFL.txt.
    + * It is also available through the world-wide-web at this URL:
    + * http://opensource.org/licenses/afl-3.0.php
    + * If you did not receive a copy of the license and are unable to
    + * obtain it through the world-wide-web, please send an email
    + * to license@magentocommerce.com so we can send you a copy immediately.
    + *
    + * DISCLAIMER
    + *
    + * Do not edit or add to this file if you wish to upgrade Magento to newer
    + * versions in the future. If you wish to customize Magento for your
    + * needs please refer to http://www.magentocommerce.com for more information.
    + *
    + * @category    frontend product price option
    + * @package     mage
    + * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
    + * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
    + */
    +/*jshint evil:true browser:true jquery:true*/
    +
    +(function ($, undefined) {
    +    $.widget('mage.priceOption', {
    +        options: {
    +            productCustomSelector: '.product-custom-option',
    +            prices: {}
    +        },
    +        _create: function () {
    +            $(this.options.productCustomSelector).each(
    +                $.proxy(function (key, value) {
    +                    var element = $(value);
    +                    if (element.attr('type') === 'checkbox' || element.attr('type') === 'radio') {
    +                        element.on('click', $.proxy(this.reloadPrice, this));
    +                    }
    +                    else if (element.prop('tagName') === 'SELECT' ||
    +                        element.prop('tagName') === 'TEXTAREA' ||
    +                        element.attr('type') === 'text' || element.attr('type') === 'file') {
    +                        element.on('change', $.proxy(this.reloadPrice, this));
    +                    }
    +                }, this)
    +            );
    +        },
    +        _formatCurrency: function (price, format, showPlus) {
    +            var precision = isNaN(format.requiredPrecision = Math.abs(format.requiredPrecision)) ? 2 : format.requiredPrecision;
    +            var integerRequired = isNaN(format.integerRequired = Math.abs(format.integerRequired)) ? 1 : format.integerRequired;
    +            var decimalSymbol = format.decimalSymbol === undefined ? "," : format.decimalSymbol;
    +            var groupSymbol = format.groupSymbol === undefined ? "." : format.groupSymbol;
    +            var groupLength = format.groupLength === undefined ? 3 : format.groupLength;
    +            var s = '';
    +
    +            if (showPlus === undefined || showPlus === true) {
    +                s = price < 0 ? "-" : ( showPlus ? "+" : "");
    +            } else if (showPlus === false) {
    +                s = '';
    +            }
    +            var i = parseInt(price = Math.abs(+price || 0).toFixed(precision), 10) + '';
    +            var pad = (i.length < integerRequired) ? (integerRequired - i.length) : 0;
    +            while (pad) {
    +                i = '0' + i;
    +                pad--;
    +            }
    +            var j = i.length > groupLength ? i.length % groupLength : 0;
    +            var re = new RegExp("(\\d{" + groupLength + "})(?=\\d)", "g");
    +
    +            /**
    +             * replace(/-/, 0) is only for fixing Safari bug which appears
    +             * when Math.abs(0).toFixed() executed on "0" number.
    +             * Result is "0.-0" :(
    +             */
    +            var r = (j ? i.substr(0, j) + groupSymbol : "") + i.substr(j).replace(re, "$1" + groupSymbol) +
    +                (precision ? decimalSymbol + Math.abs(price - i).toFixed(precision).replace(/-/, 0).slice(2) : "");
    +            var pattern = '';
    +            pattern = format.pattern.indexOf('{sign}') < 0 ? s + format.pattern : format.pattern.replace('{sign}', s);
    +            return pattern.replace('%s', r).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
    +
    +        },
    +        changePrice: function (key, price) {
    +            this.options.prices[key] = price;
    +        },
    +        _getOptionPrices: function () {
    +            var price = 0;
    +            var oldPrice = 0;
    +            $.each(this.options.prices, function (key, pair) {
    +                price += parseFloat(pair.price);
    +                oldPrice += parseFloat(pair.oldPrice);
    +            });
    +            var result = [price, oldPrice];
    +            return result;
    +        },
    +        reloadPrice: function () {
    +            if (this.options.priceConfig) {
    +                var priceSelectors = [
    +                    '#product-price-' + this.options.priceConfig.productId,
    +                    '#bundle-price-' + this.options.priceConfig.productId,
    +                    '#price-including-tax-' + this.options.priceConfig.productId,
    +                    '#price-excluding-tax-' + this.options.priceConfig.productId,
    +                    '#old-price-' + this.options.priceConfig.productId
    +                ];
    +                var getOptionPrices = this._getOptionPrices();
    +                var optionPrice = {
    +                    excludeTax: 0,
    +                    includeTax: 0,
    +                    oldPrice: 0,
    +                    price: 0,
    +                    update: function (price, excludeTax, includeTax, oldPrice) {
    +                        this.price += price;
    +                        this.excludeTax += excludeTax;
    +                        this.includeTax += includeTax;
    +                        this.oldPrice += oldPrice;
    +                    }
    +                };
    +                $(this.options.productCustomSelector).each($.proxy(function (key, elements) {
    +                    var element = $(elements);
    +                    var optionIdStartIndex, optionIdEndIndex;
    +                    if (element.attr('type') === 'file') {
    +                        optionIdStartIndex = element.attr('name').indexOf('_') + 1;
    +                        optionIdEndIndex = element.attr('name').lastIndexOf('_');
    +                    } else {
    +                        optionIdStartIndex = element.attr('name').indexOf('[') + 1;
    +                        optionIdEndIndex = element.attr('name').indexOf(']');
    +                    }
    +                    var optionId = parseInt(element.attr('name').substring(optionIdStartIndex, optionIdEndIndex), 10);
    +                    if (this.options.optionConfig[optionId]) {
    +                        var configOptions = this.options.optionConfig[optionId];
    +                        if (element.attr('type') === 'checkbox' || element.attr('type') === 'radio') {
    +                            if (element.prop('checked')) {
    +                                if (configOptions[element.val()]) {
    +                                    optionPrice.update(configOptions[element.val()].price,
    +                                        configOptions[element.val()].excludeTax,
    +                                        configOptions[element.val()].includeTax,
    +                                        configOptions[element.val()].oldPrice);
    +                                }
    +                            }
    +                        } else if (element.prop('tagName') === 'SELECT') {
    +                            element.find('option:selected').each(function () {
    +                                if (configOptions[$(this).val()]) {
    +                                    optionPrice.update(configOptions[$(this).val()].price,
    +                                        configOptions[$(this).val()].excludeTax,
    +                                        configOptions[$(this).val()].includeTax,
    +                                        configOptions[$(this).val()].oldPrice);
    +                                }
    +                            });
    +                        } else if (element.prop('tagName') === 'TEXTAREA' || element.attr('type') === 'text') {
    +                            if (element.val()) {
    +                                optionPrice.update(configOptions.price, configOptions.excludeTax,
    +                                    configOptions.includeTax, configOptions.oldPrice);
    +                            }
    +                        } else if (element.attr('type') === 'file') {
    +                            if (element.val() || element.parent('div').siblings().length > 0) {
    +                                optionPrice.update(configOptions.price, configOptions.excludeTax,
    +                                    configOptions.includeTax, configOptions.oldPrice);
    +                            }
    +                        }
    +                    }
    +                }, this));
    +                var updatedPrice = {
    +                    priceExclTax: optionPrice.excludeTax + this.options.priceConfig.priceExclTax,
    +                    priceInclTax: optionPrice.includeTax + this.options.priceConfig.priceInclTax,
    +                    productOldPrice: optionPrice.oldPrice + this.options.priceConfig.productOldPrice,
    +                    productPrice: optionPrice.price + this.options.priceConfig.productPrice
    +                };
    +                // Loop through each priceSelector and update price
    +                $.each(priceSelectors, $.proxy(function (index, value) {
    +                    var priceElement = $(value);
    +                    var clone = $(value + this.options.priceConfig.idSuffix);
    +                    var isClone = false;
    +                    if (priceElement.length === 0) {
    +                        priceElement = clone;
    +                        isClone = true;
    +                    }
    +                    if (priceElement.length === 1) {
    +                        var price = 0;
    +                        if (value.indexOf('price-including-tax-') >= 0) {
    +                            price = updatedPrice.priceInclTax;
    +                        } else if (value.indexOf('price-excluding-tax-') >= 0) {
    +                            price = updatedPrice.priceExclTax;
    +                        } else if (value.indexOf('old-price-') >= 0) {
    +                            if (this.options.priceConfig.showIncludeTax || this.options.priceConfig.showBothPrices) {
    +                                price = updatedPrice.priceInclTax;
    +                            } else {
    +                                price = updatedPrice.priceExclTax;
    +                            }
    +                        } else {
    +                            price = this.options.priceConfig.showIncludeTax ?
    +                                updatedPrice.priceInclTax : updatedPrice.priceExclTax;
    +                        }
    +
    +                        price = price + getOptionPrices[0];
    +                        priceElement.html("" + this._formatCurrency(price, this.options.priceConfig.priceFormat) + "");
    +                        // If clone exists, update clone price as well
    +                        if (!isClone && clone.length === 1) {
    +                            clone.html("" + this._formatCurrency(price, this.options.priceConfig.priceFormat) + "");
    +                        }
    +                    }
    +                }, this));
    +            }
    +        }
    +    });
    +})(jQuery);
    \ No newline at end of file
    diff --git a/app/code/core/Mage/Catalog/view/frontend/js/zoom.js b/app/code/core/Mage/Catalog/view/frontend/js/zoom.js
    new file mode 100644
    index 0000000000000..018d4f2d9c77e
    --- /dev/null
    +++ b/app/code/core/Mage/Catalog/view/frontend/js/zoom.js
    @@ -0,0 +1,197 @@
    +/**
    + * Magento
    + *
    + * NOTICE OF LICENSE
    + *
    + * This source file is subject to the Academic Free License (AFL 3.0)
    + * that is bundled with this package in the file LICENSE_AFL.txt.
    + * It is also available through the world-wide-web at this URL:
    + * http://opensource.org/licenses/afl-3.0.php
    + * If you did not receive a copy of the license and are unable to
    + * obtain it through the world-wide-web, please send an email
    + * to license@magentocommerce.com so we can send you a copy immediately.
    + *
    + * DISCLAIMER
    + *
    + * Do not edit or add to this file if you wish to upgrade Magento to newer
    + * versions in the future. If you wish to customize Magento for your
    + * needs please refer to http://www.magentocommerce.com for more information.
    + *
    + * @category    frontend image zoom
    + * @package     mage
    + * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
    + * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
    + */
    +/*jshint evil:true browser:true jquery:true*/
    +(function ($) {
    +    $(document).ready(function () {
    +        // Default zoom variables
    +        var zoomInit = {
    +            imageSelector: '#image',
    +            sliderSelector: '#slider',
    +            sliderSpeed: 10,
    +            zoomNoticeSelector: '#track_hint',
    +            zoomInSelector: '#zoom_in',
    +            zoomOutSelector: '#zoom_out'
    +        };
    +        $.mage.event.trigger("mage.zoom.initialize", zoomInit);
    +
    +        var slider, intervalId = null;
    +        var sliderMax = $(zoomInit.sliderSelector).width();
    +        var image = $(zoomInit.imageSelector);
    +        var imageWidth = image.width();
    +        var imageHeight = image.height();
    +        var imageParent = image.parent();
    +        var imageParentWidth = imageParent.width();
    +        var imageParentHeight = imageParent.height();
    +        var ceilingZoom, imageInitTop, imageInitLeft;
    +        var showFullImage = false;
    +
    +        // Image is small than parent container, no need to see full picutre or zoom slider
    +        if (imageWidth < imageParentWidth && imageHeight < imageParentHeight) {
    +            $(zoomInit.sliderSelector).parent().hide();
    +            $(zoomInit.zoomNoticeSelector).hide();
    +            return;
    +        }
    +        // Resize Image to fit parent container
    +        if (imageWidth > imageHeight) {
    +            ceilingZoom = imageWidth / imageParentWidth;
    +            image.width(imageParentWidth);
    +            image.css('top', ((imageParentHeight - image.height()) / 2) + 'px');
    +        } else {
    +            ceilingZoom = imageHeight / imageParentHeight;
    +            image.height(imageParentHeight);
    +            image.css('left', ((imageParentWidth - image.width()) / 2) + 'px');
    +        }
    +        // Remember Image original position
    +        imageInitTop = image.position().top;
    +        imageInitLeft = image.position().left;
    +
    +        // Make Image Draggable
    +        function draggableImage() {
    +            var topX = image.offset().left,
    +                topY = image.offset().top,
    +                bottomX = image.offset().left,
    +                bottomY = image.offset().top;
    +            // Calculate x offset if image width is greater than image container width
    +            if (image.width() > imageParentWidth) {
    +                topX = image.width() - (imageParent.offset().left - image.offset().left) - imageParentWidth;
    +                topX = image.offset().left - topX;
    +                bottomX = imageParent.offset().left - image.offset().left;
    +                bottomX = image.offset().left + bottomX;
    +            }
    +            // Calculate y offset if image height is greater than image container height
    +            if (image.height() > imageParentHeight) {
    +                topY = image.height() - (imageParent.offset().top - image.offset().top) - imageParentHeight;
    +                topY = image.offset().top - topY;
    +                bottomY = imageParent.offset().top - image.offset().top;
    +                bottomY = image.offset().top + bottomY;
    +            }
    +            // containment field is used because image is larger than parent container
    +            $(zoomInit.imageSelector).draggable({
    +                containment: [topX, topY, bottomX, bottomY],
    +                scroll: false
    +            });
    +        }
    +
    +        // Image zooming bases on slider position
    +        function zoom(sliderPosition, sliderLength) {
    +            var ratio = sliderPosition / sliderLength;
    +            ratio = ratio > 1 ? 1 : ratio;
    +            var imageOldLeft = image.position().left;
    +            var imageOldTop = image.position().top;
    +            var imageOldWidth = image.width();
    +            var imageOldHeight = image.height();
    +            var overSize = (imageWidth > imageParentWidth || imageHeight > imageParentHeight);
    +            var floorZoom = 1;
    +            var imageZoom = floorZoom + (ratio * (ceilingZoom - floorZoom));
    +            // Zoomed image is larger than container, and resize image based on zoom ratio
    +            if (overSize) {
    +                if (imageWidth > imageHeight) {
    +                    image.width(imageZoom * imageParentWidth);
    +                } else {
    +                    image.height(imageZoom * imageParentHeight);
    +                }
    +            } else {
    +                $(zoomInit.sliderSelector).hide();
    +            }
    +            // Position zoomed image properly
    +            var imageNewLeft = imageOldLeft - (image.width() - imageOldWidth) / 2;
    +            var imageNewTop = imageOldTop - (image.height() - imageOldHeight) / 2;
    +            // Image can't be positioned more left than original left
    +            if (imageNewLeft > imageInitLeft || image.width() < imageParentWidth) {
    +                imageNewLeft = imageInitLeft;
    +            }
    +            // Image can't be positioned more right than the difference between parent width and image current width
    +            if (Math.abs(imageNewLeft) > Math.abs(imageParentWidth - image.width())) {
    +                imageNewLeft = imageParentWidth - image.width();
    +            }
    +            // Image can't be positioned more down than original top
    +            if (imageNewTop > imageInitTop || image.height() < imageParentHeight) {
    +                imageNewTop = imageInitTop;
    +            }
    +            // Image can't be positioned more top than the difference between parent height and image current height
    +            if (Math.abs(imageNewTop) > Math.abs(imageParentHeight - image.height())) {
    +                imageNewTop = imageParentHeight - image.height();
    +            }
    +            image.css('left', imageNewLeft + 'px');
    +            image.css('top', imageNewTop + 'px');
    +            // Because image size and position changed, we need to call recalculate draggable image containment
    +            draggableImage();
    +        }
    +
    +        // Slide slider to zoom in or out the picture
    +        slider = $(zoomInit.sliderSelector).slider({
    +            value: 0,
    +            min: 0,
    +            max: sliderMax,
    +            slide: function (event, ui) {
    +                zoom(ui.value, sliderMax);
    +            },
    +            change: function (event, ui) {
    +                zoom(ui.value, sliderMax);
    +            }
    +        });
    +
    +        // Mousedown on zoom in icon to zoom in picture
    +        $(zoomInit.zoomInSelector).on('mousedown',function () {
    +            intervalId = setInterval(function () {
    +                slider.slider('value', slider.slider('value') + 1);
    +            }, zoomInit.sliderSpeed);
    +        }).on('mouseup mouseleave', function () {
    +                clearInterval(intervalId);
    +            });
    +
    +        // Mousedown on zoom out icon to zoom out picture
    +        $(zoomInit.zoomOutSelector).on('mousedown',function () {
    +            intervalId = setInterval(function () {
    +                slider.slider('value', slider.slider('value') - 1);
    +            }, zoomInit.sliderSpeed);
    +        }).on('mouseup mouseleave', function () {
    +                clearInterval(intervalId);
    +            });
    +
    +        // Double-click image to see full picture
    +        $(zoomInit.imageSelector).on('dblclick', function () {
    +            showFullImage = !showFullImage;
    +            var ratio = showFullImage ? sliderMax : slider.slider('value');
    +            zoom(ratio, sliderMax);
    +            if (showFullImage) {
    +                $(zoomInit.sliderSelector).hide();
    +                $(zoomInit.zoomInSelector).hide();
    +                $(zoomInit.zoomOutSelector).hide();
    +                imageParent.css('overflow', 'visible');
    +                imageParent.css('zIndex', '1000');
    +            } else {
    +                $(zoomInit.sliderSelector).show();
    +                $(zoomInit.zoomInSelector).show();
    +                $(zoomInit.zoomOutSelector).show();
    +                imageParent.css('overflow', 'hidden');
    +                imageParent.css('zIndex', '9');
    +            }
    +        });
    +
    +        // Window resize will change offset for draggable
    +        $(window).resize(draggableImage);
    +    });
    +}(jQuery));
    \ No newline at end of file
    diff --git a/app/code/core/Mage/Catalog/view/frontend/layer/view.phtml b/app/code/core/Mage/Catalog/view/frontend/layer/view.phtml
    index 06a5a6536455e..3e7086603ef33 100644
    --- a/app/code/core/Mage/Catalog/view/frontend/layer/view.phtml
    +++ b/app/code/core/Mage/Catalog/view/frontend/layer/view.phtml
    @@ -52,7 +52,7 @@
                     
                     
                 
    -            
    +            
             
         
    diff --git a/app/code/core/Mage/Catalog/view/frontend/msrp.js b/app/code/core/Mage/Catalog/view/frontend/msrp.js index 074d3c392638b..9dc3c1aad8d5c 100644 --- a/app/code/core/Mage/Catalog/view/frontend/msrp.js +++ b/app/code/core/Mage/Catalog/view/frontend/msrp.js @@ -30,296 +30,296 @@ Catalog.Map = { helpLinks: [], - active: false, - - addHelpLink: function(linkElement, title, actualPrice, msrpPrice, addToCartLink) { - if (typeof linkElement == 'string') { - linkElement = $$(linkElement)[0]; - } - - if (!linkElement) { - return; - } - - var helpLink = { - 'link': linkElement - }; - - var showPopup = false; - - if (typeof title == 'string' && title) { - helpLink.title = title; - showPopup = true; - } - - if (typeof actualPrice == 'string' && actualPrice || typeof actualPrice == 'object' && actualPrice) { - helpLink.price = actualPrice; - showPopup = true; - } - - if (typeof msrpPrice == 'string' && msrpPrice) { - helpLink.msrp = msrpPrice; - showPopup = true; - } - - if (typeof addToCartLink == 'string' && addToCartLink) { - helpLink.cartLink = addToCartLink; - } else if (addToCartLink && addToCartLink.url) { - helpLink.cartLink = addToCartLink.url; - if (addToCartLink.qty) { - helpLink.qty = addToCartLink.qty; - } - if (addToCartLink.notUseForm) { - helpLink.notUseForm = addToCartLink.notUseForm; - } - } - - if (!showPopup) { - this.setGotoView(linkElement, addToCartLink); - } else { - var helpLinkIndex = this.helpLinks.push(helpLink) - 1; - Event.observe(linkElement, 'click', this.showHelp.bind(this.helpLinks[helpLinkIndex])); - } - return helpLink; - }, - - setGotoView: function(element, viewPageUrl) { - $(element).stopObserving('click'); - element.href = viewPageUrl; - if(window.opener) { - Event.observe(element, 'click', function(event) { - setPLocation(this.href,true); - Catalog.Map.hideHelp(); - event.stop(); - }); - } else { - Event.observe(element, 'click', function(event) { - setLocation(this.href); - Catalog.Map.hideHelp(); - window.opener.focus(); - event.stop(); - }); - } - }, - - showSelects: function() { - var elements = document.getElementsByTagName("select"); - for (i=0;i< elements.length;i++) { - elements[i].style.visibility='visible'; - } - }, - - hideSelects: function() { - var elements = document.getElementsByTagName("select"); - for (i=0;i< elements.length;i++) { - elements[i].style.visibility='hidden'; - } - }, - - showHelp: function(event) { - var helpBox = $('map-popup'), - isIE6 = typeof document.body.style.maxHeight === "undefined"; - if (!helpBox) { - return; - } - - //Move help box to be right in body tag - var bodyNode = $$('body')[0]; - if (helpBox.parentNode != bodyNode) { - helpBox.remove(); - bodyNode.insert(helpBox); - // Fix for FF4-FF5 bug with missing alt text after DOM manipulations - var paypalImg = helpBox.select('.paypal-logo > a > img')[0]; - if (paypalImg) paypalImg.src = paypalImg.src; - } - - if (this != Catalog.Map && Catalog.Map.active != this.link) { - helpBox.style.display = 'none'; - if (!helpBox.offsetPosition) { - helpBox.offsetPosition = {left:0, top: 0}; - } - - helpBox.removeClassName('map-popup-right'); - helpBox.removeClassName('map-popup-left'); - if (Element.getWidth(bodyNode) < event.pageX + Element.getWidth(helpBox)) { - helpBox.addClassName('map-popup-left'); - } else if (event.pageX - Element.getWidth(helpBox) < 0) { - helpBox.addClassName('map-popup-right'); - } - - helpBox.style.left = event.pageX - (Element.getWidth(helpBox) / 2) + 'px'; - helpBox.style.top = event.pageY + 10 + 'px'; - - //Title - var mapTitle = $('map-popup-heading'); - if (typeof this.title != 'undefined') { - Element.update(mapTitle, this.title); - $(mapTitle).show(); - } else { - $(mapTitle).hide(); - } - - //MSRP price - var mapMsrp = $('map-popup-msrp-box'); - if (typeof this.msrp != 'undefined') { - Element.update($('map-popup-msrp'), this.msrp); - $(mapMsrp).show(); - } else { - $(mapMsrp).hide(); - } - - //Actual price - var mapPrice = $('map-popup-price-box'); - if (typeof this.price != 'undefined') { - var price = typeof this.price == 'object' ? this.price.innerHTML : this.price; - Element.update($('map-popup-price'), price); - $(mapPrice).show(); - } else { - $(mapPrice).hide(); - } - - //`Add to cart` button - var cartButton = $('map-popup-button'); - if (typeof this.cartLink != 'undefined') { - if (typeof productAddToCartForm == 'undefined' || this.notUseForm) { - Catalog.Map.setGotoView(cartButton, this.cartLink); - productAddToCartForm = $('product_addtocart_form_from_popup'); - } else { - if (this.qty) { - productAddToCartForm.qty = this.qty; - } - cartButton.stopObserving('click'); - cartButton.href = this.cartLink; - Event.observe(cartButton, 'click', function(event) { - productAddToCartForm.action = this.href; - productAddToCartForm.submit(this); - }); - } - productAddToCartForm.action = this.cartLink; - var productField = $('map-popup-product-id'); - productField.value = this.product_id; - $(cartButton).show(); - $$('.additional-addtocart-box').invoke('show'); - } else { - $(cartButton).hide(); - $$('.additional-addtocart-box').invoke('hide'); - } - - //Horizontal line - var mapText = $('map-popup-text'), - mapTextWhatThis = $('map-popup-text-what-this'), - mapContent = $('map-popup-content'); - if (!mapMsrp.visible() && !mapPrice.visible() && !cartButton.visible()) { - //If just `What's this?` link - $(mapText).hide(); - $(mapTextWhatThis).show(); - $(mapTextWhatThis).removeClassName('map-popup-only-text'); - $(mapContent).hide().setStyle({visibility: 'hidden'}); - $('product_addtocart_form_from_popup').hide(); - } else { - $(mapTextWhatThis).hide(); - $(mapText).show(); - $(mapText).addClassName('map-popup-only-text'); - $(mapContent).show().setStyle({visibility: 'visible'}); - $('product_addtocart_form_from_popup').show(); - } - - $(helpBox).show(); - if (isIE6) { - Catalog.Map.hideSelects(); - } - var closeButton = $('map-popup-close'); - if (closeButton) { - $(closeButton).stopObserving('click'); - Event.observe(closeButton, 'click', Catalog.Map.showHelp.bind(this)); - Catalog.Map.active = this.link; - } - } else { - $(helpBox).hide(); - if (isIE6) { - Catalog.Map.showSelects(); - } - Catalog.Map.active = false; - } - - Event.stop(event); - }, - - hideHelp: function(){ - var helpBox = $('map-popup'); - if (helpBox) { - var isIE6 = typeof document.body.style.maxHeight === "undefined"; - $(helpBox).hide(); - if (isIE6) { - Catalog.Map.showSelects(); - } - Catalog.Map.active = false; - } - }, - - bindProductForm: function(){ - if (('undefined' != typeof productAddToCartForm) && productAddToCartForm) { - productAddToCartFormOld = productAddToCartForm; - productAddToCartForm = new VarienForm('product_addtocart_form_from_popup'); - productAddToCartForm.submitLight = productAddToCartFormOld.submitLight; - } else if(!$('product_addtocart_form_from_popup')) { - return false; - } else if ('undefined' == typeof productAddToCartForm) { - productAddToCartForm = new VarienForm('product_addtocart_form_from_popup'); - } - - productAddToCartForm.submit = function(button, url) { - if (('undefined' != typeof productAddToCartFormOld) && productAddToCartFormOld) { - if (Catalog.Map.active) { - Catalog.Map.hideHelp(); - } - if (productAddToCartForm.qty && $('qty')) { - $('qty').value = productAddToCartForm.qty; - } - parentResult = productAddToCartFormOld.submit(); - return false; - } - if(window.opener) { - var parentButton = button; - new Ajax.Request(this.form.action, { - parameters: {isAjax: 1, method: 'GET'}, - onSuccess: function(transport) { - window.opener.focus(); - if (parentButton && parentButton.href) { - setPLocation(parentButton.href, true); - Catalog.Map.hideHelp(); - } - } - }); - return; - } - if (this.validator.validate()) { - var form = this.form; - var oldUrl = form.action; - - if (url) { - form.action = url; - } - if (!form.getAttribute('action')) { - form.action = productAddToCartForm.action; - } - try { - this.form.submit(); - } catch (e) { - this.form.action = oldUrl; - throw e; - } - this.form.action = oldUrl; - - if (button && button != 'undefined') { - button.disabled = true; - } - } - }; - } + active: false + +// addHelpLink: function(linkElement, title, actualPrice, msrpPrice, addToCartLink) { +// if (typeof linkElement == 'string') { +// linkElement = $$(linkElement)[0]; +// } +// +// if (!linkElement) { +// return; +// } +// +// var helpLink = { +// 'link': linkElement +// }; +// +// var showPopup = false; +// +// if (typeof title == 'string' && title) { +// helpLink.title = title; +// showPopup = true; +// } +// +// if (typeof actualPrice == 'string' && actualPrice || typeof actualPrice == 'object' && actualPrice) { +// helpLink.price = actualPrice; +// showPopup = true; +// } +// +// if (typeof msrpPrice == 'string' && msrpPrice) { +// helpLink.msrp = msrpPrice; +// showPopup = true; +// } +// +// if (typeof addToCartLink == 'string' && addToCartLink) { +// helpLink.cartLink = addToCartLink; +// } else if (addToCartLink && addToCartLink.url) { +// helpLink.cartLink = addToCartLink.url; +// if (addToCartLink.qty) { +// helpLink.qty = addToCartLink.qty; +// } +// if (addToCartLink.notUseForm) { +// helpLink.notUseForm = addToCartLink.notUseForm; +// } +// } +// +// if (!showPopup) { +// this.setGotoView(linkElement, addToCartLink); +// } else { +// var helpLinkIndex = this.helpLinks.push(helpLink) - 1; +// Event.observe(linkElement, 'click', this.showHelp.bind(this.helpLinks[helpLinkIndex])); +// } +// return helpLink; +// }, + +// setGotoView: function(element, viewPageUrl) { +// $(element).stopObserving('click'); +// element.href = viewPageUrl; +// if(window.opener) { +// Event.observe(element, 'click', function(event) { +// setPLocation(this.href,true); +// Catalog.Map.hideHelp(); +// event.stop(); +// }); +// } else { +// Event.observe(element, 'click', function(event) { +// setLocation(this.href); +// Catalog.Map.hideHelp(); +// window.opener.focus(); +// event.stop(); +// }); +// } +// }, + +// showSelects: function() { +// var elements = document.getElementsByTagName("select"); +// for (i=0;i< elements.length;i++) { +// elements[i].style.visibility='visible'; +// } +// }, + +// hideSelects: function() { +// var elements = document.getElementsByTagName("select"); +// for (i=0;i< elements.length;i++) { +// elements[i].style.visibility='hidden'; +// } +// }, + +// showHelp: function(event) { +// var helpBox = $('map-popup'), +// isIE6 = typeof document.body.style.maxHeight === "undefined"; +// if (!helpBox) { +// return; +// } +// +// //Move help box to be right in body tag +// var bodyNode = $$('body')[0]; +// if (helpBox.parentNode != bodyNode) { +// helpBox.remove(); +// bodyNode.insert(helpBox); +// // Fix for FF4-FF5 bug with missing alt text after DOM manipulations +// var paypalImg = helpBox.select('.paypal-logo > a > img')[0]; +// if (paypalImg) paypalImg.src = paypalImg.src; +// } +// +// if (this != Catalog.Map && Catalog.Map.active != this.link) { +// helpBox.style.display = 'none'; +// if (!helpBox.offsetPosition) { +// helpBox.offsetPosition = {left:0, top: 0}; +// } +// +// helpBox.removeClassName('map-popup-right'); +// helpBox.removeClassName('map-popup-left'); +// if (Element.getWidth(bodyNode) < event.pageX + Element.getWidth(helpBox)) { +// helpBox.addClassName('map-popup-left'); +// } else if (event.pageX - Element.getWidth(helpBox) < 0) { +// helpBox.addClassName('map-popup-right'); +// } +// +// helpBox.style.left = event.pageX - (Element.getWidth(helpBox) / 2) + 'px'; +// helpBox.style.top = event.pageY + 10 + 'px'; +// +// //Title +// var mapTitle = $('map-popup-heading'); +// if (typeof this.title != 'undefined') { +// Element.update(mapTitle, this.title); +// $(mapTitle).show(); +// } else { +// $(mapTitle).hide(); +// } +// +// //MSRP price +// var mapMsrp = $('map-popup-msrp-box'); +// if (typeof this.msrp != 'undefined') { +// Element.update($('map-popup-msrp'), this.msrp); +// $(mapMsrp).show(); +// } else { +// $(mapMsrp).hide(); +// } +// +// //Actual price +// var mapPrice = $('map-popup-price-box'); +// if (typeof this.price != 'undefined') { +// var price = typeof this.price == 'object' ? this.price.innerHTML : this.price; +// Element.update($('map-popup-price'), price); +// $(mapPrice).show(); +// } else { +// $(mapPrice).hide(); +// } + +// //`Add to cart` button +// var cartButton = $('map-popup-button'); +// if (typeof this.cartLink != 'undefined') { +// if (typeof productAddToCartForm == 'undefined' || this.notUseForm) { +// Catalog.Map.setGotoView(cartButton, this.cartLink); +// productAddToCartForm = $('product_addtocart_form_from_popup'); +// } else { +// if (this.qty) { +// productAddToCartForm.qty = this.qty; +// } +// cartButton.stopObserving('click'); +// cartButton.href = this.cartLink; +// Event.observe(cartButton, 'click', function(event) { +// productAddToCartForm.action = this.href; +// productAddToCartForm.submit(this); +// }); +// } +// productAddToCartForm.action = this.cartLink; +// var productField = $('map-popup-product-id'); +// productField.value = this.product_id; +// $(cartButton).show(); +// $$('.additional-addtocart-box').invoke('show'); +// } else { +// $(cartButton).hide(); +// $$('.additional-addtocart-box').invoke('hide'); +// } + +// //Horizontal line +// var mapText = $('map-popup-text'), +// mapTextWhatThis = $('map-popup-text-what-this'), +// mapContent = $('map-popup-content'); +// if (!mapMsrp.visible() && !mapPrice.visible() && !cartButton.visible()) { +// //If just `What's this?` link +// $(mapText).hide(); +// $(mapTextWhatThis).show(); +// $(mapTextWhatThis).removeClassName('map-popup-only-text'); +// $(mapContent).hide().setStyle({visibility: 'hidden'}); +// $('product_addtocart_form_from_popup').hide(); +// } else { +// $(mapTextWhatThis).hide(); +// $(mapText).show(); +// $(mapText).addClassName('map-popup-only-text'); +// $(mapContent).show().setStyle({visibility: 'visible'}); +// $('product_addtocart_form_from_popup').show(); +// } +// +// $(helpBox).show(); +// if (isIE6) { +// Catalog.Map.hideSelects(); +// } +// var closeButton = $('map-popup-close'); +// if (closeButton) { +// $(closeButton).stopObserving('click'); +// Event.observe(closeButton, 'click', Catalog.Map.showHelp.bind(this)); +// Catalog.Map.active = this.link; +// } +// } else { +// $(helpBox).hide(); +// if (isIE6) { +// Catalog.Map.showSelects(); +// } +// Catalog.Map.active = false; +// } +// +// Event.stop(event); +// } + +// hideHelp: function(){ +// var helpBox = $('map-popup'); +// if (helpBox) { +// var isIE6 = typeof document.body.style.maxHeight === "undefined"; +// $(helpBox).hide(); +// if (isIE6) { +// Catalog.Map.showSelects(); +// } +// Catalog.Map.active = false; +// } +// } + +// bindProductForm: function(){ +// if (('undefined' != typeof productAddToCartForm) && productAddToCartForm) { +// productAddToCartFormOld = productAddToCartForm; +// productAddToCartForm = new VarienForm('product_addtocart_form_from_popup'); +// productAddToCartForm.submitLight = productAddToCartFormOld.submitLight; +// } else if(!$('product_addtocart_form_from_popup')) { +// return false; +// } else if ('undefined' == typeof productAddToCartForm) { +// productAddToCartForm = new VarienForm('product_addtocart_form_from_popup'); +// } +// +// productAddToCartForm.submit = function(button, url) { +// if (('undefined' != typeof productAddToCartFormOld) && productAddToCartFormOld) { +// if (Catalog.Map.active) { +// Catalog.Map.hideHelp(); +// } +// if (productAddToCartForm.qty && $('qty')) { +// $('qty').value = productAddToCartForm.qty; +// } +// parentResult = productAddToCartFormOld.submit(); +// return false; +// } +// if(window.opener) { +// var parentButton = button; +// new Ajax.Request(this.form.action, { +// parameters: {isAjax: 1, method: 'GET'}, +// onSuccess: function(transport) { +// window.opener.focus(); +// if (parentButton && parentButton.href) { +// setPLocation(parentButton.href, true); +// Catalog.Map.hideHelp(); +// } +// } +// }); +// return; +// } +// if (this.validator.validate()) { +// var form = this.form; +// var oldUrl = form.action; +// +// if (url) { +// form.action = url; +// } +// if (!form.getAttribute('action')) { +// form.action = productAddToCartForm.action; +// } +// try { +// this.form.submit(); +// } catch (e) { +// this.form.action = oldUrl; +// throw e; +// } +// this.form.action = oldUrl; +// +// if (button && button != 'undefined') { +// button.disabled = true; +// } +// } +// }; +// } }; -Event.observe(window, 'resize', function(event) { +Event.observe(window, 'resize', function (event) { if (Catalog.Map.active) { Catalog.Map.showHelp(event); } @@ -349,18 +349,18 @@ $(document).observe('bundle:reload-price', function (event) { //reload price canApplyMAP = true; } if (canApplyMAP) { - $$('.full-product-price').each(function(e){ + $$('.full-product-price').each(function (e) { $(e).hide(); }); - $$('.map-info').each(function(e){ + $$('.map-info').each(function (e) { $(e).show(); }); event.noReloadPrice = true; } else { - $$('.full-product-price').each(function(e){ + $$('.full-product-price').each(function (e) { $(e).show(); }); - $$('.map-info').each(function(e){ + $$('.map-info').each(function (e) { $(e).hide(); }); } diff --git a/app/code/core/Mage/Catalog/view/frontend/msrp/popup.phtml b/app/code/core/Mage/Catalog/view/frontend/msrp/popup.phtml index f6c3132237883..6ac81df77d39a 100644 --- a/app/code/core/Mage/Catalog/view/frontend/msrp/popup.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/msrp/popup.phtml @@ -33,27 +33,30 @@ isMsrpEnabled()): ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/navigation/left.phtml b/app/code/core/Mage/Catalog/view/frontend/navigation/left.phtml index 26b5e87173625..2aad36cc89a0e 100644 --- a/app/code/core/Mage/Catalog/view/frontend/navigation/left.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/navigation/left.phtml @@ -53,7 +53,7 @@ - +
    diff --git a/app/code/core/Mage/Catalog/view/frontend/product/compare/list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/compare/list.phtml index fcfd1047e7c9b..cbb443d2d34a8 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/compare/list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/compare/list.phtml @@ -27,136 +27,133 @@ ?>

    __('Compare Products') ?>

    - __('Print This Page') ?> + __('Print This Page') ?>
    getItems()->getSize() ?> - +
    getItems() as $_item): ?> - - + + - + -2): ?> - - - - getItems() as $_item): ?> - - - - - - - - - - - - getItems() as $_item): ?> - - - - - - - - + 2): ?> + + + + getItems() as $_item): ?> + + + + + + + + + + + + getItems() as $_item): ?> + + + + + + + + getAttributes() as $_attribute): ?> - - - getItems() as $_item): ?> - - - - - - + + + getItems() as $_item): ?> + + + + + + - - - - - getItems() as $_item): ?> - - - - - - - -
     __('Remove This Item') ?>
      - <?php echo $this->stripTags($_item->getName(), null, true) ?> -

    helper('Mage_Catalog_Helper_Output')->productAttribute($_item, $_item->getName(), 'name') ?>

    - getReviewsSummaryHtml($_item, 'short') ?> - getPriceHtml($_item, true, '-compare-list-top') ?> - isSaleable()): ?> -

    - -

    __('Out of stock') ?>

    - - helper('Mage_Wishlist_Helper_Data')->isAllow()) : ?> - - -
     getRemoveUrl($_item) ?>' class="btn-remove" title="__('Remove This Item') ?>">__('Remove This Item') ?>
      + <?php echo $this->stripTags($_item->getName(), null, true) ?> +

    helper('Mage_Catalog_Helper_Output')->productAttribute($_item, $_item->getName(), 'name') ?>

    + getReviewsSummaryHtml($_item, 'short') ?> + getPriceHtml($_item, true, '-compare-list-top') ?> + isSaleable()): ?> +

    + +

    __('Out of stock') ?>

    + + helper('Mage_Wishlist_Helper_Data')->isAllow()) : ?> + + +
    getStoreLabel() ?> - getAttributeCode()) { - case "price": ?> - getPriceHtml($_item, true, '-compare-list-' . $_attribute->getCode()) ?> - - <?php echo $this->escapeHtml($_item->getName()) ?> - getProductAttributeValue($_item, $_attribute),0,10); - break; - default: ?> -
    - helper('Mage_Catalog_Helper_Output')->productAttribute($_item, $this->getProductAttributeValue($_item, $_attribute), $_attribute->getAttributeCode()) ?> -
    - -
    getStoreLabel() ?> + getAttributeCode()) { + case "price": ?> + getPriceHtml($_item, true, '-compare-list-' . $_attribute->getCode()) ?> + + <?php echo $this->escapeHtml($_item->getName()) ?> + getProductAttributeValue($_item, $_attribute),0,10); + break; + default: ?> +
    + helper('Mage_Catalog_Helper_Output')->productAttribute($_item, $this->getProductAttributeValue($_item, $_attribute), $_attribute->getAttributeCode()) ?> +
    + +
      - getPriceHtml($_item, true, '-compare-list-bottom') ?> - isSaleable()): ?> -

    - -

    __('Out of stock') ?>

    - - helper('Mage_Wishlist_Helper_Data')->isAllow()) : ?> - - -
    -
    - + + + + + getItems() as $_item): ?> + +   + + + getPriceHtml($_item, true, '-compare-list-bottom') ?> + isSaleable()): ?> +

    + +

    __('Out of stock') ?>

    + + helper('Mage_Wishlist_Helper_Data')->isAllow()) : ?> + + + + + + + +
    + -
    - +
    + - + diff --git a/app/code/core/Mage/Catalog/view/frontend/product/compare/sidebar.phtml b/app/code/core/Mage/Catalog/view/frontend/product/compare/sidebar.phtml index 5f9aab55d7fac..eb485a9a9b4b8 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/compare/sidebar.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/compare/sidebar.phtml @@ -25,36 +25,49 @@ */ /* @var $this Mage_Catalog_Block_Product_Compare_Sidebar */ ?> -helper('Mage_Catalog_Helper_Product_Compare'); $_items = $_helper->getItemCount() > 0 ? $_helper->getItemCollection() : null; ?>
    __('Compare Products') ?> - getItemCount() > 0): ?> + getItemCount() > 0): ?> __('(%d)', $_helper->getItemCount()) ?> - +
    - getItemCount() > 0): ?> + getItemCount() > 0): ?>
      - $_item): ?> + $_item): ?>
    1. - __('Remove This Item') ?> + __('Remove This Item') ?>

      helper('Mage_Catalog_Helper_Output')->productAttribute($_item, $_item->getName(), 'name') ?>

    2. - +
    -
    - __('Clear All') ?> - + __('Clear All') ?> +
    - + +

    __('You have no items to compare.') ?>

    - +
    diff --git a/app/code/core/Mage/Catalog/view/frontend/product/list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/list.phtml index 199a93a32893a..8543904c7ef07 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/list.phtml @@ -101,7 +101,6 @@ $_helper = $this->helper('Mage_Catalog_Helper_Output'); $.mage.event.observe('mage.grid.initialize', function (event, initData) { initData.listId = '#products-list'; }); - $.mage.load.js("getSkinUrl('mage/decorate.js') ?>"); $.mage.load.js("getSkinUrl('Mage_Catalog::js/grid.js') ?>"); $.mage.load.js("getSkinUrl('Mage_Catalog::js/mage-attributes-processing.js') ?>"); })(jQuery); @@ -163,10 +162,9 @@ $_helper = $this->helper('Mage_Catalog_Helper_Output'); // li'; initData.decoratorParam = ['odd', 'even', 'first', 'last']; }); - $.mage.load.js("getSkinUrl('mage/decorate.js') ?>"); $.mage.load.js("getSkinUrl('Mage_Catalog::js/grid.js') ?>"); $.mage.load.js("getSkinUrl('Mage_Catalog::js/mage-attributes-processing.js') ?>"); })(jQuery); diff --git a/app/code/core/Mage/Catalog/view/frontend/product/list/related.phtml b/app/code/core/Mage/Catalog/view/frontend/product/list/related.phtml index 61df743cf284b..677b42fd8ba75 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/list/related.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/list/related.phtml @@ -52,7 +52,7 @@ - + + diff --git a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp.phtml b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp.phtml index c8b60866b1803..068d1ebe14d09 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp.phtml @@ -46,24 +46,46 @@ getId() . $this->helper('Mage_Core_Helper_Data')->getRandomString(20); ?> __('Click for price') ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_item.phtml b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_item.phtml index e5a471e426a61..53c08c67c2d0f 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_item.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_item.phtml @@ -33,74 +33,86 @@ */ ?> helper('Mage_Core_Helper_Data'); - /** @var $_catalogHelper Mage_Catalog_Helper_Data */ - $_catalogHelper = $this->helper('Mage_Catalog_Helper_Data'); +/** @var $_coreHelper Mage_Core_Helper_Data */ +$_coreHelper = $this->helper('Mage_Core_Helper_Data'); +/** @var $_catalogHelper Mage_Catalog_Helper_Data */ +$_catalogHelper = $this->helper('Mage_Catalog_Helper_Data'); - /** @var $_product Mage_Catalog_Model_Product */ - $_product = $this->getProduct(); - $_id = $_product->getId(); - $_msrpPrice = ''; - $priceElementIdPrefix = $this->getPriceElementIdPrefix() ? $this->getPriceElementIdPrefix() : 'product-price-'; +/** @var $_product Mage_Catalog_Model_Product */ +$_product = $this->getProduct(); +$_id = $_product->getId(); +$_msrpPrice = ''; +$priceElementIdPrefix = $this->getPriceElementIdPrefix() ? $this->getPriceElementIdPrefix() : 'product-price-'; ?> -
    +
    helper('Mage_Tax_Helper_Data')->getPrice($_product, $_product->getMsrp()) ?> - getMsrp()): ?> - currency($_product->getMsrp(),true,true) ?> - - + getMsrp()): ?> + currency($_product->getMsrp(), true, true) ?> + + - isShowPriceOnGesture($_product)): ?> - getIdSuffix(); ?> - - getRandomString(20); ?> - __('Click for price'); ?> - - - + $.mage.event.observe('map.popup.close', function (event, initData) { + initData.closeButtonId = '#map-popup-close'; + }); + + $.mage.event.observe('map.popup.button', function (event, popupCartData) { + var initData = { + cartButtonId: "#map-popup-button", + cartForm: "#product_addtocart_form" + }; + popupCartData.cartData.push(initData); + }); + + + + $.mage.load.js("getSkinUrl('jquery/jquery.metadata.js')?>"); + $.mage.load.js("getSkinUrl('jquery/jquery.hook.js')?>"); + $.mage.load.jsSync("getSkinUrl('Mage_Catalog::js/msrp.js') ?>"); + })(jQuery); + //]]> + + + + getMsrpPriceMessage($_product) ?> - + + + getRandomString(20); ?> + __("What's this?"); ?> + - getRandomString(20); ?> - __("What's this?"); ?> - -
    +
    diff --git a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_noform.phtml b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_noform.phtml index 99e68640ccbc6..c177f4249e9e8 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_noform.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_noform.phtml @@ -46,28 +46,46 @@ getId() . $this->helper('Mage_Core_Helper_Data')->getRandomString(20); ?> __('Click for price') ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view.phtml index 377cdb6530917..960103c3bf2f5 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view.phtml @@ -34,139 +34,98 @@ helper('Mage_Catalog_Helper_Output'); ?> getProduct(); ?>
    getMessagesBlock()->getGroupedHtml() ?>
    -
    getOptions()): ?> enctype="multipart/form-data"> -
    - - -
    - -
    -
    -

    productAttribute($_product, $_product->getName(), 'name') ?>

    + getOptions()): ?> + enctype="multipart/form-data"> +
    + +
    - canEmailToFriend()): ?> - - +
    +
    +

    productAttribute($_product, $_product->getName(), 'name') ?>

    +
    + + canEmailToFriend()): ?> + + - getReviewsSummaryHtml($_product, false, true)?> - getChildHtml('alert_urls') ?> - getChildHtml('product_type_data') ?> - getTierPriceHtml() ?> - getChildHtml('extrahint') ?> + getReviewsSummaryHtml($_product, false, true)?> + getChildHtml('alert_urls') ?> + getChildHtml('product_type_data') ?> + getTierPriceHtml() ?> + getChildHtml('extrahint') ?> - hasOptions()):?> + hasOptions()): ?>
    - isSaleable()): ?> - getChildHtml('addtocart') ?> - helper('Mage_Wishlist_Helper_Data')->isAllow() || $_compareUrl=$this->helper('Mage_Catalog_Helper_Product_Compare')->getAddUrl($_product)): ?> - __('OR') ?> + isSaleable()): ?> + getChildHtml('addtocart') ?> + helper('Mage_Wishlist_Helper_Data')->isAllow() || $_compareUrl = $this->helper('Mage_Catalog_Helper_Product_Compare')->getAddUrl($_product)): ?> + __('OR') ?> getChildHtml('addto') ?>
    getChildHtml('extra_buttons') ?> - isSaleable()): ?> + isSaleable()): ?>
    getChildHtml('addto') ?>
    - + - getShortDescription()):?> + getShortDescription()): ?>

    __('Quick Overview') ?>

    -
    productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?>
    + +
    productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?>
    - + - getChildHtml('other');?> + getChildHtml('other');?> - isSaleable() && $this->hasOptions() && $this->getOptionsContainer() == 'container1'):?> + isSaleable() && $this->hasOptions() && $this->getOptionsContainer() == 'container1'): ?> getChildChildHtml('options_container') ?> - + -
    +
    -
    - getChildHtml('media') ?> -
    +
    + getChildHtml('media') ?> +
    -
    - isSaleable() && $this->hasOptions() && $this->getOptionsContainer() == 'container2'):?> +
    + isSaleable() && $this->hasOptions() && $this->getOptionsContainer() == 'container2'): ?> getChildChildHtml('options_container') ?> - - - + +
    - getLayout(); ?> -getGroupChildNames('detailed_info') as $name):?> + getLayout(); ?> + getGroupChildNames('detailed_info') as $name): ?> renderElement($name); ?> getElementAlias($name); ?>
    "> - getChildData($alias, 'title')):?> + getChildData($alias, 'title')): ?>

    escapeHtml($title); ?>

    - + getChildHtml('upsell_products') ?> getChildHtml('product_additional_data') ?>
    diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/addtocart.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/addtocart.phtml index c1590f9bb4d4f..472facec9f75c 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/addtocart.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/addtocart.phtml @@ -26,13 +26,32 @@ ?> getProduct(); ?> __('Add to Cart'); ?> -isSaleable()): ?> -
    - isGrouped()): ?> - - - - - getChildHtml('', true) ?> -
    +isSaleable()): ?> +
    + isGrouped()): ?> + + + + + getChildHtml('', true) ?> +
    + + diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/attributes.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/attributes.phtml index dd49710762ff4..6ae864e05f38c 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/attributes.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/attributes.phtml @@ -48,5 +48,5 @@ - + diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/media.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/media.phtml index e21f36a949e18..7275293abf2dc 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/media.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/media.phtml @@ -42,18 +42,24 @@ ?>

    __('Double click on above image to view full picture') ?>

    -
    +
    <?php echo $this->__('Zoom Out') ?> -
    -
    -
    +
    <?php echo $this->__('Zoom In') ?>
    @@ -71,9 +77,15 @@ getBaseImageIconSize()?> getGalleryImages() as $_image): ?>
  • - <?php echo $this->escapeHtml($_image->getLabel()) ?> + <?php echo $this->escapeHtml($_image->getLabel()) ?>
  • + diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/options.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options.phtml index 746044a5cf198..539971be7e813 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options.phtml @@ -29,161 +29,12 @@ decorateArray($this->getOptions()) ?>
    diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/file.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/file.phtml index 9b9f79255e38a..33363e007c4c7 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/file.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/file.phtml @@ -26,51 +26,25 @@ ?> getOption(); ?> getFileInfo(); ?> -hasData() ? true : false; ?> +hasData(); ?> getId() . '_file'; ?> - @@ -79,16 +53,16 @@ getDecoratedIsLast()):?> class="last"> getTitle(); ?> - + __('Change') ?>   - getIsRequire()): ?> - + getIsRequire()): ?> + __('Delete') ?> -
    > - onchange="opConfig.reloadPrice()" /> +
    > + /> getFileExtension()): ?>

    __('Allowed file extensions to upload')?>: getFileExtension() ?>

    diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/text.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/text.phtml index 36d28358f8199..363e259bd8ae4 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/text.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/text.phtml @@ -29,13 +29,29 @@ getFormatedPrice() ?> getDecoratedIsLast()):?> class="last">
    - getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_FIELD): ?> - - getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_AREA): ?> - - - getMaxCharacters()): ?> + getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_FIELD): ?> + getIsRequire()){ + $_textValidate['required'] = true; + } + if($_option->getMaxCharacters()){ + $_textValidate['maxlength'] = $_option->getMaxCharacters(); + } + ?> + getMaxCharacters()){ + $_textAreaValidate['maxlength'] = $_option->getMaxCharacters(); + } + ?> +