MultiLanguage_Sitemap - Version 2.0.1

Version Notes

Multi-Language Optimization (hreflang) Module.

This version properly configured automatically generates a multi-language sitemap supported by Google.

New features include:

- ability to include CMS pages
- exclusion of disabled products and categories

Download this release

Release Info

Developer Elie Orgel
Extension MultiLanguage_Sitemap
Version 2.0.1
Comparing to
See all releases


Code changes from version 1.0.3 to 2.0.1

Files changed (21) hide show
  1. app/code/{local → community}/Harapartners/SitemapXml/Block/Adminhtml/Language/Edit.php +59 -59
  2. app/code/{local → community}/Harapartners/SitemapXml/Block/Adminhtml/Language/Edit/Form.php +61 -61
  3. app/code/{local → community}/Harapartners/SitemapXml/Block/Adminhtml/Language/Index.php +22 -22
  4. app/code/{local → community}/Harapartners/SitemapXml/Block/Adminhtml/Language/Index/Grid.php +72 -72
  5. app/code/{local → community}/Harapartners/SitemapXml/Helper/Data.php +20 -20
  6. app/code/{local → community}/Harapartners/SitemapXml/Helper/Rewrite/Adminhtml/Catalog.php +17 -17
  7. app/code/community/Harapartners/SitemapXml/Helper/Store/Catalog.php +80 -0
  8. app/code/{local → community}/Harapartners/SitemapXml/Model/Language.php +20 -20
  9. app/code/{local → community}/Harapartners/SitemapXml/Model/Resource/Catalog/Product.php +0 -0
  10. app/code/{local → community}/Harapartners/SitemapXml/Model/Resource/Language.php +18 -18
  11. app/code/{local → community}/Harapartners/SitemapXml/Model/Resource/Language/Collection.php +20 -20
  12. app/code/{local → community}/Harapartners/SitemapXml/Model/Rewrite/Sitemap/Sitemap.php +168 -167
  13. app/code/{local → community}/Harapartners/SitemapXml/Model/Source/Store.php +68 -68
  14. app/code/{local → community}/Harapartners/SitemapXml/Model/Source/Xml.php +240 -152
  15. app/code/{local → community}/Harapartners/SitemapXml/controllers/Adminhtml/LanguageController.php +111 -111
  16. app/code/{local → community}/Harapartners/SitemapXml/etc/adminhtml.xml +45 -45
  17. app/code/{local → community}/Harapartners/SitemapXml/etc/config.xml +76 -90
  18. app/code/{local → community}/Harapartners/SitemapXml/etc/system.xml +63 -63
  19. app/code/{local → community}/Harapartners/SitemapXml/sql/sitemapxml_setup/install-1.0.0.php +37 -37
  20. app/etc/modules/Harapartners_Sitemapxml.xml +8 -8
  21. package.xml +12 -6
app/code/{local → community}/Harapartners/SitemapXml/Block/Adminhtml/Language/Edit.php RENAMED
@@ -1,60 +1,60 @@
1
- <?php
2
- /**
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- */
12
-
13
- class Harapartners_SitemapXml_Block_Adminhtml_Language_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
14
- {
15
-
16
- public function __construct()
17
- {
18
- parent::__construct();
19
-
20
- $this->_objectId = 'language_id';
21
- $this->_blockGroup = 'sitemapxml';
22
- $this->_controller = 'adminhtml_Language';
23
-
24
- $this->_updateButton('save', 'label', Mage::helper('sitemapxml')->__('Save Language Map'));
25
- $this->_updateButton('delete', 'label', Mage::helper('sitemapxml')->__('Delete Language Map'));
26
- }
27
-
28
- public function getHeaderText()
29
- {
30
- if (Mage::registry('sitemapxml_language_data') && Mage::registry('sitemapxml_language_data')->getId()) {
31
- return Mage::helper('sitemapxml')->__('Edit Record Map');
32
- } else {
33
- return Mage::helper('sitemapxml')->__('Add Record Map');
34
- }
35
- }
36
-
37
- protected function _prepareLayout()
38
- {
39
- $this->setChild('back_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
40
- 'label' => Mage::helper('sitemapxml')->__('Back') ,
41
- 'onclick' => "setLocation('" . $this->getUrl('*/*/index') . "')" ,
42
- 'class' => 'back'
43
- )));
44
-
45
- return parent::_prepareLayout();
46
- }
47
-
48
- public function getBackButtonHtml()
49
- {
50
- return $this->getChildHtml('back_button');
51
- }
52
-
53
- public function getSaveUrl()
54
- {
55
- return $this->getUrl('*/*/save', array(
56
- '_current' => true
57
- ));
58
- }
59
-
60
  }
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ */
12
+
13
+ class Harapartners_SitemapXml_Block_Adminhtml_Language_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
14
+ {
15
+
16
+ public function __construct()
17
+ {
18
+ parent::__construct();
19
+
20
+ $this->_objectId = 'language_id';
21
+ $this->_blockGroup = 'sitemapxml';
22
+ $this->_controller = 'adminhtml_Language';
23
+
24
+ $this->_updateButton('save', 'label', Mage::helper('sitemapxml')->__('Save Language Map'));
25
+ $this->_updateButton('delete', 'label', Mage::helper('sitemapxml')->__('Delete Language Map'));
26
+ }
27
+
28
+ public function getHeaderText()
29
+ {
30
+ if (Mage::registry('sitemapxml_language_data') && Mage::registry('sitemapxml_language_data')->getId()) {
31
+ return Mage::helper('sitemapxml')->__('Edit Record Map');
32
+ } else {
33
+ return Mage::helper('sitemapxml')->__('Add Record Map');
34
+ }
35
+ }
36
+
37
+ protected function _prepareLayout()
38
+ {
39
+ $this->setChild('back_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
40
+ 'label' => Mage::helper('sitemapxml')->__('Back') ,
41
+ 'onclick' => "setLocation('" . $this->getUrl('*/*/index') . "')" ,
42
+ 'class' => 'back'
43
+ )));
44
+
45
+ return parent::_prepareLayout();
46
+ }
47
+
48
+ public function getBackButtonHtml()
49
+ {
50
+ return $this->getChildHtml('back_button');
51
+ }
52
+
53
+ public function getSaveUrl()
54
+ {
55
+ return $this->getUrl('*/*/save', array(
56
+ '_current' => true
57
+ ));
58
+ }
59
+
60
  }
app/code/{local → community}/Harapartners/SitemapXml/Block/Adminhtml/Language/Edit/Form.php RENAMED
@@ -1,62 +1,62 @@
1
- <?php
2
- /**
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- */
12
-
13
- class Harapartners_SitemapXml_Block_Adminhtml_Language_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
14
- {
15
-
16
- protected function _prepareForm()
17
- {
18
- $yesno = Mage::getModel('adminhtml/system_config_source_yesno');
19
-
20
- $form = new Varien_Data_Form(array(
21
- 'id' => 'edit_form' ,
22
- 'action' => $this->getData('action') ,
23
- 'method' => 'post'
24
- ));
25
-
26
- // -------------------------------- Basic Info -------------------------------- //
27
- $fieldsetIds = $form->addFieldset('language', array(
28
- 'legend' => Mage::helper('sitemapxml')->__('Language Map Info')
29
- ));
30
-
31
- $fieldsetIds->addField('language_id', 'label', array(
32
- 'label' => Mage::helper('sitemapxml')->__('Language Map ID') ,
33
- 'name' => 'language_id' ,
34
- 'required' => true
35
- ));
36
-
37
- $fieldsetIds->addField('store_view_id', 'select', array(
38
- 'label' => Mage::helper('sitemapxml')->__('Record Map Status'),
39
- 'name' => 'store_view_id',
40
- 'values' => Mage::getModel('sitemapxml/source_store')->toOptionArray(),
41
- 'required' => true
42
- ));
43
-
44
- $fieldsetIds->addField('language_code', 'text', array(
45
- 'label' => Mage::helper('sitemapxml')->__('Language Code') ,
46
- 'name' => 'language_code',
47
- 'required' => true
48
- ));
49
-
50
-
51
- if (Mage::registry('sitemapxml_language_data')) {
52
- $form->setValues(Mage::registry('sitemapxml_language_data')->getData());
53
- } elseif ($recordData = Mage::getSingleton('adminhtml/session')->getData('sitemapxml_language_data')) {
54
- $form->setValues($recordData);
55
- Mage::getSingleton('adminhtml/session')->setData('sitemapxml_language_data', null);
56
- }
57
-
58
- $form->setUseContainer(true);
59
- $this->setForm($form);
60
- return parent::_prepareForm();
61
- }
62
  }
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ */
12
+
13
+ class Harapartners_SitemapXml_Block_Adminhtml_Language_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
14
+ {
15
+
16
+ protected function _prepareForm()
17
+ {
18
+ $yesno = Mage::getModel('adminhtml/system_config_source_yesno');
19
+
20
+ $form = new Varien_Data_Form(array(
21
+ 'id' => 'edit_form' ,
22
+ 'action' => $this->getData('action') ,
23
+ 'method' => 'post'
24
+ ));
25
+
26
+ // -------------------------------- Basic Info -------------------------------- //
27
+ $fieldsetIds = $form->addFieldset('language', array(
28
+ 'legend' => Mage::helper('sitemapxml')->__('Language Map Info')
29
+ ));
30
+
31
+ $fieldsetIds->addField('language_id', 'label', array(
32
+ 'label' => Mage::helper('sitemapxml')->__('Language Map ID') ,
33
+ 'name' => 'language_id' ,
34
+ 'required' => true
35
+ ));
36
+
37
+ $fieldsetIds->addField('store_view_id', 'select', array(
38
+ 'label' => Mage::helper('sitemapxml')->__('Record Map Status'),
39
+ 'name' => 'store_view_id',
40
+ 'values' => Mage::getModel('sitemapxml/source_store')->toOptionArray(),
41
+ 'required' => true
42
+ ));
43
+
44
+ $fieldsetIds->addField('language_code', 'text', array(
45
+ 'label' => Mage::helper('sitemapxml')->__('Language Code') ,
46
+ 'name' => 'language_code',
47
+ 'required' => true
48
+ ));
49
+
50
+
51
+ if (Mage::registry('sitemapxml_language_data')) {
52
+ $form->setValues(Mage::registry('sitemapxml_language_data')->getData());
53
+ } elseif ($recordData = Mage::getSingleton('adminhtml/session')->getData('sitemapxml_language_data')) {
54
+ $form->setValues($recordData);
55
+ Mage::getSingleton('adminhtml/session')->setData('sitemapxml_language_data', null);
56
+ }
57
+
58
+ $form->setUseContainer(true);
59
+ $this->setForm($form);
60
+ return parent::_prepareForm();
61
+ }
62
  }
