WIC_All - Version 1.2.0

Version Notes

New release of our WIC Core module and installed through Magento Connect

Download this release

Release Info

Developer Web In Color
Extension WIC_All
Version 1.2.0
Comparing to
See all releases


Code changes from version 1.1.0 to 1.2.0

app/code/community/WIC/All/Block/Html/Head.php CHANGED
@@ -87,13 +87,125 @@ class WIC_All_Block_Html_Head extends Mage_Page_Block_Html_Head
87
  $lines[$itemIf]['other'][] = sprintf('<link%s href="%s" />', $params, $href);
88
  break;
89
 
90
- case 'external_js':
91
- $lines[$itemIf]['other'][] = sprintf('<script type="text/javascript" src="%s" %s></script>', $href, $params);
92
- break;
93
 
94
  case 'external_css':
95
  $lines[$itemIf]['other'][] = sprintf('<link rel="stylesheet" type="text/css" href="%s" %s/>', $href, $params);
96
  break;
97
  }
98
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  }
87
  $lines[$itemIf]['other'][] = sprintf('<link%s href="%s" />', $params, $href);
88
  break;
89
 
90
+ // case 'external_js':
91
+ // $lines[$itemIf]['other'][] = sprintf('<script type="text/javascript" src="%s" %s></script>', $href, $params);
92
+ // break;
93
 
94
  case 'external_css':
95
  $lines[$itemIf]['other'][] = sprintf('<link rel="stylesheet" type="text/css" href="%s" %s/>', $href, $params);
96
  break;
97
  }
98
  }
99
+
100
+ /**
101
+ * Get HEAD HTML with CSS/JS/RSS definitions
102
+ * (actually it also renders other elements, TODO: fix it up or rename this method)
103
+ *
104
+ * @return string
105
+ */
106
+ public function getCssJsHtml()
107
+ {
108
+ // separate items by types
109
+ $lines = array();
110
+
111
+ foreach ($this->_data['items'] as $item) {
112
+ if (!is_null($item['cond']) && !$this->getData($item['cond']) || !isset($item['name'])) {
113
+ continue;
114
+ }
115
+ $if = !empty($item['if']) ? $item['if'] : '';
116
+ $params = !empty($item['params']) ? $item['params'] : '';
117
+ switch ($item['type']) {
118
+ case 'external_js': // wic //*.js
119
+ case 'js': // js/*.js
120
+ case 'skin_js': // skin/*/*.js
121
+ case 'js_css': // js/*.css
122
+ case 'skin_css': // skin/*/*.css
123
+ $lines[$if][$item['type']][$params][$item['name']] = $item['name'];
124
+ break;
125
+ default:
126
+ $this->_separateOtherHtmlHeadElements($lines, $if, $item['type'], $params, $item['name'], $item);
127
+ break;
128
+ }
129
+ }
130
+
131
+
132
+
133
+ // prepare HTML
134
+ $shouldMergeJs = Mage::getStoreConfigFlag('dev/js/merge_files');
135
+ $shouldMergeCss = Mage::getStoreConfigFlag('dev/css/merge_css_files');
136
+ $html = '';
137
+ foreach ($lines as $if => $items) {
138
+ if (empty($items)) {
139
+ continue;
140
+ }
141
+ if (!empty($if)) {
142
+ // open !IE conditional using raw value
143
+ if (strpos($if, "><!-->") !== false) {
144
+ $html .= $if . "\n";
145
+ } else {
146
+ $html .= '<!--[if '.$if.']>' . "\n";
147
+ }
148
+ }
149
+
150
+ // wic- external js
151
+ $html .= $this->_prepareExternalJsElements('<script type="text/javascript" src="%s"%s></script>' . "\n",
152
+ empty($items['external_js']) ? array() : $items['external_js']
153
+ );
154
+
155
+ // static and skin css
156
+ $html .= $this->_prepareStaticAndSkinElements('<link rel="stylesheet" type="text/css" href="%s"%s />'."\n",
157
+ empty($items['js_css']) ? array() : $items['js_css'],
158
+ empty($items['skin_css']) ? array() : $items['skin_css'],
159
+ $shouldMergeCss ? array(Mage::getDesign(), 'getMergedCssUrl') : null
160
+ );
161
+
162
+ // static and skin javascripts
163
+ $html .= $this->_prepareStaticAndSkinElements('<script type="text/javascript" src="%s"%s></script>' . "\n",
164
+ empty($items['js']) ? array() : $items['js'],
165
+ empty($items['skin_js']) ? array() : $items['skin_js'],
166
+ $shouldMergeJs ? array(Mage::getDesign(), 'getMergedJsUrl') : null
167
+ );
168
+
169
+ // other stuff
170
+ if (!empty($items['other'])) {
171
+ $html .= $this->_prepareOtherHtmlHeadElements($items['other']) . "\n";
172
+ }
173
+
174
+ if (!empty($if)) {
175
+ // close !IE conditional comments correctly
176
+ if (strpos($if, "><!-->") !== false) {
177
+ $html .= '<!--<![endif]-->' . "\n";
178
+ } else {
179
+ $html .= '<![endif]-->' . "\n";
180
+ }
181
+ }
182
+ }
183
+ return $html;
184
+ }
185
+
186
+ protected function &_prepareExternalJsElements($format, array $externalItems)
187
+ {
188
+
189
+ $items = array();
190
+
191
+ // get external url
192
+ foreach ($externalItems as $params => $rows) {
193
+ foreach ($rows as $name) {
194
+ $items[$params][] = $name;
195
+ }
196
+ }
197
+
198
+ $html = '';
199
+ foreach ($items as $params => $rows) {
200
+
201
+ // render elements
202
+ $params = trim($params);
203
+ $params = $params ? ' ' . $params : '';
204
+ foreach ($rows as $src) {
205
+ $html .= sprintf($format, $src, $params);
206
+ }
207
+ }
208
+ return $html;
209
+ }
210
+
211
  }
