sliderbywebline - Version 0.1.0

Version Notes

First Release

Download this release

Release Info

Developer Weblineindia
Extension sliderbywebline
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

Files changed (29) hide show
  1. app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider.php +12 -0
  2. app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider/Edit.php +24 -0
  3. app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider/Edit/Form.php +18 -0
  4. app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider/Edit/Tab/Form.php +80 -0
  5. app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider/Edit/Tabs.php +22 -0
  6. app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider/Grid.php +83 -0
  7. app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider/Renderer/Imagedisplay.php +16 -0
  8. app/code/local/Wli/Wlislider/Block/Html/Header.php +11 -0
  9. app/code/local/Wli/Wlislider/Helper/Data.php +5 -0
  10. app/code/local/Wli/Wlislider/Model/Mysql4/Wlislider.php +8 -0
  11. app/code/local/Wli/Wlislider/Model/Mysql4/Wlislider/Collection.php +8 -0
  12. app/code/local/Wli/Wlislider/Model/Slideroption.php +13 -0
  13. app/code/local/Wli/Wlislider/Model/Wlislider.php +10 -0
  14. app/code/local/Wli/Wlislider/controllers/Adminhtml/WlisliderController.php +181 -0
  15. app/code/local/Wli/Wlislider/controllers/IndexController.php +9 -0
  16. app/code/local/Wli/Wlislider/etc/adminhtml.xml +42 -0
  17. app/code/local/Wli/Wlislider/etc/config.xml +113 -0
  18. app/code/local/Wli/Wlislider/etc/system.xml +135 -0
  19. app/code/local/Wli/Wlislider/sql/wlislider_setup/mysql4-install-0.1.0.php +21 -0
  20. app/design/frontend/base/default/layout/wlislider.xml +74 -0
  21. app/design/frontend/base/default/template/wlislider/page/html/header.phtml +68 -0
  22. app/etc/modules/Wli_Wlislider.xml +9 -0
  23. js/slider/123protoshow.js +746 -0
  24. js/slider/site.js +21 -0
  25. package.xml +18 -0
  26. protoshow.php +758 -0
  27. skin/frontend/base/default/css/slider/protoshow.css +305 -0
  28. skin/frontend/base/default/css/slider/reset.css +102 -0
  29. skin/frontend/base/default/css/slider/site.css +9 -0
