Banners - Version 1.2.4

Version Notes

NOTE: Please download the Latest release 1.2.4 from Releases section!

Download this release

Release Info

Developer Magento Core Team
Extension Banners
Version 1.2.4
Comparing to
See all releases


Code changes from version 1.2.3 to 1.2.4

app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php DELETED
@@ -1,322 +0,0 @@
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_Adminhtml
23
- * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
-
27
-
28
- /**
29
- * config controller
30
- *
31
- * @category Mage
32
- * @package Mage_Adminhtml
33
- * @author Magento Core Team <core@magentocommerce.com>
34
- */
35
- class Mage_Adminhtml_System_ConfigController extends Mage_Adminhtml_Controller_Action
36
- {
37
- /**
38
- * Enter description here...
39
- *
40
- */
41
- public function indexAction()
42
- {
43
- $this->_forward('edit');
44
- }
45
-
46
- /**
47
- * Enter description here...
48
- *
49
- */
50
- public function editAction()
51
- {
52
- //$this->_title($this->__('System'))->_title($this->__('Configuration'));
53
- $current = $this->getRequest()->getParam('section');
54
- $website = $this->getRequest()->getParam('website');
55
- $store = $this->getRequest()->getParam('store');
56
-
57
- $configFields = Mage::getSingleton('adminhtml/config');
58
-
59
-
60
- $sections = $configFields->getSections($current);
61
- $section = $sections->$current;
62
- $hasChildren = $configFields->hasChildren($section, $website, $store);
63
- if (!$hasChildren && $current) {
64
- $this->_redirect('*/*/', array('website'=>$website, 'store'=>$store));
65
- }
66
-
67
- $this->loadLayout();
68
-
69
- $this->_setActiveMenu('system/config');
70
-
71
- $this->_addBreadcrumb(Mage::helper('adminhtml')->__('System'), Mage::helper('adminhtml')->__('System'), $this->getUrl('*/system'));
72
-
73
- $this->getLayout()->getBlock('left')
74
- ->append($this->getLayout()->createBlock('adminhtml/system_config_tabs')->initTabs());
75
-
76
- if ($this->_isSectionAllowed($this->getRequest()->getParam('section'))) {
77
- $this->_addContent($this->getLayout()->createBlock('adminhtml/system_config_edit')->initForm());
78
-
79
- $this->_addJs($this->getLayout()->createBlock('adminhtml/template')->setTemplate('system/shipping/ups.phtml'));
80
- $this->_addJs($this->getLayout()->createBlock('adminhtml/template')->setTemplate('system/config/js.phtml'));
81
- $this->_addJs($this->getLayout()->createBlock('adminhtml/template')->setTemplate('system/shipping/applicable_country.phtml'));
82
-
83
- $this->renderLayout();
84
- }
85
- }
86
-
87
- /**
88
- * Enter description here...
89
- *
90
- */
91
- public function saveAction()
92
- {
93
- $session = Mage::getSingleton('adminhtml/session');
94
- /* @var $session Mage_Adminhtml_Model_Session */
95
-
96
- $groups = $this->getRequest()->getPost('groups');
97
-
98
-
99
- if (isset($_FILES['groups']['name']) && is_array($_FILES['groups']['name'])) {
100
- /**
101
- * Carefully merge $_FILES and $_POST information
102
- * None of '+=' or 'array_merge_recursive' can do this correct
103
- */
104
- foreach($_FILES['groups']['name'] as $groupName => $group) {
105
- if (is_array($group)) {
106
- foreach ($group['fields'] as $fieldName => $field) {
107
- if (!empty($field['value'])) {
108
- $groups[$groupName]['fields'][$fieldName] = array('value' => $field['value']);
109
- }
110
- }
111
- }
112
- }
113
- }
114
-
115
- try {
116
- if (!$this->_isSectionAllowed($this->getRequest()->getParam('section'))) {
117
- throw new Exception(Mage::helper('adminhtml')->__('This section is not allowed.'));
118
- }
119
-
120
- // custom save logic
121
- $this->_saveSection();
122
- $section = $this->getRequest()->getParam('section');
123
- $website = $this->getRequest()->getParam('website');
124
- $store = $this->getRequest()->getParam('store');
125
- Mage::getModel('adminhtml/config_data')
126
- ->setSection($section)
127
- ->setWebsite($website)
128
- ->setStore($store)
129
- ->setGroups($groups)
130
- ->save();
131
-
132
- // reinit configuration
133
- Mage::getConfig()->reinit();
134
- Mage::app()->reinitStores();
135
-
136
- //Savce Banners data.xml file!
137
- if($section == "banners") {
138
- Mage::helper('banners')->generateXML();
139
- }
140
-
141
- // website and store codes can be used in event implementation, so set them as well
142
- Mage::dispatchEvent("admin_system_config_changed_section_{$section}",
143
- array('website' => $website, 'store' => $store)
144
- );
145
- $session->addSuccess(Mage::helper('adminhtml')->__('Configuration successfully saved'));
146
- }
147
- catch (Mage_Core_Exception $e) {
148
- foreach(explode("\n", $e->getMessage()) as $message) {
149
- $session->addError($message);
150
- }
151
- }
152
- catch (Exception $e) {
153
- $session->addException($e, Mage::helper('adminhtml')->__('Error while saving this configuration: '.$e->getMessage()));
154
- }
155
-
156
- $this->_saveState($this->getRequest()->getPost('config_state'));
157
-
158
- $this->_redirect('*/*/edit', array('_current' => array('section', 'website', 'store')));
159
- }
160
-
161
- /**
162
- * Custom save logic for section
163
- */
164
- protected function _saveSection ()
165
- {
166
- $method = '_save' . uc_words($this->getRequest()->getParam('section'), '');
167
- if (method_exists($this, $method)) {
168
- $this->$method();
169
- }
170
- }
171
-
172
- /**
173
- * Description goes here...
174
- */
175
- protected function _saveAdvanced ()
176
- {
177
- Mage::app()->cleanCache(
178
- array(
179
- 'layout',
180
- Mage_Core_Model_Layout_Update::LAYOUT_GENERAL_CACHE_TAG
181
- )
182
- );
183
- }
184
-
185
- /**
186
- * action for ajax saving of fieldset state
187
- *
188
- */
189
- public function stateAction()
190
- {
191
- if ($this->getRequest()->getParam('isAjax') == 1
192
- && $this->getRequest()->getParam('container') != ''
193
- && $this->getRequest()->getParam('value') != '') {
194
-
195
- $configState = array(
196
- $this->getRequest()->getParam('container') => $this->getRequest()->getParam('value')
197
- );
198
- $this->_saveState($configState);
199
- $this->getResponse()->setBody('success');
200
- }
201
- }
202
-
203
- /**
204
- * Enter description here...
205
- *
206
- */
207
- public function exportTableratesAction()
208
- {
209
- $websiteModel = Mage::app()->getWebsite($this->getRequest()->getParam('website'));
210
-
211
- if ($this->getRequest()->getParam('conditionName')) {
212
- $conditionName = $this->getRequest()->getParam('conditionName');
213
- } else {
214
- $conditionName = $websiteModel->getConfig('carriers/tablerate/condition_name');
215
- }
216
-
217
- $tableratesCollection = Mage::getResourceModel('shipping/carrier_tablerate_collection');
218
- /* @var $tableratesCollection Mage_Shipping_Model_Mysql4_Carrier_Tablerate_Collection */
219
- $tableratesCollection->setConditionFilter($conditionName);
220
- $tableratesCollection->setWebsiteFilter($websiteModel->getId());
221
- $tableratesCollection->load();
222
-
223
- $csv = '';
224
-
225
- $conditionName = Mage::getModel('shipping/carrier_tablerate')->getCode('condition_name_short', $conditionName);
226
-
227
- $csvHeader = array('"'.Mage::helper('adminhtml')->__('Country').'"', '"'.Mage::helper('adminhtml')->__('Region/State').'"', '"'.Mage::helper('adminhtml')->__('Zip/Postal Code').'"', '"'.$conditionName.'"', '"'.Mage::helper('adminhtml')->__('Shipping Price').'"');
228
- $csv .= implode(',', $csvHeader)."\n";
229
-
230
- foreach ($tableratesCollection->getItems() as $item) {
231
- if ($item->getData('dest_country') == '') {
232
- $country = '*';
233
- } else {
234
- $country = $item->getData('dest_country');
235
- }
236
- if ($item->getData('dest_region') == '') {
237
- $region = '*';
238
- } else {
239
- $region = $item->getData('dest_region');
240
- }
241
- if ($item->getData('dest_zip') == '') {
242
- $zip = '*';
243
- } else {
244
- $zip = $item->getData('dest_zip');
245
- }
246
-
247
- $csvData = array($country, $region, $zip, $item->getData('condition_value'), $item->getData('price'));
248
- foreach ($csvData as $cell) {
249
- $cell = '"'.str_replace('"', '""', $cell).'"';
250
- }
251
- $csv .= implode(',', $csvData)."\n";
252
- }
253
-
254
- header('Pragma: public');
255
- header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
256
-
257
- header("Content-type: application/octet-stream");
258
- header("Content-disposition: attachment; filename=tablerates.csv");
259
- echo $csv;
260
- exit;
261
- }
262
-
263
- /**
264
- * Enter description here...
265
- *
266
- */
267
- protected function _isAllowed()
268
- {
269
- return Mage::getSingleton('admin/session')->isAllowed('system/config');
270
- }
271
-
272
- /**
273
- * Check if specified section allowed in ACL
274
- *
275
- * Will forward to deniedAction(), if not allowed.
276
- *
277
- * @param string $section
278
- * @return bool
279
- */
280
- protected function _isSectionAllowed($section)
281
- {
282
- try {
283
- $session = Mage::getSingleton('admin/session');
284
- $resourceLookup = "admin/system/config/{$section}";
285
- $resourceId = $session->getData('acl')->get($resourceLookup)->getResourceId();
286
- if (!$session->isAllowed($resourceId)) {
287
- throw new Exception('');
288
- }
289
- return true;
290
- }
291
- catch (Exception $e) {
292
- $this->_forward('denied');
293
- return false;
294
- }
295
- }
296
-
297
- /**
298
- * saving state of config field sets
299
- *
300
- * @param array $configState
301
- * @return bool
302
- */
303
- protected function _saveState($configState = array())
304
- {
305
- $adminUser = Mage::getSingleton('admin/session')->getUser();
306
- if (is_array($configState)) {
307
- $extra = $adminUser->getExtra();
308
- if (!is_array($extra)) {
309
- $extra = array();
310
- }
311
- if (!isset($extra['configState'])) {
312
- $extra['configState'] = array();
313
- }
314
- foreach ($configState as $fieldset => $state) {
315
- $extra['configState'][$fieldset] = $state;
316
- }
317
- $adminUser->saveExtra($extra);
318
- }
319
-
320
- return true;
321
- }
322
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
media/Banners/images/Thumbs.db ADDED
Binary file
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Banners</name>
4
- <version>1.2.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL V3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Banner is a flexible solution that allow to manage banners in the easiest way.</summary>
10
  <description>Banner is a flexible solution that allow to manage banners in the easiest way.</description>
11
- <notes>NOTE: Please download the Latest release 1.2.3 from Releases section!</notes>
12
  <authors><author><name>Kamran Rafiq Malik</name><user>auto-converted</user><email>kamran.malik@unitedsol.net</email></author></authors>
13
  <date>2010-04-19</date>
14
- <time>09:30:52</time>
15
- <contents><target name="mage"><dir name="media"><dir name="Banners"><dir name="images"><file name="logo.png" hash="e33c86d89150a2d02f293f99aad7c062"/></dir><dir name="swf"><file name="banner.fla" hash="6c9b61429a2cf82af339e0dfe7b89911"/><file name="banner.swf" hash="3aa22fdf4e195134e9da0c781a5c6670"/><file name="swfobject.js" hash="b687734407abd950392ae2344b283b2c"/></dir><file name="banner.swf" hash="3aa22fdf4e195134e9da0c781a5c6670"/><file name="data.xml" hash="4ba9feb2b21520789678d4f95ebfe65e"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="banners.xml" hash="f614af3a90e6ecadc2fea0a7bd1966a9"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="banners.xml" hash="eaeb8086698ff4465edebcd738ecda25"/></dir><dir name="template"><dir name="banners"><file name="banners.phtml" hash="1c513dc4115653293812e4103784d881"/></dir></dir></dir></dir></dir></target><target name="magecore"><dir name="Mage"><dir name="Adminhtml"><dir name="controllers"><dir name="System"><file name="ConfigController.php" hash="e9562de21ec7886b22eacf430280a492"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="Mage"><dir name="Banners"><dir name="Block"><dir name="Adminhtml"><dir name="Banners"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="e09386ac043a9d6fe402a3f8ff0bca25"/></dir><file name="Form.php" hash="5d28449951793e81ddbe3c5be99fad57"/><file name="Tabs.php" hash="f2bf342dfb322366e4d509a35aafd8d5"/></dir><file name="Edit.php" hash="4b31a335d0cce9c08c83033effd2ecd1"/><file name="Grid.php" hash="899bb9d583533515949c0ac2daea7c37"/></dir><file name="Banners.php" hash="f2445f14f813ce3276ddb6968112c0cc"/></dir><file name="Banners.php" hash="5cec22181d5bd36e46db16a37a53c2fe"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BannersController.php" hash="e5b325df277c81e64c26ba7127512eae"/></dir><file name="IndexController.php" hash="9ca1c7010326b5ce868c5158eef39411"/></dir><dir name="etc"><file name="config.xml" hash="c04d625b5ebb66928dd9b309a3c9b8fc"/><file name="system.xml" hash="9a264a9c392206ef61ed5e17139f9386"/></dir><dir name="Helper"><file name="Data.php" hash="987b8f60662e4122192f78288b632f2a"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Banners"><file name="Collection.php" hash="3ba445eb7573d27e26f010b1eeadb043"/></dir><file name="Banners.php" hash="527016301edf177b1604dbe98c722756"/></dir><file name="Banners.php" hash="07374201a9f0549c2986f42ece034a8b"/><file name="Status.php" hash="3c3c447dadb5cd5e12308e5cf435d70c"/></dir><dir name="sql"><dir name="banners_setup"><file name="mysql4-install-0.1.0.php" hash="599bf22c4fd8376ee08358763b1f9052"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Banners.xml" hash="00231c699a70c089c808243400500e5e"/></dir></target><target name="magelib"><dir name="Varien"><dir name="Data"><dir name="Form"><dir name="Element"><file name="Thumbnail.php" hash="8909f9c5df2188e6eefc3f6509cafa76"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Banners</name>
4
+ <version>1.2.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL V3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Banner is a flexible solution that allow to manage banners in the easiest way.</summary>
10
  <description>Banner is a flexible solution that allow to manage banners in the easiest way.</description>
11
+ <notes>NOTE: Please download the Latest release 1.2.4 from Releases section!</notes>
12
  <authors><author><name>Kamran Rafiq Malik</name><user>auto-converted</user><email>kamran.malik@unitedsol.net</email></author></authors>
13
  <date>2010-04-19</date>
14
+ <time>10:26:12</time>
15
+ <contents><target name="mage"><dir name="media"><dir name="Banners"><dir name="images"><file name="logo.png" hash="e33c86d89150a2d02f293f99aad7c062"/><file name="Thumbs.db" hash="6def31a249c514a04bb90a964a8d8412"/></dir><dir name="swf"><file name="banner.fla" hash="6c9b61429a2cf82af339e0dfe7b89911"/><file name="banner.swf" hash="3aa22fdf4e195134e9da0c781a5c6670"/><file name="swfobject.js" hash="b687734407abd950392ae2344b283b2c"/></dir><file name="banner.swf" hash="3aa22fdf4e195134e9da0c781a5c6670"/><file name="data.xml" hash="4ba9feb2b21520789678d4f95ebfe65e"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="banners.xml" hash="f614af3a90e6ecadc2fea0a7bd1966a9"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="banners.xml" hash="eaeb8086698ff4465edebcd738ecda25"/></dir><dir name="template"><dir name="banners"><file name="banners.phtml" hash="1c513dc4115653293812e4103784d881"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Mage"><dir name="Banners"><dir name="Block"><dir name="Adminhtml"><dir name="Banners"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="e09386ac043a9d6fe402a3f8ff0bca25"/></dir><file name="Form.php" hash="5d28449951793e81ddbe3c5be99fad57"/><file name="Tabs.php" hash="f2bf342dfb322366e4d509a35aafd8d5"/></dir><file name="Edit.php" hash="4b31a335d0cce9c08c83033effd2ecd1"/><file name="Grid.php" hash="899bb9d583533515949c0ac2daea7c37"/></dir><file name="Banners.php" hash="f2445f14f813ce3276ddb6968112c0cc"/></dir><file name="Banners.php" hash="5cec22181d5bd36e46db16a37a53c2fe"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BannersController.php" hash="e5b325df277c81e64c26ba7127512eae"/></dir><file name="IndexController.php" hash="9ca1c7010326b5ce868c5158eef39411"/></dir><dir name="etc"><file name="config.xml" hash="c04d625b5ebb66928dd9b309a3c9b8fc"/><file name="system.xml" hash="9a264a9c392206ef61ed5e17139f9386"/></dir><dir name="Helper"><file name="Data.php" hash="987b8f60662e4122192f78288b632f2a"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Banners"><file name="Collection.php" hash="3ba445eb7573d27e26f010b1eeadb043"/></dir><file name="Banners.php" hash="527016301edf177b1604dbe98c722756"/></dir><file name="Banners.php" hash="07374201a9f0549c2986f42ece034a8b"/><file name="Status.php" hash="3c3c447dadb5cd5e12308e5cf435d70c"/></dir><dir name="sql"><dir name="banners_setup"><file name="mysql4-install-0.1.0.php" hash="599bf22c4fd8376ee08358763b1f9052"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Banners.xml" hash="00231c699a70c089c808243400500e5e"/></dir></target><target name="magelib"><dir name="Varien"><dir name="Data"><dir name="Form"><dir name="Element"><file name="Thumbnail.php" hash="8909f9c5df2188e6eefc3f6509cafa76"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>