Price_Countdown - Version 1.0

Version Notes

Countdown timer for Special product price to date. Timer displays according to the special price and to date set while adding products.

Download this release

Release Info

Developer Magento Core Team
Extension Price_Countdown
Version 1.0
Comparing to
See all releases


Version 1.0

Files changed (48) hide show
  1. app/code/local/Apptha/Timer/Block/Adminhtml/Timer.php +29 -0
  2. app/code/local/Apptha/Timer/Block/Adminhtml/Timer/Edit.php +61 -0
  3. app/code/local/Apptha/Timer/Block/Adminhtml/Timer/Edit/Form.php +35 -0
  4. app/code/local/Apptha/Timer/Block/Adminhtml/Timer/Edit/Tab/Form.php +74 -0
  5. app/code/local/Apptha/Timer/Block/Adminhtml/Timer/Edit/Tabs.php +40 -0
  6. app/code/local/Apptha/Timer/Block/Adminhtml/Timer/Grid.php +124 -0
  7. app/code/local/Apptha/Timer/Block/Compare.php +12 -0
  8. app/code/local/Apptha/Timer/Block/List.php +34 -0
  9. app/code/local/Apptha/Timer/Block/View.php +29 -0
  10. app/code/local/Apptha/Timer/Helper/Data.php +22 -0
  11. app/code/local/Apptha/Timer/Model/Mysql4/Timer.php +26 -0
  12. app/code/local/Apptha/Timer/Model/Mysql4/Timer/Collection.php +26 -0
  13. app/code/local/Apptha/Timer/Model/Status.php +31 -0
  14. app/code/local/Apptha/Timer/Model/Timer.php +26 -0
  15. app/code/local/Apptha/Timer/controllers/Adminhtml/TimerController.php +230 -0
  16. app/code/local/Apptha/Timer/controllers/IndexController.php +26 -0
  17. app/code/local/Apptha/Timer/etc/adminhtml.xml +23 -0
  18. app/code/local/Apptha/Timer/etc/config.xml +120 -0
  19. app/code/local/Apptha/Timer/etc/system.xml +114 -0
  20. app/code/local/Apptha/Timer/sql/timer_setup/mysql4-install-0.1.0.php +39 -0
  21. app/code/local/Mage/Adminhtml/Model/System/Config/Source/Caption.php +37 -0
  22. app/code/local/Mage/Adminhtml/Model/System/Config/Source/Heading.php +38 -0
  23. app/design/adminhtml/default/default/layout/timer.xml +14 -0
  24. app/design/frontend/default/default/layout/timer.xml +36 -0
  25. app/design/frontend/default/default/template/facebooklb/head.phtml +9 -0
  26. app/design/frontend/default/default/template/facebooklb/like.phtml +43 -0
  27. app/design/frontend/default/default/template/gr/deepzoom/product/view/media.phtml +68 -0
  28. app/design/frontend/default/default/template/gr/deepzoom/product/widget/gallery.phtml +49 -0
  29. app/design/frontend/default/default/template/gr/deepzoom/product/widget/image.phtml +49 -0
  30. app/design/frontend/default/default/template/smoovpay/blank.phtml +27 -0
  31. app/design/frontend/default/default/template/smoovpay/cancel.phtml +28 -0
  32. app/design/frontend/default/default/template/smoovpay/failure.phtml +28 -0
  33. app/design/frontend/default/default/template/smoovpay/form.phtml +29 -0
  34. app/design/frontend/default/default/template/smoovpay/info.phtml +28 -0
  35. app/design/frontend/default/default/template/smoovpay/redirect.phtml +34 -0
  36. app/design/frontend/default/default/template/timer/list.phtml +206 -0
  37. app/design/frontend/default/default/template/timer/view.phtml +84 -0
  38. app/etc/modules/Apptha_Timer.xml +9 -0
  39. js/jscolor/Thumbs.db +0 -0
  40. js/jscolor/arrow.gif +0 -0
  41. js/jscolor/cross.gif +0 -0
  42. js/jscolor/demo.html +12 -0
  43. js/jscolor/hs.png +0 -0
  44. js/jscolor/hv.png +0 -0
  45. js/jscolor/jscolor.js +863 -0
  46. js/timer.js +57 -0
  47. package.xml +18 -0
  48. skin/frontend/default/default/timer/timer.css +31 -0