app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Block_Adminhtml_Wlislider extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_wlislider';
7
+ $this->_blockGroup = 'wlislider';
8
+ $this->_headerText = Mage::helper('wlislider')->__('Item Manager');
9
+ $this->_addButtonLabel = Mage::helper('wlislider')->__('Add Item');
10
+ parent::__construct();
11
+ }
12
+ }
app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider/Edit.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Block_Adminhtml_Wlislider_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+
8
+ $this->_objectId = 'id';
9
+ $this->_blockGroup = 'wlislider';
10
+ $this->_controller = 'adminhtml_wlislider';
11
+
12
+ $this->_updateButton('save', 'label', Mage::helper('wlislider')->__('Save Banner'));
13
+ $this->_updateButton('delete', 'label', Mage::helper('wlislider')->__('Delete Banner'));
14
+ }
15
+
16
+ public function getHeaderText()
17
+ {
18
+ if( Mage::registry('wlislider_data') && Mage::registry('wlislider_data')->getId() ) {
19
+ return Mage::helper('wlislider')->__("Edit Banner '%s'", $this->htmlEscape(Mage::registry('wlislider_data')->getTitle()));
20
+ } else {
21
+ return Mage::helper('wlislider')->__('Banner Item');
22
+ }
23
+ }
24
+ }
app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider/Edit/Form.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Block_Adminhtml_Wlislider_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
+
14
+ $form->setUseContainer(true);
15
+ $this->setForm($form);
16
+ return parent::_prepareForm();
17
+ }
18
+ }
app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider/Edit/Tab/Form.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Block_Adminhtml_Wlislider_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+
7
+ $UrlData=$this->getRequest()->getParams();
8
+ $CheckEdit=$UrlData['id'];
9
+ $form = new Varien_Data_Form();
10
+ $this->setForm($form);
11
+ $fieldset = $form->addFieldset('wlislider_form', array('legend'=>Mage::helper('wlislider')->__('Item information')));
12
+ $URLID=$this->getRequest()->getParam('id');
13
+ $_edited_banner = Mage::getModel('wlislider/wlislider')->load($URLID);
14
+ $_edited_banner = ($_edited_banner->getdata());
15
+
16
+ $fieldset->addField('title', 'text', array(
17
+ 'label' => Mage::helper('wlislider')->__('Title'),
18
+ 'class' => 'required-entry validate-alpha',
19
+ 'required' => true,
20
+ 'name' => 'title',
21
+ ));
22
+
23
+ if(isset($CheckEdit))
24
+ {
25
+ $fieldset->addField('image', 'image', array(
26
+ 'label' => Mage::helper('wlislider')->__('Banner'),
27
+ 'class' => 'required-entry required-file',
28
+ 'src' => Mage::getBaseUrl('media') . 'wlislider'.DS.$_edited_banner['image'],
29
+ 'required' => true,
30
+ 'name' => 'image',
31
+ 'after_element_html' => '<div style="padding-top:5px;padding-bottom:5px" id="imagetag"><img src="'.Mage::getBaseUrl('media') . 'wlislider'.DS.$_edited_banner['image'].'" width=250px height=250/></div> ',
32
+ ));
33
+ }
34
+ else
35
+ {
36
+ $fieldset->addField('image', 'image', array(
37
+ 'label' => Mage::helper('wlislider')->__('Banner'),
38
+ 'class' => 'required-entry required-file',
39
+ 'src' => Mage::getBaseUrl('media') . 'wlislider'.DS.$_edited_banner['image'],
40
+ 'required' => true,
41
+ 'name' => 'image',
42
+ 'after_element_html' => '<small><br>File Type: <i>*.jpg,*.png,*.gif,*.jpeg</i></small>',
43
+ ));
44
+ }
45
+
46
+ $fieldset->addField('imageurl', 'text', array(
47
+ 'label' => Mage::helper('wlislider')->__('Image Url:'),
48
+ 'class' => 'required-entry',
49
+ 'required' => true,
50
+ 'name' => 'imageurl',
51
+ ));
52
+
53
+ $fieldset->addField('status', 'select', array(
54
+ 'label' => Mage::helper('wlislider')->__('Status'),
55
+ 'name' => 'status',
56
+ 'values' => array(
57
+
58
+ array(
59
+ 'value' => 1,
60
+ 'label' => Mage::helper('wlislider')->__('Active'),
61
+ ),
62
+
63
+ array(
64
+ 'value' => 0,
65
+ 'label' => Mage::helper('wlislider')->__('Inactive'),
66
+ ),
67
+ ),
68
+ ));
69
+
70
+
71
+ if ( Mage::getSingleton('adminhtml/session')->getWlisliderData() )
72
+ {
73
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getWlisliderData());
74
+ Mage::getSingleton('adminhtml/session')->setWlisliderData(null);
75
+ } elseif ( Mage::registry('wlislider_data') ) {
76
+ $form->setValues(Mage::registry('wlislider_data')->getData());
77
+ }
78
+ return parent::_prepareForm();
79
+ }
80
+ }
app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider/Edit/Tabs.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Block_Adminhtml_Wlislider_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setId('wlislider_tabs');
8
+ $this->setDestElementId('edit_form');
9
+ $this->setTitle(Mage::helper('wlislider')->__('Item Information'));
10
+ }
11
+
12
+ protected function _beforeToHtml()
13
+ {
14
+ $this->addTab('form_section', array(
15
+ 'label' => Mage::helper('wlislider')->__('Item Information'),
16
+ 'title' => Mage::helper('wlislider')->__('Item Information'),
17
+ 'content' => $this->getLayout()->createBlock('wlislider/adminhtml_wlislider_edit_tab_form')->toHtml(),
18
+ ));
19
+
20
+ return parent::_beforeToHtml();
21
+ }
22
+ }
app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider/Grid.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Block_Adminhtml_Wlislider_Grid extends Mage_Adminhtml_Block_Widget_Grid
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setId('wlisliderGrid');
8
+ // This is the primary key of the database
9
+ $this->setDefaultSort('wlislider_id');
10
+ $this->setDefaultDir('ASC');
11
+ $this->setSaveParametersInSession(true);
12
+ $this->setUseAjax(true);
13
+ }
14
+
15
+ protected function _prepareCollection()
16
+ {
17
+ $collection = Mage::getModel('wlislider/wlislider')->getCollection();
18
+ $this->setCollection($collection);
19
+ return parent::_prepareCollection();
20
+ }
21
+
22
+ protected function _prepareColumns()
23
+ {
24
+ $this->addColumn('wlislider_id', array(
25
+ 'header' => Mage::helper('wlislider')->__('ID'),
26
+ 'align' =>'right',
27
+ 'width' => '10px',
28
+ 'index' => 'wlislider_id',
29
+ ));
30
+
31
+ $this->addColumn('title', array(
32
+ 'header' => Mage::helper('wlislider')->__('Title'),
33
+ 'align' =>'left',
34
+ 'width' => '50px',
35
+ 'index' => 'title',
36
+ ));
37
+
38
+
39
+ $this->addColumn('image', array(
40
+ 'header' => Mage::helper('wlislider')->__('Image'),
41
+ 'filter' => false,
42
+ 'sortable' => false,
43
+ 'align' =>'center',
44
+ 'width' =>'150px',
45
+ 'index' => 'image',
46
+ 'renderer' =>'Wli_Wlislider_Block_Adminhtml_Wlislider_Renderer_Imagedisplay',
47
+ ));
48
+
49
+ $this->addColumn('imageurl', array(
50
+ 'header' => Mage::helper('wlislider')->__('Image Url'),
51
+ 'align' =>'left',
52
+ 'width' => '100px',
53
+ 'index' => 'imageurl',
54
+ ));
55
+
56
+ $this->addColumn('status', array(
57
+
58
+ 'header' => Mage::helper('wlislider')->__('Status'),
59
+ 'align' => 'left',
60
+ 'width' => '80px',
61
+ 'index' => 'status',
62
+ 'type' => 'options',
63
+ 'options' => array(
64
+ 1 => 'Active',
65
+ 0 => 'Inactive',
66
+ ),
67
+ ));
68
+
69
+ return parent::_prepareColumns();
70
+ }
71
+
72
+ public function getRowUrl($row)
73
+ {
74
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
75
+ }
76
+
77
+ public function getGridUrl()
78
+ {
79
+ return $this->getUrl('*/*/grid', array('_current'=>true));
80
+ }
81
+
82
+
83
+ }
app/code/local/Wli/Wlislider/Block/Adminhtml/Wlislider/Renderer/Imagedisplay.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Block_Adminhtml_Wlislider_Renderer_Imagedisplay extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ return $this->_getValue($row);
7
+ }
8
+ protected function _getValue(Varien_Object $row)
9
+ {
10
+ $imageData = $row->getData();
11
+
12
+ $url = Mage::getBaseUrl('media') . 'wlislider'.DS. $imageData['image'];
13
+ $out = "<img src=". $url ." width='150px' height='150px'/></a>";
14
+ return $out;
15
+ }
16
+ }
app/code/local/Wli/Wlislider/Block/Html/Header.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Block_Html_Header extends Mage_Page_Block_Html_Header
3
+ {
4
+ public function _construct()
5
+ {
6
+ $collection = Mage::getModel('wlislider/wlislider')->getCollection()
7
+ ->addFieldToFilter('status',1);
8
+ $this->setCollection($collection);
9
+ $this->setTemplate('wlislider/page/html/header.phtml');
10
+ }
11
+ }
app/code/local/Wli/Wlislider/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
app/code/local/Wli/Wlislider/Model/Mysql4/Wlislider.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Model_Mysql4_Wlislider extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ $this->_init('wlislider/wlislider', 'wlislider_id');
7
+ }
8
+ }
app/code/local/Wli/Wlislider/Model/Mysql4/Wlislider/Collection.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Model_Mysql4_Wlislider_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ $this->_init('wlislider/wlislider');
7
+ }
8
+ }
app/code/local/Wli/Wlislider/Model/Slideroption.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Model_Slideroption
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value'=>'fade', 'label'=>Mage::helper('wlislider')->__('Fade')),
8
+ array('value'=>'slide', 'label'=>Mage::helper('wlislider')->__('Slide')),
9
+ );
10
+ }
11
+
12
+ }
13
+
app/code/local/Wli/Wlislider/Model/Wlislider.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Model_Wlislider extends Mage_Core_Model_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->_init('wlislider/wlislider');
8
+ }
9
+
10
+ }
app/code/local/Wli/Wlislider/controllers/Adminhtml/WlisliderController.php ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_Adminhtml_WlisliderController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+
5
+ protected function _initAction()
6
+ {
7
+ $this->loadLayout()
8
+ ->_setActiveMenu('wlislider/items')
9
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
10
+ return $this;
11
+ }
12
+
13
+ public function indexAction() {
14
+ $this->_initAction();
15
+ $this->_addContent($this->getLayout()->createBlock('wlislider/adminhtml_wlislider'));
16
+ $this->renderLayout();
17
+ }
18
+
19
+ public function editAction()
20
+ {
21
+ $wlisliderId = $this->getRequest()->getParam('id');
22
+
23
+ $wlisliderModel = Mage::getModel('wlislider/wlislider')->load($wlisliderId);
24
+
25
+ if ($wlisliderModel->getId() || $wlisliderId == 0) {
26
+
27
+ Mage::register('wlislider_data', $wlisliderModel);
28
+
29
+ $this->loadLayout();
30
+ $this->_setActiveMenu('wlislider/items');
31
+
32
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
33
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
34
+
35
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
36
+
37
+ $this->_addContent($this->getLayout()->createBlock('wlislider/adminhtml_wlislider_edit'))
38
+ ->_addLeft($this->getLayout()->createBlock('wlislider/adminhtml_wlislider_edit_tabs'));
39
+
40
+ $this->renderLayout();
41
+ } else {
42
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('wlislider')->__('Item does not exist'));
43
+ $this->_redirect('*/*/');
44
+ }
45
+ }
46
+
47
+ public function newAction()
48
+ {
49
+ $this->_forward('edit');
50
+ }
51
+
52
+ public function saveAction()
53
+ {
54
+ if ( $this->getRequest()->getPost() ) {
55
+ try {
56
+ $postData = $this->getRequest()->getPost();
57
+ $wlisliderModel = Mage::getModel('wlislider/wlislider');
58
+ if(isset($_FILES['image']['name']) && $_FILES['image']['name'] != '')
59
+ {
60
+ try
61
+ {
62
+ if($this->getRequest()->getParam('id'))
63
+ {
64
+ $wlisliderModel->load($this->getRequest()->getParam('id'));
65
+ if($wlisliderModel->getImage())
66
+ {
67
+ $this->removeRequiredImages($wlisliderModel->getImage());
68
+ }
69
+ }
70
+ /* Upload Image Code Start */
71
+ $fileName = time()."_".$_FILES['image']['name'];
72
+ $fileExt = strtolower(substr(strrchr($fileName, "."), 1));
73
+ $fileNamewoe = rtrim($fileName, $fileExt);
74
+ $fileName = str_replace(' ', '', $fileNamewoe) . $fileExt;
75
+
76
+ $uploader = new Varien_File_Uploader('image');
77
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png')); //allowed extensions
78
+ $uploader->setAllowRenameFiles(false);
79
+ $uploader->setFilesDispersion(false);
80
+ $path = Mage::getBaseDir('media') . DS . 'wlislider';
81
+
82
+ if(!is_dir($path))
83
+ {
84
+ mkdir($path, 0777, true);
85
+ }
86
+
87
+ $uploader->save($path . DS, $fileName );
88
+ /* End code for image upload */
89
+
90
+
91
+
92
+
93
+ }catch (Exception $e)
94
+ {
95
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
96
+ $this->_redirect('*/*/');
97
+ return;
98
+ }
99
+ }else
100
+ {
101
+ if(isset($postData['image']['delete']) && $postData['image']['delete'] == 1)
102
+ {
103
+ $fileName = '';
104
+ $wlisliderModel->load($this->getRequest()->getParam('id'));
105
+ if($wlisliderModel->getImage())
106
+ {
107
+ $this->removeRequiredImages($wlisliderModel->getImage());
108
+ }
109
+ } else
110
+ {
111
+ unset($fileName);
112
+ }
113
+ }
114
+
115
+
116
+ $wlisliderModel->setId($this->getRequest()->getParam('id'))
117
+ ->setTitle($postData['title'])
118
+ ->setImage($fileName)
119
+ ->setImageurl($postData['imageurl'])
120
+ ->setStatus($postData['status'])
121
+ ->save();
122
+
123
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully saved'));
124
+ Mage::getSingleton('adminhtml/session')->setWlisliderData(false);
125
+
126
+ $this->_redirect('*/*/');
127
+ return;
128
+ } catch (Exception $e) {
129
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
130
+ Mage::getSingleton('adminhtml/session')->setWlisliderData($this->getRequest()->getPost());
131
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
132
+ return;
133
+ }
134
+ }
135
+ $this->_redirect('*/*/');
136
+ }
137
+
138
+ public function deleteAction()
139
+ {
140
+ if( $this->getRequest()->getParam('id') > 0 ) {
141
+ try {
142
+ $wlisliderModel = Mage::getModel('wlislider/wlislider');
143
+
144
+ $wlisliderModel->setId($this->getRequest()->getParam('id'))
145
+ ->delete();
146
+
147
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
148
+ $this->_redirect('*/*/');
149
+ } catch (Exception $e) {
150
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
151
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
152
+ }
153
+ }
154
+ $this->_redirect('*/*/');
155
+ }
156
+ /**
157
+ * Product grid for AJAX request.
158
+ * Sort and filter result for example.
159
+ */
160
+ public function gridAction()
161
+ {
162
+ $this->loadLayout();
163
+ $this->getResponse()->setBody(
164
+ $this->getLayout()->createBlock('wlislider/adminhtml_wlislider_grid')->toHtml()
165
+ );
166
+ }
167
+
168
+ /**
169
+ * Remove Required Images for edit/delete data.
170
+ */
171
+ public function removeRequiredImages($fileName)
172
+ {
173
+ if(!($fileName)) return;
174
+
175
+ $orignalImg = Mage::getBaseDir('media') . DS . 'wlislider'.DS. $fileName;
176
+
177
+ if(file_exists($orignalImg)) {
178
+ unlink($orignalImg);
179
+ }
180
+ }
181
+ }
app/code/local/Wli/Wlislider/controllers/IndexController.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wli_Wlislider_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->renderLayout();
8
+ }
9
+ }
app/code/local/Wli/Wlislider/etc/adminhtml.xml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <menu>
4
+ <wlislider module="wlislider">
5
+ <title>Wlislider</title>
6
+ <sort_order>71</sort_order>
7
+ <children>
8
+ <items module="wlislider">
9
+ <title>Manage Items</title>
10
+ <sort_order>71</sort_order>
11
+ <action>wlislider/adminhtml_wlislider</action>
12
+ </items>
13
+ </children>
14
+ </wlislider>
15
+ </menu>
16
+ <acl>
17
+ <resources>
18
+ <admin>
19
+ <children>
20
+ <system>
21
+ <children>
22
+ <config>
23
+ <children>
24
+ <wli_wlislider>
25
+ <title>Wli Slider</title>
26
+ </wli_wlislider>
27
+ </children>
28
+ </config>
29
+ </children>
30
+ </system>
31
+ </children>
32
+ </admin>
33
+ </resources>
34
+ </acl>
35
+ <layout>
36
+ <updates>
37
+ <wlislider>
38
+ <file>wlislider.xml</file>
39
+ </wlislider>
40
+ </updates>
41
+ </layout>
42
+ </config>
app/code/local/Wli/Wlislider/etc/config.xml ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Wli_Wlislider>
5
+ <version>0.1.0</version>
6
+ </Wli_Wlislider>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <wlislider>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Wli_Wlislider</module>
14
+ <frontName>wlislider</frontName>
15
+ </args>
16
+ </wlislider>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <wlislider>
21
+ <file>wlislider.xml</file>
22
+ </wlislider>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <wlislider>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Wli_Wlislider</module>
32
+ <frontName>wlislider</frontName>
33
+ </args>
34
+ </wlislider>
35
+ </routers>
36
+ </admin>
37
+ <adminhtml>
38
+ <acl>
39
+ <resources>
40
+ <all>
41
+ <title>Allow Everything</title>
42
+ </all>
43
+ </resources>
44
+ </acl>
45
+ <layout>
46
+ <updates>
47
+ <wlislider>
48
+ <file>wlislider.xml</file>
49
+ </wlislider>
50
+ </updates>
51
+ </layout>
52
+ </adminhtml>
53
+ <wli_wlislider>
54
+ <wli_wlislider>
55
+ <transitionTime>1.5</transitionTime>
56
+ </wli_wlislider>
57
+ </wli_wlislider>
58
+ <global>
59
+ <models>
60
+ <wlislider>
61
+ <class>Wli_Wlislider_Model</class>
62
+ <resourceModel>wlislider_mysql4</resourceModel>
63
+ </wlislider>
64
+ <wlislider_mysql4>
65
+ <class>Wli_Wlislider_Model_Mysql4</class>
66
+ <entities>
67
+ <wlislider>
68
+ <table>wlislider</table>
69
+ </wlislider>
70
+ </entities>
71
+ </wlislider_mysql4>
72
+ </models>
73
+ <resources>
74
+ <wlislider_setup>
75
+ <setup>
76
+ <module>Wli_Wlislider</module>
77
+ </setup>
78
+ <connection>
79
+ <use>core_setup</use>
80
+ </connection>
81
+ </wlislider_setup>
82
+ <wlislider_write>
83
+ <connection>
84
+ <use>core_write</use>
85
+ </connection>
86
+
87
+
88
+ </wlislider_write>
89
+ <wlislider_read>
90
+ <connection>
91
+ <use>core_read</use>
92
+ </connection>
93
+ </wlislider_read>
94
+ </resources>
95
+ <blocks>
96
+ <page>
97
+ <rewrite>
98
+ <html_header>Wli_Wlislider_Block_Html_Header</html_header>
99
+ </rewrite>
100
+ </page>
101
+ </blocks>
102
+ <blocks>
103
+ <wlislider>
104
+ <class>Wli_Wlislider_Block</class>
105
+ </wlislider>
106
+ </blocks>
107
+ <helpers>
108
+ <wlislider>
109
+ <class>Wli_Wlislider_Helper</class>
110
+ </wlislider>
111
+ </helpers>
112
+ </global>
113
+ </config>
app/code/local/Wli/Wlislider/etc/system.xml ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <wlislider translate="label" module="wlislider">
5
+ <label>Wli Slider</label>
6
+ <sort_order>250</sort_order>
7
+ </wlislider>
8
+ </tabs>
9
+ <sections>
10
+ <wli_wlislider>
11
+ <label>Wli Slider</label>
12
+ <tab>wlislider</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>1000</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <wli_wlislider translate="label" module="wlislider">
20
+ <label>Wlislider Menu: Config General</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>1000</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <interval translate="label">
28
+ <label>Interval: </label>
29
+ <comment>Time interval between each slide transition</comment>
30
+ <frontend_type>text</frontend_type>
31
+ <sort_order>20</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ </interval>
36
+ <autoplay translate="label">
37
+ <label>Auto Play: </label>
38
+ <comment>Decides whether to start the show automatically</comment>
39
+ <frontend_type>select</frontend_type>
40
+ <sort_order>90</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ <source_model>adminhtml/system_config_source_yesno</source_model>
45
+ </autoplay>
46
+ <transitionType translate="label">
47
+ <label>Transition Type: </label>
48
+ <comment>Type of transition. Either a fading slideshow or a slider.</comment>
49
+ <frontend_type>select</frontend_type>
50
+ <sort_order>91</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ <source_model>wlislider/slideroption</source_model>
55
+ </transitionType>
56
+ <transitionTime translate="label">
57
+ <label>Transition Time: </label>
58
+ <comment>Time taken to animate transition from one slide to the next.</comment>
59
+ <frontend_type>text</frontend_type>
60
+ <sort_order>92</sort_order>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>1</show_in_website>
63
+ <show_in_store>1</show_in_store>
64
+ </transitionTime>
65
+ <navigation translate="label">
66
+ <label>Navigation: </label>
67
+ <comment>Whether to generate/use navigation elements (eg: 1,2,3,4...etc) for each slide for quick navigation.</comment>
68
+ <frontend_type>select</frontend_type>
69
+ <sort_order>93</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>1</show_in_store>
73
+ <source_model>adminhtml/system_config_source_yesno</source_model>
74
+ </navigation>
75
+ <controls translate="label">
76
+ <label>Controls: </label>
77
+ <comment>Whether to generate/use control elements for forward,backward and stop/start.</comment>
78
+ <frontend_type>select</frontend_type>
79
+ <sort_order>94</sort_order>
80
+ <show_in_default>1</show_in_default>
81
+ <show_in_website>1</show_in_website>
82
+ <show_in_store>1</show_in_store>
83
+ <source_model>adminhtml/system_config_source_yesno</source_model>
84
+ </controls>
85
+ <captions translate="label">
86
+ <label>Captions: </label>
87
+ <comment>Whether to generate captions from the alt attribute of the img for each slide.</comment>
88
+ <frontend_type>select</frontend_type>
89
+ <sort_order>95</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ <source_model>adminhtml/system_config_source_yesno</source_model>
94
+ </captions>
95
+ <pauseonhover translate="label">
96
+ <label>Pause On Hover: </label>
97
+ <comment>Pause the show when mouse is hovered over the show element.</comment>
98
+ <frontend_type>select</frontend_type>
99
+ <sort_order>96</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>1</show_in_website>
102
+ <show_in_store>1</show_in_store>
103
+ <source_model>adminhtml/system_config_source_yesno</source_model>
104
+ </pauseonhover>
105
+ <keyboardControls translate="label">
106
+ <label>keyboard Controls: </label>
107
+ <comment>Bind arrow keys as keyboard controls for forward and backward.</comment>
108
+ <frontend_type>select</frontend_type>
109
+ <sort_order>97</sort_order>
110
+ <show_in_default>1</show_in_default>
111
+ <show_in_website>1</show_in_website>
112
+ <show_in_store>1</show_in_store>
113
+ <source_model>adminhtml/system_config_source_yesno</source_model>
114
+ </keyboardControls>
115
+ <progressTimer translate="label">
116
+ <label>Progress Timer: </label>
117
+ <comment>Generate a "whirling" progress timer element to mark progress until next transition occurs. Only available in browsers that support HTML5 canvas.</comment>
118
+ <frontend_type>select</frontend_type>
119
+ <sort_order>98</sort_order>
120
+ <show_in_default>1</show_in_default>
121
+ <show_in_website>1</show_in_website>
122
+ <show_in_store>1</show_in_store>
123
+ <source_model>adminhtml/system_config_source_yesno</source_model>
124
+ </progressTimer>
125
+
126
+
127
+
128
+
129
+
130
+ </fields>
131
+ </wli_wlislider>
132
+ </groups>
133
+ </wli_wlislider>
134
+ </sections>
135
+ </config>
app/code/local/Wli/Wlislider/sql/wlislider_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ -- DROP TABLE IF EXISTS {$this->getTable('wlislider')};
10
+ CREATE TABLE {$this->getTable('wlislider')} (
11
+ `wlislider_id` int(11) unsigned NOT NULL auto_increment,
12
+ `title` varchar(255) NOT NULL default '',
13
+ `image` varchar(255) NOT NULL default '',
14
+ `imageurl` varchar(255) NOT NULL default '',
15
+ `status` smallint(6) NOT NULL default '0',
16
+ PRIMARY KEY (`wlislider_id`)
17
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
18
+
19
+ ");
20
+
21
+ $installer->endSetup();
app/design/frontend/base/default/layout/wlislider.xml ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package base_default
24
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <layout version="0.1.0">
29
+ <!--
30
+ Default layout, loads most of the pages
31
+ -->
32
+ <default translate="label" module="page">
33
+ <reference name="head">
34
+
35
+
36
+
37
+ <action method="removeItem"><type>skin_css</type><name>css/styles.css</name></action>
38
+ <action method="addItem"><type>skin_css</type><name>css/slider/reset.css</name></action>
39
+ <action method="addItem"><type>skin_css</type><name>css/slider/protoshow.css</name></action>
40
+ <action method="addItem"><type>skin_css</type><name>css/slider/site.css</name></action>
41
+ <action method="addItem"><type>skin_css</type><name>css/styles.css</name></action>
42
+
43
+
44
+
45
+ <action method="addJs"><script>prototype/prototype.js</script></action>
46
+ <action method="addJs"><script>lib/ccard.js</script></action>
47
+ <action method="addJs"><script>prototype/validation.js</script></action>
48
+ <action method="addJs"><script>scriptaculous/scriptaculous.js</script></action>
49
+ <action method="addJs"><script>scriptaculous/builder.js</script></action>
50
+ <action method="addJs"><script>scriptaculous/effects.js</script></action>
51
+ <action method="addJs"><script>scriptaculous/dragdrop.js</script></action>
52
+ <action method="addJs"><script>scriptaculous/controls.js</script></action>
53
+ <action method="addJs"><script>scriptaculous/slider.js</script></action>
54
+ <action method="addJs"><script>varien/js.js</script></action>
55
+ <action method="addJs"><script>varien/form.js</script></action>
56
+ <action method="addJs"><script>varien/menu.js</script></action>
57
+ <action method="addJs"><script>mage/translate.js</script></action>
58
+ <action method="addJs"><script>mage/cookies.js</script></action>
59
+
60
+ <action method="addJs"><script>slider/site.js</script></action>
61
+
62
+
63
+ <block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
64
+
65
+ <action method="addCss"><stylesheet>css/styles.css</stylesheet></action>
66
+ <action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 8</if></action>
67
+ <action method="addCss"><stylesheet>css/widgets.css</stylesheet></action>
68
+ <action method="addCss"><stylesheet>css/print.css</stylesheet><params>media="print"</params></action>
69
+
70
+ <action method="addItem"><type>js</type><name>lib/ds-sleight.js</name><params/><if>lt IE 7</if></action>
71
+ <action method="addItem"><type>skin_js</type><name>js/ie6.js</name><params/><if>lt IE 7</if></action>
72
+ </reference>
73
+ </default>
74
+ </layout>
app/design/frontend/base/default/template/wlislider/page/html/header.phtml ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once ("protoshow.php");
3
+
4
+ /**
5
+ * Magento
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Academic Free License (AFL 3.0)
10
+ * that is bundled with this package in the file LICENSE_AFL.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/afl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * DISCLAIMER
18
+ *
19
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
20
+ * versions in the future. If you wish to customize Magento for your
21
+ * needs please refer to http://www.magentocommerce.com for more information.
22
+ *
23
+ * @category design
24
+ * @package base_default
25
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
26
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
27
+ */
28
+ /**
29
+ * @var Mage_Page_Block_Html_Header $this
30
+ */
31
+
32
+ ?>
33
+ <?php $collection = $this->getCollection(); ?>
34
+ <div class="header-container">
35
+ <div class="header">
36
+ <?php if ($this->getIsHomePage()):?>
37
+ <h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>
38
+ <?php else:?>
39
+ <a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a>
40
+ <?php endif?>
41
+ <div class="quick-access">
42
+ <?php echo $this->getChildHtml('topSearch') ?>
43
+ <p class="welcome-msg"><?php echo $this->getChildHtml('welcome') ?> <?php echo $this->getAdditionalHtml() ?></p>
44
+ <?php echo $this->getChildHtml('topLinks') ?>
45
+ <?php echo $this->getChildHtml('store_language') ?>
46
+ </div>
47
+ <?php echo $this->getChildHtml('topContainer'); ?>
48
+ </div>
49
+ </div>
50
+ <?php echo $this->getChildHtml('topMenu') ?>
51
+ <?php if($collection->getSize()):
52
+ $sliderdata = $collection->getdata();
53
+ $UrlData=$this->getRequest()->getParams();
54
+ ?>
55
+ <?php if($UrlData['id']=="")
56
+ { ?>
57
+ <div id="myshow1" class="protoshow">
58
+ <ul class="show">
59
+ <?php foreach($sliderdata as $slider) {?>
60
+ <?php $url = Mage::getBaseUrl('media') . 'wlislider'.DS. $slider['image']; ?>
61
+ <li class="slide" data-slide-interval=""><a href="<?php echo $slider['imageurl'];?>" target="_blank"><img src="<?php echo $url; ?>" alt="<?php echo $slider['title']?>" height="300px;" width="900px;"/></a></li>
62
+ <?php }?>
63
+
64
+
65
+ </ul>
66
+ </div>
67
+ <?php }?>
68
+ <?php endif ?>
app/etc/modules/Wli_Wlislider.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <config>
3
+ <modules>
4
+ <Wli_Wlislider>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Wli_Wlislider>
8
+ </modules>
9
+ </config>
js/slider/123protoshow.js ADDED
@@ -0,0 +1,746 @@