IG_NamedImages - Version 1.0.0

Version Notes

Enjoy it ;)

Download this release

Release Info

Developer Riccardo Tempesta
Extension IG_NamedImages
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/IG/NamedImages/Helper/Data.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
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://www.idealiagroup.com/magento-ext-license.html
11
+ *
12
+ * @category IG
13
+ * @package IG_NamedImages
14
+ * @copyright Copyright (c) 2010-2011 IDEALIAGroup srl (http://www.idealiagroup.com)
15
+ * @license http://www.idealiagroup.com/magento-ext-license.html
16
+ */
17
+
18
+ class IG_NamedImages_Helper_Data extends Mage_Core_Helper_Abstract
19
+ {
20
+ const XML_PATH_ENABLED = 'ig_namedimages/general/enabled';
21
+
22
+ /**
23
+ * Check if component is enabled or not
24
+ *
25
+ * @return bool
26
+ */
27
+ public function getIsEnabled()
28
+ {
29
+ return Mage::getStoreConfig(self::XML_PATH_ENABLED) ? true : false;
30
+ }
31
+ }
app/code/community/IG/NamedImages/Helper/Image.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
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://www.idealiagroup.com/magento-ext-license.html
11
+ *
12
+ * @category IG
13
+ * @package IG_NamedImages
14
+ * @copyright Copyright (c) 2010-2011 IDEALIAGroup srl (http://www.idealiagroup.com)
15
+ * @license http://www.idealiagroup.com/magento-ext-license.html
16
+ */
17
+
18
+ class IG_NamedImages_Helper_Image extends Mage_Catalog_Helper_Image
19
+ {
20
+ protected function _getModel()
21
+ {
22
+ if (Mage::helper('ig_namedimages')->getIsEnabled() && !$this->_model->getProduct())
23
+ {
24
+ $this->_model->setProduct($this->getProduct());
25
+ }
26
+
27
+ return $this->_model;
28
+ }
29
+ }
app/code/community/IG/NamedImages/Model/Product/Image.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDEALIAGroup srl
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
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://www.idealiagroup.com/magento-ext-license.html
11
+ *
12
+ * @category IG
13
+ * @package IG_NamedImages
14
+ * @copyright Copyright (c) 2010-2011 IDEALIAGroup srl (http://www.idealiagroup.com)
15
+ * @license http://www.idealiagroup.com/magento-ext-license.html
16
+ */
17
+
18
+ class IG_NamedImages_Model_Product_Image extends Mage_Catalog_Model_Product_Image
19
+ {
20
+ public function setBaseFile($file)
21
+ {
22
+ if (!Mage::helper('ig_namedimages')->getIsEnabled())
23
+ return parent::setBaseFile($file);
24
+
25
+ $product = $this->getProduct();
26
+ $imageName = strtolower(preg_replace('/\W+/', '_', $product->getName())).'.jpg';
27
+
28
+ parent::setBaseFile($file);
29
+
30
+ $this->_newFile = preg_replace('/\/[^\/]+\.\w+$/', '/'.$imageName, $this->_newFile);
31
+
32
+ return $return;
33
+ }
34
+ }
app/code/community/IG/NamedImages/etc/config.xml ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * IDEALIAGroup srl
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.idealiagroup.com/magento-ext-license.html
12
+ *
13
+ * @category IG
14
+ * @package IG_NamedImages
15
+ * @copyright Copyright (c) 2010-2011 IDEALIAGroup srl (http://www.idealiagroup.com)
16
+ * @license http://www.idealiagroup.com/magento-ext-license.html
17
+ */
18
+ -->
19
+ <config>
20
+ <modules>
21
+ <IG_NamedImages>
22
+ <version>1.0.0</version>
23
+ </IG_NamedImages>
24
+ </modules>
25
+ <global>
26
+ <helpers>
27
+ <ig_namedimages>
28
+ <class>IG_NamedImages_Helper</class>
29
+ </ig_namedimages>
30
+
31
+ <catalog>
32
+ <rewrite>
33
+ <image>IG_NamedImages_Helper_Image</image>
34
+ </rewrite>
35
+ </catalog>
36
+ </helpers>
37
+
38
+ <models>
39
+ <ig_namedimages>
40
+ <class>IG_NamedImages_Model</class>
41
+ </ig_namedimages>
42
+
43
+ <catalog>
44
+ <rewrite>
45
+ <product_image>IG_NamedImages_Model_Product_Image</product_image>
46
+ </rewrite>
47
+ </catalog>
48
+ </models>
49
+ </global>
50
+
51
+ <adminhtml>
52
+ <acl>
53
+ <resources>
54
+ <admin>
55
+ <children>
56
+ <system>
57
+ <children>
58
+ <config>
59
+ <children>
60
+ <ig_namedimages translate="title" module="ig_namedimages">
61
+ <title>IG NamedImages</title>
62
+ <sort_order>1000</sort_order>
63
+ </ig_namedimages>
64
+ </children>
65
+ </config>
66
+ </children>
67
+ </system>
68
+ </children>
69
+ </admin>
70
+ </resources>
71
+ </acl>
72
+ </adminhtml>
73
+
74
+ <default>
75
+ <ig_namedimages>
76
+ <general>
77
+ <enabled>1</enabled>
78
+ </general>
79
+ </ig_namedimages>
80
+ </default>
81
+ </config>
app/code/community/IG/NamedImages/etc/system.xml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * IDEALIAGroup srl
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.idealiagroup.com/magento-ext-license.html
12
+ *
13
+ * @category IG
14
+ * @package IG_NamedImages
15
+ * @copyright Copyright (c) 2010-2011 IDEALIAGroup srl (http://www.idealiagroup.com)
16
+ * @license http://www.idealiagroup.com/magento-ext-license.html
17
+ */
18
+ -->
19
+ <config>
20
+ <tabs>
21
+ <ig translate="label" module="ig_namedimages">
22
+ <label>IdealiaGroup</label>
23
+ <sort_order>200</sort_order>
24
+ </ig>
25
+ </tabs>
26
+ <sections>
27
+ <ig_namedimages translate="label" module="ig_namedimages">
28
+ <label>IG NamedImages</label>
29
+ <tab>ig</tab>
30
+ <frontend_type>text</frontend_type>
31
+ <sort_order>10</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ <groups>
36
+ <general translate="label">
37
+ <label>General</label>
38
+ <frontend_type>text</frontend_type>
39
+ <sort_order>10</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ <fields>
44
+ <enabled translate="label">
45
+ <label>Enable UniFeed</label>
46
+ <frontend_type>select</frontend_type>
47
+ <source_model>adminhtml/system_config_source_yesno</source_model>
48
+ <sort_order>10</sort_order>
49
+ <show_in_default>1</show_in_default>
50
+ <show_in_website>0</show_in_website>
51
+ <show_in_store>0</show_in_store>
52
+ </enabled>
53
+ </fields>
54
+ </general>
55
+ </groups>
56
+ </ig_namedimages>
57
+ </sections>
58
+ </config>
app/etc/modules/IG_NamedImages.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * IDEALIAGroup srl
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.idealiagroup.com/magento-ext-license.html
12
+ *
13
+ * @category IG
14
+ * @package IG_NamedImages
15
+ * @copyright Copyright (c) 2010-2011 IDEALIAGroup srl (http://www.idealiagroup.com)
16
+ * @license http://www.idealiagroup.com/magento-ext-license.html
17
+ */
18
+ -->
19
+ <config>
20
+ <modules>
21
+ <IG_NamedImages>
22
+ <active>true</active>
23
+ <codePool>community</codePool>
24
+ </IG_NamedImages>
25
+ </modules>
26
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>IG_NamedImages</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.idealiagroup.com/magento-ext-license.html">Commercial</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>IDEALIAGroup NamedImages for SEO purpose</summary>
10
+ <description>IDEALIAGroup NamedImages for SEO purpose</description>
11
+ <notes>Enjoy it ;)</notes>
12
+ <authors><author><name>Riccardo Tempesta</name><user>idealiagroup</user><email>tempesta@idealiagroup.com</email></author><author><name>Marco Giorgetti</name><user>idealiagroup</user><email>giorgetti@idealiagroup.com</email></author></authors>
13
+ <date>2011-12-28</date>
14
+ <time>10:44:01</time>
15
+ <contents><target name="magecommunity"><dir name="IG"><dir name="NamedImages"><dir name="Helper"><file name="Data.php" hash="0e85269a49dfbd9d4d3ffd76ccd4695e"/><file name="Image.php" hash="20c90fb84dd33cc5f5f291e38fafa5d7"/></dir><dir name="Model"><dir name="Product"><file name="Image.php" hash="8c783444b2272ae9e6603ea49d72914d"/></dir></dir><dir name="etc"><file name="config.xml" hash="753644860464dbe17e59b28d1e857f40"/><file name="system.xml" hash="47937781e8c6f153b0329af1263400c5"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="IG_NamedImages.xml" hash="7e88653bdf34148d22f4000be9d6e1a3"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>