app/code/community/WIC/All/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <WIC_All>
5
- <version>1.1.0</version>
6
  </WIC_All>
7
  </modules>
8
  <global>
@@ -47,6 +47,15 @@
47
  </wicall_read>
48
  </resources>
49
  </global>
 
 
 
 
 
 
 
 
 
50
  <adminhtml>
51
  <layout>
52
  <updates>
2
  <config>
3
  <modules>
4
  <WIC_All>
5
+ <version>1.2.0</version>
6
  </WIC_All>
7
  </modules>
8
  <global>
47
  </wicall_read>
48
  </resources>
49
  </global>
50
+ <frontend>
51
+ <layout>
52
+ <updates>
53
+ <wicall module="WIC_All">
54
+ <file>wic/all.xml</file>
55
+ </wicall>
56
+ </updates>
57
+ </layout>
58
+ </frontend>
59
  <adminhtml>
60
  <layout>
61
  <updates>
app/code/community/WIC/All/etc/system.xml CHANGED
@@ -1,32 +1,52 @@
1
  <?xml version="1.0"?>
2
  <config>
3
- <tabs>
4
- <wic translate="label">
5
- <label>WIC</label>
6
- <sort_order>401</sort_order>
7
- <class>wic-tab</class>
8
- </wic>
9
- </tabs>
10
- <sections>
11
- <wicall translate="label" module="wicall">
12
- <label><![CDATA[General]]></label>
13
- <tab>wic</tab>
14
- <frontend_type>text</frontend_type>
15
- <sort_order>1</sort_order>
16
- <show_in_default>1</show_in_default>
17
- <show_in_website>1</show_in_website>
18
- <show_in_store>1</show_in_store>
19
- <groups>
20
  <extensions translate="label">
21
  <label>Installed Extensions</label>
22
  <frontend_type>text</frontend_type>
23
  <frontend_model>wicall/extensions</frontend_model>
24
- <sort_order>2</sort_order>
25
  <show_in_default>1</show_in_default>
26
  <show_in_website>1</show_in_website>
27
  <show_in_store>1</show_in_store>
28
- </extensions>
29
- </groups>
30
- </wicall>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  </sections>
32
  </config>
1
  <?xml version="1.0"?>
2
  <config>
3
+ <tabs>
4
+ <wic translate="label">
5
+ <label>WIC</label>
6
+ <sort_order>401</sort_order>
7
+ <class>wic-tab</class>
8
+ </wic>
9
+ </tabs>
10
+ <sections>
11
+ <wicall translate="label" module="wicall">
12
+ <label><![CDATA[General]]></label>
13
+ <tab>wic</tab>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>1</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <groups>
20
  <extensions translate="label">