app/code/{local → community}/Harapartners/SitemapXml/Block/Adminhtml/Language/Index.php RENAMED
@@ -1,23 +1,23 @@
1
- <?php
2
- /**
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- */
12
-
13
- class Harapartners_SitemapXml_Block_Adminhtml_Language_Index extends Mage_Adminhtml_Block_Widget_Grid_Container {
14
- /**
15
- * Constructor
16
- */
17
- public function __construct() {
18
- parent::__construct ();
19
- $this->_blockGroup = 'sitemapxml';
20
- $this->_controller = 'adminhtml_language_index';
21
- $this->_headerText = Mage::helper ( 'sitemapxml' )->__ ( 'Langauge Map Entries' );
22
- }
23
  }
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ */
12
+
13
+ class Harapartners_SitemapXml_Block_Adminhtml_Language_Index extends Mage_Adminhtml_Block_Widget_Grid_Container {
14
+ /**
15
+ * Constructor
16
+ */
17
+ public function __construct() {
18
+ parent::__construct ();
19
+ $this->_blockGroup = 'sitemapxml';
20
+ $this->_controller = 'adminhtml_language_index';
21
+ $this->_headerText = Mage::helper ( 'sitemapxml' )->__ ( 'Langauge Map Entries' );
22
+ }
23
  }
app/code/{local → community}/Harapartners/SitemapXml/Block/Adminhtml/Language/Index/Grid.php RENAMED
@@ -1,73 +1,73 @@
1
- <?php
2
- /**
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- */
12
-
13
- class Harapartners_SitemapXml_Block_Adminhtml_Language_Index_Grid extends Mage_Adminhtml_Block_Widget_Grid
14
- {
15
-
16
- public function __construct()
17
- {
18
- parent::__construct();
19
- $this->setId('netsuiteLanguageGrid');
20
- }
21
-
22
- protected function _prepareCollection()
23
- {
24
- $model = Mage::getModel('sitemapxml/language');
25
- $collection = $model->getCollection();
26
- $this->setCollection($collection);
27
- parent::_prepareCollection();
28
- return $this;
29
- }
30
-
31
- protected function _getStore()
32
- {
33
- $storeId = (int) $this->getRequest()->getParam('store', 0);
34
- return Mage::app()->getStore($storeId);
35
- }
36
-
37
- protected function _prepareColumns()
38
- {
39
- $this->addColumn('language_id', array(
40
- 'header' => Mage::helper('sitemapxml')->__('Language Map ID') ,
41
- 'align' => 'right' ,
42
- 'width' => '50px' ,
43
- 'index' => 'language_id'
44
- ));
45
-
46
- $this->addColumn('store_view_id', array(
47
- 'header' => Mage::helper('sitemapxml')->__('Store View Id') ,
48
- 'align' => 'right' ,
49
- 'width' => '50px' ,
50
- 'index' => 'store_view_id' ,
51
- 'type' => 'options' ,
52
- 'options' => Mage::getModel('sitemapxml/source_store')->getStoreIds()
53
- ));
54
-
55
- $this->addColumn('language_code', array(
56
- 'header' => Mage::helper('sitemapxml')->__('Language Code') ,
57
- 'align' => 'right' ,
58
- 'width' => '50px' ,
59
- 'index' => 'language_code'
60
- ));
61
-
62
- return parent::_prepareColumns();
63
- }
64
-
65
- public function getRowUrl($row)
66
- {
67
- return $this->getUrl('*/*/edit', array(
68
- 'store' => $this->getRequest()->getParam('store') ,
69
- 'id' => $row->getId()
70
- ));
71
- }
72
-
73
  }
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ */
12
+
13
+ class Harapartners_SitemapXml_Block_Adminhtml_Language_Index_Grid extends Mage_Adminhtml_Block_Widget_Grid
14
+ {
15
+
16
+ public function __construct()
17
+ {
18
+ parent::__construct();
19
+ $this->setId('netsuiteLanguageGrid');
20
+ }
21
+
22
+ protected function _prepareCollection()
23
+ {
24
+ $model = Mage::getModel('sitemapxml/language');
25
+ $collection = $model->getCollection();
26
+ $this->setCollection($collection);
27
+ parent::_prepareCollection();
28
+ return $this;
29
+ }
30
+
31
+ protected function _getStore()
32
+ {
33
+ $storeId = (int) $this->getRequest()->getParam('store', 0);
34
+ return Mage::app()->getStore($storeId);
35
+ }
36
+
37
+ protected function _prepareColumns()
38
+ {
39
+ $this->addColumn('language_id', array(
40
+ 'header' => Mage::helper('sitemapxml')->__('Language Map ID') ,
41
+ 'align' => 'right' ,
42
+ 'width' => '50px' ,
43
+ 'index' => 'language_id'
44
+ ));
45
+
46
+ $this->addColumn('store_view_id', array(
47
+ 'header' => Mage::helper('sitemapxml')->__('Store View Id') ,
48
+ 'align' => 'right' ,
49
+ 'width' => '50px' ,
50
+ 'index' => 'store_view_id' ,
51
+ 'type' => 'options' ,
52
+ 'options' => Mage::getModel('sitemapxml/source_store')->getStoreIds()
53
+ ));
54
+
55
+ $this->addColumn('language_code', array(
56
+ 'header' => Mage::helper('sitemapxml')->__('Language Code') ,
57
+ 'align' => 'right' ,
58
+ 'width' => '50px' ,
59
+ 'index' => 'language_code'
60
+ ));
61
+
62
+ return parent::_prepareColumns();
63
+ }
64
+
65
+ public function getRowUrl($row)
66
+ {
67
+ return $this->getUrl('*/*/edit', array(
68
+ 'store' => $this->getRequest()->getParam('store') ,
69
+ 'id' => $row->getId()
70
+ ));
71
+ }
72
+
73
  }
app/code/{local → community}/Harapartners/SitemapXml/Helper/Data.php RENAMED
@@ -1,21 +1,21 @@
1
- <?php
2
- /*
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- *
12
- */
13
- class Harapartners_SitemapXml_Helper_Data extends Mage_Core_Helper_Abstract
14
- {
15
- const XML_PATH_SITEMAP_IS_ENABLED = 'sitemap/language/is_enabled';
16
-
17
- public function isLanguageEnabled()
18
- {
19
- return (boolean) Mage::getStoreConfig(self::XML_PATH_SITEMAP_IS_ENABLED);
20
- }
21
  }
1
+ <?php
2
+ /*
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ *
12
+ */
13
+ class Harapartners_SitemapXml_Helper_Data extends Mage_Core_Helper_Abstract
14
+ {
15
+ const XML_PATH_SITEMAP_IS_ENABLED = 'sitemap/language/is_enabled';
16
+
17
+ public function isLanguageEnabled()
18
+ {
19
+ return (boolean) Mage::getStoreConfig(self::XML_PATH_SITEMAP_IS_ENABLED);
20
+ }
21
  }
app/code/{local → community}/Harapartners/SitemapXml/Helper/Rewrite/Adminhtml/Catalog.php RENAMED
@@ -1,4 +1,4 @@
1
- <?php
2
  /**
3
  * Magento
4
  *
@@ -22,30 +22,30 @@
22
  * @package Mage_Adminhtml
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
  * Adminhtml Catalog helper
29
  *
30
  * @category Mage
31
  * @package Mage_Adminhtml
32
  * @author Magento Core Team <core@magentocommerce.com>
33
- */
34
- class Harapartners_SitemapXml_Helper_Rewrite_Adminhtml_Catalog extends Mage_Adminhtml_Helper_Catalog
35
- {
36
-
37
  /**
38
  * Get list valid paths for generate a sitemap XML file
39
  *
40
  * @return array
41
- */
42
- public function getSitemapValidPaths()
43
- {
44
- $path = parent::getSitemapValidPaths();
45
- if (Mage::helper('sitemapxml')->isLanguageEnabled()) {
46
- $path['available']['langauge'] = '/*/language.xml';
47
- }
48
-
49
- return $path;
50
- }
51
  }
1
+ <?php
2
  /**
3
  * Magento
4
  *
22
  * @package Mage_Adminhtml
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
  * Adminhtml Catalog helper
29
  *
30
  * @category Mage
31
  * @package Mage_Adminhtml
32
  * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Harapartners_SitemapXml_Helper_Rewrite_Adminhtml_Catalog extends Mage_Adminhtml_Helper_Catalog
35
+ {
36
+
37
  /**
38
  * Get list valid paths for generate a sitemap XML file
39
  *
40
  * @return array
41
+ */
42
+ public function getSitemapValidPaths()
43
+ {
44
+ $path = parent::getSitemapValidPaths();
45
+ if (Mage::helper('sitemapxml')->isLanguageEnabled()) {
46
+ $path['available']['langauge'] = '/*/language.xml';
47
+ }
48
+
49
+ return $path;
50
+ }
51
  }
app/code/community/Harapartners/SitemapXml/Helper/Store/Catalog.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ *
12
+ */
13
+ class Harapartners_SitemapXml_Helper_Store_Catalog extends Mage_Core_Helper_Abstract
14
+ {
15
+ protected $_catToStoreCache = array();
16
+ protected $_productToStoreCache = array();
17
+
18
+ public function getCategoriesToStore()
19
+ {
20
+ if (empty($this->_catToStoreCache)) {
21
+ $baseCatToStoreIds = array();
22
+ $storeGroups = Mage::getModel('core/store_group')->getCollection();
23
+ foreach ($storeGroups as $storeGroup) {
24
+ $storeIds = $storeGroup->getStoreIds();
25
+ $baseCat = $storeGroup->getRootCategoryId();
26
+
27
+ foreach ($storeIds as $storeId) {
28
+ $baseCatToStoreIds[$baseCat][$storeId] = true;
29
+ }
30
+ }
31
+
32
+ $categoryToStoreIds = array();
33
+ $collection = Mage::getModel('catalog/category')->getCollection();
34
+ foreach ($collection as $category) {
35
+ $path = $category->getPath();
36
+ $pathExploded = explode('/', $path);
37
+ $baseCat = $pathExploded[1];
38
+
39
+ $categoryToStoreIds[$category->getId()] = $baseCatToStoreIds[$baseCat];
40
+ }
41
+
42
+ $this->_catToStoreCache = $categoryToStoreIds;
43
+ }
44
+ return $this->_catToStoreCache;
45
+ }
46
+
47
+ public function getProductsToStore()
48
+ {
49
+ if (empty($this->_productToStoreCache)) {
50
+ $websiteToProductId = array();
51
+ $resourceHelper = Mage::getModel('catalog/product_website')->getResource();
52
+ $productWebsites = $resourceHelper->getWebsites(Mage::getModel('catalog/product')->getCollection()->getAllIds());
53
+ foreach ($productWebsites as $productId => $websiteIds) {
54
+ foreach ($websiteIds as $websiteId) {
55
+ $websiteToProductIds[$websiteId][] = $productId;
56
+ }
57
+ }
58
+
59
+ $websiteToStoreIds = array();
60
+ $collection = Mage::getModel('core/store')->getCollection();
61
+ foreach ($collection as $store) {
62
+ $storeId = $store->getId();
63
+ $websiteId = $store->getWebsiteId();
64
+
65
+ $websiteToStoreIds[$websiteId][] = $storeId;
66
+ }
67
+
68
+ $productToStoreIds = array();
69
+ foreach ($websiteToProductIds as $websiteId => $productIds) {
70
+ foreach ($productIds as $productId) {
71
+ foreach ($websiteToStoreIds[$websiteId] as $storeId)
72
+ $productToStoreIds[$productId][$storeId] = true;
73
+ }
74
+ }
75
+
76
+ $this->_productToStoreCache = $productToStoreIds;
77
+ }
78
+ return $this->_productToStoreCache;
79
+ }
80
+ }
app/code/{local → community}/Harapartners/SitemapXml/Model/Language.php RENAMED
@@ -1,20 +1,20 @@
1
- <?php
2
- /*
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- *
12
- */
13
- class Harapartners_SitemapXml_Model_Language extends Mage_Core_Model_Abstract
14
- {
15
-
16
- protected function _construct()
17
- {
18
- $this->_init('sitemapxml/language');
19
- }
20
- }
1
+ <?php
2
+ /*
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ *
12
+ */
13
+ class Harapartners_SitemapXml_Model_Language extends Mage_Core_Model_Abstract
14
+ {
15
+
16
+ protected function _construct()
17
+ {
18
+ $this->_init('sitemapxml/language');
19
+ }
20
+ }
app/code/{local → community}/Harapartners/SitemapXml/Model/Resource/Catalog/Product.php RENAMED
File without changes
app/code/{local → community}/Harapartners/SitemapXml/Model/Resource/Language.php RENAMED
@@ -1,19 +1,19 @@
1
- <?php
2
- /**
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- *
12
- */
13
-
14
- class Harapartners_SitemapXml_Model_Resource_Language extends Mage_Core_Model_Resource_Db_Abstract {
15
-
16
- protected function _construct() {
17
- $this->_init('sitemapxml/sitemap_language', 'language_id');
18
- }
19
  }
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ *
12
+ */
13
+
14
+ class Harapartners_SitemapXml_Model_Resource_Language extends Mage_Core_Model_Resource_Db_Abstract {
15
+
16
+ protected function _construct() {
17
+ $this->_init('sitemapxml/sitemap_language', 'language_id');
18
+ }
19
  }
