Mks_Responsivebannerslider - Version 1.1.1

Version Notes

new Relase

Download this release

Release Info

Developer mukesh kumar saini
Extension Mks_Responsivebannerslider
Version 1.1.1
Comparing to
See all releases


Version 1.1.1

Files changed (23) hide show
  1. app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Bannerslider.php +17 -0
  2. app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Bannerslider/Edit.php +44 -0
  3. app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Bannerslider/Edit/Form.php +17 -0
  4. app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Bannerslider/Edit/Tab/Form.php +43 -0
  5. app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Bannerslider/Edit/Tabs.php +21 -0
  6. app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Bannerslider/Grid.php +86 -0
  7. app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Responsivebannersliderbackend.php +5 -0
  8. app/code/community/Mks/Responsivebannerslider/Block/Index.php +8 -0
  9. app/code/community/Mks/Responsivebannerslider/Helper/Data.php +5 -0
  10. app/code/community/Mks/Responsivebannerslider/Model/Bannerslider.php +12 -0
  11. app/code/community/Mks/Responsivebannerslider/Model/Mysql4/Bannerslider.php +8 -0
  12. app/code/community/Mks/Responsivebannerslider/Model/Mysql4/Bannerslider/Collection.php +12 -0
  13. app/code/community/Mks/Responsivebannerslider/controllers/Adminhtml/BannersliderController.php +209 -0
  14. app/code/community/Mks/Responsivebannerslider/controllers/Adminhtml/ResponsivebannersliderbackendController.php +10 -0
  15. app/code/community/Mks/Responsivebannerslider/controllers/IndexController.php +22 -0
  16. app/code/community/Mks/Responsivebannerslider/etc/config.xml +134 -0
  17. app/code/community/Mks/Responsivebannerslider/sql/responsivebannerslider_setup/mysql4-install-1.1.1.php +14 -0
  18. app/design/adminhtml/default/default/layout/responsivebannerslider.xml +13 -0
  19. app/design/adminhtml/default/default/template/responsivebannerslider/responsivebannersliderbackend.phtml +1 -0
  20. app/design/frontend/base/default/layout/responsivebannerslider.xml +12 -0
  21. app/design/frontend/base/default/template/responsivebannerslider/index.phtml +40 -0
  22. app/etc/modules/Mks_Responsivebannerslider.xml +10 -0
  23. package.xml +24 -0