21
  <label>Installed Extensions</label>
22
  <frontend_type>text</frontend_type>
23
  <frontend_model>wicall/extensions</frontend_model>
24
+ <sort_order>10</sort_order>
25
  <show_in_default>1</show_in_default>
26
  <show_in_website>1</show_in_website>
27
  <show_in_store>1</show_in_store>
28
+ </extensions>
29
+ <jquery translate="label">
30
+ <label>jQuery</label>
31
+ <frontend_type>text</frontend_type>
32
+ <sort_order>30</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ <fields>
37
+ <enable translate="label comment">
38
+ <label>Include jQuery</label>
39
+ <frontend_type>select</frontend_type>
40
+ <source_model>adminhtml/system_config_source_yesno</source_model>
41
+ <sort_order>31</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ <comment><![CDATA[Depending on your configuration. Not necessary for Magento 1.9+.]]></comment>
46
+ </enable>
47
+ </fields>
48
+ </jquery>
49
+ </groups>
50
+ </wicall>
51
  </sections>
52
  </config>
app/design/frontend/base/default/layout/wic/all.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addItem" ifconfig="wicall/jquery/enable"><type>external_js</type><name>//code.jquery.com/jquery-latest.min.js</name></action>
6
+ <action method="addItem" ifconfig="wicall/jquery/enable"><type>js</type><name>wic/all/jquery.noconflict.js</name></action>
7
+ </reference>
8
+ </default>
9
+ </layout>
app/locale/en_US/WIC_All.csv CHANGED
@@ -1 +1,4 @@
1
- "Installed Extensions","Installed Extensions"
 
 
 
1
+ "Installed Extensions","Installed Extensions"
2
+ "Select attribute to map","Select attribute to map"
3
+ "Include jQuery","Include jQuery"
4
+ "Depending on your configuration. Not necessary for Magento 1.9+.","Depending on your configuration. Not necessary for Magento 1.9+."
app/locale/fr_FR/WIC_All.csv CHANGED
@@ -1,2 +1,4 @@
1
  "Installed Extensions","Modules installés"
2
- "Select attribute to map","Séléctionner l'attribut a mapper"
 
 
1
  "Installed Extensions","Modules installés"
2
+ "Select attribute to map","Séléctionner l'attribut a mapper"
3
+ "Include jQuery","Inclure jQuery"
4
+ "Depending on your configuration. Not necessary for Magento 1.9+.","En fonction de votre configuration. Pas nécessaire pour Magento 1.9+."
js/wic/all/jquery.noconflict.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ // Avoid PrototypeJS conflicts, assign jQuery to $j instead of $
2
+ var $j = jQuery.noConflict();
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>WIC_All</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">The Open Software License 3.0 (OSL-3.0)</license>
7
  <channel>community</channel>
@@ -19,9 +19,9 @@ Ce module Core &amp; Utility package est n&#xE9;cessaire pour le fonctionnement
19
  Pour plus d'information merci de visiter le &lt;a href="http://store.webincolor.fr"&gt;Store d'extension Magento Webincolor&lt;/a&gt;</description>
20
  <notes>New release of our WIC Core module and installed through Magento Connect</notes>
21
  <authors><author><name>Web In Color</name><user>webincolor</user><email>contact@webincolor.fr</email></author></authors>
