Raveinfosys_sitemap - Version 1.0.0

Version Notes

This is stable version of this extension and has been tested on various version of community editions.

Download this release

Release Info

Developer Rave Infosys
Extension Raveinfosys_sitemap
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (38) hide show
  1. app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap.php +12 -0
  2. app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit.php +38 -0
  3. app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Config.php +24 -0
  4. app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Form.php +19 -0
  5. app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Tab/Config.php +180 -0
  6. app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Tab/Form.php +143 -0
  7. app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Tabs.php +24 -0
  8. app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Grid.php +116 -0
  9. app/code/local/Raveinfosys/Showmap/Block/Showmap.php +17 -0
  10. app/code/local/Raveinfosys/Showmap/Helper/Data.php +6 -0
  11. app/code/local/Raveinfosys/Showmap/Model/Config.php +37 -0
  12. app/code/local/Raveinfosys/Showmap/Model/Mysql4/Config.php +10 -0
  13. app/code/local/Raveinfosys/Showmap/Model/Mysql4/Showmap.php +10 -0
  14. app/code/local/Raveinfosys/Showmap/Model/Mysql4/Showmap/Collection.php +10 -0
  15. app/code/local/Raveinfosys/Showmap/Model/Showmap.php +163 -0
  16. app/code/local/Raveinfosys/Showmap/Model/Status.php +15 -0
  17. app/code/local/Raveinfosys/Showmap/controllers/Adminhtml/ShowmapController.php +334 -0
  18. app/code/local/Raveinfosys/Showmap/controllers/IndexController.php +25 -0
  19. app/code/local/Raveinfosys/Showmap/etc/config.xml +150 -0
  20. app/code/local/Raveinfosys/Showmap/sql/showmap_setup/mysql4-install-0.1.0.php +38 -0
  21. app/code/local/Raveinfosys/Showresponse/Block/Adminhtml/Showresponse.php +12 -0
  22. app/code/local/Raveinfosys/Showresponse/Block/Adminhtml/Showresponse/Grid.php +86 -0
  23. app/code/local/Raveinfosys/Showresponse/Block/Showresponse.php +17 -0
  24. app/code/local/Raveinfosys/Showresponse/Helper/Data.php +6 -0
  25. app/code/local/Raveinfosys/Showresponse/Model/Mysql4/Showresponse.php +10 -0
  26. app/code/local/Raveinfosys/Showresponse/Model/Mysql4/Showresponse/Collection.php +10 -0
  27. app/code/local/Raveinfosys/Showresponse/Model/Showresponse.php +35 -0
  28. app/code/local/Raveinfosys/Showresponse/Model/Status.php +15 -0
  29. app/code/local/Raveinfosys/Showresponse/controllers/Adminhtml/ShowresponseController.php +89 -0
  30. app/code/local/Raveinfosys/Showresponse/etc/config.xml +108 -0
  31. app/code/local/Raveinfosys/Showresponse/sql/showresponse_setup/mysql4-install-0.1.0.php +22 -0
  32. app/design/adminhtml/default/default/layout/showmap.xml +14 -0
  33. app/design/adminhtml/default/default/layout/showresponse.xml +8 -0
  34. app/design/frontend/default/default/layout/showmap.xml +10 -0
  35. app/design/frontend/default/default/template/showmap/showmap.phtml +108 -0
  36. app/etc/modules/Raveinfosys_Showmap.xml +9 -0
  37. app/etc/modules/Raveinfosys_Showresponse.xml +9 -0
  38. package.xml +18 -0
