Skip to content

Commit f8dac8f

Browse files
committed
Update as of 5/09/2012
* Implemented configuration option that enables the page types hierarchy usage during the page generation * Removed theme/view config files caching in favour of the view files map to be implemented in the future * Fixed some issues: * Fixed persistent elements highlighting for the Visual Design Editor * Fixed instruction text absence for the "Cash On Delivery Payment" payment method * Fixed suggestion text for the 'urlEscape' method in the legacy test * Fixed "Manage Currency Symbols" system configuration page * Fixed currency validation for the PayPal Website Payments Standard * Fixed Web API for product to category assignment by SKU containing digits only * Implemented new tests
1 parent af7068a commit f8dac8f

File tree

67 files changed

+1282
-385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1282
-385
lines changed

CHANGELOG.markdown

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
Update as of 5/09/2012
2+
======================
3+
* Implemented configuration option that enables the page types hierarchy usage during the page generation
4+
* Removed theme/view config files caching in favour of the view files map to be implemented in the future
5+
* Fixed some issues:
6+
* Fixed persistent elements highlighting for the Visual Design Editor
7+
* Fixed instruction text absence for the "Cash On Delivery Payment" payment method
8+
* Fixed suggestion text for the 'urlEscape' method in the legacy test
9+
* Fixed "Manage Currency Symbols" system configuration page
10+
* Fixed currency validation for the PayPal Website Payments Standard
11+
* Fixed Web API for product to category assignment by SKU containing digits only
12+
* Implemented new tests
13+
114
Update as of 5/05/2012
215
======================
316
* Added theme inheritance ability

app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @package Mage_Api
3232
* @author Magento Core Team <core@magentocommerce.com>
3333
*/
34-
class Mage_Api_Model_Server_WSI_Adapter_Soap extends Mage_Api_Model_Server_Adapter_Soap
34+
class Mage_Api_Model_Server_Wsi_Adapter_Soap extends Mage_Api_Model_Server_Adapter_Soap
3535
{
3636
/**
3737
* Run webservice

app/code/core/Mage/Api/Model/Server/Wsi/Handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @package Mage_Api
3232
* @author Magento Core Team <core@magentocommerce.com>
3333
*/
34-
class Mage_Api_Model_Server_WSI_Handler extends Mage_Api_Model_Server_Handler_Abstract
34+
class Mage_Api_Model_Server_Wsi_Handler extends Mage_Api_Model_Server_Handler_Abstract
3535
{
3636
protected $_resourceSuffix = '_v2';
3737

app/code/core/Mage/Catalog/Model/Category/Api.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function __construct()
4343
*
4444
* @param string|int $website
4545
* @param string|int $store
46+
* @param int $categoryId
4647
* @return array
4748
*/
4849
public function level($website = null, $store = null, $categoryId = null)
@@ -126,8 +127,8 @@ public function level($website = null, $store = null, $categoryId = null)
126127
/**
127128
* Retrieve category tree
128129
*
129-
* @param int $parent
130-
* @param string|int $store
130+
* @param int|null $parentId
131+
* @param string|int|null $store
131132
* @return array
132133
*/
133134
public function tree($parentId = null, $store = null)
@@ -184,7 +185,7 @@ protected function _nodeToArray(Varien_Data_Tree_Node $node)
184185
}
185186

186187
/**
187-
* Initilize and return category model
188+
* Initialize and return category model
188189
*
189190
* @param int $categoryId
190191
* @param string|int $store
@@ -240,6 +241,7 @@ public function info($categoryId, $store = null, $attributes = null)
240241
*
241242
* @param int $parentId
242243
* @param array $categoryData
244+
* @param int|string|null $store
243245
* @return int
244246
*/
245247
public function create($parentId, $categoryData, $store = null)
@@ -388,10 +390,10 @@ public function delete($categoryId)
388390
}
389391

