Medma_Video_Testimonials - Version 1.0.0

Version Notes

This module gives facility to upload multiple videos for product (per product from Customer end) and (per category from Admin end). You don't need to upload video. Just add video URL from youtube.

Admin has the right to approve or disapprove Customer's video.

Download this release

Release Info

Developer Medma Infomatix
Extension Medma_Video_Testimonials
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (63) hide show
  1. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials.php +12 -0
  2. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Edit.php +166 -0
  3. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Edit/Form.php +19 -0
  4. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Edit/Tab/Form.php +108 -0
  5. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Edit/Tabs.php +24 -0
  6. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Grid.php +130 -0
  7. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Renderer/Category.php +19 -0
  8. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Renderer/CountCategory.php +15 -0
  9. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials.php +13 -0
  10. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Edit.php +48 -0
  11. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Edit/Form.php +19 -0
  12. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Edit/Tab/Form.php +86 -0
  13. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Edit/Tab/Video.php +14 -0
  14. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Edit/Tabs.php +30 -0
  15. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Grid.php +141 -0
  16. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Renderer/Category.php +19 -0
  17. app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Renderer/Customerproduct.php +19 -0
  18. app/code/local/Medma/Admintestimonials/Block/Admintestimonials.php +17 -0
  19. app/code/local/Medma/Admintestimonials/Block/Catalog/Product/View.php +44 -0
  20. app/code/local/Medma/Admintestimonials/Helper/Data.php +6 -0
  21. app/code/local/Medma/Admintestimonials/Model/Admintestimonials.php +10 -0
  22. app/code/local/Medma/Admintestimonials/Model/Category.php +40 -0
  23. app/code/local/Medma/Admintestimonials/Model/Customerproduct.php +21 -0
  24. app/code/local/Medma/Admintestimonials/Model/Customerstatus.php +18 -0
  25. app/code/local/Medma/Admintestimonials/Model/Customertestimonials.php +10 -0
  26. app/code/local/Medma/Admintestimonials/Model/Mysql4/Admintestimonials.php +10 -0
  27. app/code/local/Medma/Admintestimonials/Model/Mysql4/Admintestimonials/Collection.php +10 -0
  28. app/code/local/Medma/Admintestimonials/Model/Mysql4/Customertestimonials.php +10 -0
  29. app/code/local/Medma/Admintestimonials/Model/Mysql4/Customertestimonials/Collection.php +10 -0
  30. app/code/local/Medma/Admintestimonials/Model/Status.php +15 -0
  31. app/code/local/Medma/Admintestimonials/controllers/Adminhtml/AdmintestimonialsController.php +217 -0
  32. app/code/local/Medma/Admintestimonials/controllers/Adminhtml/CustomertestimonialsController.php +215 -0
  33. app/code/local/Medma/Admintestimonials/controllers/IndexController.php +35 -0
  34. app/code/local/Medma/Admintestimonials/etc/config.xml +137 -0
  35. app/code/local/Medma/Admintestimonials/sql/admintestimonials_setup/mysql4-install-0.1.0.php +23 -0
  36. app/code/local/Medma/Admintestimonials/sql/admintestimonials_setup/mysql4-upgrade-0.1.0-0.2.2.php +25 -0
  37. app/design/adminhtml/default/default/layout/admintestimonials.xml +13 -0
  38. app/design/adminhtml/default/default/template/admintestimonials/customers/customervidtestvideo.phtml +44 -0
  39. app/design/adminhtml/default/default/template/admintestimonials/form.phtml +70 -0
  40. app/design/frontend/default/default/layout/videotestimonials.xml +10 -0
  41. app/design/frontend/default/default/template/videotestimonials/catalog/product/view.phtml +163 -0
  42. app/design/frontend/default/default/template/videotestimonials/catalog/product/view/videoslider.phtml +265 -0
  43. app/etc/modules/Medma_Admintestimonials.xml +9 -0
  44. package.xml +22 -0
  45. skin/frontend/default/default/css/colorbox.css +85 -0
  46. skin/frontend/default/default/css/skin.css +229 -0
  47. skin/frontend/default/default/images/video/border.png +0 -0
  48. skin/frontend/default/default/images/video/controls.png +0 -0
  49. skin/frontend/default/default/images/video/ie6/borderBottomCenter.png +0 -0
  50. skin/frontend/default/default/images/video/ie6/borderBottomLeft.png +0 -0
  51. skin/frontend/default/default/images/video/ie6/borderBottomRight.png +0 -0
  52. skin/frontend/default/default/images/video/ie6/borderMiddleLeft.png +0 -0
  53. skin/frontend/default/default/images/video/ie6/borderMiddleRight.png +0 -0
  54. skin/frontend/default/default/images/video/ie6/borderTopCenter.png +0 -0
  55. skin/frontend/default/default/images/video/ie6/borderTopLeft.png +0 -0
  56. skin/frontend/default/default/images/video/ie6/borderTopRight.png +0 -0
  57. skin/frontend/default/default/images/video/loading.gif +0 -0
  58. skin/frontend/default/default/images/video/loading_background.png +0 -0
  59. skin/frontend/default/default/images/video/next-horizontal.png +0 -0
  60. skin/frontend/default/default/images/video/overlay.png +0 -0
  61. skin/frontend/default/default/images/video/prev-horizontal.png +0 -0
  62. skin/frontend/default/default/js/jquery.colorbox.js +888 -0
  63. skin/frontend/default/default/js/jquery.js +16 -0
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Medma_Admintestimonials_Block_Adminhtml_Admintestimonials extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_admintestimonials';
7
+ $this->_blockGroup = 'admintestimonials';
8
+ $this->_headerText = Mage::helper('admintestimonials')->__('Item Manager');
9
+ $this->_addButtonLabel = Mage::helper('admintestimonials')->__('Add Item');
10
+ parent::__construct();
11
+ }
12
+ }
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Edit.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Block_Adminhtml_Admintestimonials_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 = 'admintestimonials';
11
+ $this->_controller = 'adminhtml_admintestimonials';
12
+
13
+ $this->_updateButton('save', 'label', Mage::helper('admintestimonials')->__('Save Item'));
14
+ $this->_updateButton('delete', 'label', Mage::helper('admintestimonials')->__('Delete Item'));
15
+
16
+ $this->_addButton('saveandcontinue', array(
17
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
+ 'onclick' => 'saveAndContinueEdit()',
19
+ 'class' => 'save',
20
+ ), -100);
21
+ $required = '<span class="required">*</span>';
22
+ $removeButton = '';
23
+ $this->_formScripts[] = "
24
+ function toggleEditor() {
25
+ if (tinyMCE.getInstanceById('admintestimonials_content') == null) {
26
+ tinyMCE.execCommand('mceAddControl', false, 'admintestimonials_content');
27
+ } else {
28
+ tinyMCE.execCommand('mceRemoveControl', false, 'admintestimonials_content');
29
+ }
30
+ }
31
+
32
+ function saveAndContinueEdit(){
33
+ editForm.submit($('edit_form').action+'back/edit/');
34
+ }
35
+ function addNewDiv()
36
+ {
37
+ filecount = document.getElementById('video_link_length').value;
38
+ if(filecount == '')
39
+ filecount =1;
40
+
41
+
42
+ filecount++;
43
+
44
+ video_url_txtbox = 'video_url_'+filecount;
45
+
46
+ position_txtbox = 'position_'+filecount;
47
+
48
+ status_txtbox = 'status_'+filecount;
49
+
50
+ var tbody = document.getElementById('edit_form').getElementsByTagName('tbody')[0];
51
+
52
+ var row = document.createElement('tr');
53
+ row.setAttribute('id', 'video_row'+filecount);
54
+ var data1 = document.createElement('td');
55
+ data1.setAttribute('class','label');
56
+ data1.innerHTML='Youtube Video Url $required';
57
+
58
+ var data2 = document.createElement('td');
59
+ data2.setAttribute('class','value');
60
+
61
+ var textbox = document.createElement('input');
62
+
63
+ textbox.setAttribute('type', 'text');
64
+ textbox.setAttribute('name', video_url_txtbox);
65
+ textbox.setAttribute('class', 'input-text required-entry');
66
+ textbox.setAttribute('value', '');
67
+
68
+ data2.appendChild(textbox);
69
+
70
+ row.appendChild(data1);
71
+ row.appendChild(data2);
72
+ tbody.appendChild(row);
73
+
74
+ var row = document.createElement('tr');
75
+ row.setAttribute('id', 'position_row'+filecount);
76
+ var data1 = document.createElement('td');
77
+ data1.setAttribute('class','label');
78
+ data1.innerHTML='Position $required';
79
+
80
+ var data2 = document.createElement('td');
81
+ data2.setAttribute('class','value');
82
+
83
+ var textbox = document.createElement('input');
84
+
85
+ textbox.setAttribute('type', 'text');
86
+ textbox.setAttribute('name', position_txtbox);
87
+ textbox.setAttribute('class', 'input-text required-entry');
88
+ textbox.setAttribute('value', '');
89
+
90
+ data2.appendChild(textbox);
91
+
92
+ row.appendChild(data1);
93
+ row.appendChild(data2);
94
+ tbody.appendChild(row);
95
+
96
+ var row = document.createElement('tr');
97
+ row.setAttribute('id', 'status_row'+filecount);
98
+ var data1 = document.createElement('td');
99
+ data1.setAttribute('class','label');
100
+ data1.innerHTML='Status ';
101
+
102
+ var data2 = document.createElement('td');
103
+ data2.setAttribute('class','value');
104
+
105
+ var textbox = document.createElement('select');
106
+
107
+ textbox.setAttribute('type', 'select');
108
+ textbox.setAttribute('name', status_txtbox);
109
+ textbox.setAttribute('id', status_txtbox);
110
+ textbox.setAttribute('class', '');
111
+ textbox.setAttribute('value', '');
112
+
113
+ data2.appendChild(textbox);
114
+
115
+ var data3 = document.createElement('td');
116
+ var button = document.createElement('button');
117
+
118
+ button.setAttribute('type', 'button');
119
+ button.setAttribute('name', filecount);
120
+ button.setAttribute('id', filecount);
121
+ button.setAttribute('class', 'scalable delete');
122
+ button.setAttribute('onclick', 'removevideodivs(this.id)');
123
+ button.innerHTML = 'Remove';
124
+ data3.appendChild(button);
125
+ row.appendChild(data1);
126
+ row.appendChild(data2);
127
+ row.appendChild(data3);
128
+ tbody.appendChild(row);
129
+
130
+ var s= document.getElementById(status_txtbox);
131
+ s.options[s.options.length]= new Option('Enabled', '1');
132
+ s.options[s.options.length]= new Option('Disabled', '2');
133
+
134
+ document.getElementById('video_link_length').value=filecount;
135
+
136
+ }
137
+ function removevideodivs(id)
138
+ {
139
+ var tbody = document.getElementById('edit_form').getElementsByTagName('tbody')[0];
140
+ var tr = document.getElementById('video_row'+id);
141
+
142
+ tbody.removeChild(tr);
143
+
144
+ var tr = document.getElementById('status_row'+id);
145
+
146
+ tbody.removeChild(tr);
147
+
148
+ var tr = document.getElementById('position_row'+id);
149
+
150
+ tbody.removeChild(tr);
151
+ }
152
+ ";
153
+ }
154
+
155
+ public function getHeaderText()
156
+ {
157
+ if( Mage::registry('admintestimonials_data') && Mage::registry('admintestimonials_data')->getId() ) {
158
+ $category_id = $this->htmlEscape(Mage::registry('admintestimonials_data')->getCategoryId());
159
+ $loadedCategory = Mage::getModel('catalog/category')->load($category_id);
160
+ //$loadedCategory->getName();
161
+ return Mage::helper('admintestimonials')->__("Edit Item '%s'", $loadedCategory->getName());
162
+ } else {
163
+ return Mage::helper('admintestimonials')->__('Add Item');
164
+ }
165
+ }
166
+ }
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Block_Adminhtml_Admintestimonials_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/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Edit/Tab/Form.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Block_Adminhtml_Admintestimonials_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form();
8
+ $this->setForm($form);
9
+
10
+ $categoryArr = $this->_categotyFilter();
11
+
12
+ $fieldset = $form->addFieldset('admintestimonials_form', array('legend'=>Mage::helper('admintestimonials')->__('Item information')));
13
+
14
+ if(count($categoryArr) > 0){
15
+
16
+ $this->setTemplate('admintestimonials/form.phtml');
17
+
18
+ }else {
19
+
20
+ $fieldset->addField('category_id', 'select', array(
21
+ 'label' => Mage::helper('admintestimonials')->__('Category'),
22
+ 'name' => 'category_id',
23
+ 'required' =>true,
24
+ 'values' => Mage::getModel('admintestimonials/category')->toOptionArray(),
25
+
26
+ ));
27
+
28
+
29
+ $fieldset->addField('addmore', 'note', array(
30
+ 'text' => $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
31
+ 'label' => Mage::helper('admintestimonials')->__('Add More Video '),
32
+ 'onclick' => "addNewDiv();",
33
+ 'class' => '',
34
+ )) ->toHtml(),
35
+ ));
36
+
37
+
38
+ $fieldset->addField('video_link_length', 'hidden', array(
39
+ 'label' => Mage::helper('admintestimonials')->__('Youtube Video Url'),
40
+ 'name' => 'video_link_length',
41
+ ));
42
+
43
+ $fieldset->addField('video_url', 'text', array(
44
+ 'label' => Mage::helper('admintestimonials')->__('Youtube Video Url'),
45
+ 'class' => 'required-entry',
46
+ 'required' => true,
47
+ 'name' => 'video_url_1',
48
+ ));
49
+
50
+ $fieldset->addField('position', 'text', array(
51
+ 'label' => Mage::helper('admintestimonials')->__('Position'),
52
+ 'required' => true,
53
+ 'name' => 'position_1',
54
+ ));
55
+
56
+ /*$fieldset->addField('filename', 'file', array(
57
+ 'label' => Mage::helper('admintestimonials')->__('File'),
58
+ 'required' => false,
59
+ 'name' => 'filename',
60
+ ));*/
61
+
62
+ $fieldset->addField('status', 'select', array(
63
+ 'label' => Mage::helper('admintestimonials')->__('Status'),
64
+ 'name' => 'status_1',
65
+ 'values' => array(
66
+ array(
67
+ 'value' => 1,
68
+ 'label' => Mage::helper('admintestimonials')->__('Enabled'),
69
+ ),
70
+
71
+ array(
72
+ 'value' => 2,
73
+ 'label' => Mage::helper('admintestimonials')->__('Disabled'),
74
+ ),
75
+ ),
76
+ ));
77
+ }
78
+
79
+ /*$fieldset->addField('content', 'editor', array(
80
+ 'name' => 'content',
81
+ 'label' => Mage::helper('admintestimonials')->__('Content'),
82
+ 'title' => Mage::helper('admintestimonials')->__('Content'),
83
+ 'style' => 'width:700px; height:500px;',
84
+ 'wysiwyg' => false,
85
+ 'required' => true,
86
+ ));*/
87
+
88
+ if ( Mage::getSingleton('adminhtml/session')->getAdmintestimonialsData() )
89
+ {
90
+ // $form->setValues(Mage::getSingleton('adminhtml/session')->getAdmintestimonialsData());
91
+ Mage::getSingleton('adminhtml/session')->setAdmintestimonialsData(null);
92
+ } elseif ( Mage::registry('admintestimonials_data') ) {
93
+ // $form->setValues(Mage::registry('admintestimonials_data')->getData());
94
+ }
95
+ return parent::_prepareForm();
96
+ }
97
+
98
+ public function _categotyFilter()
99
+ {
100
+ $category_id = Mage::getSingleton('adminhtml/session')->getCategoryId();
101
+
102
+ $categoryFilterCollections = Mage::getModel('admintestimonials/admintestimonials')->getCollection()->addFieldToFilter('category_id', $category_id)->getData();
103
+
104
+ return $categoryFilterCollections;
105
+
106
+ }
107
+
108
+ }
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Edit/Tabs.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Block_Adminhtml_Admintestimonials_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('admintestimonials_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('admintestimonials')->__('Item Information'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('form_section', array(
17
+ 'label' => Mage::helper('admintestimonials')->__('Item Information'),
18
+ 'title' => Mage::helper('admintestimonials')->__('Item Information'),
19
+ 'content' => $this->getLayout()->createBlock('admintestimonials/adminhtml_admintestimonials_edit_tab_form')->toHtml(),
20
+ ));
21
+
22
+ return parent::_beforeToHtml();
23
+ }
24
+ }
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Grid.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Block_Adminhtml_Admintestimonials_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('admintestimonialsGrid');
9
+ $this->setDefaultSort('admintestimonials_id');
10
+ $this->setDefaultDir('ASC');
11
+ $this->setSaveParametersInSession(true);
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('admintestimonials/admintestimonials')->getCollection()->addFieldToSelect('admintestimonials_id')->addFieldToSelect('category_id');
17
+
18
+ $collection->getSelect()->group('category_id');
19
+ $this->setCollection($collection);
20
+ return parent::_prepareCollection();
21
+ }
22
+
23
+ protected function _prepareColumns()
24
+ {
25
+ $this->addColumn('admintestimonials_id', array(
26
+ 'header' => Mage::helper('admintestimonials')->__('ID'),
27
+ 'align' =>'right',
28
+ 'width' => '50px',
29
+ 'index' => 'admintestimonials_id',
30
+ ));
31
+
32
+ /*$this->addColumn('video_url', array(
33
+ 'header' => Mage::helper('admintestimonials')->__('Youtube Video Url'),
34
+ 'align' =>'left',
35
+ 'index' => 'video_url',
36
+ ));*/
37
+
38
+
39
+ /*$this->addColumn('position', array(
40
+ 'header' => Mage::helper('admintestimonials')->__('Position'),
41
+ 'align' =>'left',
42
+ 'index' => 'position',
43
+ ));*/
44
+
45
+
46
+ $this->addColumn('category_id', array(
47
+ 'header' => Mage::helper('sales')->__('Category '),
48
+ 'renderer' =>'Medma_Admintestimonials_Block_Adminhtml_Admintestimonials_Renderer_Category',
49
+ 'type' => 'text',
50
+ ));
51
+
52
+ $this->addColumn('', array(
53
+ 'header' => Mage::helper('sales')->__('Number Of Records '),
54
+ 'renderer' =>'Medma_Admintestimonials_Block_Adminhtml_Admintestimonials_Renderer_CountCategory',
55
+ 'type' => 'text',
56
+ ));
57
+
58
+ /*$this->addColumn('status', array(
59
+ 'header' => Mage::helper('admintestimonials')->__('Status'),
60
+ 'align' => 'left',
61
+ 'width' => '80px',
62
+ 'index' => 'status',
63
+ 'type' => 'options',
64
+ 'options' => array(
65
+ 1 => 'Enabled',
66
+ 2 => 'Disabled',
67
+ ),
68
+ ));*/
69
+
70
+ $this->addColumn('action',
71
+ array(
72
+ 'header' => Mage::helper('admintestimonials')->__('Action'),
73
+ 'width' => '100',
74
+ 'type' => 'action',
75
+ 'getter' => 'getId',
76
+ 'actions' => array(
77
+ array(
78
+ 'caption' => Mage::helper('admintestimonials')->__('Edit'),
79
+ 'url' => array('base'=> '*/*/edit'),
80
+ 'field' => 'id'
81
+ )
82
+ ),
83
+ 'filter' => false,
84
+ 'sortable' => false,
85
+ 'index' => 'stores',
86
+ 'is_system' => true,
87
+ ));
88
+
89
+ $this->addExportType('*/*/exportCsv', Mage::helper('admintestimonials')->__('CSV'));
90
+ $this->addExportType('*/*/exportXml', Mage::helper('admintestimonials')->__('XML'));
91
+
92
+ return parent::_prepareColumns();
93
+ }
94
+
95
+ protected function _prepareMassaction()
96
+ {
97
+ $this->setMassactionIdField('admintestimonials_id');
98
+ $this->getMassactionBlock()->setFormFieldName('admintestimonials');
99
+
100
+ $this->getMassactionBlock()->addItem('delete', array(
101
+ 'label' => Mage::helper('admintestimonials')->__('Delete'),
102
+ 'url' => $this->getUrl('*/*/massDelete'),
103
+ 'confirm' => Mage::helper('admintestimonials')->__('Are you sure?')
104
+ ));
105
+
106
+ $statuses = Mage::getSingleton('admintestimonials/status')->getOptionArray();
107
+
108
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
109
+ $this->getMassactionBlock()->addItem('status', array(
110
+ 'label'=> Mage::helper('admintestimonials')->__('Change status'),
111
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
112
+ 'additional' => array(
113
+ 'visibility' => array(
114
+ 'name' => 'status',
115
+ 'type' => 'select',
116
+ 'class' => 'required-entry',
117
+ 'label' => Mage::helper('admintestimonials')->__('Status'),
118
+ 'values' => $statuses
119
+ )
120
+ )
121
+ ));
122
+ return $this;
123
+ }
124
+
125
+ public function getRowUrl($row)
126
+ {
127
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
128
+ }
129
+
130
+ }
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Renderer/Category.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Medma_Admintestimonials_Block_Adminhtml_Admintestimonials_Renderer_Category extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+
5
+ public function render(Varien_Object $row)
6
+ {
7
+ $Id = $row->getId();
8
+
9
+ $collection = Mage::getModel('admintestimonials/admintestimonials')->load($Id)->getData();
10
+ $category_id=$collection['category_id'];
11
+ Mage::getSingleton('adminhtml/session')->setGridCatagoryId($category_id);
12
+ $category=Mage::getModel('catalog/category')->load($category_id)->getName();
13
+
14
+ return $category;
15
+
16
+ }
17
+
18
+ }
19
+ ?>
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Admintestimonials/Renderer/CountCategory.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Medma_Admintestimonials_Block_Adminhtml_Admintestimonials_Renderer_CountCategory extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+
5
+ public function render(Varien_Object $row)
6
+ {
7
+ $Id = Mage::getSingleton('adminhtml/session')->getGridCatagoryId();
8
+ $collection = Mage::getModel('admintestimonials/admintestimonials')->getCollection()->addFieldToFilter('category_id', $Id);
9
+
10
+ return count($collection);
11
+
12
+ }
13
+
14
+ }
15
+ ?>
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Medma_Admintestimonials_Block_Adminhtml_Customertestimonials extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_customertestimonials';
7
+ $this->_blockGroup = 'admintestimonials';
8
+ $this->_headerText = Mage::helper('admintestimonials')->__('Item Manager');
9
+ //$this->_addButtonLabel = Mage::helper('admintestimonials')->__('Add Item');
10
+ parent::__construct();
11
+ $this->_removeButton('add');
12
+ }
13
+ }
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Edit.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Block_Adminhtml_Customertestimonials_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 = 'admintestimonials';
11
+ $this->_controller = 'adminhtml_customertestimonials';
12
+
13
+ $this->_updateButton('save', 'label', Mage::helper('admintestimonials')->__('Save Item'));
14
+ $this->_updateButton('delete', 'label', Mage::helper('admintestimonials')->__('Delete Item'));
15
+
16
+ $this->_addButton('saveandcontinue', array(
17
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
+ 'onclick' => 'saveAndContinueEdit()',
19
+ 'class' => 'save',
20
+ ), -100);
21
+
22
+ $this->_formScripts[] = "
23
+ function toggleEditor() {
24
+ if (tinyMCE.getInstanceById('customertestimonials_content') == null) {
25
+ tinyMCE.execCommand('mceAddControl', false, 'customertestimonials_content');
26
+ } else {
27
+ tinyMCE.execCommand('mceRemoveControl', false, 'customertestimonials_content');
28
+ }
29
+ }
30
+
31
+ function saveAndContinueEdit(){
32
+ editForm.submit($('edit_form').action+'back/edit/');
33
+ }
34
+ ";
35
+ }
36
+
37
+ public function getHeaderText()
38
+ {
39
+ if( Mage::registry('customertestimonials_data') && Mage::registry('customertestimonials_data')->getId() ) {
40
+ $product_id = $this->htmlEscape(Mage::registry('customertestimonials_data')->getProductId());
41
+ $loadedProduct = Mage::getModel('catalog/product')->load($product_id);
42
+ //$loadedCategory->getName();
43
+ return Mage::helper('admintestimonials')->__("Edit Item '%s'", $loadedProduct->getName());
44
+ } else {
45
+ return Mage::helper('admintestimonials')->__('Add Item');
46
+ }
47
+ }
48
+ }
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Block_Adminhtml_Customertestimonials_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/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Edit/Tab/Form.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Block_Adminhtml_Customertestimonials_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form();
8
+ $this->setForm($form);
9
+ $fieldset = $form->addFieldset('customertestimonials_form', array('legend'=>Mage::helper('admintestimonials')->__('Item information')));
10
+
11
+ $fieldset->addField('customer_title', 'text', array(
12
+ 'label' => Mage::helper('admintestimonials')->__('Title'),
13
+ 'class' => 'required-entry',
14
+ 'required' => true,
15
+ 'disabled' => true,
16
+ 'name' => 'customer_title',
17
+ ));
18
+
19
+ $fieldset->addField('customer_name', 'text', array(
20
+ 'label' => Mage::helper('admintestimonials')->__('Name'),
21
+ 'class' => 'required-entry',
22
+ 'required' => true,
23
+ 'disabled' => true,
24
+ 'name' => 'customer_name',
25
+ ));
26
+
27
+
28
+ $fieldset->addField('customer_email', 'text', array(
29
+ 'label' => Mage::helper('admintestimonials')->__('Email'),
30
+ 'class' => 'required-entry',
31
+ 'required' => true,
32
+ 'disabled' => true,
33
+ 'name' => 'customer_email',
34
+ ));
35
+
36
+
37
+ $fieldset->addField('customer_comment', 'editor', array(
38
+ 'label' => Mage::helper('admintestimonials')->__('Comments'),
39
+ 'class' => 'required-entry',
40
+ 'required' => true,
41
+ 'disabled' => true,
42
+ 'style' => 'width:300px; height:100px;',
43
+ 'name' => 'customer_comment',
44
+ ));
45
+
46
+
47
+ $fieldset->addField('product_id', 'select', array(
48
+ 'label' => Mage::helper('admintestimonials')->__('Product Name'),
49
+ 'name' => 'product_id',
50
+ 'required' =>true,
51
+ 'disabled' => true,
52
+ 'values' => Mage::getModel('admintestimonials/customerproduct')->toOptionArray(),
53
+
54
+ ));
55
+
56
+
57
+ $fieldset->addField('status', 'select', array(
58
+ 'label' => Mage::helper('admintestimonials')->__('Status'),
59
+ 'name' => 'status',
60
+ 'values' => array(
61
+ array(
62
+ 'value' => 0,
63
+ 'label' => Mage::helper('admintestimonials')->__('Pending'),
64
+ ),
65
+ array(
66
+ 'value' => 1,
67
+ 'label' => Mage::helper('admintestimonials')->__('Enabled'),
68
+ ),
69
+
70
+ array(
71
+ 'value' => 2,
72
+ 'label' => Mage::helper('admintestimonials')->__('Disabled'),
73
+ ),
74
+ ),
75
+ ));
76
+
77
+ if ( Mage::getSingleton('adminhtml/session')->getCustomertestimonialsData() )
78
+ {
79
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getCustomertestimonialsData());
80
+ Mage::getSingleton('adminhtml/session')->setCustomertestimonialsData(null);
81
+ } elseif ( Mage::registry('customertestimonials_data') ) {
82
+ $form->setValues(Mage::registry('customertestimonials_data')->getData());
83
+ }
84
+ return parent::_prepareForm();
85
+ }
86
+ }
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Edit/Tab/Video.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Block_Adminhtml_Customertestimonials_Edit_Tab_Video extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+
6
+ public function _construct()
7
+ {
8
+
9
+ $this->setTemplate('admintestimonials/customers/customervidtestvideo.phtml');
10
+
11
+ }
12
+
13
+
14
+ }
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Edit/Tabs.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Block_Adminhtml_Customertestimonials_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('customertestimonials_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('admintestimonials')->__('Item Information'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('form_section', array(
17
+ 'label' => Mage::helper('admintestimonials')->__('Item Information'),
18
+ 'title' => Mage::helper('admintestimonials')->__('Item Information'),
19
+ 'content' => $this->getLayout()->createBlock('admintestimonials/adminhtml_customertestimonials_edit_tab_form')->toHtml(),
20
+ ));
21
+
22
+ $this->addTab('video_section', array(
23
+ 'label' => Mage::helper('admintestimonials')->__('Uploaded Video'),
24
+ 'title' => Mage::helper('admintestimonials')->__('Uploaded Video'),
25
+ 'content' => $this->getLayout()->createBlock('admintestimonials/adminhtml_customertestimonials_edit_tab_video')->toHtml(),
26
+ ));
27
+
28
+ return parent::_beforeToHtml();
29
+ }
30
+ }
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Grid.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Block_Adminhtml_Customertestimonials_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('customertestimonialsGrid');
9
+ $this->setDefaultSort('customertestimonials_id');
10
+ $this->setDefaultDir('ASC');
11
+ $this->setSaveParametersInSession(true);
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('admintestimonials/customertestimonials')->getCollection();
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn('customertestimonials_id', array(
24
+ 'header' => Mage::helper('admintestimonials')->__('ID'),
25
+ 'align' =>'right',
26
+ 'width' => '50px',
27
+ 'index' => 'customertestimonials_id',
28
+ ));
29
+
30
+ $this->addColumn('customer_title', array(
31
+ 'header' => Mage::helper('admintestimonials')->__('Title'),
32
+ 'align' =>'left',
33
+ 'index' => 'customer_title',
34
+ ));
35
+
36
+ $this->addColumn('customer_name', array(
37
+ 'header' => Mage::helper('admintestimonials')->__('Name'),
38
+ 'align' =>'left',
39
+ 'index' => 'customer_name',
40
+ ));
41
+
42
+ $this->addColumn('customer_email', array(
43
+ 'header' => Mage::helper('admintestimonials')->__('Email'),
44
+ 'align' =>'left',
45
+ 'index' => 'customer_email',
46
+ ));
47
+
48
+ $this->addColumn('customer_comment', array(
49
+ 'header' => Mage::helper('admintestimonials')->__('Comments'),
50
+ 'align' =>'left',
51
+ 'index' => 'customer_comment',
52
+ ));
53
+
54
+ $this->addColumn('product_id', array(
55
+ 'header' => Mage::helper('sales')->__('Product Name '),
56
+ 'renderer' =>'Medma_Admintestimonials_Block_Adminhtml_Customertestimonials_Renderer_Customerproduct',
57
+ 'type' => 'text',
58
+ ));
59
+
60
+ /*
61
+ $this->addColumn('content', array(
62
+ 'header' => Mage::helper('customertestimonials')->__('Item Content'),
63
+ 'width' => '150px',
64
+ 'index' => 'content',
65
+ ));
66
+ */
67
+
68
+ $this->addColumn('status', array(
69
+ 'header' => Mage::helper('admintestimonials')->__('Status'),
70
+ 'align' => 'left',
71
+ 'width' => '80px',
72
+ 'index' => 'status',
73
+ 'type' => 'options',
74
+ 'options' => array(
75
+ 0 => 'Pending',
76
+ 1 => 'Enabled',
77
+ 2 => 'Disabled',
78
+ ),
79
+ ));
80
+
81
+ $this->addColumn('action',
82
+ array(
83
+ 'header' => Mage::helper('admintestimonials')->__('Action'),
84
+ 'width' => '100',
85
+ 'type' => 'action',
86
+ 'getter' => 'getId',
87
+ 'actions' => array(
88
+ array(
89
+ 'caption' => Mage::helper('admintestimonials')->__('Edit'),
90
+ 'url' => array('base'=> '*/*/edit'),
91
+ 'field' => 'id'
92
+ )
93
+ ),
94
+ 'filter' => false,
95
+ 'sortable' => false,
96
+ 'index' => 'stores',
97
+ 'is_system' => true,
98
+ ));
99
+
100
+ $this->addExportType('*/*/exportCsv', Mage::helper('admintestimonials')->__('CSV'));
101
+ $this->addExportType('*/*/exportXml', Mage::helper('admintestimonials')->__('XML'));
102
+
103
+ return parent::_prepareColumns();
104
+ }
105
+
106
+ protected function _prepareMassaction()
107
+ {
108
+ $this->setMassactionIdField('customertestimonials_id');
109
+ $this->getMassactionBlock()->setFormFieldName('customertestimonials');
110
+
111
+ $this->getMassactionBlock()->addItem('delete', array(
112
+ 'label' => Mage::helper('admintestimonials')->__('Delete'),
113
+ 'url' => $this->getUrl('*/*/massDelete'),
114
+ 'confirm' => Mage::helper('admintestimonials')->__('Are you sure?')
115
+ ));
116
+
117
+ $statuses = Mage::getSingleton('admintestimonials/customerstatus')->getOptionArray();
118
+
119
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
120
+ $this->getMassactionBlock()->addItem('status', array(
121
+ 'label'=> Mage::helper('admintestimonials')->__('Change status'),
122
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
123
+ 'additional' => array(
124
+ 'visibility' => array(
125
+ 'name' => 'status',
126
+ 'type' => 'select',
127
+ 'class' => 'required-entry',
128
+ 'label' => Mage::helper('admintestimonials')->__('Status'),
129
+ 'values' => $statuses
130
+ )
131
+ )
132
+ ));
133
+ return $this;
134
+ }
135
+
136
+ public function getRowUrl($row)
137
+ {
138
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
139
+ }
140
+
141
+ }
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Renderer/Category.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Medma_Admintestimonials_Block_Adminhtml_Customertestimonials_Renderer_Category extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+
5
+ public function render(Varien_Object $row)
6
+ {
7
+ $Id = $row->getId();
8
+
9
+ $collection = Mage::getModel('admintestimonials/customertestimonials')->load($Id)->getData();
10
+ $category_id=$collection['category_id'];
11
+ Mage::getSingleton('adminhtml/session')->setGridCatagoryId($category_id);
12
+ $category=Mage::getModel('catalog/category')->load($category_id)->getName();
13
+
14
+ return $category;
15
+
16
+ }
17
+
18
+ }
19
+ ?>
app/code/local/Medma/Admintestimonials/Block/Adminhtml/Customertestimonials/Renderer/Customerproduct.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Medma_Admintestimonials_Block_Adminhtml_Customertestimonials_Renderer_Customerproduct extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+
5
+ public function render(Varien_Object $row)
6
+ {
7
+ $Id = $row->getId();
8
+
9
+ $collection = Mage::getModel('admintestimonials/customertestimonials')->load($Id)->getData();
10
+ $product_id=$collection['product_id'];
11
+ //Mage::getSingleton('adminhtml/session')->setGridCatagoryId($category_id);
12
+ $productName=Mage::getModel('catalog/product')->load($product_id)->getName();
13
+
14
+ return $productName;
15
+
16
+ }
17
+
18
+ }
19
+ ?>
app/code/local/Medma/Admintestimonials/Block/Admintestimonials.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Medma_Admintestimonials_Block_Admintestimonials extends Mage_Core_Block_Template
3
+ {
4
+ public function _prepareLayout()
5
+ {
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ public function getAdmintestimonials()
10
+ {
11
+ if (!$this->hasData('admintestimonials')) {
12
+ $this->setData('admintestimonials', Mage::registry('admintestimonials'));
13
+ }
14
+ return $this->getData('admintestimonials');
15
+
16
+ }
17
+ }
app/code/local/Medma/Admintestimonials/Block/Catalog/Product/View.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Catalog
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ /**
29
+ * Product View block
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Catalog
33
+ * @module Catalog
34
+ */
35
+ class Medma_Admintestimonials_Block_Catalog_Product_View extends Mage_Catalog_Block_Product_View
36
+ {
37
+
38
+ public function __construct()
39
+ {
40
+ //parent::__construct();
41
+ $this->setTemplate('videotestimonials/catalog/product/view.phtml');
42
+ }
43
+
44
+ }
app/code/local/Medma/Admintestimonials/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/Medma/Admintestimonials/Model/Admintestimonials.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Model_Admintestimonials extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('admintestimonials/admintestimonials');
9
+ }
10
+ }
app/code/local/Medma/Admintestimonials/Model/Category.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Model_Category extends Varien_Object
4
+ {
5
+ static public function toOptionArray()
6
+ {
7
+ /*$category = Mage::getModel('catalog/category');
8
+ $tree = $category->getTreeModel();
9
+ $tree->load();
10
+ $ids = $tree->getCollection()->getAllIds();
11
+ $arr = array();
12
+ $arr['-1']='----Please Select----';
13
+ if ($ids)
14
+ {
15
+ foreach ($ids as $id)
16
+ {
17
+ $cat = Mage::getModel('catalog/category');
18
+ $cat->load($id);
19
+ $arr[$id] = $cat->getName();
20
+ }
21
+ }
22
+ return $arr;*/
23
+
24
+ $categories = Mage::getModel('catalog/category')->getCollection()
25
+ ->addAttributeToSelect('name')
26
+ ->setLoadProductCount(true)
27
+ ->addAttributeToFilter('is_active',array('eq'=>true))
28
+ ->addAttributeToFilter('level',array('neq'=>'1'))
29
+ ->load();
30
+ $arr = array();
31
+ $arr['-1']='----Please Select----';
32
+ foreach($categories as $key=>$category):
33
+ $prodCollection = Mage::getResourceModel('catalog/product_collection')->addCategoryFilter($category); // Magento product collection
34
+ if(($prodCollection->count())!=0):
35
+ $arr[$category->getId()] = $category->getName();
36
+ endif;
37
+ endforeach;
38
+ return $arr;
39
+ }
40
+ }
app/code/local/Medma/Admintestimonials/Model/Customerproduct.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Model_Customerproduct extends Varien_Object
4
+ {
5
+ static public function toOptionArray()
6
+ {
7
+
8
+ $productCollection = Mage::getModel('catalog/product')->getCollection()
9
+ ->addAttributeToSelect('name')
10
+ ->load();
11
+
12
+ $arr = array();
13
+ $arr['-1']='----Please Select----';
14
+ foreach($productCollection as $key=>$product):
15
+
16
+ $arr[$product->getId()] = $product->getName();
17
+
18
+ endforeach;
19
+ return $arr;
20
+ }
21
+ }
app/code/local/Medma/Admintestimonials/Model/Customerstatus.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Model_Customerstatus extends Varien_Object
4
+ {
5
+ const STATUS_PENDING = 0;
6
+ const STATUS_ENABLED = 1;
7
+ const STATUS_DISABLED = 2;
8
+
9
+
10
+ static public function getOptionArray()
11
+ {
12
+ return array(
13
+ self::STATUS_PENDING => Mage::helper('admintestimonials')->__('Pending'),
14
+ self::STATUS_ENABLED => Mage::helper('admintestimonials')->__('Enabled'),
15
+ self::STATUS_DISABLED => Mage::helper('admintestimonials')->__('Disabled')
16
+ );
17
+ }
18
+ }
app/code/local/Medma/Admintestimonials/Model/Customertestimonials.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Model_Customertestimonials extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('admintestimonials/customertestimonials');
9
+ }
10
+ }
app/code/local/Medma/Admintestimonials/Model/Mysql4/Admintestimonials.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Model_Mysql4_Admintestimonials extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the admintestimonials_id refers to the key field in your database table.
8
+ $this->_init('admintestimonials/admintestimonials', 'admintestimonials_id');
9
+ }
10
+ }
app/code/local/Medma/Admintestimonials/Model/Mysql4/Admintestimonials/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Model_Mysql4_Admintestimonials_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('admintestimonials/admintestimonials');
9
+ }
10
+ }
app/code/local/Medma/Admintestimonials/Model/Mysql4/Customertestimonials.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Model_Mysql4_Customertestimonials extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the customertestimonials_id refers to the key field in your database table.
8
+ $this->_init('admintestimonials/customertestimonials', 'customertestimonials_id');
9
+ }
10
+ }
app/code/local/Medma/Admintestimonials/Model/Mysql4/Customertestimonials/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Model_Mysql4_Customertestimonials_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('admintestimonials/customertestimonials');
9
+ }
10
+ }
app/code/local/Medma/Admintestimonials/Model/Status.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_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('admintestimonials')->__('Enabled'),
12
+ self::STATUS_DISABLED => Mage::helper('admintestimonials')->__('Disabled')
13
+ );
14
+ }
15
+ }
app/code/local/Medma/Admintestimonials/controllers/Adminhtml/AdmintestimonialsController.php ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Adminhtml_AdmintestimonialsController extends Mage_Adminhtml_Controller_action
4
+ {
5
+
6
+ protected function _initAction() {
7
+ $this->loadLayout()
8
+ ->_setActiveMenu('admintestimonials/items')
9
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
10
+
11
+ return $this;
12
+ }
13
+
14
+ public function indexAction() {
15
+ $this->_initAction()
16
+ ->renderLayout();
17
+ }
18
+
19
+ public function editAction() {
20
+ $id = $this->getRequest()->getParam('id');
21
+ $model = Mage::getModel('admintestimonials/admintestimonials')->load($id);
22
+ $category_id = $model->getCategoryId();
23
+ Mage::getSingleton('adminhtml/session')->setCategoryId($category_id);
24
+ if ($model->getId() || $id == 0) {
25
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
26
+ if (!empty($data)) {
27
+ $model->setData($data);
28
+ }
29
+
30
+ Mage::register('admintestimonials_data', $model);
31
+
32
+ $this->loadLayout();
33
+ $this->_setActiveMenu('admintestimonials/items');
34
+
35
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
36
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
37
+
38
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
39
+
40
+ $this->_addContent($this->getLayout()->createBlock('admintestimonials/adminhtml_admintestimonials_edit'))
41
+ ->_addLeft($this->getLayout()->createBlock('admintestimonials/adminhtml_admintestimonials_edit_tabs'));
42
+
43
+ $this->renderLayout();
44
+ } else {
45
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('admintestimonials')->__('Item does not exist'));
46
+ $this->_redirect('*/*/');
47
+ }
48
+ }
49
+
50
+ public function newAction() {
51
+ $this->_forward('edit');
52
+ }
53
+
54
+ public function saveAction() {
55
+ if ($data = $this->getRequest()->getPost()) {
56
+
57
+ $id = '';
58
+ if($data['video_link_length']>0){
59
+
60
+ for($i=1;$i<=$data['video_link_length'];$i++)
61
+ {
62
+ if($data['video_url_'.$i]!= ""){
63
+ $id = $data['video_row_id_'.$i];
64
+ $data['video_url'] = $data['video_url_'.$i];
65
+ $data['position'] = $data['position_'.$i];
66
+ $data['status'] = $data['status_'.$i];
67
+ $model = Mage::getModel('admintestimonials/admintestimonials');
68
+ $model->setData($data)
69
+ ->setId($id);
70
+ try{
71
+
72
+ $model->save();
73
+
74
+ }catch (Exception $e) {
75
+
76
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
77
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
78
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
79
+ return;
80
+
81
+ }
82
+
83
+ }
84
+
85
+ }
86
+
87
+ }else {
88
+ $data['category_id'] = $data['category_id'];
89
+ $data['video_url'] = $data['video_url_1'];
90
+ $data['position'] = $data['position_1'];
91
+ $data['status'] = $data['status_1'];
92
+ $model = Mage::getModel('admintestimonials/admintestimonials');
93
+ $model->setData($data)
94
+ ;//->setId($id);
95
+ try{
96
+
97
+ $model->save();
98
+
99
+ }catch (Exception $e) {
100
+
101
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
102
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
103
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
104
+ return;
105
+ }
106
+ }
107
+
108
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('admintestimonials')->__('Item was successfully saved'));
109
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
110
+
111
+ if ($this->getRequest()->getParam('back')) {
112
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
113
+ return;
114
+ }
115
+ $this->_redirect('*/*/');
116
+ return;
117
+ }
118
+ }
119
+
120
+ public function deleteAction() {
121
+ if( $this->getRequest()->getParam('id') > 0 ) {
122
+ try {
123
+ $model = Mage::getModel('admintestimonials/admintestimonials');
124
+
125
+ $model->setId($this->getRequest()->getParam('id'))
126
+ ->delete();
127
+
128
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
129
+ $this->_redirect('*/*/');
130
+ } catch (Exception $e) {
131
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
132
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
133
+ }
134
+ }
135
+ $this->_redirect('*/*/');
136
+ }
137
+
138
+ public function massDeleteAction() {
139
+ $admintestimonialsIds = $this->getRequest()->getParam('admintestimonials');
140
+ if(!is_array($admintestimonialsIds)) {
141
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
142
+ } else {
143
+ try {
144
+ foreach ($admintestimonialsIds as $admintestimonialsId) {
145
+ $admintestimonials = Mage::getModel('admintestimonials/admintestimonials')->load($admintestimonialsId);
146
+ $admintestimonials->delete();
147
+ }
148
+ Mage::getSingleton('adminhtml/session')->addSuccess(
149
+ Mage::helper('adminhtml')->__(
150
+ 'Total of %d record(s) were successfully deleted', count($admintestimonialsIds)
151
+ )
152
+ );
153
+ } catch (Exception $e) {
154
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
155
+ }
156
+ }
157
+ $this->_redirect('*/*/index');
158
+ }
159
+
160
+ public function massStatusAction()
161
+ {
162
+ $admintestimonialsIds = $this->getRequest()->getParam('admintestimonials');
163
+ if(!is_array($admintestimonialsIds)) {
164
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
165
+ } else {
166
+ try {
167
+ foreach ($admintestimonialsIds as $admintestimonialsId) {
168
+ $admintestimonials = Mage::getSingleton('admintestimonials/admintestimonials')
169
+ ->load($admintestimonialsId)
170
+ ->setStatus($this->getRequest()->getParam('status'))
171
+ ->setIsMassupdate(true)
172
+ ->save();
173
+ }
174
+ $this->_getSession()->addSuccess(
175
+ $this->__('Total of %d record(s) were successfully updated', count($admintestimonialsIds))
176
+ );
177
+ } catch (Exception $e) {
178
+ $this->_getSession()->addError($e->getMessage());
179
+ }
180
+ }
181
+ $this->_redirect('*/*/index');
182
+ }
183
+
184
+ public function exportCsvAction()
185
+ {
186
+ $fileName = 'admintestimonials.csv';
187
+ $content = $this->getLayout()->createBlock('admintestimonials/adminhtml_admintestimonials_grid')
188
+ ->getCsv();
189
+
190
+ $this->_sendUploadResponse($fileName, $content);
191
+ }
192
+
193
+ public function exportXmlAction()
194
+ {
195
+ $fileName = 'admintestimonials.xml';
196
+ $content = $this->getLayout()->createBlock('admintestimonials/adminhtml_admintestimonials_grid')
197
+ ->getXml();
198
+
199
+ $this->_sendUploadResponse($fileName, $content);
200
+ }
201
+
202
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
203
+ {
204
+ $response = $this->getResponse();
205
+ $response->setHeader('HTTP/1.1 200 OK','');
206
+ $response->setHeader('Pragma', 'public', true);
207
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
208
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
209
+ $response->setHeader('Last-Modified', date('r'));
210
+ $response->setHeader('Accept-Ranges', 'bytes');
211
+ $response->setHeader('Content-Length', strlen($content));
212
+ $response->setHeader('Content-type', $contentType);
213
+ $response->setBody($content);
214
+ $response->sendResponse();
215
+ die;
216
+ }
217
+ }
app/code/local/Medma/Admintestimonials/controllers/Adminhtml/CustomertestimonialsController.php ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Admintestimonials_Adminhtml_CustomertestimonialsController extends Mage_Adminhtml_Controller_action
4
+ {
5
+
6
+ protected function _initAction() {
7
+ $this->loadLayout()
8
+ ->_setActiveMenu('admintestimonials/customertestimonials')
9
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
10
+
11
+ return $this;
12
+ }
13
+
14
+ public function indexAction() {
15
+ $this->_initAction()
16
+ ->renderLayout();
17
+ }
18
+
19
+ public function editAction() {
20
+ $id = $this->getRequest()->getParam('id');
21
+ Mage::getSingleton('adminhtml/session')->setCustomerVideoId($id);
22
+ $model = Mage::getModel('admintestimonials/customertestimonials')->load($id);
23
+
24
+ if ($model->getId() || $id == 0) {
25
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
26
+ if (!empty($data)) {
27
+ $model->setData($data);
28
+ }
29
+
30
+ Mage::register('customertestimonials_data', $model);
31
+
32
+ $this->loadLayout();
33
+ $this->_setActiveMenu('customertestimonials/items');
34
+
35
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
36
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
37
+
38
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
39
+
40
+ $this->_addContent($this->getLayout()->createBlock('admintestimonials/adminhtml_customertestimonials_edit'))
41
+ ->_addLeft($this->getLayout()->createBlock('admintestimonials/adminhtml_customertestimonials_edit_tabs'));
42
+
43
+ $this->renderLayout();
44
+ } else {
45
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('admintestimonials')->__('Item does not exist'));
46
+ $this->_redirect('*/*/');
47
+ }
48
+ }
49
+
50
+ public function newAction() {
51
+ $this->_forward('edit');
52
+ }
53
+
54
+ public function saveAction() {
55
+ if ($data = $this->getRequest()->getPost()) {
56
+
57
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
58
+ try {
59
+ /* Starting upload */
60
+ $uploader = new Varien_File_Uploader('filename');
61
+
62
+ // Any extention would work
63
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
64
+ $uploader->setAllowRenameFiles(false);
65
+
66
+ // Set the file upload mode
67
+ // false -> get the file directly in the specified folder
68
+ // true -> get the file in the product like folders
69
+ // (file.jpg will go in something like /media/f/i/file.jpg)
70
+ $uploader->setFilesDispersion(false);
71
+
72
+ // We set media as the upload dir
73
+ $path = Mage::getBaseDir('media') . DS ;
74
+ $uploader->save($path, $_FILES['filename']['name'] );
75
+
76
+ } catch (Exception $e) {
77
+
78
+ }
79
+
80
+ //this way the name is saved in DB
81
+ $data['filename'] = $_FILES['filename']['name'];
82
+ }
83
+
84
+
85
+ $model = Mage::getModel('admintestimonials/customertestimonials');
86
+ $model->setData($data)
87
+ ->setId($this->getRequest()->getParam('id'));
88
+
89
+ try {
90
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
91
+ $model->setCreatedTime(now())
92
+ ->setUpdateTime(now());
93
+ } else {
94
+ $model->setUpdateTime(now());
95
+ }
96
+
97
+ $model->save();
98
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('admintestimonials')->__('Item was successfully saved'));
99
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
100
+
101
+ if ($this->getRequest()->getParam('back')) {
102
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
103
+ return;
104
+ }
105
+ $this->_redirect('*/*/');
106
+ return;
107
+ } catch (Exception $e) {
108
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
109
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
110
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
111
+ return;
112
+ }
113
+ }
114
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('admintestimonials')->__('Unable to find item to save'));
115
+ $this->_redirect('*/*/');
116
+ }
117
+
118
+ public function deleteAction() {
119
+ if( $this->getRequest()->getParam('id') > 0 ) {
120
+ try {
121
+ $model = Mage::getModel('admintestimonials/customertestimonials');
122
+
123
+ $model->setId($this->getRequest()->getParam('id'))
124
+ ->delete();
125
+
126
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
127
+ $this->_redirect('*/*/');
128
+ } catch (Exception $e) {
129
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
130
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
131
+ }
132
+ }
133
+ $this->_redirect('*/*/');
134
+ }
135
+
136
+ public function massDeleteAction() {
137
+ $customertestimonialsIds = $this->getRequest()->getParam('customertestimonials');
138
+ if(!is_array($customertestimonialsIds)) {
139
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
140
+ } else {
141
+ try {
142
+ foreach ($customertestimonialsIds as $customertestimonialsId) {
143
+ $customertestimonials = Mage::getModel('admintestimonials/customertestimonials')->load($customertestimonialsId);
144
+ $customertestimonials->delete();
145
+ }
146
+ Mage::getSingleton('adminhtml/session')->addSuccess(
147
+ Mage::helper('adminhtml')->__(
148
+ 'Total of %d record(s) were successfully deleted', count($customertestimonialsIds)
149
+ )
150
+ );
151
+ } catch (Exception $e) {
152
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
153
+ }
154
+ }
155
+ $this->_redirect('*/*/index');
156
+ }
157
+
158
+ public function massStatusAction()
159
+ {
160
+ $customertestimonialsIds = $this->getRequest()->getParam('customertestimonials');
161
+ if(!is_array($customertestimonialsIds)) {
162
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
163
+ } else {
164
+ try {
165
+ foreach ($customertestimonialsIds as $customertestimonialsId) {
166
+ $customertestimonials = Mage::getSingleton('admintestimonials/customertestimonials')
167
+ ->load($customertestimonialsId)
168
+ ->setStatus($this->getRequest()->getParam('status'))
169
+ ->setIsMassupdate(true)
170
+ ->save();
171
+ }
172
+ $this->_getSession()->addSuccess(
173
+ $this->__('Total of %d record(s) were successfully updated', count($customertestimonialsIds))
174
+ );
175
+ } catch (Exception $e) {
176
+ $this->_getSession()->addError($e->getMessage());
177
+ }
178
+ }
179
+ $this->_redirect('*/*/index');
180
+ }
181
+
182
+ public function exportCsvAction()
183
+ {
184
+ $fileName = 'customertestimonials.csv';
185
+ $content = $this->getLayout()->createBlock('admintestimonials/adminhtml_customertestimonials_grid')
186
+ ->getCsv();
187
+
188
+ $this->_sendUploadResponse($fileName, $content);
189
+ }
190
+
191
+ public function exportXmlAction()
192
+ {
193
+ $fileName = 'customertestimonials.xml';
194
+ $content = $this->getLayout()->createBlock('admintestimonials/adminhtml_customertestimonials_grid')
195
+ ->getXml();
196
+
197
+ $this->_sendUploadResponse($fileName, $content);
198
+ }
199
+
200
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
201
+ {
202
+ $response = $this->getResponse();
203
+ $response->setHeader('HTTP/1.1 200 OK','');
204
+ $response->setHeader('Pragma', 'public', true);
205
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
206
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
207
+ $response->setHeader('Last-Modified', date('r'));
208
+ $response->setHeader('Accept-Ranges', 'bytes');
209
+ $response->setHeader('Content-Length', strlen($content));
210
+ $response->setHeader('Content-type', $contentType);
211
+ $response->setBody($content);
212
+ $response->sendResponse();
213
+ die;
214
+ }
215
+ }
app/code/local/Medma/Admintestimonials/controllers/IndexController.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Medma_Admintestimonials_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->renderLayout();
7
+ }
8
+
9
+ public function vidtestuploadAction(){
10
+
11
+ $params = $this->getRequest()->getParams();
12
+
13
+ $custestModel = Mage::getModel('admintestimonials/customertestimonials');
14
+
15
+ $custestModel->setData($params)->setStatus(Medma_Admintestimonials_Model_Customerstatus::STATUS_PENDING);
16
+
17
+ try{
18
+
19
+ $custestModel->save();
20
+ Mage::getSingleton('core/session')->addSuccess($this->__('Video information was successfully saved'));
21
+ $this->_redirectReferer('');
22
+ return;
23
+
24
+ }catch(Exception $e){
25
+
26
+ Mage::getSingleton('core/session')->addError($this->__('There was some problem in saving data'));
27
+ $this->_redirectReferer('');
28
+ return;
29
+
30
+ }
31
+
32
+ }
33
+
34
+
35
+ }
app/code/local/Medma/Admintestimonials/etc/config.xml ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Medma_Admintestimonials>
5
+ <version>0.2.2</version>
6
+ </Medma_Admintestimonials>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <admintestimonials>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Medma_Admintestimonials</module>
14
+ <frontName>admintestimonials</frontName>
15
+ </args>
16
+ </admintestimonials>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <admintestimonials>
21
+ <file>videotestimonials.xml</file>
22
+ </admintestimonials>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <admintestimonials>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Medma_Admintestimonials</module>
32
+ <frontName>admintestimonials</frontName>
33
+ </args>
34
+ </admintestimonials>
35
+ </routers>
36
+ </admin>
37
+ <adminhtml>
38
+ <menu>
39
+ <catalog>
40
+ <children>
41
+ <admintestimonials module="admintestimonials">
42
+ <title>Video Testimonials</title>
43
+ <sort_order>71</sort_order>
44
+ <children>
45
+ <items module="admintestimonials">
46
+ <title>Manage Admin Video Testimonials</title>
47
+ <sort_order>0</sort_order>
48
+ <action>admintestimonials/adminhtml_admintestimonials</action>
49
+ </items>
50
+ <customertestimonials module="admintestimonials">
51
+ <title>Manage Customer Video Testimonials</title>
52
+ <sort_order>1</sort_order>
53
+ <action>admintestimonials/adminhtml_customertestimonials</action>
54
+ </customertestimonials>
55
+ </children>
56
+ </admintestimonials>
57
+ </children>
58
+ </catalog>
59
+ </menu>
60
+ <acl>
61
+ <resources>
62
+ <all>
63
+ <title>Allow Everything</title>
64
+ </all>
65
+ <admin>
66
+ <children>
67
+ <Medma_Admintestimonials>
68
+ <title>Admintestimonials Module</title>
69
+ <sort_order>10</sort_order>
70
+ </Medma_Admintestimonials>
71
+ </children>
72
+ </admin>
73
+ </resources>
74
+ </acl>
75
+ <layout>
76
+ <updates>
77
+ <admintestimonials>
78
+ <file>admintestimonials.xml</file>
79
+ </admintestimonials>
80
+ </updates>
81
+ </layout>
82
+ </adminhtml>
83
+ <global>
84
+ <models>
85
+ <admintestimonials>
86
+ <class>Medma_Admintestimonials_Model</class>
87
+ <resourceModel>admintestimonials_mysql4</resourceModel>
88
+ </admintestimonials>
89
+ <admintestimonials_mysql4>
90
+ <class>Medma_Admintestimonials_Model_Mysql4</class>
91
+ <entities>
92
+ <admintestimonials>
93
+ <table>admin_video_testimonials</table>
94
+ </admintestimonials>
95
+ <customertestimonials>
96
+ <table>customer_video_testimonials</table>
97
+ </customertestimonials>
98
+ </entities>
99
+ </admintestimonials_mysql4>
100
+ </models>
101
+ <resources>
102
+ <admintestimonials_setup>
103
+ <setup>
104
+ <module>Medma_Admintestimonials</module>
105
+ </setup>
106
+ <connection>
107
+ <use>core_setup</use>
108
+ </connection>
109
+ </admintestimonials_setup>
110
+ <admintestimonials_write>
111
+ <connection>
112
+ <use>core_write</use>
113
+ </connection>
114
+ </admintestimonials_write>
115
+ <admintestimonials_read>
116
+ <connection>
117
+ <use>core_read</use>
118
+ </connection>
119
+ </admintestimonials_read>
120
+ </resources>
121
+ <blocks>
122
+ <admintestimonials>
123
+ <class>Medma_Admintestimonials_Block</class>
124
+ </admintestimonials>
125
+ <!--<catalog>
126
+ <rewrite>
127
+ <product_view>Medma_Admintestimonials_Block_Catalog_Product_View</product_view>
128
+ </rewrite>
129
+ </catalog>-->
130
+ </blocks>
131
+ <helpers>
132
+ <admintestimonials>
133
+ <class>Medma_Admintestimonials_Helper</class>
134
+ </admintestimonials>
135
+ </helpers>
136
+ </global>
137
+ </config>
app/code/local/Medma/Admintestimonials/sql/admintestimonials_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n";
3
+ // die("Exit for now");
4
+ $installer = $this;
5
+
6
+ $installer->startSetup();
7
+
8
+ $installer->run("
9
+
10
+ DROP TABLE IF EXISTS {$this->getTable('admin_video_testimonials')};
11
+ CREATE TABLE {$this->getTable('admin_video_testimonials')}(
12
+ `admintestimonials_id` int(11) unsigned NOT NULL auto_increment,
13
+ `video_url` varchar(255) NOT NULL default '',
14
+ `category_id` int(11) NOT NULL ,
15
+ `status` smallint(6) NOT NULL default '0',
16
+ `position` smallint(6) NOT NULL default '0',
17
+ PRIMARY KEY (`admintestimonials_id`),
18
+ UNIQUE KEY (category_id, position)
19
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
+
21
+ ");
22
+
23
+ $installer->endSetup();
app/code/local/Medma/Admintestimonials/sql/admintestimonials_setup/mysql4-upgrade-0.1.0-0.2.2.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n";
3
+ // die("Exit for now");
4
+ $installer = $this;
5
+
6
+ $installer->startSetup();
7
+
8
+ $installer->run("
9
+
10
+ DROP TABLE IF EXISTS {$this->getTable('customer_video_testimonials')};
11
+ CREATE TABLE {$this->getTable('customer_video_testimonials')}(
12
+ `customertestimonials_id` int(11) unsigned NOT NULL auto_increment,
13
+ `customer_video_url` varchar(255) NOT NULL default '',
14
+ `customer_title` varchar(255) NOT NULL default '',
15
+ `customer_name` varchar(255) NOT NULL default '',
16
+ `customer_email` varchar(255) NOT NULL default '',
17
+ `customer_comment` text NOT NULL default '',
18
+ `product_id` int(11) NOT NULL ,
19
+ `status` smallint(6) NOT NULL default '0',
20
+ PRIMARY KEY (`customertestimonials_id`)
21
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
22
+
23
+ ");
24
+
25
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/admintestimonials.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <admintestimonials_adminhtml_admintestimonials_index>
4
+ <reference name="content">
5
+ <block type="admintestimonials/adminhtml_admintestimonials" name="admintestimonials" />
6
+ </reference>
7
+ </admintestimonials_adminhtml_admintestimonials_index>
8
+ <admintestimonials_adminhtml_customertestimonials_index>
9
+ <reference name="content">
10
+ <block type="admintestimonials/adminhtml_customertestimonials" name="customertestimonials" />
11
+ </reference>
12
+ </admintestimonials_adminhtml_customertestimonials_index>
13
+ </layout>
app/design/adminhtml/default/default/template/admintestimonials/customers/customervidtestvideo.phtml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $id = Mage::getSingleton('adminhtml/session')->getCustomerVideoId();
4
+
5
+ $model = Mage::getModel('admintestimonials/customertestimonials')->load($id);
6
+
7
+ $videos = $model->getData();
8
+
9
+ //$explodeArr = explode("?v=",$videos['customer_video_url']);
10
+
11
+ $posOfV = strpos($videos['customer_video_url'],'?v=');
12
+
13
+ if($posOfV === false) {
14
+
15
+ $explodeArr = explode("youtu.be/",$videos['customer_video_url']);
16
+
17
+ $embedId = $explodeArr[1];
18
+
19
+ }else {
20
+ $explodeArr = explode("?v=",$videos['customer_video_url']);
21
+
22
+ $pos = strpos($explodeArr,'&');
23
+
24
+ if($pos === false) {
25
+ $embedId = $explodeArr[1];
26
+ }
27
+ else {
28
+ $explodedAgain = explode("&",$explodeArr[1]);
29
+
30
+ $embedId = $explodedAgain[0];
31
+ }
32
+
33
+ }
34
+ ?>
35
+ <div id="player-content">
36
+ <object width="633px" height="400px">
37
+ <param value="http://www.youtube.com/v/<?php echo $embedId ?>?f=videos&amp;app=youtube_gdata" name="movie">
38
+ <param value="true" name="allowFullScreen">
39
+ <param value="always" name="allowScriptAccess">
40
+ <embed width="633px" height="400px" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" src="http://www.youtube.com/v/<?php echo $embedId ?>?f=videos&amp;app=youtube_gdata">
41
+ </object>
42
+ </div>
43
+
44
+
app/design/adminhtml/default/default/template/admintestimonials/form.phtml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $categoryArrs = $this->_categotyFilter();
4
+
5
+ ?>
6
+ <div style="" id="admintestimonials_tabs_form_section_content"><div class="entry-edit">
7
+ <div class="entry-edit-head">
8
+ <h4 class="icon-head head-edit-form fieldset-legend">Item information</h4>
9
+ <div class="form-buttons"></div>
10
+ </div>
11
+ <div id="admintestimonials_form" class="fieldset ">
12
+ <div class="hor-scroll">
13
+ <table cellspacing="0" class="form-list">
14
+ <tbody>
15
+ <tr>
16
+ <td class="label"><label for="category_id">Category <span class="required">*</span></label></td>
17
+ <td class="value">
18
+ <?php $category_id = Mage::getSingleton('adminhtml/session')->getCategoryId(); ?>
19
+ <?php $arrCats = Mage::getModel('admintestimonials/category')->toOptionArray(); ?>
20
+ <select class=" required-entry select" name="category_id" id="category_id">
21
+ <?php foreach($arrCats as $value=>$lable) : ?>
22
+ <option value="<?php echo $value ?>" <?php if($category_id == $value):?> selected <?php endif;?>><?php echo $lable ?></option>
23
+ <?php endforeach;?>
24
+ </select>
25
+ </td>
26
+ </tr>
27
+ <tr>
28
+ <td class="label"></td>
29
+ <td class="value">
30
+ <span id="addmore"><button style="" onclick="addNewDiv();" class="scalable " type="button" id="id_712e4e6b7ae4603fe34426332f28c9e2"><span>Add More Video </span></button></span> </td>
31
+ </tr>
32
+ <tr>
33
+
34
+ </tr>
35
+ <?php $videoCount = 0; ?>
36
+ <?php foreach($categoryArrs as $categoryArr): $videoCount++;?>
37
+ <tr>
38
+ <td class="label"><label for="video_url">Youtube Video Url <span class="required">*</span></label></td>
39
+ <td class="value">
40
+ <input type="text" class="required-entry input-text required-entry" value="<?php echo $categoryArr['video_url']?>" name="video_url_<?php echo $videoCount?>" id="video_url_<?php echo $videoCount?>"> </td>
41
+ </tr>
42
+ <tr>
43
+
44
+ <td class="label"><label for="position">Position <span class="required">*</span></label></td>
45
+ <td class="value">
46
+ <input type="text" class=" input-text required-entry" value="<?php echo $categoryArr['position']?>" name="position_<?php echo $videoCount?>" id="position_<?php echo $videoCount?>"> </td>
47
+ </tr>
48
+ <tr>
49
+ <td class="label"><label for="status">Status</label></td>
50
+ <td class="value">
51
+ <select class=" select" name="status_<?php echo $videoCount?>" id="status_<?php echo $videoCount?>">
52
+ <option value="1" <?php if( $categoryArr['status'] == 1): ?> selected <?php endif;?>>Enabled</option>
53
+ <option value="2" <?php if( $categoryArr['status'] == 2): ?> selected <?php endif;?>>Disabled</option>
54
+ </select> </td>
55
+ </tr>
56
+ <tr>
57
+ <td colspan="2">
58
+
59
+ <input type="hidden" value="<?php echo $categoryArr['admintestimonials_id'];?>" name="video_row_id_<?php echo $videoCount ?>" id="video_row_id_<?php echo $videoCount ?>">
60
+
61
+ </td>
62
+ </tr>
63
+ <?php endforeach; ?>
64
+ </tbody>
65
+ </table>
66
+ <input type="hidden" value="<?php echo $videoCount; ?>" name="video_link_length" id="video_link_length">
67
+ </div>
68
+ </div>
69
+ </div>
70
+ </div>
app/design/frontend/default/default/layout/videotestimonials.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <layout version="0.1.0">
2
+
3
+ <catalog_product_view translate="label">
4
+ <reference name="product.info">
5
+
6
+ <action method='setTemplate'><template>videotestimonials/catalog/product/view.phtml</template></action>
7
+ <block type="catalog/product_view" name="videotestimonial" as="videotestimonial" template="videotestimonials/catalog/product/view/videoslider.phtml"/>
8
+ </reference>
9
+ </catalog_product_view>
10
+ </layout>
app/design/frontend/default/default/template/videotestimonials/catalog/product/view.phtml ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Product view template
29
+ *
30
+ * @see Mage_Catalog_Block_Product_View
31
+ * @see Mage_Review_Block_Product_View
32
+ */
33
+ ?>
34
+ <?php $_helper = $this->helper('catalog/output'); ?>
35
+ <?php $_product = $this->getProduct(); ?>
36
+ <script type="text/javascript">
37
+ var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
38
+ </script>
39
+ <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
40
+ <div class="product-view">
41
+ <div class="product-essential">
42
+ <form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
43
+ <div class="no-display">
44
+ <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
45
+ <input type="hidden" name="related_product" id="related-products-field" value="" />
46
+ </div>
47
+
48
+ <div class="product-shop">
49
+ <div class="product-name">
50
+ <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
51
+ </div>
52
+
53
+ <?php if ($this->canEmailToFriend()): ?>
54
+ <p class="email-friend"><a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a></p>
55
+ <?php endif; ?>
56
+
57
+ <?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
58
+ <?php echo $this->getChildHtml('alert_urls') ?>
59
+ <?php echo $this->getChildHtml('product_type_data') ?>
60
+ <?php echo $this->getTierPriceHtml() ?>
61
+ <?php echo $this->getChildHtml('extrahint') ?>
62
+
63
+ <?php if (!$this->hasOptions()):?>
64
+ <div class="add-to-box">
65
+ <?php if($_product->isSaleable()): ?>
66
+ <?php echo $this->getChildHtml('addtocart') ?>
67
+ <?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
68
+ <span class="or"><?php echo $this->__('OR') ?></span>
69
+ <?php endif; ?>
70
+ <?php endif; ?>
71
+ <?php echo $this->getChildHtml('addto') ?>
72
+ </div>
73
+ <?php echo $this->getChildHtml('extra_buttons') ?>
74
+ <?php elseif (!$_product->isSaleable()): ?>
75
+ <div class="add-to-box">
76
+ <?php echo $this->getChildHtml('addto') ?>
77
+ </div>
78
+ <?php endif; ?>
79
+
80
+ <?php if ($_product->getShortDescription()):?>
81
+ <div class="short-description">
82
+ <h2><?php echo $this->__('Quick Overview') ?></h2>
83
+ <div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
84
+ </div>
85
+ <?php endif;?>
86
+
87
+ <?php echo $this->getChildHtml('other');?>
88
+
89
+ <?php if ($_product->isSaleable() && $this->hasOptions()):?>
90
+ <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
91
+ <?php endif;?>
92
+
93
+ </div>
94
+
95
+ <div class="product-img-box">
96
+ <?php echo $this->getChildHtml('media') ?>
97
+ </div>
98
+
99
+ <div class="clearer"></div>
100
+ <?php if ($_product->isSaleable() && $this->hasOptions()):?>
101
+ <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
102
+ <?php endif;?>
103
+ </form>
104
+ <script type="text/javascript">
105
+ //<![CDATA[
106
+ var productAddToCartForm = new VarienForm('product_addtocart_form');
107
+ productAddToCartForm.submit = function(button, url) {
108
+ if (this.validator.validate()) {
109
+ var form = this.form;
110
+ var oldUrl = form.action;
111
+
112
+ if (url) {
113
+ form.action = url;
114
+ }
115
+ var e = null;
116
+ try {
117
+ this.form.submit();
118
+ } catch (e) {
119
+ }
120
+ this.form.action = oldUrl;
121
+ if (e) {
122
+ throw e;
123
+ }
124
+
125
+ if (button && button != 'undefined') {
126
+ button.disabled = true;
127
+ }
128
+ }
129
+ }.bind(productAddToCartForm);
130
+
131
+ productAddToCartForm.submitLight = function(button, url){
132
+ if(this.validator) {
133
+ var nv = Validation.methods;
134
+ delete Validation.methods['required-entry'];
135
+ delete Validation.methods['validate-one-required'];
136
+ delete Validation.methods['validate-one-required-by-name'];
137
+ if (this.validator.validate()) {
138
+ if (url) {
139
+ this.form.action = url;
140
+ }
141
+ this.form.submit();
142
+ }
143
+ Object.extend(Validation.methods, nv);
144
+ }
145
+ }.bind(productAddToCartForm);
146
+ //]]>
147
+ </script>
148
+ </div>
149
+
150
+ <div class="product-collateral">
151
+ <?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
152
+ <div class="box-collateral <?php echo "box-{$alias}"?>">
153
+ <?php if ($title = $this->getChildData($alias, 'title')):?>
154
+ <h2><?php echo $this->escapeHtml($title); ?></h2>
155
+ <?php endif;?>
156
+ <?php echo $html; ?>
157
+ </div>
158
+ <?php endforeach;?>
159
+ <?php echo $this->getChildHtml('videotestimonial') ?>
160
+ <?php echo $this->getChildHtml('upsell_products') ?>
161
+ <?php echo $this->getChildHtml('product_additional_data') ?>
162
+ </div>
163
+ </div>
app/design/frontend/default/default/template/videotestimonials/catalog/product/view/videoslider.phtml ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* */
4
+ ?>
5
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
6
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery.js') ?>"></script>
7
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('css/skin.css') ?>" />
8
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('css/colorbox.css') ?>" />
9
+ <script type="text/javascript">
10
+
11
+ function mycarousel_initCallback(carousel)
12
+ {
13
+ // Disable autoscrolling if the user clicks the prev or next button.
14
+ carousel.buttonNext.bind('click', function() {
15
+ carousel.startAuto(0);
16
+ });
17
+
18
+ carousel.buttonPrev.bind('click', function() {
19
+ carousel.startAuto(0);
20
+ });
21
+
22
+ // Pause autoscrolling if the user moves with the cursor over the clip.
23
+ carousel.clip.hover(function() {
24
+ carousel.stopAuto();
25
+ }, function() {
26
+ carousel.startAuto();
27
+ });
28
+ };
29
+
30
+ jQuery(document).ready(function() {
31
+ jQuery('#mycarousel').jcarousel({
32
+ //auto: 2,
33
+ visible: 4,
34
+ wrap: 'last',
35
+ initCallback: mycarousel_initCallback
36
+ });
37
+ });
38
+
39
+ </script>
40
+ <script src="<?php echo $this->getSkinUrl('js/jquery.colorbox.js') ?>" type="text/javascript"></script>
41
+ <script type="text/javascript">
42
+ var $j=jQuery.noConflict();
43
+ $j(document).ready(function(){
44
+ $j(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
45
+
46
+ $j(".vidtest-player").hide();
47
+ $j(".show_hide").show();
48
+
49
+ $j('.show_hide').click(function(){
50
+ $j(".vidtest-player").slideToggle();
51
+ });
52
+ });
53
+ </script>
54
+ <?php
55
+ $_product = $this->getProduct();
56
+ $_CategoryIds = $_product->getCategoryIds();
57
+ $_CategoryId = $_CategoryIds[0];
58
+ $videoCollection = Mage::getModel('admintestimonials/admintestimonials')->getCollection()->addFieldToFilter('category_id',array('eq' => $_CategoryId))->addFieldToFilter('status',array('eq' => '1'));
59
+
60
+ $customerVideoCollection = Mage::getModel('admintestimonials/customertestimonials')->getCollection()->addFieldToFilter('product_id',array('eq' => $_product->getId()))->addFieldToFilter('status',array('eq' => '1'));
61
+
62
+ $videoCollection->getSelect()->order('position ASC');
63
+ ?>
64
+ <div id="for_1400" class="vidtest-collateral-box">
65
+ <h2><?php echo $this->__('Video Testimonials &amp; Reviews')?></h2>
66
+ <div id="for_1400" class="add-own-video-button">
67
+ <a href="javascript:void(0)" class="show_hide"><?php echo $this->__('Upload Video')?></a>
68
+ </div>
69
+ <div class="vidtest-player" id="vidtest-player">
70
+ <div style="display: block;" id="uploadform-content">
71
+ <div>
72
+ <div id="for_1400" class="vidtest-uploadform">
73
+ <div class="form-head">
74
+ <h4><?php echo $this->__('Upload your YouTube URL')?></h4>
75
+ </div>
76
+ <fieldset>
77
+ <form id="vidtest-youtube-uploadform" name="vidtest-upload" method="post" action="<?php echo $this->getUrl('admintestimonials/index/vidtestupload/')?>" enctype="multipart/form-data">
78
+ <div>
79
+ <label for="title_field"><?php echo $this->__('Title')?><span class="required">*</span></label><br>
80
+ <input type="text" value="" style="width: 450px;" id="title_field" name="customer_title" class="input-text required-entry">
81
+ </div>
82
+
83
+ <div>
84
+ <label for="comment_field"><?php echo $this->__('Comment')?></label><br>
85
+ <textarea style="width: 450px;" rows="4" cols="53" id="comment_field" name="customer_comment" class="input-text"></textarea>
86
+ </div>
87
+
88
+ <div>
89
+ <label for="author_name_field"><?php echo $this->__('Author Name')?><span class="required">*</span></label><br>
90
+ <input type="text" value="" style="width: 450px;" id="author_name_field" name="customer_name" class="input-text required-entry">
91
+ </div>
92
+ <div>
93
+ <label for="author_email_field"><?php echo $this->__('Author Email')?><span class="required">*</span></label><br>
94
+ <input type="text" value="" style="width: 450px;" id="author_email_field" name="customer_email" class="input-text validate-email required-entry">
95
+ </div>
96
+
97
+ <div>
98
+
99
+ <label for="video_link_field"><?php echo $this->__('YouTube URL')?><span class="required">*</span></label><br>
100
+ <input type="text" value="" style="width: 210px;" id="video_link_field" name="customer_video_url" class="input-text required-entry">
101
+
102
+ </div>
103
+ <?php $_product = $this->getProduct(); ?>
104
+ <input type="hidden" value="<?php echo $_product->getId() ?>" name="product_id">
105
+ <div class="button-set">
106
+ <button type="submit" class="form-button right button"><span><span><?php echo $this->__('Go')?></span></span></button>
107
+ </div>
108
+ </form>
109
+ </fieldset>
110
+ </div>
111
+ <script type="text/javascript">
112
+ //<![CDATA[
113
+
114
+ // Overrides standard submit
115
+ Validation.prototype.inheritedOnSubmit = Validation.prototype.onSubmit;
116
+
117
+ Validation.prototype.onSubmit = function(ev){
118
+
119
+ this.inheritedOnSubmit(ev);
120
+ }
121
+
122
+ var dataForm = new VarienForm('vidtest-youtube-uploadform');
123
+
124
+ var checkRadios = function(){
125
+ if ($('video_file_field_radio').checked){
126
+
127
+ $('video_file_block').show();
128
+ $('video_link_block').hide();
129
+
130
+ addClass($('video_file_field'), 'required-entry');
131
+ removeClass($('video_link_field'), 'required-entry');
132
+
133
+ } else if($('video_link_field_radio').checked) {
134
+
135
+ $('video_link_block').show();
136
+ $('video_file_block').hide();
137
+
138
+ addClass($('video_link_field'), 'required-entry');
139
+ removeClass($('video_file_field'), 'required-entry');
140
+ }
141
+ }
142
+ //]]>
143
+ </script>
144
+
145
+ </div>
146
+ </div>
147
+ </div>
148
+ <?php if((count($videoCollection)>0) OR (count($customerVideoCollection)>0)):?>
149
+ <ul id="mycarousel" class="jcarousel-skin-tango">
150
+ <?php
151
+ foreach($videoCollection->getData() as $videos): ?>
152
+
153
+ <?php
154
+
155
+
156
+ /*$key = 'v';
157
+
158
+ echo $current_url = preg_replace('/(.*)(\?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $videos['video_url'] . '&');
159
+ */
160
+
161
+ $posOfV = strpos($videos['video_url'],'?v=');
162
+
163
+ if($posOfV === false) {
164
+
165
+ $explodeArr = explode("youtu.be/",$videos['video_url']);
166
+
167
+ $embedId = $explodeArr[1];
168
+
169
+ }else {
170
+ $explodeArr = explode("?v=",$videos['video_url']);
171
+
172
+ $pos = strpos($explodeArr,'&');
173
+
174
+ if($pos === false) {
175
+ $embedId = $explodeArr[1];
176
+ }
177
+ else {
178
+ $explodedAgain = explode("&",$explodeArr[1]);
179
+
180
+ $embedId = $explodedAgain[0];
181
+ }
182
+
183
+ }
184
+ ?>
185
+
186
+ <?php
187
+
188
+ $json = json_decode(file_get_contents("http://gdata.youtube.com/feeds/api/videos/".$embedId."?v=2&alt=jsonc"));
189
+ //echo '<img src="' . $json->data->thumbnail->sqDefault . '">';
190
+ $content = file_get_contents("http://youtube.com/get_video_info?video_id=".$embedId);
191
+ parse_str($content, $ytarr);
192
+ ?>
193
+ <li>
194
+ <?php
195
+ $title = $ytarr['title'];
196
+ //echo strlen($title);
197
+ $length = 40; //modify for desired width
198
+ $break=" "; $pad="...";
199
+ if (strlen($title) <= $length) {
200
+ $trunctitle = $title; //do nothing
201
+ } else {
202
+ $string = substr($title, 0, $length);
203
+ if(false !== ($breakpoint = strrpos($string, $break)))
204
+ {
205
+ $string = substr($title, 0, $breakpoint);
206
+ }
207
+ $trunctitle = $string . $pad;
208
+ //$title = substr($title,0,strpos($title,' ',$length))."...";
209
+ }
210
+ //$truncpname = myTruncate2($title, 40);
211
+ ?>
212
+ <a class="youtube" title="<?php echo $trunctitle ?>" href="http://www.youtube.com/embed/<?php echo $embedId ?>?rel=0&amp;wmode=transparent&amp;autoplay=1">
213
+ <img src="<?php echo $json->data->thumbnail->sqDefault ?>" width="100%" height="90" alt="" />
214
+ </a>
215
+
216
+ <div style="width:100%;font-weight:bold;color: #1E7EC8;"><?php echo $trunctitle; ?></div>
217
+ </li>
218
+ <?php endforeach; ?>
219
+
220
+ <?php
221
+
222
+ foreach($customerVideoCollection->getData() as $custVideotest):
223
+
224
+ //$explodeArr = explode("?v=",$custVideotest['customer_video_url']);
225
+
226
+ $posOfV = strpos($custVideotest['customer_video_url'],'?v=');
227
+
228
+ if($posOfV === false) {
229
+
230
+ $explodeArr = explode("youtu.be/",$custVideotest['customer_video_url']);
231
+
232
+ $embedId = $explodeArr[1];
233
+
234
+ }else {
235
+ $explodeArr = explode("?v=",$custVideotest['customer_video_url']);
236
+
237
+ $pos = strpos($explodeArr,'&');
238
+
239
+ if($pos === false) {
240
+ $embedId = $explodeArr[1];
241
+ }
242
+ else {
243
+ $explodedAgain = explode("&",$explodeArr[1]);
244
+
245
+ $embedId = $explodedAgain[0];
246
+ }
247
+
248
+ }
249
+
250
+ $json = json_decode(file_get_contents("http://gdata.youtube.com/feeds/api/videos/".$embedId."?v=2&alt=jsonc"));
251
+
252
+ ?>
253
+ <li>
254
+ <a class="youtube" title="<?php echo $custVideotest['customer_title']; ?>" href="http://www.youtube.com/embed/<?php echo $embedId ?>?rel=0&amp;wmode=transparent&amp;autoplay=1">
255
+ <img src="<?php echo $json->data->thumbnail->sqDefault ?>" width="100%" height="90" alt="" />
256
+ </a>
257
+ <div style="float:left;width:100%;font-weight:bold;color: #1E7EC8;"><?php echo $custVideotest['customer_title']; ?></div>
258
+ <div style="float:left;width:100%;"><?php echo $custVideotest['customer_name']; ?></div>
259
+ </li>
260
+
261
+
262
+ <?php endforeach; ?>
263
+ </ul>
264
+ <?php endif; ?>
265
+ </div>
app/etc/modules/Medma_Admintestimonials.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Medma_Admintestimonials>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Medma_Admintestimonials>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Medma_Video_Testimonials</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This module gives facility to upload multiple videos for product (per product from Customer end) and (per category from Admin end). You don't need to upload video. Just add video URL from youtube.</summary>
10
+ <description>This module gives facility to upload multiple videos for product (per product from Customer end) and (per category from Admin end). You don't need to upload video. Just add video URL from youtube.&#xD;
11
+ &#xD;
12
+ Admin has the right to approve or disapprove Customer's video.</description>
13
+ <notes>This module gives facility to upload multiple videos for product (per product from Customer end) and (per category from Admin end). You don't need to upload video. Just add video URL from youtube.&#xD;
14
+ &#xD;
15
+ Admin has the right to approve or disapprove Customer's video.</notes>
16
+ <authors><author><name>Medma_Infomatix</name><user>Medma_Infomatix</user><email>gaurav@medma.in</email></author></authors>
17
+ <date>2012-10-12</date>
18
+ <time>09:15:47</time>
19
+ <contents><target name="magelocal"><dir name="Medma"><dir name="Admintestimonials"><dir name="Block"><dir name="Adminhtml"><dir name="Admintestimonials"><dir name="Edit"><file name="Form.php" hash="00522fb204b061b38e675f00114f52c8"/><dir name="Tab"><file name="Form.php" hash="f0f6c31b5a39548d1eb32e314b70dde6"/></dir><file name="Tabs.php" hash="153ebd5d0c814ea79c8e30eae7cac070"/></dir><file name="Edit.php" hash="63b6c7a4fc4f6e032d2fb0528e195a8c"/><file name="Grid.php" hash="22b2abdbd190f649e1e8a2cbcb070a29"/><dir name="Renderer"><file name="Category.php" hash="7022a3c2be78353896ea1a273bd1b246"/><file name="CountCategory.php" hash="51b4f6aff50ac7c395b7fceb4dbaf872"/></dir></dir><file name="Admintestimonials.php" hash="a5798648440eaa5b236843c6cc2e5a2a"/><dir name="Customertestimonials"><dir name="Edit"><file name="Form.php" hash="b4fb75fefad92b80d4f7444488304641"/><dir name="Tab"><file name="Form.php" hash="fb5cc632b0879288b2f8c452cc385de9"/><file name="Video.php" hash="700d59723b2a6617036741b284dd7c3f"/></dir><file name="Tabs.php" hash="5277d1fcc29551850234852d5f3b51df"/></dir><file name="Edit.php" hash="64233667b04010dd5847750bf6879a3c"/><file name="Grid.php" hash="4d675f77a3798908266cb47b66646027"/><dir name="Renderer"><file name="Category.php" hash="2aa81a699eac77c51825cae5d888ea2e"/><file name="Customerproduct.php" hash="30c4c89fd7686e623ff2098c5267c54b"/></dir></dir><file name="Customertestimonials.php" hash="8953b21463340b2ad1cbf77ecd9ffdca"/></dir><file name="Admintestimonials.php" hash="ae05058b5644aa976e2e4d09077b2a33"/><dir name="Catalog"><dir name="Product"><file name="View.php" hash="34638d8c55b1d393be9d394ad80e15dc"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="7e2798eb9753ce77235c1c5eb796bdac"/></dir><dir name="Model"><file name="Admintestimonials.php" hash="ac251b79f056d7250981e2401a8d31ff"/><file name="Category.php" hash="99eb65efaec8238569638ee59dfe18fa"/><file name="Customerproduct.php" hash="ac93c104729302ddc6c7894a6ebb36c8"/><file name="Customerstatus.php" hash="811cfcaffbf21f93e4ffe8511df927d4"/><file name="Customertestimonials.php" hash="61e58acdaf78ed68c59be962b348dcc9"/><dir name="Mysql4"><dir name="Admintestimonials"><file name="Collection.php" hash="985b91bf23377e67c166977c42d04531"/></dir><file name="Admintestimonials.php" hash="c7945fcdb6d7d75c9fcec578b7c046ff"/><dir name="Customertestimonials"><file name="Collection.php" hash="93215308bd3f7f9996289c917b2317c8"/></dir><file name="Customertestimonials.php" hash="b884426425a37825aeb44a922cef315b"/></dir><file name="Status.php" hash="66dfa7e1980d2e4832476d64c8ddb08a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="AdmintestimonialsController.php" hash="22a113d81f7af23952a01fccf0d18e05"/><file name="CustomertestimonialsController.php" hash="a7aecd1c84f571e3cda13d9fdfc4637b"/></dir><file name="IndexController.php" hash="4ba4af2e71cddc49fd7cb5b7ea51ded3"/></dir><dir name="etc"><file name="config.xml" hash="5ed1a1da53ff87fefd08e8b24516f342"/></dir><dir name="sql"><dir name="admintestimonials_setup"><file name="mysql4-install-0.1.0.php" hash="bf98027bb61a7e8bf2917772d495b9f2"/><file name="mysql4-upgrade-0.1.0-0.2.2.php" hash="b257696ca92a64f2c5b66bfef1a8456b"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Medma_Admintestimonials.xml" hash="df6e8f4dab7a8462ebf4a448cf3d0cf0"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="admintestimonials.xml" hash="ab7be3322bb914e49ad1956346242f1e"/></dir><dir name="template"><dir name="admintestimonials"><dir name="customers"><file name="customervidtestvideo.phtml" hash="be1c8d2e9b89c98528e9514d2db2a87b"/></dir><file name="form.phtml" hash="199470b0c9d30958acbee5a4f4d9b341"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="videotestimonials.xml" hash="0c5f75830e41569b89ea1f0bc3ed9585"/></dir><dir name="template"><dir name="videotestimonials"><dir name="catalog"><dir name="product"><dir name="view"><file name="videoslider.phtml" hash="2143efcc4199ab256c7903d56bb16a35"/></dir><file name="view.phtml" hash="ad976a883895b21b5202cfa702c149eb"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="colorbox.css" hash="fd194c203085213b2dc66b0ad15b1269"/><file name="skin.css" hash="062bac3a5d51ed1a5380410d499f122e"/></dir><dir name="images"><dir name="video"><file name="border.png" hash="7ca8a1d2eb0763b35c266cd54bee2fa5"/><file name="controls.png" hash="b68b9ecaae424de4862ba0d055b7a560"/><dir name="ie6"><file name="borderBottomCenter.png" hash="1936585831e8bcf4eb5ef1081c8e2574"/><file name="borderBottomLeft.png" hash="7ceeb01563f030dc47837fd8bad29488"/><file name="borderBottomRight.png" hash="297fb77440870d91f519bcecdb312725"/><file name="borderMiddleLeft.png" hash="64df0244eeaade27764d2cf33606527b"/><file name="borderMiddleRight.png" hash="9fa458eaaa35b80b2452f35a1d6b4d0c"/><file name="borderTopCenter.png" hash="01ecb01841270f3a765aadf4900929f3"/><file name="borderTopLeft.png" hash="bf4949b95b09d255edd9bcb8358a3557"/><file name="borderTopRight.png" hash="51315fa19507a33d5f1b5411598593e7"/></dir><file name="loading.gif" hash="e6611f867d63754b7a2a974fb0a0e7dc"/><file name="loading_background.png" hash="acf427e932fb9413700a4b8b58b41eec"/><file name="next-horizontal.png" hash="f457d9e2544c1c0e38f2e059665b9ba1"/><file name="overlay.png" hash="790376e15a036959e358a19d4a7ea437"/><file name="prev-horizontal.png" hash="09bd536fd4aee6b42a8cd60bab3b3a9f"/></dir></dir><dir name="js"><file name="jquery.js" hash="e21f1b89a71a1ecab4e3c8bed467d22b"/><file name="jquery.colorbox.js" hash="21b22834236d2a450836ec7c8c2efdb8"/></dir></dir></dir></dir></target></contents>
20
+ <compatible/>
21
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
22
+ </package>
skin/frontend/default/default/css/colorbox.css ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style:
3
+ The following CSS is consistent between example themes and should not be altered.
4
+ */
5
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
6
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
7
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
8
+ #cboxContent{position:relative;}
9
+ #cboxLoadedContent{overflow:auto;}
10
+ #cboxTitle{margin:0;}
11
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
12
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
13
+ .cboxPhoto{float:left; margin:auto; border:0; display:block;}
14
+ .cboxIframe{width:100%; height:100%; display:block; border:0;}
15
+
16
+ /*
17
+ User Style:
18
+ Change the following styles to modify the appearance of ColorBox. They are
19
+ ordered & tabbed in a way that represents the nesting of the generated HTML.
20
+ */
21
+ #cboxOverlay{background:url(../images/video/overlay.png) repeat 0 0;}
22
+ #colorbox{}
23
+ #cboxTopLeft{width:21px; height:21px; background:url(../images/video/controls.png) no-repeat -101px 0;}
24
+ #cboxTopRight{width:21px; height:21px; background:url(../images/video/controls.png) no-repeat -130px 0;}
25
+ #cboxBottomLeft{width:21px; height:21px; background:url(../images/video/controls.png) no-repeat -101px -29px;}
26
+ #cboxBottomRight{width:21px; height:21px; background:url(../images/video/controls.png) no-repeat -130px -29px;}
27
+ #cboxMiddleLeft{width:21px; background:url(../images/video/controls.png) left top repeat-y;}
28
+ #cboxMiddleRight{width:21px; background:url(../images/video/controls.png) right top repeat-y;}
29
+ #cboxTopCenter{height:21px; background:url(../images/video/border.png) 0 0 repeat-x;}
30
+ #cboxBottomCenter{height:21px; background:url(../images/video/border.png) 0 -29px repeat-x;}
31
+ #cboxContent{background:#fff; overflow:hidden;}
32
+ .cboxIframe{background:#fff;}
33
+ #cboxError{padding:50px; border:1px solid #ccc;}
34
+ #cboxLoadedContent{margin-bottom:28px;}
35
+ #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
36
+ #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
37
+ #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
38
+ #cboxPrevious{position:absolute; bottom:0; left:0; background:url(../images/video/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
39
+ #cboxPrevious:hover{background-position:-75px -25px;}
40
+ #cboxNext{position:absolute; bottom:0; left:27px; background:url(../images/video/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
41
+ #cboxNext:hover{background-position:-50px -25px;}
42
+ #cboxLoadingOverlay{background:url(../images/video/loading_background.png) no-repeat center center;}
43
+ #cboxLoadingGraphic{background:url(../images/video/loading.gif) no-repeat center center;}
44
+ #cboxClose{position:absolute; bottom:0; right:0; background:url(../images/video/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
45
+ #cboxClose:hover{background-position:-25px -25px;}
46
+
47
+ /*
48
+ The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
49
+ when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
50
+ See: http://jacklmoore.com/notes/ie-transparency-problems/
51
+ */
52
+ .cboxIE #cboxTopLeft,
53
+ .cboxIE #cboxTopCenter,
54
+ .cboxIE #cboxTopRight,
55
+ .cboxIE #cboxBottomLeft,
56
+ .cboxIE #cboxBottomCenter,
57
+ .cboxIE #cboxBottomRight,
58
+ .cboxIE #cboxMiddleLeft,
59
+ .cboxIE #cboxMiddleRight {
60
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
61
+ }
62
+
63
+ /*
64
+ The following provides PNG transparency support for IE6
65
+ Feel free to remove this and the /ie6/ directory if you have dropped IE6 support.
66
+ */
67
+ .cboxIE6 #cboxTopLeft{background:url(../images/video/ie6/borderTopLeft.png);}
68
+ .cboxIE6 #cboxTopCenter{background:url(../images/video/ie6/borderTopCenter.png);}
69
+ .cboxIE6 #cboxTopRight{background:url(../images/video/ie6/borderTopRight.png);}
70
+ .cboxIE6 #cboxBottomLeft{background:url(../images/video/ie6/borderBottomLeft.png);}
71
+ .cboxIE6 #cboxBottomCenter{background:url(../images/video/ie6/borderBottomCenter.png);}
72
+ .cboxIE6 #cboxBottomRight{background:url(../images/video/ie6/borderBottomRight.png);}
73
+ .cboxIE6 #cboxMiddleLeft{background:url(../images/video/ie6/borderMiddleLeft.png);}
74
+ .cboxIE6 #cboxMiddleRight{background:url(../images/video/ie6/borderMiddleRight.png);}
75
+
76
+ .cboxIE6 #cboxTopLeft,
77
+ .cboxIE6 #cboxTopCenter,
78
+ .cboxIE6 #cboxTopRight,
79
+ .cboxIE6 #cboxBottomLeft,
80
+ .cboxIE6 #cboxBottomCenter,
81
+ .cboxIE6 #cboxBottomRight,
82
+ .cboxIE6 #cboxMiddleLeft,
83
+ .cboxIE6 #cboxMiddleRight {
84
+ _behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')");
85
+ }
skin/frontend/default/default/css/skin.css ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .jcarousel-skin-tango .jcarousel-container {
2
+ /* -moz-border-radius: 10px;
3
+ -webkit-border-radius: 10px;
4
+ border-radius: 10px;
5
+ background: #F0F6F9;*/
6
+ border: 1px solid #CCCCCC;
7
+ }
8
+
9
+ .jcarousel-skin-tango .jcarousel-direction-rtl {
10
+ direction: rtl;
11
+ }
12
+
13
+ .jcarousel-skin-tango .jcarousel-container-horizontal {
14
+ /*width: 245px;*/
15
+ padding: 20px 40px;
16
+ }
17
+
18
+ .jcarousel-skin-tango .jcarousel-container-vertical {
19
+ width: 75px;
20
+ height: 245px;
21
+ padding: 40px 20px;
22
+ }
23
+
24
+ .jcarousel-skin-tango .jcarousel-clip {
25
+ overflow: hidden;
26
+ }
27
+
28
+ .jcarousel-skin-tango .jcarousel-clip-horizontal {
29
+ /*width: 245px;
30
+ height: 75px;*/
31
+ }
32
+
33
+ .jcarousel-skin-tango .jcarousel-clip-vertical {
34
+ width: 75px;
35
+ height: 245px;
36
+ }
37
+
38
+ .jcarousel-skin-tango .jcarousel-item {
39
+ /*width: 75px;
40
+ height: 90px;*/
41
+ }
42
+
43
+ .jcarousel-skin-tango .jcarousel-item-horizontal {
44
+ margin-left: 0;
45
+ margin-right: 10px;
46
+ }
47
+
48
+ .jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-item-horizontal {
49
+ margin-left: 10px;
50
+ margin-right: 0;
51
+ }
52
+
53
+ .jcarousel-skin-tango .jcarousel-item-vertical {
54
+ margin-bottom: 10px;
55
+ }
56
+
57
+ .jcarousel-skin-tango .jcarousel-item-placeholder {
58
+ background: #fff;
59
+ color: #000;
60
+ }
61
+
62
+ /**
63
+ * Horizontal Buttons
64
+ */
65
+ .jcarousel-skin-tango .jcarousel-next-horizontal {
66
+ position: absolute;
67
+ top: 43px;
68
+ right: 5px;
69
+ width: 32px;
70
+ height: 32px;
71
+ cursor: pointer;
72
+ background: transparent url(../images/video/next-horizontal.png) no-repeat 0 0;
73
+ }
74
+
75
+ .jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-next-horizontal {
76
+ left: 5px;
77
+ right: auto;
78
+ background-image: url(../images/video/prev-horizontal.png);
79
+ }
80
+
81
+ .jcarousel-skin-tango .jcarousel-next-horizontal:hover,
82
+ .jcarousel-skin-tango .jcarousel-next-horizontal:focus {
83
+ background-position: -32px 0;
84
+ }
85
+
86
+ .jcarousel-skin-tango .jcarousel-next-horizontal:active {
87
+ background-position: -64px 0;
88
+ }
89
+
90
+ .jcarousel-skin-tango .jcarousel-next-disabled-horizontal,
91
+ .jcarousel-skin-tango .jcarousel-next-disabled-horizontal:hover,
92
+ .jcarousel-skin-tango .jcarousel-next-disabled-horizontal:focus,
93
+ .jcarousel-skin-tango .jcarousel-next-disabled-horizontal:active {
94
+ cursor: default;
95
+ background-position: -96px 0;
96
+ }
97
+
98
+ .jcarousel-skin-tango .jcarousel-prev-horizontal {
99
+ position: absolute;
100
+ top: 43px;
101
+ left: 5px;
102
+ width: 32px;
103
+ height: 32px;
104
+ cursor: pointer;
105
+ background: transparent url(../images/video/prev-horizontal.png) no-repeat 0 0;
106
+ }
107
+
108
+ .jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-prev-horizontal {
109
+ left: auto;
110
+ right: 5px;
111
+ background-image: url(../images/video/next-horizontal.png);
112
+ }
113
+
114
+ .jcarousel-skin-tango .jcarousel-prev-horizontal:hover,
115
+ .jcarousel-skin-tango .jcarousel-prev-horizontal:focus {
116
+ background-position: -32px 0;
117
+ }
118
+
119
+ .jcarousel-skin-tango .jcarousel-prev-horizontal:active {
120
+ background-position: -64px 0;
121
+ }
122
+
123
+ .jcarousel-skin-tango .jcarousel-prev-disabled-horizontal,
124
+ .jcarousel-skin-tango .jcarousel-prev-disabled-horizontal:hover,
125
+ .jcarousel-skin-tango .jcarousel-prev-disabled-horizontal:focus,
126
+ .jcarousel-skin-tango .jcarousel-prev-disabled-horizontal:active {
127
+ cursor: default;
128
+ background-position: -96px 0;
129
+ }
130
+
131
+ /**
132
+ * Vertical Buttons
133
+ */
134
+ .jcarousel-skin-tango .jcarousel-next-vertical {
135
+ position: absolute;
136
+ bottom: 5px;
137
+ left: 43px;
138
+ width: 32px;
139
+ height: 32px;
140
+ cursor: pointer;
141
+ background: transparent url(next-vertical.png) no-repeat 0 0;
142
+ }
143
+
144
+ .jcarousel-skin-tango .jcarousel-next-vertical:hover,
145
+ .jcarousel-skin-tango .jcarousel-next-vertical:focus {
146
+ background-position: 0 -32px;
147
+ }
148
+
149
+ .jcarousel-skin-tango .jcarousel-next-vertical:active {
150
+ background-position: 0 -64px;
151
+ }
152
+
153
+ .jcarousel-skin-tango .jcarousel-next-disabled-vertical,
154
+ .jcarousel-skin-tango .jcarousel-next-disabled-vertical:hover,
155
+ .jcarousel-skin-tango .jcarousel-next-disabled-vertical:focus,
156
+ .jcarousel-skin-tango .jcarousel-next-disabled-vertical:active {
157
+ cursor: default;
158
+ background-position: 0 -96px;
159
+ }
160
+
161
+ .jcarousel-skin-tango .jcarousel-prev-vertical {
162
+ position: absolute;
163
+ top: 5px;
164
+ left: 43px;
165
+ width: 32px;
166
+ height: 32px;
167
+ cursor: pointer;
168
+ background: transparent url(prev-vertical.png) no-repeat 0 0;
169
+ }
170
+
171
+ .jcarousel-skin-tango .jcarousel-prev-vertical:hover,
172
+ .jcarousel-skin-tango .jcarousel-prev-vertical:focus {
173
+ background-position: 0 -32px;
174
+ }
175
+
176
+ .jcarousel-skin-tango .jcarousel-prev-vertical:active {
177
+ background-position: 0 -64px;
178
+ }
179
+
180
+ .jcarousel-skin-tango .jcarousel-prev-disabled-vertical,
181
+ .jcarousel-skin-tango .jcarousel-prev-disabled-vertical:hover,
182
+ .jcarousel-skin-tango .jcarousel-prev-disabled-vertical:focus,
183
+ .jcarousel-skin-tango .jcarousel-prev-disabled-vertical:active {
184
+ cursor: default;
185
+ background-position: 0 -96px;
186
+ }
187
+ .product-collateral h2 {
188
+ border-bottom: 1px solid #E5DCC3;
189
+ color: #E26703;
190
+ font-size: 15px;
191
+ font-weight: bold;
192
+ margin: 0 0 15px;
193
+ padding: 0 0 1px;
194
+ }
195
+
196
+ .add-own-video-button a {
197
+ font-weight: bold;
198
+ }
199
+ a {
200
+ color: #1E7EC8;
201
+ text-decoration: underline;
202
+ }
203
+ .vidtest-uploadform div.form-head {
204
+ border-bottom: 1px solid #E4E4E4;
205
+ margin-bottom: 5px;
206
+ }
207
+
208
+ h4 {
209
+ font-size: 14px;
210
+ font-weight: bold;
211
+ }
212
+ h1, h2, h3, h4, h5, h6 {
213
+ color: #0A263C;
214
+ line-height: 1.35;
215
+ margin: 0 0 5px;
216
+ }
217
+ div#uploadform-content {
218
+ border: 1px solid #CCCCCC;
219
+ padding:11px;
220
+ }
221
+ #for_1400.vidtest-collateral-box {
222
+ position: relative;
223
+ }
224
+
225
+ .vidtest-collateral-box #for_1400.add-own-video-button {
226
+ position: absolute;
227
+ right: 4px;
228
+ top: -1px;
229
+ }
skin/frontend/default/default/images/video/border.png ADDED
Binary file
skin/frontend/default/default/images/video/controls.png ADDED
Binary file
skin/frontend/default/default/images/video/ie6/borderBottomCenter.png ADDED
Binary file
skin/frontend/default/default/images/video/ie6/borderBottomLeft.png ADDED
Binary file
skin/frontend/default/default/images/video/ie6/borderBottomRight.png ADDED
Binary file
skin/frontend/default/default/images/video/ie6/borderMiddleLeft.png ADDED
Binary file
skin/frontend/default/default/images/video/ie6/borderMiddleRight.png ADDED
Binary file
skin/frontend/default/default/images/video/ie6/borderTopCenter.png ADDED
Binary file
skin/frontend/default/default/images/video/ie6/borderTopLeft.png ADDED
Binary file
skin/frontend/default/default/images/video/ie6/borderTopRight.png ADDED
Binary file
skin/frontend/default/default/images/video/loading.gif ADDED
Binary file
skin/frontend/default/default/images/video/loading_background.png ADDED
Binary file
skin/frontend/default/default/images/video/next-horizontal.png ADDED
Binary file
skin/frontend/default/default/images/video/overlay.png ADDED
Binary file
skin/frontend/default/default/images/video/prev-horizontal.png ADDED
Binary file
skin/frontend/default/default/js/jquery.colorbox.js ADDED
@@ -0,0 +1,888 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // ColorBox v1.3.19 - jQuery lightbox plugin
2
+ // (c) 2011 Jack Moore - jacklmoore.com
3
+ // License: http://www.opensource.org/licenses/mit-license.php
4
+ (function ($, document, window) {
5
+ var
6
+ // Default settings object.
7
+ // See http://jacklmoore.com/colorbox for details.
8
+ defaults = {
9
+ transition: "elastic",
10
+ speed: 300,
11
+ width: false,
12
+ initialWidth: "600",
13
+ innerWidth: false,
14
+ maxWidth: false,
15
+ height: false,
16
+ initialHeight: "450",
17
+ innerHeight: false,
18
+ maxHeight: false,
19
+ scalePhotos: true,
20
+ scrolling: true,
21
+ inline: false,
22
+ html: false,
23
+ iframe: false,
24
+ fastIframe: true,
25
+ photo: false,
26
+ href: false,
27
+ title: false,
28
+ rel: false,
29
+ opacity: 0.9,
30
+ preloading: true,
31
+ current: "image {current} of {total}",
32
+ previous: "previous",
33
+ next: "next",
34
+ close: "close",
35
+ open: false,
36
+ returnFocus: true,
37
+ reposition: true,
38
+ loop: true,
39
+ slideshow: false,
40
+ slideshowAuto: true,
41
+ slideshowSpeed: 2500,
42
+ slideshowStart: "start slideshow",
43
+ slideshowStop: "stop slideshow",
44
+ onOpen: false,
45
+ onLoad: false,
46
+ onComplete: false,
47
+ onCleanup: false,
48
+ onClosed: false,
49
+ overlayClose: true,
50
+ escKey: true,
51
+ arrowKey: true,
52
+ top: false,
53
+ bottom: false,
54
+ left: false,
55
+ right: false,
56
+ fixed: false,
57
+ data: undefined
58
+ },
59
+
60
+ // Abstracting the HTML and event identifiers for easy rebranding
61
+ colorbox = 'colorbox',
62
+ prefix = 'cbox',
63
+ boxElement = prefix + 'Element',
64
+
65
+ // Events
66
+ event_open = prefix + '_open',
67
+ event_load = prefix + '_load',
68
+ event_complete = prefix + '_complete',
69
+ event_cleanup = prefix + '_cleanup',
70
+ event_closed = prefix + '_closed',
71
+ event_purge = prefix + '_purge',
72
+
73
+ // Special Handling for IE
74
+ isIE = !$.support.opacity && !$.support.style, // IE7 & IE8
75
+ isIE6 = isIE && !window.XMLHttpRequest, // IE6
76
+ event_ie6 = prefix + '_IE6',
77
+
78
+ // Cached jQuery Object Variables
79
+ $overlay,
80
+ $box,
81
+ $wrap,
82
+ $content,
83
+ $topBorder,
84
+ $leftBorder,
85
+ $rightBorder,
86
+ $bottomBorder,
87
+ $related,
88
+ $window,
89
+ $loaded,
90
+ $loadingBay,
91
+ $loadingOverlay,
92
+ $title,
93
+ $current,
94
+ $slideshow,
95
+ $next,
96
+ $prev,
97
+ $close,
98
+ $groupControls,
99
+
100
+ // Variables for cached values or use across multiple functions
101
+ settings,
102
+ interfaceHeight,
103
+ interfaceWidth,
104
+ loadedHeight,
105
+ loadedWidth,
106
+ element,
107
+ index,
108
+ photo,
109
+ open,
110
+ active,
111
+ closing,
112
+ loadingTimer,
113
+ publicMethod,
114
+ div = "div",
115
+ init;
116
+
117
+ // ****************
118
+ // HELPER FUNCTIONS
119
+ // ****************
120
+
121
+ // Convience function for creating new jQuery objects
122
+ function $tag(tag, id, css) {
123
+ var element = document.createElement(tag);
124
+
125
+ if (id) {
126
+ element.id = prefix + id;
127
+ }
128
+
129
+ if (css) {
130
+ element.style.cssText = css;
131
+ }
132
+
133
+ return $(element);
134
+ }
135
+
136
+ // Determine the next and previous members in a group.
137
+ function getIndex(increment) {
138
+ var
139
+ max = $related.length,
140
+ newIndex = (index + increment) % max;
141
+
142
+ return (newIndex < 0) ? max + newIndex : newIndex;
143
+ }
144
+
145
+ // Convert '%' and 'px' values to integers
146
+ function setSize(size, dimension) {
147
+ return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : $window.height()) / 100) : 1) * parseInt(size, 10));
148
+ }
149
+
150
+ // Checks an href to see if it is a photo.
151
+ // There is a force photo option (photo: true) for hrefs that cannot be matched by this regex.
152
+ function isImage(url) {
153
+ return settings.photo || /\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(url);
154
+ }
155
+
156
+ // Assigns function results to their respective properties
157
+ function makeSettings() {
158
+ var i;
159
+ settings = $.extend({}, $.data(element, colorbox));
160
+
161
+ for (i in settings) {
162
+ if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
163
+ settings[i] = settings[i].call(element);
164
+ }
165
+ }
166
+
167
+ settings.rel = settings.rel || element.rel || 'nofollow';
168
+ settings.href = settings.href || $(element).attr('href');
169
+ settings.title = settings.title || element.title;
170
+
171
+ if (typeof settings.href === "string") {
172
+ settings.href = $.trim(settings.href);
173
+ }
174
+ }
175
+
176
+ function trigger(event, callback) {
177
+ $.event.trigger(event);
178
+ if (callback) {
179
+ callback.call(element);
180
+ }
181
+ }
182
+
183
+ // Slideshow functionality
184
+ function slideshow() {
185
+ var
186
+ timeOut,
187
+ className = prefix + "Slideshow_",
188
+ click = "click." + prefix,
189
+ start,
190
+ stop,
191
+ clear;
192
+
193
+ if (settings.slideshow && $related[1]) {
194
+ start = function () {
195
+ $slideshow
196
+ .text(settings.slideshowStop)
197
+ .unbind(click)
198
+ .bind(event_complete, function () {
199
+ if (settings.loop || $related[index + 1]) {
200
+ timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
201
+ }
202
+ })
203
+ .bind(event_load, function () {
204
+ clearTimeout(timeOut);
205
+ })
206
+ .one(click + ' ' + event_cleanup, stop);
207
+ $box.removeClass(className + "off").addClass(className + "on");
208
+ timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
209
+ };
210
+
211
+ stop = function () {
212
+ clearTimeout(timeOut);
213
+ $slideshow
214
+ .text(settings.slideshowStart)
215
+ .unbind([event_complete, event_load, event_cleanup, click].join(' '))
216
+ .one(click, function () {
217
+ publicMethod.next();
218
+ start();
219
+ });
220
+ $box.removeClass(className + "on").addClass(className + "off");
221
+ };
222
+
223
+ if (settings.slideshowAuto) {
224
+ start();
225
+ } else {
226
+ stop();
227
+ }
228
+ } else {
229
+ $box.removeClass(className + "off " + className + "on");
230
+ }
231
+ }
232
+
233
+ function launch(target) {
234
+ if (!closing) {
235
+
236
+ element = target;
237
+
238
+ makeSettings();
239
+
240
+ $related = $(element);
241
+
242
+ index = 0;
243
+
244
+ if (settings.rel !== 'nofollow') {
245
+ $related = $('.' + boxElement).filter(function () {
246
+ var relRelated = $.data(this, colorbox).rel || this.rel;
247
+ return (relRelated === settings.rel);
248
+ });
249
+ index = $related.index(element);
250
+
251
+ // Check direct calls to ColorBox.
252
+ if (index === -1) {
253
+ $related = $related.add(element);
254
+ index = $related.length - 1;
255
+ }
256
+ }
257
+
258
+ if (!open) {
259
+ open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
260
+
261
+ $box.show();
262
+
263
+ if (settings.returnFocus) {
264
+ $(element).blur().one(event_closed, function () {
265
+ $(this).focus();
266
+ });
267
+ }
268
+
269
+ // +settings.opacity avoids a problem in IE when using non-zero-prefixed-string-values, like '.5'
270
+ $overlay.css({"opacity": +settings.opacity, "cursor": settings.overlayClose ? "pointer" : "auto"}).show();
271
+
272
+ // Opens inital empty ColorBox prior to content being loaded.
273
+ settings.w = setSize(settings.initialWidth, 'x');
274
+ settings.h = setSize(settings.initialHeight, 'y');
275
+ publicMethod.position();
276
+
277
+ if (isIE6) {
278
+ $window.bind('resize.' + event_ie6 + ' scroll.' + event_ie6, function () {
279
+ $overlay.css({width: $window.width(), height: $window.height(), top: $window.scrollTop(), left: $window.scrollLeft()});
280
+ }).trigger('resize.' + event_ie6);
281
+ }
282
+
283
+ trigger(event_open, settings.onOpen);
284
+
285
+ $groupControls.add($title).hide();
286
+
287
+ $close.html(settings.close).show();
288
+ }
289
+
290
+ publicMethod.load(true);
291
+ }
292
+ }
293
+
294
+ // ColorBox's markup needs to be added to the DOM prior to being called
295
+ // so that the browser will go ahead and load the CSS background images.
296
+ function appendHTML() {
297
+ if (!$box && document.body) {
298
+ init = false;
299
+
300
+ $window = $(window);
301
+ $box = $tag(div).attr({id: colorbox, 'class': isIE ? prefix + (isIE6 ? 'IE6' : 'IE') : ''}).hide();
302
+ $overlay = $tag(div, "Overlay", isIE6 ? 'position:absolute' : '').hide();
303
+ $wrap = $tag(div, "Wrapper");
304
+ $content = $tag(div, "Content").append(
305
+ $loaded = $tag(div, "LoadedContent", 'width:0; height:0; overflow:hidden'),
306
+ $loadingOverlay = $tag(div, "LoadingOverlay").add($tag(div, "LoadingGraphic")),
307
+ $title = $tag(div, "Title"),
308
+ $current = $tag(div, "Current"),
309
+ $next = $tag(div, "Next"),
310
+ $prev = $tag(div, "Previous"),
311
+ $slideshow = $tag(div, "Slideshow").bind(event_open, slideshow),
312
+ $close = $tag(div, "Close")
313
+ );
314
+
315
+ $wrap.append( // The 3x3 Grid that makes up ColorBox
316
+ $tag(div).append(
317
+ $tag(div, "TopLeft"),
318
+ $topBorder = $tag(div, "TopCenter"),
319
+ $tag(div, "TopRight")
320
+ ),
321
+ $tag(div, false, 'clear:left').append(
322
+ $leftBorder = $tag(div, "MiddleLeft"),
323
+ $content,
324
+ $rightBorder = $tag(div, "MiddleRight")
325
+ ),
326
+ $tag(div, false, 'clear:left').append(
327
+ $tag(div, "BottomLeft"),
328
+ $bottomBorder = $tag(div, "BottomCenter"),
329
+ $tag(div, "BottomRight")
330
+ )
331
+ ).find('div div').css({'float': 'left'});
332
+
333
+ $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none');
334
+
335
+ $groupControls = $next.add($prev).add($current).add($slideshow);
336
+
337
+ $(document.body).append($overlay, $box.append($wrap, $loadingBay));
338
+ }
339
+ }
340
+
341
+ // Add ColorBox's event bindings
342
+ function addBindings() {
343
+ if ($box) {
344
+ if (!init) {
345
+ init = true;
346
+
347
+ // Cache values needed for size calculations
348
+ interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6
349
+ interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
350
+ loadedHeight = $loaded.outerHeight(true);
351
+ loadedWidth = $loaded.outerWidth(true);
352
+
353
+ // Setting padding to remove the need to do size conversions during the animation step.
354
+ $box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth});
355
+
356
+ // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
357
+ $next.click(function () {
358
+ publicMethod.next();
359
+ });
360
+ $prev.click(function () {
361
+ publicMethod.prev();
362
+ });
363
+ $close.click(function () {
364
+ publicMethod.close();
365
+ });
366
+ $overlay.click(function () {
367
+ if (settings.overlayClose) {
368
+ publicMethod.close();
369
+ }
370
+ });
371
+
372
+ // Key Bindings
373
+ $(document).bind('keydown.' + prefix, function (e) {
374
+ var key = e.keyCode;
375
+ if (open && settings.escKey && key === 27) {
376
+ e.preventDefault();
377
+ publicMethod.close();
378
+ }
379
+ if (open && settings.arrowKey && $related[1]) {
380
+ if (key === 37) {
381
+ e.preventDefault();
382
+ $prev.click();
383
+ } else if (key === 39) {
384
+ e.preventDefault();
385
+ $next.click();
386
+ }
387
+ }
388
+ });
389
+
390
+ $('.' + boxElement, document).live('click', function (e) {
391
+ // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
392
+ // See: http://jacklmoore.com/notes/click-events/
393
+ if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) {
394
+ e.preventDefault();
395
+ launch(this);
396
+ }
397
+ });
398
+ }
399
+ return true;
400
+ }
401
+ return false;
402
+ }
403
+
404
+ // Don't do anything if ColorBox already exists.
405
+ if ($.colorbox) {
406
+ return;
407
+ }
408
+
409
+ // Append the HTML when the DOM loads
410
+ $(appendHTML);
411
+
412
+
413
+ // ****************
414
+ // PUBLIC FUNCTIONS
415
+ // Usage format: $.fn.colorbox.close();
416
+ // Usage from within an iframe: parent.$.fn.colorbox.close();
417
+ // ****************
418
+
419
+ publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
420
+ var $this = this;
421
+
422
+ options = options || {};
423
+
424
+ appendHTML();
425
+
426
+ if (addBindings()) {
427
+ if (!$this[0]) {
428
+ if ($this.selector) { // if a selector was given and it didn't match any elements, go ahead and exit.
429
+ return $this;
430
+ }
431
+ // if no selector was given (ie. $.colorbox()), create a temporary element to work with
432
+ $this = $('<a/>');
433
+ options.open = true; // assume an immediate open
434
+ }
435
+
436
+ if (callback) {
437
+ options.onComplete = callback;
438
+ }
439
+
440
+ $this.each(function () {
441
+ $.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options));
442
+ }).addClass(boxElement);
443
+
444
+ if (($.isFunction(options.open) && options.open.call($this)) || options.open) {
445
+ launch($this[0]);
446
+ }
447
+ }
448
+
449
+ return $this;
450
+ };
451
+
452
+ publicMethod.position = function (speed, loadedCallback) {
453
+ var
454
+ top = 0,
455
+ left = 0,
456
+ offset = $box.offset(),
457
+ scrollTop = $window.scrollTop(),
458
+ scrollLeft = $window.scrollLeft();
459
+
460
+ $window.unbind('resize.' + prefix);
461
+
462
+ // remove the modal so that it doesn't influence the document width/height
463
+ $box.css({top: -9e4, left: -9e4});
464
+
465
+ if (settings.fixed && !isIE6) {
466
+ offset.top -= scrollTop;
467
+ offset.left -= scrollLeft;
468
+ $box.css({position: 'fixed'});
469
+ } else {
470
+ top = scrollTop;
471
+ left = scrollLeft;
472
+ $box.css({position: 'absolute'});
473
+ }
474
+
475
+ // keeps the top and left positions within the browser's viewport.
476
+ if (settings.right !== false) {
477
+ left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0);
478
+ } else if (settings.left !== false) {
479
+ left += setSize(settings.left, 'x');
480
+ } else {
481
+ left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
482
+ }
483
+
484
+ if (settings.bottom !== false) {
485
+ top += Math.max($window.height() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0);
486
+ } else if (settings.top !== false) {
487
+ top += setSize(settings.top, 'y');
488
+ } else {
489
+ top += Math.round(Math.max($window.height() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
490
+ }
491
+
492
+ $box.css({top: offset.top, left: offset.left});
493
+
494
+ // setting the speed to 0 to reduce the delay between same-sized content.
495
+ speed = ($box.width() === settings.w + loadedWidth && $box.height() === settings.h + loadedHeight) ? 0 : speed || 0;
496
+
497
+ // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
498
+ // but it has to be shrank down around the size of div#colorbox when it's done. If not,
499
+ // it can invoke an obscure IE bug when using iframes.
500
+ $wrap[0].style.width = $wrap[0].style.height = "9999px";
501
+
502
+ function modalDimensions(that) {
503
+ $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = that.style.width;
504
+ $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = that.style.height;
505
+ }
506
+
507
+ $box.dequeue().animate({width: settings.w + loadedWidth, height: settings.h + loadedHeight, top: top, left: left}, {
508
+ duration: speed,
509
+ complete: function () {
510
+ modalDimensions(this);
511
+
512
+ active = false;
513
+
514
+ // shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
515
+ $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
516
+ $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
517
+
518
+ if (settings.reposition) {
519
+ setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
520
+ $window.bind('resize.' + prefix, publicMethod.position);
521
+ }, 1);
522
+ }
523
+
524
+ if (loadedCallback) {
525
+ loadedCallback();
526
+ }
527
+ },
528
+ step: function () {
529
+ modalDimensions(this);
530
+ }
531
+ });
532
+ };
533
+
534
+ publicMethod.resize = function (options) {
535
+ if (open) {
536
+ options = options || {};
537
+
538
+ if (options.width) {
539
+ settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
540
+ }
541
+ if (options.innerWidth) {
542
+ settings.w = setSize(options.innerWidth, 'x');
543
+ }
544
+ $loaded.css({width: settings.w});
545
+
546
+ if (options.height) {
547
+ settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
548
+ }
549
+ if (options.innerHeight) {
550
+ settings.h = setSize(options.innerHeight, 'y');
551
+ }
552
+ if (!options.innerHeight && !options.height) {
553
+ $loaded.css({height: "auto"});
554
+ settings.h = $loaded.height();
555
+ }
556
+ $loaded.css({height: settings.h});
557
+
558
+ publicMethod.position(settings.transition === "none" ? 0 : settings.speed);
559
+ }
560
+ };
561
+
562
+ publicMethod.prep = function (object) {
563
+ if (!open) {
564
+ return;
565
+ }
566
+
567
+ var callback, speed = settings.transition === "none" ? 0 : settings.speed;
568
+
569
+ $loaded.remove();
570
+ $loaded = $tag(div, 'LoadedContent').append(object);
571
+
572
+ function getWidth() {
573
+ settings.w = settings.w || $loaded.width();
574
+ settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
575
+ return settings.w;
576
+ }
577
+ function getHeight() {
578
+ settings.h = settings.h || $loaded.height();
579
+ settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
580
+ return settings.h;
581
+ }
582
+
583
+ $loaded.hide()
584
+ .appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
585
+ .css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'})
586
+ .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
587
+ .prependTo($content);
588
+
589
+ $loadingBay.hide();
590
+
591
+ // floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
592
+ //$(photo).css({'float': 'none', marginLeft: 'auto', marginRight: 'auto'});
593
+
594
+ $(photo).css({'float': 'none'});
595
+
596
+ // Hides SELECT elements in IE6 because they would otherwise sit on top of the overlay.
597
+ if (isIE6) {
598
+ $('select').not($box.find('select')).filter(function () {
599
+ return this.style.visibility !== 'hidden';
600
+ }).css({'visibility': 'hidden'}).one(event_cleanup, function () {
601
+ this.style.visibility = 'inherit';
602
+ });
603
+ }
604
+
605
+ callback = function () {
606
+ var preload, i, total = $related.length, iframe, frameBorder = 'frameBorder', allowTransparency = 'allowTransparency', complete, src, img;
607
+
608
+ if (!open) {
609
+ return;
610
+ }
611
+
612
+ function removeFilter() {
613
+ if (isIE) {
614
+ $box[0].style.removeAttribute('filter');
615
+ }
616
+ }
617
+
618
+ complete = function () {
619
+ clearTimeout(loadingTimer);
620
+ $loadingOverlay.hide();
621
+ trigger(event_complete, settings.onComplete);
622
+ };
623
+
624
+ if (isIE) {
625
+ //This fadeIn helps the bicubic resampling to kick-in.
626
+ if (photo) {
627
+ $loaded.fadeIn(100);
628
+ }
629
+ }
630
+
631
+ $title.html(settings.title).add($loaded).show();
632
+
633
+ if (total > 1) { // handle grouping
634
+ if (typeof settings.current === "string") {
635
+ $current.html(settings.current.replace('{current}', index + 1).replace('{total}', total)).show();
636
+ }
637
+
638
+ $next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(settings.next);
639
+ $prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous);
640
+
641
+ if (settings.slideshow) {
642
+ $slideshow.show();
643
+ }
644
+
645
+ // Preloads images within a rel group
646
+ if (settings.preloading) {
647
+ preload = [
648
+ getIndex(-1),
649
+ getIndex(1)
650
+ ];
651
+ while (i = $related[preload.pop()]) {
652
+ src = $.data(i, colorbox).href || i.href;
653
+ if ($.isFunction(src)) {
654
+ src = src.call(i);
655
+ }
656
+ if (isImage(src)) {
657
+ img = new Image();
658
+ img.src = src;
659
+ }
660
+ }
661
+ }
662
+ } else {
663
+ $groupControls.hide();
664
+ }
665
+
666
+ if (settings.iframe) {
667
+ iframe = $tag('iframe')[0];
668
+
669
+ if (frameBorder in iframe) {
670
+ iframe[frameBorder] = 0;
671
+ }
672
+ if (allowTransparency in iframe) {
673
+ iframe[allowTransparency] = "true";
674
+ }
675
+ // give the iframe a unique name to prevent caching
676
+ iframe.name = prefix + (+new Date());
677
+ if (settings.fastIframe) {
678
+ complete();
679
+ } else {
680
+ $(iframe).one('load', complete);
681
+ }
682
+ iframe.src = settings.href;
683
+ if (!settings.scrolling) {
684
+ iframe.scrolling = "no";
685
+ }
686
+ $(iframe).addClass(prefix + 'Iframe').appendTo($loaded).one(event_purge, function () {
687
+ iframe.src = "//about:blank";
688
+ });
689
+ } else {
690
+ complete();
691
+ }
692
+
693
+ if (settings.transition === 'fade') {
694
+ $box.fadeTo(speed, 1, removeFilter);
695
+ } else {
696
+ removeFilter();
697
+ }
698
+ };
699
+
700
+ if (settings.transition === 'fade') {
701
+ $box.fadeTo(speed, 0, function () {
702
+ publicMethod.position(0, callback);
703
+ });
704
+ } else {
705
+ publicMethod.position(speed, callback);
706
+ }
707
+ };
708
+
709
+ publicMethod.load = function (launched) {
710
+ var href, setResize, prep = publicMethod.prep;
711
+
712
+ active = true;
713
+
714
+ photo = false;
715
+
716
+ element = $related[index];
717
+
718
+ if (!launched) {
719
+ makeSettings();
720
+ }
721
+
722
+ trigger(event_purge);
723
+
724
+ trigger(event_load, settings.onLoad);
725
+
726
+ settings.h = settings.height ?
727
+ setSize(settings.height, 'y') - loadedHeight - interfaceHeight :
728
+ settings.innerHeight && setSize(settings.innerHeight, 'y');
729
+
730
+ settings.w = settings.width ?
731
+ setSize(settings.width, 'x') - loadedWidth - interfaceWidth :
732
+ settings.innerWidth && setSize(settings.innerWidth, 'x');
733
+
734
+ // Sets the minimum dimensions for use in image scaling
735
+ settings.mw = settings.w;
736
+ settings.mh = settings.h;
737
+
738
+ // Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
739
+ // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
740
+ if (settings.maxWidth) {
741
+ settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth;
742
+ settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
743
+ }
744
+ if (settings.maxHeight) {
745
+ settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight;
746
+ settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
747
+ }
748
+
749
+ href = settings.href;
750
+
751
+ loadingTimer = setTimeout(function () {
752
+ $loadingOverlay.show();
753
+ }, 100);
754
+
755
+ if (settings.inline) {
756
+ // Inserts an empty placeholder where inline content is being pulled from.
757
+ // An event is bound to put inline content back when ColorBox closes or loads new content.
758
+ $tag(div).hide().insertBefore($(href)[0]).one(event_purge, function () {
759
+ $(this).replaceWith($loaded.children());
760
+ });
761
+ prep($(href));
762
+ } else if (settings.iframe) {
763
+ // IFrame element won't be added to the DOM until it is ready to be displayed,
764
+ // to avoid problems with DOM-ready JS that might be trying to run in that iframe.
765
+ prep(" ");
766
+ } else if (settings.html) {
767
+ prep(settings.html);
768
+ } else if (isImage(href)) {
769
+ $(photo = new Image())
770
+ .addClass(prefix + 'Photo')
771
+ .error(function () {
772
+ settings.title = false;
773
+ prep($tag(div, 'Error').text('This image could not be loaded'));
774
+ })
775
+ .load(function () {
776
+ var percent;
777
+ photo.onload = null; //stops animated gifs from firing the onload repeatedly.
778
+
779
+ if (settings.scalePhotos) {
780
+ setResize = function () {
781
+ photo.height -= photo.height * percent;
782
+ photo.width -= photo.width * percent;
783
+ };
784
+ if (settings.mw && photo.width > settings.mw) {
785
+ percent = (photo.width - settings.mw) / photo.width;
786
+ setResize();
787
+ }
788
+ if (settings.mh && photo.height > settings.mh) {
789
+ percent = (photo.height - settings.mh) / photo.height;
790
+ setResize();
791
+ }
792
+ }
793
+
794
+ if (settings.h) {
795
+ photo.style.marginTop = Math.max(settings.h - photo.height, 0) / 2 + 'px';
796
+ }
797
+
798
+ if ($related[1] && (settings.loop || $related[index + 1])) {
799
+ photo.style.cursor = 'pointer';
800
+ photo.onclick = function () {
801
+ publicMethod.next();
802
+ };
803
+ }
804
+
805
+ if (isIE) {
806
+ photo.style.msInterpolationMode = 'bicubic';
807
+ }
808
+
809
+ setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise.
810
+ prep(photo);
811
+ }, 1);
812
+ });
813
+
814
+ setTimeout(function () { // A pause because Opera 10.6+ will sometimes not run the onload function otherwise.
815
+ photo.src = href;
816
+ }, 1);
817
+ } else if (href) {
818
+ $loadingBay.load(href, settings.data, function (data, status, xhr) {
819
+ prep(status === 'error' ? $tag(div, 'Error').text('Request unsuccessful: ' + xhr.statusText) : $(this).contents());
820
+ });
821
+ }
822
+ };
823
+
824
+ // Navigates to the next page/image in a set.
825
+ publicMethod.next = function () {
826
+ if (!active && $related[1] && (settings.loop || $related[index + 1])) {
827
+ index = getIndex(1);
828
+ publicMethod.load();
829
+ }
830
+ };
831
+
832
+ publicMethod.prev = function () {
833
+ if (!active && $related[1] && (settings.loop || index)) {
834
+ index = getIndex(-1);
835
+ publicMethod.load();
836
+ }
837
+ };
838
+
839
+ // Note: to use this within an iframe use the following format: parent.$.fn.colorbox.close();
840
+ publicMethod.close = function () {
841
+ if (open && !closing) {
842
+
843
+ closing = true;
844
+
845
+ open = false;
846
+
847
+ trigger(event_cleanup, settings.onCleanup);
848
+
849
+ $window.unbind('.' + prefix + ' .' + event_ie6);
850
+
851
+ $overlay.fadeTo(200, 0);
852
+
853
+ $box.stop().fadeTo(300, 0, function () {
854
+
855
+ $box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();
856
+
857
+ trigger(event_purge);
858
+
859
+ $loaded.remove();
860
+
861
+ setTimeout(function () {
862
+ closing = false;
863
+ trigger(event_closed, settings.onClosed);
864
+ }, 1);
865
+ });
866
+ }
867
+ };
868
+
869
+ // Removes changes ColorBox made to the document, but does not remove the plugin
870
+ // from jQuery.
871
+ publicMethod.remove = function () {
872
+ $([]).add($box).add($overlay).remove();
873
+ $box = null;
874
+ $('.' + boxElement)
875
+ .removeData(colorbox)
876
+ .removeClass(boxElement)
877
+ .die();
878
+ };
879
+
880
+ // A method for fetching the current element ColorBox is referencing.
881
+ // returns a jQuery object.
882
+ publicMethod.element = function () {
883
+ return $(element);
884
+ };
885
+
886
+ publicMethod.settings = defaults;
887
+
888
+ }(jQuery, document, this));
skin/frontend/default/default/js/jquery.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jCarousel - Riding carousels with jQuery
3
+ * http://sorgalla.com/jcarousel/
4
+ *
5
+ * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
6
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
7
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
8
+ *
9
+ * Built on top of the jQuery library
10
+ * http://jquery.com
11
+ *
12
+ * Inspired by the "Carousel Component" by Bill Scott
13
+ * http://billwscott.com/carousel/
14
+ */
15
+
16
+ (function(g){var q={vertical:!1,rtl:!1,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,setupCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,animationStepCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click", buttonNextCallback:null,buttonPrevCallback:null,itemFallbackDimension:null},m=!1;g(window).bind("load.jcarousel",function(){m=!0});g.jcarousel=function(a,c){this.options=g.extend({},q,c||{});this.autoStopped=this.locked=!1;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!c||c.rtl===void 0)this.options.rtl=(g(a).attr("dir")||g("html").attr("dir")||"").toLowerCase()=="rtl";this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical? this.options.rtl?"right":"left":"top";for(var b="",d=a.className.split(" "),f=0;f<d.length;f++)if(d[f].indexOf("jcarousel-skin")!=-1){g(a).removeClass(d[f]);b=d[f];break}a.nodeName.toUpperCase()=="UL"||a.nodeName.toUpperCase()=="OL"?(this.list=g(a),this.clip=this.list.parents(".jcarousel-clip"),this.container=this.list.parents(".jcarousel-container")):(this.container=g(a),this.list=this.container.find("ul,ol").eq(0),this.clip=this.container.find(".jcarousel-clip"));if(this.clip.size()===0)this.clip= this.list.wrap("<div></div>").parent();if(this.container.size()===0)this.container=this.clip.wrap("<div></div>").parent();b!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1&&this.container.wrap('<div class=" '+b+'"></div>');this.buttonPrev=g(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null)this.buttonPrev=g(this.options.buttonPrevHTML).appendTo(this.container);this.buttonPrev.addClass(this.className("jcarousel-prev"));this.buttonNext= g(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null)this.buttonNext=g(this.options.buttonNextHTML).appendTo(this.container);this.buttonNext.addClass(this.className("jcarousel-next"));this.clip.addClass(this.className("jcarousel-clip")).css({position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden",position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"}); !this.options.vertical&&this.options.rtl&&this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl");var j=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null,b=this.list.children("li"),e=this;if(b.size()>0){var h=0,i=this.options.offset;b.each(function(){e.format(this,i++);h+=e.dimension(this,j)});this.list.css(this.wh,h+100+"px");if(!c||c.size===void 0)this.options.size=b.size()}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display", "block");this.funcNext=function(){e.next()};this.funcPrev=function(){e.prev()};this.funcResize=function(){e.resizeTimer&&clearTimeout(e.resizeTimer);e.resizeTimer=setTimeout(function(){e.reload()},100)};this.options.initCallback!==null&&this.options.initCallback(this,"init");!m&&g.browser.safari?(this.buttons(!1,!1),g(window).bind("load.jcarousel",function(){e.setup()})):this.setup()};var f=g.jcarousel;f.fn=f.prototype={jcarousel:"0.2.8"};f.fn.extend=f.extend=g.extend;f.fn.extend({setup:function(){this.prevLast= this.prevFirst=this.last=this.first=null;this.animating=!1;this.tail=this.resizeTimer=this.timer=null;this.inTail=!1;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var a=this.pos(this.options.start,!0);this.prevFirst=this.prevLast=null;this.animate(a,!1);g(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize);this.options.setupCallback!==null&&this.options.setupCallback(this)}},reset:function(){this.list.empty();this.list.css(this.lt, "0px");this.list.css(this.wh,"10px");this.options.initCallback!==null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!==null&&this.inTail&&this.list.css(this.lt,f.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=!1;this.options.reloadCallback!==null&&this.options.reloadCallback(this);if(this.options.visible!==null){var a=this,c=Math.ceil(this.clipping()/this.options.visible),b=0,d=0;this.list.children("li").each(function(f){b+=a.dimension(this, c);f+1<a.first&&(d=b)});this.list.css(this.wh,b+"px");this.list.css(this.lt,-d+"px")}this.scroll(this.first,!1)},lock:function(){this.locked=!0;this.buttons()},unlock:function(){this.locked=!1;this.buttons()},size:function(a){if(a!==void 0)this.options.size=a,this.locked||this.buttons();return this.options.size},has:function(a,c){if(c===void 0||!c)c=a;if(this.options.size!==null&&c>this.options.size)c=this.options.size;for(var b=a;b<=c;b++){var d=this.get(b);if(!d.length||d.hasClass("jcarousel-item-placeholder"))return!1}return!0}, get:function(a){return g(">.jcarousel-item-"+a,this.list)},add:function(a,c){var b=this.get(a),d=0,p=g(c);if(b.length===0)for(var j,e=f.intval(a),b=this.create(a);;){if(j=this.get(--e),e<=0||j.length){e<=0?this.list.prepend(b):j.after(b);break}}else d=this.dimension(b);p.get(0).nodeName.toUpperCase()=="LI"?(b.replaceWith(p),b=p):b.empty().append(c);this.format(b.removeClass(this.className("jcarousel-item-placeholder")),a);p=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible): null;d=this.dimension(b,p)-d;a>0&&a<this.first&&this.list.css(this.lt,f.intval(this.list.css(this.lt))-d+"px");this.list.css(this.wh,f.intval(this.list.css(this.wh))+d+"px");return b},remove:function(a){var c=this.get(a);if(c.length&&!(a>=this.first&&a<=this.last)){var b=this.dimension(c);a<this.first&&this.list.css(this.lt,f.intval(this.list.css(this.lt))+b+"px");c.remove();this.list.css(this.wh,f.intval(this.list.css(this.wh))-b+"px")}},next:function(){this.tail!==null&&!this.inTail?this.scrollTail(!1): this.scroll((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size?1:this.first+this.options.scroll)},prev:function(){this.tail!==null&&this.inTail?this.scrollTail(!0):this.scroll((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1?this.options.size:this.first-this.options.scroll)},scrollTail:function(a){if(!this.locked&&!this.animating&&this.tail){this.pauseAuto();var c=f.intval(this.list.css(this.lt)), c=!a?c-this.tail:c+this.tail;this.inTail=!a;this.prevFirst=this.first;this.prevLast=this.last;this.animate(c)}},scroll:function(a,c){!this.locked&&!this.animating&&(this.pauseAuto(),this.animate(this.pos(a),c))},pos:function(a,c){var b=f.intval(this.list.css(this.lt));if(this.locked||this.animating)return b;this.options.wrap!="circular"&&(a=a<1?1:this.options.size&&a>this.options.size?this.options.size:a);for(var d=this.first>a,g=this.options.wrap!="circular"&&this.first<=1?1:this.first,j=d?this.get(g): this.get(this.last),e=d?g:g-1,h=null,i=0,k=!1,l=0;d?--e>=a:++e<a;){h=this.get(e);k=!h.length;if(h.length===0&&(h=this.create(e).addClass(this.className("jcarousel-item-placeholder")),j[d?"before":"after"](h),this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)))j=this.get(this.index(e)),j.length&&(h=this.add(e,j.clone(!0)));j=h;l=this.dimension(h);k&&(i+=l);if(this.first!==null&&(this.options.wrap=="circular"||e>=1&&(this.options.size===null||e<= this.options.size)))b=d?b+l:b-l}for(var g=this.clipping(),m=[],o=0,n=0,j=this.get(a-1),e=a;++o;){h=this.get(e);k=!h.length;if(h.length===0){h=this.create(e).addClass(this.className("jcarousel-item-placeholder"));if(j.length===0)this.list.prepend(h);else j[d?"before":"after"](h);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size))j=this.get(this.index(e)),j.length&&(h=this.add(e,j.clone(!0)))}j=h;l=this.dimension(h);if(l===0)throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting..."); this.options.wrap!="circular"&&this.options.size!==null&&e>this.options.size?m.push(h):k&&(i+=l);n+=l;if(n>=g)break;e++}for(h=0;h<m.length;h++)m[h].remove();i>0&&(this.list.css(this.wh,this.dimension(this.list)+i+"px"),d&&(b-=i,this.list.css(this.lt,f.intval(this.list.css(this.lt))-i+"px")));i=a+o-1;if(this.options.wrap!="circular"&&this.options.size&&i>this.options.size)i=this.options.size;if(e>i){o=0;e=i;for(n=0;++o;){h=this.get(e--);if(!h.length)break;n+=this.dimension(h);if(n>=g)break}}e=i-o+ 1;this.options.wrap!="circular"&&e<1&&(e=1);if(this.inTail&&d)b+=this.tail,this.inTail=!1;this.tail=null;if(this.options.wrap!="circular"&&i==this.options.size&&i-o+1>=1&&(d=f.intval(this.get(i).css(!this.options.vertical?"marginRight":"marginBottom")),n-d>g))this.tail=n-g-d;if(c&&a===this.options.size&&this.tail)b-=this.tail,this.inTail=!0;for(;a-- >e;)b+=this.dimension(this.get(a));this.prevFirst=this.first;this.prevLast=this.last;this.first=e;this.last=i;return b},animate:function(a,c){if(!this.locked&& !this.animating){this.animating=!0;var b=this,d=function(){b.animating=!1;a===0&&b.list.css(b.lt,0);!b.autoStopped&&(b.options.wrap=="circular"||b.options.wrap=="both"||b.options.wrap=="last"||b.options.size===null||b.last<b.options.size||b.last==b.options.size&&b.tail!==null&&!b.inTail)&&b.startAuto();b.buttons();b.notify("onAfterAnimation");if(b.options.wrap=="circular"&&b.options.size!==null)for(var c=b.prevFirst;c<=b.prevLast;c++)c!==null&&!(c>=b.first&&c<=b.last)&&(c<1||c>b.options.size)&&b.remove(c)}; this.notify("onBeforeAnimation");if(!this.options.animation||c===!1)this.list.css(this.lt,a+"px"),d();else{var f=!this.options.vertical?this.options.rtl?{right:a}:{left:a}:{top:a},d={duration:this.options.animation,easing:this.options.easing,complete:d};if(g.isFunction(this.options.animationStepCallback))d.step=this.options.animationStepCallback;this.list.animate(f,d)}}},startAuto:function(a){if(a!==void 0)this.options.auto=a;if(this.options.auto===0)return this.stopAuto();if(this.timer===null){this.autoStopped= !1;var c=this;this.timer=window.setTimeout(function(){c.next()},this.options.auto*1E3)}},stopAuto:function(){this.pauseAuto();this.autoStopped=!0},pauseAuto:function(){if(this.timer!==null)window.clearTimeout(this.timer),this.timer=null},buttons:function(a,c){if(a==null&&(a=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size===null||this.last<this.options.size),!this.locked&&(!this.options.wrap||this.options.wrap=="first")&&this.options.size!==null&& this.last>=this.options.size))a=this.tail!==null&&!this.inTail;if(c==null&&(c=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1),!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1))c=this.tail!==null&&this.inTail;var b=this;this.buttonNext.size()>0?(this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext),a&&this.buttonNext.bind(this.options.buttonNextEvent+".jcarousel",this.funcNext), this.buttonNext[a?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",a?!1:!0),this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=a&&this.buttonNext.each(function(){b.options.buttonNextCallback(b,this,a)}).data("jcarouselstate",a)):this.options.buttonNextCallback!==null&&this.buttonNextState!=a&&this.options.buttonNextCallback(b,null,a);this.buttonPrev.size()>0?(this.buttonPrev.unbind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev), c&&this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev),this.buttonPrev[c?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",c?!1:!0),this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=c&&this.buttonPrev.each(function(){b.options.buttonPrevCallback(b,this,c)}).data("jcarouselstate",c)):this.options.buttonPrevCallback!==null&&this.buttonPrevState!=c&&this.options.buttonPrevCallback(b,null,c);this.buttonNextState= a;this.buttonPrevState=c},notify:function(a){var c=this.prevFirst===null?"init":this.prevFirst<this.first?"next":"prev";this.callback("itemLoadCallback",a,c);this.prevFirst!==this.first&&(this.callback("itemFirstInCallback",a,c,this.first),this.callback("itemFirstOutCallback",a,c,this.prevFirst));this.prevLast!==this.last&&(this.callback("itemLastInCallback",a,c,this.last),this.callback("itemLastOutCallback",a,c,this.prevLast));this.callback("itemVisibleInCallback",a,c,this.first,this.last,this.prevFirst, this.prevLast);this.callback("itemVisibleOutCallback",a,c,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(a,c,b,d,f,j,e){if(!(this.options[a]==null||typeof this.options[a]!="object"&&c!="onAfterAnimation")){var h=typeof this.options[a]=="object"?this.options[a][c]:this.options[a];if(g.isFunction(h)){var i=this;if(d===void 0)h(i,b,c);else if(f===void 0)this.get(d).each(function(){h(i,this,d,b,c)});else for(var a=function(a){i.get(a).each(function(){h(i,this,a,b,c)})},k=d;k<=f;k++)k!== null&&!(k>=j&&k<=e)&&a(k)}}},create:function(a){return this.format("<li></li>",a)},format:function(a,c){for(var a=g(a),b=a.get(0).className.split(" "),d=0;d<b.length;d++)b[d].indexOf("jcarousel-")!=-1&&a.removeClass(b[d]);a.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+c)).css({"float":this.options.rtl?"right":"left","list-style":"none"}).attr("jcarouselindex",c);return a},className:function(a){return a+" "+a+(!this.options.vertical?"-horizontal":"-vertical")}, dimension:function(a,c){var b=g(a);if(c==null)return!this.options.vertical?b.outerWidth(!0)||f.intval(this.options.itemFallbackDimension):b.outerHeight(!0)||f.intval(this.options.itemFallbackDimension);else{var d=!this.options.vertical?c-f.intval(b.css("marginLeft"))-f.intval(b.css("marginRight")):c-f.intval(b.css("marginTop"))-f.intval(b.css("marginBottom"));g(b).css(this.wh,d+"px");return this.dimension(b)}},clipping:function(){return!this.options.vertical?this.clip[0].offsetWidth-f.intval(this.clip.css("borderLeftWidth"))- f.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-f.intval(this.clip.css("borderTopWidth"))-f.intval(this.clip.css("borderBottomWidth"))},index:function(a,c){if(c==null)c=this.options.size;return Math.round(((a-1)/c-Math.floor((a-1)/c))*c)+1}});f.extend({defaults:function(a){return g.extend(q,a||{})},intval:function(a){a=parseInt(a,10);return isNaN(a)?0:a},windowLoaded:function(){m=!0}});g.fn.jcarousel=function(a){if(typeof a=="string"){var c=g(this).data("jcarousel"),b=Array.prototype.slice.call(arguments, 1);return c[a].apply(c,b)}else return this.each(function(){var b=g(this).data("jcarousel");b?(a&&g.extend(b.options,a),b.reload()):g(this).data("jcarousel",new f(this,a))})}})(jQuery);