app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Raveinfosys_Showmap_Block_Adminhtml_Showmap extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_showmap';
7
+ $this->_blockGroup = 'showmap';
8
+ $this->_headerText = Mage::helper('showmap')->__('sitemap');
9
+ $this->_addButtonLabel = Mage::helper('showmap')->__('site map');
10
+ parent::__construct();
11
+ }
12
+ }
app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+
9
+ $this->_objectId = 'id';
10
+ $this->_blockGroup = 'showmap';
11
+ $this->_controller = 'adminhtml_showmap';
12
+
13
+ $this->_updateButton('save', 'label', Mage::helper('showmap')->__('Save'));
14
+
15
+ $this->_formScripts[] = "
16
+ function toggleEditor() {
17
+ if (tinyMCE.getInstanceById('showmap_content') == null) {
18
+ tinyMCE.execCommand('mceAddControl', false, 'showmap_content');
19
+ } else {
20
+ tinyMCE.execCommand('mceRemoveControl', false, 'showmap_content');
21
+ }
22
+ }
23
+
24
+ function saveAndContinueEdit(){
25
+ editForm.submit($('edit_form').action+'back/edit/');
26
+ }
27
+ ";
28
+ }
29
+
30
+ public function getHeaderText()
31
+ {
32
+ if( Mage::registry('showmap_data') && Mage::registry('showmap_data')->getId() ) {
33
+ return Mage::helper('showmap')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('showmap_data')->getTitle()));
34
+ } else {
35
+ return Mage::helper('showmap')->__('Site Map');
36
+ }
37
+ }
38
+ }
app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Config.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Config extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('showmap_config');
10
+ $this->setDestElementId('config_form');
11
+ $this->setTitle(Mage::helper('showmap')->__('Configuration'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('form_section', array(
17
+ 'label' => Mage::helper('showmap')->__('Configuration'),
18
+ 'title' => Mage::helper('showmap')->__('Sitemap'),
19
+ // 'content' => $this->getLayout()->createBlock('showmap/adminhtml_showmap_edit_tab_config')->toHtml(),
20
+ ));
21
+
22
+ return parent::_beforeToHtml();
23
+ }
24
+ }
app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'edit_form',
9
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Tab/Config.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tab_Config extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+
8
+ $config = Mage::getModel('showmap/config');
9
+ $row = $config->getRow();
10
+ $category = $row['category'];
11
+ $form = new Varien_Data_Form(array(
12
+ 'id' => 'config_form',
13
+ 'action' => $this->getUrl('*/*/config', array('id' => $this->getRequest()->getParam('id'))),
14
+ 'method' => 'post',
15
+ 'enctype' => 'multipart/form-data'
16
+ ));
17
+ $form->setUseContainer(true);
18
+ $this->setForm($form);
19
+ $fieldset = $form->addFieldset('showmap_form', array('legend'=>Mage::helper('showmap')->__('Configuration')));
20
+
21
+
22
+
23
+ if($row['category']=='yes')
24
+ {
25
+ $fieldset->addField('category', 'select', array(
26
+ 'name' => 'category',
27
+ 'label' => 'Show Categories',
28
+ 'align' =>'left',
29
+ 'values' => array(
30
+ array(
31
+ 'value' => yes,
32
+ 'label' => Mage::helper('showmap')->__('Yes'),),
33
+
34
+ array(
35
+ 'value' => no,
36
+ 'label' => Mage::helper('showmap')->__('No')))));
37
+ }
38
+ else
39
+ {
40
+ $fieldset->addField('category', 'select', array(
41
+ 'name' => 'category',
42
+ 'label' => 'Show Categories',
43
+ 'align' =>'left',
44
+ 'values' => array(
45
+ array(
46
+ 'value' => no,
47
+ 'label' => Mage::helper('showmap')->__('No'),),
48
+
49
+ array(
50
+ 'value' => yes,
51
+ 'label' => Mage::helper('showmap')->__('Yes')))));
52
+ }
53
+
54
+
55
+
56
+
57
+ if($row['product']=='yes')
58
+ {
59
+ $fieldset->addField('product', 'select', array(
60
+ 'name' => 'product',
61
+ 'label' => 'Show Products',
62
+ 'align' =>'left',
63
+ 'values' => array(
64
+ array(
65
+ 'value' => yes,
66
+ 'label' => Mage::helper('showmap')->__('Yes'),),
67
+
68
+ array(
69
+ 'value' => no,
70
+ 'label' => Mage::helper('showmap')->__('No')))));
71
+ }
72
+ else
73
+ {
74
+ $fieldset->addField('product', 'select', array(
75
+ 'name' => 'product',
76
+ 'label' => 'Show Products',
77
+ 'align' =>'left',
78
+ 'values' => array(
79
+ array(
80
+ 'value' => no,
81
+ 'label' => Mage::helper('showmap')->__('No'),),
82
+
83
+ array(
84
+ 'value' => yes,
85
+ 'label' => Mage::helper('showmap')->__('Yes')))));
86
+ }
87
+
88
+
89
+
90
+
91
+
92
+ if($row['cms']=='yes')
93
+ {
94
+ $fieldset->addField('cms', 'select', array(
95
+ 'name' => 'cms',
96
+ 'label' => 'Show CMS Pages',
97
+ 'align' =>'left',
98
+ 'values' => array(
99
+ array(
100
+ 'value' => yes,
101
+ 'label' => Mage::helper('showmap')->__('Yes'),),
102
+
103
+ array(
104
+ 'value' => no,
105
+ 'label' => Mage::helper('showmap')->__('No')))));
106
+ }
107
+ else
108
+ {
109
+ $fieldset->addField('cms', 'select', array(
110
+ 'name' => 'cms',
111
+ 'label' => 'Show CMS Pages',
112
+ 'align' =>'left',
113
+ 'values' => array(
114
+ array(
115
+ 'value' => no,
116
+ 'label' => Mage::helper('showmap')->__('No'),),
117
+
118
+ array(
119
+ 'value' => yes,
120
+ 'label' => Mage::helper('showmap')->__('Yes')))));
121
+ }
122
+
123
+
124
+
125
+
126
+ if($row['other']=='yes')
127
+ {
128
+ $fieldset->addField('other', 'select', array(
129
+ 'name' => 'other',
130
+ 'label' => 'Show Header And Footer',
131
+ 'align' =>'left',
132
+ 'values' => array(
133
+ array(
134
+ 'value' => yes,
135
+ 'label' => Mage::helper('showmap')->__('Yes'),),
136
+
137
+ array(
138
+ 'value' => no,
139
+ 'label' => Mage::helper('showmap')->__('No')))));
140
+ }
141
+ else
142
+ {
143
+ $fieldset->addField('other', 'select', array(
144
+ 'name' => 'other',
145
+ 'label' => 'Show Header And Footer',
146
+ 'align' =>'left',
147
+ 'values' => array(
148
+ array(
149
+ 'value' => no,
150
+ 'label' => Mage::helper('showmap')->__('No'),),
151
+
152
+ array(
153
+ 'value' => yes,
154
+ 'label' => Mage::helper('showmap')->__('Yes')))));
155
+ }
156
+
157
+
158
+
159
+
160
+
161
+ $fieldset->addField('submit', 'submit', array(
162
+ 'value' => 'Save',
163
+ 'after_element_html' => '<small></small>',
164
+ 'style' => 'background-color:#FF6600; width:70px; color:white;font-family:Arial, Helvetica, sans-serif;
165
+ font-style:normal; ',
166
+ 'tabindex' => 1
167
+ ));
168
+
169
+
170
+
171
+
172
+ return parent::_prepareForm();
173
+
174
+ }
175
+
176
+
177
+ }
178
+
179
+
180
+
app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Tab/Form.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+
8
+ $showmap = Mage::getModel('showmap/showmap');
9
+ $row = $showmap->getRow();
10
+ if($row['google']=='yes')$google=true;
11
+ if($row['bing']=='yes')$bing=true;
12
+ if($row['window']=='yes')$window=true;
13
+ if($row['yahoo']=='yes')
14
+ {
15
+ $yahoo=true;
16
+ $yahoo_id = $row['yahoo_id'];
17
+ }
18
+ $form = new Varien_Data_Form();
19
+ $this->setForm($form);
20
+ $fieldset = $form->addFieldset('showmap_form', array('legend'=>Mage::helper('showmap')->__('Site Map')));
21
+
22
+ if($row['ping_interval']!='')
23
+ {
24
+ $fieldset->addField('ping_interval', 'text', array(
25
+ 'label' => Mage::helper('showmap')->__('Ping Interval'),
26
+ 'class' => 'validate-greater-than-zero',
27
+ 'required' => true,
28
+ 'name' => 'ping_interval',
29
+ 'value' => "".$row['ping_interval'].""));
30
+ }
31
+ else
32
+ {
33
+ $fieldset->addField('ping_interval', 'text', array(
34
+ 'label' => Mage::helper('showmap')->__('Ping Interval'),
35
+ 'class' => 'validate-greater-than-zero',
36
+ 'required' => true,
37
+ 'name' => 'ping_interval',
38
+ 'value' => '30'));
39
+ }
40
+
41
+ if($row['format']== 'hours')
42
+ {
43
+ $fieldset->addField('format', 'select', array(
44
+ 'name' => 'format',
45
+ 'align' =>'left',
46
+ 'values' => array(
47
+ array(
48
+ 'value' => hours,
49
+ 'label' => Mage::helper('showmap')->__('Hours')),
50
+ array(
51
+ 'value' => days,
52
+ 'label' => Mage::helper('showmap')->__('Days'),),
53
+
54
+ )));
55
+ }
56
+ else
57
+ {
58
+ $fieldset->addField('format', 'select', array(
59
+ 'name' => 'format',
60
+ 'align' =>'left',
61
+ 'values' => array(
62
+ array(
63
+ 'value' => days,
64
+ 'label' => Mage::helper('showmap')->__('Days'),),
65
+
66
+ array(
67
+ 'value' => hours,
68
+ 'label' => Mage::helper('showmap')->__('Hours')))));
69
+ }
70
+
71
+
72
+
73
+
74
+ $fieldset->addField('google', 'checkbox', array(
75
+ 'label' => Mage::helper('showmap')->__('Choose Channel'),
76
+ 'name' => 'google',
77
+ 'checked' => $google,
78
+ 'onclick' => "",
79
+ 'onchange' => "",
80
+ 'value' => 'google',
81
+ 'disabled' => false,
82
+ 'after_element_html' => '<large>Google</large>',
83
+ 'tabindex' => 1
84
+ ));
85
+
86
+ $fieldset->addField('bing', 'checkbox', array(
87
+ 'name' => 'bing',
88
+ 'checked' => $bing,
89
+ 'onclick' => "",
90
+ 'onchange' => "",
91
+ 'value' => 'bing',
92
+ 'disabled' => false,
93
+ 'after_element_html' => '<large>Bing</large>',
94
+ 'tabindex' => 1
95
+ ));
96
+
97
+ $fieldset->addField('window', 'checkbox', array(
98
+ 'name' => 'window',
99
+ 'checked' => $window,
100
+ 'onclick' => "",
101
+ 'onchange' => "",
102
+ 'value' => 'window',
103
+ 'disabled' => false,
104
+ 'after_element_html' => '<large>Window Live</large>',
105
+ 'tabindex' => 1
106
+ ));
107
+
108
+ $fieldset->addField('yahoo', 'checkbox', array(
109
+ 'name' => 'yahoo',
110
+ 'checked' => $yahoo,
111
+ 'onclick' => "if(this.value=='yahoo'){if(this.checked==true){
112
+ document.getElementById('yahoo_appid').style.visibility='visible';
113
+ document.getElementById('label').style.visibility='visible';}
114
+ else{
115
+ document.getElementById('yahoo_appid').style.visibility='hidden';
116
+ document.getElementById('label').style.visibility='hidden';
117
+ }}",
118
+ 'onchange' => "",
119
+ 'value' => 'yahoo',
120
+ 'disabled' => false,
121
+
122
+ 'after_element_html' => '<large>Yahoo</large>',
123
+ 'tabindex' => 1
124
+ ));
125
+
126
+
127
+ $fieldset->addField('label', 'label', array(
128
+ 'after_element_html' => '<div id ="label" style=visibility:hidden;>Yahoo App Id</div>'));
129
+
130
+ $fieldset->addField('yahoo_appid', 'text', array(
131
+ 'label' => Mage::helper('showmap')->__(''),
132
+ 'label_style' => 'visibility: hidden;',
133
+ 'name' => 'yahoo_appid',
134
+ 'value' => ''.$yahoo_id.'',
135
+ 'style' => 'visibility: hidden;'));
136
+
137
+
138
+ return parent::_prepareForm();
139
+
140
+ }
141
+
142
+
143
+ }
app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Tabs.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('showmap_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('showmap')->__('Site Map'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('form_section', array(
17
+ 'label' => Mage::helper('showmap')->__('Site Map'),
18
+ //'title' => Mage::helper('showmap')->__('Item Information'),
19
+ 'content' => $this->getLayout()->createBlock('showmap/adminhtml_showmap_edit_tab_form')->toHtml(),
20
+ ));
21
+
22
+ return parent::_beforeToHtml();
23
+ }
24
+ }
app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Grid.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('showmapGrid');
9
+ $this->setDefaultSort('showmap_id');
10
+ $this->setDefaultDir('ASC');
11
+ $this->setSaveParametersInSession(true);
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('showmap/showmap')->getCollection();
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn('showmap_id', array(
24
+ 'header' => Mage::helper('showmap')->__('ID'),
25
+ 'align' =>'right',
26
+ 'width' => '50px',
27
+ 'index' => 'showmap_id',
28
+ ));
29
+
30
+ $this->addColumn('title', array(
31
+ 'header' => Mage::helper('showmap')->__('Title'),
32
+ 'align' =>'left',
33
+ 'index' => 'title',
34
+ ));
35
+
36
+ /*
37
+ $this->addColumn('content', array(
38
+ 'header' => Mage::helper('showmap')->__('Item Content'),
39
+ 'width' => '150px',
40
+ 'index' => 'content',
41
+ ));
42
+ */
43
+
44
+ $this->addColumn('status', array(
45
+ 'header' => Mage::helper('showmap')->__('Status'),
46
+ 'align' => 'left',
47
+ 'width' => '80px',
48
+ 'index' => 'status',
49
+ 'type' => 'options',
50
+ 'options' => array(
51
+ 1 => 'Enabled',
52
+ 2 => 'Disabled',
53
+ ),
54
+ ));
55
+
56
+ $this->addColumn('action',
57
+ array(
58
+ 'header' => Mage::helper('showmap')->__('Action'),
59
+ 'width' => '100',
60
+ 'type' => 'action',
61
+ 'getter' => 'getId',
62
+ 'actions' => array(
63
+ array(
64
+ 'caption' => Mage::helper('showmap')->__('Edit'),
65
+ 'url' => array('base'=> '*/*/edit'),
66
+ 'field' => 'id'
67
+ )
68
+ ),
69
+ 'filter' => false,
70
+ 'sortable' => false,
71
+ 'index' => 'stores',
72
+ 'is_system' => true,
73
+ ));
74
+
75
+ $this->addExportType('*/*/exportCsv', Mage::helper('showmap')->__('CSV'));
76
+ $this->addExportType('*/*/exportXml', Mage::helper('showmap')->__('XML'));
77
+
78
+ return parent::_prepareColumns();
79
+ }
80
+
81
+ protected function _prepareMassaction()
82
+ {
83
+ $this->setMassactionIdField('showmap_id');
84
+ $this->getMassactionBlock()->setFormFieldName('showmap');
85
+
86
+ $this->getMassactionBlock()->addItem('delete', array(
87
+ 'label' => Mage::helper('showmap')->__('Delete'),
88
+ 'url' => $this->getUrl('*/*/massDelete'),
89
+ 'confirm' => Mage::helper('showmap')->__('Are you sure?')
90
+ ));
91
+
92
+ $statuses = Mage::getSingleton('showmap/status')->getOptionArray();
93
+
94
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
95
+ $this->getMassactionBlock()->addItem('status', array(
96
+ 'label'=> Mage::helper('showmap')->__('Change status'),
97
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
98
+ 'additional' => array(
99
+ 'visibility' => array(
100
+ 'name' => 'status',
101
+ 'type' => 'select',
102
+ 'class' => 'required-entry',
103
+ 'label' => Mage::helper('showmap')->__('Status'),
104
+ 'values' => $statuses
105
+ )
106
+ )
107
+ ));
108
+ return $this;
109
+ }
110
+
111
+ public function getRowUrl($row)
112
+ {
113
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
+ }
115
+
116
+ }
app/code/local/Raveinfosys/Showmap/Block/Showmap.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Raveinfosys_Showmap_Block_Showmap extends Mage_Core_Block_Template
3
+ {
4
+ public function _prepareLayout()
5
+ {
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ public function getShowmap()
10
+ {
11
+ if (!$this->hasData('showmap')) {
12
+ $this->setData('showmap', Mage::registry('showmap'));
13
+ }
14
+ return $this->getData('showmap');
15
+
16
+ }
17
+ }
app/code/local/Raveinfosys/Showmap/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/Raveinfosys/Showmap/Model/Config.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Model_Config extends Mage_Core_Model_Abstract
4
+ {
5
+
6
+ public function _construct()
7
+ {
8
+ parent::_construct();
9
+ $this->_init('showmap/showmap_config');
10
+
11
+ }
12
+
13
+ public function getRow()
14
+ {
15
+
16
+ $resource = Mage::getSingleton('core/resource');
17
+ $readconnection = $resource->getConnection('core_read');
18
+ $tableName = $resource->getTableName('showmap/config');
19
+ $sql = "select * from $tableName
20
+ where id=(select max(id) from $tableName)";
21
+ $row = $readconnection->fetchRow($sql);
22
+ return $row;
23
+ }
24
+
25
+ public function insertdata($category,$product,$cms,$other)
26
+ {
27
+
28
+ $resource = Mage::getSingleton('core/resource');
29
+ $writeConnection = $resource->getConnection('core_write');
30
+ $tableName = $resource->getTableName('showmap/config');
31
+ $query = "INSERT INTO $tableName ( `category`,`product`,`cms`,`other`,`configured`) VALUES ('$category', '$product','$cms','$other',1)";
32
+ $writeConnection->query($query);
33
+
34
+ }
35
+
36
+
37
+ }
app/code/local/Raveinfosys/Showmap/Model/Mysql4/Config.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Model_Mysql4_Config extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the showmap_id refers to the key field in your database table.
8
+ $this->_init('showmap/showmap_config', 'id');
9
+ }
10
+ }
app/code/local/Raveinfosys/Showmap/Model/Mysql4/Showmap.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Model_Mysql4_Showmap extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the showmap_id refers to the key field in your database table.
8
+ $this->_init('showmap/showmap', 'showmap_id');
9
+ }
10
+ }
app/code/local/Raveinfosys/Showmap/Model/Mysql4/Showmap/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Model_Mysql4_Showmap_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('showmap/showmap');
9
+ }
10
+ }
app/code/local/Raveinfosys/Showmap/Model/Showmap.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Model_Showmap extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('showmap/showmap');
9
+
10
+ }
11
+
12
+ public function insertdata($ping_interval,$format,$google,$bing,$window,$yahoo,$yahoo_appid)
13
+ {
14
+
15
+ $resource = Mage::getSingleton('core/resource');
16
+ $writeConnection = $resource->getConnection('core_write');
17
+ $tableName = $resource->getTableName('showmap/showmap');
18
+ $query_showmap = "INSERT INTO $tableName ( `ping_interval`,`format`,`google`,`bing`,`window`,`yahoo`,`yahoo_id`) VALUES ($ping_interval,'$format','$google','$bing','$window','$yahoo','$yahoo_appid')";
19
+ $writeConnection->query($query_showmap);
20
+
21
+ }
22
+
23
+ public function getRow()
24
+ {
25
+ $resource = Mage::getSingleton('core/resource');
26
+ $readconnection = $resource->getConnection('core_read');
27
+ $tableName = $resource->getTableName('showmap/showmap');
28
+ $sql = "select * from $tableName
29
+ where showmap_id=(select max(showmap_id) from $tableName)";
30
+ $row = $readconnection->fetchRow($sql);
31
+ return $row;
32
+ }
33
+
34
+
35
+
36
+ public function update()
37
+ {
38
+
39
+ $google_response = 'Not Configured';
40
+ $yahoo_response = 'Not Configured';
41
+ $bing_response = 'Not Configured';
42
+ $window_response = 'Not Configured';
43
+ $arr_row = $this->getRow();
44
+
45
+ $ping_interval = $arr_row['ping_interval'];
46
+ $format = $arr_row['format'];
47
+ $google = $arr_row['google'];
48
+ $yahoo = $arr_row['yahoo'];
49
+ $bing = $arr_row['bing'];
50
+ $window = $arr_row['window'];
51
+
52
+
53
+ $base_url = $this->get_url()."sitemap.xml";
54
+ $isCurl = function_exists(curl_init);
55
+ if($isCurl)
56
+ {
57
+
58
+
59
+ if($google=='yes')
60
+ {
61
+
62
+ $url_google = "http://www.google.com/webmasters/tools/ping?sitemap=".$base_url;
63
+ $string = $this->get_web_page($url_google);
64
+ $DOM = new DOMDocument;
65
+ $DOM->loadHTML($string);
66
+
67
+ $items = $DOM->getElementsByTagName('body');
68
+ $array = array();
69
+ for ($i = 0; $i < $items->length; $i++)
70
+ $array = $items->item($i)->nodeValue ;
71
+ $google_response = substr($array,'0',105);
72
+
73
+
74
+ }
75
+
76
+
77
+ if($yahoo=='yes')
78
+ {
79
+
80
+ $url_yahoo = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$base_url;
81
+ $yahoo_response = $this->get_web_page($url_yahoo);
82
+
83
+ }
84
+
85
+
86
+ if($bing=='yes')
87
+ {
88
+
89
+ $url_bing = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$base_url;
90
+ $bing_response = $this->get_web_page($url_bing);
91
+
92
+ }
93
+
94
+ if($window=='yes')
95
+ {
96
+
97
+ $url_window = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$base_url;
98
+ $window_response = $this->get_web_page($url_window);
99
+
100
+ }
101
+
102
+
103
+
104
+ }
105
+
106
+
107
+
108
+
109
+
110
+
111
+ if($google=='yes' || $yahoo=='yes' || $bing=='yes' )
112
+ {
113
+
114
+ $date = date('Y-m-d h:i:s a', time());
115
+ $showresponse = Mage::getModel('showresponse/showresponse');
116
+ $showresponse->insertdata($google_response, $bing_response, $window_response, $yahoo_response, $date);
117
+
118
+ }
119
+
120
+
121
+ }
122
+
123
+
124
+
125
+ function get_web_page( $url )
126
+ {
127
+ $options = array(
128
+ CURLOPT_RETURNTRANSFER => true, // return web page
129
+ CURLOPT_HEADER => false, // don't return headers
130
+ CURLOPT_FOLLOWLOCATION => true, // follow redirects
131
+ CURLOPT_ENCODING => "", // handle all encodings
132
+ CURLOPT_AUTOREFERER => true, // set referer on redirect
133
+ CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
134
+ CURLOPT_TIMEOUT => 120, // timeout on response
135
+ CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
136
+ );
137
+
138
+ $ch = curl_init( $url );
139
+ curl_setopt_array( $ch, $options );
140
+ $content = curl_exec( $ch );
141
+ $err = curl_errno( $ch );
142
+ $errmsg = curl_error( $ch );
143
+ $header = curl_getinfo( $ch );
144
+ curl_close( $ch );
145
+ $header['errno'] = $err;
146
+ $header['errmsg'] = $errmsg;
147
+ $header['content'] = $content;
148
+ return $content;
149
+ }
150
+
151
+
152
+
153
+
154
+ public function get_url()
155
+ {
156
+ $string = Mage::getBaseURL();
157
+ $string1 = str_replace("index.php/","", $string);
158
+ $string2 = str_replace('/','%2F',$string1);
159
+ $string3 = str_replace(':','%3A',$string2);
160
+ return $string3;
161
+
162
+ }
163
+ }
app/code/local/Raveinfosys/Showmap/Model/Status.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Model_Status extends Varien_Object
4
+ {
5
+ const STATUS_ENABLED = 1;
6
+ const STATUS_DISABLED = 2;
7
+
8
+ static public function getOptionArray()
9
+ {
10
+ return array(
11
+ self::STATUS_ENABLED => Mage::helper('showmap')->__('Enabled'),
12
+ self::STATUS_DISABLED => Mage::helper('showmap')->__('Disabled')
13
+ );
14
+ }
15
+ }
app/code/local/Raveinfosys/Showmap/controllers/Adminhtml/ShowmapController.php ADDED
@@ -0,0 +1,334 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showmap_Adminhtml_ShowmapController extends Mage_Adminhtml_Controller_action
4
+ {
5
+
6
+ public function indexAction()
7
+ {
8
+
9
+ $config = Mage::getModel('showmap/config');
10
+ $row = $config->getRow();
11
+ if($row['configured'] == 0)$this->_redirect('*/*/config');
12
+ $content = file_get_contents('sitemap/sitemap.xml');
13
+ $content = str_replace('</urlset>','',$content);
14
+ $content .= '<?xml version="1.0" encoding="utf-8"?><urlset>';
15
+ $count = 0;
16
+ if($row['category'] == 'yes')
17
+ {
18
+ $cats = Mage::getModel('catalog/category')->load(2)->getChildren();
19
+ $catIds = explode(',',$cats);
20
+ Mage::register('catIds', $catIds);
21
+ foreach($catIds as $catId)
22
+ {
23
+ if($catId !='')
24
+ {
25
+ $category = Mage::getModel('catalog/category')->load($catId);
26
+ $subCats = Mage::getModel('catalog/category')->load($category->getId())->getChildren();
27
+ $subCatIds = explode(',',$subCats);
28
+ $url=$category->getUrl();
29
+ if(strpos($content,$url) === false)
30
+ {
31
+ $content .= '<url><loc>'.$url.'</loc>';
32
+ $content .= '<lastmod>'.date('Y-m-d').'</lastmod>';
33
+ $content .= '<changefreq>daily</changefreq>';
34
+ $content .= '<priority>0.50</priority>';
35
+ $content .= '</url>';
36
+ $count++;
37
+ }
38
+ if(count($subCatIds) > 1)
39
+ {
40
+ foreach($subCatIds as $subCat)
41
+ {
42
+ $subCategory = Mage::getModel('catalog/category')->load($subCat);
43
+ $url=$subCategory->getUrl();
44
+ if(strpos($content,$url) === false)
45
+ {
46
+ $content .= '<url><loc>'.$url.'</loc>';
47
+ $content .= '<lastmod>'.date('Y-m-d').'</lastmod>';
48
+ $content .= '<changefreq>daily</changefreq>';
49
+ $content .= '<priority>0.50</priority>';
50
+ $content .= '</url>';
51
+ $count++;
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+
59
+ if($row['product'] == 'yes')
60
+ {
61
+ $product = Mage::getModel('catalog/product');
62
+ $products = $product->getCollection()->addStoreFilter($storeId)->getData();
63
+ Mage::register('products', $products);
64
+ foreach ($products as $pro)
65
+ {
66
+
67
+ $Stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($pro['entity_id'])->getIsinStock();
68
+ if($Stock)
69
+ {
70
+ $_product = $product->load($pro['entity_id']);
71
+ $url=Mage::getUrl().$_product->getUrlPath();
72
+ if(strpos($content,$url) === false && $_product->getStatus()!=2)
73
+ {
74
+ $content .= '<url><loc>'.$url.'</loc>';
75
+ $content .= '<lastmod>'.date('Y-m-d').'</lastmod>';
76
+ $content .= '<changefreq>daily</changefreq>';
77
+ $content .= '<priority>0.50</priority>';
78
+ $content .= '</url>';
79
+ $count++;
80
+ }
81
+ }
82
+ }
83
+ }
84
+
85
+ if($row['cms'] == 'yes')
86
+ {
87
+ $collection = Mage::getModel('cms/page')->getCollection()->addStoreFilter(Mage::app()->getStore()->getId());
88
+ $collection->getSelect()
89
+ ->where('is_active = 1');
90
+ Mage::register('collection', $collection);
91
+ foreach (Mage::registry('collection') as $page)
92
+ {
93
+ $PageData = $page->getData();
94
+ if($PageData['identifier']!='no-route' && $PageData['identifier']!='enable-cookies')
95
+ {
96
+ $url = Mage::getUrl(). $PageData['identifier'];
97
+ if(strpos($content,$url) === false)
98
+ {
99
+ $content .= '<url><loc>'.$url.'</loc>';
100
+ $content .= '<lastmod>'.date('Y-m-d').'</lastmod>';
101
+ $content .= '<changefreq>daily</changefreq>';
102
+ $content .= '<priority>0.50</priority>';
103
+ $content .= '</url>';
104
+ $count++;
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ $content .= '</urlset>';
111
+ $url_dir = Mage::getBaseDir()."/sitemap.xml";
112
+ $file_handle = fopen($url_dir,'w');
113
+ fwrite($file_handle,$content);
114
+ fclose($file_handle);
115
+
116
+ $this->_forward('edit');
117
+
118
+ }
119
+
120
+ public function editAction()
121
+ {
122
+
123
+
124
+ $this->loadLayout();
125
+ $this->_setActiveMenu('showmap/items');
126
+
127
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
128
+
129
+ $this->_addContent($this->getLayout()->createBlock('showmap/adminhtml_showmap_edit'))
130
+ ->_addLeft($this->getLayout()->createBlock('showmap/adminhtml_showmap_edit_tabs'));
131
+
132
+ $this->renderLayout();
133
+
134
+ }
135
+
136
+
137
+ public function saveAction()
138
+ {
139
+
140
+
141
+ if ($data = $this->getRequest()->getPost())
142
+ {
143
+ $google='no';$yahoo='no';$bing='no';$window='no';
144
+ $google_response = 'Not Configured';
145
+ $yahoo_response = 'Not Configured';
146
+ $bing_response = 'Not Configured';
147
+ $window_response = 'Not Configured';
148
+ $ping_interval=$this->getRequest()->getPost('ping_interval');
149
+ $format=$this->getRequest()->getPost('format');
150
+ $ch_google=$this->getRequest()->getPost('google');
151
+ $ch_bing=$this->getRequest()->getPost('bing');
152
+ $ch_window=$this->getRequest()->getPost('window');
153
+ $ch_yahoo=$this->getRequest()->getPost('yahoo');
154
+ $yahoo_appid=$this->getRequest()->getPost('yahoo_appid');
155
+ $base_url = $this->get_url()."sitemap.xml";
156
+ $isCurl = function_exists(curl_init);
157
+ if($isCurl)
158
+ {
159
+
160
+ if($ch_google=='google')
161
+ {
162
+ $google='yes';
163
+ $url_google = "http://www.google.com/webmasters/tools/ping?sitemap=".$base_url;
164
+ $string = $this->get_web_page($url_google);
165
+ $DOM = new DOMDocument;
166
+ $DOM->loadHTML($string);
167
+
168
+ $items = $DOM->getElementsByTagName('body');
169
+ $array = array();
170
+ for ($i = 0; $i < $items->length; $i++)
171
+ $array = $items->item($i)->nodeValue ;
172
+ $google_response = substr($array,'0',105);
173
+
174
+
175
+ }
176
+
177
+
178
+ if($ch_yahoo=='yahoo' && $yahoo_appid!='')
179
+ {
180
+ $yahoo='yes';
181
+ $url_yahoo = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$base_url;
182
+ $yahoo_response = $this->get_web_page($url_yahoo);
183
+
184
+ }
185
+
186
+
187
+ if($ch_bing=='bing')
188
+ {
189
+ $bing='yes';
190
+ $url_bing = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$base_url;
191
+ $bing_response = $this->get_web_page($url_bing);
192
+
193
+
194
+ }
195
+
196
+
197
+ if($ch_window=='window')
198
+ {
199
+ $window='yes';
200
+ $url_window = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$base_url;
201
+ $window_response = $this->get_web_page($url_window);
202
+
203
+ }
204
+
205
+
206
+
207
+ }
208
+
209
+
210
+
211
+ if($google=='yes' || $yahoo=='yes' || $bing=='yes' || $window=='yes')
212
+ {
213
+ $date = date('Y-m-d h:i:s a', time());
214
+ $showmap = Mage::getModel('showmap/showmap');
215
+ $showmap->insertdata($ping_interval,$format,$google,$bing,$window,$yahoo,$yahoo_appid);
216
+ $this->xml();
217
+
218
+ $showresponse = Mage::getModel('showresponse/showresponse');
219
+ $showresponse->insertdata($google_response, $bing_response, $window_response, $yahoo_response, $date);
220
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('showmap')->__('sitemap was successfully submitted'));
221
+ if($ch_yahoo=='yahoo' && $yahoo_appid=='' )
222
+ {
223
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('showmap')->__('Please enter yahoo app id for submitting on yahoo'));
224
+ }
225
+ }
226
+ else
227
+ if($ch_yahoo=='yahoo')
228
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('showmap')->__('Please enter yahoo app id'));
229
+ else
230
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('showmap')->__('Please choose at least 1 channel'));
231
+
232
+
233
+
234
+
235
+ }
236
+ $this->_redirect('*/*/');
237
+ }
238
+
239
+
240
+ public function configAction()
241
+ {
242
+
243
+ $this->loadLayout();
244
+ $this->_setActiveMenu('showmap/items');
245
+
246
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
247
+
248
+ $this->_addContent($this->getLayout()->createBlock('showmap/adminhtml_showmap_config'))
249
+ ->_addLeft($this->getLayout()->createBlock('showmap/adminhtml_showmap_edit_config'));
250
+
251
+
252
+ if ($data = $this->getRequest()->getPost())
253
+ {
254
+
255
+ //$store = $this->getRequest()->getPost('store');
256
+ $category = $this->getRequest()->getPost('category');
257
+ $product = $this->getRequest()->getPost('product');
258
+ $cms = $this->getRequest()->getPost('cms');
259
+ $other = $this->getRequest()->getPost('other');
260
+ $config = Mage::getModel('showmap/config');
261
+ $config->insertdata($category,$product,$cms,$other);
262
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('showmap')->__('Sitemap was successfully configured'));
263
+ $this->_redirect('*/*/config');
264
+
265
+ }
266
+
267
+ $this->renderLayout();
268
+
269
+ }
270
+
271
+
272
+
273
+ function get_web_page( $url )
274
+ {
275
+ $options = array(
276
+ CURLOPT_RETURNTRANSFER => true, // return web page
277
+ CURLOPT_HEADER => false, // don't return headers
278
+ CURLOPT_FOLLOWLOCATION => true, // follow redirects
279
+ CURLOPT_ENCODING => "", // handle all encodings
280
+ CURLOPT_AUTOREFERER => true, // set referer on redirect
281
+ CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
282
+ CURLOPT_TIMEOUT => 120, // timeout on response
283
+ CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
284
+ );
285
+
286
+ $ch = curl_init( $url );
287
+ curl_setopt_array( $ch, $options );
288
+ $content = curl_exec( $ch );
289
+ $err = curl_errno( $ch );
290
+ $errmsg = curl_error( $ch );
291
+ $header = curl_getinfo( $ch );
292
+ curl_close( $ch );
293
+ $header['errno'] = $err;
294
+ $header['errmsg'] = $errmsg;
295
+ $header['content'] = $content;
296
+ return $content;
297
+ }
298
+
299
+
300
+
301
+ public function get_url()
302
+ {
303
+ $string = Mage::getBaseURL();
304
+ $string1 = str_replace("index.php/","", $string);
305
+ $string2 = str_replace('/','%2F',$string1);
306
+ $string3 = str_replace(':','%3A',$string2);
307
+ return $string3;
308
+
309
+ }
310
+
311
+
312
+ public function xml()
313
+ {
314
+
315
+ $obj = Mage::getModel('showmap/showmap');
316
+ $showmap = $obj->getRow();
317
+ if($showmap['format'] == 'days')
318
+ {
319
+ $ping_interval = $showmap['ping_interval'];
320
+ $cron = '0 0 */'.$ping_interval.' * *';
321
+ }
322
+ if($showmap['format'] == 'hours')
323
+ {
324
+ $ping_interval = $showmap['ping_interval'];
325
+ $cron = '0 */'.$ping_interval.' * * *';
326
+ }
327
+ $url = Mage::getBaseDir()."/app/code/local/Raveinfosys/Showmap/etc/config.xml";
328
+ $endreXML = simplexml_load_file($url);
329
+ $endreXML->crontab[0]->jobs[0]->Raveinfosys_Showmap[0]->schedule[0]->cron_expr = $cron;
330
+ file_put_contents($url, $endreXML->asXML());
331
+
332
+ }
333
+
334
+ }
app/code/local/Raveinfosys/Showmap/controllers/IndexController.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Raveinfosys_Showmap_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+
7
+ $this->loadLayout();
8
+
9
+ $cats = Mage::getModel('catalog/category')->load(2)->getChildren();
10
+ $catIds = explode(',',$cats);
11
+ Mage::register('catIds', $catIds);
12
+
13
+ $product = Mage::getModel('catalog/product');
14
+ $products = $product->getCollection()->addStoreFilter($storeId)->getData();
15
+ Mage::register('products', $products);
16
+
17
+ $collection = Mage::getModel('cms/page')->getCollection()->addStoreFilter(Mage::app()->getStore()->getId());
18
+ $collection->getSelect()
19
+ ->where('is_active = 1');
20
+ Mage::register('collection', $collection);
21
+
22
+ $this->renderLayout();
23
+
24
+ }
25
+ }
app/code/local/Raveinfosys/Showmap/etc/config.xml ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Raveinfosys_Showmap>
5
+ <version>0.1.0</version>
6
+ </Raveinfosys_Showmap>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <showmap>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Raveinfosys_Showmap</module>
14
+ <frontName>showmap</frontName>
15
+ </args>
16
+ </showmap>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <showmap>
21
+ <file>showmap.xml</file>
22
+ </showmap>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <showmap>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Raveinfosys_Showmap</module>
32
+ <frontName>showmap</frontName>
33
+ </args>
34
+ </showmap>
35
+ </routers>
36
+ </admin>
37
+ <adminhtml>
38
+ <menu>
39
+ <showmap module="showmap">
40
+ <title>Sitemap</title>
41
+ <sort_order>71</sort_order>
42
+ <children>
43
+ <sitemap_submission translate="title" module="showmap">
44
+ <title>Sitemap Submission</title>
45
+ <action>showmap/adminhtml_showmap</action>
46
+ <sort_order>0</sort_order>
47
+ </sitemap_submission>
48
+ <frontend_configuration translate="title" module="showmap">
49
+ <title>Configuration</title>
50
+ <action>showmap/adminhtml_showmap/config</action>
51
+ <sort_order>10</sort_order>
52
+ </frontend_configuration>
53
+ <view_response translate="title" module="showmap">
54
+ <title>View Response</title>
55
+ <action>showresponse/adminhtml_showresponse/index</action>
56
+ <sort_order>100</sort_order>
57
+ </view_response>
58
+ </children>
59
+
60
+ </showmap>
61
+ </menu>
62
+ <acl>
63
+ <resources>
64
+ <all>
65
+ <title>Allow Everything</title>
66
+ </all>
67
+ <admin>
68
+ <children>
69
+ <Raveinfosys_Showmap>
70
+ <title>Showmap Module</title>
71
+ <sort_order>10</sort_order>
72
+ </Raveinfosys_Showmap>
73
+ </children>
74
+ </admin>
75
+ </resources>
76
+ </acl>
77
+ <layout>
78
+ <updates>
79
+ <showmap>
80
+ <file>showmap.xml</file>
81
+ </showmap>
82
+ </updates>
83
+ </layout>
84
+ </adminhtml>
85
+ <global>
86
+ <models>
87
+ <showmap>
88
+ <class>Raveinfosys_Showmap_Model</class>
89
+ <resourceModel>showmap_mysql4</resourceModel>
90
+ </showmap>
91
+
92
+ <showmap_mysql4>
93
+ <class>Raveinfosys_Showmap_Model_Mysql4</class>
94
+ <entities>
95
+ <showmap>
96
+ <table>showmap</table>
97
+ </showmap>
98
+ <config>
99
+ <table>showmap_config</table>
100
+ </config>
101
+ </entities>
102
+ </showmap_mysql4>
103
+
104
+ </models>
105
+ <resources>
106
+ <showmap_setup>
107
+ <setup>
108
+ <module>Raveinfosys_Showmap</module>
109
+ </setup>
110
+ <connection>
111
+ <use>core_setup</use>
112
+ </connection>
113
+ </showmap_setup>
114
+ <showmap_write>
115
+ <connection>
116
+ <use>core_write</use>
117
+ </connection>
118
+ </showmap_write>
119
+ <showmap_read>
120
+ <connection>
121
+ <use>core_read</use>
122
+ </connection>
123
+ </showmap_read>
124
+ </resources>
125
+ <blocks>
126
+ <showmap>
127
+ <class>Raveinfosys_Showmap_Block</class>
128
+ </showmap>
129
+ </blocks>
130
+ <helpers>
131
+ <showmap>
132
+ <class>Raveinfosys_Showmap_Helper</class>
133
+ </showmap>
134
+ </helpers>
135
+ </global>
136
+
137
+ <crontab>
138
+ <jobs>
139
+ <Raveinfosys_Showmap>
140
+ <schedule>
141
+ <cron_expr>0 */2 * * *</cron_expr>
142
+ </schedule>
143
+ <run>
144
+ <model>showmap/showmap::update</model>
145
+ </run>
146
+ </Raveinfosys_Showmap>
147
+ </jobs>
148
+ </crontab>
149
+
150
+ </config>
app/code/local/Raveinfosys/Showmap/sql/showmap_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
7
+
8
+ $installer->run("
9
+
10
+ -- DROP TABLE IF EXISTS {$this->getTable('showmap')};
11
+ CREATE TABLE {$this->getTable('showmap')} (
12
+ `showmap_id` int(11) NOT NULL auto_increment,
13
+ `ping_interval` int(12),
14
+ `format` varchar(20),
15
+ `google` varchar(20),
16
+ `bing` varchar(20),
17
+ `window` varchar(20),
18
+ `yahoo` varchar(20),
19
+ `yahoo_id` varchar(20),
20
+ `internal_company_id` varchar(80) NOT NULL default '',
21
+ PRIMARY KEY (`showmap_id`)
22
+ )ENGINE=InnoDB DEFAULT CHARSET=utf8;
23
+
24
+
25
+
26
+ -- DROP TABLE IF EXISTS {$this->getTable('showmap_config')};
27
+ CREATE TABLE {$this->getTable('showmap_config')} (
28
+ `id` int(11) NOT NULL auto_increment,
29
+ `product` varchar(20),
30
+ `category` varchar(20),
31
+ `cms` varchar(20),
32
+ `other` varchar(20),
33
+ `configured` int(2) NOT NULL DEFAULT 0,
34
+ PRIMARY KEY (`id`)
35
+ )ENGINE=InnoDB DEFAULT CHARSET=utf8;
36
+ ");
37
+
38
+ $installer->endSetup();
app/code/local/Raveinfosys/Showresponse/Block/Adminhtml/Showresponse.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Raveinfosys_Showresponse_Block_Adminhtml_Showresponse extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_showresponse';
7
+ $this->_blockGroup = 'showresponse';
8
+ $this->_headerText = Mage::helper('showresponse')->__('View Responses');
9
+ $this->_addButtonLabel = Mage::helper('showresponse')->__('Refresh');
10
+ parent::__construct();
11
+ }
12
+ }
app/code/local/Raveinfosys/Showresponse/Block/Adminhtml/Showresponse/Grid.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showresponse_Block_Adminhtml_Showresponse_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('showresponseGrid');
9
+ $this->setDefaultSort('showresponse_id');
10
+ $this->setDefaultDir('ASC');
11
+ $this->setSaveParametersInSession(true);
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('showresponse/showresponse')->getCollection();
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn('showresponse_id', array(
24
+ 'header' => Mage::helper('showresponse')->__('ID'),
25
+ 'align' =>'right',
26
+ 'width' => '10px',
27
+ 'index' => 'showresponse_id',
28
+ ));
29
+
30
+ $this->addColumn('google_response', array(
31
+ 'header' => Mage::helper('showresponse')->__('Google Response'),
32
+ 'align' =>'left',
33
+ 'index' => 'google_response',
34
+ ));
35
+
36
+ $this->addColumn('yahoo_response', array(
37
+ 'header' => Mage::helper('showresponse')->__('Yahoo Response'),
38
+ 'align' =>'left',
39
+ 'index' => 'yahoo_response',
40
+ ));
41
+
42
+ $this->addColumn('bing_response', array(
43
+ 'header' => Mage::helper('showresponse')->__('Bing Response'),
44
+ 'align' =>'left',
45
+ 'index' => 'bing_response',
46
+ ));
47
+
48
+ $this->addColumn('window_response', array(
49
+ 'header' => Mage::helper('showresponse')->__('Window Live Response'),
50
+ 'align' =>'left',
51
+ 'index' => 'window_response',
52
+ ));
53
+
54
+ $this->addColumn('date', array(
55
+ 'header' => Mage::helper('showresponse')->__('Date'),
56
+ 'align' =>'left',
57
+ 'index' => 'date',
58
+ ));
59
+
60
+
61
+
62
+ return parent::_prepareColumns();
63
+ }
64
+
65
+ protected function _prepareMassaction()
66
+ {
67
+ $this->setMassactionIdField('showresponse_id');
68
+ $this->getMassactionBlock()->setFormFieldName('showresponse');
69
+
70
+ $this->getMassactionBlock()->addItem('delete', array(
71
+ 'label' => Mage::helper('showresponse')->__('Delete'),
72
+ 'url' => $this->getUrl('*/*/massDelete'),
73
+ 'confirm' => Mage::helper('showresponse')->__('Are you sure?')
74
+ ));
75
+
76
+
77
+ return $this;
78
+ }
79
+
80
+ public function getRowUrl($row)
81
+ {
82
+ // return $this->getUrl('*/*/edit', array('id' => $row->getId()));
83
+ }
84
+
85
+
86
+ }
app/code/local/Raveinfosys/Showresponse/Block/Showresponse.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Raveinfosys_Showresponse_Block_Showresponse extends Mage_Core_Block_Template
3
+ {
4
+ public function _prepareLayout()
5
+ {
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ public function getShowresponse()
10
+ {
11
+ if (!$this->hasData('showresponse')) {
12
+ $this->setData('showresponse', Mage::registry('showresponse'));
13
+ }
14
+ return $this->getData('showresponse');
15
+
16
+ }
17
+ }
app/code/local/Raveinfosys/Showresponse/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showresponse_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/Raveinfosys/Showresponse/Model/Mysql4/Showresponse.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showresponse_Model_Mysql4_Showresponse extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the showresponse_id refers to the key field in your database table.
8
+ $this->_init('showresponse/showresponse', 'showresponse_id');
9
+ }
10
+ }
app/code/local/Raveinfosys/Showresponse/Model/Mysql4/Showresponse/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showresponse_Model_Mysql4_Showresponse_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('showresponse/showresponse');
9
+ }
10
+ }
app/code/local/Raveinfosys/Showresponse/Model/Showresponse.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showresponse_Model_Showresponse extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('showresponse/showresponse');
9
+ }
10
+
11
+ public function insertdata($google_response, $bing_response, $window_response, $yahoo_response, $date)
12
+ {
13
+
14
+ $resource = Mage::getSingleton('core/resource');
15
+ $writeConnection = $resource->getConnection('core_write');
16
+ $tableName = $resource->getTableName('showresponse/showresponse');
17
+ $query_showmap_response = "INSERT INTO $tableName (`google_response`,`bing_response` ,`window_response`, `yahoo_response`,`date`) VALUES ('$google_response', '$bing_response', '$window_response', '$yahoo_response', '$date')";
18
+
19
+ $writeConnection->query($query_showmap_response);
20
+
21
+ }
22
+
23
+ public function getRow()
24
+ {
25
+
26
+ $resource = Mage::getSingleton('core/resource');
27
+ $readconnection = $resource->getConnection('core_read');
28
+ $tableName = $resource->getTableName('showmap/showmap');
29
+ $sql = "select * from $tableName
30
+ where id=(select max(id) from $tableName)";
31
+ $row = $readconnection->fetchRow($sql);
32
+ return $row;
33
+
34
+ }
35
+ }
app/code/local/Raveinfosys/Showresponse/Model/Status.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showresponse_Model_Status extends Varien_Object
4
+ {
5
+ const STATUS_ENABLED = 1;
6
+ const STATUS_DISABLED = 2;
7
+
8
+ static public function getOptionArray()
9
+ {
10
+ return array(
11
+ self::STATUS_ENABLED => Mage::helper('showresponse')->__('Enabled'),
12
+ self::STATUS_DISABLED => Mage::helper('showresponse')->__('Disabled')
13
+ );
14
+ }
15
+ }
app/code/local/Raveinfosys/Showresponse/controllers/Adminhtml/ShowresponseController.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Showresponse_Adminhtml_ShowresponseController extends Mage_Adminhtml_Controller_action
4
+ {
5
+
6
+ protected function _initAction()
7
+ {
8
+ $this->loadLayout()
9
+ ->_setActiveMenu('showmap/items');
10
+
11
+ return $this;
12
+ }
13
+
14
+ public function indexAction()
15
+ {
16
+
17
+ $config = Mage::getModel('showmap/config');
18
+ $row = $config->getRow();
19
+ if($row['configured'] == 0)$this->_redirect('showmap/adminhtml_showmap/config');
20
+ $this->_initAction()
21
+ ->renderLayout();
22
+ }
23
+
24
+ public function editAction()
25
+ {
26
+
27
+ $this->_redirect('*/*/');
28
+
29
+ }
30
+
31
+ public function newAction()
32
+ {
33
+
34
+ $this->_forward('edit');
35
+
36
+ }
37
+
38
+
39
+ public function deleteAction()
40
+ {
41
+ if( $this->getRequest()->getParam('id') > 0 )
42
+ {
43
+ try
44
+ {
45
+ $model = Mage::getModel('showresponse/showresponse');
46
+
47
+ $model->setId($this->getRequest()->getParam('id'))
48
+ ->delete();
49
+
50
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
51
+ $this->_redirect('*/*/');
52
+ } catch (Exception $e) {
53
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
54
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
55
+ }
56
+ }
57
+ $this->_redirect('*/*/');
58
+ }
59
+
60
+ public function massDeleteAction()
61
+ {
62
+ $showresponseIds = $this->getRequest()->getParam('showresponse');
63
+ if(!is_array($showresponseIds))
64
+ {
65
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
66
+ }
67
+ else
68
+ {
69
+ try
70
+ {
71
+ foreach ($showresponseIds as $showresponseId)
72
+ {
73
+ $showresponse = Mage::getModel('showresponse/showresponse')->load($showresponseId);
74
+ $showresponse->delete();
75
+ }
76
+ Mage::getSingleton('adminhtml/session')->addSuccess(
77
+ Mage::helper('adminhtml')->__(
78
+ 'Total of %d record(s) were successfully deleted', count($showresponseIds)
79
+ )
80
+ );
81
+ }
82
+ catch (Exception $e)
83
+ {
84
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
85
+ }
86
+ }
87
+ $this->_redirect('*/*/index');
88
+ }
89
+ }
app/code/local/Raveinfosys/Showresponse/etc/config.xml ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Raveinfosys_Showresponse>
5
+ <version>0.1.0</version>
6
+ </Raveinfosys_Showresponse>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <showresponse>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Raveinfosys_Showresponse</module>
14
+ <frontName>showresponse</frontName>
15
+ </args>
16
+ </showresponse>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <showresponse>
21
+ <file>showresponse.xml</file>
22
+ </showresponse>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <showresponse>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Raveinfosys_Showresponse</module>
32
+ <frontName>showresponse</frontName>
33
+ </args>
34
+ </showresponse>
35
+ </routers>
36
+ </admin>
37
+ <adminhtml>
38
+
39
+ <acl>
40
+ <resources>
41
+ <all>
42
+ <title>Allow Everything</title>
43
+ </all>
44
+ <admin>
45
+ <children>
46
+ <Raveinfosys_Showresponse>
47
+ <title>Showresponse Module</title>
48
+ <sort_order>10</sort_order>
49
+ </Raveinfosys_Showresponse>
50
+ </children>
51
+ </admin>
52
+ </resources>
53
+ </acl>
54
+ <layout>
55
+ <updates>
56
+ <showresponse>
57
+ <file>showresponse.xml</file>
58
+ </showresponse>
59
+ </updates>
60
+ </layout>
61
+ </adminhtml>
62
+ <global>
63
+ <models>
64
+ <showresponse>
65
+ <class>Raveinfosys_Showresponse_Model</class>
66
+ <resourceModel>showresponse_mysql4</resourceModel>
67
+ </showresponse>
68
+ <showresponse_mysql4>
69
+ <class>Raveinfosys_Showresponse_Model_Mysql4</class>
70
+ <entities>
71
+ <showresponse>
72
+ <table>showresponse</table>
73
+ </showresponse>
74
+ </entities>
75
+ </showresponse_mysql4>
76
+ </models>
77
+ <resources>
78
+ <showresponse_setup>
79
+ <setup>
80
+ <module>Raveinfosys_Showresponse</module>
81
+ </setup>
82
+ <connection>
83
+ <use>core_setup</use>
84
+ </connection>
85
+ </showresponse_setup>
86
+ <showresponse_write>
87
+ <connection>
88
+ <use>core_write</use>
89
+ </connection>
90
+ </showresponse_write>
91
+ <showresponse_read>
92
+ <connection>
93
+ <use>core_read</use>
94
+ </connection>
95
+ </showresponse_read>
96
+ </resources>
97
+ <blocks>
98
+ <showresponse>
99
+ <class>Raveinfosys_Showresponse_Block</class>
100
+ </showresponse>
101
+ </blocks>
102
+ <helpers>
103
+ <showresponse>
104
+ <class>Raveinfosys_Showresponse_Helper</class>
105
+ </showresponse>
106
+ </helpers>
107
+ </global>
108
+ </config>
app/code/local/Raveinfosys/Showresponse/sql/showresponse_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ -- DROP TABLE IF EXISTS {$this->getTable('showresponse')};
10
+ CREATE TABLE {$this->getTable('showresponse')} (
11
+ `showresponse_id` int(11) NOT NULL auto_increment,
12
+ `google_response` text,
13
+ `yahoo_response` text,
14
+ `bing_response` text,
15
+ `window_response` text,
16
+ `date` timestamp,
17
+ `internal_company_id` varchar(80) NOT NULL default '',
18
+ PRIMARY KEY (`showresponse_id`)
19
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
+ ");
21
+
22
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/showmap.xml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <showmap_adminhtml_showmap_index>
4
+ <reference name="content">
5
+ <block type="showmap/adminhtml_showmap" name="showmap" />
6
+ </reference>
7
+ </showmap_adminhtml_showmap_index>
8
+
9
+ <showmap_adminhtml_showmap_config>
10
+ <reference name="content">
11
+ <block type="showmap/adminhtml_showmap_edit_tab_config" name="showmap_config"/>
12
+ </reference>
13
+ </showmap_adminhtml_showmap_config>
14
+ </layout>
app/design/adminhtml/default/default/layout/showresponse.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <showresponse_adminhtml_showresponse_index>
4
+ <reference name="content">
5
+ <block type="showresponse/adminhtml_showresponse" name="showresponse" />
6
+ </reference>
7
+ </showresponse_adminhtml_showresponse_index>
8
+ </layout>
app/design/frontend/default/default/layout/showmap.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ </default>
5
+ <showmap_index_index>
6
+ <reference name="content">
7
+ <block type="showmap/showmap" name="showmap" template="showmap/showmap.phtml" />
8
+ </reference>
9
+ </showmap_index_index>
10
+ </layout>
app/design/frontend/default/default/template/showmap/showmap.phtml ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h4><?php echo $this->__('Sitemap') ?></h4>
2
+
3
+ <?php
4
+ $config = Mage::getModel('showmap/config');
5
+ $row = $config->getRow();
6
+ ?>
7
+ <?php if($row['category'] == 'yes') {?>
8
+ <div class="block block-reviews">
9
+ <div class="block-title">
10
+ <strong><span>Categories</span></strong>
11
+ </div>
12
+ <div class="block-content">
13
+ <ul>
14
+ <?php foreach(Mage::registry('catIds') as $catId): ?>
15
+ <li>
16
+ <?php $category = Mage::getModel('catalog/category')->load($catId);?>
17
+ <a href="<?php echo $category->getUrl();?>" style="font:bold;font-size:13px;"><?php echo $category->getName();?></a>
18
+ <?php
19
+ $subCats = Mage::getModel('catalog/category')->load($category->getId())->getChildren();
20
+ $subCatIds = explode(',',$subCats);
21
+ ?>
22
+ <?php if(count($subCatIds) > 1):?>
23
+ <ul>
24
+ <?php foreach($subCatIds as $subCat) :?>
25
+ <li>
26
+ <?php $subCategory = Mage::getModel('catalog/category')->load($subCat);?>
27
+ <a href="<?php echo $subCategory->getUrl();?>" style="font:bold;font-size:11px;"><?php echo $subCategory->getName();?></a>
28
+ </li>
29
+ <?php endforeach;?>
30
+ </ul>
31
+ <?php endif; ?>
32
+ </li>
33
+ <?php endforeach; ?>
34
+ </ul>
35
+ </div>
36
+ </div>
37
+ <?php }?>
38
+
39
+
40
+
41
+
42
+ <?php if($row['product'] == 'yes') {?>
43
+ <div class="block block-reviews">
44
+ <div class="block-title">
45
+ <strong><span>Products</span></strong>
46
+ </div>
47
+ <div class="block-content"><ul>
48
+ <?php $storeId = Mage::app()->getStore()->getId();
49
+ $product = Mage::getModel('catalog/product');
50
+ foreach (Mage::registry('products') as $pro) //loop for getting products
51
+ {
52
+ $Stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($pro['entity_id'])->getIsinStock();
53
+ if($Stock)
54
+ {
55
+ $_product = $product->load($pro['entity_id']);?>
56
+ <?php if($_product->getStatus() != 2){?>
57
+ <li><a href="<?php echo $_product->getUrlPath()?>" style="font:bold;font-size:13px;"><?php echo $_product->getName();}?></a></li>
58
+ <?php }?>
59
+ <?php }?>
60
+ </ul>
61
+ </div>
62
+ </div>
63
+
64
+ <?php }?>
65
+
66
+
67
+
68
+
69
+
70
+ <?php if($row['cms'] == 'yes') {?>
71
+ <div class="block block-reviews">
72
+ <div class="block-title">
73
+ <strong><span>CMS</span></strong>
74
+ </div>
75
+ <ul>
76
+ <?php foreach (Mage::registry('collection') as $page): ?>
77
+ <?php $PageData = $page->getData(); ?>
78
+ <?php if($PageData['identifier']!='no-route' && $PageData['identifier']!='enable-cookies') { ?>
79
+ <li>
80
+ <a href="<?php echo $PageData['identifier']?>" style="font:bold;font-size:13px;"><?php echo $PageData['title'] ?></a>
81
+ </li>
82
+ <?php } ?>
83
+ <?php endforeach; ?>
84
+ </div>
85
+ <?php }?>
86
+
87
+
88
+
89
+
90
+ <?php if($row['other'] == 'yes') {?>
91
+ <div class="block block-reviews">
92
+ <div class="block-title">
93
+ <strong><span>Other</span></strong>
94
+ </div>
95
+ <ul>
96
+
97
+ <li><a href="<?php echo Mage::getUrl(). "customer/account";?>" style="font:bold;font-size:13px;">My Account</a></li>
98
+ <li><a href="<?php echo Mage::getUrl(). "wishlist";?>" style="font:bold;font-size:13px;">My Wishlist</a></li>
99
+ <li><a href="<?php echo Mage::getUrl(). "checkout/cart";?>" style="font:bold;font-size:13px;">My Cart</a></li>
100
+ <li><a href="<?php echo Mage::getUrl(). "checkout/";?>" style="font:bold;font-size:13px;">Checkout</a></li>
101
+ <li><a href="<?php echo Mage::getUrl(). "catalogsearch/advanced";?>" style="font:bold;font-size:13px;">Advanced Search</a></li>
102
+ <li><a href="<?php echo Mage::getUrl(). "customer/account";?>" style="font:bold;font-size:13px;">Login</a></li>
103
+
104
+ </div>
105
+ <?php }?>
106
+
107
+
108
+
app/etc/modules/Raveinfosys_Showmap.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Raveinfosys_Showmap>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Raveinfosys_Showmap>
8
+ </modules>
9
+ </config>
app/etc/modules/Raveinfosys_Showresponse.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Raveinfosys_Showresponse>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Raveinfosys_Showresponse>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Raveinfosys_sitemap</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>The Raveinfosys Sitemap Extension generate the sitemap xml file and submit the created xml file on different channel.</summary>
10
+ <description>The Raveinfosys Sitemap Extension generate the sitemap xml file and submit the created xml file on different channel e.g. Google,Yahoo,Bing and Window Live.</description>
11
+ <notes>This is stable version of this extension and has been tested on various version of community editions. </notes>
12
+ <authors><author><name>Rave Infosys</name><user>raveinfo</user><email>lpext@raveinfosys.com</email></author><author><name>Mayank Sharma</name><user>mayank3008</user><email>mynk.sharma@gmail.com</email></author></authors>
13
+ <date>2012-07-19</date>
14
+ <time>12:05:47</time>
15
+ <contents><target name="magelocal"><dir name="Raveinfosys"><dir name="Showmap"><dir name="Block"><dir name="Adminhtml"><dir name="Showmap"><dir name="Edit"><file name="Config.php" hash="5848ce1009d583ae291136c9e870d40a"/><file name="Form.php" hash="fdb5180a209343c38065d5c065ee8ab8"/><dir name="Tab"><file name="Config.php" hash="0cf6da139fb1b909f8e6a4c01b2f4e38"/><file name="Form.php" hash="615bb208231639d841b7bdc7cea221bc"/></dir><file name="Tabs.php" hash="6ad8f280da7ef0e2499f860f8e1411c0"/></dir><file name="Edit.php" hash="400d209cc1160d501c75bb4a6210cbfe"/><file name="Grid.php" hash="846d1bf93299528ab77c649abfc57f58"/></dir><file name="Showmap.php" hash="f607b56084d16443341e6d23a17e9e08"/></dir><file name="Showmap.php" hash="7f7ae3444b772a774a70d652efed707b"/></dir><dir name="Helper"><file name="Data.php" hash="613c2b028f0fbf350044ffc58522923a"/></dir><dir name="Model"><file name="Config.php" hash="e3bb4a117a10e2c356df894fe01f314f"/><dir name="Mysql4"><file name="Config.php" hash="b91f0b0b2b62a562455c0a34901887cc"/><dir name="Showmap"><file name="Collection.php" hash="306a934b96d01954787c66e0811deb98"/></dir><file name="Showmap.php" hash="2555336901b5215c23a7ffa63e8eb664"/></dir><file name="Showmap.php" hash="8b73d844b39d00f90cc98f29e4ca5201"/><file name="Status.php" hash="a7fe6bb32beb082d627e93e7b0c8c58a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ShowmapController.php" hash="73eac6fd45edf46bc8546e524cf600f3"/></dir><file name="IndexController.php" hash="f26a62dd658509fb2bb19c5e881ef2e8"/></dir><dir name="etc"><file name="config.xml" hash="9d9baf84f54adcc162960020c235b345"/></dir><dir name="sql"><dir name="showmap_setup"><file name="mysql4-install-0.1.0.php" hash="126a029495b19130b4aa05770e64c5b2"/></dir></dir></dir><dir name="Showresponse"><dir name="Block"><dir name="Adminhtml"><dir name="Showresponse"><file name="Grid.php" hash="aeae4dda58c8ed986da08edd6971905b"/></dir><file name="Showresponse.php" hash="8443b2efba0c9d8ee1298c07346bc0ad"/></dir><file name="Showresponse.php" hash="422ee30d87ab80694bd4359b3c2723fa"/></dir><dir name="Helper"><file name="Data.php" hash="bb901d91823996ca1394a17fb8c37626"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Showresponse"><file name="Collection.php" hash="48661fd41f6e68c6c2b98341cda9bd99"/></dir><file name="Showresponse.php" hash="509aa9d1d29696fc09e7b3d0d71aee30"/></dir><file name="Showresponse.php" hash="0e67bf60f7607d3dcdeb8117779fa520"/><file name="Status.php" hash="9851754aa54725f1a9744a292e5c29b2"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ShowresponseController.php" hash="9f366706451e35ed95733f84ec28c7b3"/></dir></dir><dir name="etc"><file name="config.xml" hash="acceb3c67515280cfcb653667a884daa"/></dir><dir name="sql"><dir name="showresponse_setup"><file name="mysql4-install-0.1.0.php" hash="2659dc69c13ea6a2375013d664733a26"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="showmap.xml" hash="c1ebb47555f3b60cad22e1b2f2d20780"/><file name="showresponse.xml" hash="8590cf727e2fa8f2109305c06cfc0cbf"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="showmap"><file name="showmap.phtml" hash="4a97dd140070035185afe7b76aeaa073"/></dir></dir><dir name="layout"><file name="showmap.xml" hash="2dc0228bfe8979923bd4fd482231ecb2"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Raveinfosys_Showmap.xml" hash="0c48ca715f40153515ce6f47ab4fe557"/><file name="Raveinfosys_Showresponse.xml" hash="0872101b7165467d24123621097d5ad5"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>5.3.10</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.5.0</min><max>1.7.0.1</max></package><extension><name>curl</name><min>7.21.4</min><max>7.26.0</max></extension><extension><name>SimpleXML</name><min></min><max></max></extension></required></dependencies>
18
+ </package>