app/code/{local → community}/Harapartners/SitemapXml/Model/Resource/Language/Collection.php RENAMED
@@ -1,21 +1,21 @@
1
- <?php
2
- /**
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- *
12
- */
13
-
14
- class Harapartners_SitemapXml_Model_Resource_Language_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
15
- {
16
-
17
- public function _construct()
18
- {
19
- $this->_init('sitemapxml/language');
20
- }
21
  }
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ *
12
+ */
13
+
14
+ class Harapartners_SitemapXml_Model_Resource_Language_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
15
+ {
16
+
17
+ public function _construct()
18
+ {
19
+ $this->_init('sitemapxml/language');
20
+ }
21
  }
app/code/{local → community}/Harapartners/SitemapXml/Model/Rewrite/Sitemap/Sitemap.php RENAMED
@@ -1,4 +1,4 @@
1
- <?php
2
  /**
3
  * Magento
4
  *
@@ -22,8 +22,8 @@
22
  * @package Mage_Sitemap
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
  * Sitemap model
29
  *
@@ -43,183 +43,184 @@
43
  * @category Mage
44
  * @package Mage_Sitemap
45
  * @author Magento Core Team <core@magentocommerce.com>
46
- */
47
- class Harapartners_Sitemapxml_Model_Rewrite_Sitemap_Sitemap extends Mage_Sitemap_Model_Sitemap
48
- {
49
- const LANGUAGE_FILENAME = 'language.xml';
50
-
51
- protected $_xmlGenLang;
52
-
53
  /**
54
  * Generate XML file
55
  *
56
  * @return Mage_Sitemap_Model_Sitemap
57
- */
58
- public function generateXml()
59
- {
60
- if (! $this->_isLanguageEnabled()) {
61
- return parent::generateXml();
62
- }
63
-
64
- $io = new Varien_Io_File();
65
- $io->setAllowCreateFolders(true);
66
- $io->open(array(
67
- 'path' => $this->getPath()
68
- ));
69
-
70
- if ($io->fileExists($this->getSitemapFilename()) && ! $io->isWriteable($this->getSitemapFilename())) {
71
- Mage::throwException(Mage::helper('sitemap')->__('File "%s" cannot be saved. Please, make sure the directory "%s" is writeable by web server.', $this->getSitemapFilename(), $this->getPath()));
72
- }
73
-
74
- $io->streamOpen($this->getSitemapFilename());
75
-
76
- $io->streamWrite('<?xml version="1.0" encoding="UTF-8"?>' . "\n");
77
- $io->streamWrite('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">');
78
-
79
- $storeId = $this->getStoreId();
80
- $date = Mage::getSingleton('core/date')->gmtDate('Y-m-d');
81
- $baseUrl = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
82
-
83
  /**
84
  * Generate categories sitemap
85
- */
86
- $changefreq = (string) Mage::getStoreConfig('sitemap/category/changefreq', $storeId);
87
- $priority = (string) Mage::getStoreConfig('sitemap/category/priority', $storeId);
88
- $collection = Mage::getResourceModel('sitemap/catalog_category')->getCollection($storeId);
89
- foreach ($collection as $item) {
90
- $xml = sprintf('<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>', htmlspecialchars($baseUrl . $item->getUrl()), $date, $changefreq, $priority);
91
- $newXml = $this->_insertLanguageXml($baseUrl, $item, 'category', $xml);
92
- $io->streamWrite($newXml);
93
- }
94
- unset($collection);
95
-
96
-
 
97
  /**
98
  * Generate products sitemap
99
- */
100
- $changefreq = (string) Mage::getStoreConfig('sitemap/product/changefreq', $storeId);
101
- $priority = (string) Mage::getStoreConfig('sitemap/product/priority', $storeId);
102
- $collection = Mage::getResourceModel('sitemap/catalog_product')->getCollection($storeId);
103
- $collection = $this->_joinByOtherStoreIds($collection, $this->_getOtherStoreIds($storeId));
104
- foreach ($collection as $item) {
105
- $xml = sprintf('<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>', htmlspecialchars($baseUrl . $item->getUrl()), $date, $changefreq, $priority);
106
- $newXml = $this->_insertLanguageXml($baseUrl, $item, 'product', $xml);
107
- $io->streamWrite($newXml);
108
- }
109
- unset($collection);
110
-
111
  /**
112
  * Generate cms pages sitemap
113
- */
114
- $changefreq = (string) Mage::getStoreConfig('sitemap/page/changefreq', $storeId);
115
- $priority = (string) Mage::getStoreConfig('sitemap/page/priority', $storeId);
116
- $collection = Mage::getResourceModel('sitemap/cms_page')->getCollection($storeId);
117
- foreach ($collection as $item) {
118
- $xml = sprintf('<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>', htmlspecialchars($baseUrl . $item->getUrl()), $date, $changefreq, $priority);
119
- $io->streamWrite($xml);
120
- }
121
- unset($collection);
122
-
123
- $io->streamWrite('</urlset>');
124
- $io->streamClose();
125
-
126
- $this->setSitemapTime(Mage::getSingleton('core/date')->gmtDate('Y-m-d H:i:s'));
127
- $this->save();
128
-
129
- return $this;
130
- }
131
-
132
- protected function _insertLanguageXml($baseUrl, $item, $itemType, $xml)
133
- {
134
- if (! $item->getId() || ! $item->getUrl()) {
135
- return $xml;
136
- }
137
-
138
- $insertXml = $this->_getLanguageXml($baseUrl, $item, $itemType);
139
-
140
- $count = 0;
141
- $returnXml = str_replace('</url>', ' ' . $insertXml . ' </url>', $xml, $count);
142
- $oldKeep = substr($xml, 0, strlen($xml) - 6);
143
- $returnXml = $oldKeep . ' ' . $insertXml . ' </url>';
144
- $count = 1;
145
- if ($count != 1) {
146
  //error
147
- return $xml;
148
- } else {
149
- return $returnXml;
150
- }
151
-
152
- }
153
-
154
- protected function _getLanguageXml($baseUrl, $item, $itemType)
155
- {
156
- return $this->_getXmlLangGen()->getUrlBlock($baseUrl, $item, $itemType, false);
157
- }
158
-
159
  /**
160
  * Enter description here...
161
  *
162
  * @return Harapartners_SitemapXml_Model_Source_Xml
163
- */
164
- protected function _getXmlLangGen()
165
- {
166
- if (! isset($this->_xmlGenLang)) {
167
- $this->_xmlGenLang = Mage::getModel('sitemapxml/source_xml');
168
- }
169
-
170
- return $this->_xmlGenLang;
171
- }
172
-
173
- protected function _isLanguageEnabled()
174
- {
175
- $siteMapFilename = $this->getSitemapFilename();
176
- if ($siteMapFilename !== self::LANGUAGE_FILENAME) {
177
- //return false;
178
- }
179
-
180
- return Mage::helper('sitemapxml')->isLanguageEnabled();
181
- }
182
-
183
- protected function _getOtherStoreIds($oldStoreId)
184
- {
185
- $allStores = Mage::app()->getStores();
186
- foreach(Mage::getModel('sitemapxml/language')->getCollection() as $site){
187
- $sites[$site->getStoreViewId()] = true;
188
- }
189
-
190
- $collection = Mage::getModel('sitemapxml/language')->getCollection();
191
- foreach ($allStores as $storeId => $val) {
192
- if ($storeId != $oldStoreId && isset($sites[$storeId])) {
193
- $otherStores[] = $storeId;
194
- }
195
- }
196
-
197
- return $otherStores;
198
- }
199
-
200
- protected function _joinByOtherStoreIds($currentCollection, $newStoreIds)
201
- {
202
- if (empty($newStoreIds)) {
203
- return $currentCollection;
204
- }
205
-
206
- foreach ($currentCollection as $product) {
207
- $id = $product->getId();
208
- $ids[$id] = true;
209
- }
210
-
211
-
212
- foreach ($newStoreIds as $storeId) {
213
- $tempCollection = Mage::getResourceModel('sitemap/catalog_product')->getCollection($storeId);
214
-
215
- foreach ($tempCollection as $product) {
216
- $id = $product->getId();
217
- if (! isset($ids[$id])) {
218
- $ids[$id] = true;
219
- $currentCollection[] = $product;
220
- }
221
- }
222
- }
223
- return $currentCollection;
224
- }
225
  }
