Version Notes
Release for econda Web Controlling functions.
Download this release
Release Info
Developer | Magento Core Team |
Extension | Mage_Econda |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/local/Mage/Econda/Block/Adminhtml/Econda.php +12 -0
- app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit.php +45 -0
- app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit/Form.php +19 -0
- app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit/Tab/Form.php +58 -0
- app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit/Tabs.php +24 -0
- app/code/local/Mage/Econda/Block/Adminhtml/Econda/Grid.php +116 -0
- app/code/local/Mage/Econda/Block/Adminhtml/Tracker.php +12 -0
- app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit.php +45 -0
- app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit/Form.php +19 -0
- app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit/Tab/Form.php +58 -0
- app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit/Tabs.php +24 -0
- app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Grid.php +116 -0
- app/code/local/Mage/Econda/Block/Econda.php +642 -0
- app/code/local/Mage/Econda/Block/emos.php +607 -0
- app/code/local/Mage/Econda/Helper/Data.php +6 -0
- app/code/local/Mage/Econda/Language/english.php +46 -0
- app/code/local/Mage/Econda/Language/german.php +46 -0
- app/code/local/Mage/Econda/Model/Econda.php +10 -0
- app/code/local/Mage/Econda/Model/Mysql4/Econda.php +10 -0
- app/code/local/Mage/Econda/Model/Mysql4/Econda/Collection.php +10 -0
- app/code/local/Mage/Econda/Model/Mysql4/Tracker.php +10 -0
- app/code/local/Mage/Econda/Model/Mysql4/Tracker/Collection.php +10 -0
- app/code/local/Mage/Econda/Model/Status.php +15 -0
- app/code/local/Mage/Econda/Model/System/Config/Source/Language.php +34 -0
- app/code/local/Mage/Econda/controllers/Adminhtml/EcondaController.php +214 -0
- app/code/local/Mage/Econda/controllers/Adminhtml/TrackerController.php +214 -0
- app/code/local/Mage/Econda/controllers/IndexController.php +47 -0
- app/code/local/Mage/Econda/etc/config.xml +107 -0
- app/code/local/Mage/Econda/etc/system.xml +61 -0
- app/design/adminhtml/default/default/layout/econda.xml +8 -0
- app/design/frontend/default/default/layout/econda.xml +16 -0
- app/design/frontend/default/default/template/econda/tracker.phtml +9 -0
- app/design/frontend/default/default/template/econda/trackerop.phtml +104 -0
- app/etc/modules/Mage_Econda.xml +9 -0
- app/locale/de_AT/Mage_Econda.csv +3 -0
- app/locale/de_CH/Mage_Econda.csv +3 -0
- app/locale/de_DE/Mage_Econda.csv +3 -0
- app/locale/en_US/Mage_Econda.csv +3 -0
- js/tracker/emosop.js +85 -0
- package.xml +18 -0
app/code/local/Mage/Econda/Block/Adminhtml/Econda.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mage_Econda_Block_Adminhtml_Econda extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_controller = 'adminhtml_econda';
|
7 |
+
$this->_blockGroup = 'econda';
|
8 |
+
$this->_headerText = Mage::helper('econda')->__('Item Manager');
|
9 |
+
$this->_addButtonLabel = Mage::helper('econda')->__('Add Item');
|
10 |
+
parent::__construct();
|
11 |
+
}
|
12 |
+
}
|
app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Block_Adminhtml_Econda_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
|
9 |
+
$this->_objectId = 'id';
|
10 |
+
$this->_blockGroup = 'econda';
|
11 |
+
$this->_controller = 'adminhtml_econda';
|
12 |
+
|
13 |
+
$this->_updateButton('save', 'label', Mage::helper('econda')->__('Save Item'));
|
14 |
+
$this->_updateButton('delete', 'label', Mage::helper('econda')->__('Delete Item'));
|
15 |
+
|
16 |
+
$this->_addButton('saveandcontinue', array(
|
17 |
+
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
18 |
+
'onclick' => 'saveAndContinueEdit()',
|
19 |
+
'class' => 'save',
|
20 |
+
), -100);
|
21 |
+
|
22 |
+
$this->_formScripts[] = "
|
23 |
+
function toggleEditor() {
|
24 |
+
if (tinyMCE.getInstanceById('econda_content') == null) {
|
25 |
+
tinyMCE.execCommand('mceAddControl', false, 'econda_content');
|
26 |
+
} else {
|
27 |
+
tinyMCE.execCommand('mceRemoveControl', false, 'econda_content');
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
function saveAndContinueEdit(){
|
32 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
33 |
+
}
|
34 |
+
";
|
35 |
+
}
|
36 |
+
|
37 |
+
public function getHeaderText()
|
38 |
+
{
|
39 |
+
if( Mage::registry('econda_data') && Mage::registry('econda_data')->getId() ) {
|
40 |
+
return Mage::helper('econda')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('econda_data')->getTitle()));
|
41 |
+
} else {
|
42 |
+
return Mage::helper('econda')->__('Add Item');
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit/Form.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Block_Adminhtml_Econda_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form(array(
|
8 |
+
'id' => 'edit_form',
|
9 |
+
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
10 |
+
'method' => 'post',
|
11 |
+
'enctype' => 'multipart/form-data'
|
12 |
+
)
|
13 |
+
);
|
14 |
+
|
15 |
+
$form->setUseContainer(true);
|
16 |
+
$this->setForm($form);
|
17 |
+
return parent::_prepareForm();
|
18 |
+
}
|
19 |
+
}
|
app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Block_Adminhtml_Econda_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form();
|
8 |
+
$this->setForm($form);
|
9 |
+
$fieldset = $form->addFieldset('econda_form', array('legend'=>Mage::helper('econda')->__('Item information')));
|
10 |
+
|
11 |
+
$fieldset->addField('title', 'text', array(
|
12 |
+
'label' => Mage::helper('econda')->__('Title'),
|
13 |
+
'class' => 'required-entry',
|
14 |
+
'required' => true,
|
15 |
+
'name' => 'title',
|
16 |
+
));
|
17 |
+
|
18 |
+
$fieldset->addField('filename', 'file', array(
|
19 |
+
'label' => Mage::helper('econda')->__('File'),
|
20 |
+
'required' => false,
|
21 |
+
'name' => 'filename',
|
22 |
+
));
|
23 |
+
|
24 |
+
$fieldset->addField('status', 'select', array(
|
25 |
+
'label' => Mage::helper('econda')->__('Status'),
|
26 |
+
'name' => 'status',
|
27 |
+
'values' => array(
|
28 |
+
array(
|
29 |
+
'value' => 1,
|
30 |
+
'label' => Mage::helper('econda')->__('Enabled'),
|
31 |
+
),
|
32 |
+
|
33 |
+
array(
|
34 |
+
'value' => 2,
|
35 |
+
'label' => Mage::helper('econda')->__('Disabled'),
|
36 |
+
),
|
37 |
+
),
|
38 |
+
));
|
39 |
+
|
40 |
+
$fieldset->addField('content', 'editor', array(
|
41 |
+
'name' => 'content',
|
42 |
+
'label' => Mage::helper('econda')->__('Content'),
|
43 |
+
'title' => Mage::helper('econda')->__('Content'),
|
44 |
+
'style' => 'width:700px; height:500px;',
|
45 |
+
'wysiwyg' => false,
|
46 |
+
'required' => true,
|
47 |
+
));
|
48 |
+
|
49 |
+
if ( Mage::getSingleton('adminhtml/session')->getEcondaData() )
|
50 |
+
{
|
51 |
+
$form->setValues(Mage::getSingleton('adminhtml/session')->getEcondaData());
|
52 |
+
Mage::getSingleton('adminhtml/session')->setEcondaData(null);
|
53 |
+
} elseif ( Mage::registry('econda_data') ) {
|
54 |
+
$form->setValues(Mage::registry('econda_data')->getData());
|
55 |
+
}
|
56 |
+
return parent::_prepareForm();
|
57 |
+
}
|
58 |
+
}
|
app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit/Tabs.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Block_Adminhtml_Econda_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
$this->setId('econda_tabs');
|
10 |
+
$this->setDestElementId('edit_form');
|
11 |
+
$this->setTitle(Mage::helper('econda')->__('Item Information'));
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _beforeToHtml()
|
15 |
+
{
|
16 |
+
$this->addTab('form_section', array(
|
17 |
+
'label' => Mage::helper('econda')->__('Item Information'),
|
18 |
+
'title' => Mage::helper('econda')->__('Item Information'),
|
19 |
+
'content' => $this->getLayout()->createBlock('econda/adminhtml_econda_edit_tab_form')->toHtml(),
|
20 |
+
));
|
21 |
+
|
22 |
+
return parent::_beforeToHtml();
|
23 |
+
}
|
24 |
+
}
|
app/code/local/Mage/Econda/Block/Adminhtml/Econda/Grid.php
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Block_Adminhtml_Econda_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('econdaGrid');
|
9 |
+
$this->setDefaultSort('econda_id');
|
10 |
+
$this->setDefaultDir('ASC');
|
11 |
+
$this->setSaveParametersInSession(true);
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _prepareCollection()
|
15 |
+
{
|
16 |
+
$collection = Mage::getModel('econda/econda')->getCollection();
|
17 |
+
$this->setCollection($collection);
|
18 |
+
return parent::_prepareCollection();
|
19 |
+
}
|
20 |
+
|
21 |
+
protected function _prepareColumns()
|
22 |
+
{
|
23 |
+
$this->addColumn('econda_id', array(
|
24 |
+
'header' => Mage::helper('econda')->__('ID'),
|
25 |
+
'align' =>'right',
|
26 |
+
'width' => '50px',
|
27 |
+
'index' => 'econda_id',
|
28 |
+
));
|
29 |
+
|
30 |
+
$this->addColumn('title', array(
|
31 |
+
'header' => Mage::helper('econda')->__('Title'),
|
32 |
+
'align' =>'left',
|
33 |
+
'index' => 'title',
|
34 |
+
));
|
35 |
+
|
36 |
+
/*
|
37 |
+
$this->addColumn('content', array(
|
38 |
+
'header' => Mage::helper('econda')->__('Item Content'),
|
39 |
+
'width' => '150px',
|
40 |
+
'index' => 'content',
|
41 |
+
));
|
42 |
+
*/
|
43 |
+
|
44 |
+
$this->addColumn('status', array(
|
45 |
+
'header' => Mage::helper('econda')->__('Status'),
|
46 |
+
'align' => 'left',
|
47 |
+
'width' => '80px',
|
48 |
+
'index' => 'status',
|
49 |
+
'type' => 'options',
|
50 |
+
'options' => array(
|
51 |
+
1 => 'Enabled',
|
52 |
+
2 => 'Disabled',
|
53 |
+
),
|
54 |
+
));
|
55 |
+
|
56 |
+
$this->addColumn('action',
|
57 |
+
array(
|
58 |
+
'header' => Mage::helper('econda')->__('Action'),
|
59 |
+
'width' => '100',
|
60 |
+
'type' => 'action',
|
61 |
+
'getter' => 'getId',
|
62 |
+
'actions' => array(
|
63 |
+
array(
|
64 |
+
'caption' => Mage::helper('econda')->__('Edit'),
|
65 |
+
'url' => array('base'=> '*/*/edit'),
|
66 |
+
'field' => 'id'
|
67 |
+
)
|
68 |
+
),
|
69 |
+
'filter' => false,
|
70 |
+
'sortable' => false,
|
71 |
+
'index' => 'stores',
|
72 |
+
'is_system' => true,
|
73 |
+
));
|
74 |
+
|
75 |
+
$this->addExportType('*/*/exportCsv', Mage::helper('econda')->__('CSV'));
|
76 |
+
$this->addExportType('*/*/exportXml', Mage::helper('econda')->__('XML'));
|
77 |
+
|
78 |
+
return parent::_prepareColumns();
|
79 |
+
}
|
80 |
+
|
81 |
+
protected function _prepareMassaction()
|
82 |
+
{
|
83 |
+
$this->setMassactionIdField('econda_id');
|
84 |
+
$this->getMassactionBlock()->setFormFieldName('econda');
|
85 |
+
|
86 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
87 |
+
'label' => Mage::helper('econda')->__('Delete'),
|
88 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
89 |
+
'confirm' => Mage::helper('econda')->__('Are you sure?')
|
90 |
+
));
|
91 |
+
|
92 |
+
$statuses = Mage::getSingleton('econda/status')->getOptionArray();
|
93 |
+
|
94 |
+
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
95 |
+
$this->getMassactionBlock()->addItem('status', array(
|
96 |
+
'label'=> Mage::helper('econda')->__('Change status'),
|
97 |
+
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
98 |
+
'additional' => array(
|
99 |
+
'visibility' => array(
|
100 |
+
'name' => 'status',
|
101 |
+
'type' => 'select',
|
102 |
+
'class' => 'required-entry',
|
103 |
+
'label' => Mage::helper('econda')->__('Status'),
|
104 |
+
'values' => $statuses
|
105 |
+
)
|
106 |
+
)
|
107 |
+
));
|
108 |
+
return $this;
|
109 |
+
}
|
110 |
+
|
111 |
+
public function getRowUrl($row)
|
112 |
+
{
|
113 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
114 |
+
}
|
115 |
+
|
116 |
+
}
|
app/code/local/Mage/Econda/Block/Adminhtml/Tracker.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mage_Econda_Block_Adminhtml_Tracker extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_controller = 'adminhtml_tracker';
|
7 |
+
$this->_blockGroup = 'tracker';
|
8 |
+
$this->_headerText = Mage::helper('tracker')->__('Item Manager');
|
9 |
+
$this->_addButtonLabel = Mage::helper('tracker')->__('Add Item');
|
10 |
+
parent::__construct();
|
11 |
+
}
|
12 |
+
}
|
app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Block_Adminhtml_Tracker_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
|
9 |
+
$this->_objectId = 'id';
|
10 |
+
$this->_blockGroup = 'tracker';
|
11 |
+
$this->_controller = 'adminhtml_tracker';
|
12 |
+
|
13 |
+
$this->_updateButton('save', 'label', Mage::helper('tracker')->__('Save Item'));
|
14 |
+
$this->_updateButton('delete', 'label', Mage::helper('tracker')->__('Delete Item'));
|
15 |
+
|
16 |
+
$this->_addButton('saveandcontinue', array(
|
17 |
+
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
18 |
+
'onclick' => 'saveAndContinueEdit()',
|
19 |
+
'class' => 'save',
|
20 |
+
), -100);
|
21 |
+
|
22 |
+
$this->_formScripts[] = "
|
23 |
+
function toggleEditor() {
|
24 |
+
if (tinyMCE.getInstanceById('tracker_content') == null) {
|
25 |
+
tinyMCE.execCommand('mceAddControl', false, 'tracker_content');
|
26 |
+
} else {
|
27 |
+
tinyMCE.execCommand('mceRemoveControl', false, 'tracker_content');
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
function saveAndContinueEdit(){
|
32 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
33 |
+
}
|
34 |
+
";
|
35 |
+
}
|
36 |
+
|
37 |
+
public function getHeaderText()
|
38 |
+
{
|
39 |
+
if( Mage::registry('tracker_data') && Mage::registry('tracker_data')->getId() ) {
|
40 |
+
return Mage::helper('tracker')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('tracker_data')->getTitle()));
|
41 |
+
} else {
|
42 |
+
return Mage::helper('tracker')->__('Add Item');
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit/Form.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Block_Adminhtml_Tracker_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form(array(
|
8 |
+
'id' => 'edit_form',
|
9 |
+
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
10 |
+
'method' => 'post',
|
11 |
+
'enctype' => 'multipart/form-data'
|
12 |
+
)
|
13 |
+
);
|
14 |
+
|
15 |
+
$form->setUseContainer(true);
|
16 |
+
$this->setForm($form);
|
17 |
+
return parent::_prepareForm();
|
18 |
+
}
|
19 |
+
}
|
app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Block_Adminhtml_Tracker_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form();
|
8 |
+
$this->setForm($form);
|
9 |
+
$fieldset = $form->addFieldset('tracker_form', array('legend'=>Mage::helper('tracker')->__('Item information')));
|
10 |
+
|
11 |
+
$fieldset->addField('title', 'text', array(
|
12 |
+
'label' => Mage::helper('tracker')->__('Title'),
|
13 |
+
'class' => 'required-entry',
|
14 |
+
'required' => true,
|
15 |
+
'name' => 'title',
|
16 |
+
));
|
17 |
+
|
18 |
+
$fieldset->addField('filename', 'file', array(
|
19 |
+
'label' => Mage::helper('tracker')->__('File'),
|
20 |
+
'required' => false,
|
21 |
+
'name' => 'filename',
|
22 |
+
));
|
23 |
+
|
24 |
+
$fieldset->addField('status', 'select', array(
|
25 |
+
'label' => Mage::helper('tracker')->__('Status'),
|
26 |
+
'name' => 'status',
|
27 |
+
'values' => array(
|
28 |
+
array(
|
29 |
+
'value' => 1,
|
30 |
+
'label' => Mage::helper('tracker')->__('Enabled'),
|
31 |
+
),
|
32 |
+
|
33 |
+
array(
|
34 |
+
'value' => 2,
|
35 |
+
'label' => Mage::helper('tracker')->__('Disabled'),
|
36 |
+
),
|
37 |
+
),
|
38 |
+
));
|
39 |
+
|
40 |
+
$fieldset->addField('content', 'editor', array(
|
41 |
+
'name' => 'content',
|
42 |
+
'label' => Mage::helper('tracker')->__('Content'),
|
43 |
+
'title' => Mage::helper('tracker')->__('Content'),
|
44 |
+
'style' => 'width:700px; height:500px;',
|
45 |
+
'wysiwyg' => false,
|
46 |
+
'required' => true,
|
47 |
+
));
|
48 |
+
|
49 |
+
if ( Mage::getSingleton('adminhtml/session')->getTrackerData() )
|
50 |
+
{
|
51 |
+
$form->setValues(Mage::getSingleton('adminhtml/session')->getTrackerData());
|
52 |
+
Mage::getSingleton('adminhtml/session')->setTrackerData(null);
|
53 |
+
} elseif ( Mage::registry('tracker_data') ) {
|
54 |
+
$form->setValues(Mage::registry('tracker_data')->getData());
|
55 |
+
}
|
56 |
+
return parent::_prepareForm();
|
57 |
+
}
|
58 |
+
}
|
app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit/Tabs.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Block_Adminhtml_Tracker_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
$this->setId('tracker_tabs');
|
10 |
+
$this->setDestElementId('edit_form');
|
11 |
+
$this->setTitle(Mage::helper('tracker')->__('Item Information'));
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _beforeToHtml()
|
15 |
+
{
|
16 |
+
$this->addTab('form_section', array(
|
17 |
+
'label' => Mage::helper('tracker')->__('Item Information'),
|
18 |
+
'title' => Mage::helper('tracker')->__('Item Information'),
|
19 |
+
'content' => $this->getLayout()->createBlock('tracker/adminhtml_tracker_edit_tab_form')->toHtml(),
|
20 |
+
));
|
21 |
+
|
22 |
+
return parent::_beforeToHtml();
|
23 |
+
}
|
24 |
+
}
|
app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Grid.php
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Block_Adminhtml_Tracker_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('trackerGrid');
|
9 |
+
$this->setDefaultSort('tracker_id');
|
10 |
+
$this->setDefaultDir('ASC');
|
11 |
+
$this->setSaveParametersInSession(true);
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _prepareCollection()
|
15 |
+
{
|
16 |
+
$collection = Mage::getModel('tracker/tracker')->getCollection();
|
17 |
+
$this->setCollection($collection);
|
18 |
+
return parent::_prepareCollection();
|
19 |
+
}
|
20 |
+
|
21 |
+
protected function _prepareColumns()
|
22 |
+
{
|
23 |
+
$this->addColumn('tracker_id', array(
|
24 |
+
'header' => Mage::helper('tracker')->__('ID'),
|
25 |
+
'align' =>'right',
|
26 |
+
'width' => '50px',
|
27 |
+
'index' => 'tracker_id',
|
28 |
+
));
|
29 |
+
|
30 |
+
$this->addColumn('title', array(
|
31 |
+
'header' => Mage::helper('tracker')->__('Title'),
|
32 |
+
'align' =>'left',
|
33 |
+
'index' => 'title',
|
34 |
+
));
|
35 |
+
|
36 |
+
/*
|
37 |
+
$this->addColumn('content', array(
|
38 |
+
'header' => Mage::helper('tracker')->__('Item Content'),
|
39 |
+
'width' => '150px',
|
40 |
+
'index' => 'content',
|
41 |
+
));
|
42 |
+
*/
|
43 |
+
|
44 |
+
$this->addColumn('status', array(
|
45 |
+
'header' => Mage::helper('tracker')->__('Status'),
|
46 |
+
'align' => 'left',
|
47 |
+
'width' => '80px',
|
48 |
+
'index' => 'status',
|
49 |
+
'type' => 'options',
|
50 |
+
'options' => array(
|
51 |
+
1 => 'Enabled',
|
52 |
+
2 => 'Disabled',
|
53 |
+
),
|
54 |
+
));
|
55 |
+
|
56 |
+
$this->addColumn('action',
|
57 |
+
array(
|
58 |
+
'header' => Mage::helper('tracker')->__('Action'),
|
59 |
+
'width' => '100',
|
60 |
+
'type' => 'action',
|
61 |
+
'getter' => 'getId',
|
62 |
+
'actions' => array(
|
63 |
+
array(
|
64 |
+
'caption' => Mage::helper('tracker')->__('Edit'),
|
65 |
+
'url' => array('base'=> '*/*/edit'),
|
66 |
+
'field' => 'id'
|
67 |
+
)
|
68 |
+
),
|
69 |
+
'filter' => false,
|
70 |
+
'sortable' => false,
|
71 |
+
'index' => 'stores',
|
72 |
+
'is_system' => true,
|
73 |
+
));
|
74 |
+
|
75 |
+
$this->addExportType('*/*/exportCsv', Mage::helper('tracker')->__('CSV'));
|
76 |
+
$this->addExportType('*/*/exportXml', Mage::helper('tracker')->__('XML'));
|
77 |
+
|
78 |
+
return parent::_prepareColumns();
|
79 |
+
}
|
80 |
+
|
81 |
+
protected function _prepareMassaction()
|
82 |
+
{
|
83 |
+
$this->setMassactionIdField('tracker_id');
|
84 |
+
$this->getMassactionBlock()->setFormFieldName('tracker');
|
85 |
+
|
86 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
87 |
+
'label' => Mage::helper('tracker')->__('Delete'),
|
88 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
89 |
+
'confirm' => Mage::helper('tracker')->__('Are you sure?')
|
90 |
+
));
|
91 |
+
|
92 |
+
$statuses = Mage::getSingleton('tracker/status')->getOptionArray();
|
93 |
+
|
94 |
+
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
95 |
+
$this->getMassactionBlock()->addItem('status', array(
|
96 |
+
'label'=> Mage::helper('tracker')->__('Change status'),
|
97 |
+
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
98 |
+
'additional' => array(
|
99 |
+
'visibility' => array(
|
100 |
+
'name' => 'status',
|
101 |
+
'type' => 'select',
|
102 |
+
'class' => 'required-entry',
|
103 |
+
'label' => Mage::helper('tracker')->__('Status'),
|
104 |
+
'values' => $statuses
|
105 |
+
)
|
106 |
+
)
|
107 |
+
));
|
108 |
+
return $this;
|
109 |
+
}
|
110 |
+
|
111 |
+
public function getRowUrl($row)
|
112 |
+
{
|
113 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
114 |
+
}
|
115 |
+
|
116 |
+
}
|
app/code/local/Mage/Econda/Block/Econda.php
ADDED
@@ -0,0 +1,642 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
Copyright (c) 2004 - 2009 ECONDA GmbH Karlsruhe
|
5 |
+
All rights reserved.
|
6 |
+
|
7 |
+
ECONDA GmbH
|
8 |
+
Eisenlohrstr. 43
|
9 |
+
76135 Karlsruhe
|
10 |
+
Tel.: 0721/663035-0
|
11 |
+
Fax.: 0721 663035-10
|
12 |
+
info@econda.de
|
13 |
+
www.econda.de
|
14 |
+
|
15 |
+
author: Edgar Gaiser <gaiser@econda.de>
|
16 |
+
|
17 |
+
Redistribution and use in source and binary forms, with or without modification,
|
18 |
+
are permitted provided that the following conditions are met:
|
19 |
+
|
20 |
+
* Redistributions of source code must retain the above copyright notice,
|
21 |
+
this list of conditions and the following disclaimer.
|
22 |
+
* Redistributions in binary form must reproduce the above copyright notice,
|
23 |
+
this list of conditions and the following disclaimer in the documentation
|
24 |
+
and/or other materials provided with the distribution.
|
25 |
+
* Neither the name of the ECONDA GmbH nor the names of its contributors may
|
26 |
+
be used to endorse or promote products derived from this software without
|
27 |
+
specific prior written permission.
|
28 |
+
|
29 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
30 |
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
31 |
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
32 |
+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
33 |
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
34 |
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
35 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
36 |
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
37 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
38 |
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
39 |
+
*/
|
40 |
+
|
41 |
+
/** This Class is a implementation of a PHP Function to include
|
42 |
+
* ECONDA Tracking into Magento Shop-Systems.
|
43 |
+
*/
|
44 |
+
|
45 |
+
|
46 |
+
require_once("app/Mage.php");
|
47 |
+
Mage::app ();
|
48 |
+
|
49 |
+
class Mage_Econda_Block_Econda extends Mage_Core_Block_Template
|
50 |
+
{
|
51 |
+
|
52 |
+
public function __construct()
|
53 |
+
{
|
54 |
+
parent::__construct();
|
55 |
+
$this->setTemplate('econda/tracker.phtml');
|
56 |
+
}
|
57 |
+
|
58 |
+
public function getEmos() {
|
59 |
+
|
60 |
+
require ('emos.php');
|
61 |
+
$storeId = $this->getStore();
|
62 |
+
$langValue = 'econda/econda/tracking_language';
|
63 |
+
$langPath = Mage::getStoreConfig($langValue, $storeId);
|
64 |
+
|
65 |
+
if($langPath == '0') {
|
66 |
+
$langFile = 'german';
|
67 |
+
}
|
68 |
+
else if($langPath == '1') {
|
69 |
+
$langFile = 'english';
|
70 |
+
}
|
71 |
+
else {
|
72 |
+
$langFile = 'german';
|
73 |
+
}
|
74 |
+
require_once ('app/code/local/Mage/Econda/Language/'.$langFile.'.php');
|
75 |
+
|
76 |
+
/*
|
77 |
+
* path to emos2.js
|
78 |
+
*/
|
79 |
+
$jsUrl = $this->getJsUrl();
|
80 |
+
$pathToFile = $jsUrl.'tracker/';
|
81 |
+
|
82 |
+
/*
|
83 |
+
* start of emos string
|
84 |
+
*/
|
85 |
+
$emosString = "\n\n<!-- Start Econda-Monitor -->\n\n";
|
86 |
+
|
87 |
+
$emos = new EMOS($pathToFile);
|
88 |
+
|
89 |
+
Mage::getSingleton('core/session', array('name'=>'frontend'));
|
90 |
+
$db = Mage::getSingleton('core/resource')->getConnection('core_write');
|
91 |
+
$session = Mage::getSingleton('checkout/session');
|
92 |
+
|
93 |
+
/*
|
94 |
+
* emos addContent
|
95 |
+
*/
|
96 |
+
$storeId = Mage::app()->getStore()->getStoreId();
|
97 |
+
$storeNameLoad = Mage::getModel('core/store_group')->load($storeId);
|
98 |
+
$storeName = $storeNameLoad->getName();
|
99 |
+
$tablePrefix = Mage::getConfig()->getTablePrefix();
|
100 |
+
|
101 |
+
$getPath = Mage::helper('catalog')->getBreadcrumbPath($this->getCategory());
|
102 |
+
if(sizeof($getPath) > 0) {
|
103 |
+
$contentPath = "Start";
|
104 |
+
}
|
105 |
+
else {
|
106 |
+
$contentPath = "";
|
107 |
+
}
|
108 |
+
|
109 |
+
$realUrl = Mage::helper('core/url')->getCurrentUrl();
|
110 |
+
|
111 |
+
//content for checkout
|
112 |
+
$contentCheckout = '';
|
113 |
+
$stepCheckout = '';
|
114 |
+
|
115 |
+
if(stristr($realUrl,'checkout/multishipping/login/') != false) {
|
116 |
+
$contentCheckout = $eLang[0];
|
117 |
+
$stepCheckout = 'LOGIN';
|
118 |
+
}
|
119 |
+
if(stristr($realUrl,'checkout/multishipping/register/') != false) {
|
120 |
+
$contentCheckout = $eLang[1];
|
121 |
+
$stepCheckout = 'LOGINREGISTER';
|
122 |
+
}
|
123 |
+
if(stristr($realUrl,'checkout/multishipping/addresses/') != false) {
|
124 |
+
$contentCheckout = $eLang[2].'/'.$eLang[3];
|
125 |
+
$stepCheckout = 'SHIPPINGADRESS';
|
126 |
+
}
|
127 |
+
if(stristr($realUrl,'checkout/multishipping/shipping/') != false) {
|
128 |
+
$contentCheckout = $eLang[2].'/'.$eLang[4];
|
129 |
+
$stepCheckout = 'SHIPPINGMETHOD';
|
130 |
+
}
|
131 |
+
if(stristr($realUrl,'checkout/multishipping/billing/') != false) {
|
132 |
+
$contentCheckout = $eLang[5];
|
133 |
+
$stepCheckout = 'PAYMENT';
|
134 |
+
}
|
135 |
+
if(stristr($realUrl,'checkout/multishipping/overview/') != false) {
|
136 |
+
$contentCheckout = $eLang[6];
|
137 |
+
$stepCheckout = 'REVIEW';
|
138 |
+
}
|
139 |
+
if(stristr($realUrl,'checkout/multishipping/success/') != false || stristr($realUrl,'checkout/onepage/success/') != false || stristr($realUrl,'uospayment/success/') != false) {
|
140 |
+
$contentCheckout = $eLang[41];
|
141 |
+
$stepCheckout = 'SUCCESS';
|
142 |
+
}
|
143 |
+
|
144 |
+
foreach($getPath as $pathID) {
|
145 |
+
$contentPath .= '/'.$pathID['label'];
|
146 |
+
}
|
147 |
+
|
148 |
+
$getTagName = "";
|
149 |
+
$getTagId = "";
|
150 |
+
if(stristr($realUrl,'q=') != false) $contentPath .= 'Start/'.$eLang[6].'/'.$eLang[7];
|
151 |
+
if(stristr($realUrl,'/about-') != false || stristr($realUrl,'/impressum') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[10];
|
152 |
+
if(stristr($realUrl,'/datenschutz') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[11];
|
153 |
+
if(stristr($realUrl,'/agb') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[12];
|
154 |
+
if(stristr($realUrl,'/rss') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[13];
|
155 |
+
if(stristr($realUrl,'/customer-service') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[14];
|
156 |
+
if(stristr($realUrl,'/seo_sitemap') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[15];
|
157 |
+
if(stristr($realUrl,'/seo_sitemap/product') != false) $contentPath .= '-'.$eLang[16];
|
158 |
+
if(stristr($realUrl,'/term/popular') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[17];
|
159 |
+
if(stristr($realUrl,'/catalogsearch/advanced') != false) {
|
160 |
+
$contentPath .= 'Start/'.$eLang[6].'/'.$eLang[8];
|
161 |
+
if(stristr($realUrl,'catalogsearch/advanced/result/?') != false) {
|
162 |
+
$contentPath .= '/'.$eLang[18];
|
163 |
+
}
|
164 |
+
}
|
165 |
+
if(stristr($realUrl,'/contacts/') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[19];
|
166 |
+
if(stristr($realUrl,'/login') != false) $contentPath .= 'Start/'.$eLang[0];
|
167 |
+
if(stristr($realUrl,'/customer/account/create/') != false) $contentPath .= 'Start/'.$eLang[20];
|
168 |
+
if(stristr($realUrl,'/customer/account/forgotpassword/') != false) $contentPath .= 'Start/'.$eLang[21];
|
169 |
+
if(stristr($realUrl,'/customer/') != false && stristr($realUrl,'/customer/account/login/') == false && stristr($realUrl,'/customer/account/forgotpassword/') == false && stristr($realUrl,'/customer/account/create/') == false) $contentPath .= 'Start/'.$eLang[22];
|
170 |
+
if(stristr($realUrl,'/customer/account/') != false && stristr($realUrl,'/customer/account/edit/') == false && stristr($realUrl,'/customer/account/login/') == false && stristr($realUrl,'/customer/account/forgotpassword/') == false && stristr($realUrl,'/customer/account/create/') == false) $contentPath .= '/'.$eLang[23];
|
171 |
+
if(stristr($realUrl,'/customer/account/edit/') != false) $contentPath .= '/'.$eLang[24];
|
172 |
+
if(stristr($realUrl,'/customer/address/') != false) $contentPath .= '/'.$eLang[25];
|
173 |
+
if(stristr($realUrl,'/sales/order/history/') != false) $contentPath .= 'Start/'.$eLang[22].'/'.$eLang[26];
|
174 |
+
if(stristr($realUrl,'/review/customer/') != false) $contentPath .= '/'.$eLang[27];
|
175 |
+
if(stristr($realUrl,'/tag/customer/') != false) $contentPath .= '/'.$eLang[28];
|
176 |
+
if(stristr($realUrl,'/newsletter/manage/') != false) $contentPath .= 'Start/'.$eLang[22].'/'.$eLang[29];
|
177 |
+
if(stristr($realUrl,'/wishlist/') != false) $contentPath .= 'Start/'.$eLang[22].'/'.$eLang[30];
|
178 |
+
if(stristr($realUrl,'/downloadable/customer/products/') != false) $contentPath .= '/'.$eLang[31];
|
179 |
+
if(stristr($realUrl,'checkout/cart') != false) $contentPath .= 'Start/'.$eLang[32].'/'.$eLang[33];
|
180 |
+
if(stristr($realUrl,'checkout/onepage/success') != false) $contentPath .= 'Start/'.$eLang[32].'/'.$eLang[41];
|
181 |
+
if(stristr($realUrl,'/checkout/multishipping') != false) $contentPath .= 'Start/'.$eLang[32].'/'.$contentCheckout;
|
182 |
+
if(stristr($realUrl,'/review') != false && stristr($realUrl,'/review/customer/') == false) $contentPath .= '/'.$eLang[34];
|
183 |
+
if($contentPath == '/Bewertungen') $contentPath = 'Start/'.$eLang[9].'/'.$eLang[37];
|
184 |
+
if(stristr($realUrl,'/tag/') != false && stristr($realUrl,'/tag/customer/') == false) {
|
185 |
+
$contentPath .= 'Start/'.$eLang[35];
|
186 |
+
$tagIdPos = strpos($realUrl,'/tagId/'); //tag id from url, hmmm.
|
187 |
+
$getTagId = substr($realUrl,$tagIdPos+6);
|
188 |
+
$getTagId = intval(str_replace('/','',$getTagId));
|
189 |
+
$tableTag = $tablePrefix.'tag';
|
190 |
+
$result = $db->query("SELECT name FROM $tableTag WHERE tag_id = $getTagId");
|
191 |
+
$row = $result->fetch(PDO::FETCH_ASSOC);
|
192 |
+
$getTagName .= $row['name'];
|
193 |
+
if(trim($getTagName) == ''){
|
194 |
+
$contentPath .= '/'.$eLang[36];
|
195 |
+
}
|
196 |
+
else {
|
197 |
+
$contentPath .= '/'.$getTagName;
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
+
//not specified sites
|
202 |
+
if(trim($contentPath == '')){
|
203 |
+
$urlExt = $_SERVER['PHP_SELF'];
|
204 |
+
$urlExt = str_replace('index.php','',$urlExt);
|
205 |
+
$urlExt = str_replace('.html','',$urlExt);
|
206 |
+
$urlExt = str_replace('//','/',$urlExt);
|
207 |
+
|
208 |
+
if(substr($urlExt,0,1) == '/') {
|
209 |
+
$urlExt = substr($urlExt,1);
|
210 |
+
}
|
211 |
+
|
212 |
+
if(substr($urlExt,-1) == '/') {
|
213 |
+
$urlExt = substr($urlExt,0,-1);
|
214 |
+
}
|
215 |
+
$urlExtExp = explode("/",$urlExt);
|
216 |
+
$urlExtO = '';
|
217 |
+
for ($i = 0; $i < sizeof($urlExtExp); $i++) {
|
218 |
+
$urlExtO .= ucfirst($urlExtExp[$i]).'/';
|
219 |
+
}
|
220 |
+
$urlExtO = substr($urlExtO,0,-1);
|
221 |
+
$contentPath = 'Start/'.$eLang[38].'/'.$urlExtO;
|
222 |
+
if(trim($contentPath == '' || $contentPath == 'Start/'.$eLang[38].'/')){
|
223 |
+
$urlExt1 = $_SERVER['REQUEST_URI'];
|
224 |
+
$contentPath = 'Start/'.$eLang[38].$urlExt1;
|
225 |
+
if($contentPath == 'Start/' || $contentPath == 'Start/'.$eLang[38].'/' || $contentPath == 'Start/'.$eLang[38].'/index.php/') {
|
226 |
+
$contentPath = 'Start';
|
227 |
+
}
|
228 |
+
}
|
229 |
+
}
|
230 |
+
|
231 |
+
// if not onePage checkout steps
|
232 |
+
if(stristr($realUrl,'checkout/onepage/') == false) {
|
233 |
+
$emos->addContent($contentPath);
|
234 |
+
}
|
235 |
+
|
236 |
+
//onePage checkout success
|
237 |
+
if(stristr($realUrl,'checkout/onepage/success') != false) {
|
238 |
+
$emos->addContent($contentPath);
|
239 |
+
}
|
240 |
+
|
241 |
+
/*
|
242 |
+
* emos addPageID
|
243 |
+
*/
|
244 |
+
$emos->addPageID(md5($contentPath)); //same as $contentPath
|
245 |
+
|
246 |
+
/*
|
247 |
+
* emos addSiteID
|
248 |
+
*/
|
249 |
+
/* will not work on multilanguage shops
|
250 |
+
$getStoreID = Mage::app()->getStore()->getStoreId();
|
251 |
+
$selectStoreDB = Mage::getModel('core/store_group')->load($getStoreID);
|
252 |
+
$siteName = $selectStoreDB->getId ();
|
253 |
+
*/
|
254 |
+
|
255 |
+
$siteName = $_SERVER['SERVER_NAME'];
|
256 |
+
$emos->addSiteID($siteName);
|
257 |
+
|
258 |
+
/*
|
259 |
+
* emos addLangID
|
260 |
+
*/
|
261 |
+
$getLocale = Mage::app()->getStore()->getStoreId(); // locale as shopID
|
262 |
+
$emos->addLangID($getLocale);
|
263 |
+
|
264 |
+
// save pageID, siteID and langID into session for onePageCheckout
|
265 |
+
$jsSessionData = $contentPath.','.$siteName.','.$getLocale;
|
266 |
+
$session->setData('econda_content',$jsSessionData);
|
267 |
+
|
268 |
+
/*
|
269 |
+
* emos addSearch
|
270 |
+
*/
|
271 |
+
if(Mage::helper('catalogSearch')->getQueryText() != null) {
|
272 |
+
$searchQuery = Mage::helper('catalogSearch')->getQueryText();
|
273 |
+
$getQuery = Mage::helper('catalogSearch')->getQuery();
|
274 |
+
$splitQuery = explode(',',$getQuery);
|
275 |
+
$searchHits = $splitQuery[2];
|
276 |
+
$emos->addSearch($searchQuery, $searchHits);
|
277 |
+
}
|
278 |
+
|
279 |
+
/*
|
280 |
+
* emos addSearch advanced
|
281 |
+
*/
|
282 |
+
if(stristr($realUrl,'/catalogsearch/advanced/result/?') != false) {
|
283 |
+
$searchQuery = '';
|
284 |
+
$searchCriterias = Mage::getSingleton('catalogsearch/advanced')->getSearchCriterias();
|
285 |
+
foreach ($searchCriterias as $val) {
|
286 |
+
$searchQuery .= $val['value'];
|
287 |
+
}
|
288 |
+
$productCollection = Mage::getSingleton('catalogsearch/advanced')->getProductCollection();
|
289 |
+
$emos->addSearch($searchQuery, sizeof($productCollection));
|
290 |
+
}
|
291 |
+
|
292 |
+
/*
|
293 |
+
* emos Basket add / remove item
|
294 |
+
*/
|
295 |
+
if(stristr($realUrl,'checkout/cart') != false) {
|
296 |
+
$emos->addOrderProcess("1_".$eLang[33]);
|
297 |
+
}
|
298 |
+
|
299 |
+
$isAddBasket = false;
|
300 |
+
|
301 |
+
//bugfix for basket after customer re-login
|
302 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn() == 1) {
|
303 |
+
if($session->getData('econda_logged') != 1) {
|
304 |
+
$oldBasket = true;
|
305 |
+
}
|
306 |
+
else {
|
307 |
+
$oldBasket = false;
|
308 |
+
}
|
309 |
+
}
|
310 |
+
else {
|
311 |
+
$oldBasket = false;
|
312 |
+
}
|
313 |
+
$nIdArray = array();
|
314 |
+
$nQtyArray = array();
|
315 |
+
$nNmeArray = array();
|
316 |
+
|
317 |
+
$counter = 1;
|
318 |
+
|
319 |
+
foreach ($session->getQuote()->getAllItems() as $item) {
|
320 |
+
$nIdArray[$counter] = $item->getproductId();
|
321 |
+
$nQtyArray[$counter] = $item->getQty();
|
322 |
+
$nNmeArray[$counter] = $item->getItemId();
|
323 |
+
$counter += 1;
|
324 |
+
}
|
325 |
+
|
326 |
+
if(!$session->getData('econda_card_id')){
|
327 |
+
$session->setData('econda_card_id',$nIdArray);
|
328 |
+
$session->setData('econda_card_qty',$nQtyArray);
|
329 |
+
$session->setData('econda_card_nme',$nNmeArray);
|
330 |
+
$oIdArray = $nIdArray;
|
331 |
+
$oQtyArray = $nQtyArray;
|
332 |
+
$oNmeArray = $nNmeArray;
|
333 |
+
$eStarter = 1;
|
334 |
+
}
|
335 |
+
else {
|
336 |
+
$oIdArray = $session->getData('econda_card_id');
|
337 |
+
$oQtyArray = $session->getData('econda_card_qty');
|
338 |
+
$oPrcArray = $session->getData('econda_card_prc');
|
339 |
+
$oNmeArray = $session->getData('econda_card_nme');
|
340 |
+
$eStarter = 0;
|
341 |
+
}
|
342 |
+
|
343 |
+
if(!$oldBasket) {
|
344 |
+
if($eStarter == 1) {
|
345 |
+
foreach ($session->getQuote()->getAllItems() as $item) {
|
346 |
+
$getGroup = $this->getProductCategory($item->getproductId());
|
347 |
+
if($getGroup) $prodGroup = $getGroup;
|
348 |
+
else $prodGroup = $eLang[39];
|
349 |
+
$eItem = new EMOS_Item();
|
350 |
+
$eItem->productName = $item->getName();
|
351 |
+
$eItem->productID = $item->getproductId();
|
352 |
+
$eItem->price = $this->convertPrice($item->getPrice());
|
353 |
+
$eItem->quantity = $item->getQty();
|
354 |
+
$eItem->productGroup = $prodGroup.'/'.$item->getName();
|
355 |
+
if($eItem->price != '0.00') {
|
356 |
+
$emos->addToBasket($eItem);
|
357 |
+
}
|
358 |
+
$isAddBasket = true;
|
359 |
+
}
|
360 |
+
}
|
361 |
+
else {
|
362 |
+
foreach ($session->getQuote()->getAllItems() as $item) {
|
363 |
+
$emosAction = false;
|
364 |
+
$addRmv = false;
|
365 |
+
$idKey = array_search($item->getItemId(),$oNmeArray);
|
366 |
+
|
367 |
+
if($idKey == false) {
|
368 |
+
$emosAction = 'addBasket';
|
369 |
+
$basketQty = $item->getQty();
|
370 |
+
}
|
371 |
+
|
372 |
+
if($idKey != false) {
|
373 |
+
|
374 |
+
if($oQtyArray[$idKey] != $item->getQty()) {
|
375 |
+
if($oQtyArray[$idKey] > $item->getQty() && $oNmeArray[$idKey] == $item->getItemId()) {
|
376 |
+
$emosAction = 'rmvBasket';
|
377 |
+
$basketQty = $oQtyArray[$idKey] - $item->getQty();
|
378 |
+
}
|
379 |
+
if($oQtyArray[$idKey] < $item->getQty() && $oNmeArray[$idKey] == $item->getItemId()) {
|
380 |
+
$emosAction = 'addBasket';
|
381 |
+
$basketQty = $item->getQty() - $oQtyArray[$idKey];
|
382 |
+
}
|
383 |
+
}
|
384 |
+
}
|
385 |
+
|
386 |
+
if($emosAction != false) {
|
387 |
+
$getGroup = $this->getProductCategory($item->getproductId());
|
388 |
+
if($getGroup) $prodGroup = $getGroup;
|
389 |
+
else $prodGroup = $eLang[39];
|
390 |
+
$eItem = new EMOS_Item();
|
391 |
+
$eItem->productName = $item->getName();
|
392 |
+
$eItem->productID = $item->getproductId();
|
393 |
+
$eItem->price = $this->convertPrice($item->getPrice());
|
394 |
+
$eItem->quantity = $basketQty;
|
395 |
+
$eItem->productGroup = $prodGroup.'/'.$item->getName();
|
396 |
+
|
397 |
+
if($emosAction == 'addBasket' && stristr($this->getMessagesBlock()->getGroupedHtml(),'error-msg') == false && $eItem->price != '0.00') {
|
398 |
+
$emos->addToBasket($eItem);
|
399 |
+
$isAddBasket = true;
|
400 |
+
if(stristr($realUrl,'checkout/cart') == false) {
|
401 |
+
$addRmv = true;
|
402 |
+
}
|
403 |
+
}
|
404 |
+
if($emosAction == 'rmvBasket' && stristr($this->getMessagesBlock()->getGroupedHtml(),'error-msg') == false && $eItem->price != '0.00') {
|
405 |
+
if(!$addRmv) {
|
406 |
+
$emos->removeFromBasket($eItem);
|
407 |
+
}
|
408 |
+
$isAddBasket = true;
|
409 |
+
}
|
410 |
+
}
|
411 |
+
}
|
412 |
+
|
413 |
+
}
|
414 |
+
}
|
415 |
+
|
416 |
+
$session->setData('econda_card_qty',$nQtyArray);
|
417 |
+
$session->setData('econda_card_id',$nIdArray);
|
418 |
+
$session->setData('econda_card_nme',$nNmeArray);
|
419 |
+
|
420 |
+
/*
|
421 |
+
* emos addDetailView
|
422 |
+
*/
|
423 |
+
if(Mage::registry('current_product') && !$isAddBasket) {
|
424 |
+
$item = Mage::registry('current_product');
|
425 |
+
$getGroup = $this->getProductCategory($item->getId());
|
426 |
+
if($getGroup) $prodGroup = $getGroup;
|
427 |
+
else $prodGroup = $eLang[39];
|
428 |
+
$eItem = new EMOS_Item();
|
429 |
+
$eItem->productName = $item->getName();
|
430 |
+
$eItem->productID = $item->getId();
|
431 |
+
$eItem->price = $this->convertPrice($item->getPrice());
|
432 |
+
$eItem->quantity = '1';
|
433 |
+
$eItem->productGroup = $prodGroup.'/'.$item->getName();
|
434 |
+
$emos->addDetailView($eItem);
|
435 |
+
}
|
436 |
+
|
437 |
+
/*
|
438 |
+
* emos addContact
|
439 |
+
*/
|
440 |
+
if(stristr($realUrl,'/contacts/index/') != false) {
|
441 |
+
$emos->addContact($eLang[40]);
|
442 |
+
}
|
443 |
+
|
444 |
+
/*
|
445 |
+
* emos addRegister
|
446 |
+
*/
|
447 |
+
if(stristr($realUrl,'customer/account/index/') != false || stristr($realUrl,'checkout/multishipping/addresses/') != false){
|
448 |
+
if(stristr($this->getMessagesBlock()->getGroupedHtml(),'success-msg') != false) {
|
449 |
+
$customerId = Mage::getSingleton('customer/session')->getCustomerId();
|
450 |
+
$emos->addRegister($customerId,0);
|
451 |
+
}
|
452 |
+
}
|
453 |
+
|
454 |
+
/*
|
455 |
+
* emos addLogin
|
456 |
+
*/
|
457 |
+
//login success
|
458 |
+
$isLoggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
|
459 |
+
|
460 |
+
if($isLoggedIn == 1 && $session->getData('econda_logged') != 2) {
|
461 |
+
$session->setData('econda_logged','1');
|
462 |
+
}
|
463 |
+
if($session->getData('econda_logged') == 1) {
|
464 |
+
$customerId = Mage::getSingleton('customer/session')->getCustomerId();
|
465 |
+
$emos->addLogin($customerId,0);
|
466 |
+
$session->setData('econda_logged','2');
|
467 |
+
}
|
468 |
+
|
469 |
+
//login failed
|
470 |
+
if(stristr($realUrl,'customer/account/login/') != false || stristr($realUrl,'checkout/multishipping/login/') != false){
|
471 |
+
if(stristr($this->getMessagesBlock()->getGroupedHtml(),'error-msg') != false) {
|
472 |
+
$customerId = Mage::getSingleton('customer/session')->getCustomerId();
|
473 |
+
$emos->addLogin($customerId,1);
|
474 |
+
}
|
475 |
+
}
|
476 |
+
|
477 |
+
/*
|
478 |
+
* emos orderProcess multishipping checkout
|
479 |
+
*/
|
480 |
+
switch ($stepCheckout) {
|
481 |
+
|
482 |
+
case 'LOGIN':
|
483 |
+
$emos->addOrderProcess("2_".$eLang[0]);
|
484 |
+
break;
|
485 |
+
case 'LOGINREGISTER':
|
486 |
+
$emos->addOrderProcess("3_".$eLang[1]);
|
487 |
+
break;
|
488 |
+
case 'SHIPPINGADRESS':
|
489 |
+
$emos->addOrderProcess("4_".$eLang[2]."/".$eLang[3]);
|
490 |
+
break;
|
491 |
+
case 'SHIPPINGMETHOD':
|
492 |
+
$emos->addOrderProcess("4_".$eLang[2]."/".$eLang[4]);
|
493 |
+
break;
|
494 |
+
case 'PAYMENT':
|
495 |
+
$emos->addOrderProcess("5_".$eLang[5]);
|
496 |
+
break;
|
497 |
+
case 'REVIEW':
|
498 |
+
$emos->addOrderProcess("6_".$eLang[42]);
|
499 |
+
$actOrder = Mage::getSingleton('checkout/session')->getQuoteId();
|
500 |
+
$session->setData('econda_order_id',$actOrder);
|
501 |
+
break;
|
502 |
+
case 'SUCCESS':
|
503 |
+
$emos->addOrderProcess("7_".$eLang[41]);
|
504 |
+
|
505 |
+
/*
|
506 |
+
* addEmosBillingPageArray checkout
|
507 |
+
*/
|
508 |
+
if(stristr($realUrl,'checkout/onepage/success/') != false || stristr($realUrl,'uospayment/success/') != false) {//onepage
|
509 |
+
$lastOrder = Mage::getSingleton('checkout/type_onepage')->getLastOrderId();
|
510 |
+
$tableSfq = $tablePrefix.'sales_flat_quote';
|
511 |
+
$result = $db->query("SELECT entity_id FROM $tableSfq WHERE reserved_order_id = $lastOrder");
|
512 |
+
$row = $result->fetch(PDO::FETCH_ASSOC);
|
513 |
+
$entityId = $row['entity_id'];
|
514 |
+
$lastOrderId = $lastOrder;
|
515 |
+
}
|
516 |
+
else{//multipage
|
517 |
+
$entityId = intval($session->getData('econda_order_id'));
|
518 |
+
$tableSfq = $tablePrefix.'sales_flat_quote';
|
519 |
+
$result = $db->query("SELECT reserved_order_id FROM $tableSfq WHERE entity_id = $entityId");
|
520 |
+
$row = $result->fetch(PDO::FETCH_ASSOC);
|
521 |
+
$lastOrderId = $row['reserved_order_id'];
|
522 |
+
}
|
523 |
+
$tableSfqa = $tablePrefix.'sales_flat_quote_address';
|
524 |
+
$result = $db->query("SELECT customer_id,city,postcode,country_id,grand_total FROM $tableSfqa WHERE quote_id = $entityId and address_type = 'shipping'");
|
525 |
+
$row = $result->fetch(PDO::FETCH_ASSOC);
|
526 |
+
$custCountry = $row['country_id'];
|
527 |
+
$custPostCode = $row['postcode'];
|
528 |
+
$custCity = $row['city'];
|
529 |
+
$custId = $row['customer_id'];
|
530 |
+
$ordId = $lastOrderId;
|
531 |
+
$priceTotal = $this->convertPrice($row['grand_total']);
|
532 |
+
|
533 |
+
$custAdress = $custCountry.'/'.substr($custPostCode,0,1).'/'.substr($custPostCode,0,2).'/'.$custCity.'/'.$custPostCode;
|
534 |
+
$emos->addEmosBillingPageArray($ordId,$custId,$priceTotal,$custCountry,$custPostCode,$custCity);
|
535 |
+
|
536 |
+
/*
|
537 |
+
* addEmosBasketPageArray checkout
|
538 |
+
*/
|
539 |
+
$basket = array();
|
540 |
+
$bCounter = 0;
|
541 |
+
$tableSfqi = $tablePrefix.'sales_flat_quote_item';
|
542 |
+
$result = $db->query("SELECT product_id,name,qty,price,parent_item_id FROM $tableSfqi WHERE quote_id = $entityId");
|
543 |
+
|
544 |
+
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
545 |
+
if($row['parent_item_id'] == '') {
|
546 |
+
$getGroup = $this->getProductCategory($row['product_id']);
|
547 |
+
if($getGroup) $prodGroup = $getGroup;
|
548 |
+
else $prodGroup = $eLang[39];
|
549 |
+
$eItem = new EMOS_Item();
|
550 |
+
$eItem->productName = $row['name'];
|
551 |
+
$eItem->productID = $row['product_id'];
|
552 |
+
$eItem->price = $this->convertPrice($row['price']);
|
553 |
+
$eItem->quantity = number_format($row['qty'],0);
|
554 |
+
$eItem->productGroup = $prodGroup.'/'.$row['name'];
|
555 |
+
$basket[$bCounter] = $eItem;
|
556 |
+
$bCounter += 1;
|
557 |
+
}
|
558 |
+
}
|
559 |
+
|
560 |
+
$emos->addEmosBasketPageArray($basket);
|
561 |
+
}
|
562 |
+
|
563 |
+
$emosString .= $emos->toString();
|
564 |
+
$emosString .= "\n<!-- End Econda-Monitor -->\n\n";
|
565 |
+
|
566 |
+
return $emosString;
|
567 |
+
}
|
568 |
+
|
569 |
+
/*
|
570 |
+
* get highest level category path for a product
|
571 |
+
*/
|
572 |
+
private function getProductCategory($productId) {
|
573 |
+
|
574 |
+
Mage::getSingleton('core/session', array('name'=>'frontend'));
|
575 |
+
$db = Mage::getSingleton('core/resource')->getConnection('core_write');
|
576 |
+
$tablePrefix = Mage::getConfig()->getTablePrefix();
|
577 |
+
$tableCcp = $tablePrefix.'catalog_category_product';
|
578 |
+
$result = $db->query("SELECT category_id FROM $tableCcp WHERE product_id = $productId");
|
579 |
+
$getCatId = array();
|
580 |
+
$count = 0;
|
581 |
+
$isCategory = false;
|
582 |
+
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
583 |
+
$getCatId[$count] = $row['category_id'];
|
584 |
+
$count += 1;
|
585 |
+
$isCategory = true;
|
586 |
+
}
|
587 |
+
|
588 |
+
if($isCategory) {
|
589 |
+
|
590 |
+
$catLevel = 0;
|
591 |
+
for($i=0;$i<sizeof($getCatId);$i++) {
|
592 |
+
$getCat = $getCatId[$i];
|
593 |
+
$tableCce = $tablePrefix.'catalog_category_entity';
|
594 |
+
$result = $db->query("SELECT level,path FROM $tableCce WHERE entity_id = $getCat");
|
595 |
+
$row = $result->fetch(PDO::FETCH_ASSOC);
|
596 |
+
|
597 |
+
if($catLevel < intval($row['level'])) {
|
598 |
+
$catLevel = intval($row['level']);
|
599 |
+
$categoryId = $getCat;
|
600 |
+
$catPath = explode('/',$row['path']);
|
601 |
+
}
|
602 |
+
}
|
603 |
+
|
604 |
+
$tableCcev = $tablePrefix.'catalog_category_entity_varchar';
|
605 |
+
$result = $db->query("SELECT attribute_id FROM $tableCcev WHERE value_id = 1");
|
606 |
+
$row = $result->fetch(PDO::FETCH_ASSOC);
|
607 |
+
$getEntidyId = $row['attribute_id'];
|
608 |
+
|
609 |
+
$category = "";
|
610 |
+
|
611 |
+
for($i=1;$i<sizeof($catPath);$i++) {
|
612 |
+
$catId = intval($catPath[$i]);
|
613 |
+
$result = $db->query("SELECT value FROM $tableCcev WHERE entity_id = $catId AND attribute_id = $getEntidyId");
|
614 |
+
$row = $result->fetch(PDO::FETCH_ASSOC);
|
615 |
+
$category .= $row['value']."/";
|
616 |
+
}
|
617 |
+
$category = substr($category,0,-1);
|
618 |
+
return $category;
|
619 |
+
}
|
620 |
+
else {
|
621 |
+
return false;
|
622 |
+
}
|
623 |
+
}
|
624 |
+
|
625 |
+
private function convertPrice($price) {
|
626 |
+
|
627 |
+
$price = number_format($price,2);
|
628 |
+
$corPrice = substr($price,0,-3);
|
629 |
+
$corPrice = str_replace(',','',$corPrice);
|
630 |
+
$corPrice = str_replace('.','',$corPrice);
|
631 |
+
return $corPrice.'.'.substr($price,-2);
|
632 |
+
}
|
633 |
+
|
634 |
+
private function pageUrl() {
|
635 |
+
|
636 |
+
$protocol = ((int) $_SERVER['SERVER_PORT'] === 443)? 'https://' : 'http://';
|
637 |
+
$current_page = $protocol . $_SERVER['HTTP_HOST'] . ((!empty($_SERVER['REQUEST_URI']))? $_SERVER['REQUEST_URI'] : '');
|
638 |
+
|
639 |
+
return $current_page;
|
640 |
+
}
|
641 |
+
|
642 |
+
}
|
app/code/local/Mage/Econda/Block/emos.php
ADDED
@@ -0,0 +1,607 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
/*******************************************************************************
|
5 |
+
* EMOS PHP Bib 2
|
6 |
+
* $Id: emos.php,v 1.13 2007/08/17 08:40:33 unaegele Exp $
|
7 |
+
********************************************************************************
|
8 |
+
|
9 |
+
Copyright (c) 2004 - 2007 ECONDA GmbH Karlsruhe
|
10 |
+
All rights reserved.
|
11 |
+
|
12 |
+
ECONDA GmbH
|
13 |
+
Haid-und-Neu-Str. 7
|
14 |
+
76131 Karlsruhe
|
15 |
+
Tel. +49 (721) 6630350
|
16 |
+
Fax +49 (721) 66303510
|
17 |
+
info@econda.de
|
18 |
+
www.econda.de
|
19 |
+
|
20 |
+
Redistribution and use in source and binary forms, with or without modification,
|
21 |
+
are permitted provided that the following conditions are met:
|
22 |
+
|
23 |
+
* Redistributions of source code must retain the above copyright notice,
|
24 |
+
this list of conditions and the following disclaimer.
|
25 |
+
* Redistributions in binary form must reproduce the above copyright notice,
|
26 |
+
this list of conditions and the following disclaimer in the documentation
|
27 |
+
and/or other materials provided with the distribution.
|
28 |
+
* Neither the name of the ECONDA GmbH nor the names of its contributors may
|
29 |
+
be used to endorse or promote products derived from this software without
|
30 |
+
specific prior written permission.
|
31 |
+
|
32 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
33 |
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
34 |
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
35 |
+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
36 |
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
37 |
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
38 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
39 |
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
40 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
41 |
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
42 |
+
|
43 |
+
Changes:
|
44 |
+
|
45 |
+
$Log: emos.php,v $
|
46 |
+
Revision 1.13 2007/08/17 08:40:33 unaegele
|
47 |
+
added function addEMOSCustomPageArray
|
48 |
+
added function getEMOSCustomPageArray
|
49 |
+
|
50 |
+
Revision 1.12 2007/05/16 08:24:09 unaegele
|
51 |
+
fix wrong reference to htmlspecialchars_decodephp4()
|
52 |
+
|
53 |
+
Revision 1.11 2007/05/11 07:52:42 unaegele
|
54 |
+
Update ECONDA Tel Number, prepare Release 20070510
|
55 |
+
|
56 |
+
Revision 1.10 2007/05/11 07:45:53 unaegele
|
57 |
+
added \n to addSid
|
58 |
+
|
59 |
+
Revision 1.9 2007/05/10 12:19:04 unaegele
|
60 |
+
Fix php 4 compatibility for the call to htmlspecialchars_decode()
|
61 |
+
Replace traslated =chr(0xa0) with real spaces
|
62 |
+
|
63 |
+
Revision 1.8 2007/05/04 10:17:31 unaegele
|
64 |
+
several bugfixes
|
65 |
+
|
66 |
+
Revision 1.7 2007/05/04 09:59:01 unaegele
|
67 |
+
source code formating
|
68 |
+
|
69 |
+
Revision 1.6 2007/05/04 09:55:12 unaegele
|
70 |
+
*** empty log message ***
|
71 |
+
|
72 |
+
Revision 1.5 2007/05/04 09:49:08 unaegele
|
73 |
+
*** empty log message ***
|
74 |
+
|
75 |
+
Revision 1.4 2007/05/04 09:43:48 unaegele
|
76 |
+
Added methods addSiteID($siteid), addLangID($langid), addPageID($pageID), addCountryID($countryid)
|
77 |
+
|
78 |
+
Revision 1.2 added URL Encoding, Dataformat
|
79 |
+
|
80 |
+
Revision 1.1 added 1st party session tracking
|
81 |
+
|
82 |
+
|
83 |
+
*/
|
84 |
+
|
85 |
+
/** PHP Helper Class to construct a ECONDA Monitor statement for the later
|
86 |
+
* inclusion in a HTML/PHP Page.
|
87 |
+
*/
|
88 |
+
class EMOS {
|
89 |
+
|
90 |
+
/**
|
91 |
+
* the EMOS statement consists of 3 parts
|
92 |
+
* 1. the inScript :<code><script type="text/javascript" src="emos2.js"></script>
|
93 |
+
* 2,3. a part before and after this inScript (preScript/postScript)</code>
|
94 |
+
*/
|
95 |
+
var $preScript = "";
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Here we store the call to the js bib
|
99 |
+
*/
|
100 |
+
var $inScript = "";
|
101 |
+
|
102 |
+
/**
|
103 |
+
* if we must put something behind the call to the js bin we put it here
|
104 |
+
*/
|
105 |
+
var $postScript = "";
|
106 |
+
|
107 |
+
/** path to the emos2.js script-file */
|
108 |
+
var $pathToFile = "";
|
109 |
+
|
110 |
+
/** Name of the script-file */
|
111 |
+
var $scriptFileName = "emos2.js";
|
112 |
+
|
113 |
+
/** if we use pretty print, we will set the lineseparator or tab here */
|
114 |
+
var $br = "\n";
|
115 |
+
var $tab = "\t";
|
116 |
+
|
117 |
+
/* session id for 1st party sessions*/
|
118 |
+
var $emsid = "";
|
119 |
+
|
120 |
+
/* visitor id for 1st partyx visitors */
|
121 |
+
var $emvid = "";
|
122 |
+
|
123 |
+
/**
|
124 |
+
* add compatibility function for php < 5.1
|
125 |
+
*/
|
126 |
+
function htmlspecialchars_decode_php4($str) {
|
127 |
+
return strtr($str, array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
|
128 |
+
}
|
129 |
+
|
130 |
+
/** Constructor
|
131 |
+
* Sets the path to the emos2.js js-bib and prepares the later calls
|
132 |
+
*
|
133 |
+
* @param $pathToFile The path to the js-bib (/opt/myjs)
|
134 |
+
* @param $scriptFileName If we want to have annother Filename than
|
135 |
+
* emos2.js you can set it here
|
136 |
+
*/
|
137 |
+
function EMOS($pathToFile , $scriptFileName = "emos2.js") {
|
138 |
+
$this->pathToFile = $pathToFile;
|
139 |
+
$this->scriptFileName = $scriptFileName;
|
140 |
+
$this->prepareInScript();
|
141 |
+
|
142 |
+
}
|
143 |
+
|
144 |
+
/* formats data/values/params by eliminating named entities and xml-entities */
|
145 |
+
function emos_ItemFormat($item) {
|
146 |
+
$item->productID = $this->emos_DataFormat($item->productID);
|
147 |
+
$item->productName = $this->emos_DataFormat($item->productName);
|
148 |
+
$item->productGroup = $this->emos_DataFormat($item->productGroup);
|
149 |
+
$item->variant1 = $this->emos_DataFormat($item->variant1);
|
150 |
+
$item->variant2 = $this->emos_DataFormat($item->variant2);
|
151 |
+
$item->variant3 = $this->emos_DataFormat($item->variant3);
|
152 |
+
return $item;
|
153 |
+
}
|
154 |
+
|
155 |
+
/* formats data/values/params by eliminating named entities and xml-entities */
|
156 |
+
function emos_DataFormat($str) {
|
157 |
+
$str = urldecode($str);
|
158 |
+
//2007-05-10 Fix incompatibility with php4
|
159 |
+
if (function_exists('htmlspecialchars_decode')) {
|
160 |
+
$str = htmlspecialchars_decode($str, ENT_QUOTES);
|
161 |
+
} else {
|
162 |
+
$str = $this->htmlspecialchars_decode_php4($str);
|
163 |
+
}
|
164 |
+
$str = html_entity_decode($str);
|
165 |
+
$str = strip_tags($str);
|
166 |
+
$str = trim($str);
|
167 |
+
|
168 |
+
//2007-05-10 replace translated with spaces
|
169 |
+
$nbsp = chr(0xa0);
|
170 |
+
$str = str_replace($nbsp, " ", $str);
|
171 |
+
$str = str_replace("\"", "", $str);
|
172 |
+
$str = str_replace("'", "", $str);
|
173 |
+
$str = str_replace("%", "", $str);
|
174 |
+
$str = str_replace(",", "", $str);
|
175 |
+
$str = str_replace(";", "", $str);
|
176 |
+
/* remove unnecessary white spaces*/
|
177 |
+
while (true) {
|
178 |
+
$str_temp = $str;
|
179 |
+
$str = str_replace(" ", " ", $str);
|
180 |
+
|
181 |
+
if ($str == $str_temp) {
|
182 |
+
break;
|
183 |
+
}
|
184 |
+
}
|
185 |
+
$str = str_replace(" / ", "/", $str);
|
186 |
+
$str = str_replace(" /", "/", $str);
|
187 |
+
$str = str_replace("/ ", "/", $str);
|
188 |
+
|
189 |
+
$str = substr($str, 0, 254);
|
190 |
+
$str = rawurlencode($str);
|
191 |
+
return $str;
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* sets the 1st party session id
|
196 |
+
*/
|
197 |
+
function setSid($sid = "") {
|
198 |
+
if ($sid) {
|
199 |
+
$this->emsid = $sid;
|
200 |
+
$this->appendPreScript("<a name=\"emos_sid\" title=\"$sid\"></a>\n");
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* set 1st party visitor id
|
206 |
+
*/
|
207 |
+
function setVid($vid = "") {
|
208 |
+
if ($vid) {
|
209 |
+
$this->emvid = $vid;
|
210 |
+
$this->appendPreScript("<a name=\"emos_vid\" title=\"$vid\"></a>");
|
211 |
+
}
|
212 |
+
}
|
213 |
+
|
214 |
+
/** switch on pretty printing of generated code. If not called, the output
|
215 |
+
* will be in one line of html.
|
216 |
+
*/
|
217 |
+
function prettyPrint() {
|
218 |
+
$this->br .= "\n";
|
219 |
+
$this->tab .= "\t";
|
220 |
+
}
|
221 |
+
|
222 |
+
/** Concatenates the current command and the $inScript */
|
223 |
+
function appendInScript($stringToAppend) {
|
224 |
+
$this->inScript .= $stringToAppend;
|
225 |
+
}
|
226 |
+
|
227 |
+
/** Concatenates the current command and the $proScript */
|
228 |
+
function appendPreScript($stringToAppend) {
|
229 |
+
$this->preScript .= $stringToAppend;
|
230 |
+
}
|
231 |
+
|
232 |
+
/** Concatenates the current command and the $postScript */
|
233 |
+
function appendPostScript($stringToAppend) {
|
234 |
+
$this->postScript .= $stringToAppend;
|
235 |
+
}
|
236 |
+
|
237 |
+
/** sets up the inScript Part with Initialisation Params */
|
238 |
+
function prepareInScript() {
|
239 |
+
$this->inScript .= "<script type=\"text/javascript\" " .
|
240 |
+
"src=\"" . $this->pathToFile . $this->scriptFileName . "\">" .
|
241 |
+
"</script>" . $this->br;
|
242 |
+
}
|
243 |
+
|
244 |
+
/** returns the whole statement */
|
245 |
+
function toString() {
|
246 |
+
return $this->preScript . $this->inScript . $this->postScript;
|
247 |
+
}
|
248 |
+
|
249 |
+
/** constructs a emos anchor tag */
|
250 |
+
function getAnchorTag($title = "", $rel = "", $rev = "") {
|
251 |
+
|
252 |
+
$rel = $this->emos_DataFormat($rel);
|
253 |
+
$rev = $this->emos_DataFormat($rev);
|
254 |
+
$anchor = "<a name=\"emos_name\" " .
|
255 |
+
"title=\"$title\" " .
|
256 |
+
"rel=\"$rel\" " .
|
257 |
+
"rev=\"$rev\"></a>$this->br";
|
258 |
+
return $anchor;
|
259 |
+
}
|
260 |
+
|
261 |
+
/** adds a anchor tag for content tracking
|
262 |
+
* <a name="emos_name" title="content" rel="$content" rev=""></a>
|
263 |
+
*/
|
264 |
+
function addContent($content) {
|
265 |
+
$this->appendPreScript($this->getAnchorTag("content", $content));
|
266 |
+
}
|
267 |
+
|
268 |
+
/** adds a anchor tag for orderprocess tracking
|
269 |
+
* <a name="emos_name" title="orderProcess" rel="$processStep" rev=""></a>
|
270 |
+
*/
|
271 |
+
function addOrderProcess($processStep) {
|
272 |
+
$this->appendPreScript($this->getAnchorTag("orderProcess", $processStep));
|
273 |
+
}
|
274 |
+
|
275 |
+
/** adds a anchor tag for siteid tracking
|
276 |
+
* <a name="emos_name" title="siteid" rel="$siteid" rev=""></a>
|
277 |
+
*/
|
278 |
+
function addSiteID($siteid) {
|
279 |
+
$this->appendPreScript($this->getAnchorTag("siteid", $siteid));
|
280 |
+
}
|
281 |
+
|
282 |
+
/** adds a anchor tag for language tracking
|
283 |
+
* <a name="emos_name" title="langid" rel="$langid" rev=""></a>
|
284 |
+
*/
|
285 |
+
function addLangID($langid) {
|
286 |
+
$this->appendPreScript($this->getAnchorTag("langid", $langid));
|
287 |
+
}
|
288 |
+
|
289 |
+
/** adds a anchor tag for country tracking
|
290 |
+
* <a name="emos_name" title="countryid" rel="$countryid" rev=""></a>
|
291 |
+
*/
|
292 |
+
function addCountryID($countryid) {
|
293 |
+
$this->appendPreScript($this->getAnchorTag("countryid", $countryid));
|
294 |
+
}
|
295 |
+
|
296 |
+
/**
|
297 |
+
* adds a Page ID to the current window (window.emosPageId)
|
298 |
+
*/
|
299 |
+
function addPageID($pageID) {
|
300 |
+
$this->appendPreScript("\n<script type=\"text/javascript\">\n window.emosPageId = '$pageID';\n</script>\n\n");
|
301 |
+
}
|
302 |
+
|
303 |
+
/** adds a anchor tag for search tracking
|
304 |
+
* <a name="emos_name" title="search" rel="$queryString" rev="$numberOfHits"></a>
|
305 |
+
*/
|
306 |
+
function addSearch($queryString, $numberOfHits) {
|
307 |
+
$this->appendPreScript($this->getAnchorTag("search", $queryString, $numberOfHits));
|
308 |
+
}
|
309 |
+
|
310 |
+
/** adds a anchor tag for registration tracking
|
311 |
+
* The userid gets a md5() to fullfilll german datenschutzgesetz
|
312 |
+
* <a name="emos_name" title="register" rel="$userID" rev="$result"></a>
|
313 |
+
*/
|
314 |
+
function addRegister($userID, $result) {
|
315 |
+
$this->appendPreScript($this->getAnchorTag("register", md5($userID), $result));
|
316 |
+
}
|
317 |
+
|
318 |
+
/** adds a anchor tag for login tracking
|
319 |
+
*The userid gets a md5() to fullfilll german datenschutzgesetz
|
320 |
+
* <a name="emos_name" title="login" rel="$userID" rev="$result"></a>
|
321 |
+
*/
|
322 |
+
function addLogin($userID, $result) {
|
323 |
+
$this->appendPreScript($this->getAnchorTag("login", md5($userID), $result));
|
324 |
+
}
|
325 |
+
|
326 |
+
/** adds a anchor tag for contact tracking
|
327 |
+
* <a name="emos_name" title="scontact" rel="$contactType" rev=""></a>
|
328 |
+
*/
|
329 |
+
function addContact($contactType) {
|
330 |
+
$this->appendPreScript($this->getAnchorTag("scontact", $contactType));
|
331 |
+
}
|
332 |
+
|
333 |
+
/** adds a anchor tag for download tracking
|
334 |
+
* <a name="emos_name" title="download" rel="$downloadLabel" rev=""></a>
|
335 |
+
*/
|
336 |
+
function addDownload($downloadLabel) {
|
337 |
+
$this->appendPreScript($this->getAnchorTag("download", $downloadLabel));
|
338 |
+
}
|
339 |
+
|
340 |
+
/** constructs a emosECPageArray of given $event type
|
341 |
+
* @param $item a instance of class EMOS_Item
|
342 |
+
* @param $event Type of this event ("add","c_rmv","c_add")
|
343 |
+
*/
|
344 |
+
function getEmosECPageArray($item, $event) {
|
345 |
+
|
346 |
+
$item = $this->emos_ItemFormat($item);
|
347 |
+
|
348 |
+
$out = "";
|
349 |
+
$out .= "<script type=\"text/javascript\">$this->br" .
|
350 |
+
"<!--$this->br" .
|
351 |
+
"$this->tab var emosECPageArray = new Array();$this->br" .
|
352 |
+
"$this->tab emosECPageArray['event'] = '$event';$this->br" .
|
353 |
+
"$this->tab emosECPageArray['id'] = '$item->productID';$this->br" .
|
354 |
+
"$this->tab emosECPageArray['name'] = '$item->productName';$this->br" .
|
355 |
+
"$this->tab emosECPageArray['preis'] = '$item->price';$this->br" .
|
356 |
+
"$this->tab emosECPageArray['group'] = '$item->productGroup';$this->br" .
|
357 |
+
"$this->tab emosECPageArray['anzahl'] = '$item->quantity';$this->br" .
|
358 |
+
"$this->tab emosECPageArray['var1'] = '$item->variant1';$this->br" .
|
359 |
+
"$this->tab emosECPageArray['var2'] = '$item->variant2';$this->br" .
|
360 |
+
"$this->tab emosECPageArray['var3'] = '$item->variant3';$this->br" .
|
361 |
+
"// -->$this->br" .
|
362 |
+
"</script>$this->br";
|
363 |
+
return $out;
|
364 |
+
}
|
365 |
+
|
366 |
+
/** constructs a emosBillingPageArray of given $event type */
|
367 |
+
function addEmosBillingPageArray($billingID = "", $customerNumber = "", $total = 0, $country = "", $cip = "", $city = "") {
|
368 |
+
$out = $this->getEmosBillingArray($billingID, $customerNumber, $total, $country, $cip, $city, "emosBillingPageArray");
|
369 |
+
$this->appendPreScript($out);
|
370 |
+
}
|
371 |
+
|
372 |
+
/** gets a emosBillingArray for a given ArrayName */
|
373 |
+
function getEmosBillingArray($billingID = "", $customerNumber = "", $total = 0, $country = "", $cip = "", $city = "", $arrayName = "") {
|
374 |
+
|
375 |
+
/******************* prepare data *************************************/
|
376 |
+
/* md5 the customer id to fullfill requirements of german datenschutzgeesetz */
|
377 |
+
$customerNumber = md5($customerNumber);
|
378 |
+
|
379 |
+
$country = $this->emos_DataFormat($country);
|
380 |
+
$cip = $this->emos_DataFormat($cip);
|
381 |
+
$city = $this->emos_DataFormat($city);
|
382 |
+
|
383 |
+
/* get a / separated location stzring for later drilldown */
|
384 |
+
$ort = "";
|
385 |
+
if ($country) {
|
386 |
+
$ort .= "$country/";
|
387 |
+
}
|
388 |
+
if ($cip) {
|
389 |
+
$ort .= substr($cip, 0, 1) . "/" . substr($cip, 0, 2) . "/";
|
390 |
+
}
|
391 |
+
if ($city) {
|
392 |
+
$ort .= "$city/";
|
393 |
+
}
|
394 |
+
if ($cip) {
|
395 |
+
$ort .= $cip;
|
396 |
+
}
|
397 |
+
|
398 |
+
/******************* get output** *************************************/
|
399 |
+
/* get the real output of this funktion */
|
400 |
+
$out = "";
|
401 |
+
$out .= "<script type=\"text/javascript\">$this->br" .
|
402 |
+
"<!--$this->br" .
|
403 |
+
"$this->tab var $arrayName = new Array();$this->br" .
|
404 |
+
"$this->tab $arrayName" . "[0] = '$billingID';$this->br" .
|
405 |
+
"$this->tab $arrayName" . "[1] = '$customerNumber';$this->br" .
|
406 |
+
"$this->tab $arrayName" . "[2] = '$ort';$this->br" .
|
407 |
+
"$this->tab $arrayName" . "[3] = '$total';$this->br" .
|
408 |
+
"// -->$this->br" .
|
409 |
+
"</script>$this->br";
|
410 |
+
return $out;
|
411 |
+
}
|
412 |
+
|
413 |
+
/** adds a emosBasket Page Array to the preScript */
|
414 |
+
function addEmosBasketPageArray($basket) {
|
415 |
+
$out = $this->getEmosBasketPageArray($basket, "emosBasketPageArray");
|
416 |
+
$this->appendPreScript($out);
|
417 |
+
}
|
418 |
+
|
419 |
+
/** returns a emosBasketArray of given Name */
|
420 |
+
function getEmosBasketPageArray($basket, $arrayName) {
|
421 |
+
$out = "";
|
422 |
+
$out .= "<script type=\"text/javascript\">$this->br" .
|
423 |
+
"<!--$this->br" .
|
424 |
+
"var $arrayName = new Array();$this->br";
|
425 |
+
$count = 0;
|
426 |
+
foreach ($basket as $item) {
|
427 |
+
|
428 |
+
$item = $this->emos_ItemFormat($item);
|
429 |
+
|
430 |
+
$out .= $this->br;
|
431 |
+
$out .= "$this->tab $arrayName" . "[$count]=new Array();$this->br";
|
432 |
+
$out .= "$this->tab $arrayName" . "[$count][0]='$item->productID';$this->br";
|
433 |
+
$out .= "$this->tab $arrayName" . "[$count][1]='$item->productName';$this->br";
|
434 |
+
$out .= "$this->tab $arrayName" . "[$count][2]='$item->price';$this->br";
|
435 |
+
$out .= "$this->tab $arrayName" . "[$count][3]='$item->productGroup';$this->br";
|
436 |
+
$out .= "$this->tab $arrayName" . "[$count][4]='$item->quantity';$this->br";
|
437 |
+
$out .= "$this->tab $arrayName" . "[$count][5]='$item->variant1';$this->br";
|
438 |
+
$out .= "$this->tab $arrayName" . "[$count][6]='$item->variant2';$this->br";
|
439 |
+
$out .= "$this->tab $arrayName" . "[$count][7]='$item->variant3';$this->br";
|
440 |
+
$count++;
|
441 |
+
}
|
442 |
+
$out .= "// -->$this->br" .
|
443 |
+
"</script>$this->br";
|
444 |
+
|
445 |
+
return $out;
|
446 |
+
}
|
447 |
+
|
448 |
+
/** adds a detailView to the preScript */
|
449 |
+
function addDetailView($item) {
|
450 |
+
$this->appendPreScript($this->getEmosECPageArray($item, "view"));
|
451 |
+
}
|
452 |
+
|
453 |
+
/** adds a removeFromBasket to the preScript */
|
454 |
+
function removeFromBasket($item) {
|
455 |
+
$this->appendPreScript($this->getEmosECPageArray($item, "c_rmv"));
|
456 |
+
}
|
457 |
+
|
458 |
+
/** adds a addToBasket to the preScript */
|
459 |
+
function addToBasket($item) {
|
460 |
+
$this->appendPreScript($this->getEmosECPageArray($item, "c_add"));
|
461 |
+
}
|
462 |
+
|
463 |
+
/**
|
464 |
+
* constructs a generic EmosCustomPageArray from a PHP Array
|
465 |
+
*/
|
466 |
+
function getEmosCustomPageArray($listOfValues){
|
467 |
+
|
468 |
+
$out = "";
|
469 |
+
$out .= "<script type=\"text/javascript\">$this->br" .
|
470 |
+
"<!--$this->br" .
|
471 |
+
"$this->tab var emosCustomPageArray = new Array();$this->br";
|
472 |
+
|
473 |
+
$counter = 0;
|
474 |
+
foreach ($listOfValues as $value) {
|
475 |
+
|
476 |
+
$value = $this->emos_DataFormat($value);
|
477 |
+
$out .= "$this->tab emosCustomPageArray[$counter] = '$value';$this->br";
|
478 |
+
$counter ++;
|
479 |
+
}
|
480 |
+
$out .= "// -->$this->br" ."</script>$this->br";
|
481 |
+
return $out;
|
482 |
+
|
483 |
+
|
484 |
+
|
485 |
+
}
|
486 |
+
|
487 |
+
|
488 |
+
/** constructs a emosCustomPageArray with 8 Variables and shortcut
|
489 |
+
* @param $cType Type of this event - shortcut in config
|
490 |
+
* @param $cVar1 first variable of this custom event (optional)
|
491 |
+
* @param $cVar2 second variable of this custom event (optional)
|
492 |
+
* @param $cVar3 third variable of this custom event (optional)
|
493 |
+
* @param $cVar4 fourth variable of this custom event (optional)
|
494 |
+
* @param $cVar5 fifth variable of this custom event (optional)
|
495 |
+
* @param $cVar6 sixth variable of this custom event (optional)
|
496 |
+
* @param $cVar7 seventh variable of this custom event (optional)
|
497 |
+
* @param $cVar8 eighth variable of this custom event (optional)
|
498 |
+
* @param $cVar9 nineth variable of this custom event (optional)
|
499 |
+
* @param $cVar10 tenth variable of this custom event (optional)
|
500 |
+
* @param $cVar11 eleventh variable of this custom event (optional)
|
501 |
+
* @param $cVar12 twelveth variable of this custom event (optional)
|
502 |
+
* @param $cVar13 thirteenth variable of this custom event (optional)
|
503 |
+
*/
|
504 |
+
function addEmosCustomPageArray($cType=0, $cVar1=0, $cVar2=0, $cVar3=0, $cVar4=0,
|
505 |
+
$cVar5=0, $cVar6=0, $cVar7=0, $cVar8=0, $cVar9=0,
|
506 |
+
$cVar10=0, $cVar11=0, $cVar12=0, $cVar13=0) {
|
507 |
+
|
508 |
+
$values[0] = $cType;
|
509 |
+
if($cVar1) $values[1] = $cVar1;
|
510 |
+
if($cVar2) $values[2] = $cVar2;
|
511 |
+
if($cVar3) $values[3] = $cVar3;
|
512 |
+
if($cVar4) $values[4] = $cVar4;
|
513 |
+
if($cVar5) $values[5] = $cVar5;
|
514 |
+
if($cVar6) $values[6] = $cVar6;
|
515 |
+
if($cVar7) $values[7] = $cVar7;
|
516 |
+
if($cVar8) $values[8] = $cVar8;
|
517 |
+
if($cVar9) $values[9] = $cVar9;
|
518 |
+
if($cVar10) $values[10] = $cVar10;
|
519 |
+
if($cVar11) $values[11] = $cVar11;
|
520 |
+
if($cVar12) $values[12] = $cVar12;
|
521 |
+
if($cVar13) $values[13] = $cVar13;
|
522 |
+
|
523 |
+
$this->appendPreScript($this->getEmosCustomPageArray($values));
|
524 |
+
}
|
525 |
+
|
526 |
+
}
|
527 |
+
|
528 |
+
/** global Functions */
|
529 |
+
|
530 |
+
function getEmosECEvent($item, $event) {
|
531 |
+
$item = $this->emos_ItemFormat($item);
|
532 |
+
$out = "";
|
533 |
+
$out .= "emos_ecEvent('$event'," .
|
534 |
+
"'$item->productID'," .
|
535 |
+
"'$item->productName'," .
|
536 |
+
"'$item->price'," .
|
537 |
+
"'$item->productGroup'," .
|
538 |
+
"'$item->quantity'," .
|
539 |
+
"'$item->variant1'" .
|
540 |
+
"'$item->variant2'" .
|
541 |
+
"'$item->variant3');";
|
542 |
+
return $out;
|
543 |
+
}
|
544 |
+
|
545 |
+
function getEmosViewEvent($item) {
|
546 |
+
return getEmosECEvent($item, "view");
|
547 |
+
}
|
548 |
+
|
549 |
+
function getEmosAddToBasketEvent($item) {
|
550 |
+
return getEmosECEvent($item, "c_add");
|
551 |
+
}
|
552 |
+
|
553 |
+
function getRemoveFromBasketEvent($item) {
|
554 |
+
return getEmosECEvent($item, "c_rmv");
|
555 |
+
}
|
556 |
+
|
557 |
+
function getEmosBillingEventArray($billingID = "", $customerNumber = "", $total = 0, $country = "", $cip = "", $city = "") {
|
558 |
+
$b = new EMOS();
|
559 |
+
return $b->getEmosBillingArray($billingID, $customerNumber, $total, $country, $cip, $city, "emosBillingArray");
|
560 |
+
}
|
561 |
+
|
562 |
+
function getEMOSBasketEventArray($basket) {
|
563 |
+
$b = new EMOS();
|
564 |
+
return $b->getEmosBasketArray($basket, "emosBasketArray");
|
565 |
+
}
|
566 |
+
|
567 |
+
/** A Class to hold products as well a basket items
|
568 |
+
* If you want to track a product view, set the quantity to 1.
|
569 |
+
* For "real" basket items, the quantity should be given in your
|
570 |
+
* shopping systems basket/shopping cart.
|
571 |
+
*
|
572 |
+
* Purpose of this class:
|
573 |
+
* This class provides a common subset of features for most shopping systems
|
574 |
+
* products or basket/cart items. So all you have to do is to convert your
|
575 |
+
* products/articles/basket items/cart items to a EMOS_Items. And finally use
|
576 |
+
* the functionaltiy of the EMOS class.
|
577 |
+
* So for each shopping system we only have to do the conversion of the cart/basket
|
578 |
+
* and items and we can (hopefully) keep the rest of code.
|
579 |
+
*
|
580 |
+
* Shopping carts:
|
581 |
+
* A shopping cart / basket is a simple Array[] of EMOS items.
|
582 |
+
* Convert your cart to a Array of EMOS_Items and your job is nearly done.
|
583 |
+
*/
|
584 |
+
class EMOS_Item {
|
585 |
+
/** unique Identifier of a product e.g. article number */
|
586 |
+
var $productID = "NULL";
|
587 |
+
/** the name of a product */
|
588 |
+
var $productName = "NULL";
|
589 |
+
/** the price of the product, it is your choice wether its gross or net */
|
590 |
+
var $price = "NULL";
|
591 |
+
/** the product group for this product, this is a drill down dimension
|
592 |
+
* or tree-like structure
|
593 |
+
* so you might want to use it like this:
|
594 |
+
* productgroup/subgroup/subgroup/product
|
595 |
+
*/
|
596 |
+
var $productGroup = "NULL";
|
597 |
+
/* the quantity / number of products viewed/bought etc.. */
|
598 |
+
var $quantity = "NULL";
|
599 |
+
/** variant of the product e.g. size, color, brand ....
|
600 |
+
* remember to keep the order of theses variants allways the same
|
601 |
+
* decide which variant is which feature and stick to it
|
602 |
+
*/
|
603 |
+
var $variant1 = "NULL";
|
604 |
+
var $variant2 = "NULL";
|
605 |
+
var $variant3 = "NULL";
|
606 |
+
}
|
607 |
+
?>
|
app/code/local/Mage/Econda/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/local/Mage/Econda/Language/english.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$eLang[0] = "Login";
|
3 |
+
$eLang[1] = "Register";
|
4 |
+
$eLang[2] = "Shipping";
|
5 |
+
$eLang[3] = "Adress";
|
6 |
+
$eLang[4] = "Method";
|
7 |
+
$eLang[5] = "Payment";
|
8 |
+
$eLang[6] = "Search";
|
9 |
+
$eLang[7] = "Basic Search";
|
10 |
+
$eLang[8] = "Advanced Search";
|
11 |
+
$eLang[9] = "Information";
|
12 |
+
$eLang[10] = "About";
|
13 |
+
$eLang[11] = "Privacy";
|
14 |
+
$eLang[12] = "General Business Terms";
|
15 |
+
$eLang[13] = "RSS";
|
16 |
+
$eLang[14] = "Customer Service";
|
17 |
+
$eLang[15] = "Sitemap";
|
18 |
+
$eLang[16] = "Products";
|
19 |
+
$eLang[17] = "Popular Search Terms";
|
20 |
+
$eLang[18] = "Results";
|
21 |
+
$eLang[19] = "Contact";
|
22 |
+
$eLang[20] = "Create Account";
|
23 |
+
$eLang[21] = "Forgot Password";
|
24 |
+
$eLang[22] = "My Account";
|
25 |
+
$eLang[23] = "Account Dashboard";
|
26 |
+
$eLang[24] = "Account Information";
|
27 |
+
$eLang[25] = "Adress Book";
|
28 |
+
$eLang[26] = "My Orders";
|
29 |
+
$eLang[27] = "My Product Reviews";
|
30 |
+
$eLang[28] = "My Tags";
|
31 |
+
$eLang[29] = "Newsletter Subscriptions";
|
32 |
+
$eLang[30] = "My Wishlist";
|
33 |
+
$eLang[31] = "My Downloadable Products";
|
34 |
+
$eLang[32] = "Order Process";
|
35 |
+
$eLang[33] = "Shopping Cart";
|
36 |
+
$eLang[34] = "Reviews";
|
37 |
+
$eLang[35] = "Tags";
|
38 |
+
$eLang[36] = "Overview";
|
39 |
+
$eLang[37] = "Review";
|
40 |
+
$eLang[38] = "Other Sites";
|
41 |
+
$eLang[39] = "No Category";
|
42 |
+
$eLang[40] = "Contact";
|
43 |
+
$eLang[41] = "Order Confirmation";
|
44 |
+
$eLang[42] = "Order Review";
|
45 |
+
$eLang[43] = "Billing";
|
46 |
+
?>
|
app/code/local/Mage/Econda/Language/german.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$eLang[0] = "Anmeldung";
|
3 |
+
$eLang[1] = "Registrierung";
|
4 |
+
$eLang[2] = "Versand";
|
5 |
+
$eLang[3] = "Adresse";
|
6 |
+
$eLang[4] = "Methode";
|
7 |
+
$eLang[5] = "Zahlung";
|
8 |
+
$eLang[6] = "Suche";
|
9 |
+
$eLang[7] = "Einfache Suche";
|
10 |
+
$eLang[8] = "Erweiterte Suche";
|
11 |
+
$eLang[9] = "Informationen";
|
12 |
+
$eLang[10] = "Impressum";
|
13 |
+
$eLang[11] = "Datenschutz";
|
14 |
+
$eLang[12] = "AGB";
|
15 |
+
$eLang[13] = "RSS";
|
16 |
+
$eLang[14] = "Kundenservice";
|
17 |
+
$eLang[15] = "Sitemap";
|
18 |
+
$eLang[16] = "Produkte";
|
19 |
+
$eLang[17] = "Meistgesucht";
|
20 |
+
$eLang[18] = "Ergebnis";
|
21 |
+
$eLang[19] = "Kontakt";
|
22 |
+
$eLang[20] = "Konto erstellen";
|
23 |
+
$eLang[21] = "Passwort anfordern";
|
24 |
+
$eLang[22] = "Kundenbereich";
|
25 |
+
$eLang[23] = "Uebersichtsseite";
|
26 |
+
$eLang[24] = "Kundeninformationen";
|
27 |
+
$eLang[25] = "Adressbuch";
|
28 |
+
$eLang[26] = "Bestellhistorie";
|
29 |
+
$eLang[27] = "Eigene Bewertungen";
|
30 |
+
$eLang[28] = "Eigene Tags";
|
31 |
+
$eLang[29] = "Newsletter abbonieren";
|
32 |
+
$eLang[30] = "Wunschliste";
|
33 |
+
$eLang[31] = "Herunterladbare Produkte";
|
34 |
+
$eLang[32] = "Kaufprozess";
|
35 |
+
$eLang[33] = "Warenkorb";
|
36 |
+
$eLang[34] = "Bewertungen";
|
37 |
+
$eLang[35] = "Tags";
|
38 |
+
$eLang[36] = "Uebersicht";
|
39 |
+
$eLang[37] = "Bewertung";
|
40 |
+
$eLang[38] = "Sonstige Seiten";
|
41 |
+
$eLang[39] = "Ohne Kategorie";
|
42 |
+
$eLang[40] = "Kontakt";
|
43 |
+
$eLang[41] = "Bestaetigung";
|
44 |
+
$eLang[42] = "Bestelluebersicht";
|
45 |
+
$eLang[43] = "Rechnung";
|
46 |
+
?>
|
app/code/local/Mage/Econda/Model/Econda.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Model_Econda extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('econda/econda');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Mage/Econda/Model/Mysql4/Econda.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Model_Mysql4_Econda extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
// Note that the econda_id refers to the key field in your database table.
|
8 |
+
$this->_init('econda/econda', 'econda_id');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Mage/Econda/Model/Mysql4/Econda/Collection.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Model_Mysql4_Econda_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('econda/econda');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Mage/Econda/Model/Mysql4/Tracker.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Model_Mysql4_Tracker extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
// Note that the tracker_id refers to the key field in your database table.
|
8 |
+
$this->_init('tracker/tracker', 'tracker_id');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Mage/Econda/Model/Mysql4/Tracker/Collection.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Model_Mysql4_Tracker_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('tracker/tracker');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Mage/Econda/Model/Status.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Model_Status extends Varien_Object
|
4 |
+
{
|
5 |
+
const STATUS_ENABLED = 1;
|
6 |
+
const STATUS_DISABLED = 2;
|
7 |
+
|
8 |
+
static public function getOptionArray()
|
9 |
+
{
|
10 |
+
return array(
|
11 |
+
self::STATUS_ENABLED => Mage::helper('econda')->__('Enabled'),
|
12 |
+
self::STATUS_DISABLED => Mage::helper('econda')->__('Disabled')
|
13 |
+
);
|
14 |
+
}
|
15 |
+
}
|
app/code/local/Mage/Econda/Model/System/Config/Source/Language.php
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 Mage
|
16 |
+
* @package Mage_Adminhtml
|
17 |
+
* @copyright Copyright (c) 2004-2007 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*
|
20 |
+
* @copyright 2008 by UNITED-ONLINE-SERVICES
|
21 |
+
* @author S.Wilking (s.wilking@united-online-services.de)
|
22 |
+
*/
|
23 |
+
|
24 |
+
|
25 |
+
class Mage_Econda_Model_System_Config_Source_Language
|
26 |
+
{
|
27 |
+
public function toOptionArray()
|
28 |
+
{
|
29 |
+
return array(
|
30 |
+
array('value'=>'0', 'label'=>Mage::helper('econda')->__('deutsch')),
|
31 |
+
array('value'=>'1', 'label'=>Mage::helper('econda')->__('english'))
|
32 |
+
);
|
33 |
+
}
|
34 |
+
}
|
app/code/local/Mage/Econda/controllers/Adminhtml/EcondaController.php
ADDED
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Adminhtml_EcondaController extends Mage_Adminhtml_Controller_action
|
4 |
+
{
|
5 |
+
|
6 |
+
protected function _initAction() {
|
7 |
+
$this->loadLayout()
|
8 |
+
->_setActiveMenu('econda/items')
|
9 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
10 |
+
|
11 |
+
return $this;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function indexAction() {
|
15 |
+
$this->_initAction()
|
16 |
+
->renderLayout();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function editAction() {
|
20 |
+
$id = $this->getRequest()->getParam('id');
|
21 |
+
$model = Mage::getModel('econda/econda')->load($id);
|
22 |
+
|
23 |
+
if ($model->getId() || $id == 0) {
|
24 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
25 |
+
if (!empty($data)) {
|
26 |
+
$model->setData($data);
|
27 |
+
}
|
28 |
+
|
29 |
+
Mage::register('econda_data', $model);
|
30 |
+
|
31 |
+
$this->loadLayout();
|
32 |
+
$this->_setActiveMenu('econda/items');
|
33 |
+
|
34 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
35 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
36 |
+
|
37 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
38 |
+
|
39 |
+
$this->_addContent($this->getLayout()->createBlock('econda/adminhtml_econda_edit'))
|
40 |
+
->_addLeft($this->getLayout()->createBlock('econda/adminhtml_econda_edit_tabs'));
|
41 |
+
|
42 |
+
$this->renderLayout();
|
43 |
+
} else {
|
44 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('econda')->__('Item does not exist'));
|
45 |
+
$this->_redirect('*/*/');
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
public function newAction() {
|
50 |
+
$this->_forward('edit');
|
51 |
+
}
|
52 |
+
|
53 |
+
public function saveAction() {
|
54 |
+
if ($data = $this->getRequest()->getPost()) {
|
55 |
+
|
56 |
+
if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
|
57 |
+
try {
|
58 |
+
/* Starting upload */
|
59 |
+
$uploader = new Varien_File_Uploader('filename');
|
60 |
+
|
61 |
+
// Any extention would work
|
62 |
+
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
|
63 |
+
$uploader->setAllowRenameFiles(false);
|
64 |
+
|
65 |
+
// Set the file upload mode
|
66 |
+
// false -> get the file directly in the specified folder
|
67 |
+
// true -> get the file in the product like folders
|
68 |
+
// (file.jpg will go in something like /media/f/i/file.jpg)
|
69 |
+
$uploader->setFilesDispersion(false);
|
70 |
+
|
71 |
+
// We set media as the upload dir
|
72 |
+
$path = Mage::getBaseDir('media') . DS ;
|
73 |
+
$uploader->save($path, $_FILES['filename']['name'] );
|
74 |
+
|
75 |
+
} catch (Exception $e) {
|
76 |
+
|
77 |
+
}
|
78 |
+
|
79 |
+
//this way the name is saved in DB
|
80 |
+
$data['filename'] = $_FILES['filename']['name'];
|
81 |
+
}
|
82 |
+
|
83 |
+
|
84 |
+
$model = Mage::getModel('econda/econda');
|
85 |
+
$model->setData($data)
|
86 |
+
->setId($this->getRequest()->getParam('id'));
|
87 |
+
|
88 |
+
try {
|
89 |
+
if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
|
90 |
+
$model->setCreatedTime(now())
|
91 |
+
->setUpdateTime(now());
|
92 |
+
} else {
|
93 |
+
$model->setUpdateTime(now());
|
94 |
+
}
|
95 |
+
|
96 |
+
$model->save();
|
97 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('econda')->__('Item was successfully saved'));
|
98 |
+
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
99 |
+
|
100 |
+
if ($this->getRequest()->getParam('back')) {
|
101 |
+
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
102 |
+
return;
|
103 |
+
}
|
104 |
+
$this->_redirect('*/*/');
|
105 |
+
return;
|
106 |
+
} catch (Exception $e) {
|
107 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
108 |
+
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
109 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
110 |
+
return;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('econda')->__('Unable to find item to save'));
|
114 |
+
$this->_redirect('*/*/');
|
115 |
+
}
|
116 |
+
|
117 |
+
public function deleteAction() {
|
118 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
119 |
+
try {
|
120 |
+
$model = Mage::getModel('econda/econda');
|
121 |
+
|
122 |
+
$model->setId($this->getRequest()->getParam('id'))
|
123 |
+
->delete();
|
124 |
+
|
125 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
126 |
+
$this->_redirect('*/*/');
|
127 |
+
} catch (Exception $e) {
|
128 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
129 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
130 |
+
}
|
131 |
+
}
|
132 |
+
$this->_redirect('*/*/');
|
133 |
+
}
|
134 |
+
|
135 |
+
public function massDeleteAction() {
|
136 |
+
$econdaIds = $this->getRequest()->getParam('econda');
|
137 |
+
if(!is_array($econdaIds)) {
|
138 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
139 |
+
} else {
|
140 |
+
try {
|
141 |
+
foreach ($econdaIds as $econdaId) {
|
142 |
+
$econda = Mage::getModel('econda/econda')->load($econdaId);
|
143 |
+
$econda->delete();
|
144 |
+
}
|
145 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
146 |
+
Mage::helper('adminhtml')->__(
|
147 |
+
'Total of %d record(s) were successfully deleted', count($econdaIds)
|
148 |
+
)
|
149 |
+
);
|
150 |
+
} catch (Exception $e) {
|
151 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
152 |
+
}
|
153 |
+
}
|
154 |
+
$this->_redirect('*/*/index');
|
155 |
+
}
|
156 |
+
|
157 |
+
public function massStatusAction()
|
158 |
+
{
|
159 |
+
$econdaIds = $this->getRequest()->getParam('econda');
|
160 |
+
if(!is_array($econdaIds)) {
|
161 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
162 |
+
} else {
|
163 |
+
try {
|
164 |
+
foreach ($econdaIds as $econdaId) {
|
165 |
+
$econda = Mage::getSingleton('econda/econda')
|
166 |
+
->load($econdaId)
|
167 |
+
->setStatus($this->getRequest()->getParam('status'))
|
168 |
+
->setIsMassupdate(true)
|
169 |
+
->save();
|
170 |
+
}
|
171 |
+
$this->_getSession()->addSuccess(
|
172 |
+
$this->__('Total of %d record(s) were successfully updated', count($econdaIds))
|
173 |
+
);
|
174 |
+
} catch (Exception $e) {
|
175 |
+
$this->_getSession()->addError($e->getMessage());
|
176 |
+
}
|
177 |
+
}
|
178 |
+
$this->_redirect('*/*/index');
|
179 |
+
}
|
180 |
+
|
181 |
+
public function exportCsvAction()
|
182 |
+
{
|
183 |
+
$fileName = 'econda.csv';
|
184 |
+
$content = $this->getLayout()->createBlock('econda/adminhtml_econda_grid')
|
185 |
+
->getCsv();
|
186 |
+
|
187 |
+
$this->_sendUploadResponse($fileName, $content);
|
188 |
+
}
|
189 |
+
|
190 |
+
public function exportXmlAction()
|
191 |
+
{
|
192 |
+
$fileName = 'econda.xml';
|
193 |
+
$content = $this->getLayout()->createBlock('econda/adminhtml_econda_grid')
|
194 |
+
->getXml();
|
195 |
+
|
196 |
+
$this->_sendUploadResponse($fileName, $content);
|
197 |
+
}
|
198 |
+
|
199 |
+
protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
|
200 |
+
{
|
201 |
+
$response = $this->getResponse();
|
202 |
+
$response->setHeader('HTTP/1.1 200 OK','');
|
203 |
+
$response->setHeader('Pragma', 'public', true);
|
204 |
+
$response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
|
205 |
+
$response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
|
206 |
+
$response->setHeader('Last-Modified', date('r'));
|
207 |
+
$response->setHeader('Accept-Ranges', 'bytes');
|
208 |
+
$response->setHeader('Content-Length', strlen($content));
|
209 |
+
$response->setHeader('Content-type', $contentType);
|
210 |
+
$response->setBody($content);
|
211 |
+
$response->sendResponse();
|
212 |
+
die;
|
213 |
+
}
|
214 |
+
}
|
app/code/local/Mage/Econda/controllers/Adminhtml/TrackerController.php
ADDED
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Econda_Adminhtml_TrackerController extends Mage_Adminhtml_Controller_action
|
4 |
+
{
|
5 |
+
|
6 |
+
protected function _initAction() {
|
7 |
+
$this->loadLayout()
|
8 |
+
->_setActiveMenu('tracker/items')
|
9 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
10 |
+
|
11 |
+
return $this;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function indexAction() {
|
15 |
+
$this->_initAction()
|
16 |
+
->renderLayout();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function editAction() {
|
20 |
+
$id = $this->getRequest()->getParam('id');
|
21 |
+
$model = Mage::getModel('tracker/tracker')->load($id);
|
22 |
+
|
23 |
+
if ($model->getId() || $id == 0) {
|
24 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
25 |
+
if (!empty($data)) {
|
26 |
+
$model->setData($data);
|
27 |
+
}
|
28 |
+
|
29 |
+
Mage::register('tracker_data', $model);
|
30 |
+
|
31 |
+
$this->loadLayout();
|
32 |
+
$this->_setActiveMenu('tracker/items');
|
33 |
+
|
34 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
35 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
36 |
+
|
37 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
38 |
+
|
39 |
+
$this->_addContent($this->getLayout()->createBlock('tracker/adminhtml_tracker_edit'))
|
40 |
+
->_addLeft($this->getLayout()->createBlock('tracker/adminhtml_tracker_edit_tabs'));
|
41 |
+
|
42 |
+
$this->renderLayout();
|
43 |
+
} else {
|
44 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('tracker')->__('Item does not exist'));
|
45 |
+
$this->_redirect('*/*/');
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
public function newAction() {
|
50 |
+
$this->_forward('edit');
|
51 |
+
}
|
52 |
+
|
53 |
+
public function saveAction() {
|
54 |
+
if ($data = $this->getRequest()->getPost()) {
|
55 |
+
|
56 |
+
if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
|
57 |
+
try {
|
58 |
+
/* Starting upload */
|
59 |
+
$uploader = new Varien_File_Uploader('filename');
|
60 |
+
|
61 |
+
// Any extention would work
|
62 |
+
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
|
63 |
+
$uploader->setAllowRenameFiles(false);
|
64 |
+
|
65 |
+
// Set the file upload mode
|
66 |
+
// false -> get the file directly in the specified folder
|
67 |
+
// true -> get the file in the product like folders
|
68 |
+
// (file.jpg will go in something like /media/f/i/file.jpg)
|
69 |
+
$uploader->setFilesDispersion(false);
|
70 |
+
|
71 |
+
// We set media as the upload dir
|
72 |
+
$path = Mage::getBaseDir('media') . DS ;
|
73 |
+
$uploader->save($path, $_FILES['filename']['name'] );
|
74 |
+
|
75 |
+
} catch (Exception $e) {
|
76 |
+
|
77 |
+
}
|
78 |
+
|
79 |
+
//this way the name is saved in DB
|
80 |
+
$data['filename'] = $_FILES['filename']['name'];
|
81 |
+
}
|
82 |
+
|
83 |
+
|
84 |
+
$model = Mage::getModel('tracker/tracker');
|
85 |
+
$model->setData($data)
|
86 |
+
->setId($this->getRequest()->getParam('id'));
|
87 |
+
|
88 |
+
try {
|
89 |
+
if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
|
90 |
+
$model->setCreatedTime(now())
|
91 |
+
->setUpdateTime(now());
|
92 |
+
} else {
|
93 |
+
$model->setUpdateTime(now());
|
94 |
+
}
|
95 |
+
|
96 |
+
$model->save();
|
97 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('tracker')->__('Item was successfully saved'));
|
98 |
+
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
99 |
+
|
100 |
+
if ($this->getRequest()->getParam('back')) {
|
101 |
+
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
102 |
+
return;
|
103 |
+
}
|
104 |
+
$this->_redirect('*/*/');
|
105 |
+
return;
|
106 |
+
} catch (Exception $e) {
|
107 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
108 |
+
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
109 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
110 |
+
return;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('tracker')->__('Unable to find item to save'));
|
114 |
+
$this->_redirect('*/*/');
|
115 |
+
}
|
116 |
+
|
117 |
+
public function deleteAction() {
|
118 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
119 |
+
try {
|
120 |
+
$model = Mage::getModel('tracker/tracker');
|
121 |
+
|
122 |
+
$model->setId($this->getRequest()->getParam('id'))
|
123 |
+
->delete();
|
124 |
+
|
125 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
126 |
+
$this->_redirect('*/*/');
|
127 |
+
} catch (Exception $e) {
|
128 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
129 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
130 |
+
}
|
131 |
+
}
|
132 |
+
$this->_redirect('*/*/');
|
133 |
+
}
|
134 |
+
|
135 |
+
public function massDeleteAction() {
|
136 |
+
$trackerIds = $this->getRequest()->getParam('tracker');
|
137 |
+
if(!is_array($trackerIds)) {
|
138 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
139 |
+
} else {
|
140 |
+
try {
|
141 |
+
foreach ($trackerIds as $trackerId) {
|
142 |
+
$tracker = Mage::getModel('tracker/tracker')->load($trackerId);
|
143 |
+
$tracker->delete();
|
144 |
+
}
|
145 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
146 |
+
Mage::helper('adminhtml')->__(
|
147 |
+
'Total of %d record(s) were successfully deleted', count($trackerIds)
|
148 |
+
)
|
149 |
+
);
|
150 |
+
} catch (Exception $e) {
|
151 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
152 |
+
}
|
153 |
+
}
|
154 |
+
$this->_redirect('*/*/index');
|
155 |
+
}
|
156 |
+
|
157 |
+
public function massStatusAction()
|
158 |
+
{
|
159 |
+
$trackerIds = $this->getRequest()->getParam('tracker');
|
160 |
+
if(!is_array($trackerIds)) {
|
161 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
162 |
+
} else {
|
163 |
+
try {
|
164 |
+
foreach ($trackerIds as $trackerId) {
|
165 |
+
$tracker = Mage::getSingleton('tracker/tracker')
|
166 |
+
->load($trackerId)
|
167 |
+
->setStatus($this->getRequest()->getParam('status'))
|
168 |
+
->setIsMassupdate(true)
|
169 |
+
->save();
|
170 |
+
}
|
171 |
+
$this->_getSession()->addSuccess(
|
172 |
+
$this->__('Total of %d record(s) were successfully updated', count($trackerIds))
|
173 |
+
);
|
174 |
+
} catch (Exception $e) {
|
175 |
+
$this->_getSession()->addError($e->getMessage());
|
176 |
+
}
|
177 |
+
}
|
178 |
+
$this->_redirect('*/*/index');
|
179 |
+
}
|
180 |
+
|
181 |
+
public function exportCsvAction()
|
182 |
+
{
|
183 |
+
$fileName = 'tracker.csv';
|
184 |
+
$content = $this->getLayout()->createBlock('tracker/adminhtml_tracker_grid')
|
185 |
+
->getCsv();
|
186 |
+
|
187 |
+
$this->_sendUploadResponse($fileName, $content);
|
188 |
+
}
|
189 |
+
|
190 |
+
public function exportXmlAction()
|
191 |
+
{
|
192 |
+
$fileName = 'tracker.xml';
|
193 |
+
$content = $this->getLayout()->createBlock('tracker/adminhtml_tracker_grid')
|
194 |
+
->getXml();
|
195 |
+
|
196 |
+
$this->_sendUploadResponse($fileName, $content);
|
197 |
+
}
|
198 |
+
|
199 |
+
protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
|
200 |
+
{
|
201 |
+
$response = $this->getResponse();
|
202 |
+
$response->setHeader('HTTP/1.1 200 OK','');
|
203 |
+
$response->setHeader('Pragma', 'public', true);
|
204 |
+
$response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
|
205 |
+
$response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
|
206 |
+
$response->setHeader('Last-Modified', date('r'));
|
207 |
+
$response->setHeader('Accept-Ranges', 'bytes');
|
208 |
+
$response->setHeader('Content-Length', strlen($content));
|
209 |
+
$response->setHeader('Content-type', $contentType);
|
210 |
+
$response->setBody($content);
|
211 |
+
$response->sendResponse();
|
212 |
+
die;
|
213 |
+
}
|
214 |
+
}
|
app/code/local/Mage/Econda/controllers/IndexController.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mage_Econda_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
|
7 |
+
/*
|
8 |
+
* Load an object by id
|
9 |
+
* Request looking like:
|
10 |
+
* http://site.com/econda?id=15
|
11 |
+
* or
|
12 |
+
* http://site.com/econda/id/15
|
13 |
+
*/
|
14 |
+
/*
|
15 |
+
$econda_id = $this->getRequest()->getParam('id');
|
16 |
+
|
17 |
+
if($econda_id != null && $econda_id != '') {
|
18 |
+
$econda = Mage::getModel('econda/econda')->load($econda_id)->getData();
|
19 |
+
} else {
|
20 |
+
$econda = null;
|
21 |
+
}
|
22 |
+
*/
|
23 |
+
|
24 |
+
/*
|
25 |
+
* If no param we load a the last created item
|
26 |
+
*/
|
27 |
+
/*
|
28 |
+
if($econda == null) {
|
29 |
+
$resource = Mage::getSingleton('core/resource');
|
30 |
+
$read= $resource->getConnection('core_read');
|
31 |
+
$econdaTable = $resource->getTableName('econda');
|
32 |
+
|
33 |
+
$select = $read->select()
|
34 |
+
->from($econdaTable,array('econda_id','title','content','status'))
|
35 |
+
->where('status',1)
|
36 |
+
->order('created_time DESC') ;
|
37 |
+
|
38 |
+
$econda = $read->fetchRow($select);
|
39 |
+
}
|
40 |
+
Mage::register('econda', $econda);
|
41 |
+
*/
|
42 |
+
|
43 |
+
|
44 |
+
$this->loadLayout();
|
45 |
+
$this->renderLayout();
|
46 |
+
}
|
47 |
+
}
|
app/code/local/Mage/Econda/etc/config.xml
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mage_Econda>
|
5 |
+
<version>0.2.0</version>
|
6 |
+
</Mage_Econda>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<econda>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Mage_Econda</module>
|
14 |
+
<frontName>econda</frontName>
|
15 |
+
</args>
|
16 |
+
</econda>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<econda>
|
21 |
+
<file>econda.xml</file>
|
22 |
+
</econda>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<admin>
|
27 |
+
<routers>
|
28 |
+
<econda>
|
29 |
+
<use>admin</use>
|
30 |
+
<args>
|
31 |
+
<module>Mage_Econda</module>
|
32 |
+
<frontName>econda</frontName>
|
33 |
+
</args>
|
34 |
+
</econda>
|
35 |
+
</routers>
|
36 |
+
</admin>
|
37 |
+
<adminhtml>
|
38 |
+
<translate>
|
39 |
+
<modules>
|
40 |
+
<Mage_Econda>
|
41 |
+
<files>
|
42 |
+
<default>Mage_Econda.csv</default>
|
43 |
+
</files>
|
44 |
+
</Mage_Econda>
|
45 |
+
</modules>
|
46 |
+
</translate>
|
47 |
+
<acl>
|
48 |
+
<resources>
|
49 |
+
<admin>
|
50 |
+
<children>
|
51 |
+
<system>
|
52 |
+
<children>
|
53 |
+
<config>
|
54 |
+
<children>
|
55 |
+
<econda>
|
56 |
+
<title>Econda Section</title>
|
57 |
+
</econda>
|
58 |
+
</children>
|
59 |
+
</config>
|
60 |
+
</children>
|
61 |
+
</system>
|
62 |
+
</children>
|
63 |
+
</admin>
|
64 |
+
</resources>
|
65 |
+
</acl>
|
66 |
+
<layout>
|
67 |
+
<updates>
|
68 |
+
<econda>
|
69 |
+
<file>econda.xml</file>
|
70 |
+
</econda>
|
71 |
+
</updates>
|
72 |
+
</layout>
|
73 |
+
</adminhtml>
|
74 |
+
<global>
|
75 |
+
|
76 |
+
<resources>
|
77 |
+
<econda_setup>
|
78 |
+
<setup>
|
79 |
+
<module>Mage_Econda</module>
|
80 |
+
</setup>
|
81 |
+
<connection>
|
82 |
+
<use>core_setup</use>
|
83 |
+
</connection>
|
84 |
+
</econda_setup>
|
85 |
+
<econda_write>
|
86 |
+
<connection>
|
87 |
+
<use>core_write</use>
|
88 |
+
</connection>
|
89 |
+
</econda_write>
|
90 |
+
<econda_read>
|
91 |
+
<connection>
|
92 |
+
<use>core_read</use>
|
93 |
+
</connection>
|
94 |
+
</econda_read>
|
95 |
+
</resources>
|
96 |
+
<blocks>
|
97 |
+
<econda>
|
98 |
+
<class>Mage_Econda_Block</class>
|
99 |
+
</econda>
|
100 |
+
</blocks>
|
101 |
+
<helpers>
|
102 |
+
<econda>
|
103 |
+
<class>Mage_Econda_Helper</class>
|
104 |
+
</econda>
|
105 |
+
</helpers>
|
106 |
+
</global>
|
107 |
+
</config>
|
app/code/local/Mage/Econda/etc/system.xml
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* @category
|
23 |
+
* @package Econda_tracker
|
24 |
+
* @copyright Copyright (c) 2009 econda GmbH (http://www.econda.de)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<config>
|
29 |
+
<sections>
|
30 |
+
<econda module="econda">
|
31 |
+
<label>econda Web Controlling</label>
|
32 |
+
<tab>sales</tab>
|
33 |
+
<frontend_type>text</frontend_type>
|
34 |
+
<sort_order>410</sort_order>
|
35 |
+
<show_in_default>1</show_in_default>
|
36 |
+
<show_in_website>1</show_in_website>
|
37 |
+
<show_in_store>0</show_in_store>
|
38 |
+
<groups>
|
39 |
+
<econda translate="label">
|
40 |
+
<label>Settings</label>
|
41 |
+
<sort_order>10</sort_order>
|
42 |
+
<show_in_default>1</show_in_default>
|
43 |
+
<show_in_website>1</show_in_website>
|
44 |
+
<show_in_store>0</show_in_store>
|
45 |
+
<fields>
|
46 |
+
<tracking_language>
|
47 |
+
<label>Used Language</label>
|
48 |
+
<comment>Select only the language, which at the time of initial activation of your econda product has been selected.</comment>
|
49 |
+
<frontend_type>select</frontend_type>
|
50 |
+
<source_model>econda/system_config_source_language</source_model>
|
51 |
+
<sort_order>1</sort_order>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>0</show_in_store>
|
55 |
+
</tracking_language>
|
56 |
+
</fields>
|
57 |
+
</econda>
|
58 |
+
</groups>
|
59 |
+
</econda>
|
60 |
+
</sections>
|
61 |
+
</config>
|
app/design/adminhtml/default/default/layout/econda.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<econda_adminhtml_econda_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="econda/adminhtml_econda" name="econda" />
|
6 |
+
</reference>
|
7 |
+
</econda_adminhtml_econda_index>
|
8 |
+
</layout>
|
app/design/frontend/default/default/layout/econda.xml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="before_body_end">
|
5 |
+
<block type="econda/econda" after="-" name="econda">
|
6 |
+
<action method="setTemplate"><template>econda/tracker.phtml</template></action>
|
7 |
+
</block>
|
8 |
+
</reference>
|
9 |
+
</default>
|
10 |
+
<checkout_onepage_index>
|
11 |
+
<reference name="content">
|
12 |
+
<block type="econda/econda" after="-" name="trackerop" template="econda/trackerop.phtml">
|
13 |
+
</block>
|
14 |
+
</reference>
|
15 |
+
</checkout_onepage_index>
|
16 |
+
</layout>
|
app/design/frontend/default/default/template/econda/tracker.phtml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<?php
|
3 |
+
$realUrlNoOp = Mage::helper('core/url')->getCurrentUrl();
|
4 |
+
if(stristr($realUrlNoOp,'checkout/onepage/index/') == false) {
|
5 |
+
echo $this->getEmos();
|
6 |
+
}
|
7 |
+
?>
|
8 |
+
|
9 |
+
|
app/design/frontend/default/default/template/econda/trackerop.phtml
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<?php
|
3 |
+
|
4 |
+
$realUrlOp = Mage::helper('core/url')->getCurrentUrl();
|
5 |
+
$opsession = Mage::getSingleton('checkout/session');
|
6 |
+
|
7 |
+
if(stristr($realUrlOp,'checkout/onepage/') != false) {
|
8 |
+
|
9 |
+
$pathToEmos = $this->getJsUrl().'tracker/emos2.js';
|
10 |
+
$pathToOpJs = $this->getJsUrl().'tracker/emosop.js';
|
11 |
+
|
12 |
+
$emosInclude = "\n<script type=\"text/javascript\" src='".$pathToEmos."'></script>\n";
|
13 |
+
$opInclude = "<script type=\"text/javascript\" src='".$pathToOpJs."'></script>\n";
|
14 |
+
|
15 |
+
$getSessionData = $opsession->getData('econda_content');
|
16 |
+
$splitSessionData = explode(',',$getSessionData);
|
17 |
+
$customerId = md5(Mage::getSingleton('customer/session')->getCustomerId());
|
18 |
+
|
19 |
+
$setPageId = md5($splitSessionData[0]);
|
20 |
+
$setSiteID = dataFormat($splitSessionData[1]);
|
21 |
+
$setLangID = $splitSessionData[2];
|
22 |
+
|
23 |
+
$storeIdOp = $this->getStore();
|
24 |
+
$langValueOP = 'econda/econda/tracking_language';
|
25 |
+
$langPathOp = Mage::getStoreConfig($langValueOP, $storeIdOp);
|
26 |
+
|
27 |
+
if($langPathOp == '0') {
|
28 |
+
$langFileOp = 'german';
|
29 |
+
}
|
30 |
+
else if($langPathOp == '1') {
|
31 |
+
$langFileOp = 'english';
|
32 |
+
}
|
33 |
+
else {
|
34 |
+
$langFileOp = 'german';
|
35 |
+
}
|
36 |
+
require_once ('app/code/local/Mage/Econda/Language/'.$langFileOp.'.php');
|
37 |
+
|
38 |
+
$langStep[0] = $eLang[0]; $langStep[1] = $eLang[43]; $langStep[2] = $eLang[2].'/'.$eLang[3];
|
39 |
+
$langStep[3] = $eLang[2].'/'.$eLang[4]; $langStep[4] = $eLang[5]; $langStep[5] = $eLang[42];
|
40 |
+
$langStep[6] = $eLang[43]; $langStep[7] = $eLang[32];
|
41 |
+
|
42 |
+
|
43 |
+
$emosOut = "\n<!-- Start Econda-Monitor -->\n";
|
44 |
+
$emosOut .= "\n<a name=\"emos_name\" title=\"content\" rel=\"Start/".$eLang[38]."\" rev=\"\"></a>\n";
|
45 |
+
$emosOut .= "\n<script type=\"text/javascript\">\n";
|
46 |
+
$emosOut .= " window.emosPageId = '".$setPageId."'; \n";
|
47 |
+
$emosOut .= " ecStep = new Array('".$langStep[0]."','".$langStep[1]."','".$langStep[2]."','".$langStep[3]."','".$langStep[4]."','".$langStep[5]."','".$langStep[6]."','".$langStep[7]."');\n";
|
48 |
+
$emosOut .= "</script>\n";
|
49 |
+
$emosOut .= "\n<a name=\"emos_name\" title=\"siteid\" rel=\"".$setSiteID."\" rev=\"\"></a>";
|
50 |
+
$emosOut .= "\n<a name=\"emos_name\" title=\"langid\" rel=\"".$setLangID."\" rev=\"\"></a>\n";
|
51 |
+
|
52 |
+
if(stristr($this->getMessagesBlock()->getGroupedHtml(),'error-msg') != false) {
|
53 |
+
$emosOut .= "<a name=\"emos_name\" title=\"login\" rel=\"".$customerId."\" rev=\"1\"></a>\n";
|
54 |
+
}
|
55 |
+
$isLoggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
|
56 |
+
|
57 |
+
if($isLoggedIn == 1 && $opsession->getData('econda_logged') != 2) {
|
58 |
+
$emosOut .= "<a name=\"emos_name\" title=\"login\" rel=\"".$customerId."\" rev=\"0\"></a>\n";
|
59 |
+
$opsession->setData('econda_logged','2');
|
60 |
+
}
|
61 |
+
|
62 |
+
echo $emosOut;
|
63 |
+
echo $emosInclude;
|
64 |
+
echo $opInclude;
|
65 |
+
echo "\n<!-- End Econda-Monitor -->\n";
|
66 |
+
}
|
67 |
+
|
68 |
+
|
69 |
+
function dataFormat($str) {
|
70 |
+
$str = urldecode($str);
|
71 |
+
if (function_exists('htmlspecialchars_decode')) {
|
72 |
+
$str = htmlspecialchars_decode($str, ENT_QUOTES);
|
73 |
+
} else {
|
74 |
+
$str = $this->htmlspecialchars_decode_php4($str);
|
75 |
+
}
|
76 |
+
$str = html_entity_decode($str);
|
77 |
+
$str = strip_tags($str);
|
78 |
+
$str = trim($str);
|
79 |
+
|
80 |
+
$nbsp = chr(0xa0);
|
81 |
+
$str = str_replace($nbsp, " ", $str);
|
82 |
+
$str = str_replace("\"", "", $str);
|
83 |
+
$str = str_replace("'", "", $str);
|
84 |
+
$str = str_replace("%", "", $str);
|
85 |
+
$str = str_replace(",", "", $str);
|
86 |
+
$str = str_replace(";", "", $str);
|
87 |
+
while (true) {
|
88 |
+
$str_temp = $str;
|
89 |
+
$str = str_replace(" ", " ", $str);
|
90 |
+
|
91 |
+
if ($str == $str_temp) {
|
92 |
+
break;
|
93 |
+
}
|
94 |
+
}
|
95 |
+
$str = str_replace(" / ", "/", $str);
|
96 |
+
$str = str_replace(" /", "/", $str);
|
97 |
+
$str = str_replace("/ ", "/", $str);
|
98 |
+
|
99 |
+
$str = substr($str, 0, 254);
|
100 |
+
$str = rawurlencode($str);
|
101 |
+
return $str;
|
102 |
+
}
|
103 |
+
?>
|
104 |
+
|
app/etc/modules/Mage_Econda.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mage_Econda>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Mage_Econda>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/locale/de_AT/Mage_Econda.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
"Used Language","Verwendete Sprache"
|
2 |
+
"Settings","Einstellungen"
|
3 |
+
"Select only the language, which at the time of initial activation of your econda product has been selected.","Nur die Sprache verwenden, welche bei der ersten Aktivierung Ihres econda Produktes ausgewählt wurde."
|
app/locale/de_CH/Mage_Econda.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
"Used Language","Verwendete Sprache"
|
2 |
+
"Settings","Einstellungen"
|
3 |
+
"Select only the language, which at the time of initial activation of your econda product has been selected.","Nur die Sprache verwenden, welche bei der ersten Aktivierung Ihres econda Produktes ausgewählt wurde."
|
app/locale/de_DE/Mage_Econda.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
"Used Language","Verwendete Sprache"
|
2 |
+
"Settings","Einstellungen"
|
3 |
+
"Select only the language, which at the time of initial activation of your econda product has been selected.","Nur die Sprache verwenden, welche bei der ersten Aktivierung Ihres econda Produktes ausgewählt wurde."
|
app/locale/en_US/Mage_Econda.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
"Used Language","Used Language"
|
2 |
+
"Settings","Settings"
|
3 |
+
"Select only the language, which at the time of initial activation of your econda product has been selected.","Select only the language, which at the time of initial activation of your econda product has been selected."
|
js/tracker/emosop.js
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var sendOne = 1;
|
2 |
+
var orderProcess = '';
|
3 |
+
var contentLabel = '';
|
4 |
+
|
5 |
+
if (document.addEventListener){
|
6 |
+
document.addEventListener("mousemove", onePageTracker, false);
|
7 |
+
}
|
8 |
+
else if (document.attachEvent){ //IE
|
9 |
+
document.attachEvent("onmousemove", onePageTracker);
|
10 |
+
}
|
11 |
+
|
12 |
+
function onePageTracker() {
|
13 |
+
|
14 |
+
orderProcess = '';
|
15 |
+
contentLabel = '';
|
16 |
+
|
17 |
+
if(document.getElementById('opc-login')) {
|
18 |
+
if(stristr(document.getElementById('opc-login').className,'active') != false && sendOne == 1) {
|
19 |
+
orderProcess = '2_' + ecStep[0];
|
20 |
+
contentLabel = ecStep[0];
|
21 |
+
sendOne += 1;
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
if(stristr(document.getElementById('opc-billing').className,'active') != false && (sendOne == 1 || sendOne == 2)) {
|
26 |
+
orderProcess = '3_' + ecStep[1];
|
27 |
+
contentLabel = ecStep[6];
|
28 |
+
if(sendOne == 1) {
|
29 |
+
sendOne += 1;
|
30 |
+
}
|
31 |
+
sendOne += 1;
|
32 |
+
}
|
33 |
+
|
34 |
+
if(stristr(document.getElementById('opc-shipping').className,'active') != false && sendOne == 3) {
|
35 |
+
orderProcess = '4_' + ecStep[2];
|
36 |
+
contentLabel = ecStep[2];
|
37 |
+
sendOne += 1;
|
38 |
+
}
|
39 |
+
|
40 |
+
if(stristr(document.getElementById('opc-shipping_method').className,'active') != false && (sendOne == 3 || sendOne == 4)) {
|
41 |
+
orderProcess = '4_' + ecStep[3];
|
42 |
+
contentLabel = ecStep[3];
|
43 |
+
if(sendOne == 3) {
|
44 |
+
sendOne += 1;
|
45 |
+
}
|
46 |
+
sendOne += 1;
|
47 |
+
}
|
48 |
+
|
49 |
+
if(stristr(document.getElementById('opc-payment').className,'active') != false && sendOne == 5) {
|
50 |
+
orderProcess = '5_' + ecStep[4];
|
51 |
+
contentLabel = ecStep[4];
|
52 |
+
sendOne += 1;
|
53 |
+
}
|
54 |
+
|
55 |
+
if(stristr(document.getElementById('opc-review').className,'active') != false && sendOne == 6) {
|
56 |
+
orderProcess = '6_' + ecStep[5];
|
57 |
+
contentLabel = ecStep[5];
|
58 |
+
sendOne += 1;
|
59 |
+
}
|
60 |
+
|
61 |
+
if (orderProcess != '') {
|
62 |
+
var properties = {};
|
63 |
+
properties.orderProcess=orderProcess;
|
64 |
+
properties.content='Start/' + ecStep[7] + '/' + contentLabel;
|
65 |
+
window.emosPropertiesEvent(properties);
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
function stristr(haystack,needle,bool) {
|
70 |
+
var pos = 0;
|
71 |
+
haystack += '';
|
72 |
+
pos = haystack.toLowerCase().indexOf( (needle+'').toLowerCase() );
|
73 |
+
if( pos == -1 ){
|
74 |
+
return false;
|
75 |
+
} else{
|
76 |
+
if( bool ){
|
77 |
+
return haystack.substr(0,pos);
|
78 |
+
} else{
|
79 |
+
return haystack.slice(pos);
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Mage_Econda</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Bindet econda Web Controlling in Magento ein. Inserts econda Web Contolling into Magento.</summary>
|
10 |
+
<description>Bindet econda Web Controlling in Magento ein. Weitere Informationen unter http://www.econda.de. Inserts econda Web Contolling into Magento. For further information visit http://www.econda.de/</description>
|
11 |
+
<notes>Release for econda Web Controlling functions.</notes>
|
12 |
+
<authors><author><name>ecdev</name><user>auto-converted</user><email>bebop30@gmx.net</email></author></authors>
|
13 |
+
<date>2009-06-25</date>
|
14 |
+
<time>14:34:00</time>
|
15 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="econda.xml" hash="cbb5b0bc56602498ea5fc0af88a847ab"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="econda.xml" hash="7997011c0987fd24178f27f2c9a89fc4"/></dir><dir name="template"><dir name="econda"><file name="tracker.phtml" hash="f3f4a75988775e652255a27b19a190ba"/><file name="trackerop.phtml" hash="9f423e8db39a5f926bac9373b72631e4"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_AT"><file name="Mage_Econda.csv" hash="d34ccda243a4d5422e78e271c5582701"/></dir><dir name="de_CH"><file name="Mage_Econda.csv" hash="d34ccda243a4d5422e78e271c5582701"/></dir><dir name="de_DE"><file name="Mage_Econda.csv" hash="d34ccda243a4d5422e78e271c5582701"/></dir><dir name="en_US"><file name="Mage_Econda.csv" hash="b6c45b488af70218583ba61764f43fce"/></dir></target><target name="mageweb"><dir name="js"><dir name="tracker"><file name="emosop.js" hash="ed5590349e9654766f42fb63d47a7366"/></dir></dir></target><target name="magelocal"><dir name="Mage"><dir name="Econda"><dir name="Block"><file name="Econda.php" hash="db83e52eec7940261e8134831d9cdeec"/><file name="emos.php" hash="9724a5fd1c5bcb3066d22f60a59acab8"/><dir name="Adminhtml"><file name="Econda.php" hash="dfe2f3270e832a0f9952e262a26a12ee"/><file name="Tracker.php" hash="9a8820c2f5d1b105dfeb023926e0d368"/><dir name="Econda"><file name="Edit.php" hash="43a19bcffd20b3e4c4b497503f7adf2a"/><file name="Grid.php" hash="d92771738a4e196a9ebb255e94e5c8eb"/><dir name="Edit"><file name="Form.php" hash="8e765540fc4aaaf487cbc976b74147bc"/><file name="Tabs.php" hash="86e7ac45dfaa6ac89e30c709f5311538"/><dir name="Tab"><file name="Form.php" hash="eb9530cada5105bf190b927b970744b7"/></dir></dir></dir><dir name="Tracker"><file name="Edit.php" hash="c0496415a5f1d0021b1d2d2313ed0eff"/><file name="Grid.php" hash="3318d472ac71cce739696b287cb81557"/><dir name="Edit"><file name="Form.php" hash="f292fa68f4782eadcac34d757fdce073"/><file name="Tabs.php" hash="c02f68b55b22d77158b841c89af5b230"/><dir name="Tab"><file name="Form.php" hash="3f463742e5f9c61e88c929c70502bf22"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="253cbb1316220834b9c6222792e59fc4"/><dir name="Adminhtml"><file name="EcondaController.php" hash="8dad3d7cb5ec59fadc5bb1ba5aafae14"/><file name="TrackerController.php" hash="12fdf5c3b1c9ca04cc899faf3272a3e0"/></dir></dir><dir name="etc"><file name="config.xml" hash="9e928ac5aece32953dc5b43d9108ffdc"/><file name="system.xml" hash="9f2cd7c5625ceb7221223f63bb6339da"/></dir><dir name="Helper"><file name="Data.php" hash="a2e8e8cc0b42886d8e7fdf6239ac5180"/></dir><dir name="Language"><file name="english.php" hash="d0fa9b08a9cfb9e7c5e8003a5839a22f"/><file name="german.php" hash="d181289a8024e2b4d9f69150fad54ddc"/></dir><dir name="Model"><file name="Econda.php" hash="2129423b43edaa5ad86ca1ce2925f4d5"/><file name="Status.php" hash="8c73ee6feba08a3a9c9cf73105751cbd"/><dir name="Mysql4"><file name="Econda.php" hash="9e3244467bdb6bef7519e90c7b8b9dd8"/><file name="Tracker.php" hash="d0493cdc60d3b3fd7d3e548480641823"/><dir name="Econda"><file name="Collection.php" hash="78207d4301d2d3b6a63121f8b57ae989"/></dir><dir name="Tracker"><file name="Collection.php" hash="411183409afca6ec33aff08fa4884d0f"/></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Language.php" hash="d125200a9df69489692c606f2452e351"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Econda.xml" hash="4857a6367896368610cda11f31de2822"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies/>
|
18 |
+
</package>
|