390392
/**
391-
* Get prduct Id from sku or from product id
393+
* Get product Id from sku or from product id
392394
*
393395
* @param int|string $productId
394-
* @param string $identifierType
396+
* @param string $identifierType
395397
* @return int
396398
*/
397399
protected function _getProductId($productId, $identifierType = null)
@@ -440,13 +442,14 @@ public function assignedProducts($categoryId, $store = null)
440442
* @param int $categoryId
441443
* @param int $productId
442444
* @param int $position
445+
* @param string|null $identifierType
443446
* @return boolean
444447
*/
445448
public function assignProduct($categoryId, $productId, $position = null, $identifierType = null)
446449
{
447450
$category = $this->_initCategory($categoryId);
448451
$positions = $category->getProductsPosition();
449-
$productId = $this->_getProductId($productId);
452+
$productId = $this->_getProductId($productId, $identifierType);
450453
$positions[$productId] = $position;
451454
$category->setPostedProducts($positions);
452455

@@ -466,6 +469,7 @@ public function assignProduct($categoryId, $productId, $position = null, $identi
466469
* @param int $categoryId
467470
* @param int $productId
468471
* @param int $position
472+
* @param string|null $identifierType
469473
* @return boolean
470474
*/
471475
public function updateProduct($categoryId, $productId, $position = null, $identifierType = null)
@@ -493,6 +497,7 @@ public function updateProduct($categoryId, $productId, $position = null, $identi
493497
*
494498
* @param int $categoryId
495499
* @param int $productId
500+
* @param string|null $identifierType
496501
* @return boolean
497502
*/
498503
public function removeProduct($categoryId, $productId, $identifierType = null)
@@ -516,4 +521,4 @@ public function removeProduct($categoryId, $productId, $identifierType = null)
516521
return true;
517522
}
518523

519-
} // Class Mage_Catalog_Model_Category_Api End
524+
}

app/code/core/Mage/Core/Controller/Varien/Action.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ abstract class Mage_Core_Controller_Varien_Action
5050
const PARAM_NAME_BASE64_URL = 'r64';
5151
const PARAM_NAME_URL_ENCODED = 'uenc';
5252

53+
const XML_PAGE_TYPE_RENDER_INHERITED = 'dev/page_type/render_inherited';
54+
5355
/**
5456
* Request object
5557
*
@@ -298,10 +300,10 @@ public function getDefaultLayoutHandle()
298300
*/
299301
public function addActionLayoutHandles()
300302
{
301-
/*
302-
* @todo Use addPageLayoutHandles() as soon as page type inheritance declarations are correct
303-
*/
304-
$this->getLayout()->getUpdate()->addHandle($this->getDefaultLayoutHandle());
303+
$isRenderByInherited = Mage::getStoreConfig(self::XML_PAGE_TYPE_RENDER_INHERITED);
304+
if (!$isRenderByInherited || !$this->addPageLayoutHandles()) {
305+
$this->getLayout()->getUpdate()->addHandle($this->getDefaultLayoutHandle());
306+
}
305307
return $this;
306308
}
307309

app/code/core/Mage/Core/Model/Design/Package.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,10 @@ public function getLocaleFileName($file, array $params=array())
403403
$area = $params['_area'];
404404
$package = $params['_package'];
405405
$theme = $params['_theme'];
406-
while ($theme) {
406+
do {
407407
$dirs[] = "{$dir}/{$area}/{$package}/{$theme}/locale/{$locale}";
408408
list($package, $theme) = $this->_getInheritedTheme($area, $package, $theme);
409-
}
409+
} while ($theme);
410410

411411
return $this->_fallback($file, $dirs);
412412
}
@@ -1236,11 +1236,13 @@ protected function _getDesignEntitiesFilesystemStructure($area)
12361236
*/
12371237
public function getThemeConfig($area)
12381238
{
1239-
if (!isset($this->_themeConfigs[$area])) {
1240-
$themeConfigFiles = glob(Mage::getBaseDir('design') . "/{$area}/*/*/theme.xml", GLOB_NOSORT);
1241-
$this->_themeConfigs[$area] = new Magento_Config_Theme($themeConfigFiles, Mage::app()->getCache());
1239+
if (isset($this->_themeConfigs[$area])) {
1240+
return $this->_themeConfigs[$area];
12421241
}
1243-
return $this->_themeConfigs[$area];
1242+
$configFiles = glob(Mage::getBaseDir('design') . "/{$area}/*/*/theme.xml", GLOB_NOSORT);
1243+
$config = new Magento_Config_Theme($configFiles);
1244+
$this->_themeConfigs[$area] = $config;
1245+
return $config;
12441246
}
12451247

12461248
/**
@@ -1275,14 +1277,13 @@ public function getViewConfig()
12751277
return $this->_viewConfigs[$key];
12761278
}
12771279

1278-
$files = Mage::getConfig()->getModuleConfigurationFiles('view.xml');
1279-
$themeFile = $this->getFilename('view.xml', array());
1280-
if (file_exists($themeFile)) {
1281-
$files[] = $themeFile;
1280+
$configFiles = Mage::getConfig()->getModuleConfigurationFiles('view.xml');
1281+
$themeConfigFile = $this->getFilename('view.xml', array());
1282+
if (file_exists($themeConfigFile)) {
1283+
$configFiles[] = $themeConfigFile;
12821284
}
1285+
$config = new Magento_Config_View($configFiles);
12831286

1284-
/** @var Magento_Config_View $config */
1285-
$config = new Magento_Config_View($files, Mage::app()->getCache());
12861287
$this->_viewConfigs[$key] = $config;
12871288
return $config;
12881289
}