1
+ <?php
2
  /**
3
  * Magento
4
  *
22
  * @package Mage_Sitemap
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
  * Sitemap model
29
  *
43
  * @category Mage
44
  * @package Mage_Sitemap
45
  * @author Magento Core Team <core@magentocommerce.com>
46
+ */
47
+ class Harapartners_Sitemapxml_Model_Rewrite_Sitemap_Sitemap extends Mage_Sitemap_Model_Sitemap
48
+ {
49
+ const LANGUAGE_FILENAME = 'language.xml';
50
+
51
+ protected $_xmlGenLang;
52
+
53
  /**
54
  * Generate XML file
55
  *
56
  * @return Mage_Sitemap_Model_Sitemap
57
+ */
58
+ public function generateXml()
59
+ {
60
+ if (! $this->_isLanguageEnabled()) {
61
+ return parent::generateXml();
62
+ }
63
+
64
+ $io = new Varien_Io_File();
65
+ $io->setAllowCreateFolders(true);
66
+ $io->open(array(
67
+ 'path' => $this->getPath()
68
+ ));
69
+
70
+ if ($io->fileExists($this->getSitemapFilename()) && ! $io->isWriteable($this->getSitemapFilename())) {
71
+ Mage::throwException(Mage::helper('sitemap')->__('File "%s" cannot be saved. Please, make sure the directory "%s" is writeable by web server.', $this->getSitemapFilename(), $this->getPath()));
72
+ }
73
+
74
+ $io->streamOpen($this->getSitemapFilename());
75
+
76
+ $io->streamWrite('<?xml version="1.0" encoding="UTF-8"?>' . "\n");
77
+ $io->streamWrite('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">');
78
+
79
+ $storeId = $this->getStoreId();
80
+ $date = Mage::getSingleton('core/date')->gmtDate('Y-m-d');
81
+ $baseUrl = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
82
+
83
  /**
84
  * Generate categories sitemap
85
+ */
86
+ $changefreq = (string) Mage::getStoreConfig('sitemap/category/changefreq', $storeId);
87
+ $priority = (string) Mage::getStoreConfig('sitemap/category/priority', $storeId);
88
+ $collection = Mage::getResourceModel('sitemap/catalog_category')->getCollection($storeId);
89
+ $collection = $this->_joinByOtherStoreIds($collection, $this->_getOtherStoreIds($storeId),'category');
90
+ foreach ($collection as $item) {
91
+ $xml = sprintf('<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>', htmlspecialchars($baseUrl . $item->getUrl()), $date, $changefreq, $priority);
92
+ $newXml = $this->_insertLanguageXml($baseUrl, $item, 'category', $xml);
93
+ $io->streamWrite($newXml);
94
+ }
95
+ unset($collection);
96
+
97
+
98
  /**
99
  * Generate products sitemap
100
+ */
101
+ $changefreq = (string) Mage::getStoreConfig('sitemap/product/changefreq', $storeId);
102
+ $priority = (string) Mage::getStoreConfig('sitemap/product/priority', $storeId);
103
+ $collection = Mage::getResourceModel('sitemap/catalog_product')->getCollection($storeId);
104
+ $collection = $this->_joinByOtherStoreIds($collection, $this->_getOtherStoreIds($storeId),'product');
105
+ foreach ($collection as $item) {
106
+ $xml = sprintf('<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>', htmlspecialchars($baseUrl . $item->getUrl()), $date, $changefreq, $priority);
107
+ $newXml = $this->_insertLanguageXml($baseUrl, $item, 'product', $xml);
108
+ $io->streamWrite($newXml);
109
+ }
110
+ unset($collection);
111
+
112
  /**
113
  * Generate cms pages sitemap
114
+ */
115
+ $changefreq = (string) Mage::getStoreConfig('sitemap/page/changefreq', $storeId);
116
+ $priority = (string) Mage::getStoreConfig('sitemap/page/priority', $storeId);
117
+ $collection = Mage::getResourceModel('sitemap/cms_page')->getCollection($storeId);
118
+ foreach ($collection as $item) {
119
+ $xml = sprintf('<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>', htmlspecialchars($baseUrl . $item->getUrl()), $date, $changefreq, $priority);
120
+ $io->streamWrite($xml);
121
+ }
122
+ unset($collection);
123
+
124
+ $io->streamWrite('</urlset>');
125
+ $io->streamClose();
126
+
127
+ $this->setSitemapTime(Mage::getSingleton('core/date')->gmtDate('Y-m-d H:i:s'));
128
+ $this->save();
129
+
130
+ return $this;
131
+ }
132
+
133
+ protected function _insertLanguageXml($baseUrl, $item, $itemType, $xml)
134
+ {
135
+ if (! $item->getId() || ! $item->getUrl()) {
136
+ return $xml;
137
+ }
138
+
139
+ $insertXml = $this->_getLanguageXml($baseUrl, $item, $itemType);
140
+
141
+ $count = 0;
142
+ $returnXml = str_replace('</url>', ' ' . $insertXml . ' </url>', $xml, $count);
143
+ $oldKeep = substr($xml, 0, strlen($xml) - 6);
144
+ $returnXml = $oldKeep . ' ' . $insertXml . ' </url>';
145
+ $count = 1;
146
+ if ($count != 1) {
147
  //error
148
+ return $xml;
149
+ } else {
150
+ return $returnXml;
151
+ }
152
+
153
+ }
154
+
155
+ protected function _getLanguageXml($baseUrl, $item, $itemType)
156
+ {
157
+ return $this->_getXmlLangGen()->getUrlBlock($baseUrl, $item, $itemType, false);
158
+ }
159
+
160
  /**
161
  * Enter description here...
162
  *
163
  * @return Harapartners_SitemapXml_Model_Source_Xml
164
+ */
165
+ protected function _getXmlLangGen()
166
+ {
167
+ if (! isset($this->_xmlGenLang)) {
168
+ $this->_xmlGenLang = Mage::getModel('sitemapxml/source_xml');
169
+ }
170
+
171
+ return $this->_xmlGenLang;
172
+ }
173
+
174
+ protected function _isLanguageEnabled()
175
+ {
176
+ $siteMapFilename = $this->getSitemapFilename();
177
+ if ($siteMapFilename !== self::LANGUAGE_FILENAME) {
178
+ //return false;
179
+ }
180
+
181
+ return Mage::helper('sitemapxml')->isLanguageEnabled();
182
+ }
183
+
184
+ protected function _getOtherStoreIds($oldStoreId)
185
+ {
186
+ $allStores = Mage::app()->getStores();
187
+ foreach(Mage::getModel('sitemapxml/language')->getCollection() as $site){
188
+ $sites[$site->getStoreViewId()] = true;
189
+ }
190
+
191
+ $collection = Mage::getModel('sitemapxml/language')->getCollection();
192
+ foreach ($allStores as $storeId => $val) {
193
+ if ($storeId != $oldStoreId && isset($sites[$storeId])) {
194
+ $otherStores[] = $storeId;
195
+ }
196
+ }
197
+
198
+ return $otherStores;
199
+ }
200
+
201
+ protected function _joinByOtherStoreIds($currentCollection, $newStoreIds, $type)
202
+ {
203
+ if (empty($newStoreIds)) {
204
+ return $currentCollection;
205
+ }
206
+
207
+ foreach ($currentCollection as $item) {
208
+ $id = $item->getId();
209
+ $ids[$id] = true;
210
+ }
211
+
212
+
213
+ foreach ($newStoreIds as $storeId) {
214
+ $tempCollection = Mage::getResourceModel('sitemap/catalog_'.$type)->getCollection($storeId);
215
+
216
+ foreach ($tempCollection as $product) {
217
+ $id = $product->getId();
218
+ if (! isset($ids[$id])) {
219
+ $ids[$id] = true;
220
+ $currentCollection[] = $product;
221
+ }
222
+ }
223
+ }
224
+ return $currentCollection;
225
+ }
226
  }
