Skip to content

Commit 44407a7

Browse files
committed
Import Magento Release 1.7.0.1
1 parent 7652d08 commit 44407a7

File tree

90 files changed

+5655
-3035
lines changed

Some content is hidden

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

90 files changed

+5655
-3035
lines changed

RELEASE_NOTES.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
==== 1.7.0.1 ====
2+
3+
=== Major Highlights ===
4+
Improved the backend configuration UI for PayPal payment solutions
5+
6+
=== Improvements ===
7+
Added the functionality for creating nested field sets in the System configuration
8+
Implemented the support for the extended and shared configuration fields
9+
Added the ability to define dependencies between fields from different field sets
10+
11+
=== Changes ===
12+
Moved PayPal configuration to the Payment Methods menu
13+
Set the default value of the cUrl VERIFYPEER option to TRUE for PayPal and added the ability to change this value
14+
Changed the design and position of the configuration field tooltips
15+
16+
=== Fixes ===
17+
Fixed: Inability of SOAP v2 API use in non WS-I compatible mode in the applications written in languages with strong typing
18+
Fixed: In some cases comments history tab on order does not contain information about customer notifications
19+
Fixed: Several potential security vulnerabilities
20+
21+
22+
123
==== 1.7.0.0 ====
224

325
=== Major Highlights ===

app/Mage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public static function getVersionInfo()
170170
'major' => '1',
171171
'minor' => '7',
172172
'revision' => '0',
173-
'patch' => '0',
173+
'patch' => '1',
174174
'stability' => '',
175175
'number' => '',
176176
);

app/code/core/Mage/Adminhtml/Block/System/Config/Form.php

Lines changed: 136 additions & 100 deletions
Large diffs are not rendered by default.

app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field.php

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ public function render(Varien_Data_Form_Element_Abstract $element)
5858
{
5959
$id = $element->getHtmlId();
6060

61-
$useContainerId = $element->getData('use_container_id');
62-
$html = '<tr id="row_' . $id . '">'
63-
. '<td class="label"><label for="'.$id.'">'.$element->getLabel().'</label></td>';
61+
$html = '<td class="label"><label for="'.$id.'">'.$element->getLabel().'</label></td>';
6462

6563
//$isDefault = !$this->getRequest()->getParam('website') && !$this->getRequest()->getParam('store');
6664
$isMultiple = $element->getExtType()==='multiple';
@@ -87,8 +85,14 @@ public function render(Varien_Data_Form_Element_Abstract $element)
8785
}
8886
}
8987

90-
$html.= '<td class="value">';
91-
$html.= $this->_getElementHtml($element);
88+
if ($element->getTooltip()) {
89+
$html .= '<td class="value with-tooltip">';
90+
$html .= $this->_getElementHtml($element);
91+
$html .= '<div class="field-tooltip"><div>' . $element->getTooltip() . '</div></div>';
92+
} else {
93+
$html .= '<td class="value">';
94+
$html .= $this->_getElementHtml($element);
95+
};
9296
if ($element->getComment()) {
9397
$html.= '<p class="note"><span>'.$element->getComment().'</span></p>';
9498
}
@@ -134,8 +138,18 @@ public function render(Varien_Data_Form_Element_Abstract $element)
134138
}
135139
$html.= '</td>';
136140

137-
$html.= '</tr>';
138-
return $html;
141+
return $this->_decorateRowHtml($element, $html);
139142
}
140143

144+
/**
145+
* Decorate field row html
146+
*
147+
* @param Varien_Data_Form_Element_Abstract $element
148+
* @param string $html
149+
* @return string
150+
*/
151+
protected function _decorateRowHtml($element, $html)
152+
{
153+
return '<tr id="row_' . $element->getHtmlId() . '">' . $html . '</tr>';
154+
}
141155
}

app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php