app/code/core/Mage/Core/etc/config.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@
194194
<js>
195195
<merge_files>0</merge_files>
196196
</js>
197+
<page_type>
198+
<render_inherited>0</render_inherited>
199+
</page_type>
197200
</dev>
198201
<system>
199202
<smtp>

app/code/core/Mage/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @package Mage_CurrencySymbol
3232
* @author Magento Core Team <core@magentocommerce.com>
3333
*/
34-
class Mage_Currencysymbol_Block_Adminhtml_System_Currencysymbol extends Mage_Adminhtml_Block_Widget_Form
34+
class Mage_CurrencySymbol_Block_Adminhtml_System_Currencysymbol extends Mage_Adminhtml_Block_Widget_Form
3535
{
3636
/**
3737
* Constructor. Initialization required variables for class instance.

app/code/core/Mage/CurrencySymbol/view/adminhtml/grid.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
?>
2727
<?php
2828
/**
29-
* @var $this Mage_Currencysymbol_Block_Adminhtml_System_Currencysymbol
29+
* @var $this Mage_CurrencySymbol_Block_Adminhtml_System_Currencysymbol
3030
*/
3131
?>
3232
<div class="content-header">
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* Magento
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* This source file is subject to the Open Software License (OSL 3.0)
8+
* that is bundled with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://opensource.org/licenses/osl-3.0.php
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to license@magentocommerce.com so we can send you a copy immediately.
14+
*
15+
* DISCLAIMER
16+
*
17+
* Do not edit or add to this file if you wish to upgrade Magento to newer
18+
* versions in the future. If you wish to customize Magento for your
19+
* needs please refer to http://www.magentocommerce.com for more information.
20+
*
21+
* @category Mage
22+
* @package Mage_DesignEditor
23+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25+
*/
26+
27+
/**
28+
* Extended template block for Visual Design Editor
29+
*/
30+
class Mage_DesignEditor_Block_Template extends Mage_Core_Block_Template
31+
{
32+
/**
33+
* Check whether highlighting of elements is disabled or not
34+
*
35+
* @return bool
36+
*/
37+
public function isHighlightingDisabled()
38+
{
39+
return Mage::getSingleton('Mage_DesignEditor_Model_Session')->isHighlightingDisabled();
40+
}
41+
}

app/code/core/Mage/DesignEditor/Block/Toolbar.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,17 @@ public function getMessages()
5555
->getMessages(true)
5656
->getItems();
5757
}
58+
59+
/**
60+
* Get configuration options for Visual Design Editor as JSON
61+
*
62+
* @return string
63+
*/
64+
public function getOptionsJson()
65+
{
66+
$options = array(
67+
'cookie_highlighting_name' => Mage_DesignEditor_Model_Session::COOKIE_HIGHLIGHTING,
68+
);
69+
return Mage::helper('Mage_Core_Helper_Data')->jsonEncode($options);
70+
}
5871
}

app/code/core/Mage/DesignEditor/Model/Observer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ public function wrapPageElement(Varien_Event_Observer $observer)
123123
}
124124