app/code/{local → community}/Harapartners/SitemapXml/Model/Source/Store.php RENAMED
@@ -1,68 +1,68 @@
1
- <?php
2
- /*
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- *
12
- */
13
- class Harapartners_SitemapXml_Model_Source_Store
14
- {
15
-
16
- public function getStoreIds()
17
- {
18
- $stores = Mage::app()->getStores();
19
-
20
- $storename = array();
21
- foreach ($stores as $store) {
22
- $id = $store->getId();
23
- $name = $store->getName();
24
- $storename[$id] = $name;
25
- }
26
-
27
- return $storename;
28
- }
29
-
30
- protected function _toOptionArray($skipUsed = false)
31
- {
32
- $optionArray = array();
33
- if ($skipUsed) {
34
- $usedIds = $this->_getUsedIds();
35
- } else {
36
- $usedIds = array();
37
- }
38
-
39
- foreach ($this->getStoreIds() as $id => $name) {
40
- if (isset($usedIds[$id]) && $skipUsed) {
41
- continue;
42
- }
43
-
44
- $optionArray[] = array(
45
- 'value' => $id ,
46
- 'label' => $name
47
- );
48
- }
49
- return $optionArray;
50
- }
51
-
52
- public function toOptionArray()
53
- {
54
- return $this->_toOptionArray(true);
55
- }
56
-
57
- protected function _getUsedIds(){
58
- $collection = Mage::getModel('sitemapxml/language')->getCollection();
59
-
60
- $usedId = array();
61
- foreach($collection as $language){
62
- $id = $language->getStoreViewId();
63
- $usedId[$id] =true;
64
- }
65
-
66
- return $usedId;
67
- }
68
- }
1
+ <?php
2
+ /*
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ *
12
+ */
13
+ class Harapartners_SitemapXml_Model_Source_Store
14
+ {
15
+
16
+ public function getStoreIds()
17
+ {
18
+ $stores = Mage::app()->getStores();
19
+
20
+ $storename = array();
21
+ foreach ($stores as $store) {
22
+ $id = $store->getId();
23
+ $name = $store->getName();
24
+ $storename[$id] = $name;
25
+ }
26
+
27
+ return $storename;
28
+ }
29
+
30
+ protected function _toOptionArray($skipUsed = false)
31
+ {
32
+ $optionArray = array();
33
+ if ($skipUsed) {
34
+ $usedIds = $this->_getUsedIds();
35
+ } else {
36
+ $usedIds = array();
37
+ }
38
+
39
+ foreach ($this->getStoreIds() as $id => $name) {
40
+ if (isset($usedIds[$id]) && $skipUsed) {
41
+ continue;
42
+ }
43
+
44
+ $optionArray[] = array(
45
+ 'value' => $id ,
46
+ 'label' => $name
47
+ );
48
+ }
49
+ return $optionArray;
50
+ }
51
+
52
+ public function toOptionArray()
53
+ {
54
+ return $this->_toOptionArray(true);
55
+ }
56
+
57
+ protected function _getUsedIds(){
58
+ $collection = Mage::getModel('sitemapxml/language')->getCollection();
59
+
60
+ $usedId = array();
61
+ foreach($collection as $language){
62
+ $id = $language->getStoreViewId();
63
+ $usedId[$id] =true;
64
+ }
65
+
66
+ return $usedId;
67
+ }
68
+ }
app/code/{local → community}/Harapartners/SitemapXml/Model/Source/Xml.php RENAMED
@@ -1,152 +1,240 @@
1
- <?php
2
- /*
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- *
12
- */
13
- class Harapartners_SitemapXml_Model_Source_Xml
14
- {
15
- const XML_PATH_VALIDATE_URL = 'sitemap/language/validate_url';
16
-
17
- protected $_links;
18
- protected $_validator;
19
-
20
- public function getLinks()
21
- {
22
- if (empty($this->_links)) {
23
- $collection = Mage::getModel('sitemapxml/language')->getCollection();
24
-
25
- $links[] = $this->_getXDefualtLink();
26
- foreach ($collection as $language) {
27
- $storeId = $language->getStoreViewId();
28
- $langCode = $language->getLanguageCode();
29
- $href = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK, false);
30
- $links[] = array(
31
- 'lang_code' => $langCode ,
32
- 'href' => $href ,
33
- 'store_id' => $storeId
34
- );
35
- }
36
-
37
- $this->_links = $links;
38
- }
39
-
40
- return $this->_links;
41
- }
42
-
43
- protected function _getXDefualtLink()
44
- {
45
- $xUrl = Mage::getStoreConfig('sitemap/language/x_default_url');
46
- if (empty($xUrl)) {
47
- $xUrl = Mage::getBaseUrl();
48
- }
49
-
50
- return array(
51
- 'lang_code' => 'x-default' ,
52
- 'href' => $xUrl
53
- );
54
- }
55
-
56
- protected function _getValidator()
57
- {
58
- if (! isset($validator)) {
59
- $this->_validator = Mage::getModel('sitemapxml/controller_validator');
60
- }
61
-
62
- return $this->_validator;
63
- }
64
-
65
- public function getUrlBlock($baseUrl, $item, $itemType, $prettyPrint = false)
66
- {
67
- $conditionalLineEnding = '';
68
- $conditionalTab = '';
69
- if ($prettyPrint) {
70
- $conditionalLineEnding = PHP_EOL;
71
- $conditionalTab = "\t";
72
- }
73
-
74
- $links = $this->getLinks();
75
-
76
- $string = '';
77
- //$string = '<url>' . $conditionalLineEnding;
78
- //$string = "$conditionalTab <loc>{$baseUrl}</loc>" . $conditionalLineEnding;
79
- $suffixPaths = $this->_getSuffixPathsById($itemType, $item->getId());
80
- foreach ($links as $link) {
81
- $suffixpath = isset($suffixPaths[$link['store_id']]) ? $suffixPaths[$link['store_id']] : $item->getUrl();
82
- $readyLink = $link['href'] . $suffixpath;
83
- if (! $this->_isLinkValid($readyLink)) {
84
- continue;
85
- }
86
-
87
- $string .= $conditionalTab . "<xhtml:link rel=\"alternate\" hreflang=\"{$link['lang_code']}\" href=\"{$readyLink}\" />" . $conditionalLineEnding;
88
- }
89
-
90
- return $string;
91
- }
92
-
93
- protected function _getSuffixPathsById($type, $id)
94
- {
95
- $collection = Mage::getModel('core/url_rewrite')->getCollection();
96
- switch ($type) {
97
- case 'product':
98
- $collection->filterAllByProductId($id);
99
- break;
100
- case 'category':
101
- $this->_addCollectionFilterToCollection($collection, $id);
102
- break;
103
- default:
104
- return array();
105
- }
106
-
107
- $paths = array();
108
- foreach ($collection as $urlRewrite) {
109
- // TODO only Newest ??
110
- $storeId = $urlRewrite->getStoreId();
111
- $path = $urlRewrite->getRequestPath();
112
- $paths[$storeId] = $path;
113
- }
114
-
115
- return $paths;
116
- }
117
-
118
- protected function _addCollectionFilterToCollection($collection, $id)
119
- {
120
- $collection->getSelect()->where('id_path LIKE ?', "category/{$id}");
121
- return $this;
122
- }
123
-
124
- protected function _isLinkValid($link)
125
- {
126
- if (! Mage::getStoreConfig(self::XML_PATH_VALIDATE_URL)) {
127
- // Are we validating URLs?
128
- return true;
129
- }
130
-
131
- $url = $link;
132
- $ch = curl_init($url);
133
- curl_setopt($ch, CURLOPT_NOBODY, true);
134
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
135
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
136
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
137
-
138
- curl_exec($ch);
139
- $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
140
- curl_close($ch);
141
-
142
- if (200 == $retcode) {
143
- // All's well
144
- return true;
145
- } else {
146
- // not so much
147
- return false;
148
- }
149
-
150
- return true;
151
- }
152
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ *
12
+ */
13
+ class Harapartners_SitemapXml_Model_Source_Xml
14
+ {
15
+ const XML_PATH_VALIDATE_URL = 'sitemap/language/validate_url';
16
+
17
+ protected $_links;
18
+ protected $_validator;
19
+
20
+ public function getLinks()
21
+ {
22
+ if (empty($this->_links)) {
23
+ $collection = Mage::getModel('sitemapxml/language')->getCollection();
24
+
25
+ $links[] = $this->_getXDefualtLink();
26
+ foreach ($collection as $language) {
27
+ $storeId = $language->getStoreViewId();
28
+ $langCode = $language->getLanguageCode();
29
+ $href = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK, false);
30
+ $links[] = array(
31
+ 'lang_code' => $langCode ,
32
+ 'href' => $href ,
33
+ 'store_id' => $storeId
34
+ );
35
+ }
36
+
37
+ $this->_links = $links;
38
+ }
39
+
40
+ return $this->_links;
41
+ }
42
+
43
+ protected function _getXDefualtLink()
44
+ {
45
+ $xUrl = Mage::getStoreConfig('sitemap/language/x_default_url');
46
+ if (empty($xUrl)) {
47
+ $xUrl = Mage::getBaseUrl();
48
+ }
49
+
50
+ return array(
51
+ 'lang_code' => 'x-default' ,
52
+ 'href' => $xUrl
53
+ );
54
+ }
55
+
56
+ protected function _getValidator()
57
+ {
58
+ if (! isset($validator)) {
59
+ $this->_validator = Mage::getModel('sitemapxml/controller_validator');
60
+ }
61
+
62
+ return $this->_validator;
63
+ }
64
+
65
+ public function getUrlBlock($baseUrl, $item, $itemType, $prettyPrint = false)
66
+ {
67
+ $conditionalLineEnding = '';
68
+ $conditionalTab = '';
69
+ if ($prettyPrint) {
70
+ $conditionalLineEnding = PHP_EOL;
71
+ $conditionalTab = "\t";
72
+ }
73
+
74
+ $links = $this->getLinks();
75
+
76
+ $string = '';
77
+ //$string = '<url>' . $conditionalLineEnding;
78
+ //$string = "$conditionalTab <loc>{$baseUrl}</loc>" . $conditionalLineEnding;
79
+ $suffixPaths = $this->_getSuffixPathsById($itemType, $item->getId());
80
+ foreach ($links as $link) {
81
+ if ($link['lang_code'] != 'x-default') {
82
+ if (! $this->_isPathEnabled($item->getId(), $link['store_id'], $itemType)) {
83
+ continue;
84
+ }
85
+ }
86
+
87
+ $suffixpath = ! empty($suffixPaths[$link['store_id']]) ? $suffixPaths[$link['store_id']] : $item->getUrl();
88
+ $readyLink = $link['href'] . $suffixpath;
89
+ if (! $this->_isLinkValid($readyLink)) {
90
+ continue;
91
+ }
92
+
93
+ $string .= $conditionalTab . "<xhtml:link rel=\"alternate\" hreflang=\"{$link['lang_code']}\" href=\"{$readyLink}\" />" . $conditionalLineEnding;
94
+ }
95
+
96
+ return $string;
97
+ }
98
+
99
+ protected function _getSuffixPathsById($type, $id)
100
+ {
101
+ $collection = Mage::getModel('core/url_rewrite')->getCollection();
102
+ switch ($type) {
103
+ case 'product':
104
+ $collection->filterAllByProductId($id);
105
+ break;
106
+ case 'category':
107
+ $this->_addCollectionFilterToCollection($collection, $id);
108
+ break;
109
+ default:
110
+ return array();
111
+ }
112
+
113
+ $paths = array();
114
+ foreach ($collection as $urlRewrite) {
115
+ // TODO only Newest ??
116
+ $storeId = $urlRewrite->getStoreId();
117
+ $path = $urlRewrite->getRequestPath();
118
+ $paths[$storeId] = $path;
119
+ }
120
+
121
+ return $paths;
122
+ }
123
+
124
+ protected function _isPathEnabled($id, $storeId, $type)
125
+ {
126
+ //return true;
127
+ if ($type == 'category') {
128
+ $attributeType = 'catalog/category';
129
+ $attributeCode = 'is_active';
130
+ $attributeValues = array(
131
+ 1 // enabled
132
+ );
133
+
134
+ if (! $this->_isCategoryInStoreView($id, $storeId)) {
135
+ // Special Check for Category
136
+ return false;
137
+ }
138
+ } elseif ($type == 'product') {
139
+ $attributeType = 'catalog/product';
140
+ $attributeCode = 'status';
141
+ $attributeValues = array(
142
+ 1 // enabled
143
+ );
144
+
145
+ if (! $this->_isProductInStoreView($id, $storeId)) {
146
+ // Special Check for Category
147
+ return false;
148
+ }
149
+ }
150
+
151
+ /* $collection Mage_Eav_Model_Entity_Collection */
152
+ $collection = Mage::getModel($attributeType)->getCollection();
153
+ $collection->addFieldToFilter('entity_id', $id);
154
+ $collection->setStore($storeId);
155
+ $collection->addFieldToFilter($attributeCode, array(
156
+ in => ($attributeValues)
157
+ ));
158
+
159
+ $firstValue = $collection->getFirstItem();
160
+ if ($firstValue->getId()) {
161
+ return true;
162
+ }
163
+
164
+ return false;
165
+ }
166
+
167
+ // == Special Validation == //
168
+ protected function _addCollectionFilterToCollection($collection, $id)
169
+ {
170
+ $collection->getSelect()->where('id_path LIKE ?', "category/{$id}");
171
+ return $this;
172
+ }
173
+
174
+ protected function _isCategoryInStoreView($id, $storeId)
175
+ {
176
+ $catsToStore = $this->_getCatsToStore();
177
+ $storeIds = $catsToStore[$id];
178
+ return ! empty($storeIds[$storeId]);
179
+ }
180
+
181
+ protected function _getCatsToStore()
182
+ {
183
+ return Mage::helper('sitemapxml/store_catalog')->getCategoriesToStore();
184
+ }
185
+
186
+ protected function _isProductInStoreView($id, $storeId)
187
+ {
188
+ $productsToStore = $this->_getProductsToStore();
189
+ $storeIds = $productsToStore[$id];
190
+ return ! empty($storeIds[$storeId]);
191
+ }
192
+
193
+ protected function _getProductsToStore()
194
+ {
195
+ return Mage::helper('sitemapxml/store_catalog')->getProductsToStore();
196
+ }
197
+
198
+ // == END Special Validation == //
199
+ // protected function _joinEnabledFilter($collection, $type){
200
+ // switch($type){
201
+ // case 'product':
202
+ // $collection->getSelect()->join(array('p_status'=>'catalog_product_entity_int'),'p_status.entity_id=core_url.product_id AND p_status.store_id = core_url.store_id');
203
+ // $collection->addFieldToFilter('p_status.value',2);
204
+ // break;
205
+ // case 'category':
206
+ // break;
207
+ // default:
208
+ // }
209
+ // }
210
+
211
+
212
+ protected function _isLinkValid($link)
213
+ {
214
+ if (! Mage::getStoreConfig(self::XML_PATH_VALIDATE_URL)) {
215
+ // Are we validating URLs?
216
+ return true;
217
+ }
218
+
219
+ $url = $link;
220
+ $ch = curl_init($url);
221
+ curl_setopt($ch, CURLOPT_NOBODY, true);
222
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
223
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
224
+ curl_setopt($ch, CURLOPT_TIMEOUT, 10);
225
+
226
+ curl_exec($ch);
227
+ $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
228
+ curl_close($ch);
229
+
230
+ if (200 == $retcode) {
231
+ // All's well
232
+ return true;
233
+ } else {
234
+ // not so much
235
+ return false;
236
+ }
237
+
238
+ return true;
239
+ }
240
+ }
app/code/{local → community}/Harapartners/SitemapXml/controllers/Adminhtml/LanguageController.php RENAMED
@@ -1,111 +1,111 @@
1
- <?php
2
- /**
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- */
12
-
13
- class Harapartners_Sitemapxml_Adminhtml_LanguageController extends Mage_Adminhtml_Controller_Action {
14
-
15
- /**
16
- * View form action
17
- */
18
- public function indexAction() {
19
- $this->loadLayout ();
20
- $this->_setActiveMenu ( 'sitemapxml/language' );
21
- //$this->_addBreadcrumb ( Mage::helper ( 'webservice' )->__ ( 'Product1' ), Mage::helper ( 'webservice' )->__ ( 'Form' ) );
22
- $this->_addContent ( $this->getLayout ()->createBlock ( 'sitemapxml/adminhtml_language_index' ) );
23
- $this->renderLayout ();
24
- }
25
-
26
- public function editAction() {
27
- $id = $this->getRequest ()->getParam ( 'id' );
28
- $model = Mage::getModel ( 'sitemapxml/language' )->load ( $id );
29
-
30
- if ($model->getId () || $id == 0) {
31
- $data = Mage::getSingleton ( 'adminhtml/session' )->getData ( 'sitemapxml_language_data' );
32
- if (! empty ( $data )) {
33
- $model->setData ( $data );
34
- }
35
-
36
- Mage::register ( 'sitemapxml_language_data', $model );
37
-
38
- $this->loadLayout ()->_setActiveMenu ( 'sitemapxml/language' );
39
-
40
- //$this->_addBreadcrumb ( Mage::helper ( 'sitemapxml' )->__ ( 'Manage Buy X Rules' ), Mage::helper ( 'adminhtml' )->__ ( 'Manage Buy X Rules' ) );
41
- //$this->_addBreadcrumb ( Mage::helper ( 'sitemapxml' )->__ ( 'Buy X Rule Configuration' ), Mage::helper ( 'adminhtml' )->__ ( 'Buy X Rule Configuration' ) );
42
-
43
- $this->getLayout ()->getBlock ( 'head' )->setCanLoadExtJs ( true );
44
-
45
- $this->_addContent ( $this->getLayout ()->createBlock ( 'sitemapxml/adminhtml_language_edit' ) );
46
-
47
- $this->renderLayout ();
48
- } else {
49
- Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'sitemapxml' )->__ ( 'Language Map does not exist' ) );
50
- $this->_redirect ( '*/*/' );
51
- }
52
- }
53
-
54
- public function newAction(){
55
- return $this->editAction();
56
- }
57
-
58
- public function saveAction() {
59
- if ($data = $this->getRequest ()->getPost ()) {
60
- $model = Mage::getModel ( 'sitemapxml/language' );
61
- $model->setData ( $data )->setId ( $this->getRequest ()->getParam ( 'id' ) );
62
-
63
- try {
64
- $model->save ();
65
- Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( 'sitemapxml' )->__ ( 'Language Map Saved' ) );
66
- Mage::getSingleton ( 'adminhtml/session' )->setData ( false );
67
-
68
- if ($this->getRequest ()->getParam ( 'back' )) {
69
- $this->_redirect ( '*/*/edit', array ('id' => $model->getId () ) );
70
- return;
71
- }
72
- $this->_redirect ( '*/*/' );
73
- return;
74
- } catch ( Exception $e ) {
75
- Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
76
- Mage::getSingleton ( 'adminhtml/session' )->setData ('sitemapxml_language_data', $data );
77
- $this->_redirect ( '*/*/edit', array ('id' => $this->getRequest ()->getParam ( 'id' ) ) );
78
- return;
79
- }
80
- }
81
- Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'sitemapxml' )->__ ( 'Unable to find Language Map to Save' ) );
82
- $this->_redirect ( '*/*/' );
83
- }
84
-
85
- public function deleteAction() {
86
- if ($id = $this->getRequest ()->getParam ( 'id' )) {
87
- $model = Mage::getModel ( 'sitemapxml/language' );
88
- $model->setId ( $id );
89
-
90
- try {
91
- $model->delete ();
92
- Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( 'sitemapxml' )->__ ( 'Language Map Deleted' ) );
93
- Mage::getSingleton ( 'adminhtml/session' )->setData ( false );
94
-
95
- if ($this->getRequest ()->getParam ( 'back' )) {
96
- $this->_redirect ( '*/*/');
97
- return;
98
- }
99
- $this->_redirect ( '*/*/' );
100
- return;
101
- } catch ( Exception $e ) {
102
- Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
103
- Mage::getSingleton ( 'adminhtml/session' )->setData ('sitemapxml_language_data', $data );
104
- $this->_redirect ( '*/*/edit', array ('id' => $this->getRequest ()->getParam ( 'id' ) ) );
105
- return;
106
- }
107
- }
108
- Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'sitemapxml' )->__ ( 'Unable to find Language Map to Delete' ) );
109
- $this->_redirect ( '*/*/' );
110
- }
111
- }
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ */
12
+
13
+ class Harapartners_Sitemapxml_Adminhtml_LanguageController extends Mage_Adminhtml_Controller_Action {
14
+
15
+ /**
16
+ * View form action
17
+ */
18
+ public function indexAction() {
19
+ $this->loadLayout ();
20
+ $this->_setActiveMenu ( 'sitemapxml/language' );
21
+ //$this->_addBreadcrumb ( Mage::helper ( 'webservice' )->__ ( 'Product1' ), Mage::helper ( 'webservice' )->__ ( 'Form' ) );
22
+ $this->_addContent ( $this->getLayout ()->createBlock ( 'sitemapxml/adminhtml_language_index' ) );
23
+ $this->renderLayout ();
24
+ }
25
+
26
+ public function editAction() {
27
+ $id = $this->getRequest ()->getParam ( 'id' );
28
+ $model = Mage::getModel ( 'sitemapxml/language' )->load ( $id );
29
+
30
+ if ($model->getId () || $id == 0) {
31
+ $data = Mage::getSingleton ( 'adminhtml/session' )->getData ( 'sitemapxml_language_data' );
32
+ if (! empty ( $data )) {
33
+ $model->setData ( $data );
34
+ }
35
+
36
+ Mage::register ( 'sitemapxml_language_data', $model );
37
+
38
+ $this->loadLayout ()->_setActiveMenu ( 'sitemapxml/language' );
39
+
40
+ //$this->_addBreadcrumb ( Mage::helper ( 'sitemapxml' )->__ ( 'Manage Buy X Rules' ), Mage::helper ( 'adminhtml' )->__ ( 'Manage Buy X Rules' ) );
41
+ //$this->_addBreadcrumb ( Mage::helper ( 'sitemapxml' )->__ ( 'Buy X Rule Configuration' ), Mage::helper ( 'adminhtml' )->__ ( 'Buy X Rule Configuration' ) );
42
+
43
+ $this->getLayout ()->getBlock ( 'head' )->setCanLoadExtJs ( true );
44
+
45
+ $this->_addContent ( $this->getLayout ()->createBlock ( 'sitemapxml/adminhtml_language_edit' ) );
46
+
47
+ $this->renderLayout ();
48
+ } else {
49
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'sitemapxml' )->__ ( 'Language Map does not exist' ) );
50
+ $this->_redirect ( '*/*/' );
51
+ }
52
+ }
53
+
54
+ public function newAction(){
55
+ return $this->editAction();
56
+ }
57
+
58
+ public function saveAction() {
59
+ if ($data = $this->getRequest ()->getPost ()) {
60
+ $model = Mage::getModel ( 'sitemapxml/language' );
61
+ $model->setData ( $data )->setId ( $this->getRequest ()->getParam ( 'id' ) );
62
+
63
+ try {
64
+ $model->save ();
65
+ Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( 'sitemapxml' )->__ ( 'Language Map Saved' ) );
66
+ Mage::getSingleton ( 'adminhtml/session' )->setData ( false );
67
+
68
+ if ($this->getRequest ()->getParam ( 'back' )) {
69
+ $this->_redirect ( '*/*/edit', array ('id' => $model->getId () ) );
70
+ return;
71
+ }
72
+ $this->_redirect ( '*/*/' );
73
+ return;
74
+ } catch ( Exception $e ) {
75
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
76
+ Mage::getSingleton ( 'adminhtml/session' )->setData ('sitemapxml_language_data', $data );
77
+ $this->_redirect ( '*/*/edit', array ('id' => $this->getRequest ()->getParam ( 'id' ) ) );
78
+ return;
79
+ }
80
+ }
81
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'sitemapxml' )->__ ( 'Unable to find Language Map to Save' ) );
82
+ $this->_redirect ( '*/*/' );
83
+ }
84
+
85
+ public function deleteAction() {
86
+ if ($id = $this->getRequest ()->getParam ( 'id' )) {
87
+ $model = Mage::getModel ( 'sitemapxml/language' );
88
+ $model->setId ( $id );
89
+
90
+ try {
91
+ $model->delete ();
92
+ Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( 'sitemapxml' )->__ ( 'Language Map Deleted' ) );
93
+ Mage::getSingleton ( 'adminhtml/session' )->setData ( false );
94
+
95
+ if ($this->getRequest ()->getParam ( 'back' )) {
96
+ $this->_redirect ( '*/*/');
97
+ return;
98
+ }
99
+ $this->_redirect ( '*/*/' );
100
+ return;
101
+ } catch ( Exception $e ) {
102
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
103
+ Mage::getSingleton ( 'adminhtml/session' )->setData ('sitemapxml_language_data', $data );
104
+ $this->_redirect ( '*/*/edit', array ('id' => $this->getRequest ()->getParam ( 'id' ) ) );
105
+ return;
106
+ }
107
+ }
108
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'sitemapxml' )->__ ( 'Unable to find Language Map to Delete' ) );
109
+ $this->_redirect ( '*/*/' );
110
+ }
111
+ }
app/code/{local → community}/Harapartners/SitemapXml/etc/adminhtml.xml RENAMED
@@ -1,45 +1,45 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- *
12
- * @author Steven Hoffman <s.hoffman@harapartners.com>
13
- * @copyright Copyright (c) 2013 Harapartners Inc.
14
- *
15
- -->
16
- <!-- app/code/local/Harapartners/Edi/etc/adminhtml.xml -->
17
-
18
- <config>
19
- <menu>
20
- <catalog>
21
- <children>
22
- <sitemap_language translate="title" module="sitemapxml">
23
- <title>Google Sitemap Store - Languages</title>
24
- <sort_order>200</sort_order>
25
- <action>sitemapxml_adminhtml/language</action>
26
- </sitemap_language>
27
- </children>
28
- </catalog>
29
- </menu>
30
- <acl>
31
- <resources>
32
- <admin>
33
- <children>
34
- <catalog>
35
- <children>
36
- <sitemap_language translate="title" module="sitemapxml">
37
- <title>Language Map</title>
38
- </sitemap_language>
39
- </children>
40
- </catalog>
41
- </children>
42
- </admin>
43
- </resources>
44
- </acl>
45
- </config>
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ *
12
+ * @author Steven Hoffman <s.hoffman@harapartners.com>
13
+ * @copyright Copyright (c) 2013 Harapartners Inc.
14
+ *
15
+ -->
16
+ <!-- app/code/local/Harapartners/Edi/etc/adminhtml.xml -->
17
+
18
+ <config>
19
+ <menu>
20
+ <catalog>
21
+ <children>
22
+ <sitemap_language translate="title" module="sitemapxml">
23
+ <title>Google Sitemap Store - Languages</title>
24
+ <sort_order>200</sort_order>
25
+ <action>sitemapxml_adminhtml/language</action>
26
+ </sitemap_language>
27
+ </children>
28
+ </catalog>
29
+ </menu>
30
+ <acl>
31
+ <resources>
32
+ <admin>
33
+ <children>
34
+ <catalog>
35
+ <children>
36
+ <sitemap_language translate="title" module="sitemapxml">
37
+ <title>Language Map</title>
38
+ </sitemap_language>
39
+ </children>
40
+ </catalog>
41
+ </children>
42
+ </admin>
43
+ </resources>
44
+ </acl>
45
+ </config>
app/code/{local → community}/Harapartners/SitemapXml/etc/config.xml RENAMED
@@ -1,90 +1,76 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- *
12
- -->
13
- <config>
14
- <modules>
15
- <Harapartners_SitemapXml>
16
- <version>1.0.0</version>
17
- </Harapartners_SitemapXml>
18
- </modules>
19
- <global>
20
- <blocks>
21
- <sitemapxml>
22
- <class>Harapartners_SitemapXml_Block</class>
23
- </sitemapxml>
24
- </blocks>
25
- <models>
26
- <sitemapxml>
27
- <class>Harapartners_SitemapXml_Model</class>
28
- <resourceModel>sitemapxml_resource</resourceModel>
29
- </sitemapxml>
30
- <sitemap>
31
- <rewrite>
32
- <sitemap>Harapartners_SitemapXml_Model_Rewrite_Sitemap_Sitemap</sitemap>
33
- </rewrite>
34
- </sitemap>
35
- <sitemapxml_resource>
36
- <class>Harapartners_SitemapXml_Model_Resource</class>
37
- <entities>
38
- <sitemap_language>
39
- <table>harapartners_sitemap_language</table>
40
- </sitemap_language>
41
- </entities>
42
- </sitemapxml_resource>
43
- </models>
44
- <resources>
45
- <sitemapxml_setup>
46
- <setup>
47
- <module>Harapartners_SitemapXml</module>
48
- </setup>
49
- <connection>
50
- <use>core_setup</use>
51
- </connection>
52
- </sitemapxml_setup>
53
- </resources>
54
- <helpers>
55
- <sitemapxml>
56
- <class>Harapartners_SitemapXml_Helper</class>
57
- </sitemapxml>
58
- <adminhtml>
59
- <rewrite>
60
- <catalog>Harapartners_SitemapXml_Helper_Rewrite_Adminhtml_Catalog</catalog>
61
- </rewrite>
62
- </adminhtml>
63
- </helpers>
64
- </global>
65
- <admin>
66
- <routers>
67
- <sitemapxml_adminhtml>
68
- <use>admin</use>
69
- <args>
70
- <module>Harapartners_SitemapXml_Adminhtml</module>
71
- <frontName>sitemapxml_adminhtml</frontName>
72
- </args>
73
- </sitemapxml_adminhtml>
74
- </routers>
75
- </admin>
76
- <!--
77
- <crontab>
78
- <jobs>
79
- <edi_sync>
80
- <schedule>
81
- <cron_expr>0,30 * * * *</cron_expr>
82
- </schedule>
83
- <run>
84
- <model>edi/observer::createSendRecieveSyncEdi</model>
85
- </run>
86
- </edi_sync>
87
- </jobs>
88
- </crontab>
89
- -->
90
- </config>
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ *
12
+ -->
13
+ <config>
14
+ <modules>
15
+ <Harapartners_SitemapXml>
16
+ <version>1.0.0</version>
17
+ </Harapartners_SitemapXml>
18
+ </modules>
19
+ <global>
20
+ <blocks>
21
+ <sitemapxml>
22
+ <class>Harapartners_SitemapXml_Block</class>
23
+ </sitemapxml>
24
+ </blocks>
25
+ <models>
26
+ <sitemapxml>
27
+ <class>Harapartners_SitemapXml_Model</class>
28
+ <resourceModel>sitemapxml_resource</resourceModel>
29
+ </sitemapxml>
30
+ <sitemap>
31
+ <rewrite>
32
+ <sitemap>Harapartners_SitemapXml_Model_Rewrite_Sitemap_Sitemap</sitemap>
33
+ </rewrite>
34
+ </sitemap>
35
+ <sitemapxml_resource>
36
+ <class>Harapartners_SitemapXml_Model_Resource</class>
37
+ <entities>
38
+ <sitemap_language>
39
+ <table>harapartners_sitemap_language</table>
40
+ </sitemap_language>
41
+ </entities>
42
+ </sitemapxml_resource>
43
+ </models>
44
+ <resources>
45
+ <sitemapxml_setup>
46
+ <setup>
47
+ <module>Harapartners_SitemapXml</module>
48
+ </setup>
49
+ <connection>
50
+ <use>core_setup</use>
51
+ </connection>
52
+ </sitemapxml_setup>
53
+ </resources>
54
+ <helpers>
55
+ <sitemapxml>
56
+ <class>Harapartners_SitemapXml_Helper</class>
57
+ </sitemapxml>
58
+ <adminhtml>
59
+ <rewrite>
60
+ <catalog>Harapartners_SitemapXml_Helper_Rewrite_Adminhtml_Catalog</catalog>
61
+ </rewrite>
62
+ </adminhtml>
63
+ </helpers>
64
+ </global>
65
+ <admin>
66
+ <routers>
67
+ <sitemapxml_adminhtml>
68
+ <use>admin</use>
69
+ <args>
70
+ <module>Harapartners_SitemapXml_Adminhtml</module>
71
+ <frontName>sitemapxml_adminhtml</frontName>
72
+ </args>
73
+ </sitemapxml_adminhtml>
74
+ </routers>
75
+ </admin>
76
+ </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/{local → community}/Harapartners/SitemapXml/etc/system.xml RENAMED
@@ -1,63 +1,63 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- *
12
- * @author Steven Hoffman <s.hoffman@harapartners.com>
13
- * @copyright Copyright (c) 2013 Harapartners Inc.
14
- *
15
- -->
16
- <!-- app/code/local/Harapartners/Edi/etc/system.xml -->
17
-
18
- <config>
19
- <sections>
20
- <sitemap>
21
- <groups>
22
- <language>
23
- <label>Langauge Settings</label>
24
- <sort_order>40</sort_order>
25
- <show_in_default>1</show_in_default>
26
- <show_in_website>1</show_in_website>
27
- <show_in_store>0</show_in_store>
28
- <fields>
29
- <is_enabled translate="label">
30
- <label>Enable this Addon</label>
31
- <frontend_type>select</frontend_type>
32
- <source_model>adminhtml/system_config_source_yesno</source_model>
33
- <sort_order>5</sort_order>
34
- <show_in_default>1</show_in_default>
35
- <show_in_website>1</show_in_website>
36
- <show_in_store>0</show_in_store>
37
- </is_enabled>
38
- <x_default_url translate="label">
39
- <label>X-Default Base Url</label>
40
- <comment>Leave Blank to use Site Default </comment>
41
- <frontend_type>text</frontend_type>
42
- <validate>validate-url</validate>
43
- <sort_order>10</sort_order>
44
- <show_in_default>1</show_in_default>
45
- <show_in_website>1</show_in_website>
46
- <show_in_store>0</show_in_store>
47
- </x_default_url>
48
- <validate_url translate="label">
49
- <label>Ping URL to Validate Link</label>
50
- <comment>(200 is a valid responce code)</comment>
51
- <frontend_type>select</frontend_type>
52
- <source_model>adminhtml/system_config_source_yesno</source_model>
53
- <sort_order>15</sort_order>
54
- <show_in_default>1</show_in_default>
55
- <show_in_website>1</show_in_website>
56
- <show_in_store>0</show_in_store>
57
- </validate_url>
58
- </fields>
59
- </language>
60
- </groups>
61
- </sitemap>
62
- </sections>
63
- </config>
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ *
12
+ * @author Steven Hoffman <s.hoffman@harapartners.com>
13
+ * @copyright Copyright (c) 2013 Harapartners Inc.
14
+ *
15
+ -->
16
+ <!-- app/code/local/Harapartners/Edi/etc/system.xml -->
17
+
18
+ <config>
19
+ <sections>
20
+ <sitemap>
21
+ <groups>
22
+ <language>
23
+ <label>Langauge Settings</label>
24
+ <sort_order>40</sort_order>
25
+ <show_in_default>1</show_in_default>
26
+ <show_in_website>1</show_in_website>
27
+ <show_in_store>0</show_in_store>
28
+ <fields>
29
+ <is_enabled translate="label">
30
+ <label>Enable this Addon</label>
31
+ <frontend_type>select</frontend_type>
32
+ <source_model>adminhtml/system_config_source_yesno</source_model>
33
+ <sort_order>5</sort_order>
34
+ <show_in_default>1</show_in_default>
35
+ <show_in_website>1</show_in_website>
36
+ <show_in_store>0</show_in_store>
37
+ </is_enabled>
38
+ <x_default_url translate="label">
39
+ <label>X-Default Base Url</label>
40
+ <comment>Leave Blank to use Site Default </comment>
41
+ <frontend_type>text</frontend_type>
42
+ <validate>validate-url</validate>
43
+ <sort_order>10</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>1</show_in_website>
46
+ <show_in_store>0</show_in_store>
47
+ </x_default_url>
48
+ <validate_url translate="label">
49
+ <label>Ping URL to Validate Link</label>
50
+ <comment>(200 is a valid responce code)</comment>
51
+ <frontend_type>select</frontend_type>
52
+ <source_model>adminhtml/system_config_source_yesno</source_model>
53
+ <sort_order>15</sort_order>
54
+ <show_in_default>1</show_in_default>
55
+ <show_in_website>1</show_in_website>
56
+ <show_in_store>0</show_in_store>
57
+ </validate_url>
58
+ </fields>
59
+ </language>
60
+ </groups>
61
+ </sitemap>
62
+ </sections>
63
+ </config>
app/code/{local → community}/Harapartners/SitemapXml/sql/sitemapxml_setup/install-1.0.0.php RENAMED
@@ -1,37 +1,37 @@
1
- <?php
2
- /*
3
- * NOTICE OF LICENSE
4
- *
5
- * This source file is subject to the End User Software Agreement (EULA).
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.harapartners.com/license
8
- * If you did not receive a copy of the license and are unable to
9
- * obtain it through the world-wide-web, please send an email
10
- * to eula@harapartners.com so we can send you a copy immediately.
11
- *
12
- */
13
- $installer = $this;
14
- $installer->startSetup();
15
- $table = $installer->getConnection()
16
- ->newTable($installer->getTable('sitemapxml/sitemap_language'))
17
- ->addColumn('language_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
18
- 'identity' => true,
19
- 'unsigned' => true,
20
- 'nullable' => false,
21
- 'primary' => true,
22
- ), 'Auto Increment Language Map ID')
23
- ->addColumn('store_view_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
24
- 'unsigned' => true,
25
- 'nullable' => false,
26
- ), 'Record Map Status')
27
- ->addColumn('language_code', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
28
- 'nullable' => false,
29
- ), 'Language Code')
30
- ->addIndex(
31
- $installer->getIdxName('sitemapxml/sitemap_language', array('store_view_id')),
32
- array('store_view_id'),
33
- array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
34
- )
35
- ->setComment('Sitemap Xml Language Map');
36
- $installer->getConnection()->createTable( $table );
37
- $installer->endSetup();
1
+ <?php
2
+ /*
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the End User Software Agreement (EULA).
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.harapartners.com/license
8
+ * If you did not receive a copy of the license and are unable to
9
+ * obtain it through the world-wide-web, please send an email
10
+ * to eula@harapartners.com so we can send you a copy immediately.
11
+ *
12
+ */
13
+ $installer = $this;
14
+ $installer->startSetup();
15
+ $table = $installer->getConnection()
16
+ ->newTable($installer->getTable('sitemapxml/sitemap_language'))
17
+ ->addColumn('language_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
18
+ 'identity' => true,
19
+ 'unsigned' => true,
20
+ 'nullable' => false,
21
+ 'primary' => true,
22
+ ), 'Auto Increment Language Map ID')
23
+ ->addColumn('store_view_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
24
+ 'unsigned' => true,
25
+ 'nullable' => false,
26
+ ), 'Record Map Status')
27
+ ->addColumn('language_code', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
28
+ 'nullable' => false,
29
+ ), 'Language Code')
30
+ ->addIndex(
31
+ $installer->getIdxName('sitemapxml/sitemap_language', array('store_view_id')),
32
+ array('store_view_id'),
33
+ array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
34
+ )
35
+ ->setComment('Sitemap Xml Language Map');
36
+ $installer->getConnection()->createTable( $table );
37
+ $installer->endSetup();
app/etc/modules/Harapartners_Sitemapxml.xml CHANGED
@@ -1,9 +1,9 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Harapartners_SitemapXml>
5
- <active>true</active>
6
- <codePool>local</codePool>
7
- </Harapartners_SitemapXml>
8
- </modules>
9
  </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Harapartners_SitemapXml>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Harapartners_SitemapXml>