Lines changed: 78 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class Mage_Adminhtml_Block_System_Config_Form_Fieldset
4545
*/
4646
public function render(Varien_Data_Form_Element_Abstract $element)
4747
{
48+
$this->setElement($element);
4849
$html = $this->_getHeaderHtml($element);
4950

5051
foreach ($element->getSortedElements() as $field) {
@@ -64,38 +65,97 @@ public function render(Varien_Data_Form_Element_Abstract $element)
6465
*/
6566
protected function _getHeaderHtml($element)
6667
{
67-
$default = !$this->getRequest()->getParam('website') && !$this->getRequest()->getParam('store');
68+
if ($element->getIsNested()) {
69+
$html = '<tr class="nested"><td colspan="4"><div class="' . $this->_getFrontendClass($element) . '">';
70+
} else {
71+
$html = '<div class="' . $this->_getFrontendClass($element) . '">';
72+
}
73+
74+
$html .= $this->_getHeaderTitleHtml($element);
6875

69-
$html = '<div class="entry-edit-head collapseable" ><a id="' . $element->getHtmlId()
70-
. '-head" href="#" onclick="Fieldset.toggleCollapse(\'' . $element->getHtmlId() . '\', \''
71-
. $this->getUrl('*/*/state') . '\'); return false;">' . $element->getLegend() . '</a></div>';
7276
$html .= '<input id="'.$element->getHtmlId() . '-state" name="config_state[' . $element->getId()
7377
. ']" type="hidden" value="' . (int)$this->_getCollapseState($element) . '" />';
74-
$html .= '<fieldset class="' . $this->_getFieldsetCss() . '" id="' . $element->getHtmlId() . '">';
78+
$html .= '<fieldset class="' . $this->_getFieldsetCss($element) . '" id="' . $element->getHtmlId() . '">';
7579
$html .= '<legend>' . $element->getLegend() . '</legend>';
7680

77-
if ($element->getComment()) {
78-
$html .= '<span class="comment" style="display: block;">' . $element->getComment() . '</span>';
79-
}
81+
$html .= $this->_getHeaderCommentHtml($element);
82+
8083
// field label column
8184
$html .= '<table cellspacing="0" class="form-list"><colgroup class="label" /><colgroup class="value" />';
82-
if (!$default) {
85+
if ($this->getRequest()->getParam('website') || $this->getRequest()->getParam('store')) {
8386
$html .= '<colgroup class="use-default" />';
8487
}
8588
$html .= '<colgroup class="scope-label" /><colgroup class="" /><tbody>';
8689

8790
return $html;
8891
}
8992

93+
/**
94+
* Get frontend class
95+
*
96+
* @param Varien_Data_Form_Element_Abstract $element
97+
* @return string
98+
*/
99+
protected function _getFrontendClass($element)
100+
{
101+
$frontendClass = (string)$this->getGroup($element)->frontend_class;
102+
return 'section-config' . (empty($frontendClass) ? '' : (' ' . $frontendClass));
103+
}
104+
105+
/**
106+
* Get group xml data of the element
107+
*
108+
* @param null|Varien_Data_Form_Element_Abstract $element
109+
* @return Mage_Core_Model_Config_Element
110+
*/
111+
public function getGroup($element = null)
112+
{
113+
if (is_null($element)) {
114+
$element = $this->getElement();
115+
}
116+
if ($element && $element->getGroup() instanceof Mage_Core_Model_Config_Element) {
117+
return $element->getGroup();
118+
}
119+
120+
return new Mage_Core_Model_Config_Element('<config/>');
121+
}
122+
123+
/**
124+
* Return header title part of html for fieldset
125+
*
126+
* @param Varien_Data_Form_Element_Abstract $element
127+
* @return string
128+
*/
129+
protected function _getHeaderTitleHtml($element)
130+
{
131+
return '<div class="entry-edit-head collapseable" ><a id="' . $element->getHtmlId()
132+
. '-head" href="#" onclick="Fieldset.toggleCollapse(\'' . $element->getHtmlId() . '\', \''
133+
. $this->getUrl('*/*/state') . '\'); return false;">' . $element->getLegend() . '</a></div>';
134+
}
135+
136+
/**
137+
* Return header comment part of html for fieldset
138+
*
139+
* @param Varien_Data_Form_Element_Abstract $element
140+
* @return string
141+
*/
142+
protected function _getHeaderCommentHtml($element)
143+
{
144+
return $element->getComment()
145+
? '<div class="comment">' . $element->getComment() . '</div>'
146+
: '';
147+
}
148+
90149
/**
91150
* Return full css class name for form fieldset
92151
*
152+
* @param null|Varien_Data_Form_Element_Abstract $element
93153
* @return string
94154
*/
95-
protected function _getFieldsetCss()
155+
protected function _getFieldsetCss($element = null)
96156
{
97-
$configCss = (string)$this->getGroup()->fieldset_css;
98-
return 'config collapseable'.($configCss ? ' ' . $configCss : '');
157+
$configCss = (string)$this->getGroup($element)->fieldset_css;
158+
return 'config collapseable' . ($configCss ? ' ' . $configCss : '');
99159
}
100160

101161
/**
@@ -109,15 +169,13 @@ protected function _getFooterHtml($element)
109169
{
110170
$tooltipsExist = false;
111171
$html = '</tbody></table>';
112-
foreach ($element->getSortedElements() as $field) {
113-
if ($field->getTooltip()) {
114-
$tooltipsExist = true;
115-
$html .= sprintf('<div id="row_%s_comment" class="system-tooltip-box" style="display:none;">%s</div>',
116-
$field->getId(), $field->getTooltip()
117-
);
118-
}
119-
}
120172
$html .= '</fieldset>' . $this->_getExtraJs($element, $tooltipsExist);
173+
174+
if ($element->getIsNested()) {
175+
$html .= '</div></td></tr>';
176+
} else {
177+
$html .= '</div>';
178+
}
121179
return $html;
122180
}
123181

@@ -134,54 +192,6 @@ protected function _getExtraJs($element, $tooltipsExist = false)
134192
{
135193
$id = $element->getHtmlId();
136194
$js = "Fieldset.applyCollapse('{$id}');";
137-
if ($tooltipsExist) {
138-
$js.= "$$('#{$id} table')[0].addClassName('system-tooltip-wrap');
139-
$$('#{$id} table tbody tr').each(function(tr) {
140-
Event.observe(tr, 'mouseover', function (event) {
141-
var relatedTarget = $(event.relatedTarget || event.fromElement);
142-
if(relatedTarget && (relatedTarget == this || relatedTarget.descendantOf(this))) {
143-
return;
144-
}
145-
showTooltip(event);
146-
});
147-
Event.observe(tr, 'mouseout', function (event) {
148-
var relatedTarget = $(event.relatedTarget || event.toElement);
149-
if(relatedTarget && (relatedTarget == this || relatedTarget.childOf(this))) {
150-
return;
151-
}
152-
hideTooltip(event);
153-
});
154-
});
155-
$$('#{$id} table')[0].select('input','select').each(function(field) {
156-
Event.observe(field, 'focus', function (event) {
157-
showTooltip(event);
158-
});
159-
Event.observe(field, 'blur', function (event) {
160-
hideTooltip(event);
161-
});
162-
});
163-
function showTooltip(event) {
164-
var tableHeight = Event.findElement(event, 'table').getStyle('height');
165-
var tr = Event.findElement(event, 'tr');
166-
var id = tr.id + '_comment';
167-
$$('div.system-tooltip-box').invoke('hide');
168-
if ($(id)) {
169-
$(id).show().setStyle({height : tableHeight});
170-
if(document.viewport.getWidth() < 1200) {
171-
$(id).addClassName('system-tooltip-small').setStyle({height : 'auto'});
172-
} else {
173-
$(id).removeClassName('system-tooltip-small');
174-
}
175-
}
176-
};
177-
function hideTooltip(event) {
178-
var tr = Event.findElement(event, 'tr');
179-
var id = tr.id + '_comment';
180-
if ($(id)) {
181-
setTimeout(function() { $(id).hide(); }, 1);
182-
}
183-
};";
184-
}
185195
return Mage::helper('adminhtml/js')->getScript($js);
186196
}
187197

app/code/core/Mage/Adminhtml/Model/Config.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function getSections($sectionCode=null, $websiteCode=null, $storeCode=nul
6767
}
6868

6969
/**
70-
* Retrive tabs
70+
* Retrieve tabs
7171
*
7272
* @return Varien_Simplexml_Element
7373
*/
@@ -80,19 +80,21 @@ public function getTabs()
8080
return $this->_tabs;
8181
}
8282

83+
/**
84+
* Init modules configuration
85+
*
86+
* @return void
87+
*/
8388
protected function _initSectionsAndTabs()
8489
{
85-
$mergeConfig = Mage::getModel('core/config_base');
86-
87-
$config = Mage::getConfig()->loadModulesConfiguration('system.xml');
90+
$config = Mage::getConfig()->loadModulesConfiguration('system.xml')
91+
->applyExtends();
8892

93+
Mage::dispatchEvent('adminhtml_init_system_config', array('config' => $config));
8994
$this->_sections = $config->getNode('sections');
90-
9195
$this->_tabs = $config->getNode('tabs');
9296
}
9397

94-
95-
9698
/**
9799
* Enter description here...
98100
*
@@ -103,7 +105,6 @@ protected function _initSectionsAndTabs()
103105
*/
104106
public function getSection($sectionCode=null, $websiteCode=null, $storeCode=null)
105107
{
106-
107108
if ($sectionCode){
108109
return $this->getSections()->$sectionCode;
109110
} elseif ($websiteCode) {
@@ -131,7 +132,7 @@ public function hasChildren ($node, $websiteCode=null, $storeCode=null, $isField
131132
$showTab=true;
132133
}
133134
}
134-
}elseif ($websiteCode) {
135+
} elseif ($websiteCode) {
135136
if (isset($node->show_in_website)) {
136137
if ((int)$node->show_in_website) {
137138
$showTab=true;
@@ -162,7 +163,6 @@ public function hasChildren ($node, $websiteCode=null, $storeCode=null, $isField
162163
}
163164
}
164165
return false;
165-
166166
}
167167

168168
/**

0 commit comments

Comments
 (0)