125125
if (!$this->_wrappingRenderer) {
126-
$this->_wrappingRenderer = Mage::getModel('Mage_Core_Block_Template', array(
127-
'template' => 'Mage_DesignEditor::wrapping.phtml'
126+
$this->_wrappingRenderer = Mage::getModel('Mage_DesignEditor_Block_Template', array(
127+
'template' => 'wrapping.phtml'
128128
));
129129
}
130130

app/code/core/Mage/DesignEditor/view/frontend/css/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ body {
152152
.vde_placeholder {
153153
background-color: #F5F5DC;
154154
}
155-
.vde_wrapper_hidden , .vde_wrapper_hidden .vde_element_title {
155+
.vde_wrapper_hidden, .vde_wrapper_hidden .vde_element_title {
156156
display: none;
157157
}
158158

app/code/core/Mage/DesignEditor/view/frontend/js/design_editor.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
$.extend(this._options, defaultOptions, opts);
3939

4040
if (Mage.Cookies.get(this._options['cookie_highlighting_name']) == 'off') {
41-
this._addParentMarkers();
41+
this._processMarkers();
4242
}
4343
this._enableDragDrop();
4444
};
@@ -95,7 +95,7 @@
9595

9696
DesignEditor.prototype._turnHighlightingOn = function () {
9797
var thisObj = this;
98-
Mage.Cookies.set(this._options['cookie_highlighting_name'], "on");
98+
Mage.Cookies.clear(this._options['cookie_highlighting_name']);
9999
$('.vde_element_wrapper').each(function () {
100100
$(this)
101101
.append(thisObj._getChildren($(this).attr('id')))
@@ -123,39 +123,39 @@
123123
return this;
124124
};
125125

126-
DesignEditor.prototype._addParentMarkers = function () {
126+
DesignEditor.prototype._processMarkers = function () {
127127
var thisObj = this;
128-
var parentsStack = [];
129-
var currentParent;
128+
var parentsIdsStack = [];
129+
var currentParentId;
130130
$('*').contents().each(function(){
131131
if (this.nodeType == Node.COMMENT_NODE) {
132132
if (this.data.substr(0, 9) == 'start_vde') {
133-
currentParent = this.data.substr(6, this.data.length);
134-
parentsStack.push(currentParent);
133+
currentParentId = this.data.substr(6, this.data.length);
134+
parentsIdsStack.push(currentParentId);
135135
this.parentNode.removeChild(this);
136136
} else if (this.data.substr(0, 7) == 'end_vde') {
137-
if (this.data.substr(4, this.data.length) !== currentParent) {
138-
throw "Could not find closing element for opened '" + currentParent + "' element";
137+
if (this.data.substr(4, this.data.length) !== currentParentId) {
138+
throw "Could not find closing element for opened '" + currentParentId + "' element";
139139
}
140-
parentsStack.pop();
141-
currentParent = parentsStack[parentsStack.length - 1];
140+
parentsIdsStack.pop();
141+
currentParentId = parentsIdsStack[parentsIdsStack.length - 1];
142142
this.parentNode.removeChild(this);
143143
}
144-
} else if (undefined !== currentParent) {
145-
thisObj._storeChild(currentParent, this);
144+
} else if (currentParentId) {
145+
thisObj._storeChild(currentParentId, this);
146146
}
147147
});
148148
};
149149

150150
DesignEditor.prototype._storeChild = function (parentId, child) {
151-
if (undefined == this._children[parentId]) {
151+
if (!this._children[parentId]) {
152152
this._children[parentId] = [];
153153
}
154154
this._children[parentId].push(child);
155155
};
156156

157157
DesignEditor.prototype._getChildren = function (parentId) {
158-
if (undefined == this._children[parentId]) {
158+
if (!this._children[parentId]) {
159159
return [];
160160
}
161161
return this._children[parentId];

app/code/core/Mage/DesignEditor/view/frontend/layout.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
<!-- Toolbar block has been intentionally declared outside of containers to be rendered manually -->
4141
<block type="Mage_DesignEditor_Block_Toolbar" name="design_editor_toolbar" template="toolbar.phtml">
4242
<block type="Mage_DesignEditor_Block_Toolbar_Breadcrumbs" name="design_editor_toolbar_breadcrumbs" template="toolbar/breadcrumbs.phtml"/>
43-
<block type="Mage_Core_Block_Template" name="design_editor_toolbar_row" template="Mage_DesignEditor::toolbar/row.phtml">
43+
<block type="Mage_DesignEditor_Block_Template" name="design_editor_toolbar_row" template="toolbar/row.phtml">
4444
<block type="Mage_DesignEditor_Block_Toolbar_PageType" name="design_editor_toolbar_page_types" template="toolbar/page_types.phtml"/>
4545
<block type="Mage_DesignEditor_Block_Toolbar_Skin" name="design_editor_toolbar_skin" template="toolbar/skin.phtml"/>
46-
<block type="Mage_Core_Block_Template" name="design_editor_toolbar_highlighting" template="Mage_DesignEditor::toolbar/highlighting.phtml"/>
46+
<block type="Mage_DesignEditor_Block_Template" name="design_editor_toolbar_highlighting" template="toolbar/highlighting.phtml"/>
4747
<block type="Mage_DesignEditor_Block_Toolbar_Exit" name="design_editor_toolbar_exit" template="toolbar/exit.phtml"/>
4848
</block>
4949
</block>

app/code/core/Mage/DesignEditor/view/frontend/toolbar.phtml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@
3636
<script type="text/javascript">
3737
(function ($) {
3838
$(document).ready(function () {
39-
designEditor = new DesignEditor({
40-
'cookie_highlighting_name': '<?php echo Mage_DesignEditor_Model_Session::COOKIE_HIGHLIGHTING; ?>'
41-
});
39+
designEditor = new DesignEditor(<?php echo $this->getOptionsJson(); ?>);
4240

4341
$('.vde_toolbar_cell_title').click(function(){
4442
var cellElement = $(this).parents('.vde_toolbar_cell');

0 commit comments

Comments
 (0)