8
+ </modules>
9
  </config>
package.xml CHANGED
@@ -1,20 +1,26 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MultiLanguage_Sitemap</name>
4
- <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.elieandmai.com/eula">Elie and Mai End User License Agreement</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>The Multi-Language Sitemap Optimization Magento module automatically generates a multi-language sitemap supported by Google.</summary>
10
  <description>This extension will allow for you to Search Engine optimize your Magento store for multiple languages. This extension give you the ability to create a &#x201C;language sitemap&#x201D; which you can submit in Google Webmaster tools. This language sitemap tells Google which version page to display in the counties you specify. For example, you can indicate that you want us.example.com to rank for US visitors or fr.example.com to rank in France.</description>
11
- <notes>First Stable Version for General Use of the Multi-Language Optimization (hreflang).&#xD;
12
  &#xD;
13
- This version properly configured automatically generates a multi-language sitemap supported by Google.</notes>
 
 
 
 
 
 
14
  <authors><author><name>Elie Orgel</name><user>elieandmai</user><email>magento@elieandmai.com</email></author></authors>
15
- <date>2014-05-16</date>
16
- <time>19:38:08</time>
17
- <contents><target name="magelocal"><dir name="Harapartners"><dir name="SitemapXml"><dir name="Block"><dir name="Adminhtml"><dir name="Language"><dir name="Edit"><file name="Form.php" hash="cc7626b3ce229ab2ecd53367b279c64a"/></dir><file name="Edit.php" hash="4e3c1b8c75082b1021a79765a19f095f"/><dir name="Index"><file name="Grid.php" hash="eaefaf1259dd7dbf7040b2e00bc4ae05"/></dir><file name="Index.php" hash="76dec39b4af1821624c0f0460d7a793b"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="3247339dd38b724fe10783ebb65f12dd"/><dir name="Rewrite"><dir name="Adminhtml"><file name="Catalog.php" hash="4014d9de20574f2163f793c7287037f0"/></dir></dir></dir><dir name="Model"><file name="Language.php" hash="244d1d82a6365eb33e8bd475f6cc3793"/><dir name="Resource"><dir name="Catalog"><file name="Product.php" hash="c6bc72c42bd106756893a524db7bc6b9"/></dir><dir name="Language"><file name="Collection.php" hash="dc064cf886b3d7992d34af27da069b5f"/></dir><file name="Language.php" hash="99e8bebe005f841cda6e2330b9c8f6e2"/></dir><dir name="Rewrite"><dir name="Sitemap"><file name="Sitemap.php" hash="ee89c4cd240fcd2946d3928134ea35d9"/></dir></dir><dir name="Source"><file name="Store.php" hash="3f0ea63fde41b3b0d55ee888fcc8ef85"/><file name="Xml.php" hash="f60b6e6bf1f570685ebbc893357a6685"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="LanguageController.php" hash="090aa123a35a9c6fa06259555a6566e1"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="d9ae504e4afc73941cbba59116c6dcfe"/><file name="config.xml" hash="13a6a58523ba01841c010f3b1db8b3bf"/><file name="system.xml" hash="affc7706807dd4eae6019ab165937a82"/></dir><dir name="sql"><dir name="sitemapxml_setup"><file name="install-1.0.0.php" hash="9b84cb415328cc6283db06cf9462e297"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Harapartners_Sitemapxml.xml" hash="38018c4b411931ea63efd16eb4141f1e"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MultiLanguage_Sitemap</name>
4
+ <version>2.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.elieandmai.com/eula">Elie and Mai End User License Agreement</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>The Multi-Language Sitemap Optimization Magento module automatically generates a multi-language sitemap supported by Google.</summary>
10
  <description>This extension will allow for you to Search Engine optimize your Magento store for multiple languages. This extension give you the ability to create a &#x201C;language sitemap&#x201D; which you can submit in Google Webmaster tools. This language sitemap tells Google which version page to display in the counties you specify. For example, you can indicate that you want us.example.com to rank for US visitors or fr.example.com to rank in France.</description>