22
- <date>2014-12-10</date>
23
- <time>11:33:49</time>
24
- <contents><target name="magecommunity"><dir name="WIC"><dir name="All"><dir name="Block"><file name="Extensions.php" hash="9675492162e2c90cbe6214c1f5c82d32"/><dir name="Html"><file name="Head.php" hash="67561290bf7d2dfcf0773c7b625f94b8"/></dir></dir><dir name="Helper"><file name="Data.php" hash="db6319093e7e520198edec46abc106fd"/></dir><dir name="Model"><dir name="Catalog"><dir name="Convert"><dir name="Parser"><file name="Product.php" hash="40c168af1be0ecdb847eaee0365d15ef"/></dir></dir></dir><dir name="Source"><file name="Attributes.php" hash="fe0a7821e52d5794e1e8fa403eeab69a"/></dir></dir><dir name="etc"><file name="config.xml" hash="1976a9900632d2881048145ee9195ced"/><file name="system.xml" hash="bc711e7e8d71a9ced216223d959490e4"/></dir><dir name="sql"><dir name="wicall_setup"><file name="mysql4-install-1.0.0.php" hash="c05dcd363b70b96a7ac8486a22b877b7"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="wic"><file name="all.xml" hash="c15d5bdb46061fe92a3aa92cf11f04a7"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="wic"><dir name="all"><dir><dir name="css"><file name="tab.css" hash="ef8952d96fcb600de21199fa59338b2a"/></dir><dir name="images"><file name="ok.gif" hash="7ea13c1a3d1b4c1d7a7dccf6b83b0391"/><file name="wic.png" hash="05ab11c89a103417af6ffef8a8ea5dc5"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="WIC_All.xml" hash="b8f57cc72e3c717744d8792bd260a84e"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="WIC_All.csv" hash="610e0de2f2fe3ada84b7b30297368208"/></dir><dir name="fr_FR"><file name="WIC_All.csv" hash="482635cd580ce4c08a3609704c4b371c"/></dir></dir></target><target name="mageweb"><dir name="."><file name="WIC-LICENSE.TXT" hash="460ced36627150fe9f9ecb733309b62a"/></dir></target></contents>
25
  <compatible/>
26
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
27
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>WIC_All</name>
4
+ <version>1.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">The Open Software License 3.0 (OSL-3.0)</license>
7
  <channel>community</channel>
19
  Pour plus d'information merci de visiter le &lt;a href="http://store.webincolor.fr"&gt;Store d'extension Magento Webincolor&lt;/a&gt;</description>
20
  <notes>New release of our WIC Core module and installed through Magento Connect</notes>
21
  <authors><author><name>Web In Color</name><user>webincolor</user><email>contact@webincolor.fr</email></author></authors>
22
+ <date>2015-09-29</date>
23
+ <time>07:34:14</time>
24
+ <contents><target name="magecommunity"><dir name="WIC"><dir name="All"><dir name="Block"><file name="Extensions.php" hash="9675492162e2c90cbe6214c1f5c82d32"/><dir name="Html"><file name="Head.php" hash="5394f89960ab55b258112ae3de0277da"/></dir></dir><dir name="Helper"><file name="Data.php" hash="db6319093e7e520198edec46abc106fd"/></dir><dir name="Model"><dir name="Catalog"><dir name="Convert"><dir name="Parser"><file name="Product.php" hash="40c168af1be0ecdb847eaee0365d15ef"/></dir></dir></dir><dir name="Source"><file name="Attributes.php" hash="fe0a7821e52d5794e1e8fa403eeab69a"/></dir></dir><dir name="etc"><file name="config.xml" hash="94fe10631be6590d901df036ee061d58"/><file name="system.xml" hash="fc6ec17c3c8c5a38caebfa8dc8ce7ed6"/></dir><dir name="sql"><dir name="wicall_setup"><file name="mysql4-install-1.0.0.php" hash="c05dcd363b70b96a7ac8486a22b877b7"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="wic"><file name="all.xml" hash="c15d5bdb46061fe92a3aa92cf11f04a7"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="wic"><file name="all.xml" hash="5ed6d88bf9b67923ff8ffd41e7b560d1"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="wic"><dir name="all"><dir><dir name="css"><file name="tab.css" hash="ef8952d96fcb600de21199fa59338b2a"/></dir><dir name="images"><file name="ok.gif" hash="7ea13c1a3d1b4c1d7a7dccf6b83b0391"/><file name="wic.png" hash="05ab11c89a103417af6ffef8a8ea5dc5"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="WIC_All.xml" hash="b8f57cc72e3c717744d8792bd260a84e"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="WIC_All.csv" hash="6b417faee68f1246562121e70408b6b8"/></dir><dir name="fr_FR"><file name="WIC_All.csv" hash="9c7c48e058e833164b5037a5f6fa3391"/></dir></dir></target><target name="mageweb"><dir name="."><file name="WIC-LICENSE.TXT" hash="460ced36627150fe9f9ecb733309b62a"/></dir><dir name="js"><dir name="wic"><dir name="all"><file name="jquery.noconflict.js" hash="6f9e578b15b76c89f25f284e8df57df2"/></dir></dir></dir></target></contents>
25
  <compatible/>
26
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
27
  </package>