app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Bannerslider.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Mks_Responsivebannerslider_Block_Adminhtml_Bannerslider extends Mage_Adminhtml_Block_Widget_Grid_Container{
5
+
6
+ public function __construct()
7
+ {
8
+
9
+ $this->_controller = "adminhtml_bannerslider";
10
+ $this->_blockGroup = "responsivebannerslider";
11
+ $this->_headerText = Mage::helper("responsivebannerslider")->__("Bannerslider Manager");
12
+ $this->_addButtonLabel = Mage::helper("responsivebannerslider")->__("Add New Item");
13
+ parent::__construct();
14
+
15
+ }
16
+
17
+ }
app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Bannerslider/Edit.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mks_Responsivebannerslider_Block_Adminhtml_Bannerslider_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+
8
+ parent::__construct();
9
+ $this->_objectId = "id";
10
+ $this->_blockGroup = "responsivebannerslider";
11
+ $this->_controller = "adminhtml_bannerslider";
12
+ $this->_updateButton("save", "label", Mage::helper("responsivebannerslider")->__("Save Item"));
13
+ $this->_updateButton("delete", "label", Mage::helper("responsivebannerslider")->__("Delete Item"));
14
+
15
+ $this->_addButton("saveandcontinue", array(
16
+ "label" => Mage::helper("responsivebannerslider")->__("Save And Continue Edit"),
17
+ "onclick" => "saveAndContinueEdit()",
18
+ "class" => "save",
19
+ ), -100);
20
+
21
+
22
+
23
+ $this->_formScripts[] = "
24
+
25
+ function saveAndContinueEdit(){
26
+ editForm.submit($('edit_form').action+'back/edit/');
27
+ }
28
+ ";
29
+ }
30
+
31
+ public function getHeaderText()
32
+ {
33
+ if( Mage::registry("bannerslider_data") && Mage::registry("bannerslider_data")->getId() ){
34
+
35
+ return Mage::helper("responsivebannerslider")->__("Edit Item '%s'", $this->htmlEscape(Mage::registry("bannerslider_data")->getId()));
36
+
37
+ }
38
+ else{
39
+
40
+ return Mage::helper("responsivebannerslider")->__("Add Item");
41
+
42
+ }
43
+ }
44
+ }
app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Bannerslider/Edit/Form.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mks_Responsivebannerslider_Block_Adminhtml_Bannerslider_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form(array(
7
+ "id" => "edit_form",
8
+ "action" => $this->getUrl("*/*/save", array("id" => $this->getRequest()->getParam("id"))),
9
+ "method" => "post",
10
+ "enctype" =>"multipart/form-data",
11
+ )
12
+ );
13
+ $form->setUseContainer(true);
14
+ $this->setForm($form);
15
+ return parent::_prepareForm();
16
+ }
17
+ }
app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Bannerslider/Edit/Tab/Form.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mks_Responsivebannerslider_Block_Adminhtml_Bannerslider_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+
7
+ $form = new Varien_Data_Form();
8
+ $this->setForm($form);
9
+ $fieldset = $form->addFieldset("responsivebannerslider_form", array("legend"=>Mage::helper("responsivebannerslider")->__("Item information")));
10
+
11
+
12
+ $fieldset->addField("title", "text", array(
13
+ "label" => Mage::helper("responsivebannerslider")->__("Title"),
14
+ "name" => "title",
15
+ ));
16
+
17
+ $fieldset->addField('image', 'image', array(
18
+ 'label' => Mage::helper('responsivebannerslider')->__('Image'),
19
+ 'name' => 'image',
20
+ 'note' => '(*.jpg, *.png, *.gif)',
21
+ ));
22
+ $fieldset->addField("description", "textarea", array(
23
+ "label" => Mage::helper("responsivebannerslider")->__("Description"),
24
+ "name" => "description",
25
+ ));
26
+
27
+ $fieldset->addField('status', 'select', array(
28
+ 'label' => Mage::helper('responsivebannerslider')->__('Status'),
29
+ 'values' => Mks_Responsivebannerslider_Block_Adminhtml_Bannerslider_Grid::getValueArray5(),
30
+ 'name' => 'status',
31
+ ));
32
+
33
+ if (Mage::getSingleton("adminhtml/session")->getBannersliderData())
34
+ {
35
+ $form->setValues(Mage::getSingleton("adminhtml/session")->getBannersliderData());
36
+ Mage::getSingleton("adminhtml/session")->setBannersliderData(null);
37
+ }
38
+ elseif(Mage::registry("bannerslider_data")) {
39
+ $form->setValues(Mage::registry("bannerslider_data")->getData());
40
+ }
41
+ return parent::_prepareForm();
42
+ }
43
+ }
app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Bannerslider/Edit/Tabs.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mks_Responsivebannerslider_Block_Adminhtml_Bannerslider_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setId("bannerslider_tabs");
8
+ $this->setDestElementId("edit_form");
9
+ $this->setTitle(Mage::helper("responsivebannerslider")->__("Item Information"));
10
+ }
11
+ protected function _beforeToHtml()
12
+ {
13
+ $this->addTab("form_section", array(
14
+ "label" => Mage::helper("responsivebannerslider")->__("Item Information"),
15
+ "title" => Mage::helper("responsivebannerslider")->__("Item Information"),
16
+ "content" => $this->getLayout()->createBlock("responsivebannerslider/adminhtml_bannerslider_edit_tab_form")->toHtml(),
17
+ ));
18
+ return parent::_beforeToHtml();
19
+ }
20
+
21
+ }
app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Bannerslider/Grid.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mks_Responsivebannerslider_Block_Adminhtml_Bannerslider_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId("bannersliderGrid");
10
+ $this->setDefaultSort("id");
11
+ $this->setDefaultDir("ASC");
12
+ $this->setSaveParametersInSession(true);
13
+ }
14
+
15
+ protected function _prepareCollection()
16
+ {
17
+ $collection = Mage::getModel("responsivebannerslider/bannerslider")->getCollection();
18
+ $this->setCollection($collection);
19
+ return parent::_prepareCollection();
20
+ }
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn("id", array(
24
+ "header" => Mage::helper("responsivebannerslider")->__("ID"),
25
+ "align" =>"right",
26
+ "width" => "50px",
27
+ "type" => "number",
28
+ "index" => "id",
29
+ ));
30
+
31
+ $this->addColumn("title", array(
32
+ "header" => Mage::helper("responsivebannerslider")->__("Title"),
33
+ "index" => "title",
34
+ ));
35
+ $this->addColumn('status', array(
36
+ 'header' => Mage::helper('responsivebannerslider')->__('Status'),
37
+ 'index' => 'status',
38
+ 'type' => 'options',
39
+ 'options'=>Mks_Responsivebannerslider_Block_Adminhtml_Bannerslider_Grid::getOptionArray5(),
40
+ ));
41
+
42
+ $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
43
+ $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel'));
44
+
45
+ return parent::_prepareColumns();
46
+ }
47
+
48
+ public function getRowUrl($row)
49
+ {
50
+ return $this->getUrl("*/*/edit", array("id" => $row->getId()));
51
+ }
52
+
53
+
54
+
55
+ protected function _prepareMassaction()
56
+ {
57
+ $this->setMassactionIdField('id');
58
+ $this->getMassactionBlock()->setFormFieldName('ids');
59
+ $this->getMassactionBlock()->setUseSelectAll(true);
60
+ $this->getMassactionBlock()->addItem('remove_bannerslider', array(
61
+ 'label'=> Mage::helper('responsivebannerslider')->__('Remove Bannerslider'),
62
+ 'url' => $this->getUrl('*/adminhtml_bannerslider/massRemove'),
63
+ 'confirm' => Mage::helper('responsivebannerslider')->__('Are you sure?')
64
+ ));
65
+ return $this;
66
+ }
67
+
68
+ static public function getOptionArray5()
69
+ {
70
+ $data_array=array();
71
+ $data_array[0]='Yes';
72
+ $data_array[1]='No';
73
+ return($data_array);
74
+ }
75
+ static public function getValueArray5()
76
+ {
77
+ $data_array=array();
78
+ foreach(Mks_Responsivebannerslider_Block_Adminhtml_Bannerslider_Grid::getOptionArray5() as $k=>$v){
79
+ $data_array[]=array('value'=>$k,'label'=>$v);
80
+ }
81
+ return($data_array);
82
+
83
+ }
84
+
85
+
86
+ }
app/code/community/Mks/Responsivebannerslider/Block/Adminhtml/Responsivebannersliderbackend.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mks_Responsivebannerslider_Block_Adminhtml_Responsivebannersliderbackend extends Mage_Adminhtml_Block_Template {
4
+
5
+ }
app/code/community/Mks/Responsivebannerslider/Block/Index.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mks_Responsivebannerslider_Block_Index extends Mage_Core_Block_Template{
3
+
4
+
5
+
6
+
7
+
8
+ }
app/code/community/Mks/Responsivebannerslider/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Mks_Responsivebannerslider_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
5
+
app/code/community/Mks/Responsivebannerslider/Model/Bannerslider.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mks_Responsivebannerslider_Model_Bannerslider extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct(){
6
+
7
+ $this->_init("responsivebannerslider/bannerslider");
8
+
9
+ }
10
+
11
+ }
12
+
app/code/community/Mks/Responsivebannerslider/Model/Mysql4/Bannerslider.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mks_Responsivebannerslider_Model_Mysql4_Bannerslider extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("responsivebannerslider/bannerslider", "id");
7
+ }
8
+ }
app/code/community/Mks/Responsivebannerslider/Model/Mysql4/Bannerslider/Collection.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mks_Responsivebannerslider_Model_Mysql4_Bannerslider_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+
5
+ public function _construct(){
6
+ $this->_init("responsivebannerslider/bannerslider");
7
+ }
8
+
9
+
10
+
11
+ }
12
+
app/code/community/Mks/Responsivebannerslider/controllers/Adminhtml/BannersliderController.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mks_Responsivebannerslider_Adminhtml_BannersliderController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+ protected function _initAction()
6
+ {
7
+ $this->loadLayout()->_setActiveMenu("responsivebannerslider/bannerslider")->_addBreadcrumb(Mage::helper("adminhtml")->__("Bannerslider Manager"),Mage::helper("adminhtml")->__("Bannerslider Manager"));
8
+ return $this;
9
+ }
10
+ public function indexAction()
11
+ {
12
+ $this->_title($this->__("Responsivebannerslider"));
13
+ $this->_title($this->__("Manager Bannerslider"));
14
+
15
+ $this->_initAction();
16
+ $this->renderLayout();
17
+ }
18
+ public function editAction()
19
+ {
20
+ $this->_title($this->__("Responsivebannerslider"));
21
+ $this->_title($this->__("Bannerslider"));
22
+ $this->_title($this->__("Edit Item"));
23
+
24
+ $id = $this->getRequest()->getParam("id");
25
+ $model = Mage::getModel("responsivebannerslider/bannerslider")->load($id);
26
+ if ($model->getId()) {
27
+ Mage::register("bannerslider_data", $model);
28
+ $this->loadLayout();
29
+ $this->_setActiveMenu("responsivebannerslider/bannerslider");
30
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Bannerslider Manager"), Mage::helper("adminhtml")->__("Bannerslider Manager"));
31
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Bannerslider Description"), Mage::helper("adminhtml")->__("Bannerslider Description"));
32
+ $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
33
+ $this->_addContent($this->getLayout()->createBlock("responsivebannerslider/adminhtml_bannerslider_edit"))->_addLeft($this->getLayout()->createBlock("responsivebannerslider/adminhtml_bannerslider_edit_tabs"));
34
+ $this->renderLayout();
35
+ }
36
+ else {
37
+ Mage::getSingleton("adminhtml/session")->addError(Mage::helper("responsivebannerslider")->__("Item does not exist."));
38
+ $this->_redirect("*/*/");
39
+ }
40
+ }
41
+
42
+ public function newAction()
43
+ {
44
+
45
+ $this->_title($this->__("Responsivebannerslider"));
46
+ $this->_title($this->__("Bannerslider"));
47
+ $this->_title($this->__("New Item"));
48
+
49
+ $id = $this->getRequest()->getParam("id");
50
+ $model = Mage::getModel("responsivebannerslider/bannerslider")->load($id);
51
+
52
+ $data = Mage::getSingleton("adminhtml/session")->getFormData(true);
53
+ if (!empty($data)) {
54
+ $model->setData($data);
55
+ }
56
+
57
+ Mage::register("bannerslider_data", $model);
58
+
59
+ $this->loadLayout();
60
+ $this->_setActiveMenu("responsivebannerslider/bannerslider");
61
+
62
+ $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
63
+
64
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Bannerslider Manager"), Mage::helper("adminhtml")->__("Bannerslider Manager"));
65
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Bannerslider Description"), Mage::helper("adminhtml")->__("Bannerslider Description"));
66
+
67
+
68
+ $this->_addContent($this->getLayout()->createBlock("responsivebannerslider/adminhtml_bannerslider_edit"))->_addLeft($this->getLayout()->createBlock("responsivebannerslider/adminhtml_bannerslider_edit_tabs"));
69
+
70
+ $this->renderLayout();
71
+
72
+ }
73
+ public function saveAction()
74
+ {
75
+
76
+ $post_data=$this->getRequest()->getPost();
77
+
78
+
79
+ if ($post_data) {
80
+
81
+ try {
82
+
83
+
84
+ //save image
85
+ try{
86
+
87
+ if((bool)$post_data['image']['delete']==1) {
88
+
89
+ $post_data['image']='';
90
+
91
+ }
92
+ else {
93
+
94
+ unset($post_data['image']);
95
+
96
+ if (isset($_FILES)){
97
+
98
+ if ($_FILES['image']['name']) {
99
+
100
+ if($this->getRequest()->getParam("id")){
101
+ $model = Mage::getModel("responsivebannerslider/bannerslider")->load($this->getRequest()->getParam("id"));
102
+ if($model->getData('image')){
103
+ $io = new Varien_Io_File();
104
+ $io->rm(Mage::getBaseDir('media').DS.implode(DS,explode('/',$model->getData('image'))));
105
+ }
106
+ }
107
+ $path = Mage::getBaseDir('media') . DS . 'responsivebannerslider' . DS .'bannerslider'.DS;
108
+ $uploader = new Varien_File_Uploader('image');
109
+ $uploader->setAllowedExtensions(array('jpg','png','gif'));
110
+ $uploader->setAllowRenameFiles(false);
111
+ $uploader->setFilesDispersion(false);
112
+ $destFile = $path.$_FILES['image']['name'];
113
+ $filename = $uploader->getNewFileName($destFile);
114
+ $uploader->save($path, $filename);
115
+
116
+ $post_data['image']='responsivebannerslider/bannerslider/'.$filename;
117
+ }
118
+ }
119
+ }
120
+
121
+ } catch (Exception $e) {
122
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
123
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
124
+ return;
125
+ }
126
+ //save image
127
+
128
+
129
+ $model = Mage::getModel("responsivebannerslider/bannerslider")
130
+ ->addData($post_data)
131
+ ->setId($this->getRequest()->getParam("id"))
132
+ ->save();
133
+
134
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Bannerslider was successfully saved"));
135
+ Mage::getSingleton("adminhtml/session")->setBannersliderData(false);
136
+
137
+ if ($this->getRequest()->getParam("back")) {
138
+ $this->_redirect("*/*/edit", array("id" => $model->getId()));
139
+ return;
140
+ }
141
+ $this->_redirect("*/*/");
142
+ return;
143
+ }
144
+ catch (Exception $e) {
145
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
146
+ Mage::getSingleton("adminhtml/session")->setBannersliderData($this->getRequest()->getPost());
147
+ $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
148
+ return;
149
+ }
150
+
151
+ }
152
+ $this->_redirect("*/*/");
153
+ }
154
+
155
+
156
+
157
+ public function deleteAction()
158
+ {
159
+ if( $this->getRequest()->getParam("id") > 0 ) {
160
+ try {
161
+ $model = Mage::getModel("responsivebannerslider/bannerslider");
162
+ $model->setId($this->getRequest()->getParam("id"))->delete();
163
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item was successfully deleted"));
164
+ $this->_redirect("*/*/");
165
+ }
166
+ catch (Exception $e) {
167
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
168
+ $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
169
+ }
170
+ }
171
+ $this->_redirect("*/*/");
172
+ }
173
+
174
+
175
+ public function massRemoveAction()
176
+ {
177
+ try {
178
+ $ids = $this->getRequest()->getPost('ids', array());
179
+ foreach ($ids as $id) {
180
+ $model = Mage::getModel("responsivebannerslider/bannerslider");
181
+ $model->setId($id)->delete();
182
+ }
183
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item(s) was successfully removed"));
184
+ }
185
+ catch (Exception $e) {
186
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
187
+ }
188
+ $this->_redirect('*/*/');
189
+ }
190
+
191
+ /**
192
+ * Export order grid to CSV format
193
+ */
194
+ public function exportCsvAction()
195
+ {
196
+ $fileName = 'bannerslider.csv';
197
+ $grid = $this->getLayout()->createBlock('responsivebannerslider/adminhtml_bannerslider_grid');
198
+ $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
199
+ }
200
+ /**
201
+ * Export order grid to Excel XML format
202
+ */
203
+ public function exportExcelAction()
204
+ {
205
+ $fileName = 'bannerslider.xml';
206
+ $grid = $this->getLayout()->createBlock('responsivebannerslider/adminhtml_bannerslider_grid');
207
+ $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
208
+ }
209
+ }
app/code/community/Mks/Responsivebannerslider/controllers/Adminhtml/ResponsivebannersliderbackendController.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mks_Responsivebannerslider_Adminhtml_ResponsivebannersliderbackendController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->_title($this->__("About Us"));
8
+ $this->renderLayout();
9
+ }
10
+ }
app/code/community/Mks/Responsivebannerslider/controllers/IndexController.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mks_Responsivebannerslider_IndexController extends Mage_Core_Controller_Front_Action{
3
+ public function IndexAction() {
4
+
5
+ $this->loadLayout();
6
+ $this->getLayout()->getBlock("head")->setTitle($this->__("banner slider"));
7
+ $breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
8
+ $breadcrumbs->addCrumb("home", array(
9
+ "label" => $this->__("Home Page"),
10
+ "title" => $this->__("Home Page"),
11
+ "link" => Mage::getBaseUrl()
12
+ ));
13
+
14
+ $breadcrumbs->addCrumb("banner slider", array(
15
+ "label" => $this->__("banner slider"),
16
+ "title" => $this->__("banner slider")
17
+ ));
18
+
19
+ $this->renderLayout();
20
+
21
+ }
22
+ }
app/code/community/Mks/Responsivebannerslider/etc/config.xml ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Mks_Responsivebannerslider>
5
+ <version>1.1.1</version>
6
+ </Mks_Responsivebannerslider>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <responsivebannerslider>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Mks_Responsivebannerslider</module>
14
+ <frontName>responsivebannerslider</frontName>
15
+ </args>
16
+ </responsivebannerslider>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <responsivebannerslider>
21
+ <file>responsivebannerslider.xml</file>
22
+ </responsivebannerslider>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <global>
27
+ <helpers>
28
+ <responsivebannerslider>
29
+ <class>Mks_Responsivebannerslider_Helper</class>
30
+ </responsivebannerslider>
31
+ </helpers>
32
+ <blocks>
33
+ <responsivebannerslider>
34
+ <class>Mks_Responsivebannerslider_Block</class>
35
+ </responsivebannerslider>
36
+ </blocks>
37
+ <models>
38
+ <responsivebannerslider>
39
+ <class>Mks_Responsivebannerslider_Model</class>
40
+ <resourceModel>responsivebannerslider_mysql4</resourceModel>
41
+ </responsivebannerslider>
42
+ <responsivebannerslider_mysql4>
43
+ <class>Mks_Responsivebannerslider_Model_Mysql4</class>
44
+ <entities>
45
+ <bannerslider>
46
+ <table>mksresponsivebannerslider</table>
47
+ </bannerslider>
48
+ </entities>
49
+ </responsivebannerslider_mysql4>
50
+ </models>
51
+ <resources>
52
+ <responsivebannerslider_setup>
53
+ <setup>
54
+ <module>Mks_Responsivebannerslider</module>
55
+ </setup>
56
+ <connection>
57
+ <use>core_setup</use>
58
+ </connection>
59
+ </responsivebannerslider_setup>
60
+ <responsivebannerslider_write>
61
+ <connection>
62
+ <use>core_write</use>
63
+ </connection>
64
+ </responsivebannerslider_write>
65
+ <responsivebannerslider_read>
66
+ <connection>
67
+ <use>core_read</use>
68
+ </connection>
69
+ </responsivebannerslider_read>
70
+ </resources>
71
+ </global>
72
+ <admin>
73
+ <routers>
74
+ <responsivebannerslider>
75
+ <use>admin</use>
76
+ <args>
77
+ <module>Mks_Responsivebannerslider</module>
78
+ <frontName>responsivebannerslider</frontName>
79
+ </args>
80
+ </responsivebannerslider>
81
+ </routers>
82
+ </admin>
83
+ <adminhtml>
84
+ <menu>
85
+ <responsivebannerslider module="responsivebannerslider">
86
+ <title>Responsivebannerslider</title>
87
+ <sort_order>100</sort_order>
88
+ <children>
89
+ <responsivebannersliderbackend module="responsivebannerslider">
90
+ <title>About Us</title>
91
+ <sort_order>0</sort_order>
92
+ <action>responsivebannerslider/adminhtml_responsivebannersliderbackend</action>
93
+ </responsivebannersliderbackend>
94
+ <bannerslider module="responsivebannerslider">
95
+ <title>Manage Bannerslider</title>
96
+ <sort_order>0</sort_order>
97
+ <action>responsivebannerslider/adminhtml_bannerslider</action>
98
+ </bannerslider>
99
+ </children>
100
+ </responsivebannerslider>
101
+ </menu>
102
+ <acl>
103
+ <resources>
104
+ <all>
105
+ <title>Allow Everything</title>
106
+ </all>
107
+ <admin>
108
+ <children>
109
+ <responsivebannerslider translate="title" module="responsivebannerslider">
110
+ <title>Responsivebannerslider</title>
111
+ <sort_order>1000</sort_order>
112
+ <children>
113
+ <responsivebannersliderbackend translate="title">
114
+ <title>About Us</title>
115
+ </responsivebannersliderbackend>
116
+ <bannerslider translate="title">
117
+ <title>Manage Bannerslider</title>
118
+ <sort_order>0</sort_order>
119
+ </bannerslider>
120
+ </children>
121
+ </responsivebannerslider>
122
+ </children>
123
+ </admin>
124
+ </resources>
125
+ </acl>
126
+ <layout>
127
+ <updates>
128
+ <responsivebannerslider>
129
+ <file>responsivebannerslider.xml</file>
130
+ </responsivebannerslider>
131
+ </updates>
132
+ </layout>
133
+ </adminhtml>
134
+ </config>
app/code/community/Mks/Responsivebannerslider/sql/responsivebannerslider_setup/mysql4-install-1.1.1.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $sql=<<<SQLTEXT
5
+ create table mksresponsivebannerslider(id int not null auto_increment, title varchar(255),image varchar(255),description varchar(255),status varchar(255), primary key(id));
6
+
7
+ SQLTEXT;
8
+
9
+ $installer->run($sql);
10
+ //demo
11
+ Mage::getModel('core/url_rewrite')->setId(null);
12
+ //demo
13
+ $installer->endSetup();
14
+
app/design/adminhtml/default/default/layout/responsivebannerslider.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <responsivebannerslider_adminhtml_responsivebannersliderbackend_index>
4
+ <reference name="content">
5
+ <block type="responsivebannerslider/adminhtml_responsivebannersliderbackend" name="responsivebannersliderbackend" template="responsivebannerslider/responsivebannersliderbackend.phtml"/>
6
+ </reference>
7
+ </responsivebannerslider_adminhtml_responsivebannersliderbackend_index>
8
+ <responsivebannerslider_adminhtml_bannerslider_index>
9
+ <reference name="content">
10
+ <block type="responsivebannerslider/adminhtml_bannerslider" name="bannerslider" />
11
+ </reference>
12
+ </responsivebannerslider_adminhtml_bannerslider_index>
13
+ </layout>
app/design/adminhtml/default/default/template/responsivebannerslider/responsivebannersliderbackend.phtml ADDED
@@ -0,0 +1 @@
 