app/code/local/Apptha/Timer/Block/Adminhtml/Timer.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Block_Adminhtml_Timer extends Mage_Adminhtml_Block_Widget_Grid_Container
20
+ {
21
+ public function __construct()
22
+ {
23
+ $this->_controller = 'adminhtml_timer';
24
+ $this->_blockGroup = 'timer';
25
+ $this->_headerText = Mage::helper('timer')->__('Item Manager');
26
+ $this->_addButtonLabel = Mage::helper('timer')->__('Add Item');
27
+ parent::__construct();
28
+ }
29
+ }
app/code/local/Apptha/Timer/Block/Adminhtml/Timer/Edit.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Block_Adminhtml_Timer_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
20
+ {
21
+ public function __construct()
22
+ {
23
+ parent::__construct();
24
+
25
+ $this->_objectId = 'id';
26
+ $this->_blockGroup = 'timer';
27
+ $this->_controller = 'adminhtml_timer';
28
+
29
+ $this->_updateButton('save', 'label', Mage::helper('timer')->__('Save Item'));
30
+ $this->_updateButton('delete', 'label', Mage::helper('timer')->__('Delete Item'));
31
+
32
+ $this->_addButton('saveandcontinue', array(
33
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
34
+ 'onclick' => 'saveAndContinueEdit()',
35
+ 'class' => 'save',
36
+ ), -100);
37
+
38
+ $this->_formScripts[] = "
39
+ function toggleEditor() {
40
+ if (tinyMCE.getInstanceById('timer_content') == null) {
41
+ tinyMCE.execCommand('mceAddControl', false, 'timer_content');
42
+ } else {
43
+ tinyMCE.execCommand('mceRemoveControl', false, 'timer_content');
44
+ }
45
+ }
46
+
47
+ function saveAndContinueEdit(){
48
+ editForm.submit($('edit_form').action+'back/edit/');
49
+ }
50
+ ";
51
+ }
52
+
53
+ public function getHeaderText()
54
+ {
55
+ if( Mage::registry('timer_data') && Mage::registry('timer_data')->getId() ) {
56
+ return Mage::helper('timer')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('timer_data')->getTitle()));
57
+ } else {
58
+ return Mage::helper('timer')->__('Add Item');
59
+ }
60
+ }
61
+ }
app/code/local/Apptha/Timer/Block/Adminhtml/Timer/Edit/Form.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Block_Adminhtml_Timer_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
20
+ {
21
+ protected function _prepareForm()
22
+ {
23
+ $form = new Varien_Data_Form(array(
24
+ 'id' => 'edit_form',
25
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
26
+ 'method' => 'post',
27
+ 'enctype' => 'multipart/form-data'
28
+ )
29
+ );
30
+
31
+ $form->setUseContainer(true);
32
+ $this->setForm($form);
33
+ return parent::_prepareForm();
34
+ }
35
+ }
app/code/local/Apptha/Timer/Block/Adminhtml/Timer/Edit/Tab/Form.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Block_Adminhtml_Timer_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
20
+ {
21
+ protected function _prepareForm()
22
+ {
23
+ $form = new Varien_Data_Form();
24
+ $this->setForm($form);
25
+ $fieldset = $form->addFieldset('timer_form', array('legend'=>Mage::helper('timer')->__('Item information')));
26
+
27
+ $fieldset->addField('title', 'text', array(
28
+ 'label' => Mage::helper('timer')->__('Title'),
29
+ 'class' => 'required-entry',
30
+ 'required' => true,
31
+ 'name' => 'title',
32
+ ));
33
+
34
+ $fieldset->addField('filename', 'file', array(
35
+ 'label' => Mage::helper('timer')->__('File'),
36
+ 'required' => false,
37
+ 'name' => 'filename',
38
+ ));
39
+
40
+ $fieldset->addField('status', 'select', array(
41
+ 'label' => Mage::helper('timer')->__('Status'),
42
+ 'name' => 'status',
43
+ 'values' => array(
44
+ array(
45
+ 'value' => 1,
46
+ 'label' => Mage::helper('timer')->__('Enabled'),
47
+ ),
48
+
49
+ array(
50
+ 'value' => 2,
51
+ 'label' => Mage::helper('timer')->__('Disabled'),
52
+ ),
53
+ ),
54
+ ));
55
+
56
+ $fieldset->addField('content', 'editor', array(
57
+ 'name' => 'content',
58
+ 'label' => Mage::helper('timer')->__('Content'),
59
+ 'title' => Mage::helper('timer')->__('Content'),
60
+ 'style' => 'width:700px; height:500px;',
61
+ 'wysiwyg' => false,
62
+ 'required' => true,
63
+ ));
64
+
65
+ if ( Mage::getSingleton('adminhtml/session')->getTimerData() )
66
+ {
67
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getTimerData());
68
+ Mage::getSingleton('adminhtml/session')->setTimerData(null);
69
+ } elseif ( Mage::registry('timer_data') ) {
70
+ $form->setValues(Mage::registry('timer_data')->getData());
71
+ }
72
+ return parent::_prepareForm();
73
+ }
74
+ }
app/code/local/Apptha/Timer/Block/Adminhtml/Timer/Edit/Tabs.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Block_Adminhtml_Timer_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
20
+ {
21
+
22
+ public function __construct()
23
+ {
24
+ parent::__construct();
25
+ $this->setId('timer_tabs');
26
+ $this->setDestElementId('edit_form');
27
+ $this->setTitle(Mage::helper('timer')->__('Item Information'));
28
+ }
29
+
30
+ protected function _beforeToHtml()
31
+ {
32
+ $this->addTab('form_section', array(
33
+ 'label' => Mage::helper('timer')->__('Item Information'),
34
+ 'title' => Mage::helper('timer')->__('Item Information'),
35
+ 'content' => $this->getLayout()->createBlock('timer/adminhtml_timer_edit_tab_form')->toHtml(),
36
+ ));
37
+
38
+ return parent::_beforeToHtml();
39
+ }
40
+ }
app/code/local/Apptha/Timer/Block/Adminhtml/Timer/Grid.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Block_Adminhtml_Timer_Grid extends Mage_Adminhtml_Block_Widget_Grid
20
+ {
21
+ public function __construct()
22
+ {
23
+ parent::__construct();
24
+ $this->setId('timerGrid');
25
+ $this->setDefaultSort('timer_id');
26
+ $this->setDefaultDir('ASC');
27
+ $this->setSaveParametersInSession(true);
28
+ }
29
+
30
+ protected function _prepareCollection()
31
+ {
32
+ $collection = Mage::getModel('timer/timer')->getCollection();
33
+ $this->setCollection($collection);
34
+ return parent::_prepareCollection();
35
+ }
36
+
37
+ protected function _prepareColumns()
38
+ {
39
+ $this->addColumn('timer_id', array(
40
+ 'header' => Mage::helper('timer')->__('ID'),
41
+ 'align' =>'right',
42
+ 'width' => '50px',
43
+ 'index' => 'timer_id',
44
+ ));
45
+
46
+ $this->addColumn('title', array(
47
+ 'header' => Mage::helper('timer')->__('Title'),
48
+ 'align' =>'left',
49
+ 'index' => 'title',
50
+ ));
51
+
52
+ $this->addColumn('status', array(
53
+ 'header' => Mage::helper('timer')->__('Status'),
54
+ 'align' => 'left',
55
+ 'width' => '80px',
56
+ 'index' => 'status',
57
+ 'type' => 'options',
58
+ 'options' => array(
59
+ 1 => 'Enabled',
60
+ 2 => 'Disabled',
61
+ ),
62
+ ));
63
+
64
+ $this->addColumn('action',
65
+ array(
66
+ 'header' => Mage::helper('timer')->__('Action'),
67
+ 'width' => '100',
68
+ 'type' => 'action',
69
+ 'getter' => 'getId',
70
+ 'actions' => array(
71
+ array(
72
+ 'caption' => Mage::helper('timer')->__('Edit'),
73
+ 'url' => array('base'=> '*/*/edit'),
74
+ 'field' => 'id'
75
+ )
76
+ ),
77
+ 'filter' => false,
78
+ 'sortable' => false,
79
+ 'index' => 'stores',
80
+ 'is_system' => true,
81
+ ));
82
+
83
+ $this->addExportType('*/*/exportCsv', Mage::helper('timer')->__('CSV'));
84
+ $this->addExportType('*/*/exportXml', Mage::helper('timer')->__('XML'));
85
+
86
+ return parent::_prepareColumns();
87
+ }
88
+
89
+ protected function _prepareMassaction()
90
+ {
91
+ $this->setMassactionIdField('timer_id');
92
+ $this->getMassactionBlock()->setFormFieldName('timer');
93
+
94
+ $this->getMassactionBlock()->addItem('delete', array(
95
+ 'label' => Mage::helper('timer')->__('Delete'),
96
+ 'url' => $this->getUrl('*/*/massDelete'),
97
+ 'confirm' => Mage::helper('timer')->__('Are you sure?')
98
+ ));
99
+
100
+ $statuses = Mage::getSingleton('timer/status')->getOptionArray();
101
+
102
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
103
+ $this->getMassactionBlock()->addItem('status', array(
104
+ 'label'=> Mage::helper('timer')->__('Change status'),
105
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
106
+ 'additional' => array(
107
+ 'visibility' => array(
108
+ 'name' => 'status',
109
+ 'type' => 'select',
110
+ 'class' => 'required-entry',
111
+ 'label' => Mage::helper('timer')->__('Status'),
112
+ 'values' => $statuses
113
+ )
114
+ )
115
+ ));
116
+ return $this;
117
+ }
118
+
119
+ public function getRowUrl($row)
120
+ {
121
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
122
+ }
123
+
124
+ }
app/code/local/Apptha/Timer/Block/Compare.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Apptha_Timer_Block_Compare extends Mage_Catalog_Block_Product_Compare_List
3
+ {
4
+ protected function _prepareLayout()
5
+ {
6
+ $block = $this->getLayout()->getBlock('catalog.compare.list');
7
+ if ($block) {
8
+ $block->setTemplate('timer/compare.phtml');
9
+ }
10
+ }
11
+ }
12
+ ?>
app/code/local/Apptha/Timer/Block/List.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Block_List extends Mage_Catalog_Block_Product_List
20
+ {
21
+ protected function _prepareLayout()
22
+ {
23
+ $block = $this->getLayout()->getBlock('product_list');
24
+ if ($block) {
25
+ $block->setTemplate('timer/list.phtml');
26
+ }
27
+
28
+ $block = $this->getLayout()->getBlock('search_result_list');
29
+ if ($block) {
30
+ $block->setTemplate('timer/list.phtml');
31
+ }
32
+ }
33
+ }
34
+ ?>
app/code/local/Apptha/Timer/Block/View.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Block_View extends Mage_Catalog_Block_Product_View
20
+ {
21
+ protected function _prepareLayout()
22
+ {
23
+ $block = $this->getLayout()->getBlock('product.info.addto');
24
+ if ($block) {
25
+ $block->setTemplate('timer/view.phtml');
26
+ }
27
+ }
28
+ }
29
+ ?>
app/code/local/Apptha/Timer/Helper/Data.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Helper_Data extends Mage_Core_Helper_Abstract
20
+ {
21
+
22
+ }
app/code/local/Apptha/Timer/Model/Mysql4/Timer.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Model_Mysql4_Timer extends Mage_Core_Model_Mysql4_Abstract
20
+ {
21
+ public function _construct()
22
+ {
23
+ // Note that the timer_id refers to the key field in your database table.
24
+ $this->_init('timer/timer', 'timer_id');
25
+ }
26
+ }
app/code/local/Apptha/Timer/Model/Mysql4/Timer/Collection.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Model_Mysql4_Timer_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
20
+ {
21
+ public function _construct()
22
+ {
23
+ parent::_construct();
24
+ $this->_init('timer/timer');
25
+ }
26
+ }
app/code/local/Apptha/Timer/Model/Status.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Model_Status extends Varien_Object
20
+ {
21
+ const STATUS_ENABLED = 1;
22
+ const STATUS_DISABLED = 2;
23
+
24
+ static public function getOptionArray()
25
+ {
26
+ return array(
27
+ self::STATUS_ENABLED => Mage::helper('timer')->__('Enabled'),
28
+ self::STATUS_DISABLED => Mage::helper('timer')->__('Disabled')
29
+ );
30
+ }
31
+ }
app/code/local/Apptha/Timer/Model/Timer.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Model_Timer extends Mage_Core_Model_Abstract
20
+ {
21
+ public function _construct()
22
+ {
23
+ parent::_construct();
24
+ $this->_init('timer/timer');
25
+ }
26
+ }
app/code/local/Apptha/Timer/controllers/Adminhtml/TimerController.php ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_Adminhtml_TimerController extends Mage_Adminhtml_Controller_action
20
+ {
21
+
22
+ protected function _initAction() {
23
+ $this->loadLayout()
24
+ ->_setActiveMenu('timer/items')
25
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
26
+
27
+ return $this;
28
+ }
29
+
30
+ public function indexAction() {
31
+ $this->_initAction()
32
+ ->renderLayout();
33
+ }
34
+
35
+ public function editAction() {
36
+ $id = $this->getRequest()->getParam('id');
37
+ $model = Mage::getModel('timer/timer')->load($id);
38
+
39
+ if ($model->getId() || $id == 0) {
40
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
41
+ if (!empty($data)) {
42
+ $model->setData($data);
43
+ }
44
+
45
+ Mage::register('timer_data', $model);
46
+
47
+ $this->loadLayout();
48
+ $this->_setActiveMenu('timer/items');
49
+
50
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
51
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
52
+
53
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
54
+
55
+ $this->_addContent($this->getLayout()->createBlock('timer/adminhtml_timer_edit'))
56
+ ->_addLeft($this->getLayout()->createBlock('timer/adminhtml_timer_edit_tabs'));
57
+
58
+ $this->renderLayout();
59
+ } else {
60
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('timer')->__('Item does not exist'));
61
+ $this->_redirect('*/*/');
62
+ }
63
+ }
64
+
65
+ public function newAction() {
66
+ $this->_forward('edit');
67
+ }
68
+
69
+ public function saveAction() {
70
+ if ($data = $this->getRequest()->getPost()) {
71
+
72
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
73
+ try {
74
+ /* Starting upload */
75
+ $uploader = new Varien_File_Uploader('filename');
76
+
77
+ // Any extention would work
78
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
79
+ $uploader->setAllowRenameFiles(false);
80
+
81
+ // Set the file upload mode
82
+ // false -> get the file directly in the specified folder
83
+ // true -> get the file in the product like folders
84
+ // (file.jpg will go in something like /media/f/i/file.jpg)
85
+ $uploader->setFilesDispersion(false);
86
+
87
+ // We set media as the upload dir
88
+ $path = Mage::getBaseDir('media') . DS ;
89
+ $uploader->save($path, $_FILES['filename']['name'] );
90
+
91
+ } catch (Exception $e) {
92
+
93
+ }
94
+
95
+ //this way the name is saved in DB
96
+ $data['filename'] = $_FILES['filename']['name'];
97
+ }
98
+
99
+
100
+ $model = Mage::getModel('timer/timer');
101
+ $model->setData($data)
102
+ ->setId($this->getRequest()->getParam('id'));
103
+
104
+ try {
105
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
106
+ $model->setCreatedTime(now())
107
+ ->setUpdateTime(now());
108
+ } else {
109
+ $model->setUpdateTime(now());
110
+ }
111
+
112
+ $model->save();
113
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('timer')->__('Item was successfully saved'));
114
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
115
+
116
+ if ($this->getRequest()->getParam('back')) {
117
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
118
+ return;
119
+ }
120
+ $this->_redirect('*/*/');
121
+ return;
122
+ } catch (Exception $e) {
123
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
124
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
125
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
126
+ return;
127
+ }
128
+ }
129
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('timer')->__('Unable to find item to save'));
130
+ $this->_redirect('*/*/');
131
+ }
132
+
133
+ public function deleteAction() {
134
+ if( $this->getRequest()->getParam('id') > 0 ) {
135
+ try {
136
+ $model = Mage::getModel('timer/timer');
137
+
138
+ $model->setId($this->getRequest()->getParam('id'))
139
+ ->delete();
140
+
141
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
142
+ $this->_redirect('*/*/');
143
+ } catch (Exception $e) {
144
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
145
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
146
+ }
147
+ }
148
+ $this->_redirect('*/*/');
149
+ }
150
+
151
+ public function massDeleteAction() {
152
+ $timerIds = $this->getRequest()->getParam('timer');
153
+ if(!is_array($timerIds)) {
154
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
155
+ } else {
156
+ try {
157
+ foreach ($timerIds as $timerId) {
158
+ $timer = Mage::getModel('timer/timer')->load($timerId);
159
+ $timer->delete();
160
+ }
161
+ Mage::getSingleton('adminhtml/session')->addSuccess(
162
+ Mage::helper('adminhtml')->__(
163
+ 'Total of %d record(s) were successfully deleted', count($timerIds)
164
+ )
165
+ );
166
+ } catch (Exception $e) {
167
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
168
+ }
169
+ }
170
+ $this->_redirect('*/*/index');
171
+ }
172
+
173
+ public function massStatusAction()
174
+ {
175
+ $timerIds = $this->getRequest()->getParam('timer');
176
+ if(!is_array($timerIds)) {
177
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
178
+ } else {
179
+ try {
180
+ foreach ($timerIds as $timerId) {
181
+ $timer = Mage::getSingleton('timer/timer')
182
+ ->load($timerId)
183
+ ->setStatus($this->getRequest()->getParam('status'))
184
+ ->setIsMassupdate(true)
185
+ ->save();
186
+ }
187
+ $this->_getSession()->addSuccess(
188
+ $this->__('Total of %d record(s) were successfully updated', count($timerIds))
189
+ );
190
+ } catch (Exception $e) {
191
+ $this->_getSession()->addError($e->getMessage());
192
+ }
193
+ }
194
+ $this->_redirect('*/*/index');
195
+ }
196
+
197
+ public function exportCsvAction()
198
+ {
199
+ $fileName = 'timer.csv';
200
+ $content = $this->getLayout()->createBlock('timer/adminhtml_timer_grid')
201
+ ->getCsv();
202
+
203
+ $this->_sendUploadResponse($fileName, $content);
204
+ }
205
+
206
+ public function exportXmlAction()
207
+ {
208
+ $fileName = 'timer.xml';
209
+ $content = $this->getLayout()->createBlock('timer/adminhtml_timer_grid')
210
+ ->getXml();
211
+
212
+ $this->_sendUploadResponse($fileName, $content);
213
+ }
214
+
215
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
216
+ {
217
+ $response = $this->getResponse();
218
+ $response->setHeader('HTTP/1.1 200 OK','');
219
+ $response->setHeader('Pragma', 'public', true);
220
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
221
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
222
+ $response->setHeader('Last-Modified', date('r'));
223
+ $response->setHeader('Accept-Ranges', 'bytes');
224
+ $response->setHeader('Content-Length', strlen($content));
225
+ $response->setHeader('Content-type', $contentType);
226
+ $response->setBody($content);
227
+ $response->sendResponse();
228
+ die;
229
+ }
230
+ }
app/code/local/Apptha/Timer/controllers/IndexController.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Apptha_Timer_IndexController extends Mage_Core_Controller_Front_Action
20
+ {
21
+ public function indexAction()
22
+ {
23
+ $this->loadLayout();
24
+ $this->renderLayout();
25
+ }
26
+ }
app/code/local/Apptha/Timer/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" ?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <timer translate="title" module="timer">
12
+ <title>Product Timer</title>
13
+ <sort_order>100</sort_order>
14
+ </timer>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/local/Apptha/Timer/etc/config.xml ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Apptha_Timer>
5
+ <version>0.1.0</version>
6
+ </Apptha_Timer>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <timer>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Apptha_Timer</module>
14
+ <frontName>timer</frontName>
15
+ </args>
16
+ </timer>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <timer>
21
+ <file>timer.xml</file>
22
+ </timer>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <timer>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Apptha_Timer</module>
32
+ <frontName>timer</frontName>
33
+ </args>
34
+ </timer>
35
+ </routers>
36
+ </admin>
37
+ <adminhtml>
38
+ <!-- <menu>
39
+ <timer module="timer">
40
+ <title>Timer</title>
41
+ <sort_order>71</sort_order>
42
+ <children>
43
+ <items module="timer">
44
+ <title>Manage Items</title>
45
+ <sort_order>0</sort_order>
46
+ <action>timer/adminhtml_timer</action>
47
+ </items>
48
+ </children>
49
+ </timer>
50
+ </menu> -->
51
+ <acl>
52
+ <resources>
53
+ <all>
54
+ <title>Allow Everything</title>
55
+ </all>
56
+ <admin>
57
+ <children>
58
+ <Apptha_Timer>
59
+ <title>Timer Module</title>
60
+ <sort_order>10</sort_order>
61
+ </Apptha_Timer>
62
+ </children>
63
+ </admin>
64
+ </resources>
65
+ </acl>
66
+ <layout>
67
+ <updates>
68
+ <timer>
69
+ <file>timer.xml</file>
70
+ </timer>
71
+ </updates>
72
+ </layout>
73
+ </adminhtml>
74
+ <global>
75
+ <models>
76
+ <timer>
77
+ <class>Apptha_Timer_Model</class>
78
+ <resourceModel>timer_mysql4</resourceModel>
79
+ </timer>
80
+ <timer_mysql4>
81
+ <class>Apptha_Timer_Model_Mysql4</class>
82
+ <entities>
83
+ <timer>
84
+ <table>timer</table>
85
+ </timer>
86
+ </entities>
87
+ </timer_mysql4>
88
+ </models>
89
+ <resources>
90
+ <timer_setup>
91
+ <setup>
92
+ <module>Apptha_Timer</module>
93
+ </setup>
94
+ <connection>
95
+ <use>core_setup</use>
96
+ </connection>
97
+ </timer_setup>
98
+ <timer_write>
99
+ <connection>
100
+ <use>core_write</use>
101
+ </connection>
102
+ </timer_write>
103
+ <timer_read>
104
+ <connection>
105
+ <use>core_read</use>
106
+ </connection>
107
+ </timer_read>
108
+ </resources>
109
+ <blocks>
110
+ <timer>
111
+ <class>Apptha_Timer_Block</class>
112
+ </timer>
113
+ </blocks>
114
+ <helpers>
115
+ <timer>
116
+ <class>Apptha_Timer_Helper</class>
117
+ </timer>
118
+ </helpers>
119
+ </global>
120
+ </config>
app/code/local/Apptha/Timer/etc/system.xml ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <Apptha translate="label" module="timer">
5
+ <label>Apptha</label>
6
+ <sort_order>300</sort_order>
7
+ </Apptha>
8
+ </tabs>
9
+ <sections>
10
+ <timer translate="label" module="timer">
11
+ <tab>Apptha</tab>
12
+ <label>Price Countdown</label>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>120</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <general translate="label" module="timer">
20
+ <label>General</label>
21
+ <frontend_type>text</frontend_type>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <fields>
26
+ <activate_apptha_timer translate="label">
27
+ <label>Activate Price Countdown:</label>
28
+ <frontend_type>select</frontend_type>
29
+ <source_model>adminhtml/system_config_source_yesno</source_model>
30
+ <sort_order>0</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>1</show_in_store>
34
+ <comment>Activate Product Timer</comment>
35
+ </activate_apptha_timer>
36
+
37
+ <activate_apptha_heading translate="label">
38
+ <label>Timer Heading:</label>
39
+ <frontend_type>select</frontend_type>
40
+ <source_model>adminhtml/system_config_source_Heading</source_model>
41
+ <sort_order>1</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ <comment>Timer Heading</comment>
46
+ </activate_apptha_heading>
47
+
48
+ <activate_apptha_description translate="label">
49
+ <label>Timer Caption:</label>
50
+ <frontend_type>select</frontend_type>
51
+ <source_model>adminhtml/system_config_source_Caption</source_model>
52
+ <sort_order>2</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>1</show_in_store>
56
+ <comment>Timer Caption</comment>
57
+ </activate_apptha_description>
58
+
59
+ <heading translate="label">
60
+ <label>Timer Title:</label>
61
+ <frontend_type>text</frontend_type>
62
+ <sort_order>3</sort_order>
63
+ <show_in_default>1</show_in_default>
64
+ <show_in_website>1</show_in_website>
65
+ <show_in_store>1</show_in_store>
66
+ <comment>Timer Title.</comment>
67
+ </heading>
68
+ </fields>
69
+ </general>
70
+ <apptha_timer_color translate="label" module="timer">
71
+ <label>Colors</label>
72
+ <frontend_type>text</frontend_type>
73
+ <sort_order>4</sort_order>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>1</show_in_store>
77
+ <fields>
78
+ <text translate="label">
79
+ <label>Timer Color:</label>
80
+ <frontend_type>text</frontend_type>
81
+ <sort_order>5</sort_order>
82
+ <show_in_default>1</show_in_default>
83
+ <show_in_website>1</show_in_website>
84
+ <show_in_store>1</show_in_store>
85
+ <comment>Please Click the text box to select color</comment>
86
+ </text>
87
+
88
+ <heading_text_color translate="label">
89
+ <label>Timer Heading Text Color:</label>
90
+ <frontend_type>text</frontend_type>
91
+ <sort_order>6</sort_order>
92
+ <show_in_default>1</show_in_default>
93
+ <show_in_website>1</show_in_website>
94
+ <show_in_store>1</show_in_store>
95
+ <comment>Please Click the text box to select color</comment>
96
+ </heading_text_color>
97
+
98
+ <description translate="label">
99
+ <label>Timer Caption Text Color:</label>
100
+ <frontend_type>text</frontend_type>
101
+ <sort_order>7</sort_order>
102
+ <show_in_default>1</show_in_default>
103
+ <show_in_website>1</show_in_website>
104
+ <show_in_store>1</show_in_store>
105
+ <comment>Please Click the text box to select color</comment>
106
+ </description>
107
+
108
+
109
+ </fields>
110
+ </apptha_timer_color>
111
+ </groups>
112
+ </timer>
113
+ </sections>
114
+ </config>
app/code/local/Apptha/Timer/sql/timer_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ $installer = $this;
20
+
21
+ $installer->startSetup();
22
+
23
+ $installer->run("
24
+
25
+ -- DROP TABLE IF EXISTS {$this->getTable('timer')};
26
+ CREATE TABLE {$this->getTable('timer')} (
27
+ `timer_id` int(11) unsigned NOT NULL auto_increment,
28
+ `title` varchar(255) NOT NULL default '',
29
+ `filename` varchar(255) NOT NULL default '',
30
+ `content` text NOT NULL default '',
31
+ `status` smallint(6) NOT NULL default '0',
32
+ `created_time` datetime NULL,
33
+ `update_time` datetime NULL,
34
+ PRIMARY KEY (`timer_id`)
35
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
36
+
37
+ ");
38
+
39
+ $installer->endSetup();
app/code/local/Mage/Adminhtml/Model/System/Config/Source/Caption.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+ class Mage_Adminhtml_Model_System_Config_Source_caption
19
+ {
20
+
21
+ /**
22
+ * Options getter
23
+ *
24
+ * @return array
25
+ */
26
+ public function toOptionArray()
27
+ {
28
+ return array(
29
+ array('value' => showall, 'label'=>Mage::helper('adminhtml')->__('Show in catalog/products pages')),
30
+ array('value' => listpage, 'label'=>Mage::helper('adminhtml')->__('Show in catalog page')),
31
+ array('value' => viewpage, 'label'=>Mage::helper('adminhtml')->__('Show in product page')),
32
+ array('value' => hideall, 'label'=>Mage::helper('adminhtml')->__('Hide in all pages')),
33
+
34
+ );
35
+ }
36
+
37
+ }
app/code/local/Mage/Adminhtml/Model/System/Config/Source/Heading.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+
19
+ class Mage_Adminhtml_Model_System_Config_Source_heading
20
+ {
21
+
22
+ /**
23
+ * Options getter
24
+ *
25
+ * @return array
26
+ */
27
+ public function toOptionArray()
28
+ {
29
+ return array(
30
+ array('value' => showall, 'label'=>Mage::helper('adminhtml')->__('Show in catalog/products pages')),
31
+ array('value' => listpage, 'label'=>Mage::helper('adminhtml')->__('Show in catalog page')),
32
+ array('value' => viewpage, 'label'=>Mage::helper('adminhtml')->__('Show in product page')),
33
+ array('value' => hideall, 'label'=>Mage::helper('adminhtml')->__('Hide in all pages')),
34
+
35
+ );
36
+ }
37
+
38
+ }
app/design/adminhtml/default/default/layout/timer.xml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addJs"><script>jscolor/jscolor.js</script></action>
6
+ </reference>
7
+ </default>
8
+
9
+ <timer_adminhtml_timer_index>
10
+ <reference name="content">
11
+ <block type="timer/adminhtml_timer" name="timer" />
12
+ </reference>
13
+ </timer_adminhtml_timer_index>
14
+ </layout>
app/design/frontend/default/default/layout/timer.xml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addJs"><script>timer.js</script></action>
6
+ <action method="addCss"><stylesheet>timer/timer.css</stylesheet></action>
7
+ </reference>
8
+ </default>
9
+ <catalog_category_default>
10
+ <update handle="content"/>
11
+ <reference name="category.products">
12
+ <block type="timer/list" name="list" as="list" />
13
+ </reference>
14
+ </catalog_category_default>
15
+
16
+ <catalog_product_view>
17
+ <update handle="content"/>
18
+ <reference name="product.info.addto">
19
+ <block type="timer/view" name="view" as="view" />
20
+ </reference>
21
+ </catalog_product_view>
22
+
23
+ <!--<catalog_product_compare_index>
24
+ <update handle="content"/>
25
+ <reference name="catalog.compare.list">
26
+ <block type="timer/compare" name="compare" as="compare" />
27
+ </reference>
28
+ </catalog_product_compare_index>-->
29
+
30
+ <catalogsearch_advanced_result>
31
+ <reference name="catalogsearch_advanced_result">
32
+ <block type="timer/list" name="list" as="list" />
33
+ </reference>
34
+ </catalogsearch_advanced_result>
35
+
36
+ </layout>
app/design/frontend/default/default/template/facebooklb/head.phtml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php $product = Mage::registry('current_product'); ?>
2
+
3
+ <meta property="fb:app_id" content="<?php echo Mage::getStoreConfig('facebooklb/general/appid'); ?>"/>
4
+ <?php if ($product): ?>
5
+ <meta property="og:title" content="<?php echo trim($product->getName()); ?>"/>
6
+ <?php endif; ?>
7
+ <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>"/>
8
+ <meta property="og:type" content="product"/>
9
+ <meta property="og:image" content="<?php echo Mage::getBaseUrl('media') . ltrim($product->getImage(), '/');?>"/>
app/design/frontend/default/default/template/facebooklb/like.phtml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php echo 'jkdnfkdsnm';?>
2
+
3
+ <?php if (Mage::getStoreConfig('facebooklb/general/enabled')) : ?>
4
+ <?php if (!Mage::getStoreConfig('facebooklb/opengraph/enabled_op')) :
5
+ $facebookUrl = 'http://www.facebook.com/plugins/like.php?' .
6
+ 'api_key = ' . Mage::getStoreConfig('facebooklb/general/appkey') .
7
+ '&href=' . $this->helper('core/url')->getCurrentUrl() .
8
+ '&layout=' . Mage::getStoreConfig('facebooklb/general/layout') .
9
+ '&node_type=link&sdk=joey' .
10
+ '&show_faces=' . Mage::getStoreConfig('facebooklb/general/showfaces') .
11
+ '&action=' . Mage::getStoreConfig('facebooklb/general/verb') .
12
+ '&font=' . Mage::getStoreConfig('facebooklb/general/font') .
13
+ '&colorscheme="' . Mage::getStoreConfig('facebooklb/general/color') . '" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:' . Mage::getStoreConfig('facebooklb/general/width') . 'px; height:' . Mage::getStoreConfig('facebooklb/general/height') . 'px">'
14
+ ;
15
+ ?>
16
+
17
+ <iframe src="<?php echo $facebookUrl; ?>" </iframe>
18
+
19
+ <?php else: ?>
20
+
21
+ <div id="fb-root"></div>
22
+ <script>
23
+ window.fbAsyncInit = function() {
24
+ FB.init({
25
+ appId : <?php echo Mage::getStoreConfig('facebooklb/general/appid'); ?>,
26
+ status : true,
27
+ cookie : true,
28
+ xfbml : true
29
+ });
30
+ };
31
+
32
+ (function() {
33
+ var e = document.createElement('script');
34
+ e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
35
+ e.async = true;
36
+ document.getElementById('fb-root').appendChild(e);
37
+ }());
38
+ </script>
39
+ <div><fb:like expr:href=' <?php echo Mage::helper('core/url')->getCurrentUrl(); ?> '/></div>
40
+
41
+ <?php endif; ?>
42
+
43
+ <?php endif; ?>
app/design/frontend/default/default/template/gr/deepzoom/product/view/media.phtml ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Product media data template
29
+ *
30
+ * @see Mage_Catalog_Block_Product_View_Media
31
+ */
32
+ ?>
33
+ <?php
34
+ $_product = $this->getProduct();
35
+ ?>
36
+ <p class="product-image">
37
+ <div id="container-deepzoom"></div>
38
+ <?php if ($_product->getImage() == 'no_selection' || !$_product->getImage()): ?>
39
+ <div class="no-selection">
40
+ <?php
41
+ $_helper = $this->helper('catalog/output');
42
+ $_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(265).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
43
+ echo $_helper->productAttribute($_product, $_img, 'image');
44
+ ?>
45
+ </div>
46
+ <?php endif; ?>
47
+ </p>
48
+ <?php if (count($this->getGalleryImages()) > 0): ?>
49
+ <div class="more-views">
50
+ <h2><?php echo $this->__('More Views') ?></h2>
51
+ <ul>
52
+ <?php foreach ($this->getGalleryImages() as $_image): ?>
53
+ <li>
54
+ <a href="<?php echo $this->helper('grdeepzoom')->getDescriptorUrl($_image->getFile())?>" rel="seadragon" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" width="56" height="56" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
55
+ </li>
56
+ <?php endforeach; ?>
57
+ </ul>
58
+ </div>
59
+ <?php endif; ?>
60
+ <script type="text/javascript">
61
+ //<![CDATA[
62
+ var seadragonUi = new GrSeadragonUi('container-deepzoom',{Config:<?php echo $this->helper('grdeepzoom')->getConfigJson();?>,noSelection:'.no-selection',containerStyles: {width: '265px',height:'265px',backgroundColor:'white',color:'white'},Tooltips:{ZoomIn: '<?php echo $this->__('Zoom in (you can also use your mouse\\\'s scroll wheel)'); ?>',ZoomOut: '<?php echo $this->__('Zoom out (you can also use your mouse\\\'s scroll wheel)'); ?>',Home: '<?php echo $this->__('Go home'); ?>',FullPage: '<?php echo $this->__('Toggle full page'); ?>'}});
63
+ <?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?>
64
+ seadragonUi.open('<?php echo $this->helper('grdeepzoom')->getDescriptorUrl($_product->getImage())?>');
65
+ seadragonUi.loadGallery(<?php echo $this->helper('grdeepzoom')->getGalleryImagesJson($this->getGalleryImages());?>);
66
+ <?php endif;?>
67
+ //]]>
68
+ </script>
app/design/frontend/default/default/template/gr/deepzoom/product/widget/gallery.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 Gr
22
+ * @package Gr_Deepzoom
23
+ * @copyright Copyright (c) 2010 groupeReflect (http://www.groupereflect.net)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ if($this->getDescriptor() != 'no_selection' && $this->getDescriptor()):
27
+ $_helper = $this->helper('grdeepzoom');
28
+ $_idDeep = $this->helper('core')->uniqHash();
29
+ ?>
30
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('css/gr/deepzoom/seadragon-0.6.0.css');?>" media="all" />
31
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/gr/deepzoom/seadragon-0-8-4-min.js');?>"></script>
32
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/gr/deepzoom/seadragon-ui-0.6.0-min.js');?>"></script>
33
+ <div class="deepzoom" >
34
+ <div id="container-<?php echo $_idDeep ?>"></div>
35
+ </div>
36
+
37
+ <script type="text/javascript">
38
+ //<![CDATA[
39
+ var seadragonUi<?php echo $_idDeep ?> = new GrSeadragonUi('container-<?php echo $_idDeep ?>',
40
+ {containerStyles:
41
+ {width: '<?php echo $this->getWidth()?>px',
42
+ height:'<?php echo $this->getHeight()?>px',
43
+ backgroundColor:'<?php echo $this->getBackgroundColor()?>',
44
+ color:'white'}});
45
+ seadragonUi<?php echo $_idDeep ?>.open('<?php echo $_helper->getDescriptorUrl($this->getDescriptor())?>');
46
+ seadragonUi<?php echo $_idDeep ?>.loadGallery(<?php echo $this->getGalleryImagesJson()?>);
47
+ //]]>
48
+ </script>
49
+ <?php endif;?>
app/design/frontend/default/default/template/gr/deepzoom/product/widget/image.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 Gr
22
+ * @package Gr_Deepzoom
23
+ * @copyright Copyright (c) 2010 groupeReflect (http://www.groupereflect.net)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ if($this->getDescriptor() != 'no_selection' && $this->getDescriptor()):
27
+ $_helper = $this->helper('grdeepzoom');
28
+ $_idDeep = $this->helper('core')->uniqHash();
29
+ ?>
30
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('css/gr/deepzoom/seadragon-0.6.0.css');?>" media="all" />
31
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/gr/deepzoom/seadragon-0-8-4-min.js');?>"></script>
32
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/gr/deepzoom/seadragon-ui-0.6.0-min.js');?>"></script>
33
+ <div class="deepzoom" >
34
+ <div id="container-<?php echo $_idDeep; ?>"></div>
35
+ </div>
36
+
37
+ <script type="text/javascript">
38
+ //<![CDATA[
39
+ var seadragonUi<?php echo $_idDeep; ?> = new GrSeadragonUi('container-<?php echo $_idDeep; ?>',
40
+ {containerStyles:
41
+ {width: '<?php echo $this->getWidth()?>px',
42
+ height:'<?php echo $this->getHeight()?>px',
43
+ backgroundColor:'<?php echo $this->getBackgroundColor()?>',
44
+ color:'white'}});
45
+ seadragonUi<?php echo $_idDeep; ?>.open('<?php echo $_helper->getDescriptorUrl($this->getDescriptor())?>');
46
+ //]]>
47
+ </script>
48
+ <?php endif;?>
49
+
app/design/frontend/default/default/template/smoovpay/blank.phtml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ * @category design_default
16
+ * @package Apptha_Smoovpay
17
+ * @copyright Copyright (c) 2011 ContusSupport
18
+ */
19
+ ?>
20
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
21
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
22
+ <head>
23
+ </head>
24
+ <body>
25
+ <?php echo $this->getChildHtml('content') ?>
26
+ </body>
27
+ </html>
app/design/frontend/default/default/template/smoovpay/cancel.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ * @category design_default
16
+ * @package Apptha_Smoovpay
17
+ * @copyright Copyright (c) 2011 ContusSupport
18
+ */
19
+ ?>
20
+ <html>
21
+ <meta http-equiv="refresh" content="0; URL=<?php echo $this->getContinueShoppingUrl() ?>">
22
+ <body>
23
+ <div class="page-head">
24
+ <h3><?php echo Mage::helper('smoovpay')->__('Payment was canceled') ?></h3>
25
+ </div>
26
+ <p><?php echo Mage::helper('smoovpay')->__('Please <a href="%s">continue shopping</a>.', $this->getContinueShoppingUrl()) ?></p>
27
+ </body>
28
+ </html>
app/design/frontend/default/default/template/smoovpay/failure.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ * @category design_default
16
+ * @package Apptha_Smoovpay
17
+ * @copyright Copyright (c) 2011 ContusSupport
18
+ */
19
+ ?>
20
+ <html>
21
+ <meta http-equiv="refresh" content="0; URL=<?php echo $this->getContinueShoppingUrl()?>">
22
+ <body>
23
+ <div class="page-head">
24
+ <h3><?php echo Mage::helper('smoovpay')->__('Error occurred') ?></h3>
25
+ </div>
26
+ <p><?php echo Mage::helper('smoovpay')->__('Please <a href="%s">continue shopping</a>.', $this->getContinueShoppingUrl()) ?></p>
27
+ </body>
28
+ </html>
app/design/frontend/default/default/template/smoovpay/form.phtml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ * @category design_default
16
+ * @package Apptha_Smoovpay
17
+ * @copyright Copyright (c) 2011 ContusSupport
18
+ */
19
+ ?>
20
+ <fieldset class="form-list">
21
+ <?php $_code = $this->getMethodCode() ?>
22
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none">
23
+ <li>
24
+ <?php echo Mage::helper('smoovpay')->__('You will be redirected to Smoovpay website when you place an order.') ?><br/>
25
+ <img src="https://www.smoovpay.com/img/btn_smoovpay_v1.png" alt="SmoovPay!" />
26
+
27
+ </li>
28
+ </ul>
29
+ </fieldset>
app/design/frontend/default/default/template/smoovpay/info.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ * @category design_default
16
+ * @package Apptha_Smoovpay
17
+ * @copyright Copyright (c) 2011 ContusSupport
18
+ */
19
+ ?>
20
+ <?php
21
+ echo $this->getMethod()->getTitle() . '<br/>';
22
+ if ($this->getInfo()->getLastTransId() == '') {
23
+ echo '<em>' . Mage::helper('smoovpay')->__($this->getMethodCode().':You will be redirected to Smoovpay website when you place an order.') . '</em>';
24
+ } else {
25
+ echo Mage::helper('smoovpay')->__('Credit Card Type: %s', $this->htmlEscape($this->getInfo()->getCcType())) . '<br/>';
26
+ echo Mage::helper('smoovpay')->__('smoovpay Transaction ID: %s', $this->htmlEscape($this->getInfo()->getLastTransId())) . '<br/>';
27
+ }
28
+ ?>
app/design/frontend/default/default/template/smoovpay/redirect.phtml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ * @category design_default
16
+ * @package Apptha_Smoovpay
17
+ * @copyright Copyright (c) 2011 ContusSupport
18
+ */
19
+ ?>
20
+ <b><?php echo Mage::helper('smoovpay')->__('You will be redirected to smoovpay in a few seconds.'); ?></b>
21
+ <form name="smoovpay_checkout" id="smoovpay_checkout" action="<?php echo $this->getFormAction();?>" method="POST">
22
+ <?php if (is_array($this->getFormData())): ?>
23
+ <?php foreach ($this->getFormData() as $name => $value): ?>
24
+ <input type="hidden" name="<?php echo $name; ?>" <?php if (!is_null($value)) { echo 'value="'. $value . '"'; } ?> />
25
+ <?php endforeach; ?>
26
+ <?php endif; ?>
27
+ </form>
28
+
29
+ <script type="text/javascript">
30
+ //<![CDATA[
31
+ var paymentform = document.getElementById('smoovpay_checkout');
32
+ window.onload = paymentform.submit();
33
+ //]]>
34
+ </script>
app/design/frontend/default/default/template/timer/list.phtml ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+ ?>
19
+ <?php
20
+ /**
21
+ * Product list template
22
+ *
23
+ * @see Mage_Catalog_Block_Product_List
24
+ */
25
+ ?>
26
+ <?php
27
+ /* Count for timer calculation declared here */
28
+ $count = 1;
29
+ $_productCollection=$this->getLoadedProductCollection();
30
+ $_helper = $this->helper('catalog/output');
31
+
32
+ /* Admin Controllers for timer are declared here */
33
+ $timer_active = Mage::getStoreConfig('timer/general/activate_apptha_timer');
34
+ $timer_head_active = Mage::getStoreConfig('timer/general/activate_apptha_heading');
35
+ $timer_desc_active = Mage::getStoreConfig('timer/general/activate_apptha_description');
36
+ $timer_color = Mage::getStoreConfig('timer/apptha_timer_color/text');
37
+ $desc_color = Mage::getStoreConfig('timer/apptha_timer_color/description');
38
+ $head_color = Mage::getStoreConfig('timer/apptha_timer_color/heading_text_color');
39
+ $timer_head = Mage::getStoreConfig('timer/general/heading');
40
+ ?>
41
+
42
+ <?php if(!$_productCollection->count()): ?>
43
+ <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
44
+ <?php else: ?>
45
+ <div class="category-products">
46
+ <?php echo $this->getToolbarHtml() ?>
47
+
48
+ <?php // List mode ?>
49
+ <?php if($this->getMode()!='grid'): ?>
50
+ <?php $_iterator = 0; ?>
51
+ <ol class="products-list" id="products-list">
52
+ <?php foreach ($_productCollection as $_product):?>
53
+ <?php $toDate = $_product->getSpecialTODate(); ?>
54
+ <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
55
+
56
+ <?php // Product Image ?>
57
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
58
+ <div class="product-shop">
59
+ <div class="f-fix">
60
+ <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
61
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
62
+ <?php if($_product->getRatingSummary()): ?>
63
+ <?php echo $this->getReviewsSummaryHtml($_product) ?>
64
+ <?php endif; ?>
65
+ <?php echo $this->getPriceHtml($_product, true) ?>
66
+
67
+ <!--Condition for Timer Controllers goes here-->
68
+ <?php if($timer_active == 1) :?>
69
+ <?php if($_product->getPrice() > $_product->getSpecialPrice()) : ?>
70
+ <?php if($_product->getSpecialPrice()!= 0 || $_product->getSpecialPrice()!= "" ) :?>
71
+ <?php if($timer_head_active == 'showall' || $timer_head_active == 'listpage' && $timer_head_active!='hideall' && $timer_head!= '') : ?>
72
+ <div id="heading<?php echo $count; ?>" style="color:#<?php echo $head_color; ?>; font-size: 14px; font-weight:bold;padding-top:0px;clear: both;"><?php echo $timer_head ?></div>
73
+ <?php endif; ?>
74
+ <div id="countbox_<?php echo $count; ?>" class="timer-list"></div>
75
+ <?php if($timer_desc_active == 'showall' || $timer_desc_active == 'listpage' && $timer_desc_active!='hideall') : ?>
76
+ <div class='clear'></div><div class='timerdate' id="caption<?php echo $count; ?>"><span class='hour' style='margin:1px 23px 0 4px'><?php echo $this->__('D') ?></span><span class='hour' style='margin:1px 19px 0 6px'><?php echo $this->__('H') ?></span><span class='min' style='margin:1px 20px 0 7px'><?php echo $this->__('M') ?></span><span class='sec' style='margin:1px 0 0 6px'><?php echo $this->__('S') ?></span></div>
77
+ <?php endif;endif;endif;endif; ?>
78
+
79
+ <?php if($_product->isSaleable()): ?>
80
+ <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
81
+ <?php else: ?>
82
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
83
+ <?php endif; ?>
84
+ <div class="desc std">
85
+ <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
86
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
87
+ </div>
88
+ <ul class="add-to-links">
89
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
90
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
91
+ <?php endif; ?>
92
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
93
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
94
+ <?php endif; ?>
95
+ </ul>
96
+ <?php if($_product->getPrice() > $_product->getSpecialPrice()) : ?>
97
+ <?php if($_product->getSpecialPrice()!= 0 || $_product->getSpecialPrice()!= "" ) :?>
98
+ <script type="text/javascript">
99
+ var dthen<?php echo $count; ?> = new Date("<?php echo Date("m/d/y", strtotime($toDate)).' 11:59:00 PM'; ?>");
100
+ start = "<?php echo Date("m/d/y h:i:s A", strtotime(Mage_Core_Model_Locale::date(null, null, "en_US", true))); ?>";
101
+ start_date = Date.parse(start);
102
+ var dnow<?php echo $count; ?> = new Date(start_date);
103
+ if(CountStepper>0)
104
+ ddiff= new Date((dnow<?php echo $count; ?>)-(dthen<?php echo $count; ?>));
105
+ else
106
+ ddiff = new Date((dthen<?php echo $count; ?>)-(dnow<?php echo $count; ?>));
107
+ gsecs<?php echo $count; ?> = Math.floor(ddiff.valueOf()/1000);
108
+ var iid<?php echo $count; ?> = "countbox_<?php echo $count; ?>";
109
+ CountBack(gsecs<?php echo $count; ?>,"countbox_"+j, j);
110
+ j++;
111
+ </script>
112
+ <?php $count = $count + 1; ?>
113
+ <?php endif;endif; ?>
114
+ </div>
115
+ </div>
116
+ </li>
117
+ <?php endforeach; ?>
118
+ </ol>
119
+
120
+ <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
121
+ <?php else: ?>
122
+
123
+ <?php // Grid Mode ?>
124
+
125
+ <?php $_collectionSize = $_productCollection->count() ?>
126
+ <?php $_columnCount = $this->getColumnCount();?>
127
+ <?php $i=0; foreach ($_productCollection as $_product): ?>
128
+ <?php $toDate = $_product->getSpecialTODate();?>
129
+ <?php if ($i++%$_columnCount==0): ?>
130
+ <ul class="products-grid">
131
+ <?php endif ?>
132
+ <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
133
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
134
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
135
+ <?php if($_product->getRatingSummary()): ?>
136
+ <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
137
+ <?php endif; ?>
138
+ <?php echo $this->getPriceHtml($_product, true) ?>
139
+
140
+ <!--Condition for Timer Controllers goes here-->
141
+ <?php if($timer_active == 1) :?>
142
+ <?php if($_product->getPrice() > $_product->getSpecialPrice()) : ?>
143
+ <?php if($_product->getSpecialPrice()!= 0 || $_product->getSpecialPrice()!= "" ) :?>
144
+ <?php if($timer_head_active == 'showall' || $timer_head_active == 'listpage' && $timer_head_active!='hideall' && $timer_head!= '') : ?>
145
+ <div id="heading<?php echo $count; ?>" style="color:#<?php echo $head_color; ?>; font-size: 14px; font-weight:bold;padding-top:3px;clear: both;"><?php echo $timer_head ?></div>
146
+ <?php endif; ?>
147
+ <div id="countbox_<?php echo $count; ?>" class="timer-grid"></div>
148
+ <?php if($timer_desc_active == 'showall' || $timer_desc_active == 'listpage' && $timer_desc_active!='hideall') : ?>
149
+ <div class='clear'></div><div class='timerdate' id="caption<?php echo $count; ?>"><span class='hour' style='margin:1px 23px 0 8px'><?php echo $this->__('D') ?></span><span class='hour' style='margin:1px 24px 0 1px'><?php echo $this->__('H') ?></span><span class='min' style='margin:1px 21px 0 3px'><?php echo $this->__('M') ?></span><span class='sec' style='margin:1px 0 0 6px'><?php echo $this->__('S') ?></span></div>
150
+ <?php endif;endif;endif;endif; ?>
151
+ <div class="actions">
152
+ <?php if($_product->isSaleable()): ?>
153
+ <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
154
+ <?php else: ?>
155
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
156
+ <?php endif; ?>
157
+
158
+ <?php if($_product->getPrice() > $_product->getSpecialPrice()) : ?>
159
+ <?php if($_product->getSpecialPrice()!= 0 || $_product->getSpecialPrice()!= "" ) :?>
160
+ <script type="text/javascript">
161
+ var dthen<?php echo $count; ?> = new Date("<?php echo Date("m/d/y", strtotime($toDate)).' 11:59:00 PM'; ?>");
162
+ start = "<?php echo Date("m/d/y h:i:s A", strtotime(Mage_Core_Model_Locale::date(null, null, "en_US", true))); ?>";
163
+ start_date = Date.parse(start);
164
+ var dnow<?php echo $count; ?> = new Date(start_date);
165
+ if(CountStepper>0)
166
+ ddiff= new Date((dnow<?php echo $count; ?>)-(dthen<?php echo $count; ?>));
167
+ else
168
+ ddiff = new Date((dthen<?php echo $count; ?>)-(dnow<?php echo $count; ?>));
169
+ gsecs<?php echo $count; ?> = Math.floor(ddiff.valueOf()/1000);
170
+
171
+ var iid<?php echo $count; ?> = "countbox_<?php echo $count; ?>";
172
+ CountBack(gsecs<?php echo $count; ?>,"countbox_"+j, j);
173
+ j++;
174
+ </script>
175
+ <?php $count = $count + 1; ?>
176
+ <?php endif;endif; ?>
177
+
178
+ <ul class="add-to-links">
179
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
180
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
181
+ <?php endif; ?>
182
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
183
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
184
+ <?php endif; ?>
185
+ </ul>
186
+ </div>
187
+ </li>
188
+ <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
189
+ </ul>
190
+ <?php endif ?>
191
+ <?php endforeach ?>
192
+ <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
193
+ <?php endif; ?>
194
+
195
+ <div class="toolbar-bottom">
196
+ <?php echo $this->getToolbarHtml() ?>
197
+ </div>
198
+ </div>
199
+ <?php endif; ?>
200
+
201
+ <!--Dynamic style changes goes here-->
202
+ <style>
203
+ .timer-grid{float: left;width: 100%;padding: 0;color: #<?php echo $timer_color; ?>;font-size: 18px;font-family: arial;font-weight: bold;}
204
+ .timer-list{float: left;width: 100%;padding: 0;color: #<?php echo $timer_color; ?>;font-size: 18px;font-family:arial;font-weight: bold;}
205
+ .timerdate{float: left;width: 100%;padding:0 0 3px 0;color: #<?php echo $desc_color; ?>;font-size: 12px;}
206
+ </style>
app/design/frontend/default/default/template/timer/view.phtml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contus Support Interactive.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
14
+ * Contus Support does not guarantee correct work of this package
15
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
16
+ * =================================================================
17
+ */
18
+ ?>
19
+ <?php
20
+ /* Count for timer calculation declared here */
21
+ $count = 1;
22
+ $_product = $this->getProduct();
23
+ $toDate = $_product->getSpecialTODate();
24
+
25
+ /* Admin Controllers for timer are declared here */
26
+ $timer_active = Mage::getStoreConfig('timer/general/activate_apptha_timer');
27
+ $timer_head_active = Mage::getStoreConfig('timer/general/activate_apptha_heading');
28
+ $timer_desc_active = Mage::getStoreConfig('timer/general/activate_apptha_description');
29
+ $desc_color = Mage::getStoreConfig('timer/apptha_timer_color/description');
30
+ $timer_color = Mage::getStoreConfig('timer/apptha_timer_color/text');
31
+ $head_color = Mage::getStoreConfig('timer/apptha_timer_color/heading_text_color');
32
+ $timer_head = Mage::getStoreConfig('timer/general/heading');
33
+ ?>
34
+
35
+ <?php $_wishlistSubmitUrl = $this->helper('wishlist')->getAddUrl($_product); ?>
36
+ <ul class="add-to-links">
37
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
38
+ <li><a href="<?php echo $_wishlistSubmitUrl ?>" onclick="productAddToCartForm.submitLight(this, '<?php echo $_wishlistSubmitUrl ?>'); return false;" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
39
+ <?php endif; ?>
40
+ <?php
41
+ $_compareUrl = $this->helper('catalog/product_compare')->getAddUrl($_product);
42
+ ?>
43
+ <?php if ($_compareUrl) : ?>
44
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
45
+ <?php endif; ?>
46
+ </ul>
47
+
48
+ <!--Condition for Timer Controllers goes here-->
49
+ <?php if ($timer_active == 1) : ?>
50
+ <?php if ($_product->getPrice() > $_product->getSpecialPrice()) : ?>
51
+ <?php if ($_product->getSpecialPrice() != 0 || $_product->getSpecialPrice() != "") : ?>
52
+ <?php if ($timer_head_active == 'showall' || $timer_head_active == 'viewpage' && $timer_head_active != 'hideall' && $timer_head != '') : ?>
53
+ <div id="heading<?php echo $count; ?>" style="color:#<?php echo $head_color; ?>; font-size: 18px; font-weight:bold;padding-top:15px;clear: both;"><?php echo $timer_head ?></div>
54
+ <?php endif; ?>
55
+ <div id="countbox_<?php echo $count; ?>" class="timer-view"></div>
56
+ <?php if ($timer_desc_active == 'showall' || $timer_desc_active == 'viewpage' && $timer_desc_active != 'hideall') : ?>
57
+ <div class='clear'></div><div class='timerdate' id="caption<?php echo $count; ?>"><span class='hour' style='margin:1px 23px 0 0px'><?php echo $this->__('Days') ?></span><span class='hour' style='margin:1px 19px 0 15px'><?php echo $this->__('Hours') ?></span><span class='min' style='margin:1px 20px 0 7px'><?php echo $this->__('Minutes') ?></span><span class='sec' style='margin:1px 0 0 2px'><?php echo $this->__('Seconds') ?></span></div>
58
+ <?php endif;endif;endif; ?>
59
+
60
+ <?php if ($_product->getPrice() > $_product->getSpecialPrice()) : ?>
61
+ <?php if ($_product->getSpecialPrice() != 0 || $_product->getSpecialPrice() != "") : ?>
62
+ <script type="text/javascript">
63
+ var dthen<?php echo $count; ?> = new Date("<?php echo Date("m/d/y", strtotime($toDate)).' 11:59:00 PM'; ?>");
64
+ start = "<?php echo Date("m/d/y h:i:s A", strtotime(Mage_Core_Model_Locale::date(null, null, "en_US", true))); ?>";
65
+ start_date = Date.parse(start);
66
+ var dnow<?php echo $count; ?> = new Date(start_date);
67
+ if(CountStepper>0)
68
+ ddiff= new Date((dnow<?php echo $count; ?>)-(dthen<?php echo $count; ?>));
69
+ else
70
+ ddiff = new Date((dthen<?php echo $count; ?>)-(dnow<?php echo $count; ?>));
71
+ gsecs<?php echo $count; ?> = Math.floor(ddiff.valueOf()/1000);
72
+
73
+ var iid<?php echo $count; ?> = "countbox_<?php echo $count; ?>";
74
+ CountBack(gsecs<?php echo $count; ?>,"countbox_"+j, j);
75
+ j++;
76
+ </script>
77
+ <?php $count = $count + 1; ?>
78
+ <?php endif;endif;endif; ?>
79
+
80
+ <!--Dynamic style changes goes here-->
81
+ <style>
82
+ .timer-view{float: left;width: 100%;padding:0;color: #<?php echo $timer_color; ?>;font-size: 40px; font-family: arial;font-weight: bold;}
83
+ .timerdate{float: left;width: 100%;padding:0 0 15px 10px;color: #<?php echo $desc_color; ?>;font-size: 13px;}
84
+ </style>
app/etc/modules/Apptha_Timer.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Apptha_Timer>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Apptha_Timer>
8
+ </modules>
9
+ </config>
js/jscolor/Thumbs.db ADDED
Binary file
js/jscolor/arrow.gif ADDED
Binary file
js/jscolor/cross.gif ADDED
Binary file
js/jscolor/demo.html ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <title>jscolor demo</title>
4
+ </head>
5
+ <body>
6
+
7
+ <script type="text/javascript" src="jscolor.js"></script>
8
+
9
+ Click here: <input class="color" value="66ff00">
10
+
11
+ </body>
12
+ </html>
js/jscolor/hs.png ADDED
Binary file
js/jscolor/hv.png ADDED
Binary file
js/jscolor/jscolor.js ADDED
@@ -0,0 +1,863 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jscolor, JavaScript Color Picker
3
+ *
4
+ * @version 1.3.1
5
+ * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
6
+ * @author Jan Odvarko, http://odvarko.cz
7
+ * @created 2008-06-15
8
+ * @updated 2010-01-23
9
+ * @link http://jscolor.com
10
+ */
11
+
12
+
13
+ var jscolor = {
14
+
15
+
16
+ dir : '', // location of jscolor directory (leave empty to autodetect)
17
+ bindClass : 'timer_apptha_timer_color_text',
18
+ bindClass1 : 'timer_apptha_timer_color_description',
19
+ bindClass2 : 'timer_apptha_timer_color_heading_text_color', // class name
20
+ binding : true, // automatic binding via <input class="...">
21
+ preloading : true, // use image preloading?
22
+
23
+
24
+ install : function() {
25
+ jscolor.addEvent(window, 'load', jscolor.init);
26
+ },
27
+
28
+
29
+ init : function() {
30
+ if(jscolor.binding) {
31
+ jscolor.bind();
32
+ }
33
+ if(jscolor.preloading) {
34
+ jscolor.preload();
35
+ }
36
+ },
37
+
38
+
39
+ getDir : function() {
40
+ if(!jscolor.dir) {
41
+ var detected = jscolor.detectDir();
42
+ jscolor.dir = detected!==false ? detected : 'jscolor/';
43
+ }
44
+ return jscolor.dir;
45
+ },
46
+
47
+
48
+ detectDir : function() {
49
+ var base = location.href;
50
+
51
+ var e = document.getElementsByTagName('base');
52
+ for(var i=0; i<e.length; i+=1) {
53
+ if(e[i].href) {base = e[i].href;}
54
+ }
55
+
56
+ var e = document.getElementsByTagName('script');
57
+ for(var i=0; i<e.length; i+=1) {
58
+ if(e[i].src && /(^|\/)jscolor\.js([?#].*)?$/i.test(e[i].src)) {
59
+ var src = new jscolor.URI(e[i].src);
60
+ var srcAbs = src.toAbsolute(base);
61
+ srcAbs.path = srcAbs.path.replace(/[^\/]+$/, ''); // remove filename
62
+ srcAbs.query = null;
63
+ srcAbs.fragment = null;
64
+ return srcAbs.toString();
65
+ }
66
+ }
67
+ return false;
68
+ },
69
+
70
+
71
+ bind : function() {
72
+ var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i');
73
+ var matchClass1 = new RegExp('(^|\\s)('+jscolor.bindClass1+')\\s*(\\{[^}]*\\})?', 'i');
74
+ var matchClass2 = new RegExp('(^|\\s)('+jscolor.bindClass2+')\\s*(\\{[^}]*\\})?', 'i');
75
+ var e = document.getElementsByTagName('input');
76
+ for(var i=0; i<e.length; i+=1) {
77
+ var m;
78
+ if(!e[i].color && e[i].id&& (m = e[i].id.match(matchClass))) {
79
+ var prop = {};
80
+ if(m[3]) {
81
+ try {
82
+ eval('prop='+m[3]);
83
+ } catch(eInvalidProp) {}
84
+ }
85
+ e[i].color = new jscolor.color(e[i], prop);
86
+ }
87
+ if(!e[i].color && e[i].id&& (m = e[i].id.match(matchClass1))) {
88
+ var prop = {};
89
+ if(m[3]) {
90
+ try {
91
+ eval('prop='+m[3]);
92
+ } catch(eInvalidProp) {}
93
+ }
94
+ e[i].color = new jscolor.color(e[i], prop);
95
+ }
96
+ if(!e[i].color && e[i].id&& (m = e[i].id.match(matchClass2))) {
97
+ var prop = {};
98
+ if(m[3]) {
99
+ try {
100
+ eval('prop='+m[3]);
101
+ } catch(eInvalidProp) {}
102
+ }
103
+ e[i].color = new jscolor.color(e[i], prop);
104
+ }
105
+ }
106
+ },
107
+
108
+
109
+ preload : function() {
110
+ for(var fn in jscolor.imgRequire) {
111
+ if(jscolor.imgRequire.hasOwnProperty(fn)) {
112
+ jscolor.loadImage(fn);
113
+ }
114
+ }
115
+ },
116
+
117
+
118
+ images : {
119
+ pad : [ 181, 101 ],
120
+ sld : [ 16, 101 ],
121
+ cross : [ 15, 15 ],
122
+ arrow : [ 7, 11 ]
123
+ },
124
+
125
+
126
+ imgRequire : {},
127
+ imgLoaded : {},
128
+
129
+
130
+ requireImage : function(filename) {
131
+ jscolor.imgRequire[filename] = true;
132
+ },
133
+
134
+
135
+ loadImage : function(filename) {
136
+ if(!jscolor.imgLoaded[filename]) {
137
+ jscolor.imgLoaded[filename] = new Image();
138
+ jscolor.imgLoaded[filename].src = jscolor.getDir()+filename;
139
+ }
140
+ },
141
+
142
+
143
+ fetchElement : function(mixed) {
144
+ return typeof mixed === 'string' ? document.getElementById(mixed) : mixed;
145
+ },
146
+
147
+
148
+ addEvent : function(el, evnt, func) {
149
+ if(el.addEventListener) {
150
+ el.addEventListener(evnt, func, false);
151
+ } else if(el.attachEvent) {
152
+ el.attachEvent('on'+evnt, func);
153
+ }
154
+ },
155
+
156
+
157
+ fireEvent : function(el, evnt) {
158
+ if(!el) {
159
+ return;
160
+ }
161
+ if(document.createEventObject) {
162
+ var ev = document.createEventObject();
163
+ el.fireEvent('on'+evnt, ev);
164
+ } else if(document.createEvent) {
165
+ var ev = document.createEvent('HTMLEvents');
166
+ ev.initEvent(evnt, true, true);
167
+ el.dispatchEvent(ev);
168
+ } else if(el['on'+evnt]) { // alternatively use the traditional event model (IE5)
169
+ el['on'+evnt]();
170
+ }
171
+ },
172
+
173
+
174
+ getElementPos : function(e) {
175
+ var e1=e, e2=e;
176
+ var x=0, y=0;
177
+ if(e1.offsetParent) {
178
+ do {
179
+ x += e1.offsetLeft;
180
+ y += e1.offsetTop;
181
+ } while(e1 = e1.offsetParent);
182
+ }
183
+ while((e2 = e2.parentNode) && e2.nodeName.toUpperCase() !== 'BODY') {
184
+ x -= e2.scrollLeft;
185
+ y -= e2.scrollTop;
186
+ }
187
+ return [x, y];
188
+ },
189
+
190
+
191
+ getElementSize : function(e) {
192
+ return [e.offsetWidth, e.offsetHeight];
193
+ },
194
+
195
+
196
+ getMousePos : function(e) {
197
+ if(!e) {e = window.event;}
198
+ if(typeof e.pageX === 'number') {
199
+ return [e.pageX, e.pageY];
200
+ } else if(typeof e.clientX === 'number') {
201
+ return [
202
+ e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft,
203
+ e.clientY + document.body.scrollTop + document.documentElement.scrollTop
204
+ ];
205
+ }
206
+ },
207
+
208
+
209
+ getViewPos : function() {
210
+ if(typeof window.pageYOffset === 'number') {
211
+ return [window.pageXOffset, window.pageYOffset];
212
+ } else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
213
+ return [document.body.scrollLeft, document.body.scrollTop];
214
+ }else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
215
+ return [document.documentElement.scrollLeft, document.documentElement.scrollTop];
216
+ }else {
217
+ return [0, 0];
218
+ }
219
+ },
220
+
221
+
222
+ getViewSize : function() {
223
+ if(typeof window.innerWidth === 'number') {
224
+ return [window.innerWidth, window.innerHeight];
225
+ } else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
226
+ return [document.body.clientWidth, document.body.clientHeight];
227
+ } else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
228
+ return [document.documentElement.clientWidth, document.documentElement.clientHeight];
229
+ } else {
230
+ return [0, 0];
231
+ }
232
+ },
233
+
234
+
235
+ URI : function(uri) { // See RFC3986
236
+
237
+ this.scheme = null;
238
+ this.authority = null;
239
+ this.path = '';
240
+ this.query = null;
241
+ this.fragment = null;
242
+
243
+ this.parse = function(uri) {
244
+ var m = uri.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);
245
+ this.scheme = m[3] ? m[2] : null;
246
+ this.authority = m[5] ? m[6] : null;
247
+ this.path = m[7];
248
+ this.query = m[9] ? m[10] : null;
249
+ this.fragment = m[12] ? m[13] : null;
250
+ return this;
251
+ };
252
+
253
+ this.toString = function() {
254
+ var result = '';
255
+ if(this.scheme !== null) {result = result + this.scheme + ':';}
256
+ if(this.authority !== null) {result = result + '//' + this.authority;}
257
+ if(this.path !== null) {result = result + this.path;}
258
+ if(this.query !== null) {result = result + '?' + this.query;}
259
+ if(this.fragment !== null) {result = result + '#' + this.fragment;}
260
+ return result;
261
+ };
262
+
263
+ this.toAbsolute = function(base) {
264
+ var base = new jscolor.URI(base);
265
+ var r = this;
266
+ var t = new jscolor.URI;
267
+
268
+ if(base.scheme === null) {return false;}
269
+
270
+ if(r.scheme !== null && r.scheme.toLowerCase() === base.scheme.toLowerCase()) {
271
+ r.scheme = null;
272
+ }
273
+
274
+ if(r.scheme !== null) {
275
+ t.scheme = r.scheme;
276
+ t.authority = r.authority;
277
+ t.path = removeDotSegments(r.path);
278
+ t.query = r.query;
279
+ } else {
280
+ if(r.authority !== null) {
281
+ t.authority = r.authority;
282
+ t.path = removeDotSegments(r.path);
283
+ t.query = r.query;
284
+ } else {
285
+ if(r.path === '') { // TODO: == or === ?
286
+ t.path = base.path;
287
+ if(r.query !== null) {
288
+ t.query = r.query;
289
+ } else {
290
+ t.query = base.query;
291
+ }
292
+ } else {
293
+ if(r.path.substr(0,1) === '/') {
294
+ t.path = removeDotSegments(r.path);
295
+ } else {
296
+ if(base.authority !== null && base.path === '') { // TODO: == or === ?
297
+ t.path = '/'+r.path;
298
+ } else {
299
+ t.path = base.path.replace(/[^\/]+$/,'')+r.path;
300
+ }
301
+ t.path = removeDotSegments(t.path);
302
+ }
303
+ t.query = r.query;
304
+ }
305
+ t.authority = base.authority;
306
+ }
307
+ t.scheme = base.scheme;
308
+ }
309
+ t.fragment = r.fragment;
310
+
311
+ return t;
312
+ };
313
+
314
+ function removeDotSegments(path) {
315
+ var out = '';
316
+ while(path) {
317
+ if(path.substr(0,3)==='../' || path.substr(0,2)==='./') {
318
+ path = path.replace(/^\.+/,'').substr(1);
319
+ } else if(path.substr(0,3)==='/./' || path==='/.') {
320
+ path = '/'+path.substr(3);
321
+ } else if(path.substr(0,4)==='/../' || path==='/..') {
322
+ path = '/'+path.substr(4);
323
+ out = out.replace(/\/?[^\/]*$/, '');
324
+ } else if(path==='.' || path==='..') {
325
+ path = '';
326
+ } else {
327
+ var rm = path.match(/^\/?[^\/]*/)[0];
328
+ path = path.substr(rm.length);
329
+ out = out + rm;
330
+ }
331
+ }
332
+ return out;
333
+ }
334
+
335
+ if(uri) {
336
+ this.parse(uri);
337
+ }
338
+
339
+ },
340
+
341
+
342
+ /*
343
+ * Usage example:
344
+ * var myColor = new jscolor.color(myInputElement)
345
+ */
346
+
347
+ color : function(target, prop) {
348
+
349
+
350
+ this.required = true; // refuse empty values?
351
+ this.adjust = true; // adjust value to uniform notation?
352
+ this.hash = false; // prefix color with # symbol?
353
+ this.caps = true; // uppercase?
354
+ this.valueElement = target; // value holder
355
+ this.styleElement = target; // where to reflect current color
356
+ this.hsv = [0, 0, 1]; // read-only 0-6, 0-1, 0-1
357
+ this.rgb = [1, 1, 1]; // read-only 0-1, 0-1, 0-1
358
+
359
+ this.pickerOnfocus = true; // display picker on focus?
360
+ this.pickerMode = 'HSV'; // HSV | HVS
361
+ this.pickerPosition = 'bottom'; // left | right | top | bottom
362
+ this.pickerFace = 10; // px
363
+ this.pickerFaceColor = 'ThreeDFace'; // CSS color
364
+ this.pickerBorder = 1; // px
365
+ this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight'; // CSS color
366
+ this.pickerInset = 1; // px
367
+ this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow'; // CSS color
368
+ this.pickerZIndex = 10000;
369
+
370
+
371
+ for(var p in prop) {
372
+ if(prop.hasOwnProperty(p)) {
373
+ this[p] = prop[p];
374
+ }
375
+ }
376
+
377
+
378
+ this.hidePicker = function() {
379
+ if(isPickerOwner()) {
380
+ removePicker();
381
+ }
382
+ };
383
+
384
+
385
+ this.showPicker = function() {
386
+ if(!isPickerOwner()) {
387
+ var tp = jscolor.getElementPos(target); // target pos
388
+ var ts = jscolor.getElementSize(target); // target size
389
+ var vp = jscolor.getViewPos(); // view pos
390
+ var vs = jscolor.getViewSize(); // view size
391
+ var ps = [ // picker size
392
+ 2*this.pickerBorder + 4*this.pickerInset + 2*this.pickerFace + jscolor.images.pad[0] + 2*jscolor.images.arrow[0] + jscolor.images.sld[0],
393
+ 2*this.pickerBorder + 2*this.pickerInset + 2*this.pickerFace + jscolor.images.pad[1]
394
+ ];
395
+ var a, b, c;
396
+ switch(this.pickerPosition.toLowerCase()) {
397
+ case 'left':a=1;b=0;c=-1;break;
398
+ case 'right':a=1;b=0;c=1;break;
399
+ case 'top':a=0;b=1;c=-1;break;
400
+ default:a=0;b=1;c=1;break;
401
+ }
402
+ var l = (ts[b]+ps[b])/2;
403
+ var pp = [ // picker pos
404
+ -vp[a]+tp[a]+ps[a] > vs[a] ?
405
+ (-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) :
406
+ tp[a],
407
+ -vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ?
408
+ (-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) :
409
+ (tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c)
410
+ ];
411
+ drawPicker(pp[a], pp[b]);
412
+ }
413
+ };
414
+
415
+
416
+ this.importColor = function() {
417
+ if(!valueElement) {
418
+ this.exportColor();
419
+ } else {
420
+ if(!this.adjust) {
421
+ if(!this.fromString(valueElement.value, leaveValue)) {
422
+ styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
423
+ styleElement.style.color = styleElement.jscStyle.color;
424
+ this.exportColor(leaveValue | leaveStyle);
425
+ }
426
+ } else if(!this.required && /^\s*$/.test(valueElement.value)) {
427
+ valueElement.value = '';
428
+ styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
429
+ styleElement.style.color = styleElement.jscStyle.color;
430
+ this.exportColor(leaveValue | leaveStyle);
431
+
432
+ } else if(this.fromString(valueElement.value)) {
433
+ // OK
434
+ } else {
435
+ this.exportColor();
436
+ }
437
+ }
438
+ };
439
+
440
+
441
+ this.exportColor = function(flags) {
442
+ if(!(flags & leaveValue) && valueElement) {
443
+ var value = this.toString();
444
+ if(this.caps) {value = value.toUpperCase();}
445
+ if(this.hash) {value = '#'+value;}
446
+ valueElement.value = value;
447
+ }
448
+ if(!(flags & leaveStyle) && styleElement) {
449
+ styleElement.style.backgroundColor =
450
+ '#'+this.toString();
451
+ styleElement.style.color =
452
+ 0.213 * this.rgb[0] +
453
+ 0.715 * this.rgb[1] +
454
+ 0.072 * this.rgb[2]
455
+ < 0.5 ? '#FFF' : '#000';
456
+ }
457
+ if(!(flags & leavePad) && isPickerOwner()) {
458
+ redrawPad();
459
+ }
460
+ if(!(flags & leaveSld) && isPickerOwner()) {
461
+ redrawSld();
462
+ }
463
+ };
464
+
465
+
466
+ this.fromHSV = function(h, s, v, flags) { // null = don't change
467
+ h<0 && (h=0) || h>6 && (h=6);
468
+ s<0 && (s=0) || s>1 && (s=1);
469
+ v<0 && (v=0) || v>1 && (v=1);
470
+ this.rgb = HSV_RGB(
471
+ h===null ? this.hsv[0] : (this.hsv[0]=h),
472
+ s===null ? this.hsv[1] : (this.hsv[1]=s),
473
+ v===null ? this.hsv[2] : (this.hsv[2]=v)
474
+ );
475
+ this.exportColor(flags);
476
+ };
477
+
478
+
479
+ this.fromRGB = function(r, g, b, flags) { // null = don't change
480
+ r<0 && (r=0) || r>1 && (r=1);
481
+ g<0 && (g=0) || g>1 && (g=1);
482
+ b<0 && (b=0) || b>1 && (b=1);
483
+ var hsv = RGB_HSV(
484
+ r===null ? this.rgb[0] : (this.rgb[0]=r),
485
+ g===null ? this.rgb[1] : (this.rgb[1]=g),
486
+ b===null ? this.rgb[2] : (this.rgb[2]=b)
487
+ );
488
+ if(hsv[0] !== null) {
489
+ this.hsv[0] = hsv[0];
490
+ }
491
+ if(hsv[2] !== 0) {
492
+ this.hsv[1] = hsv[1];
493
+ }
494
+ this.hsv[2] = hsv[2];
495
+ this.exportColor(flags);
496
+ };
497
+
498
+
499
+ this.fromString = function(hex, flags) {
500
+ var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);
501
+ if(!m) {
502
+ return false;
503
+ } else {
504
+ if(m[1].length === 6) { // 6-char notation
505
+ this.fromRGB(
506
+ parseInt(m[1].substr(0,2),16) / 255,
507
+ parseInt(m[1].substr(2,2),16) / 255,
508
+ parseInt(m[1].substr(4,2),16) / 255,
509
+ flags
510
+ );
511
+ } else { // 3-char notation
512
+ this.fromRGB(
513
+ parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255,
514
+ parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255,
515
+ parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255,
516
+ flags
517
+ );
518
+ }
519
+ return true;
520
+ }
521
+ };
522
+
523
+
524
+ this.toString = function() {
525
+ return (
526
+ (0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) +
527
+ (0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) +
528
+ (0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1)
529
+ );
530
+ };
531
+
532
+
533
+ function RGB_HSV(r, g, b) {
534
+ var n = Math.min(Math.min(r,g),b);
535
+ var v = Math.max(Math.max(r,g),b);
536
+ var m = v - n;
537
+ if(m === 0) {return [ null, 0, v ];}
538
+ var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);
539
+ return [ h===6?0:h, m/v, v ];
540
+ }
541
+
542
+
543
+ function HSV_RGB(h, s, v) {
544
+ if(h === null) {return [ v, v, v ];}
545
+ var i = Math.floor(h);
546
+ var f = i%2 ? h-i : 1-(h-i);
547
+ var m = v * (1 - s);
548
+ var n = v * (1 - s*f);
549
+ switch(i) {
550
+ case 6:
551
+ case 0:return [v,n,m];
552
+ case 1:return [n,v,m];
553
+ case 2:return [m,v,n];
554
+ case 3:return [m,n,v];
555
+ case 4:return [n,m,v];
556
+ case 5:return [v,m,n];
557
+ }
558
+ }
559
+
560
+
561
+ function removePicker() {
562
+ delete jscolor.picker.owner;
563
+ document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB);
564
+ }
565
+
566
+
567
+ function drawPicker(x, y) {
568
+ if(!jscolor.picker) {
569
+ jscolor.picker = {
570
+ box : document.createElement('div'),
571
+ boxB : document.createElement('div'),
572
+ pad : document.createElement('div'),
573
+ padB : document.createElement('div'),
574
+ padM : document.createElement('div'),
575
+ sld : document.createElement('div'),
576
+ sldB : document.createElement('div'),
577
+ sldM : document.createElement('div')
578
+ };
579
+ for(var i=0,segSize=4; i<jscolor.images.sld[1]; i+=segSize) {
580
+ var seg = document.createElement('div');
581
+ seg.style.height = segSize+'px';
582
+ seg.style.fontSize = '1px';
583
+ seg.style.lineHeight = '0';
584
+ jscolor.picker.sld.appendChild(seg);
585
+ }
586
+ jscolor.picker.sldB.appendChild(jscolor.picker.sld);
587
+ jscolor.picker.box.appendChild(jscolor.picker.sldB);
588
+ jscolor.picker.box.appendChild(jscolor.picker.sldM);
589
+ jscolor.picker.padB.appendChild(jscolor.picker.pad);
590
+ jscolor.picker.box.appendChild(jscolor.picker.padB);
591
+ jscolor.picker.box.appendChild(jscolor.picker.padM);
592
+ jscolor.picker.boxB.appendChild(jscolor.picker.box);
593
+ }
594
+
595
+ var p = jscolor.picker;
596
+
597
+ // recompute controls positions
598
+ posPad = [
599
+ x+THIS.pickerBorder+THIS.pickerFace+THIS.pickerInset,
600
+ y+THIS.pickerBorder+THIS.pickerFace+THIS.pickerInset ];
601
+ posSld = [
602
+ null,
603
+ y+THIS.pickerBorder+THIS.pickerFace+THIS.pickerInset ];
604
+
605
+ // controls interaction
606
+ p.box.onmouseup =
607
+ p.box.onmouseout = function() {target.focus();};
608
+ p.box.onmousedown = function() {abortBlur=true;};
609
+ p.box.onmousemove = function(e) {holdPad && setPad(e);holdSld && setSld(e);};
610
+ p.padM.onmouseup =
611
+ p.padM.onmouseout = function() {if(holdPad) {holdPad=false;jscolor.fireEvent(valueElement,'change');}};
612
+ p.padM.onmousedown = function(e) {holdPad=true;setPad(e);};
613
+ p.sldM.onmouseup =
614
+ p.sldM.onmouseout = function() {if(holdSld) {holdSld=false;jscolor.fireEvent(valueElement,'change');}};
615
+ p.sldM.onmousedown = function(e) {holdSld=true;setSld(e);};
616
+
617
+ // picker
618
+ p.box.style.width = 4*THIS.pickerInset + 2*THIS.pickerFace + jscolor.images.pad[0] + 2*jscolor.images.arrow[0] + jscolor.images.sld[0] + 'px';
619
+ p.box.style.height = 2*THIS.pickerInset + 2*THIS.pickerFace + jscolor.images.pad[1] + 'px';
620
+
621
+ // picker border
622
+ p.boxB.style.position = 'absolute';
623
+ p.boxB.style.clear = 'both';
624
+ p.boxB.style.left = x+'px';
625
+ p.boxB.style.top = y+'px';
626
+ p.boxB.style.zIndex = THIS.pickerZIndex;
627
+ p.boxB.style.border = THIS.pickerBorder+'px solid';
628
+ p.boxB.style.borderColor = THIS.pickerBorderColor;
629
+ p.boxB.style.background = THIS.pickerFaceColor;
630
+
631
+ // pad image
632
+ p.pad.style.width = jscolor.images.pad[0]+'px';
633
+ p.pad.style.height = jscolor.images.pad[1]+'px';
634
+
635
+ // pad border
636
+ p.padB.style.position = 'absolute';
637
+ p.padB.style.left = THIS.pickerFace+'px';
638
+ p.padB.style.top = THIS.pickerFace+'px';
639
+ p.padB.style.border = THIS.pickerInset+'px solid';
640
+ p.padB.style.borderColor = THIS.pickerInsetColor;
641
+
642
+ // pad mouse area
643
+ p.padM.style.position = 'absolute';
644
+ p.padM.style.left = '0';
645
+ p.padM.style.top = '0';
646
+ p.padM.style.width = THIS.pickerFace + 2*THIS.pickerInset + jscolor.images.pad[0] + jscolor.images.arrow[0] + 'px';
647
+ p.padM.style.height = p.box.style.height;
648
+ p.padM.style.cursor = 'crosshair';
649
+
650
+ // slider image
651
+ p.sld.style.overflow = 'hidden';
652
+ p.sld.style.width = jscolor.images.sld[0]+'px';
653
+ p.sld.style.height = jscolor.images.sld[1]+'px';
654
+
655
+ // slider border
656
+ p.sldB.style.position = 'absolute';
657
+ p.sldB.style.right = THIS.pickerFace+'px';
658
+ p.sldB.style.top = THIS.pickerFace+'px';
659
+ p.sldB.style.border = THIS.pickerInset+'px solid';
660
+ p.sldB.style.borderColor = THIS.pickerInsetColor;
661
+
662
+ // slider mouse area
663
+ p.sldM.style.position = 'absolute';
664
+ p.sldM.style.right = '0';
665
+ p.sldM.style.top = '0';
666
+ p.sldM.style.width = jscolor.images.sld[0] + jscolor.images.arrow[0] + THIS.pickerFace + 2*THIS.pickerInset + 'px';
667
+ p.sldM.style.height = p.box.style.height;
668
+ try {
669
+ p.sldM.style.cursor = 'pointer';
670
+ } catch(eOldIE) {
671
+ p.sldM.style.cursor = 'hand';
672
+ }
673
+
674
+ // load images in optimal order
675
+ switch(modeID) {
676
+ case 0:var padImg = 'hs.png';break;
677
+ case 1:var padImg = 'hv.png';break;
678
+ }
679
+ p.padM.style.background = "url('"+jscolor.getDir()+"cross.gif') no-repeat";
680
+ p.sldM.style.background = "url('"+jscolor.getDir()+"arrow.gif') no-repeat";
681
+ p.pad.style.background = "url('"+jscolor.getDir()+padImg+"') 0 0 no-repeat";
682
+
683
+ // place pointers
684
+ redrawPad();
685
+ redrawSld();
686
+
687
+ jscolor.picker.owner = THIS;
688
+ document.getElementsByTagName('body')[0].appendChild(p.boxB);
689
+ }
690
+
691
+
692
+ function redrawPad() {
693
+ // redraw the pad pointer
694
+ switch(modeID) {
695
+ case 0:var yComponent = 1;break;
696
+ case 1:var yComponent = 2;break;
697
+ }
698
+ var x = Math.round((THIS.hsv[0]/6) * (jscolor.images.pad[0]-1));
699
+ var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.pad[1]-1));
700
+ jscolor.picker.padM.style.backgroundPosition =
701
+ (THIS.pickerFace+THIS.pickerInset+x - Math.floor(jscolor.images.cross[0]/2)) + 'px ' +
702
+ (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.cross[1]/2)) + 'px';
703
+
704
+ // redraw the slider image
705
+ var seg = jscolor.picker.sld.childNodes;
706
+
707
+ switch(modeID) {
708
+ case 0:
709
+ var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1);
710
+ for(var i=0; i<seg.length; i+=1) {
711
+ seg[i].style.backgroundColor = 'rgb('+
712
+ (rgb[0]*(1-i/seg.length)*100)+'%,'+
713
+ (rgb[1]*(1-i/seg.length)*100)+'%,'+
714
+ (rgb[2]*(1-i/seg.length)*100)+'%)';
715
+ }
716
+ break;
717
+ case 1:
718
+ var rgb, s, c = [ THIS.hsv[2], 0, 0 ];
719
+ var i = Math.floor(THIS.hsv[0]);
720
+ var f = i%2 ? THIS.hsv[0]-i : 1-(THIS.hsv[0]-i);
721
+ switch(i) {
722
+ case 6:
723
+ case 0:rgb=[0,1,2];break;
724
+ case 1:rgb=[1,0,2];break;
725
+ case 2:rgb=[2,0,1];break;
726
+ case 3:rgb=[2,1,0];break;
727
+ case 4:rgb=[1,2,0];break;
728
+ case 5:rgb=[0,2,1];break;
729
+ }
730
+ for(var i=0; i<seg.length; i+=1) {
731
+ s = 1 - 1/(seg.length-1)*i;
732
+ c[1] = c[0] * (1 - s*f);
733
+ c[2] = c[0] * (1 - s);
734
+ seg[i].style.backgroundColor = 'rgb('+
735
+ (c[rgb[0]]*100)+'%,'+
736
+ (c[rgb[1]]*100)+'%,'+
737
+ (c[rgb[2]]*100)+'%)';
738
+ }
739
+ break;
740
+ }
741
+ }
742
+
743
+
744
+ function redrawSld() {
745
+ // redraw the slider pointer
746
+ switch(modeID) {
747
+ case 0:var yComponent = 2;break;
748
+ case 1:var yComponent = 1;break;
749
+ }
750
+ var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.sld[1]-1));
751
+ jscolor.picker.sldM.style.backgroundPosition =
752
+ '0 ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.arrow[1]/2)) + 'px';
753
+ }
754
+
755
+
756
+ function isPickerOwner() {
757
+ return jscolor.picker && jscolor.picker.owner === THIS;
758
+ }
759
+
760
+
761
+ function blurTarget() {
762
+ if(valueElement === target) {
763
+ THIS.importColor();
764
+ }
765
+ if(THIS.pickerOnfocus) {
766
+ THIS.hidePicker();
767
+ }
768
+ }
769
+
770
+
771
+ function blurValue() {
772
+ if(valueElement !== target) {
773
+ THIS.importColor();
774
+ }
775
+ }
776
+
777
+
778
+ function setPad(e) {
779
+ var posM = jscolor.getMousePos(e);
780
+ var x = posM[0]-posPad[0];
781
+ var y = posM[1]-posPad[1];
782
+ switch(modeID) {
783
+ case 0:THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), 1 - y/(jscolor.images.pad[1]-1), null, leaveSld);break;
784
+ case 1:THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), null, 1 - y/(jscolor.images.pad[1]-1), leaveSld);break;
785
+ }
786
+ }
787
+
788
+
789
+ function setSld(e) {
790
+ var posM = jscolor.getMousePos(e);
791
+ var y = posM[1]-posPad[1];
792
+ switch(modeID) {
793
+ case 0:THIS.fromHSV(null, null, 1 - y/(jscolor.images.sld[1]-1), leavePad);break;
794
+ case 1:THIS.fromHSV(null, 1 - y/(jscolor.images.sld[1]-1), null, leavePad);break;
795
+ }
796
+ }
797
+
798
+
799
+ var THIS = this;
800
+ var modeID = this.pickerMode.toLowerCase()==='hvs' ? 1 : 0;
801
+ var abortBlur = false;
802
+ var
803
+ valueElement = jscolor.fetchElement(this.valueElement),
804
+ styleElement = jscolor.fetchElement(this.styleElement);
805
+ var
806
+ holdPad = false,
807
+ holdSld = false;
808
+ var
809
+ posPad,
810
+ posSld;
811
+ var
812
+ leaveValue = 1<<0,
813
+ leaveStyle = 1<<1,
814
+ leavePad = 1<<2,
815
+ leaveSld = 1<<3;
816
+
817
+ // target
818
+ jscolor.addEvent(target, 'focus', function() {
819
+ if(THIS.pickerOnfocus) {THIS.showPicker();}
820
+ });
821
+ jscolor.addEvent(target, 'blur', function() {
822
+ if(!abortBlur) {
823
+ window.setTimeout(function(){abortBlur || blurTarget();abortBlur=false;}, 0);
824
+ } else {
825
+ abortBlur = false;
826
+ }
827
+ });
828
+
829
+ // valueElement
830
+ if(valueElement) {
831
+ var updateField = function() {
832
+ THIS.fromString(valueElement.value, leaveValue);
833
+ };
834
+ jscolor.addEvent(valueElement, 'keyup', updateField);
835
+ jscolor.addEvent(valueElement, 'input', updateField);
836
+ jscolor.addEvent(valueElement, 'blur', blurValue);
837
+ valueElement.setAttribute('autocomplete', 'off');
838
+ }
839
+
840
+ // styleElement
841
+ if(styleElement) {
842
+ styleElement.jscStyle = {
843
+ backgroundColor : styleElement.style.backgroundColor,
844
+ color : styleElement.style.color
845
+ };
846
+ }
847
+
848
+ // require images
849
+ switch(modeID) {
850
+ case 0:jscolor.requireImage('hs.png');break;
851
+ case 1:jscolor.requireImage('hv.png');break;
852
+ }
853
+ jscolor.requireImage('cross.gif');
854
+ jscolor.requireImage('arrow.gif');
855
+
856
+ this.importColor();
857
+ }
858
+
859
+ };
860
+
861
+
862
+ jscolor.install();
863
+ //jscolor.noConflict();
js/timer.js ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Contus Support Interactive.
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the EULA
7
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
8
+ *
9
+ * =================================================================
10
+ * MAGENTO EDITION USAGE NOTICE
11
+ * =================================================================
12
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
13
+ * Contus Support does not guarantee correct work of this package
14
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
15
+ * =================================================================
16
+ */
17
+
18
+ var j =1;
19
+ if (typeof(BackColor)=="undefined")
20
+ BackColor = "white";
21
+ if (typeof(ForeColor)=="undefined")
22
+ ForeColor= "black";
23
+ if (typeof(DisplayFormat)=="undefined")
24
+ DisplayFormat = "<span class='day'>%%D%%</span><span style='margin:0px 4px'>:</span><span class='hour'>%%H%%</span><span style='margin:0px 4px'>:</span><span class='min'>%%M%%</span><span style='margin:0px 4px'>:</span><span class='sec'>%%S%%</span>";
25
+ if (typeof(CountActive)=="undefined")
26
+ CountActive = true;
27
+ if (typeof(FinishMessage)=="undefined")
28
+ FinishMessage = "";
29
+ if (typeof(CountStepper)!="number")
30
+ CountStepper = -1;
31
+ if (typeof(LeadingZero)=="undefined")
32
+ LeadingZero = true;
33
+ CountStepper = Math.ceil(CountStepper);
34
+ if (CountStepper == 0)
35
+ CountActive = false;
36
+ var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990;
37
+ function calcage(secs, num1, num2) {
38
+ s = ((Math.floor(secs/num1)%num2)).toString();
39
+ if (LeadingZero && s.length < 2)
40
+ s = "0" + s;
41
+ return "<b>" + s + "</b>";
42
+ }
43
+ function CountBack(secs,iid,j) {
44
+ if (secs < 0) {
45
+ document.getElementById(iid).innerHTML = FinishMessage;
46
+ document.getElementById('caption'+j).style.display = "none";
47
+ document.getElementById('heading'+j).style.display = "none";
48
+ return;
49
+ }
50
+ DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage(secs,86400,100000));
51
+ DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs,3600,24));
52
+ DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs,60,60));
53
+ DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs,1,60));
54
+ document.getElementById(iid).innerHTML = DisplayStr;
55
+ if (CountActive)
56
+ setTimeout(function(){CountBack((secs+CountStepper),iid,j)}, SetTimeOutPeriod);
57
+ }
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Price_Countdown</name>
4
+ <version>1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Countdown timer for Special product price to date. Timer displays according to the special price and to date set while adding products.</summary>
10
+ <description>Countdown timer for Special product price to date. Timer displays according to the special price and to date set while adding products.</description>
11
+ <notes>Countdown timer for Special product price to date. Timer displays according to the special price and to date set while adding products.</notes>
12
+ <authors><author><name>Apptha</name><user>auto-converted</user><email>info@apptha.com</email></author></authors>
13
+ <date>2011-08-13</date>
14
+ <time>00:37:27</time>
15
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="timer.xml" hash="922bab7b8ef9783a71da8af3a4d1586b"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="timer.xml" hash="af09b5d00b40016eafa4d74282103231"/></dir><dir name="template"><dir name="facebooklb"><file name="head.phtml" hash="061d3cb23d09c4fcbafd5db8658f3137"/><file name="like.phtml" hash="f6b89000f9ad76b9ef3ad8af769a7fa7"/></dir><dir name="gr"><dir name="deepzoom"><dir name="product"><dir name="view"><file name="media.phtml" hash="a7295b823ccacd8f9aa5321e2274dc11"/></dir><dir name="widget"><file name="gallery.phtml" hash="d04b40979393bc22ab8ecb2928dd0d07"/><file name="image.phtml" hash="394103e979e84f71cbd9582ef4597c8d"/></dir></dir></dir></dir><dir name="smoovpay"><file name="blank.phtml" hash="b575084988786791231ade3d18a5e7a1"/><file name="cancel.phtml" hash="7c166c97981b7dc478cf303a42a9f3cd"/><file name="failure.phtml" hash="9f1a043a25281f2ed2000a996105d902"/><file name="form.phtml" hash="f7209aec22f6ce9041035b972aac33f8"/><file name="info.phtml" hash="38925077734f5f51f0f71c6ad37d6b39"/><file name="redirect.phtml" hash="dc982bcc3bfe42c37c5418a6a1d35360"/></dir><dir name="timer"><file name="list.phtml" hash="d6167b4526883ce0cf7547e6ebb980dc"/><file name="view.phtml" hash="ac729282ef95ae536ccaec6c0163b07b"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Apptha"><dir name="Timer"><dir name="Block"><file name="Compare.php" hash="67a2dcb24788f98669928cb4e053c12d"/><file name="List.php" hash="0eec8b05238b8c1fb3d6c5e9b36ba0f2"/><file name="View.php" hash="cb9ef6d51f81a5e19a5bf0f1a5ced057"/><dir name="Adminhtml"><file name="Timer.php" hash="41e15898f393910176531c7a402924d6"/><dir name="Timer"><file name="Edit.php" hash="328ae3312a3a27580f3ceec0f1e3d1a9"/><file name="Grid.php" hash="4c3285d41d3d2bc36d3e14381adaf2fb"/><dir name="Edit"><file name="Form.php" hash="8dbc637bb22b48db386712782c7f57f5"/><file name="Tabs.php" hash="8d1b3b2c1753f85109104fa17a7e9178"/><dir name="Tab"><file name="Form.php" hash="e52b4fbfa7b6591daca75000ff62d26f"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="df0410bbc702e03dc132e7885a77906b"/><dir name="Adminhtml"><file name="TimerController.php" hash="da8e47f527a9dbaca6aaf1ea14d9469b"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="9e49c3217738110eb53f6f074f5e1b4c"/><file name="config.xml" hash="a5ac52a8e49c6ff21b52b45d92f53c79"/><file name="system.xml" hash="b03b62de7cc6e0e778a61afa4b426471"/></dir><dir name="Helper"><file name="Data.php" hash="90aab09e0601a4b9979787fb07f4ac43"/></dir><dir name="Model"><file name="Status.php" hash="b0979e8ee08fa38288981a620fff0289"/><file name="Timer.php" hash="a892cf13e30d46305701665c4093cfd2"/><dir name="Mysql4"><file name="Timer.php" hash="24a37d8b83b13d8c74bfaacf8e5eb46c"/><dir name="Timer"><file name="Collection.php" hash="92d0e9389d7876f5706a7dadf076705e"/></dir></dir></dir><dir name="sql"><dir name="timer_setup"><file name="mysql4-install-0.1.0.php" hash="ca197db87139585fba35d472a5af60f5"/></dir></dir></dir></dir><dir name="Mage"><dir name="Adminhtml"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Caption.php" hash="0ef33d4dcfc139788f56e500cfe2a4a4"/><file name="Heading.php" hash="de0d7e340af16af42416369657c7f202"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="timer"><file name="timer.css" hash="d708dd99a8bfba68149cbb5d8ca9a5e9"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="jscolor"><file name="arrow.gif" hash="5034704a76cd55c1cbcbc58ea6bf523f"/><file name="cross.gif" hash="ba9a274b9323753cd95bc3b1eb2f4e5f"/><file name="demo.html" hash="edf71251cb2be20322d2efb00aee86a6"/><file name="hs.png" hash="fefa1a03d92ebad25c88dca94a0b63db"/><file name="hv.png" hash="990d71cada17da100653636cf8490884"/><file name="jscolor.js" hash="40781563e36d1f1df99a2b5c8e0ef9bf"/><file name="Thumbs.db" hash="b1f50deafceb1febfcf05103758e03a6"/></dir><file name="timer.js" hash="4f709d357b0d7863a2b4fc2d95596a8b"/></dir></target><target name="mageetc"><dir name="modules"><file name="Apptha_Timer.xml" hash="ede273b6645782b3d3953e6ea604dbce"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>
skin/frontend/default/default/timer/timer.css ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Contus Support Interactive.
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the EULA
7
+ * that is bundled with this package in the file PRICE COUNTDOWN-LICENSE.txt.
8
+ *
9
+ * =================================================================
10
+ * MAGENTO EDITION USAGE NOTICE
11
+ * =================================================================
12
+ * This package designed for Magento 1.4.x and 1.5.x COMMUNITY edition
13
+ * Contus Support does not guarantee correct work of this package
14
+ * on any other Magento edition except Magento 1.4.x and 1.5.x COMMUNITY edition.
15
+ * =================================================================
16
+ */
17
+
18
+ .timer-grid{float: left;width: 100%;padding: 3px 0 0 0;color: #000000;font-size: 18px;font-family: arial; font-weight: bold;}
19
+ .timer-list{float: left;width: 100%;padding: 0;color: #000000;font-size: 18px;font-family: arial; font-weight: bold;}
20
+ .timer-view{float: left;width: 100%;padding:2px 0 0 0px;color: #000000;font-size: 40px; font-family:arial;font-weight: bold;}
21
+ .timer-view .day{margin:1px 1px}
22
+ .timer-view .hour{margin:1px 1px}
23
+ .timer-view .min{margin:1px 1px}
24
+ .timer-view .sec{margin:1px 1px}
25
+ .timer-compare{float: left;width: 100%;padding: 0;color: #000000;font-size: 22px;font-family: arial; font-weight: bold;}
26
+ .timerspec{float: left;width: 100%;color: #1E7EC8;font-size: 13px;}
27
+ .timerdate{float: left;width: 100%;padding:0 0 3px 0;color: #1E7EC8;font-size: 12px;}
28
+ .timerdate .day{margin:1px 1px; width:20px; text-align: center;}
29
+ .timerdate .hour{margin:1px 1px;width:20px; text-align: center;}
30
+ .timerdate .min{margin:1px 1px; width:20px; text-align: center;}
31
+ .timerdate .sec{margin:1px 1px; width:20px; text-align: center;}