11
+ <notes>Multi-Language Optimization (hreflang) Module.&#xD;
12
  &#xD;
13
+ This version properly configured automatically generates a multi-language sitemap supported by Google.&#xD;
14
+ &#xD;
15
+ New features include:&#xD;
16
+ &#xD;
17
+ - ability to include CMS pages&#xD;
18
+ - exclusion of disabled products and categories&#xD;
19
+ </notes>
20
  <authors><author><name>Elie Orgel</name><user>elieandmai</user><email>magento@elieandmai.com</email></author></authors>
21
+ <date>2014-10-22</date>
22
+ <time>17:39:43</time>
23
+ <contents><target name="magecommunity"><dir name="Harapartners"><dir name="SitemapXml"><dir name="Block"><dir name="Adminhtml"><dir name="Language"><dir name="Edit"><file name="Form.php" hash="cecd54d827ba0e79667c5c1aabfba8b8"/></dir><file name="Edit.php" hash="3e6ff1b204c0822d3454f868d8e8d61d"/><dir name="Index"><file name="Grid.php" hash="79ea8d05432a69217660dc2a8e9ef218"/></dir><file name="Index.php" hash="82c56e32919a9a8eaf70b138fe75e99c"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="e56e667845d82fda6bde9c909ac7366b"/><dir name="Rewrite"><dir name="Adminhtml"><file name="Catalog.php" hash="9d3b6b606efa9f207b0f12fbcf7439f0"/></dir></dir><dir name="Store"><file name="Catalog.php" hash="6029325ce3565d22e535b05c54b55722"/></dir></dir><dir name="Model"><file name="Language.php" hash="4295c3dc0d055c0f65e4538a49c3d367"/><dir name="Resource"><dir name="Catalog"><file name="Product.php" hash="c6bc72c42bd106756893a524db7bc6b9"/></dir><dir name="Language"><file name="Collection.php" hash="9993e9e6191fcbeaab25dccd5930b480"/></dir><file name="Language.php" hash="d3280c29d26093ac7c7f305c7c6a918d"/></dir><dir name="Rewrite"><dir name="Sitemap"><file name="Sitemap.php" hash="57fdaa355aa35abd5145a54134c075ec"/></dir></dir><dir name="Source"><file name="Store.php" hash="bf961247b3deccabfd7d0a0fe6303a1f"/><file name="Xml.php" hash="431ee58f7c638ec17e6f5de8c032561e"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="LanguageController.php" hash="5a54dd85623b8deb3fe1553d80fdb269"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="0a3b58e430dd48c38027cbd1546bff11"/><file name="config.xml" hash="7c1ae4ed3742d1879c34d411c19825f5"/><file name="system.xml" hash="7d455d5d813ec1e98e8446fabb717cf5"/></dir><dir name="sql"><dir name="sitemapxml_setup"><file name="install-1.0.0.php" hash="6d7d96bf394ec10d2cb689f55121ab0c"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Harapartners_Sitemapxml.xml" hash="3c2128b6ca754a668eae4157d7013f24"/></dir></target></contents>
24
  <compatible/>
25
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
26
  </package>