1
+ Demo Backend Page Content
app/design/frontend/base/default/layout/responsivebannerslider.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="1.1.1">
3
+ <responsivebannerslider_index_index>
4
+ <reference name="root">
5
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
6
+ </reference>
7
+ <reference name="content">
8
+ <block type="responsivebannerslider/index" name="responsivebannerslider_index" template="responsivebannerslider/index.phtml"/>
9
+ </reference>
10
+ </responsivebannerslider_index_index>
11
+ </layout>
12
+
app/design/frontend/base/default/template/responsivebannerslider/index.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <link rel="stylesheet" href="<?php echo $this->getSkinUrl('mksslider/css/font-awesome.min.css'); ?>">
2
+
3
+ </head>
4
+ <body>
5
+
6
+ <div class="container">
7
+ <div id="slides">
8
+ <?php
9
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
10
+ $sql = $connection->query("select * from mksresponsivebannerslider");
11
+ while($row1 = $sql->fetch())
12
+ {
13
+ $title = $row1["title"];
14
+ $urlx = $row1["image"];
15
+ $media_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
16
+ $imgurl=$media_url.$urlx;
17
+ ?>
18
+ <img src="<?php echo $imgurl; ?>" alt="<?php echo $title; ?>">
19
+ <?php } ?>
20
+ </div>
21
+ </div>
22
+
23
+ <script src="<?php echo $this->getSkinUrl('mksslider/js/jquery-1.9.1.min.js'); ?>"></script>
24
+ <script src="<?php echo $this->getSkinUrl('mksslider/js/jquery.slides.min.js'); ?>"></script>
25
+ <script>
26
+ $(function() {
27
+ $('#slides').slidesjs({
28
+ width: 800,
29
+ height: 300,
30
+ play: {
31
+ active: true,
32
+ auto: true,
33
+ interval: 4000,
34
+ swap: true
35
+ }
36
+ });
37
+ });
38
+ </script>
39
+
40
+
app/etc/modules/Mks_Responsivebannerslider.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Mks_Responsivebannerslider>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <version>1.1.1</version>
8
+ </Mks_Responsivebannerslider>
9
+ </modules>
10
+ </config>
package.xml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Mks_Responsivebannerslider</name>
4
+ <version>1.1.1</version>
5
+ <stability>stable</stability>
6
+ <license>OSL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Responsive Banner slider extension displays unlimited sliders &amp; allow to view stats reports.</summary>
10
+ <description>&lt;h1&gt;Responsive Banner slider extension &lt;/h1&gt;&#xD;
11
+ &#xD;
12
+ MultiBanner with Multiple Effects for Images and Html (Slideshow, TextFade, Square Transition, Play Pause, &#xD;
13
+ &lt;br /&gt;&#xD;
14
+ Numbered banners, Horizontal Slider, Vertical Slider and Many more custom effects) using magento protoype library.&#xD;
15
+ &#xD;
16
+ &lt;h2&gt;Support : mukesh@ptiwebtech.com&lt;/h2&gt;</description>
17
+ <notes>new Relase</notes>
18
+ <authors><author><name>Mukesh Kumar Saini</name><user>mukeshbagri</user><email>in.mukeshsaini@gmail.com</email></author></authors>
19
+ <date>2013-12-21</date>
20
+ <time>07:20:27</time>
21
+ <contents><target name="mageetc"><dir name="modules"><file name="Mks_Responsivebannerslider.xml" hash="a04e883ef005844c7a1f11d7fec7e848"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="responsivebannerslider"><file name="responsivebannersliderbackend.phtml" hash="93ad3e798b60ad33539a944088478690"/></dir></dir><dir name="layout"><file name="responsivebannerslider.xml" hash="d4fa3c58f4e73497b34afebbbb95744a"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="responsivebannerslider"><file name="index.phtml" hash="234c8bcf0cc2fcab827f4aa420573f0e"/></dir></dir><dir name="layout"><file name="responsivebannerslider.xml" hash="223b3947d796209f85c010b4e2bc92bf"/></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Mks"><dir name="Responsivebannerslider"><dir name="Block"><dir name="Adminhtml"><dir name="Bannerslider"><dir name="Edit"><file name="Form.php" hash="1f10dccbc5e4edcc90ea3ac5366f57be"/><dir name="Tab"><file name="Form.php" hash="b876cf8d67286b29ddd2c50708eb5c4d"/></dir><file name="Tabs.php" hash="9bc44dafb937cbba749b524774d60db9"/></dir><file name="Edit.php" hash="43d560427c5c71cef9941147cebaa993"/><file name="Grid.php" hash="08b5c4cb74f39a625d6f33d0ad63d84a"/></dir><file name="Bannerslider.php" hash="f34ef00e533391b3bea2b46b19306f24"/><file name="Responsivebannersliderbackend.php" hash="492c6c1c9897c51b987a1acadcc42a5c"/></dir><file name="Index.php" hash="c5f0965e5010398c0f65cf1362f3b136"/></dir><dir name="Helper"><file name="Data.php" hash="54fb6015b45224292e5e47f0004633b6"/></dir><dir name="Model"><file name="Bannerslider.php" hash="9a90f66e05379c7a2ff04dbd95626e8d"/><dir name="Mysql4"><dir name="Bannerslider"><file name="Collection.php" hash="e67814d8806485a9fae33cd3ba88212f"/></dir><file name="Bannerslider.php" hash="39ec20c65650737b829f646fc02df11b"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="BannersliderController.php" hash="d54d8c12a9deab4dd6cecbe17db76ad4"/><file name="ResponsivebannersliderbackendController.php" hash="f095780b42f66f229d8bb76b69bb8f08"/></dir><file name="IndexController.php" hash="617399f39b6bdb8a88cd939405f4a455"/></dir><dir name="etc"><file name="config.xml" hash="1cd622d64348032aefde23aa6e871184"/></dir><dir name="sql"><dir name="responsivebannerslider_setup"><file name="mysql4-install-1.1.1.php" hash="ac01e89718fa96ddb2bd41b9900c0a30"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><file name="mksslider" hash=""/></dir></dir></dir></target></contents>
22
+ <compatible/>
23
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
24
+ </package>