Version Notes
A simple addition to your Magento store's search engine, our Shop By Manufacturer extension allows customers to search products based on brands / manufacturers.
Download this release
Release Info
Developer | Magebuzz |
Extension | magebuzz-shop-by-manufacturer |
Version | 0.1.5 |
Comparing to | |
See all releases |
Version 0.1.5
- app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer.php +51 -0
- app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Edit.php +43 -0
- app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Form.php +23 -0
- app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Tab/Form.php +115 -0
- app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Tab/Meta.php +28 -0
- app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Tab/Products.php +200 -0
- app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Tabs.php +38 -0
- app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Grid.php +154 -0
- app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Serializer.php +21 -0
- app/code/local/Magebuzz/Manufacturer/Block/Left.php +24 -0
- app/code/local/Magebuzz/Manufacturer/Block/Manufacturer.php +105 -0
- app/code/local/Magebuzz/Manufacturer/Block/Product.php +18 -0
- app/code/local/Magebuzz/Manufacturer/Block/Product/Manufacturer.php +24 -0
- app/code/local/Magebuzz/Manufacturer/Block/Sidebar.php +14 -0
- app/code/local/Magebuzz/Manufacturer/Block/View.php +57 -0
- app/code/local/Magebuzz/Manufacturer/Controller/Router.php +48 -0
- app/code/local/Magebuzz/Manufacturer/Helper/Data.php +166 -0
- app/code/local/Magebuzz/Manufacturer/Model/Manufacturer.php +127 -0
- app/code/local/Magebuzz/Manufacturer/Model/Mysql4/Manufacturer.php +80 -0
- app/code/local/Magebuzz/Manufacturer/Model/Mysql4/Manufacturer/Collection.php +14 -0
- app/code/local/Magebuzz/Manufacturer/Model/Noterouter.php +55 -0
- app/code/local/Magebuzz/Manufacturer/Model/Status.php +19 -0
- app/code/local/Magebuzz/Manufacturer/Model/Validatemanufacturer.php +23 -0
- app/code/local/Magebuzz/Manufacturer/controllers/Adminhtml/ManufacturerController.php +412 -0
- app/code/local/Magebuzz/Manufacturer/controllers/IndexController.php +34 -0
- app/code/local/Magebuzz/Manufacturer/etc/adminhtml.xml +60 -0
- app/code/local/Magebuzz/Manufacturer/etc/config.xml +125 -0
- app/code/local/Magebuzz/Manufacturer/etc/system.xml +156 -0
- app/code/local/Magebuzz/Manufacturer/sql/manufacturer_setup/mysql4-install-0.1.0.php +22 -0
- app/code/local/Magebuzz/Manufacturer/sql/manufacturer_setup/mysql4-upgrade-0.1.0-0.1.1.php +16 -0
- app/code/local/Magebuzz/Manufacturer/sql/manufacturer_setup/mysql4-upgrade-0.1.1-0.1.2.php +11 -0
- app/design/adminhtml/default/default/layout/manufacturer.xml +37 -0
- app/design/adminhtml/default/default/template/manufacturer/notifications.phtml +9 -0
- app/design/frontend/base/default/layout/manufacturer.xml +96 -0
- app/design/frontend/base/default/template/manufacturer/manufacturer.phtml +96 -0
- app/design/frontend/base/default/template/manufacturer/product/manufacturer.phtml +12 -0
- app/design/frontend/base/default/template/manufacturer/sidebar.phtml +28 -0
- app/design/frontend/base/default/template/manufacturer/view.phtml +26 -0
- app/etc/modules/Magebuzz_Manufacturer.xml +9 -0
- app/locale/en_US/Magebuzz_Manufacturer.csv +0 -0
- js/magebuzz/jquery.js +11 -0
- js/magebuzz/jquery.scrollShow.js +136 -0
- js/magebuzz/jquery.scrollTo-min.js +10 -0
- js/magebuzz/manufacturer/jquery.js +28 -0
- js/magebuzz/manufacturer/jquery.scrollShow.js +140 -0
- js/magebuzz/manufacturer/jquery.scrollTo-min.js +44 -0
- js/magebuzz/manufacturer/manufacturer_slider.js +20 -0
- js/magebuzz/manufacturer_slider.js +20 -0
- package.xml +18 -0
- skin/frontend/base/default/css/magebuzz/manufacturer.css +93 -0
- skin/frontend/base/default/css/magebuzz/manufacturer/btn_next-hover.png +0 -0
- skin/frontend/base/default/css/magebuzz/manufacturer/btn_next.png +0 -0
- skin/frontend/base/default/css/magebuzz/manufacturer/btn_prev-hover.png +0 -0
- skin/frontend/base/default/css/magebuzz/manufacturer/btn_prev.png +0 -0
app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Adminhtml_Manufacturer extends Mage_Adminhtml_Block_Widget_Grid_Container
|
8 |
+
{
|
9 |
+
public function __construct()
|
10 |
+
{
|
11 |
+
$this->_controller = 'adminhtml_manufacturer';
|
12 |
+
$this->_blockGroup = 'manufacturer';
|
13 |
+
$this->_headerText = Mage::helper('manufacturer')->__('Manufacturer Manager');
|
14 |
+
$this->_addButtonLabel = Mage::helper('manufacturer')->__('Add Manufacturer');
|
15 |
+
$this->_addButton('import_from_magento', array(
|
16 |
+
'label' => Mage::helper('manufacturer')->__('Update Manufacturer from Magento'),
|
17 |
+
'onclick' => 'setLocation(\'' . $this->_getImportUrl() . '\')',
|
18 |
+
'class' => 'add',
|
19 |
+
));
|
20 |
+
|
21 |
+
$this->_addButton('reindex_url', array(
|
22 |
+
'label' => Mage::helper('manufacturer')->__('Reindex Manufacturer URL'),
|
23 |
+
'onclick' => 'setLocation(\'' . $this->_getReindexUrl() . '\')',
|
24 |
+
'class' => ''
|
25 |
+
));
|
26 |
+
|
27 |
+
parent::__construct();
|
28 |
+
}
|
29 |
+
|
30 |
+
protected function _getImportUrl()
|
31 |
+
{
|
32 |
+
return $this->getUrl('*/*/import', array('_secure' => TRUE));
|
33 |
+
}
|
34 |
+
|
35 |
+
protected function _getReindexUrl()
|
36 |
+
{
|
37 |
+
return $this->getUrl('*/*/reindex', array('_secure' => TRUE));
|
38 |
+
}
|
39 |
+
|
40 |
+
public function getNotification()
|
41 |
+
{
|
42 |
+
$helper = Mage::helper('manufacturer');
|
43 |
+
$urls = Mage::getModel('core/url_rewrite')->getCollection()
|
44 |
+
->addFieldToFilter('request_path', array('like' => $helper->getConfigTextRouter() . '%'));
|
45 |
+
if (!count($urls)) {
|
46 |
+
return TRUE;
|
47 |
+
} else {
|
48 |
+
return FALSE;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Edit.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Adminhtml_Manufacturer_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
8 |
+
{
|
9 |
+
public function __construct()
|
10 |
+
{
|
11 |
+
parent::__construct();
|
12 |
+
|
13 |
+
$this->_objectId = 'id';
|
14 |
+
$this->_blockGroup = 'manufacturer';
|
15 |
+
$this->_controller = 'adminhtml_manufacturer';
|
16 |
+
$this->_updateButton('save', 'label', Mage::helper('manufacturer')->__('Save Manufacturer'));
|
17 |
+
$this->_updateButton('delete', 'label', Mage::helper('manufacturer')->__('Delete Manufacturer'));
|
18 |
+
$this->_addButton('saveandcontinue', array(
|
19 |
+
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
20 |
+
'onclick' => 'saveAndContinueEdit()',
|
21 |
+
'class' => 'save',
|
22 |
+
), -100);
|
23 |
+
$this->_formScripts[] = "
|
24 |
+
function saveAndContinueEdit(){
|
25 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
26 |
+
}
|
27 |
+
";
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getSaveUrl()
|
31 |
+
{
|
32 |
+
return $this->getUrl('*/*/save', array('store' => $this->getRequest()->getParam('store')));
|
33 |
+
}
|
34 |
+
|
35 |
+
public function getHeaderText()
|
36 |
+
{
|
37 |
+
if (Mage::registry('manufacturer_data') && Mage::registry('manufacturer_data')->getId()) {
|
38 |
+
return Mage::helper('manufacturer')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('manufacturer_data')->getName()));
|
39 |
+
} else {
|
40 |
+
return Mage::helper('manufacturer')->__('Add Item');
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Form.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Adminhtml_Manufacturer_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
8 |
+
{
|
9 |
+
protected function _prepareForm()
|
10 |
+
{
|
11 |
+
$form = new Varien_Data_Form(array(
|
12 |
+
'id' => 'edit_form',
|
13 |
+
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
14 |
+
'method' => 'post',
|
15 |
+
'enctype' => 'multipart/form-data'
|
16 |
+
)
|
17 |
+
);
|
18 |
+
|
19 |
+
$form->setUseContainer(TRUE);
|
20 |
+
$this->setForm($form);
|
21 |
+
return parent::_prepareForm();
|
22 |
+
}
|
23 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Adminhtml_Manufacturer_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
8 |
+
{
|
9 |
+
protected function _prepareForm()
|
10 |
+
{
|
11 |
+
$form = new Varien_Data_Form();
|
12 |
+
$this->setForm($form);
|
13 |
+
$fieldset = $form->addFieldset('manufacturer_form', array('legend' => Mage::helper('manufacturer')->__('Item information')));
|
14 |
+
$manufacturer_data = array();
|
15 |
+
$model = Mage::registry('manufacturer_data');
|
16 |
+
if (Mage::getSingleton('adminhtml/session')->getManufacturerData()) {
|
17 |
+
$manufacturer_data = Mage::getSingleton('adminhtml/session')->getManufacturerData();
|
18 |
+
Mage::getSingleton('adminhtml/session')->setManufacturerData(null);
|
19 |
+
} elseif (Mage::registry('manufacturer_data')) {
|
20 |
+
$manufacturer_data = Mage::registry('manufacturer_data')->getData();
|
21 |
+
}
|
22 |
+
|
23 |
+
if (isset($manufacturer_data['image']) && $manufacturer_data['image'] != '') {
|
24 |
+
$manufacturer_data['image'] = 'manufacturer/' . $manufacturer_data['image'];
|
25 |
+
}
|
26 |
+
if (!isset($manufacturer_data['manufacturer_id']) || ($manufacturer_data['manufacturer_id'] == null)) {
|
27 |
+
$fieldset->addField('name', 'text', array(
|
28 |
+
'label' => Mage::helper('manufacturer')->__('Name'),
|
29 |
+
'class' => 'required-entry',
|
30 |
+
'required' => TRUE,
|
31 |
+
'name' => 'name',
|
32 |
+
));
|
33 |
+
} else {
|
34 |
+
$fieldset->addField('name', 'text', array(
|
35 |
+
'label' => Mage::helper('manufacturer')->__('Name'),
|
36 |
+
'class' => 'required-entry',
|
37 |
+
'required' => TRUE,
|
38 |
+
'name' => 'name',
|
39 |
+
'readonly' => 'readonly',
|
40 |
+
));
|
41 |
+
}
|
42 |
+
$fieldset->addField('identifier', 'text', array(
|
43 |
+
'label' => Mage::helper('manufacturer')->__('URL Identifier'),
|
44 |
+
'class' => 'required-entry',
|
45 |
+
'required' => TRUE,
|
46 |
+
'name' => 'identifier',
|
47 |
+
/* 'readonly' => 'readonly', */
|
48 |
+
));
|
49 |
+
$fieldset->addField('image', 'image', array(
|
50 |
+
'label' => Mage::helper('manufacturer')->__('Image'),
|
51 |
+
'required' => FALSE,
|
52 |
+
'name' => 'image',
|
53 |
+
));
|
54 |
+
if (!Mage::app()->isSingleStoreMode()) {
|
55 |
+
$fieldset->addField('store_id', 'multiselect', array(
|
56 |
+
'name' => 'stores[]',
|
57 |
+
'label' => Mage::helper('cms')->__('Store View'),
|
58 |
+
'title' => Mage::helper('cms')->__('Store View'),
|
59 |
+
'required' => TRUE,
|
60 |
+
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(FALSE, TRUE)
|
61 |
+
));
|
62 |
+
} else {
|
63 |
+
$fieldset->addField('store_id', 'hidden', array(
|
64 |
+
'name' => 'stores[]',
|
65 |
+
'value' => Mage::app()->getStore(TRUE)->getId()
|
66 |
+
));
|
67 |
+
}
|
68 |
+
$fieldset->addField('website', 'text', array(
|
69 |
+
'label' => Mage::helper('manufacturer')->__('Website'),
|
70 |
+
'required' => FALSE,
|
71 |
+
'name' => 'website',
|
72 |
+
));
|
73 |
+
$fieldset->addField('is_featured', 'select', array(
|
74 |
+
'label' => Mage::helper('manufacturer')->__('Featured Manufacturer'),
|
75 |
+
'name' => 'is_featured',
|
76 |
+
'values' => array(
|
77 |
+
array(
|
78 |
+
'value' => 1,
|
79 |
+
'label' => Mage::helper('manufacturer')->__('Yes'),
|
80 |
+
),
|
81 |
+
array(
|
82 |
+
'value' => 0,
|
83 |
+
'label' => Mage::helper('manufacturer')->__('No'),
|
84 |
+
),
|
85 |
+
),
|
86 |
+
));
|
87 |
+
|
88 |
+
$fieldset->addField('status', 'select', array(
|
89 |
+
'label' => Mage::helper('manufacturer')->__('Status'),
|
90 |
+
'name' => 'status',
|
91 |
+
'values' => array(
|
92 |
+
array(
|
93 |
+
'value' => 1,
|
94 |
+
'label' => Mage::helper('manufacturer')->__('Enabled'),
|
95 |
+
),
|
96 |
+
array(
|
97 |
+
'value' => 0,
|
98 |
+
'label' => Mage::helper('manufacturer')->__('Disabled'),
|
99 |
+
),
|
100 |
+
),
|
101 |
+
));
|
102 |
+
|
103 |
+
$fieldset->addField('description', 'editor', array(
|
104 |
+
'name' => 'description',
|
105 |
+
'label' => Mage::helper('manufacturer')->__('Description'),
|
106 |
+
'title' => Mage::helper('manufacturer')->__('Description'),
|
107 |
+
'style' => 'width:700px; height:150px;',
|
108 |
+
'wysiwyg' => FALSE,
|
109 |
+
'required' => FALSE,
|
110 |
+
));
|
111 |
+
|
112 |
+
$form->setValues($manufacturer_data);
|
113 |
+
return parent::_prepareForm();
|
114 |
+
}
|
115 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Tab/Meta.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Adminhtml_Manufacturer_Edit_Tab_Meta extends Mage_Adminhtml_Block_Widget_Form
|
8 |
+
{
|
9 |
+
protected function _prepareForm()
|
10 |
+
{
|
11 |
+
$form = new Varien_Data_Form();
|
12 |
+
$model = Mage::registry('manufacturer_data');
|
13 |
+
$fieldset = $form->addFieldset('meta_fieldset', array('legend' => Mage::helper('manufacturer')->__('Meta Data'), 'class' => 'fieldset-wide'));
|
14 |
+
$fieldset->addField('meta_keywords', 'textarea', array(
|
15 |
+
'name' => 'meta_keywords',
|
16 |
+
'label' => Mage::helper('manufacturer')->__('Keywords'),
|
17 |
+
'title' => Mage::helper('manufacturer')->__('Meta Keywords')
|
18 |
+
));
|
19 |
+
$fieldset->addField('meta_description', 'textarea', array(
|
20 |
+
'name' => 'meta_description',
|
21 |
+
'label' => Mage::helper('manufacturer')->__('Description'),
|
22 |
+
'title' => Mage::helper('manufacturer')->__('Meta Description')
|
23 |
+
));
|
24 |
+
$form->setValues($model->getData());
|
25 |
+
$this->setForm($form);
|
26 |
+
return parent::_prepareForm();
|
27 |
+
}
|
28 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Tab/Products.php
ADDED
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Adminhtml_Manufacturer_Edit_Tab_Products extends Mage_Adminhtml_Block_Widget_Grid
|
8 |
+
{
|
9 |
+
public function __construct()
|
10 |
+
{
|
11 |
+
parent::__construct();
|
12 |
+
$this->setId('manufacturer_product_grid');
|
13 |
+
$this->setDefaultSort('entity_id');
|
14 |
+
$this->setUseAjax(TRUE);
|
15 |
+
$this->getSelectedProducts();
|
16 |
+
}
|
17 |
+
|
18 |
+
protected function _addColumnFilterToCollection($column)
|
19 |
+
{
|
20 |
+
if ($column->getId() == 'in_manufacturer') {
|
21 |
+
$productIds = $this->_getSelectedProducts();
|
22 |
+
if (empty($productIds)) {
|
23 |
+
$productIds = 0;
|
24 |
+
}
|
25 |
+
if ($column->getFilter()->getValue()) {
|
26 |
+
$this->getCollection()->addFieldToFilter('entity_id', array('in' => $productIds));
|
27 |
+
} elseif (!empty($productIds)) {
|
28 |
+
$this->getCollection()->addFieldToFilter('entity_id', array('nin' => $productIds));
|
29 |
+
}
|
30 |
+
} else {
|
31 |
+
parent::_addColumnFilterToCollection($column);
|
32 |
+
}
|
33 |
+
return $this;
|
34 |
+
}
|
35 |
+
|
36 |
+
protected function _prepareCollection()
|
37 |
+
{
|
38 |
+
if ($this->getManufacturer()->getId()) {
|
39 |
+
$this->setDefaultFilter(array('in_manufacturer' => 1));
|
40 |
+
}
|
41 |
+
$store = $this->_getStore();
|
42 |
+
$collection = Mage::getModel('catalog/product')->getCollection()
|
43 |
+
->addAttributeToSelect('manufacturer')
|
44 |
+
->addAttributeToSelect('name')
|
45 |
+
->addAttributeToSelect('attribute_set_id')
|
46 |
+
->addAttributeToSelect('type_id')
|
47 |
+
->addFieldToFilter('type_id', 'simple');
|
48 |
+
if ($store->getId()) {
|
49 |
+
$adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;
|
50 |
+
$collection->addStoreFilter($store);
|
51 |
+
$collection->joinAttribute('name', 'catalog_product/name', 'entity_id', null, 'inner', $adminStore);
|
52 |
+
$collection->joinAttribute('custom_name', 'catalog_product/name', 'entity_id', null, 'inner', $store->getId());
|
53 |
+
$collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner', $store->getId());
|
54 |
+
$collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner', $store->getId());
|
55 |
+
$collection->joinAttribute('price', 'catalog_product/price', 'entity_id', null, 'left', $store->getId());
|
56 |
+
} else {
|
57 |
+
$collection->addAttributeToSelect('price');
|
58 |
+
$collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
|
59 |
+
$collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
|
60 |
+
}
|
61 |
+
|
62 |
+
$this->setCollection($collection);
|
63 |
+
return parent::_prepareCollection();
|
64 |
+
}
|
65 |
+
|
66 |
+
protected function _prepareColumns()
|
67 |
+
{
|
68 |
+
$this->addColumn('in_manufacturer', array(
|
69 |
+
'header_css_class' => 'a-center',
|
70 |
+
'type' => 'checkbox',
|
71 |
+
'name' => 'in_manufacturer',
|
72 |
+
'align' => 'center',
|
73 |
+
'index' => 'entity_id',
|
74 |
+
'values' => $this->_getSelectedProducts(),
|
75 |
+
));
|
76 |
+
|
77 |
+
$this->addColumn('entity_id', array(
|
78 |
+
'header' => Mage::helper('manufacturer')->__('ID'),
|
79 |
+
'width' => '50px',
|
80 |
+
'index' => 'entity_id',
|
81 |
+
'type' => 'number',
|
82 |
+
));
|
83 |
+
|
84 |
+
$this->addColumn('product_name', array(
|
85 |
+
'header' => Mage::helper('manufacturer')->__('Product Name'),
|
86 |
+
'index' => 'name'
|
87 |
+
));
|
88 |
+
|
89 |
+
$this->addColumn('type',
|
90 |
+
array(
|
91 |
+
'header' => Mage::helper('manufacturer')->__('Type'),
|
92 |
+
'width' => '60px',
|
93 |
+
'index' => 'type_id',
|
94 |
+
'type' => 'options',
|
95 |
+
'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),
|
96 |
+
));
|
97 |
+
|
98 |
+
$sets = Mage::getResourceModel('eav/entity_attribute_set_collection')
|
99 |
+
->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())
|
100 |
+
->load()
|
101 |
+
->toOptionHash();
|
102 |
+
|
103 |
+
$this->addColumn('set_name',
|
104 |
+
array(
|
105 |
+
'header' => Mage::helper('catalog')->__('Attrib. Set Name'),
|
106 |
+
'width' => '100px',
|
107 |
+
'index' => 'attribute_set_id',
|
108 |
+
'type' => 'options',
|
109 |
+
'options' => $sets,
|
110 |
+
));
|
111 |
+
|
112 |
+
$this->addColumn('sku',
|
113 |
+
array(
|
114 |
+
'header' => Mage::helper('catalog')->__('SKU'),
|
115 |
+
'width' => '80px',
|
116 |
+
'index' => 'sku',
|
117 |
+
));
|
118 |
+
|
119 |
+
$store = $this->_getStore();
|
120 |
+
$this->addColumn('price',
|
121 |
+
array(
|
122 |
+
'header' => Mage::helper('catalog')->__('Price'),
|
123 |
+
'type' => 'price',
|
124 |
+
'currency_code' => $store->getBaseCurrency()->getCode(),
|
125 |
+
'index' => 'price',
|
126 |
+
));
|
127 |
+
|
128 |
+
$this->addColumn('visibility',
|
129 |
+
array(
|
130 |
+
'header' => Mage::helper('catalog')->__('Visibility'),
|
131 |
+
'width' => '70px',
|
132 |
+
'index' => 'visibility',
|
133 |
+
'type' => 'options',
|
134 |
+
'options' => Mage::getModel('catalog/product_visibility')->getOptionArray(),
|
135 |
+
));
|
136 |
+
|
137 |
+
$this->addColumn('product_status',
|
138 |
+
array(
|
139 |
+
'header' => Mage::helper('catalog')->__('Status'),
|
140 |
+
'width' => '70px',
|
141 |
+
'index' => 'status',
|
142 |
+
'type' => 'options',
|
143 |
+
'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),
|
144 |
+
));
|
145 |
+
|
146 |
+
$this->addColumn('position', array(
|
147 |
+
'header' => Mage::helper('manufacturer')->__(''),
|
148 |
+
'name' => 'position',
|
149 |
+
'index' => 'position',
|
150 |
+
'width' => 0,
|
151 |
+
'editable' => TRUE,
|
152 |
+
'filter' => FALSE,
|
153 |
+
));
|
154 |
+
|
155 |
+
return parent::_prepareColumns();
|
156 |
+
}
|
157 |
+
|
158 |
+
public function getGridUrl()
|
159 |
+
{
|
160 |
+
return $this->getData('grid_url')
|
161 |
+
? $this->getData('grid_url')
|
162 |
+
: $this->getUrl('*/*/productlistGrid', array('_current' => TRUE, 'id' => $this->getRequest()->getParam('id')));
|
163 |
+
}
|
164 |
+
|
165 |
+
public function getRowUrl($row)
|
166 |
+
{
|
167 |
+
//return $this->getUrl('adminhtml/catalog_product/edit', array('id' => $row->getId()));
|
168 |
+
return "#";
|
169 |
+
}
|
170 |
+
|
171 |
+
protected function _getSelectedProducts()
|
172 |
+
{
|
173 |
+
$products = $this->getRequest()->getParam('oproduct');
|
174 |
+
if (is_null($products)) {
|
175 |
+
$products = array_keys($this->getSelectedProducts());
|
176 |
+
}
|
177 |
+
return $products;
|
178 |
+
}
|
179 |
+
|
180 |
+
public function getSelectedProducts()
|
181 |
+
{
|
182 |
+
$products = array();
|
183 |
+
$productIds = $this->getManufacturer()->getSelectedProductIds();
|
184 |
+
foreach ($productIds as $productId) {
|
185 |
+
$products[$productId] = array('position' => 0);
|
186 |
+
}
|
187 |
+
return $products;
|
188 |
+
}
|
189 |
+
|
190 |
+
public function getManufacturer()
|
191 |
+
{
|
192 |
+
return Mage::getModel('manufacturer/manufacturer')->load($this->getRequest()->getParam('id'));
|
193 |
+
}
|
194 |
+
|
195 |
+
protected function _getStore()
|
196 |
+
{
|
197 |
+
$storeId = (int)$this->getRequest()->getParam('store', 0);
|
198 |
+
return Mage::app()->getStore($storeId);
|
199 |
+
}
|
200 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Edit/Tabs.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Adminhtml_Manufacturer_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
8 |
+
{
|
9 |
+
public function __construct()
|
10 |
+
{
|
11 |
+
parent::__construct();
|
12 |
+
$this->setId('manufacturer_tabs');
|
13 |
+
$this->setDestElementId('edit_form');
|
14 |
+
$this->setTitle(Mage::helper('manufacturer')->__('Manufacturer Information'));
|
15 |
+
}
|
16 |
+
|
17 |
+
protected function _beforeToHtml()
|
18 |
+
{
|
19 |
+
$this->addTab('form_section', array(
|
20 |
+
'label' => Mage::helper('manufacturer')->__('Manufacturer Information'),
|
21 |
+
'title' => Mage::helper('manufacturer')->__('Manufacturer Information'),
|
22 |
+
'content' => $this->getLayout()->createBlock('manufacturer/adminhtml_manufacturer_edit_tab_form')->toHtml(),
|
23 |
+
));
|
24 |
+
|
25 |
+
$this->addTab('manufacturer_products', array(
|
26 |
+
'label' => Mage::helper('manufacturer')->__('Manufacturer Products'),
|
27 |
+
'title' => Mage::helper('manufacturer')->__('Manufacturer Products'),
|
28 |
+
'class' => 'ajax',
|
29 |
+
'url' => $this->getUrl('manufacturer/adminhtml_manufacturer/productlist', array('_current' => TRUE, 'id' => $this->getRequest()->getParam('id'))),
|
30 |
+
));
|
31 |
+
$this->addTab('manufacturer_meta_data', array(
|
32 |
+
'label' => Mage::helper('manufacturer')->__('Meta Data'),
|
33 |
+
'title' => Mage::helper('manufacturer')->__('Meta Data'),
|
34 |
+
'content' => $this->getLayout()->createBlock('manufacturer/adminhtml_manufacturer_edit_tab_meta')->toHtml(),
|
35 |
+
));
|
36 |
+
return parent::_beforeToHtml();
|
37 |
+
}
|
38 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Grid.php
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Adminhtml_Manufacturer_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
8 |
+
{
|
9 |
+
public function __construct()
|
10 |
+
{
|
11 |
+
parent::__construct();
|
12 |
+
$this->setId('manufacturerGrid');
|
13 |
+
$this->setDefaultSort('manufacturer_id');
|
14 |
+
$this->setDefaultDir('ASC');
|
15 |
+
$this->setSaveParametersInSession(TRUE);
|
16 |
+
}
|
17 |
+
|
18 |
+
protected function _prepareCollection()
|
19 |
+
{
|
20 |
+
$collection = Mage::getModel('manufacturer/manufacturer')->getCollection();
|
21 |
+
$this->setCollection($collection);
|
22 |
+
return parent::_prepareCollection();
|
23 |
+
}
|
24 |
+
|
25 |
+
protected function _afterLoadCollection()
|
26 |
+
{
|
27 |
+
$this->getCollection()->walk('afterLoad');
|
28 |
+
parent::_afterLoadCollection();
|
29 |
+
}
|
30 |
+
|
31 |
+
protected function _filterStoreCondition($collection, $column)
|
32 |
+
{
|
33 |
+
if (!$value = $column->getFilter()->getValue()) {
|
34 |
+
return;
|
35 |
+
}
|
36 |
+
$this->getCollection()->addStoreFilter($value);
|
37 |
+
}
|
38 |
+
|
39 |
+
protected function _prepareColumns()
|
40 |
+
{
|
41 |
+
$this->addColumn('manufacturer_id', array(
|
42 |
+
'header' => Mage::helper('manufacturer')->__('ID'),
|
43 |
+
'align' => 'right',
|
44 |
+
'width' => '50px',
|
45 |
+
'index' => 'manufacturer_id',
|
46 |
+
));
|
47 |
+
|
48 |
+
$this->addColumn('name', array(
|
49 |
+
'header' => Mage::helper('manufacturer')->__('Name'),
|
50 |
+
'align' => 'left',
|
51 |
+
'index' => 'name',
|
52 |
+
));
|
53 |
+
|
54 |
+
|
55 |
+
if (!Mage::app()->isSingleStoreMode()) {
|
56 |
+
$this->addColumn('store_id', array(
|
57 |
+
'header' => Mage::helper('manufacturer')->__('Store View'),
|
58 |
+
'index' => 'store_id',
|
59 |
+
'type' => 'store',
|
60 |
+
'store_all' => TRUE,
|
61 |
+
'store_view' => TRUE,
|
62 |
+
'sortable' => FALSE,
|
63 |
+
'filter_condition_callback'
|
64 |
+
=> array($this, '_filterStoreCondition'),
|
65 |
+
));
|
66 |
+
}
|
67 |
+
|
68 |
+
$this->addColumn('website', array(
|
69 |
+
'header' => Mage::helper('manufacturer')->__('Website'),
|
70 |
+
'align' => 'left',
|
71 |
+
'width' => '200px',
|
72 |
+
'index' => 'website',
|
73 |
+
));
|
74 |
+
|
75 |
+
$this->addColumn('is_featured', array(
|
76 |
+
'header' => Mage::helper('manufacturer')->__('Is Featured'),
|
77 |
+
'align' => 'left',
|
78 |
+
'width' => '80px',
|
79 |
+
'index' => 'is_featured',
|
80 |
+
'type' => 'options',
|
81 |
+
'options' => array(
|
82 |
+
1 => 'Yes',
|
83 |
+
0 => 'No',
|
84 |
+
),
|
85 |
+
));
|
86 |
+
|
87 |
+
$this->addColumn('status', array(
|
88 |
+
'header' => Mage::helper('manufacturer')->__('Status'),
|
89 |
+
'align' => 'left',
|
90 |
+
'width' => '80px',
|
91 |
+
'index' => 'status',
|
92 |
+
'type' => 'options',
|
93 |
+
'options' => array(
|
94 |
+
1 => 'Enabled',
|
95 |
+
0 => 'Disabled',
|
96 |
+
),
|
97 |
+
));
|
98 |
+
|
99 |
+
$this->addColumn('action',
|
100 |
+
array(
|
101 |
+
'header' => Mage::helper('manufacturer')->__('Action'),
|
102 |
+
'width' => '100',
|
103 |
+
'type' => 'action',
|
104 |
+
'getter' => 'getId',
|
105 |
+
'actions' => array(
|
106 |
+
array(
|
107 |
+
'caption' => Mage::helper('manufacturer')->__('Edit'),
|
108 |
+
'url' => array('base' => '*/*/edit'),
|
109 |
+
'field' => 'id'
|
110 |
+
)
|
111 |
+
),
|
112 |
+
'filter' => FALSE,
|
113 |
+
'sortable' => FALSE,
|
114 |
+
'index' => 'stores',
|
115 |
+
'is_system' => TRUE,
|
116 |
+
));
|
117 |
+
$this->addExportType('*/*/exportCsv', Mage::helper('manufacturer')->__('CSV'));
|
118 |
+
$this->addExportType('*/*/exportXml', Mage::helper('manufacturer')->__('XML'));
|
119 |
+
return parent::_prepareColumns();
|
120 |
+
}
|
121 |
+
|
122 |
+
protected function _prepareMassaction()
|
123 |
+
{
|
124 |
+
$this->setMassactionIdField('manufacturer_id');
|
125 |
+
$this->getMassactionBlock()->setFormFieldName('manufacturer');
|
126 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
127 |
+
'label' => Mage::helper('manufacturer')->__('Delete'),
|
128 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
129 |
+
'confirm' => Mage::helper('manufacturer')->__('Are you sure?')
|
130 |
+
));
|
131 |
+
$statuses = Mage::getSingleton('manufacturer/status')->getOptionArray();
|
132 |
+
array_unshift($statuses, array('label' => '', 'value' => ''));
|
133 |
+
$this->getMassactionBlock()->addItem('status', array(
|
134 |
+
'label' => Mage::helper('manufacturer')->__('Change status'),
|
135 |
+
'url' => $this->getUrl('*/*/massStatus', array('_current' => TRUE)),
|
136 |
+
'additional' => array(
|
137 |
+
'visibility' => array(
|
138 |
+
'name' => 'status',
|
139 |
+
'type' => 'select',
|
140 |
+
'class' => 'required-entry',
|
141 |
+
'label' => Mage::helper('manufacturer')->__('Status'),
|
142 |
+
'values' => $statuses
|
143 |
+
)
|
144 |
+
)
|
145 |
+
));
|
146 |
+
return $this;
|
147 |
+
}
|
148 |
+
|
149 |
+
public function getRowUrl($row)
|
150 |
+
{
|
151 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
152 |
+
}
|
153 |
+
|
154 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/Adminhtml/Manufacturer/Serializer.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Adminhtml_Manufacturer_Serializer extends Mage_Core_Block_Template
|
8 |
+
{
|
9 |
+
public function __construct()
|
10 |
+
{
|
11 |
+
parent::__construct();
|
12 |
+
return $this;
|
13 |
+
}
|
14 |
+
|
15 |
+
public function initSerializerBlock($gridName, $hiddenInputName)
|
16 |
+
{
|
17 |
+
$grid = $this->getLayout()->getBlock($gridName);
|
18 |
+
$this->setGridBlock($grid)
|
19 |
+
->setInputElementName($hiddenInputName);
|
20 |
+
}
|
21 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/Left.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Left extends Magebuzz_Manufacturer_Block_Manufacturer
|
8 |
+
{
|
9 |
+
public function _prepareLayout()
|
10 |
+
{
|
11 |
+
return parent::_prepareLayout();
|
12 |
+
}
|
13 |
+
|
14 |
+
public function displayOnSidebarBlock()
|
15 |
+
{
|
16 |
+
$block = $this->getParentBlock();
|
17 |
+
if ($block) {
|
18 |
+
if (Mage::getStoreConfig('manufacturer/general/enable_left_nav')) {
|
19 |
+
$sidebarBlock = $this->getLayout()->createBlock('manufacturer/sidebar');
|
20 |
+
$block->insert($sidebarBlock, '', FALSE, 'manufacturer-sidebar');
|
21 |
+
}
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/Manufacturer.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Manufacturer extends Mage_Core_Block_Template
|
8 |
+
{
|
9 |
+
public function _prepareLayout()
|
10 |
+
{
|
11 |
+
return parent::_prepareLayout();
|
12 |
+
}
|
13 |
+
|
14 |
+
public function getManufacturers()
|
15 |
+
{
|
16 |
+
$store_id = Mage::app()->getStore(TRUE)->getId();
|
17 |
+
$manufacturerIds = Mage::getModel('manufacturer/manufacturer')->getResource()->getManufacturerId($store_id);
|
18 |
+
if (count($manufacturerIds)) {
|
19 |
+
$collection = Mage::getModel('manufacturer/manufacturer')->getCollection()
|
20 |
+
->addFieldToFilter('manufacturer_id', $manufacturerIds)
|
21 |
+
->addFieldToFilter('status', 1);
|
22 |
+
if (Mage::helper('manufacturer')->isAlphabetOrder()) {
|
23 |
+
$collection->setOrder('name', 'ASC');
|
24 |
+
}
|
25 |
+
return $collection;
|
26 |
+
}
|
27 |
+
return FALSE;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function displayImage()
|
31 |
+
{
|
32 |
+
return Mage::helper('manufacturer')->displayImage();
|
33 |
+
}
|
34 |
+
|
35 |
+
public function groupAlphabet()
|
36 |
+
{
|
37 |
+
return Mage::helper('manufacturer')->groupAlphabet();
|
38 |
+
}
|
39 |
+
|
40 |
+
public function getFirstLetter($name)
|
41 |
+
{
|
42 |
+
return Mage::helper('manufacturer')->getFirstLetter($name);
|
43 |
+
}
|
44 |
+
|
45 |
+
public function getAvailableLetter($collection)
|
46 |
+
{
|
47 |
+
$prev = '';
|
48 |
+
$letters = array();
|
49 |
+
foreach ($collection as $manufacturer) {
|
50 |
+
$current = $this->getFirstLetter($manufacturer->getName());
|
51 |
+
if ($current != $prev) {
|
52 |
+
$letters[] = $current;
|
53 |
+
$prev = $current;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
return $letters;
|
57 |
+
}
|
58 |
+
|
59 |
+
public function getManufacturersByFirstLetter($letter)
|
60 |
+
{
|
61 |
+
$collection = Mage::getModel('manufacturer/manufacturer')->getCollection()
|
62 |
+
->addFieldToFilter('status', 1)
|
63 |
+
->addFieldToFilter('name', array('like' => $letter . '%'));
|
64 |
+
return $collection;
|
65 |
+
}
|
66 |
+
|
67 |
+
public function showFeaturedManufacturers()
|
68 |
+
{
|
69 |
+
return Mage::helper('manufacturer')->showFeaturedManufacturers();
|
70 |
+
}
|
71 |
+
|
72 |
+
public function getFeaturedImage($image)
|
73 |
+
{
|
74 |
+
if ($image == '') {
|
75 |
+
return Mage::helper('manufacturer')->getDefaultManufacturerImage();
|
76 |
+
} else {
|
77 |
+
return Mage::helper('manufacturer')->getManufacturerImage($image);
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
public function getManufacturerImageListingUrl($image)
|
82 |
+
{
|
83 |
+
return Mage::helper('manufacturer')->getManufacturerImageListingUrl($image);
|
84 |
+
}
|
85 |
+
|
86 |
+
public function getManufacturerUrl($id)
|
87 |
+
{
|
88 |
+
$manufacturer = Mage::getModel('manufacturer/manufacturer')->load($id);
|
89 |
+
return $this->getUrl() . $this->_helperMenufacturer()->getConfigTextRouter() . '/' . $manufacturer->getIdentifier();
|
90 |
+
}
|
91 |
+
|
92 |
+
public function getFeaturedManufacturers()
|
93 |
+
{
|
94 |
+
$collection = $this->getManufacturers();
|
95 |
+
if ($collection) {
|
96 |
+
$collection->addFieldToFilter('is_featured', 1);
|
97 |
+
}
|
98 |
+
return $collection;
|
99 |
+
}
|
100 |
+
|
101 |
+
protected function _helperMenufacturer()
|
102 |
+
{
|
103 |
+
return Mage::helper('manufacturer');
|
104 |
+
}
|
105 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/Product.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Product extends Mage_Catalog_Block_Product_List
|
8 |
+
{
|
9 |
+
protected function _getProductCollection()
|
10 |
+
{
|
11 |
+
$manufacturer_id = $this->getRequest()->getParam('id');
|
12 |
+
$collection = Mage::getModel('catalog/product')->getCollection()
|
13 |
+
->addAttributeToSelect('*');
|
14 |
+
$collection->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
|
15 |
+
$this->_productCollection = $collection;
|
16 |
+
return $this->_productCollection;
|
17 |
+
}
|
18 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/Product/Manufacturer.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Product_Manufacturer extends Mage_Catalog_Block_Product_View
|
8 |
+
{
|
9 |
+
protected function _prepareLayout()
|
10 |
+
{
|
11 |
+
return parent::_prepareLayout();
|
12 |
+
}
|
13 |
+
|
14 |
+
public function showManufacturerInProduct()
|
15 |
+
{
|
16 |
+
return Mage::helper('manufacturer')->showManufacturerInProduct();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getManufacturerByProductId($optionId)
|
20 |
+
{
|
21 |
+
$manufacturer = Mage::getModel('manufacturer/manufacturer')->loadByOptionId($optionId);
|
22 |
+
return $manufacturer;
|
23 |
+
}
|
24 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/Sidebar.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_Sidebar extends Magebuzz_Manufacturer_Block_Manufacturer
|
8 |
+
{
|
9 |
+
public function _construct()
|
10 |
+
{
|
11 |
+
$this->setTemplate('manufacturer/sidebar.phtml');
|
12 |
+
return parent::_construct();
|
13 |
+
}
|
14 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Block/View.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Block_View extends Mage_Core_Block_Template
|
8 |
+
{
|
9 |
+
public function _prepareLayout()
|
10 |
+
{
|
11 |
+
$id = $this->getRequest()->getParam('id');
|
12 |
+
$manufacturer = Mage::getModel('manufacturer/manufacturer')->load($id);
|
13 |
+
$head = $this->getLayout()->getBlock('head');
|
14 |
+
$head->setKeywords($manufacturer->getMetaKeywords());
|
15 |
+
$head->setDescription($manufacturer->getMetaDescription());
|
16 |
+
return parent::_prepareLayout();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getManufacturer()
|
20 |
+
{
|
21 |
+
$id = $this->getRequest()->getParam('id');
|
22 |
+
$manufacturer = Mage::getModel('manufacturer/manufacturer')->load($id);
|
23 |
+
return $manufacturer;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getManufacturerImage($image)
|
27 |
+
{
|
28 |
+
return Mage::helper('manufacturer')->getManufacturerImage($image);
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getProductHtml()
|
32 |
+
{
|
33 |
+
return $this->getChildHtml('manufacturer.product');
|
34 |
+
}
|
35 |
+
|
36 |
+
public function setListCollection()
|
37 |
+
{
|
38 |
+
$this->getChild('manufacturer.product')
|
39 |
+
->setCollection($this->_getProductCollection());
|
40 |
+
}
|
41 |
+
|
42 |
+
protected function _getProductCollection()
|
43 |
+
{
|
44 |
+
$manufacturer = $this->getManufacturer();
|
45 |
+
$collection = Mage::getModel('catalog/product')->getCollection()
|
46 |
+
->addAttributeToSelect('*')
|
47 |
+
->addAttributeToFilter(Mage::helper('manufacturer')->getConfigAttributrCode(), array('in' => array($manufacturer->getOptionId())))
|
48 |
+
->addFieldToFilter('status', 1);
|
49 |
+
// $collection->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
|
50 |
+
return $collection;
|
51 |
+
}
|
52 |
+
|
53 |
+
public function getDefaultManufacturerImage()
|
54 |
+
{
|
55 |
+
return Mage::helper('manufacturer')->getDefaultManufacturerImage();
|
56 |
+
}
|
57 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Controller/Router.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Controller_Router extends Mage_Core_Controller_Varien_Router_Abstract
|
8 |
+
{
|
9 |
+
public function initControllerRouters($observer)
|
10 |
+
{
|
11 |
+
$front = $observer->getEvent()->getFront();
|
12 |
+
$manufacturer = new Magebuzz_Manufacturer_Controller_Router();
|
13 |
+
$front->addRouter('manufacturer', $manufacturer);
|
14 |
+
}
|
15 |
+
|
16 |
+
public function match(Zend_Controller_Request_Http $request)
|
17 |
+
{
|
18 |
+
if (!Mage::app()->isInstalled()) {
|
19 |
+
Mage::app()->getFrontController()->getResponse()
|
20 |
+
->setRedirect(Mage::getUrl('install'))
|
21 |
+
->sendResponse();
|
22 |
+
exit;
|
23 |
+
}
|
24 |
+
$route = Mage::helper('manufacturer')->getConfigTextRouter();
|
25 |
+
$identifier = $request->getPathInfo();
|
26 |
+
|
27 |
+
if (substr(str_replace("/", "", $identifier), 0, strlen($route)) != $route) {
|
28 |
+
return FALSE;
|
29 |
+
}
|
30 |
+
$identifier = substr_replace($request->getPathInfo(), '', 0, strlen("/" . $route . "/"));
|
31 |
+
if (substr($request->getPathInfo(), 0, 13) !== '/manufacturer') {
|
32 |
+
if ($identifier == '') {
|
33 |
+
$request->setModuleName('manufacturer')
|
34 |
+
->setControllerName('index')
|
35 |
+
->setActionName('index');
|
36 |
+
return TRUE;
|
37 |
+
} elseif (substr($request->getPathInfo(), 0, strlen($route) + 2) === '/' . $route . '/') {
|
38 |
+
$request->setModuleName('manufacturer')
|
39 |
+
->setControllerName('index')
|
40 |
+
->setActionName('view');
|
41 |
+
return TRUE;
|
42 |
+
}
|
43 |
+
}
|
44 |
+
return FALSE;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
?>
|
app/code/local/Magebuzz/Manufacturer/Helper/Data.php
ADDED
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
class Magebuzz_Manufacturer_Helper_Data extends Mage_Core_Helper_Abstract
|
7 |
+
{
|
8 |
+
public function getManufacturerOptions()
|
9 |
+
{
|
10 |
+
$attributeId = Mage::getResourceModel('eav/entity_attribute')
|
11 |
+
->getIdByCode('catalog_product', $this->getConfigAttributrCode());
|
12 |
+
$attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
|
13 |
+
$attributeOptions = $attribute->getSource()->getAllOptions();
|
14 |
+
return $attributeOptions;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function generateIdentifier($string)
|
18 |
+
{
|
19 |
+
$identifier = preg_replace('#[^0-9a-z]+#i', '-', Mage::helper('catalog/product_url')->format($string));
|
20 |
+
$identifier = strtolower($identifier);
|
21 |
+
$identifier = trim($identifier, '-');
|
22 |
+
return $identifier;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function getOptionById($option_id)
|
26 |
+
{
|
27 |
+
$option = Mage::getModel('manufacturer/manufacturer')->getCollection()
|
28 |
+
->addFieldToFilter('option_id', $option_id)
|
29 |
+
->getFirstItem();
|
30 |
+
if ($option) return $option->getId();
|
31 |
+
return FALSE;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function getManufacturerOptionById($option_id)
|
35 |
+
{
|
36 |
+
$manufacturer_options = $this->getManufacturerOptions();
|
37 |
+
if (is_array($manufacturer_options)) {
|
38 |
+
foreach ($manufacturer_options as $option) {
|
39 |
+
if ($option_id == $option['value']) {
|
40 |
+
return TRUE;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
return FALSE;
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
public function renameImage($image_name)
|
48 |
+
{
|
49 |
+
$string = str_replace(" ", " ", $image_name);
|
50 |
+
$new_image_name = str_replace(" ", "-", $string);
|
51 |
+
$new_image_name = strtolower($new_image_name);
|
52 |
+
return $new_image_name;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function isAlphabetOrder()
|
56 |
+
{
|
57 |
+
return (bool)Mage::getStoreConfig('manufacturer/general/alphabet_sorting');
|
58 |
+
}
|
59 |
+
|
60 |
+
public function displayImage()
|
61 |
+
{
|
62 |
+
return (bool)Mage::getStoreConfig('manufacturer/general/show_image');
|
63 |
+
}
|
64 |
+
|
65 |
+
public function groupAlphabet()
|
66 |
+
{
|
67 |
+
return (bool)Mage::getStoreConfig('manufacturer/general/group_alphabet');
|
68 |
+
}
|
69 |
+
|
70 |
+
public function getFirstLetter($name)
|
71 |
+
{
|
72 |
+
$letter = '';
|
73 |
+
$name = trim($name);
|
74 |
+
$letter = strtoupper(substr($name, 0, 1));
|
75 |
+
return $letter;
|
76 |
+
}
|
77 |
+
|
78 |
+
public function showFeaturedManufacturers()
|
79 |
+
{
|
80 |
+
return (bool)Mage::getStoreConfig('manufacturer/general/show_featured_manufacturer');
|
81 |
+
}
|
82 |
+
|
83 |
+
public function getManufacturerImageListingUrl($image)
|
84 |
+
{
|
85 |
+
if (empty($image) || $image == '') return '';
|
86 |
+
$image_url = Mage::getBaseDir('media') . DS . 'manufacturer' . DS . $image;
|
87 |
+
$imageResized = Mage::getBaseDir('media') . DS . 'manufacturer' . DS . 'resized' . DS . $image;
|
88 |
+
if (!file_exists($imageResized) && file_exists($image_url)) {
|
89 |
+
$imageObj = new Varien_Image($image_url);
|
90 |
+
$imageObj->constrainOnly(TRUE);
|
91 |
+
$imageObj->keepAspectRatio(TRUE);
|
92 |
+
$imageObj->keepFrame(FALSE);
|
93 |
+
$imageObj->resize(80, 80);
|
94 |
+
$imageObj->save($imageResized);
|
95 |
+
}
|
96 |
+
return Mage::getBaseUrl('media') . 'manufacturer' . '/resized/' . $image;
|
97 |
+
}
|
98 |
+
|
99 |
+
public function getManufacturerImage($image)
|
100 |
+
{
|
101 |
+
if (empty($image) || $image == '') {
|
102 |
+
$default = $this->getDefaultManufacturerImage();
|
103 |
+
return $default;
|
104 |
+
} else {
|
105 |
+
return Mage::getBaseUrl('media') . 'manufacturer' . '/' . $image;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
public function getDefaultManufacturerImage()
|
110 |
+
{
|
111 |
+
$image = Mage::getStoreConfig('manufacturer/general/default_manufacturer_image');
|
112 |
+
if ($image != "") {
|
113 |
+
return Mage::getBaseUrl('media') . 'manufacturer/default' . '/' . $image;
|
114 |
+
}
|
115 |
+
return '';
|
116 |
+
}
|
117 |
+
|
118 |
+
public function showManufacturerInProduct()
|
119 |
+
{
|
120 |
+
return (bool)Mage::getStoreConfig('manufacturer/general/show_manufacturer_in_product_page');
|
121 |
+
}
|
122 |
+
|
123 |
+
public function getSelectedProducts($manufacturer_id)
|
124 |
+
{
|
125 |
+
$products = array();
|
126 |
+
$productIds = Mage::getModel('manufacturer/manufacturer')->load($manufacturer_id)->getSelectedProductIds();
|
127 |
+
foreach ($productIds as $productId) {
|
128 |
+
$products[$productId] = array('position' => 0);
|
129 |
+
}
|
130 |
+
return $products;
|
131 |
+
}
|
132 |
+
|
133 |
+
public function getConfigAttributrCode()
|
134 |
+
{
|
135 |
+
return Mage::getStoreConfig('manufacturer/configfield/text_attribute_code');
|
136 |
+
}
|
137 |
+
|
138 |
+
public function getConfigTextLabe()
|
139 |
+
{
|
140 |
+
return Mage::getStoreConfig('manufacturer/configfield/text_manufacturer_lable');
|
141 |
+
}
|
142 |
+
|
143 |
+
public function getConfigTextFeatured()
|
144 |
+
{
|
145 |
+
return Mage::getStoreConfig('manufacturer/configfield/text_featured_manufacturer_lable');
|
146 |
+
}
|
147 |
+
|
148 |
+
public function getConfigTextAll()
|
149 |
+
{
|
150 |
+
return Mage::getStoreConfig('manufacturer/configfield/text_all_manufacturer_lable');
|
151 |
+
}
|
152 |
+
|
153 |
+
public function getConfigTextRouter()
|
154 |
+
{
|
155 |
+
return strtolower(Mage::getStoreConfig('manufacturer/configfield/text_router'));
|
156 |
+
}
|
157 |
+
|
158 |
+
public function getManufacturerByIdentifier($idenfier)
|
159 |
+
{
|
160 |
+
$manufacturer = Mage::getModel('manufacturer/manufacturer')->getCollection()->AddFieldToFilter('identifier', $idenfier);
|
161 |
+
foreach ($manufacturer as $facturer) {
|
162 |
+
$idIdenfier = $facturer->getManufacturerId();
|
163 |
+
}
|
164 |
+
return $idIdenfier;
|
165 |
+
}
|
166 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Model/Manufacturer.php
ADDED
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Model_Manufacturer extends Mage_Core_Model_Abstract
|
8 |
+
{
|
9 |
+
public function _construct()
|
10 |
+
{
|
11 |
+
parent::_construct();
|
12 |
+
$this->_init('manufacturer/manufacturer');
|
13 |
+
}
|
14 |
+
|
15 |
+
protected function _afterLoad()
|
16 |
+
{
|
17 |
+
parent::_afterLoad();
|
18 |
+
$this->setData('store_id', $this->getResource()->getStoreId($this->getId()));
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getSelectedProductIds()
|
22 |
+
{
|
23 |
+
$produtIds = array();
|
24 |
+
$collection = Mage::getModel('catalog/product')->getCollection()
|
25 |
+
->addFieldToFilter(Mage::helper('manufacturer')->getConfigAttributrCode(), $this->getOptionId());
|
26 |
+
if (count($collection)) {
|
27 |
+
foreach ($collection as $item) {
|
28 |
+
$produtIds[] = $item->getEntityId();
|
29 |
+
}
|
30 |
+
}
|
31 |
+
return $produtIds;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function loadByOptionId($optionId)
|
35 |
+
{
|
36 |
+
$manufacturer = Mage::getModel('manufacturer/manufacturer')->getCollection()
|
37 |
+
->addFieldToFilter('option_id', $optionId)
|
38 |
+
->getFirstItem();
|
39 |
+
return $manufacturer;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function compareProductList($newarray, $oldarray, $manufaturer_option)
|
43 |
+
{
|
44 |
+
$insert = array_diff($newarray, $oldarray);
|
45 |
+
$delete = array_diff($oldarray, $newarray);
|
46 |
+
$resource = Mage::getSingleton('core/resource');
|
47 |
+
if (isset($newarray)) {
|
48 |
+
if (count($delete)) {
|
49 |
+
$manufac_attribute_code_del = $this->_hepper()->getConfigAttributrCode();
|
50 |
+
foreach ($delete as $del) {
|
51 |
+
$product = Mage::getModel('catalog/product')->load($del);
|
52 |
+
$product->setData($manufac_attribute_code_del,null)->save();
|
53 |
+
}
|
54 |
+
}
|
55 |
+
if (count($insert)) {
|
56 |
+
$manufac_attribute_code = $this->_hepper()->getConfigAttributrCode();
|
57 |
+
foreach ($insert as $pid) {
|
58 |
+
$product = Mage::getModel('catalog/product')->load($pid);
|
59 |
+
$product->setData($manufac_attribute_code,$manufaturer_option)->save();
|
60 |
+
}
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
public function addManufacturerOption($opdata)
|
66 |
+
{
|
67 |
+
|
68 |
+
$attribute = Mage::getModel('eav/entity_attribute')
|
69 |
+
->loadByCode('catalog_product', $this->_hepper()->getConfigAttributrCode())->getAttributeId();
|
70 |
+
$resource = Mage::getSingleton('core/resource');
|
71 |
+
$writeConnection = $resource->getConnection('core_write');
|
72 |
+
$attributeOption = array(
|
73 |
+
'attribute_id' => $attribute,
|
74 |
+
'sort_order' => 0,
|
75 |
+
);
|
76 |
+
$writeConnection->insert('eav_attribute_option', $attributeOption);
|
77 |
+
$lastInsertId = $writeConnection->lastInsertId();
|
78 |
+
foreach ($opdata['store_id'] as $storeId) {
|
79 |
+
$attOptionValue[] = array(
|
80 |
+
'option_id' => $lastInsertId,
|
81 |
+
'value' => $opdata['manufacturerName'],
|
82 |
+
'store_id' => $storeId,
|
83 |
+
);
|
84 |
+
}
|
85 |
+
if (isset($attOptionValue)) {
|
86 |
+
$writeConnection->insertMultiple('eav_attribute_option_value', $attOptionValue);
|
87 |
+
}
|
88 |
+
return $lastInsertId;
|
89 |
+
}
|
90 |
+
|
91 |
+
public function deleteManufacturerOption($manufacturer)
|
92 |
+
{
|
93 |
+
$manufacturerModel = $this->load($manufacturer);
|
94 |
+
$optionId = $manufacturerModel->getOptionId();
|
95 |
+
$resource = Mage::getSingleton('core/resource');
|
96 |
+
$writeConnection = $resource->getConnection('core_write');
|
97 |
+
$whereValue = 'eav_attribute_option_value.option_id = ' . $optionId;
|
98 |
+
$writeConnection->delete('eav_attribute_option_value', $whereValue);
|
99 |
+
$whereOption = 'eav_attribute_option.option_id = ' . $optionId;
|
100 |
+
$writeConnection->delete('eav_attribute_option', $whereOption);
|
101 |
+
}
|
102 |
+
|
103 |
+
public function getAllManufacturer($listOption)
|
104 |
+
{
|
105 |
+
$collection = $this->getCollection()->getData();
|
106 |
+
if (count($collection) > 0) {
|
107 |
+
$listManufacturer = array();
|
108 |
+
foreach ($collection as $manufacturer) {
|
109 |
+
$listManufacturer[] = $manufacturer['option_id'];
|
110 |
+
}
|
111 |
+
$options = array();
|
112 |
+
foreach ($listOption as $option) {
|
113 |
+
$options[] = $option['value'];
|
114 |
+
}
|
115 |
+
$delete = array_diff($listManufacturer, $options);
|
116 |
+
foreach ($delete as $del) {
|
117 |
+
$this->load($del, 'option_id')->delete();
|
118 |
+
}
|
119 |
+
}
|
120 |
+
return TRUE;
|
121 |
+
}
|
122 |
+
|
123 |
+
protected function _hepper()
|
124 |
+
{
|
125 |
+
return Mage::helper('manufacturer');
|
126 |
+
}
|
127 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Model/Mysql4/Manufacturer.php
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Model_Mysql4_Manufacturer extends Mage_Core_Model_Mysql4_Abstract
|
8 |
+
{
|
9 |
+
public function _construct()
|
10 |
+
{
|
11 |
+
$this->_init('manufacturer/manufacturer', 'manufacturer_id');
|
12 |
+
}
|
13 |
+
|
14 |
+
public function saveStore($manufacturer_id, $storeIds)
|
15 |
+
{
|
16 |
+
$where = $this->_getReadAdapter()->quoteInto('manufacturer_id = ?', $manufacturer_id);
|
17 |
+
$select = $this->_getReadAdapter()->select()->from(
|
18 |
+
$this->getTable('manufacturer/manufacturer_store')
|
19 |
+
)->where($where);
|
20 |
+
$rows = $this->_getReadAdapter()->fetchAll($select);
|
21 |
+
if ($rows) {
|
22 |
+
$this->_getWriteAdapter()->delete($this->getTable('manufacturer/manufacturer_store'), $where);
|
23 |
+
}
|
24 |
+
if (is_array($storeIds)) {
|
25 |
+
foreach ($storeIds as $store_id) {
|
26 |
+
$manufacturerstoreArray = array();
|
27 |
+
$manufacturerstoreArray['manufacturer_id'] = $manufacturer_id;
|
28 |
+
$manufacturerstoreArray['store_id'] = $store_id;
|
29 |
+
$this->_getWriteAdapter()->insert(
|
30 |
+
$this->getTable('manufacturer/manufacturer_store'), $manufacturerstoreArray);
|
31 |
+
}
|
32 |
+
} else {
|
33 |
+
$manufacturerstoreArray = array();
|
34 |
+
$manufacturerstoreArray['manufacturer_id'] = $manufacturer_id;
|
35 |
+
$manufacturerstoreArray['store_id'] = $storeIds;
|
36 |
+
$this->_getWriteAdapter()->insert(
|
37 |
+
$this->getTable('manufacturer/manufacturer_store'), $manufacturerstoreArray);
|
38 |
+
}
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function getManufacturerId($store_id)
|
43 |
+
{
|
44 |
+
$where = $this->_getReadAdapter()->quoteInto('store_id IN (?)', array('0', $store_id));
|
45 |
+
$select = $this->_getReadAdapter()->select()->from(
|
46 |
+
$this->getTable('manufacturer/manufacturer_store')
|
47 |
+
)->where($where);
|
48 |
+
$rows = $this->_getReadAdapter()->fetchAll($select);
|
49 |
+
$manufacturerIds = array();
|
50 |
+
foreach ($rows as $row) {
|
51 |
+
$manufacturerIds[] = $row['manufacturer_id'];
|
52 |
+
}
|
53 |
+
return $manufacturerIds;
|
54 |
+
}
|
55 |
+
|
56 |
+
public function getStoreId($manufacturer_id)
|
57 |
+
{
|
58 |
+
$where = $this->_getReadAdapter()->quoteInto('manufacturer_id = ?', $manufacturer_id);
|
59 |
+
$select = $this->_getReadAdapter()->select()->from(
|
60 |
+
$this->getTable('manufacturer/manufacturer_store')
|
61 |
+
)->where($where);
|
62 |
+
$rows = $this->_getReadAdapter()->fetchAll($select);
|
63 |
+
$storeIds = array();
|
64 |
+
foreach ($rows as $row) {
|
65 |
+
$storeIds[] = $row['store_id'];
|
66 |
+
}
|
67 |
+
return $storeIds;
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
+
/* public function getManufacturer ($store_id) {
|
72 |
+
$manufacturer_table=$this->getTable('manufacturer/manufacturer');
|
73 |
+
$manufacturer_store_table=$this->getTable('manufacturer/manufacturer_store');
|
74 |
+
$where = $this->_getReadAdapter()->quoteInto('store_id = ? AND ', $store_id).$this->_getReadAdapter()->quoteInto('status =?',1);
|
75 |
+
$condition=$this->_getReadAdapter()->quoteInto('manufacturer.manufacturer_id =manufacturer_store.manufacturer_id', '');
|
76 |
+
$select=$this->_getReadAdapter()->select()->from(array('manufacturer'=>$manufacturer_table))->join(array('manufacturer_store'=>$manufacturer_store_table),$condition)->where($where);
|
77 |
+
$manufacturer=$this->_getReadAdapter()->fetchAll($select);
|
78 |
+
return $manufacturer;
|
79 |
+
} */
|
80 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Model/Mysql4/Manufacturer/Collection.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Model_Mysql4_Manufacturer_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
8 |
+
{
|
9 |
+
public function _construct()
|
10 |
+
{
|
11 |
+
parent::_construct();
|
12 |
+
$this->_init('manufacturer/manufacturer');
|
13 |
+
}
|
14 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Model/Noterouter.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Model_Noterouter extends Mage_Core_Model_Config_Data
|
8 |
+
{
|
9 |
+
|
10 |
+
public function _afterSave()
|
11 |
+
{
|
12 |
+
$router = $this->getValue();
|
13 |
+
if ($this->isValueChanged()) {
|
14 |
+
$helper = Mage::helper('manufacturer');
|
15 |
+
$urls = Mage::getModel('core/url_rewrite')->getCollection()
|
16 |
+
->addFieldToFilter('id_path', array('like' => 'manufacturer%'));
|
17 |
+
if (count($urls)) {
|
18 |
+
foreach ($urls as $item) {
|
19 |
+
try {
|
20 |
+
$item->delete();
|
21 |
+
} catch (Exception $e) {
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
25 |
+
$collection = Mage::getModel('manufacturer/manufacturer')->getCollection();
|
26 |
+
if (count($collection)) {
|
27 |
+
$store_id = Mage::app()->getStore()->getId();
|
28 |
+
try {
|
29 |
+
foreach ($collection as $item) {
|
30 |
+
if ($item->getIdentifier()) {
|
31 |
+
$rewriteModel = Mage::getModel('core/url_rewrite');
|
32 |
+
$identifier = $helper->generateIdentifier($item->getName());
|
33 |
+
$id_path = 'manufacturer/' . $item->getId();
|
34 |
+
$request_path = $router . '/' . $identifier;
|
35 |
+
$rewriteModel->loadByRequestPath($request_path);
|
36 |
+
if ($rewriteModel->getId()) {
|
37 |
+
$identifier = $identifier . '-' . $item->getId();
|
38 |
+
$request_path = $request_path . '-' . $item->getId();
|
39 |
+
}
|
40 |
+
$urlRewrite = Mage::getModel('core/url_rewrite');
|
41 |
+
$urlRewrite->setData('id_path', 'manufacturer/' . $item->getId());
|
42 |
+
$urlRewrite->setData('target_path', 'manufacturer/index/view/id/' . $item->getId());
|
43 |
+
$urlRewrite->setStoreId($store_id);
|
44 |
+
$urlRewrite->setData('request_path', $request_path);
|
45 |
+
$urlRewrite->save();
|
46 |
+
$item->setIdentifier($identifier)->save();
|
47 |
+
}
|
48 |
+
}
|
49 |
+
} catch (Exception $e) {
|
50 |
+
}
|
51 |
+
}
|
52 |
+
}
|
53 |
+
return parent::_afterSave();
|
54 |
+
}
|
55 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Model/Status.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Model_Status extends Varien_Object
|
8 |
+
{
|
9 |
+
const STATUS_ENABLED = 1;
|
10 |
+
const STATUS_DISABLED = 2;
|
11 |
+
|
12 |
+
static public function getOptionArray()
|
13 |
+
{
|
14 |
+
return array(
|
15 |
+
self::STATUS_ENABLED => Mage::helper('manufacturer')->__('Enabled'),
|
16 |
+
self::STATUS_DISABLED => Mage::helper('manufacturer')->__('Disabled')
|
17 |
+
);
|
18 |
+
}
|
19 |
+
}
|
app/code/local/Magebuzz/Manufacturer/Model/Validatemanufacturer.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Model_Validatemanufacturer extends Mage_Core_Model_Config_Data
|
8 |
+
{
|
9 |
+
public function save()
|
10 |
+
{
|
11 |
+
$manufacturerCode = $this->getValue();
|
12 |
+
$attribute = Mage::getModel('eav/entity_attribute')
|
13 |
+
->loadByCode('catalog_product', $manufacturerCode)->getFrontendInput();
|
14 |
+
if ($attribute == '' || $attribute == null) {
|
15 |
+
Mage::throwException("Attribute doesn't Exist.");
|
16 |
+
}
|
17 |
+
if ($attribute != 'select') {
|
18 |
+
Mage::getSingleton('core/session')->addNotice('Attribute Manufacturer Code support type is Dropdown .');
|
19 |
+
Mage::throwException("Attribute type doesn't Dropdown.");
|
20 |
+
}
|
21 |
+
return parent::save();
|
22 |
+
}
|
23 |
+
}
|
app/code/local/Magebuzz/Manufacturer/controllers/Adminhtml/ManufacturerController.php
ADDED
@@ -0,0 +1,412 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_Adminhtml_ManufacturerController extends Mage_Adminhtml_Controller_action
|
8 |
+
{
|
9 |
+
protected function _initAction()
|
10 |
+
{
|
11 |
+
$this->loadLayout()
|
12 |
+
->_setActiveMenu('manufacturer/items')
|
13 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Manufacturer Manager'), Mage::helper('adminhtml')->__('Manufacturer Manager'));
|
14 |
+
return $this;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function indexAction()
|
18 |
+
{
|
19 |
+
$this->_initAction()
|
20 |
+
->renderLayout();
|
21 |
+
}
|
22 |
+
|
23 |
+
public function editAction()
|
24 |
+
{
|
25 |
+
$id = $this->getRequest()->getParam('id');
|
26 |
+
$model = Mage::getModel('manufacturer/manufacturer')->load($id);
|
27 |
+
if ($model->getId() || $id == 0) {
|
28 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(TRUE);
|
29 |
+
if (!empty($data)) {
|
30 |
+
$model->setData($data);
|
31 |
+
}
|
32 |
+
Mage::register('manufacturer_data', $model);
|
33 |
+
$this->loadLayout();
|
34 |
+
$this->_setActiveMenu('manufacturer/items');
|
35 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
36 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
37 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(TRUE);
|
38 |
+
$this->_addContent($this->getLayout()->createBlock('manufacturer/adminhtml_manufacturer_edit'))
|
39 |
+
->_addLeft($this->getLayout()->createBlock('manufacturer/adminhtml_manufacturer_edit_tabs'));
|
40 |
+
$this->renderLayout();
|
41 |
+
} else {
|
42 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('manufacturer')->__('Item does not exist'));
|
43 |
+
$this->_redirect('*/*/');
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
public function newAction()
|
48 |
+
{
|
49 |
+
$this->_forward('edit');
|
50 |
+
}
|
51 |
+
|
52 |
+
public function saveAction()
|
53 |
+
{
|
54 |
+
$helper = Mage::helper('manufacturer');
|
55 |
+
if ($data = $this->getRequest()->getPost()) {
|
56 |
+
$helper = Mage::helper('manufacturer');
|
57 |
+
$model = Mage::getModel('manufacturer/manufacturer');
|
58 |
+
if ($id = $this->getRequest()->getParam('id')) {
|
59 |
+
$model->load($id);
|
60 |
+
$productlist = $model->getSelectedProductIds();
|
61 |
+
$optionid = $model->getOptionId();
|
62 |
+
}
|
63 |
+
$storeIds = $this->getRequest()->getParam('stores');
|
64 |
+
$data['image'] = '';
|
65 |
+
if (isset($_FILES['image']['name']) && $_FILES['image']['name'] != '') {
|
66 |
+
try {
|
67 |
+
$image_name = $_FILES['image']['name'];
|
68 |
+
$new_image_name = $helper->renameImage($image_name);
|
69 |
+
$uploader = new Varien_File_Uploader('image');
|
70 |
+
$uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
|
71 |
+
$uploader->setAllowRenameFiles(TRUE);
|
72 |
+
$uploader->setFilesDispersion(FALSE);
|
73 |
+
$path = Mage::getBaseDir('media') . DS . 'manufacturer';
|
74 |
+
if (!file_exists($path . DS . $new_image_name)) {
|
75 |
+
$uploader->save($path, $new_image_name);
|
76 |
+
}
|
77 |
+
} catch (Exception $e) {
|
78 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('manufacturer')->__("There was problem when saving manufacturer. Please try again."));
|
79 |
+
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
80 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
81 |
+
return;
|
82 |
+
}
|
83 |
+
$data['image'] = $new_image_name;
|
84 |
+
} elseif ($model->getImage()) {
|
85 |
+
$data['image'] = $model->getImage();
|
86 |
+
}
|
87 |
+
$post = $this->getRequest()->getPost();
|
88 |
+
if (isset($post['image']['delete']) && $post['image']['delete'] == 1) {
|
89 |
+
$data['image'] = '';
|
90 |
+
}
|
91 |
+
$model->setData($data);
|
92 |
+
//edit Form
|
93 |
+
if ($this->getRequest()->getParam('id') > 0) {
|
94 |
+
$model->setId($this->getRequest()->getParam('id'));
|
95 |
+
if (isset($data['in_manufacturer_product'])) {
|
96 |
+
$productIds = array();
|
97 |
+
parse_str($data['in_manufacturer_product'], $productIds);
|
98 |
+
$productIds = array_keys($productIds);
|
99 |
+
$model->compareProductList($productIds, $productlist, $optionid);
|
100 |
+
}
|
101 |
+
|
102 |
+
} else {
|
103 |
+
//add Form
|
104 |
+
$manufacturerOption = array('manufacturerName' => $data['name'], 'store_id' => $storeIds);
|
105 |
+
$optionManufacturerId = $model->addManufacturerOption($manufacturerOption);
|
106 |
+
if (isset($data['in_manufacturer_product'])) {
|
107 |
+
$productIds = array();
|
108 |
+
parse_str($data['in_manufacturer_product'], $productIds);
|
109 |
+
$productIds = array_keys($productIds);
|
110 |
+
//zend_debug::dump($productIds); die();
|
111 |
+
$model->compareProductList($productIds, $productlist = array(), $optionManufacturerId);
|
112 |
+
$model->setOptionId($optionManufacturerId);
|
113 |
+
}
|
114 |
+
}
|
115 |
+
try {
|
116 |
+
$model->save();
|
117 |
+
//rewrite URL
|
118 |
+
$isChangedIdentifier = FALSE;
|
119 |
+
if ($model->getId() && $model->getIdentifier() == $data['identifier']) {
|
120 |
+
$isChangedIdentifier = TRUE;
|
121 |
+
}
|
122 |
+
$store_id = Mage::app()->getStore()->getId();
|
123 |
+
$identifier = $helper->generateIdentifier($model->getIdentifier());
|
124 |
+
$rewriteModel = Mage::getModel('core/url_rewrite');
|
125 |
+
$id_path = 'manufacturer/' . $model->getId();
|
126 |
+
$rewriteModel->loadByIdPath($id_path);
|
127 |
+
$request_path = $helper->getConfigTextRouter() . '/' . $identifier;
|
128 |
+
if ($rewriteModel->getId()) {
|
129 |
+
if ($isChangedIdentifier) {
|
130 |
+
$rewriteModel->setData('id_path', 'manufacturer/' . $model->getId());
|
131 |
+
$rewriteModel->setData('request_path', $request_path);
|
132 |
+
$rewriteModel->setData('target_path', 'manufacturer/index/view/id/' . $model->getId());
|
133 |
+
$rewriteModel->save();
|
134 |
+
}
|
135 |
+
} else {
|
136 |
+
//create new rewrite
|
137 |
+
$rewriteModel->loadByRequestPath($request_path);
|
138 |
+
if ($rewriteModel->getId()) {
|
139 |
+
$identifier = $identifier . '-' . $model->getId();
|
140 |
+
$request_path = $request_path . '-' . $model->getId();
|
141 |
+
$urlRewrite = Mage::getModel('core/url_rewrite');
|
142 |
+
$urlRewrite->setData('id_path', 'manufacturer/' . $model->getId());
|
143 |
+
$urlRewrite->setData('request_path', $request_path);
|
144 |
+
$urlRewrite->setData('target_path', 'manufacturer/index/view/id/' . $model->getId());
|
145 |
+
$urlRewrite->setStoreId($store_id);
|
146 |
+
$urlRewrite->save();
|
147 |
+
} else {
|
148 |
+
$identifier = $identifier . '-' . $model->getId();
|
149 |
+
$urlRewrite = Mage::getModel('core/url_rewrite');
|
150 |
+
$urlRewrite->setData('id_path', 'manufacturer/' . $model->getId());
|
151 |
+
$urlRewrite->setData('request_path', $request_path);
|
152 |
+
$urlRewrite->setData('target_path', 'manufacturer/index/view/id/' . $model->getId());
|
153 |
+
$urlRewrite->setStoreId($store_id);
|
154 |
+
$urlRewrite->save();
|
155 |
+
}
|
156 |
+
}
|
157 |
+
$model->setIdentifier($data['identifier'])->save();
|
158 |
+
Mage::getModel('manufacturer/manufacturer')->getResource()->saveStore($model->getId(), $storeIds);
|
159 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('manufacturer')->__('Item was successfully saved'));
|
160 |
+
Mage::getSingleton('adminhtml/session')->setFormData(FALSE);
|
161 |
+
if ($this->getRequest()->getParam('back')) {
|
162 |
+
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
163 |
+
return;
|
164 |
+
}
|
165 |
+
$this->_redirect('*/*/');
|
166 |
+
return;
|
167 |
+
} catch (Exception $e) {
|
168 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
169 |
+
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
170 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
171 |
+
return;
|
172 |
+
}
|
173 |
+
}
|
174 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('manufacturer')->__('Unable to find item to save'));
|
175 |
+
$this->_redirect('*/*/');
|
176 |
+
}
|
177 |
+
|
178 |
+
public function deleteAction()
|
179 |
+
{
|
180 |
+
if ($this->getRequest()->getParam('id') > 0) {
|
181 |
+
try {
|
182 |
+
$model = Mage::getModel('manufacturer/manufacturer');
|
183 |
+
//delete URL rewrite
|
184 |
+
$id_path = 'manufacturer/' . $model->getId();
|
185 |
+
$urlRewrite = Mage::getModel('core/url_rewrite');
|
186 |
+
$urlRewrite->loadByIdPath($id_path)->delete();
|
187 |
+
Mage::getModel('manufacturer/manufacturer')->deleteManufacturerOption($this->getRequest()->getParam('id'));
|
188 |
+
$model->setId($this->getRequest()->getParam('id'))->delete();
|
189 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
190 |
+
$this->_redirect('*/*/');
|
191 |
+
} catch (Exception $e) {
|
192 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
193 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
194 |
+
}
|
195 |
+
}
|
196 |
+
$this->_redirect('*/*/');
|
197 |
+
}
|
198 |
+
|
199 |
+
public function productlistAction()
|
200 |
+
{
|
201 |
+
$this->loadLayout();
|
202 |
+
$this->getLayout()->getBlock('manufacturer.edit.tab.products')
|
203 |
+
->setProducts($this->getRequest()->getPost('oproduct', null));
|
204 |
+
$this->renderLayout();
|
205 |
+
}
|
206 |
+
|
207 |
+
public function productlistGridAction()
|
208 |
+
{
|
209 |
+
$this->loadLayout();
|
210 |
+
$this->getLayout()->getBlock('manufacturer.edit.tab.products')
|
211 |
+
->setProducts($this->getRequest()->getPost('oproduct', null));
|
212 |
+
$this->renderLayout();
|
213 |
+
}
|
214 |
+
|
215 |
+
public function gridAction()
|
216 |
+
{
|
217 |
+
$this->getResponse()->setBody(
|
218 |
+
$this->getLayout()->createBlock('manufacturer/adminhtml_manufacturer_edit_tab_products')->toHtml()
|
219 |
+
);
|
220 |
+
}
|
221 |
+
|
222 |
+
public function massDeleteAction()
|
223 |
+
{
|
224 |
+
$manufacturerIds = $this->getRequest()->getParam('manufacturer');
|
225 |
+
if (!is_array($manufacturerIds)) {
|
226 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
227 |
+
} else {
|
228 |
+
try {
|
229 |
+
foreach ($manufacturerIds as $manufacturerId) {
|
230 |
+
$manufacturer = Mage::getModel('manufacturer/manufacturer')->load($manufacturerId);
|
231 |
+
//delete URL rewrite
|
232 |
+
$id_path = 'manufacturer/' . $manufacturer->getId();
|
233 |
+
$urlRewrite = Mage::getModel('core/url_rewrite');
|
234 |
+
$urlRewrite->loadByIdPath($id_path)->delete();
|
235 |
+
Mage::getModel('manufacturer/manufacturer')->deleteManufacturerOption($manufacturerId);
|
236 |
+
$manufacturer->delete();
|
237 |
+
}
|
238 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
239 |
+
Mage::helper('adminhtml')->__(
|
240 |
+
'Total of %d record(s) were successfully deleted', count($manufacturerIds)
|
241 |
+
)
|
242 |
+
);
|
243 |
+
} catch (Exception $e) {
|
244 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
245 |
+
}
|
246 |
+
}
|
247 |
+
$this->_redirect('*/*/index');
|
248 |
+
}
|
249 |
+
|
250 |
+
public function massStatusAction()
|
251 |
+
{
|
252 |
+
$manufacturerIds = $this->getRequest()->getParam('manufacturer');
|
253 |
+
if (!is_array($manufacturerIds)) {
|
254 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
255 |
+
} else {
|
256 |
+
try {
|
257 |
+
foreach ($manufacturerIds as $manufacturerId) {
|
258 |
+
$manufacturer = Mage::getSingleton('manufacturer/manufacturer')
|
259 |
+
->load($manufacturerId)
|
260 |
+
->setStatus($this->getRequest()->getParam('status'))
|
261 |
+
->setIsMassupdate(TRUE)
|
262 |
+
->save();
|
263 |
+
}
|
264 |
+
$this->_getSession()->addSuccess(
|
265 |
+
$this->__('Total of %d record(s) were successfully updated', count($manufacturerIds))
|
266 |
+
);
|
267 |
+
} catch (Exception $e) {
|
268 |
+
$this->_getSession()->addError($e->getMessage());
|
269 |
+
}
|
270 |
+
}
|
271 |
+
$this->_redirect('*/*/index');
|
272 |
+
}
|
273 |
+
|
274 |
+
public function exportCsvAction()
|
275 |
+
{
|
276 |
+
$fileName = 'manufacturer.csv';
|
277 |
+
$content = $this->getLayout()->createBlock('manufacturer/adminhtml_manufacturer_grid')
|
278 |
+
->getCsv();
|
279 |
+
$this->_sendUploadResponse($fileName, $content);
|
280 |
+
}
|
281 |
+
|
282 |
+
public function exportXmlAction()
|
283 |
+
{
|
284 |
+
$fileName = 'manufacturer.xml';
|
285 |
+
$content = $this->getLayout()->createBlock('manufacturer/adminhtml_manufacturer_grid')
|
286 |
+
->getXml();
|
287 |
+
$this->_sendUploadResponse($fileName, $content);
|
288 |
+
}
|
289 |
+
|
290 |
+
protected function _sendUploadResponse($fileName, $content, $contentType = 'application/octet-stream')
|
291 |
+
{
|
292 |
+
$response = $this->getResponse();
|
293 |
+
$response->setHeader('HTTP/1.1 200 OK', '');
|
294 |
+
$response->setHeader('Pragma', 'public', TRUE);
|
295 |
+
$response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', TRUE);
|
296 |
+
$response->setHeader('Content-Disposition', 'attachment; filename=' . $fileName);
|
297 |
+
$response->setHeader('Last-Modified', date('r'));
|
298 |
+
$response->setHeader('Accept-Ranges', 'bytes');
|
299 |
+
$response->setHeader('Content-Length', strlen($content));
|
300 |
+
$response->setHeader('Content-type', $contentType);
|
301 |
+
$response->setBody($content);
|
302 |
+
$response->sendResponse();
|
303 |
+
die;
|
304 |
+
}
|
305 |
+
|
306 |
+
public function importAction()
|
307 |
+
{
|
308 |
+
$helper = Mage::helper('manufacturer');
|
309 |
+
$manufacturer_options = $helper->getManufacturerOptions();
|
310 |
+
Mage::getModel('manufacturer/manufacturer')->getAllManufacturer($manufacturer_options);
|
311 |
+
$count = 0;
|
312 |
+
foreach ($manufacturer_options as $manufacturer) {
|
313 |
+
if ($manufacturer['value']) {
|
314 |
+
$model = Mage::getModel('manufacturer/manufacturer');
|
315 |
+
$model->load($manufacturer['value'], 'option_id');
|
316 |
+
if (!$model->getId()) {
|
317 |
+
$identifier = $helper->generateIdentifier($manufacturer['label']);
|
318 |
+
$store_id = 0;
|
319 |
+
$model->setName($manufacturer['label'])
|
320 |
+
->setOptionId($manufacturer['value'])
|
321 |
+
->setIdentifier($identifier)
|
322 |
+
->setStoreId($store_id)
|
323 |
+
->setStatus(1)
|
324 |
+
->save();
|
325 |
+
$request_path = $helper->getConfigTextRouter() . '/' . $identifier;
|
326 |
+
$id_path = 'manufacturer/' . $model->getId();
|
327 |
+
$rewriteModel = Mage::getModel('core/url_rewrite');
|
328 |
+
$rewriteModel->loadByRequestPath($request_path);
|
329 |
+
if (!$rewriteModel->getId()) {
|
330 |
+
$rewriteModel->setData('id_path', $id_path);
|
331 |
+
$rewriteModel->setData('request_path', $request_path);
|
332 |
+
$rewriteModel->setData('target_path', 'manufacturer/index/view/id/' . $model->getId());
|
333 |
+
$rewriteModel->save();
|
334 |
+
} else {
|
335 |
+
$identifier = $identifier . '-' . $model->getId();
|
336 |
+
$request_path = $request_path . '-' . $model->getId();
|
337 |
+
$urlModel = Mage::getModel('core/url_rewrite');
|
338 |
+
$urlModel->setData('id_path', $id_path);
|
339 |
+
$urlModel->setData('request_path', $request_path);
|
340 |
+
$urlModel->setData('target_path', 'manufacturer/index/view/id/' . $model->getId());
|
341 |
+
$urlModel->save();
|
342 |
+
}
|
343 |
+
$model->setIdentifier($identifier)->save();
|
344 |
+
$model->getResource()->saveStore($model->getId(), $store_id);
|
345 |
+
$count++;
|
346 |
+
}
|
347 |
+
}
|
348 |
+
}
|
349 |
+
if ($count != 0) {
|
350 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
351 |
+
Mage::helper('adminhtml')->__(
|
352 |
+
'Total of %d record(s) were successfully imported', $count
|
353 |
+
)
|
354 |
+
);
|
355 |
+
$this->_redirect('*/*/index');
|
356 |
+
} else {
|
357 |
+
Mage::getSingleton('adminhtml/session')->addError($helper->__('There is no item to import'));
|
358 |
+
$this->_redirect('*/*/index');
|
359 |
+
}
|
360 |
+
}
|
361 |
+
|
362 |
+
public function reindexAction()
|
363 |
+
{
|
364 |
+
$helper = Mage::helper('manufacturer');
|
365 |
+
$urls = Mage::getModel('core/url_rewrite')->getCollection()
|
366 |
+
->addFieldToFilter('id_path', array('like' => 'manufacturer%'));
|
367 |
+
if (count($urls)) {
|
368 |
+
foreach ($urls as $item) {
|
369 |
+
try {
|
370 |
+
$item->delete();
|
371 |
+
} catch (Exception $e) {
|
372 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('index')->__('Cannot initialize the indexer process.'));
|
373 |
+
}
|
374 |
+
}
|
375 |
+
}
|
376 |
+
$collection = Mage::getModel('manufacturer/manufacturer')->getCollection();
|
377 |
+
if (count($collection)) {
|
378 |
+
$helper = Mage::helper('manufacturer');
|
379 |
+
$store_id = Mage::app()->getStore()->getId();
|
380 |
+
try {
|
381 |
+
foreach ($collection as $item) {
|
382 |
+
if ($item->getIdentifier()) {
|
383 |
+
$rewriteModel = Mage::getModel('core/url_rewrite');
|
384 |
+
$identifier = $helper->generateIdentifier($item->getName());
|
385 |
+
$id_path = 'manufacturer/' . $item->getId();
|
386 |
+
$request_path = $helper->getConfigTextRouter() . '/' . $identifier;
|
387 |
+
$rewriteModel->loadByRequestPath($request_path);
|
388 |
+
if ($rewriteModel->getId()) {
|
389 |
+
$identifier = $identifier . '-' . $item->getId();
|
390 |
+
$request_path = $request_path . '-' . $item->getId();
|
391 |
+
}
|
392 |
+
$urlRewrite = Mage::getModel('core/url_rewrite');
|
393 |
+
$urlRewrite->setData('id_path', 'manufacturer/' . $item->getId());
|
394 |
+
$urlRewrite->setData('target_path', 'manufacturer/index/view/id/' . $item->getId());
|
395 |
+
$urlRewrite->setStoreId($store_id);
|
396 |
+
$urlRewrite->setData('request_path', $request_path);
|
397 |
+
$urlRewrite->save();
|
398 |
+
|
399 |
+
$item->setIdentifier($identifier)->save();
|
400 |
+
}
|
401 |
+
}
|
402 |
+
} catch (Exception $e) {
|
403 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('index')->__('Cannot initialize the indexer process.'));
|
404 |
+
$this->_redirect('*/*/index');
|
405 |
+
}
|
406 |
+
}
|
407 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
408 |
+
Mage::helper('manufacturer')->__('Manufacturer URLs are re-indexed successfully.')
|
409 |
+
);
|
410 |
+
$this->_redirect('*/*/index');
|
411 |
+
}
|
412 |
+
}
|
app/code/local/Magebuzz/Manufacturer/controllers/IndexController.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright (c) 2014 www.magebuzz.com
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Magebuzz_Manufacturer_IndexController extends Mage_Core_Controller_Front_Action
|
8 |
+
{
|
9 |
+
public function preDispatch()
|
10 |
+
{
|
11 |
+
parent::preDispatch();
|
12 |
+
}
|
13 |
+
|
14 |
+
public function indexAction()
|
15 |
+
{
|
16 |
+
$this->loadLayout();
|
17 |
+
$this->getLayout()->getBlock('head')->setTitle(Mage::helper('manufacturer')->__('Shop By ' . Mage::helper('manufacturer')->getConfigTextLabe()));
|
18 |
+
$this->renderLayout();
|
19 |
+
}
|
20 |
+
|
21 |
+
public function viewAction()
|
22 |
+
{
|
23 |
+
$id = $this->getRequest()->getParam('id', FALSE);
|
24 |
+
if ($id) {
|
25 |
+
$manufacturer = Mage::getModel('manufacturer/manufacturer')->load($id);
|
26 |
+
$this->loadLayout();
|
27 |
+
$this->getLayout()->getBlock('head')->setTitle($manufacturer->getName());
|
28 |
+
$this->renderLayout();
|
29 |
+
return;
|
30 |
+
} else {
|
31 |
+
return $this->_redirect('*/*/index');
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
app/code/local/Magebuzz/Manufacturer/etc/adminhtml.xml
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<manufacturer module="manufacturer">
|
5 |
+
<title>Manufacturer</title>
|
6 |
+
<sort_order>70</sort_order>
|
7 |
+
<children>
|
8 |
+
<manage_manufacturer module="manufacturer">
|
9 |
+
<title>Manage Manufacturers</title>
|
10 |
+
<sort_order>0</sort_order>
|
11 |
+
<action>manufacturer/adminhtml_manufacturer</action>
|
12 |
+
</manage_manufacturer>
|
13 |
+
<settings module="manufacturer" translate="title">
|
14 |
+
<title>Settings</title>
|
15 |
+
<sort_order>1000</sort_order>
|
16 |
+
<action>adminhtml/system_config/edit/section/manufacturer</action>
|
17 |
+
</settings>
|
18 |
+
</children>
|
19 |
+
</manufacturer>
|
20 |
+
</menu>
|
21 |
+
<acl>
|
22 |
+
<resources>
|
23 |
+
<all>
|
24 |
+
<title>Allow Everything</title>
|
25 |
+
</all>
|
26 |
+
<admin>
|
27 |
+
<children>
|
28 |
+
<system>
|
29 |
+
<children>
|
30 |
+
<config>
|
31 |
+
<children>
|
32 |
+
<manufacturer module="manufacturer" translate="title">
|
33 |
+
<title>Manufacturer</title>
|
34 |
+
<sort_order>80</sort_order>
|
35 |
+
</manufacturer>
|
36 |
+
</children>
|
37 |
+
</config>
|
38 |
+
</children>
|
39 |
+
</system>
|
40 |
+
<manufacturer module="manufacturer">
|
41 |
+
<title>Manufacturer</title>
|
42 |
+
<sort_order>70</sort_order>
|
43 |
+
<children>
|
44 |
+
<manage_manufacturer module="manufacturer">
|
45 |
+
<title>Manage Manufacturers</title>
|
46 |
+
<sort_order>0</sort_order>
|
47 |
+
<action>manufacturer/adminhtml_manufacturer</action>
|
48 |
+
</manage_manufacturer>
|
49 |
+
<settings module="manufacturer" translate="title">
|
50 |
+
<title>Settings</title>
|
51 |
+
<sort_order>1000</sort_order>
|
52 |
+
<action>adminhtml/system_config/edit/section/manufacturer</action>
|
53 |
+
</settings>
|
54 |
+
</children>
|
55 |
+
</manufacturer>
|
56 |
+
</children>
|
57 |
+
</admin>
|
58 |
+
</resources>
|
59 |
+
</acl>
|
60 |
+
</config>
|
app/code/local/Magebuzz/Manufacturer/etc/config.xml
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Magebuzz_Manufacturer>
|
5 |
+
<version>0.1.5</version>
|
6 |
+
</Magebuzz_Manufacturer>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<manufacturer>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Magebuzz_Manufacturer</module>
|
14 |
+
<frontName>manufacturer</frontName>
|
15 |
+
</args>
|
16 |
+
</manufacturer>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<manufacturer>
|
21 |
+
<file>manufacturer.xml</file>
|
22 |
+
</manufacturer>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<admin>
|
27 |
+
<routers>
|
28 |
+
<manufacturer>
|
29 |
+
<use>admin</use>
|
30 |
+
<args>
|
31 |
+
<module>Magebuzz_Manufacturer</module>
|
32 |
+
<frontName>manufacturer</frontName>
|
33 |
+
</args>
|
34 |
+
</manufacturer>
|
35 |
+
</routers>
|
36 |
+
</admin>
|
37 |
+
<adminhtml>
|
38 |
+
<layout>
|
39 |
+
<updates>
|
40 |
+
<manufacturer>
|
41 |
+
<file>manufacturer.xml</file>
|
42 |
+
</manufacturer>
|
43 |
+
</updates>
|
44 |
+
</layout>
|
45 |
+
</adminhtml>
|
46 |
+
<global>
|
47 |
+
<events>
|
48 |
+
<controller_front_init_routers>
|
49 |
+
<observers>
|
50 |
+
<manufacturer>
|
51 |
+
<type>singleton</type>
|
52 |
+
<class>Magebuzz_Manufacturer_Controller_Router</class>
|
53 |
+
<method>initControllerRouters</method>
|
54 |
+
</manufacturer>
|
55 |
+
</observers>
|
56 |
+
</controller_front_init_routers>
|
57 |
+
</events>
|
58 |
+
<models>
|
59 |
+
<manufacturer>
|
60 |
+
<class>Magebuzz_Manufacturer_Model</class>
|
61 |
+
<resourceModel>manufacturer_mysql4</resourceModel>
|
62 |
+
</manufacturer>
|
63 |
+
<manufacturer_mysql4>
|
64 |
+
<class>Magebuzz_Manufacturer_Model_Mysql4</class>
|
65 |
+
<entities>
|
66 |
+
<manufacturer>
|
67 |
+
<table>manufacturer</table>
|
68 |
+
</manufacturer>
|
69 |
+
<manufacturer_store>
|
70 |
+
<table>manufacturer_store</table>
|
71 |
+
</manufacturer_store>
|
72 |
+
</entities>
|
73 |
+
</manufacturer_mysql4>
|
74 |
+
</models>
|
75 |
+
<resources>
|
76 |
+
<manufacturer_setup>
|
77 |
+
<setup>
|
78 |
+
<module>Magebuzz_Manufacturer</module>
|
79 |
+
</setup>
|
80 |
+
<connection>
|
81 |
+
<use>core_setup</use>
|
82 |
+
</connection>
|
83 |
+
</manufacturer_setup>
|
84 |
+
<manufacturer_write>
|
85 |
+
<connection>
|
86 |
+
<use>core_write</use>
|
87 |
+
</connection>
|
88 |
+
</manufacturer_write>
|
89 |
+
<manufacturer_read>
|
90 |
+
<connection>
|
91 |
+
<use>core_read</use>
|
92 |
+
</connection>
|
93 |
+
</manufacturer_read>
|
94 |
+
</resources>
|
95 |
+
<blocks>
|
96 |
+
<manufacturer>
|
97 |
+
<class>Magebuzz_Manufacturer_Block</class>
|
98 |
+
</manufacturer>
|
99 |
+
</blocks>
|
100 |
+
<helpers>
|
101 |
+
<manufacturer>
|
102 |
+
<class>Magebuzz_Manufacturer_Helper</class>
|
103 |
+
</manufacturer>
|
104 |
+
</helpers>
|
105 |
+
</global>
|
106 |
+
<default>
|
107 |
+
<manufacturer>
|
108 |
+
<general>
|
109 |
+
<top_link_url>1</top_link_url>
|
110 |
+
<alphabet_sorting>1</alphabet_sorting>
|
111 |
+
<group_alphabet>0</group_alphabet>
|
112 |
+
<show_featured_manufacturer>0</show_featured_manufacturer>
|
113 |
+
<show_manufacturer_in_product_page>0</show_manufacturer_in_product_page>
|
114 |
+
<enable_left_nav>1</enable_left_nav>
|
115 |
+
</general>
|
116 |
+
<configfield>
|
117 |
+
<text_attribute_code>manufacturer</text_attribute_code>
|
118 |
+
<text_manufacturer_lable>Manufacturer</text_manufacturer_lable>
|
119 |
+
<text_featured_manufacturer_lable>Featured Manufacturers</text_featured_manufacturer_lable>
|
120 |
+
<text_all_manufacturer_lable>All Manufacturers</text_all_manufacturer_lable>
|
121 |
+
<text_router>manufacturer</text_router>
|
122 |
+
</configfield>
|
123 |
+
</manufacturer>
|
124 |
+
</default>
|
125 |
+
</config>
|
app/code/local/Magebuzz/Manufacturer/etc/system.xml
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<magebuzz translate="label">
|
5 |
+
<label>MageBuzz Add-ons</label>
|
6 |
+
<sort_order>400</sort_order>
|
7 |
+
</magebuzz>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<manufacturer translate="label" module="manufacturer">
|
11 |
+
<class>separator-top</class>
|
12 |
+
<label>Manufacturer</label>
|
13 |
+
<tab>magebuzz</tab>
|
14 |
+
<frontend_type>text</frontend_type>
|
15 |
+
<sort_order>350</sort_order>
|
16 |
+
<show_in_default>1</show_in_default>
|
17 |
+
<show_in_website>1</show_in_website>
|
18 |
+
<show_in_store>1</show_in_store>
|
19 |
+
<groups>
|
20 |
+
<general translate="label">
|
21 |
+
<label>Manufacturer Listing Page</label>
|
22 |
+
<frontend_type>text</frontend_type>
|
23 |
+
<sort_order>1</sort_order>
|
24 |
+
<show_in_default>1</show_in_default>
|
25 |
+
<show_in_website>1</show_in_website>
|
26 |
+
<show_in_store>1</show_in_store>
|
27 |
+
<fields>
|
28 |
+
<top_link_url translate="label">
|
29 |
+
<label>Show URL in top link</label>
|
30 |
+
<frontend_type>select</frontend_type>
|
31 |
+
<sort_order>1</sort_order>
|
32 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
</top_link_url>
|
37 |
+
<default_manufacturer_image>
|
38 |
+
<label>Default manufacturer image</label>
|
39 |
+
<frontend_type>image</frontend_type>
|
40 |
+
<backend_model>adminhtml/system_config_backend_image_pdf</backend_model>
|
41 |
+
<upload_dir config="system/filesystem/media" scope_info="1">manufacturer/default</upload_dir>
|
42 |
+
<base_url type="media" scope_info="1">manufacturer/default</base_url>
|
43 |
+
<sort_order>3</sort_order>
|
44 |
+
<show_in_default>1</show_in_default>
|
45 |
+
<show_in_website>1</show_in_website>
|
46 |
+
<show_in_store>1</show_in_store>
|
47 |
+
</default_manufacturer_image>
|
48 |
+
<alphabet_sorting>
|
49 |
+
<label>Alphabet sort order</label>
|
50 |
+
<frontend_type>select</frontend_type>
|
51 |
+
<sort_order>4</sort_order>
|
52 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
53 |
+
<show_in_default>1</show_in_default>
|
54 |
+
<show_in_website>1</show_in_website>
|
55 |
+
<show_in_store>1</show_in_store>
|
56 |
+
</alphabet_sorting>
|
57 |
+
<group_alphabet>
|
58 |
+
<label>Group manufacturer by the first letter</label>
|
59 |
+
<frontend_type>select</frontend_type>
|
60 |
+
<sort_order>5</sort_order>
|
61 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
62 |
+
<show_in_default>1</show_in_default>
|
63 |
+
<show_in_website>1</show_in_website>
|
64 |
+
<show_in_store>1</show_in_store>
|
65 |
+
</group_alphabet>
|
66 |
+
<show_featured_manufacturer>
|
67 |
+
<label>Show featured manufacturer in top</label>
|
68 |
+
<frontend_type>select</frontend_type>
|
69 |
+
<sort_order>6</sort_order>
|
70 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
71 |
+
<show_in_default>1</show_in_default>
|
72 |
+
<show_in_website>1</show_in_website>
|
73 |
+
<show_in_store>1</show_in_store>
|
74 |
+
</show_featured_manufacturer>
|
75 |
+
<show_manufacturer_in_product_page>
|
76 |
+
<label>Show manufacturer in product page</label>
|
77 |
+
<frontend_type>select</frontend_type>
|
78 |
+
<sort_order>7</sort_order>
|
79 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
80 |
+
<show_in_default>1</show_in_default>
|
81 |
+
<show_in_website>1</show_in_website>
|
82 |
+
<show_in_store>1</show_in_store>
|
83 |
+
</show_manufacturer_in_product_page>
|
84 |
+
<enable_left_nav>
|
85 |
+
<label>Enable manufacturer navigation</label>
|
86 |
+
<frontend_type>select</frontend_type>
|
87 |
+
<sort_order>8</sort_order>
|
88 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
89 |
+
<show_in_default>1</show_in_default>
|
90 |
+
<show_in_website>1</show_in_website>
|
91 |
+
<show_in_store>1</show_in_store>
|
92 |
+
</enable_left_nav>
|
93 |
+
</fields>
|
94 |
+
</general>
|
95 |
+
<configfield translate="label">
|
96 |
+
<label>Configuration Text</label>
|
97 |
+
<frontend_type>text</frontend_type>
|
98 |
+
<sort_order>2</sort_order>
|
99 |
+
<show_in_default>1</show_in_default>
|
100 |
+
<show_in_website>1</show_in_website>
|
101 |
+
<show_in_store>0</show_in_store>
|
102 |
+
<fields>
|
103 |
+
<text_attribute_code>
|
104 |
+
<label>Attribute Manufacturer Code</label>
|
105 |
+
<backend_model>manufacturer/validatemanufacturer</backend_model>
|
106 |
+
<frontend_type>text</frontend_type>
|
107 |
+
<sort_order>8</sort_order>
|
108 |
+
<show_in_default>1</show_in_default>
|
109 |
+
<show_in_website>1</show_in_website>
|
110 |
+
<show_in_store>1</show_in_store>
|
111 |
+
<validate>required-entry validate-alpha</validate>
|
112 |
+
</text_attribute_code>
|
113 |
+
<text_manufacturer_lable>
|
114 |
+
<label>Text Title Display In Frontend</label>
|
115 |
+
<frontend_type>text</frontend_type>
|
116 |
+
<sort_order>8</sort_order>
|
117 |
+
<show_in_default>1</show_in_default>
|
118 |
+
<show_in_website>1</show_in_website>
|
119 |
+
<show_in_store>1</show_in_store>
|
120 |
+
<validate>required-entry validate-alpha</validate>
|
121 |
+
</text_manufacturer_lable>
|
122 |
+
<text_featured_manufacturer_lable>
|
123 |
+
<label>Text Display in Featured</label>
|
124 |
+
<frontend_type>text</frontend_type>
|
125 |
+
<sort_order>8</sort_order>
|
126 |
+
<show_in_default>1</show_in_default>
|
127 |
+
<show_in_website>1</show_in_website>
|
128 |
+
<show_in_store>1</show_in_store>
|
129 |
+
<validate>required-entry</validate>
|
130 |
+
<comment>Title display in list featured manufacturer</comment>
|
131 |
+
</text_featured_manufacturer_lable>
|
132 |
+
<text_all_manufacturer_lable>
|
133 |
+
<label>Text Display in Featured</label>
|
134 |
+
<frontend_type>text</frontend_type>
|
135 |
+
<sort_order>8</sort_order>
|
136 |
+
<show_in_default>1</show_in_default>
|
137 |
+
<show_in_website>1</show_in_website>
|
138 |
+
<show_in_store>1</show_in_store>
|
139 |
+
<validate>required-entry</validate>
|
140 |
+
<comment>Title display in list all manufacturer</comment>
|
141 |
+
</text_all_manufacturer_lable>
|
142 |
+
<text_router>
|
143 |
+
<label>Text Router Display In Frontend</label>
|
144 |
+
<frontend_type>text</frontend_type>
|
145 |
+
<sort_order>8</sort_order>
|
146 |
+
<show_in_default>1</show_in_default>
|
147 |
+
<show_in_website>1</show_in_website>
|
148 |
+
<show_in_store>1</show_in_store>
|
149 |
+
<validate>required-entry validate-alpha</validate>
|
150 |
+
</text_router>
|
151 |
+
</fields>
|
152 |
+
</configfield>
|
153 |
+
</groups>
|
154 |
+
</manufacturer>
|
155 |
+
</sections>
|
156 |
+
</config>
|
app/code/local/Magebuzz/Manufacturer/sql/manufacturer_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Copyright (c) 2014 www.magebuzz.com
|
4 |
+
*/
|
5 |
+
$installer = $this;
|
6 |
+
$installer->startSetup();
|
7 |
+
$installer->run("
|
8 |
+
-- DROP TABLE IF EXISTS {$this->getTable('manufacturer')};
|
9 |
+
CREATE TABLE {$this->getTable('manufacturer')} (
|
10 |
+
`manufacturer_id` int(11) unsigned NOT NULL auto_increment,
|
11 |
+
`name` varchar(255) NOT NULL default '',
|
12 |
+
`image` varchar(255) NULL default '',
|
13 |
+
`identifier` varchar(255) NOT NULL default '',
|
14 |
+
`website` varchar(255) NULL,
|
15 |
+
`description` text NULL,
|
16 |
+
`is_featured` smallint(6) NOT NULL default '0',
|
17 |
+
`status` smallint(6) NOT NULL default '0',
|
18 |
+
`option_id` int(11) NOT NULL default '0',
|
19 |
+
PRIMARY KEY (`manufacturer_id`)
|
20 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
21 |
+
");
|
22 |
+
$installer->endSetup();
|
app/code/local/Magebuzz/Manufacturer/sql/manufacturer_setup/mysql4-upgrade-0.1.0-0.1.1.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Copyright (c) 2014 www.magebuzz.com
|
4 |
+
*/
|
5 |
+
$installer = $this;
|
6 |
+
$installer->startSetup();
|
7 |
+
$installer->run("
|
8 |
+
-- DROP TABLE IF EXISTS {$this->getTable('manufacturer_store')};
|
9 |
+
CREATE TABLE {$this->getTable('manufacturer_store')} (
|
10 |
+
`manufacturer_id` int(11) unsigned NOT NULL,
|
11 |
+
`store_id` int(11) NOT NULL default '0',
|
12 |
+
PRIMARY KEY (`manufacturer_id`,`store_id`),
|
13 |
+
CONSTRAINT `FK_MANUFACTURER_MANUFACTURER_STORE` FOREIGN KEY (`manufacturer_id`) REFERENCES `{$this->getTable('manufacturer')}` (`manufacturer_id`) ON DELETE CASCADE
|
14 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
15 |
+
");
|
16 |
+
$installer->endSetup();
|
app/code/local/Magebuzz/Manufacturer/sql/manufacturer_setup/mysql4-upgrade-0.1.1-0.1.2.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Copyright (c) 2014 www.magebuzz.com
|
4 |
+
*/
|
5 |
+
$installer = $this;
|
6 |
+
$installer->startSetup();
|
7 |
+
$installer->run("
|
8 |
+
ALTER TABLE {$this->getTable('manufacturer')} ADD `meta_keywords` text NOT NULL;
|
9 |
+
ALTER TABLE {$this->getTable('manufacturer')} ADD `meta_description` text NOT NULL;
|
10 |
+
");
|
11 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/manufacturer.xml
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="notifications">
|
5 |
+
<block type="manufacturer/adminhtml_manufacturer" name="manufacturer_notifications"
|
6 |
+
template="manufacturer/notifications.phtml"></block>
|
7 |
+
</reference>
|
8 |
+
</default>
|
9 |
+
<manufacturer_adminhtml_manufacturer_index>
|
10 |
+
<reference name="content">
|
11 |
+
<block type="manufacturer/adminhtml_manufacturer" name="manufacturer"/>
|
12 |
+
</reference>
|
13 |
+
</manufacturer_adminhtml_manufacturer_index>
|
14 |
+
|
15 |
+
<manufacturer_adminhtml_manufacturer_productlist>
|
16 |
+
<block type="core/text_list" name="root">
|
17 |
+
<block type="manufacturer/adminhtml_manufacturer_edit_tab_products" name="manufacturer.edit.tab.products"/>
|
18 |
+
<block type="adminhtml/widget_grid_serializer" name="related_grid_serializer">
|
19 |
+
<action method="initSerializerBlock">
|
20 |
+
<grid_block_name>manufacturer.edit.tab.products</grid_block_name>
|
21 |
+
<data_callback>getSelectedProducts</data_callback>
|
22 |
+
<hidden_input_name>in_manufacturer_product</hidden_input_name>
|
23 |
+
<reload_param_name>oproduct</reload_param_name>
|
24 |
+
</action>
|
25 |
+
<action method="addColumnInputName">
|
26 |
+
<input_name>position</input_name>
|
27 |
+
</action>
|
28 |
+
</block>
|
29 |
+
</block>
|
30 |
+
</manufacturer_adminhtml_manufacturer_productlist>
|
31 |
+
|
32 |
+
<manufacturer_adminhtml_manufacturer_productlistgrid>
|
33 |
+
<block type="core/text_list" name="root">
|
34 |
+
<block type="manufacturer/adminhtml_manufacturer_edit_tab_products" name="manufacturer.edit.tab.products"/>
|
35 |
+
</block>
|
36 |
+
</manufacturer_adminhtml_manufacturer_productlistgrid>
|
37 |
+
</layout>
|
app/design/adminhtml/default/default/template/manufacturer/notifications.phtml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ($this->getNotification()) {
|
3 |
+
?>
|
4 |
+
|
5 |
+
<div class="notification-global">
|
6 |
+
<strong><?php echo $this->helper('index')->__('Manufacturer URL are not up to date.') ?></strong>
|
7 |
+
<?php echo $this->helper('index')->__('Click here to go to <a href="%s">Manufacturer Management</a> and rebuild Manufacturer URLs.', $this->getUrl('manufacturer/adminhtml_manufacturer/index')); ?>
|
8 |
+
</div>
|
9 |
+
<?php } ?>
|
app/design/frontend/base/default/layout/manufacturer.xml
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="top.links">
|
5 |
+
<action method="addLink" translate="label title" module="manufacturer"
|
6 |
+
ifconfig="manufacturer/general/top_link_url">
|
7 |
+
<label helper="manufacturer/getConfigTextLabe"/>
|
8 |
+
<url helper="manufacturer/getConfigTextRouter"/>
|
9 |
+
<title helper="manufacturer/getConfigTextLabe"/>
|
10 |
+
<prepare>true</prepare>
|
11 |
+
<urlParams/>
|
12 |
+
<position>0</position>
|
13 |
+
</action>
|
14 |
+
</reference>
|
15 |
+
<reference name="left">
|
16 |
+
<block type="manufacturer/left" before="-" name="manufacturer.left.sidebar">
|
17 |
+
<action method="displayOnSidebarBlock"/>
|
18 |
+
</block>
|
19 |
+
</reference>
|
20 |
+
</default>
|
21 |
+
<manufacturer_index_index>
|
22 |
+
<reference name="root">
|
23 |
+
<action method="setTemplate">
|
24 |
+
<template>page/2columns-left.phtml</template>
|
25 |
+
</action>
|
26 |
+
</reference>
|
27 |
+
<reference name="head">
|
28 |
+
<action method="addCss">
|
29 |
+
<stylesheet>magebuzz/manufacturer/css/manufacturer.css</stylesheet>
|
30 |
+
</action>
|
31 |
+
<action method="addJs">
|
32 |
+
<script>magebuzz/manufacturer/jquery.js</script>
|
33 |
+
</action>
|
34 |
+
<action method="addJs">
|
35 |
+
<script>magebuzz/manufacturer/jquery.scrollTo-min.js</script>
|
36 |
+
</action>
|
37 |
+
<action method="addJs">
|
38 |
+
<script>magebuzz/manufacturer/jquery.scrollShow.js</script>
|
39 |
+
</action>
|
40 |
+
<action method="addJs">
|
41 |
+
<script>magebuzz/manufacturer/manufacturer_slider.js</script>
|
42 |
+
</action>
|
43 |
+
</reference>
|
44 |
+
<reference name="content">
|
45 |
+
<block type="manufacturer/manufacturer" name="manufacturer" template="manufacturer/manufacturer.phtml"/>
|
46 |
+
</reference>
|
47 |
+
</manufacturer_index_index>
|
48 |
+
<manufacturer_index_view>
|
49 |
+
<reference name="root">
|
50 |
+
<action method="setTemplate">
|
51 |
+
<template>page/2columns-left.phtml</template>
|
52 |
+
</action>
|
53 |
+
</reference>
|
54 |
+
<reference name="head">
|
55 |
+
<action method="addCss">
|
56 |
+
<stylesheet>magebuzz/manufacturer/css/manufacturer.css</stylesheet>
|
57 |
+
</action>
|
58 |
+
</reference>
|
59 |
+
<reference name="content">
|
60 |
+
<block type="manufacturer/view" name="manufacturer.view" template="manufacturer/view.phtml">
|
61 |
+
<block type="catalog/product_list" name="manufacturer.product" template="catalog/product/list.phtml">
|
62 |
+
<block type="core/text_list" name="product_list.name.after" as="name.after" />
|
63 |
+
<block type="core/text_list" name="product_list.after" as="after" />
|
64 |
+
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
|
65 |
+
<block type="page/html_pager" name="product_list_toolbar_pager"/>
|
66 |
+
<!-- The following code shows how to set your own pager increments -->
|
67 |
+
<!--
|
68 |
+
<action method="setDefaultListPerPage"><limit>4</limit></action>
|
69 |
+
<action method="setDefaultGridPerPage"><limit>9</limit></action>
|
70 |
+
<action method="addPagerLimit"><mode>list</mode><limit>2</limit></action>
|
71 |
+
<action method="addPagerLimit"><mode>list</mode><limit>4</limit></action>
|
72 |
+
<action method="addPagerLimit"><mode>list</mode><limit>6</limit></action>
|
73 |
+
<action method="addPagerLimit"><mode>list</mode><limit>8</limit></action>
|
74 |
+
<action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
|
75 |
+
-->
|
76 |
+
</block>
|
77 |
+
<action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
|
78 |
+
<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
|
79 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
|
80 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
|
81 |
+
<action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
|
82 |
+
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
|
83 |
+
<!-- Since the addColumnCountLayoutDepend does not work, we are manually setting the max columns -->
|
84 |
+
<action method="setColumnCount"><count>4</count></action>
|
85 |
+
</block>
|
86 |
+
<action method="setListCollection"/>
|
87 |
+
</block>
|
88 |
+
</reference>
|
89 |
+
</manufacturer_index_view>
|
90 |
+
<catalog_product_view>
|
91 |
+
<reference name="product.info.extrahint">
|
92 |
+
<block type="manufacturer/product_manufacturer" name="product.manufacturer"
|
93 |
+
template="manufacturer/product/manufacturer.phtml"/>
|
94 |
+
</reference>
|
95 |
+
</catalog_product_view>
|
96 |
+
</layout>
|
app/design/frontend/base/default/template/manufacturer/manufacturer.phtml
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Copyright (c) 2014 www.magebuzz.com
|
4 |
+
*/
|
5 |
+
if ($this->showFeaturedManufacturers()):?>
|
6 |
+
<div class="featured-manufacturers">
|
7 |
+
<?php $featuredManufacturers = $this->getFeaturedManufacturers(); ?>
|
8 |
+
<?php if (count($featuredManufacturers)): ?>
|
9 |
+
<h2 class="title"><?php echo $this->_helperMenufacturer()->getConfigTextFeatured(); ?></h2>
|
10 |
+
<ul id="featured-manu-screen">
|
11 |
+
<li>
|
12 |
+
<a id="navleft" href="#"> </a>
|
13 |
+
</li>
|
14 |
+
<li id="featured-manu-view">
|
15 |
+
<ul id="featured-manu-images">
|
16 |
+
<?php $i = 0;
|
17 |
+
foreach ($featuredManufacturers as $featuredManu): $i++ ?>
|
18 |
+
<li>
|
19 |
+
<a href="<?php echo $this->getManufacturerUrl($featuredManu->getId()); ?>"
|
20 |
+
title="<?php echo $featuredManu->getName(); ?>" target="_blank" class="img">
|
21 |
+
<div class="item">
|
22 |
+
<img id="img<?php echo $i; ?>"
|
23 |
+
src="<?php echo $this->getFeaturedImage($featuredManu->getImage()) ?>"
|
24 |
+
alt="<?php echo $featuredManu->getName(); ?>" />
|
25 |
+
</div>
|
26 |
+
</a>
|
27 |
+
</li>
|
28 |
+
<?php endforeach ?>
|
29 |
+
</ul>
|
30 |
+
</li>
|
31 |
+
<li><a id="navright" href="#"> </a></li>
|
32 |
+
</ul>
|
33 |
+
<?php endif; ?>
|
34 |
+
</div>
|
35 |
+
<?php endif; ?>
|
36 |
+
<?php $manufacturerCollection = $this->getManufacturers(); ?>
|
37 |
+
<?php if (count($manufacturerCollection)): ?>
|
38 |
+
<div class="manufacturers">
|
39 |
+
<h2 class="title"><?php echo $this->_helperMenufacturer()->getConfigTextAll(); ?></h2>
|
40 |
+
<?php if ($this->groupAlphabet()): ?>
|
41 |
+
<!-- Group manufacturer by first letter-->
|
42 |
+
<?php $letters = $this->getAvailableLetter($manufacturerCollection); ?>
|
43 |
+
<?php if (count($letters)): ?>
|
44 |
+
<?php $i = 0; ?>
|
45 |
+
<?php foreach ($letters as $letter): ?>
|
46 |
+
<?php if ($i++ % 3 == 0): ?>
|
47 |
+
<ul class="group-manufacturer-grid">
|
48 |
+
<?php endif ?>
|
49 |
+
<li class="item <?php if (($i - 1) % 3 == 0): ?>first<?php endif; ?>">
|
50 |
+
<h2><?php echo $letter; ?></h2>
|
51 |
+
<?php //$manufacturers = $manufacturerCollection->addFieldToFilter('name', array('like' => $letter . '%'));?>
|
52 |
+
<?php //echo count($manufacturers); die('sss');?>
|
53 |
+
<?php $manufacturers = $this->getManufacturersByFirstLetter($letter); ?>
|
54 |
+
<?php if (count($manufacturers)): ?>
|
55 |
+
<dl>
|
56 |
+
<?php foreach ($manufacturers as $manufacturer): ?>
|
57 |
+
<dt><a
|
58 |
+
href="<?php echo $this->getManufacturerUrl($manufacturer->getId()); ?>"><?php echo $manufacturer->getName(); ?></a>
|
59 |
+
</dt>
|
60 |
+
<?php endforeach; ?>
|
61 |
+
</dl>
|
62 |
+
<?php endif; ?>
|
63 |
+
</li>
|
64 |
+
<?php if ($i % 3 == 0 || $i == count($manufacturerCollection)): ?>
|
65 |
+
</ul>
|
66 |
+
<?php endif ?>
|
67 |
+
<?php endforeach; ?>
|
68 |
+
<?php endif; ?>
|
69 |
+
|
70 |
+
<?php else: ?>
|
71 |
+
<!-- normal display -->
|
72 |
+
<?php $i = 0; ?>
|
73 |
+
<?php foreach ($manufacturerCollection as $manufacturer): ?>
|
74 |
+
<?php if ($i++ % 3 == 0): ?>
|
75 |
+
<ul class="manufacturer-grid">
|
76 |
+
<?php endif ?>
|
77 |
+
<li class="item <?php if (($i - 1) % 3 == 0): ?>first<?php endif; ?>">
|
78 |
+
<?php //if ($this->displayImage()):?>
|
79 |
+
<!--<div class="manufacturer-image">
|
80 |
+
<a href="#" title="<?php echo $manufacturer->getName(); ?>" class="manufacturer-image">
|
81 |
+
<img width="80px" height="80px;" src="<?php echo $this->getManufacturerImageListingUrl($manufacturer->getImage()) ?>" alt="<?php echo $manufacturer->getName(); ?>" />
|
82 |
+
</a>
|
83 |
+
</div>-->
|
84 |
+
<?php //endif?>
|
85 |
+
<a class="manufacturer-name"
|
86 |
+
href="<?php echo $this->getManufacturerUrl($manufacturer->getId()); ?>"><?php echo $manufacturer->getName(); ?></a>
|
87 |
+
</li>
|
88 |
+
<?php if ($i % 3 == 0 || $i == count($manufacturerCollection)): ?>
|
89 |
+
</ul>
|
90 |
+
<?php endif ?>
|
91 |
+
<?php endforeach; ?>
|
92 |
+
<?php endif; ?>
|
93 |
+
</div>
|
94 |
+
<?php else: ?>
|
95 |
+
<p class="note-msg"><?php echo $this->__('There are no manufacturer matching the selection.') ?></p>
|
96 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/manufacturer/product/manufacturer.phtml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Copyright (c) 2014 www.magebuzz.com
|
4 |
+
*/
|
5 |
+
if ($this->showManufacturerInProduct()) {
|
6 |
+
$manufacturer_option_id = $this->getProduct()->getData(Mage::helper('manufacturer')->getConfigAttributrCode());
|
7 |
+
$manufacturer = $this->getManufacturerByProductId($manufacturer_option_id);
|
8 |
+
if (isset($manufacturer) && $manufacturer->getId()) {
|
9 |
+
echo '<p>' . Mage::helper('manufacturer')->getConfigTextLabe() . ' : ' . '<span><b>' . $manufacturer->getName() . '</b></span></p>';
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
app/design/frontend/base/default/template/manufacturer/sidebar.phtml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Copyright (c) 2014 www.magebuzz.com
|
4 |
+
*/
|
5 |
+
$manufacturers = $this->getManufacturers();?>
|
6 |
+
<?php if (count($manufacturers)): ?>
|
7 |
+
<div class="block block-manufacturer">
|
8 |
+
<div class="block-title">
|
9 |
+
<strong><span><?php echo Mage::helper('manufacturer')->getConfigTextLabe(); ?></span></strong>
|
10 |
+
</div>
|
11 |
+
<div class="block-content">
|
12 |
+
<div class="manufacturer-sidebar">
|
13 |
+
<ul>
|
14 |
+
<?php $i = 0;
|
15 |
+
foreach ($manufacturers as $manufacturer): ?>
|
16 |
+
<li class="<?php if ($i % 2 == 0): ?>left<?php else: ?>right<?php endif; ?>">
|
17 |
+
<a href="<?php echo $this->getManufacturerUrl($manufacturer->getId()); ?>"
|
18 |
+
title="<?php echo $manufacturer->getName(); ?>">
|
19 |
+
<?php echo $manufacturer->getName(); ?>
|
20 |
+
</a>
|
21 |
+
</li>
|
22 |
+
<?php $i++; ?>
|
23 |
+
<?php endforeach; ?>
|
24 |
+
</ul>
|
25 |
+
</div>
|
26 |
+
</div>
|
27 |
+
</div>
|
28 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/manufacturer/view.phtml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Copyright (c) 2014 www.magebuzz.com
|
4 |
+
*/
|
5 |
+
|
6 |
+
$manufacturer = $this->getManufacturer();
|
7 |
+
?>
|
8 |
+
<div class="page-title">
|
9 |
+
<h1><?php echo $manufacturer->getName(); ?></h1>
|
10 |
+
</div>
|
11 |
+
<div class="manufacturer-description">
|
12 |
+
<?php
|
13 |
+
$urlImage = $this->getManufacturerImage($manufacturer->getImage());
|
14 |
+
?>
|
15 |
+
<?php if ($urlImage != ""): ?>
|
16 |
+
<div class="manufacturer-des-image">
|
17 |
+
<a title="<?php echo $manufacturer->getName(); ?>"><img src="<?php echo $urlImage; ?>"
|
18 |
+
alt="<?php echo $manufacturer->getName() ?>"/> </a>
|
19 |
+
</div>
|
20 |
+
<?php endif; ?>
|
21 |
+
<div class="description-info">
|
22 |
+
<?php echo $manufacturer->getDescription()?>
|
23 |
+
</div>
|
24 |
+
</div>
|
25 |
+
<div class="clear" style="clear:both;"></div>
|
26 |
+
<?php echo $this->getProductHtml() ?>
|
app/etc/modules/Magebuzz_Manufacturer.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Magebuzz_Manufacturer>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Magebuzz_Manufacturer>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/locale/en_US/Magebuzz_Manufacturer.csv
ADDED
File without changes
|
js/magebuzz/jquery.js
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery 1.2.1 - New Wave Javascript
|
3 |
+
*
|
4 |
+
* Copyright (c) 2007 John Resig (jquery.com)
|
5 |
+
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
6 |
+
* and GPL (GPL-LICENSE.txt) licenses.
|
7 |
+
*
|
8 |
+
* $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
|
9 |
+
* $Rev: 3353 $
|
10 |
+
*/
|
11 |
+
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(G(){9(1m E!="W")H w=E;H E=18.15=G(a,b){I 6 7u E?6.5N(a,b):1u E(a,b)};9(1m $!="W")H D=$;18.$=E;H u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;E.1b=E.3A={5N:G(c,a){c=c||U;9(1m c=="1M"){H m=u.2S(c);9(m&&(m[1]||!a)){9(m[1])c=E.4D([m[1]],a);J{H b=U.3S(m[3]);9(b)9(b.22!=m[3])I E().1Y(c);J{6[0]=b;6.K=1;I 6}J c=[]}}J I 1u E(a).1Y(c)}J 9(E.1n(c))I 1u E(U)[E.1b.2d?"2d":"39"](c);I 6.6v(c.1c==1B&&c||(c.4c||c.K&&c!=18&&!c.1y&&c[0]!=W&&c[0].1y)&&E.2h(c)||[c])},4c:"1.2.1",7Y:G(){I 6.K},K:0,21:G(a){I a==W?E.2h(6):6[a]},2o:G(a){H b=E(a);b.4Y=6;I b},6v:G(a){6.K=0;1B.3A.1a.16(6,a);I 6},N:G(a,b){I E.N(6,a,b)},4I:G(a){H b=-1;6.N(G(i){9(6==a)b=i});I b},1x:G(f,d,e){H c=f;9(f.1c==3X)9(d==W)I 6.K&&E[e||"1x"](6[0],f)||W;J{c={};c[f]=d}I 6.N(G(a){L(H b 1i c)E.1x(e?6.R:6,b,E.1e(6,c[b],e,a,b))})},17:G(b,a){I 6.1x(b,a,"3C")},2g:G(e){9(1m e!="5i"&&e!=S)I 6.4n().3g(U.6F(e));H t="";E.N(e||6,G(){E.N(6.3j,G(){9(6.1y!=8)t+=6.1y!=1?6.6x:E.1b.2g([6])})});I t},5m:G(b){9(6[0])E(b,6[0].3H).6u().3d(6[0]).1X(G(){H a=6;1W(a.1w)a=a.1w;I a}).3g(6);I 6},8m:G(a){I 6.N(G(){E(6).6q().5m(a)})},8d:G(a){I 6.N(G(){E(6).5m(a)})},3g:G(){I 6.3z(1q,Q,1,G(a){6.58(a)})},6j:G(){I 6.3z(1q,Q,-1,G(a){6.3d(a,6.1w)})},6g:G(){I 6.3z(1q,P,1,G(a){6.12.3d(a,6)})},50:G(){I 6.3z(1q,P,-1,G(a){6.12.3d(a,6.2q)})},2D:G(){I 6.4Y||E([])},1Y:G(t){H b=E.1X(6,G(a){I E.1Y(t,a)});I 6.2o(/[^+>] [^+>]/.14(t)||t.1g("..")>-1?E.4V(b):b)},6u:G(e){H f=6.1X(G(){I 6.67?E(6.67)[0]:6.4R(Q)});H d=f.1Y("*").4O().N(G(){9(6[F]!=W)6[F]=S});9(e===Q)6.1Y("*").4O().N(G(i){H c=E.M(6,"2P");L(H a 1i c)L(H b 1i c[a])E.1j.1f(d[i],a,c[a][b],c[a][b].M)});I f},1E:G(t){I 6.2o(E.1n(t)&&E.2W(6,G(b,a){I t.16(b,[a])})||E.3m(t,6))},5V:G(t){I 6.2o(t.1c==3X&&E.3m(t,6,Q)||E.2W(6,G(a){I(t.1c==1B||t.4c)?E.2A(a,t)<0:a!=t}))},1f:G(t){I 6.2o(E.1R(6.21(),t.1c==3X?E(t).21():t.K!=W&&(!t.11||E.11(t,"2Y"))?t:[t]))},3t:G(a){I a?E.3m(a,6).K>0:P},7c:G(a){I 6.3t("."+a)},3i:G(b){9(b==W){9(6.K){H c=6[0];9(E.11(c,"24")){H e=c.4Z,a=[],Y=c.Y,2G=c.O=="24-2G";9(e<0)I S;L(H i=2G?e:0,33=2G?e+1:Y.K;i<33;i++){H d=Y[i];9(d.26){H b=E.V.1h&&!d.9V["1Q"].9L?d.2g:d.1Q;9(2G)I b;a.1a(b)}}I a}J I 6[0].1Q.1p(/\\r/g,"")}}J I 6.N(G(){9(b.1c==1B&&/4k|5j/.14(6.O))6.2Q=(E.2A(6.1Q,b)>=0||E.2A(6.2H,b)>=0);J 9(E.11(6,"24")){H a=b.1c==1B?b:[b];E("9h",6).N(G(){6.26=(E.2A(6.1Q,a)>=0||E.2A(6.2g,a)>=0)});9(!a.K)6.4Z=-1}J 6.1Q=b})},4o:G(a){I a==W?(6.K?6[0].3O:S):6.4n().3g(a)},6H:G(a){I 6.50(a).28()},6E:G(i){I 6.2J(i,i+1)},2J:G(){I 6.2o(1B.3A.2J.16(6,1q))},1X:G(b){I 6.2o(E.1X(6,G(a,i){I b.2O(a,i,a)}))},4O:G(){I 6.1f(6.4Y)},3z:G(f,d,g,e){H c=6.K>1,a;I 6.N(G(){9(!a){a=E.4D(f,6.3H);9(g<0)a.8U()}H b=6;9(d&&E.11(6,"1I")&&E.11(a[0],"4m"))b=6.4l("1K")[0]||6.58(U.5B("1K"));E.N(a,G(){H a=c?6.4R(Q):6;9(!5A(0,a))e.2O(b,a)})})}};G 5A(i,b){H a=E.11(b,"1J");9(a){9(b.3k)E.3G({1d:b.3k,3e:P,1V:"1J"});J E.5f(b.2g||b.6s||b.3O||"");9(b.12)b.12.3b(b)}J 9(b.1y==1)E("1J",b).N(5A);I a}E.1k=E.1b.1k=G(){H c=1q[0]||{},a=1,2c=1q.K,5e=P;9(c.1c==8o){5e=c;c=1q[1]||{}}9(2c==1){c=6;a=0}H b;L(;a<2c;a++)9((b=1q[a])!=S)L(H i 1i b){9(c==b[i])6r;9(5e&&1m b[i]==\'5i\'&&c[i])E.1k(c[i],b[i]);J 9(b[i]!=W)c[i]=b[i]}I c};H F="15"+(1u 3D()).3B(),6p=0,5c={};E.1k({8a:G(a){18.$=D;9(a)18.15=w;I E},1n:G(a){I!!a&&1m a!="1M"&&!a.11&&a.1c!=1B&&/G/i.14(a+"")},4a:G(a){I a.2V&&!a.1G||a.37&&a.3H&&!a.3H.1G},5f:G(a){a=E.36(a);9(a){9(18.6l)18.6l(a);J 9(E.V.1N)18.56(a,0);J 3w.2O(18,a)}},11:G(b,a){I b.11&&b.11.27()==a.27()},1L:{},M:G(c,d,b){c=c==18?5c:c;H a=c[F];9(!a)a=c[F]=++6p;9(d&&!E.1L[a])E.1L[a]={};9(b!=W)E.1L[a][d]=b;I d?E.1L[a][d]:a},30:G(c,b){c=c==18?5c:c;H a=c[F];9(b){9(E.1L[a]){2E E.1L[a][b];b="";L(b 1i E.1L[a])1T;9(!b)E.30(c)}}J{2a{2E c[F]}29(e){9(c.53)c.53(F)}2E E.1L[a]}},N:G(a,b,c){9(c){9(a.K==W)L(H i 1i a)b.16(a[i],c);J L(H i=0,48=a.K;i<48;i++)9(b.16(a[i],c)===P)1T}J{9(a.K==W)L(H i 1i a)b.2O(a[i],i,a[i]);J L(H i=0,48=a.K,3i=a[0];i<48&&b.2O(3i,i,3i)!==P;3i=a[++i]){}}I a},1e:G(c,b,d,e,a){9(E.1n(b))b=b.2O(c,[e]);H f=/z-?4I|7T-?7Q|1r|69|7P-?1H/i;I b&&b.1c==4W&&d=="3C"&&!f.14(a)?b+"2T":b},1o:{1f:G(b,c){E.N((c||"").2l(/\\s+/),G(i,a){9(!E.1o.3K(b.1o,a))b.1o+=(b.1o?" ":"")+a})},28:G(b,c){b.1o=c!=W?E.2W(b.1o.2l(/\\s+/),G(a){I!E.1o.3K(c,a)}).66(" "):""},3K:G(t,c){I E.2A(c,(t.1o||t).3s().2l(/\\s+/))>-1}},2k:G(e,o,f){L(H i 1i o){e.R["3r"+i]=e.R[i];e.R[i]=o[i]}f.16(e,[]);L(H i 1i o)e.R[i]=e.R["3r"+i]},17:G(e,p){9(p=="1H"||p=="2N"){H b={},42,41,d=["7J","7I","7G","7F"];E.N(d,G(){b["7C"+6]=0;b["7B"+6+"5Z"]=0});E.2k(e,b,G(){9(E(e).3t(\':3R\')){42=e.7A;41=e.7w}J{e=E(e.4R(Q)).1Y(":4k").5W("2Q").2D().17({4C:"1P",2X:"4F",19:"2Z",7o:"0",1S:"0"}).5R(e.12)[0];H a=E.17(e.12,"2X")||"3V";9(a=="3V")e.12.R.2X="7g";42=e.7e;41=e.7b;9(a=="3V")e.12.R.2X="3V";e.12.3b(e)}});I p=="1H"?42:41}I E.3C(e,p)},3C:G(h,j,i){H g,2w=[],2k=[];G 3n(a){9(!E.V.1N)I P;H b=U.3o.3Z(a,S);I!b||b.4y("3n")==""}9(j=="1r"&&E.V.1h){g=E.1x(h.R,"1r");I g==""?"1":g}9(j.1t(/4u/i))j=y;9(!i&&h.R[j])g=h.R[j];J 9(U.3o&&U.3o.3Z){9(j.1t(/4u/i))j="4u";j=j.1p(/([A-Z])/g,"-$1").2p();H d=U.3o.3Z(h,S);9(d&&!3n(h))g=d.4y(j);J{L(H a=h;a&&3n(a);a=a.12)2w.4w(a);L(a=0;a<2w.K;a++)9(3n(2w[a])){2k[a]=2w[a].R.19;2w[a].R.19="2Z"}g=j=="19"&&2k[2w.K-1]!=S?"2s":U.3o.3Z(h,S).4y(j)||"";L(a=0;a<2k.K;a++)9(2k[a]!=S)2w[a].R.19=2k[a]}9(j=="1r"&&g=="")g="1"}J 9(h.3Q){H f=j.1p(/\\-(\\w)/g,G(m,c){I c.27()});g=h.3Q[j]||h.3Q[f];9(!/^\\d+(2T)?$/i.14(g)&&/^\\d/.14(g)){H k=h.R.1S;H e=h.4v.1S;h.4v.1S=h.3Q.1S;h.R.1S=g||0;g=h.R.71+"2T";h.R.1S=k;h.4v.1S=e}}I g},4D:G(a,e){H r=[];e=e||U;E.N(a,G(i,d){9(!d)I;9(d.1c==4W)d=d.3s();9(1m d=="1M"){d=d.1p(/(<(\\w+)[^>]*?)\\/>/g,G(m,a,b){I b.1t(/^(70|6Z|6Y|9Q|4t|9N|9K|3a|9G|9E)$/i)?m:a+"></"+b+">"});H s=E.36(d).2p(),1s=e.5B("1s"),2x=[];H c=!s.1g("<9y")&&[1,"<24>","</24>"]||!s.1g("<9w")&&[1,"<6T>","</6T>"]||s.1t(/^<(9u|1K|9t|9r|9p)/)&&[1,"<1I>","</1I>"]||!s.1g("<4m")&&[2,"<1I><1K>","</1K></1I>"]||(!s.1g("<9m")||!s.1g("<9k"))&&[3,"<1I><1K><4m>","</4m></1K></1I>"]||!s.1g("<6Y")&&[2,"<1I><1K></1K><6L>","</6L></1I>"]||E.V.1h&&[1,"1s<1s>","</1s>"]||[0,"",""];1s.3O=c[1]+d+c[2];1W(c[0]--)1s=1s.5p;9(E.V.1h){9(!s.1g("<1I")&&s.1g("<1K")<0)2x=1s.1w&&1s.1w.3j;J 9(c[1]=="<1I>"&&s.1g("<1K")<0)2x=1s.3j;L(H n=2x.K-1;n>=0;--n)9(E.11(2x[n],"1K")&&!2x[n].3j.K)2x[n].12.3b(2x[n]);9(/^\\s/.14(d))1s.3d(e.6F(d.1t(/^\\s*/)[0]),1s.1w)}d=E.2h(1s.3j)}9(0===d.K&&(!E.11(d,"2Y")&&!E.11(d,"24")))I;9(d[0]==W||E.11(d,"2Y")||d.Y)r.1a(d);J r=E.1R(r,d)});I r},1x:G(c,d,a){H e=E.4a(c)?{}:E.5o;9(d=="26"&&E.V.1N)c.12.4Z;9(e[d]){9(a!=W)c[e[d]]=a;I c[e[d]]}J 9(E.V.1h&&d=="R")I E.1x(c.R,"9e",a);J 9(a==W&&E.V.1h&&E.11(c,"2Y")&&(d=="9d"||d=="9a"))I c.97(d).6x;J 9(c.37){9(a!=W){9(d=="O"&&E.11(c,"4t")&&c.12)6G"O 94 93\'t 92 91";c.90(d,a)}9(E.V.1h&&/6C|3k/.14(d)&&!E.4a(c))I c.4p(d,2);I c.4p(d)}J{9(d=="1r"&&E.V.1h){9(a!=W){c.69=1;c.1E=(c.1E||"").1p(/6O\\([^)]*\\)/,"")+(3I(a).3s()=="8S"?"":"6O(1r="+a*6A+")")}I c.1E?(3I(c.1E.1t(/1r=([^)]*)/)[1])/6A).3s():""}d=d.1p(/-([a-z])/8Q,G(z,b){I b.27()});9(a!=W)c[d]=a;I c[d]}},36:G(t){I(t||"").1p(/^\\s+|\\s+$/g,"")},2h:G(a){H r=[];9(1m a!="8P")L(H i=0,2c=a.K;i<2c;i++)r.1a(a[i]);J r=a.2J(0);I r},2A:G(b,a){L(H i=0,2c=a.K;i<2c;i++)9(a[i]==b)I i;I-1},1R:G(a,b){9(E.V.1h){L(H i=0;b[i];i++)9(b[i].1y!=8)a.1a(b[i])}J L(H i=0;b[i];i++)a.1a(b[i]);I a},4V:G(b){H r=[],2f={};2a{L(H i=0,6y=b.K;i<6y;i++){H a=E.M(b[i]);9(!2f[a]){2f[a]=Q;r.1a(b[i])}}}29(e){r=b}I r},2W:G(b,a,c){9(1m a=="1M")a=3w("P||G(a,i){I "+a+"}");H d=[];L(H i=0,4g=b.K;i<4g;i++)9(!c&&a(b[i],i)||c&&!a(b[i],i))d.1a(b[i]);I d},1X:G(c,b){9(1m b=="1M")b=3w("P||G(a){I "+b+"}");H d=[];L(H i=0,4g=c.K;i<4g;i++){H a=b(c[i],i);9(a!==S&&a!=W){9(a.1c!=1B)a=[a];d=d.8M(a)}}I d}});H v=8K.8I.2p();E.V={4s:(v.1t(/.+(?:8F|8E|8C|8B)[\\/: ]([\\d.]+)/)||[])[1],1N:/6w/.14(v),34:/34/.14(v),1h:/1h/.14(v)&&!/34/.14(v),35:/35/.14(v)&&!/(8z|6w)/.14(v)};H y=E.V.1h?"4h":"5h";E.1k({5g:!E.V.1h||U.8y=="8x",4h:E.V.1h?"4h":"5h",5o:{"L":"8w","8v":"1o","4u":y,5h:y,4h:y,3O:"3O",1o:"1o",1Q:"1Q",3c:"3c",2Q:"2Q",8u:"8t",26:"26",8s:"8r"}});E.N({1D:"a.12",8q:"15.4e(a,\'12\')",8p:"15.2I(a,2,\'2q\')",8n:"15.2I(a,2,\'4d\')",8l:"15.4e(a,\'2q\')",8k:"15.4e(a,\'4d\')",8j:"15.5d(a.12.1w,a)",8i:"15.5d(a.1w)",6q:"15.11(a,\'8h\')?a.8f||a.8e.U:15.2h(a.3j)"},G(i,n){E.1b[i]=G(a){H b=E.1X(6,n);9(a&&1m a=="1M")b=E.3m(a,b);I 6.2o(E.4V(b))}});E.N({5R:"3g",8c:"6j",3d:"6g",8b:"50",89:"6H"},G(i,n){E.1b[i]=G(){H a=1q;I 6.N(G(){L(H j=0,2c=a.K;j<2c;j++)E(a[j])[n](6)})}});E.N({5W:G(a){E.1x(6,a,"");6.53(a)},88:G(c){E.1o.1f(6,c)},87:G(c){E.1o.28(6,c)},86:G(c){E.1o[E.1o.3K(6,c)?"28":"1f"](6,c)},28:G(a){9(!a||E.1E(a,[6]).r.K){E.30(6);6.12.3b(6)}},4n:G(){E("*",6).N(G(){E.30(6)});1W(6.1w)6.3b(6.1w)}},G(i,n){E.1b[i]=G(){I 6.N(n,1q)}});E.N(["85","5Z"],G(i,a){H n=a.2p();E.1b[n]=G(h){I 6[0]==18?E.V.1N&&3y["84"+a]||E.5g&&38.33(U.2V["5a"+a],U.1G["5a"+a])||U.1G["5a"+a]:6[0]==U?38.33(U.1G["6n"+a],U.1G["6m"+a]):h==W?(6.K?E.17(6[0],n):S):6.17(n,h.1c==3X?h:h+"2T")}});H C=E.V.1N&&3x(E.V.4s)<83?"(?:[\\\\w*57-]|\\\\\\\\.)":"(?:[\\\\w\\82-\\81*57-]|\\\\\\\\.)",6k=1u 47("^>\\\\s*("+C+"+)"),6i=1u 47("^("+C+"+)(#)("+C+"+)"),6h=1u 47("^([#.]?)("+C+"*)");E.1k({55:{"":"m[2]==\'*\'||15.11(a,m[2])","#":"a.4p(\'22\')==m[2]",":":{80:"i<m[3]-0",7Z:"i>m[3]-0",2I:"m[3]-0==i",6E:"m[3]-0==i",3v:"i==0",3u:"i==r.K-1",6f:"i%2==0",6e:"i%2","3v-46":"a.12.4l(\'*\')[0]==a","3u-46":"15.2I(a.12.5p,1,\'4d\')==a","7X-46":"!15.2I(a.12.5p,2,\'4d\')",1D:"a.1w",4n:"!a.1w",7W:"(a.6s||a.7V||15(a).2g()||\'\').1g(m[3])>=0",3R:\'"1P"!=a.O&&15.17(a,"19")!="2s"&&15.17(a,"4C")!="1P"\',1P:\'"1P"==a.O||15.17(a,"19")=="2s"||15.17(a,"4C")=="1P"\',7U:"!a.3c",3c:"a.3c",2Q:"a.2Q",26:"a.26||15.1x(a,\'26\')",2g:"\'2g\'==a.O",4k:"\'4k\'==a.O",5j:"\'5j\'==a.O",54:"\'54\'==a.O",52:"\'52\'==a.O",51:"\'51\'==a.O",6d:"\'6d\'==a.O",6c:"\'6c\'==a.O",2r:\'"2r"==a.O||15.11(a,"2r")\',4t:"/4t|24|6b|2r/i.14(a.11)",3K:"15.1Y(m[3],a).K",7S:"/h\\\\d/i.14(a.11)",7R:"15.2W(15.32,G(1b){I a==1b.T;}).K"}},6a:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1u 47("^([:.#]*)("+C+"+)")],3m:G(a,c,b){H d,2b=[];1W(a&&a!=d){d=a;H f=E.1E(a,c,b);a=f.t.1p(/^\\s*,\\s*/,"");2b=b?c=f.r:E.1R(2b,f.r)}I 2b},1Y:G(t,o){9(1m t!="1M")I[t];9(o&&!o.1y)o=S;o=o||U;H d=[o],2f=[],3u;1W(t&&3u!=t){H r=[];3u=t;t=E.36(t);H l=P;H g=6k;H m=g.2S(t);9(m){H p=m[1].27();L(H i=0;d[i];i++)L(H c=d[i].1w;c;c=c.2q)9(c.1y==1&&(p=="*"||c.11.27()==p.27()))r.1a(c);d=r;t=t.1p(g,"");9(t.1g(" ")==0)6r;l=Q}J{g=/^([>+~])\\s*(\\w*)/i;9((m=g.2S(t))!=S){r=[];H p=m[2],1R={};m=m[1];L(H j=0,31=d.K;j<31;j++){H n=m=="~"||m=="+"?d[j].2q:d[j].1w;L(;n;n=n.2q)9(n.1y==1){H h=E.M(n);9(m=="~"&&1R[h])1T;9(!p||n.11.27()==p.27()){9(m=="~")1R[h]=Q;r.1a(n)}9(m=="+")1T}}d=r;t=E.36(t.1p(g,""));l=Q}}9(t&&!l){9(!t.1g(",")){9(o==d[0])d.44();2f=E.1R(2f,d);r=d=[o];t=" "+t.68(1,t.K)}J{H k=6i;H m=k.2S(t);9(m){m=[0,m[2],m[3],m[1]]}J{k=6h;m=k.2S(t)}m[2]=m[2].1p(/\\\\/g,"");H f=d[d.K-1];9(m[1]=="#"&&f&&f.3S&&!E.4a(f)){H q=f.3S(m[2]);9((E.V.1h||E.V.34)&&q&&1m q.22=="1M"&&q.22!=m[2])q=E(\'[@22="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.11(q,m[3]))?[q]:[]}J{L(H i=0;d[i];i++){H a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];9(a=="*"&&d[i].11.2p()=="5i")a="3a";r=E.1R(r,d[i].4l(a))}9(m[1]==".")r=E.4X(r,m[2]);9(m[1]=="#"){H e=[];L(H i=0;r[i];i++)9(r[i].4p("22")==m[2]){e=[r[i]];1T}r=e}d=r}t=t.1p(k,"")}}9(t){H b=E.1E(t,r);d=r=b.r;t=E.36(b.t)}}9(t)d=[];9(d&&o==d[0])d.44();2f=E.1R(2f,d);I 2f},4X:G(r,m,a){m=" "+m+" ";H c=[];L(H i=0;r[i];i++){H b=(" "+r[i].1o+" ").1g(m)>=0;9(!a&&b||a&&!b)c.1a(r[i])}I c},1E:G(t,r,h){H d;1W(t&&t!=d){d=t;H p=E.6a,m;L(H i=0;p[i];i++){m=p[i].2S(t);9(m){t=t.7O(m[0].K);m[2]=m[2].1p(/\\\\/g,"");1T}}9(!m)1T;9(m[1]==":"&&m[2]=="5V")r=E.1E(m[3],r,Q).r;J 9(m[1]==".")r=E.4X(r,m[2],h);J 9(m[1]=="["){H g=[],O=m[3];L(H i=0,31=r.K;i<31;i++){H a=r[i],z=a[E.5o[m[2]]||m[2]];9(z==S||/6C|3k|26/.14(m[2]))z=E.1x(a,m[2])||\'\';9((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1g(m[5])||O=="$="&&z.68(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1g(m[5])>=0)^h)g.1a(a)}r=g}J 9(m[1]==":"&&m[2]=="2I-46"){H e={},g=[],14=/(\\d*)n\\+?(\\d*)/.2S(m[3]=="6f"&&"2n"||m[3]=="6e"&&"2n+1"||!/\\D/.14(m[3])&&"n+"+m[3]||m[3]),3v=(14[1]||1)-0,d=14[2]-0;L(H i=0,31=r.K;i<31;i++){H j=r[i],12=j.12,22=E.M(12);9(!e[22]){H c=1;L(H n=12.1w;n;n=n.2q)9(n.1y==1)n.4U=c++;e[22]=Q}H b=P;9(3v==1){9(d==0||j.4U==d)b=Q}J 9((j.4U+d)%3v==0)b=Q;9(b^h)g.1a(j)}r=g}J{H f=E.55[m[1]];9(1m f!="1M")f=E.55[m[1]][m[2]];f=3w("P||G(a,i){I "+f+"}");r=E.2W(r,f,h)}}I{r:r,t:t}},4e:G(b,c){H d=[];H a=b[c];1W(a&&a!=U){9(a.1y==1)d.1a(a);a=a[c]}I d},2I:G(a,e,c,b){e=e||1;H d=0;L(;a;a=a[c])9(a.1y==1&&++d==e)1T;I a},5d:G(n,a){H r=[];L(;n;n=n.2q){9(n.1y==1&&(!a||n!=a))r.1a(n)}I r}});E.1j={1f:G(g,e,c,h){9(E.V.1h&&g.4j!=W)g=18;9(!c.2u)c.2u=6.2u++;9(h!=W){H d=c;c=G(){I d.16(6,1q)};c.M=h;c.2u=d.2u}H i=e.2l(".");e=i[0];c.O=i[1];H b=E.M(g,"2P")||E.M(g,"2P",{});H f=E.M(g,"2t",G(){H a;9(1m E=="W"||E.1j.4T)I a;a=E.1j.2t.16(g,1q);I a});H j=b[e];9(!j){j=b[e]={};9(g.4S)g.4S(e,f,P);J g.7N("43"+e,f)}j[c.2u]=c;6.1Z[e]=Q},2u:1,1Z:{},28:G(d,c,b){H e=E.M(d,"2P"),2L,4I;9(1m c=="1M"){H a=c.2l(".");c=a[0]}9(e){9(c&&c.O){b=c.4Q;c=c.O}9(!c){L(c 1i e)6.28(d,c)}J 9(e[c]){9(b)2E e[c][b.2u];J L(b 1i e[c])9(!a[1]||e[c][b].O==a[1])2E e[c][b];L(2L 1i e[c])1T;9(!2L){9(d.4P)d.4P(c,E.M(d,"2t"),P);J d.7M("43"+c,E.M(d,"2t"));2L=S;2E e[c]}}L(2L 1i e)1T;9(!2L){E.30(d,"2P");E.30(d,"2t")}}},1F:G(d,b,e,c,f){b=E.2h(b||[]);9(!e){9(6.1Z[d])E("*").1f([18,U]).1F(d,b)}J{H a,2L,1b=E.1n(e[d]||S),4N=!b[0]||!b[0].2M;9(4N)b.4w(6.4M({O:d,2m:e}));b[0].O=d;9(E.1n(E.M(e,"2t")))a=E.M(e,"2t").16(e,b);9(!1b&&e["43"+d]&&e["43"+d].16(e,b)===P)a=P;9(4N)b.44();9(f&&f.16(e,b)===P)a=P;9(1b&&c!==P&&a!==P&&!(E.11(e,\'a\')&&d=="4L")){6.4T=Q;e[d]()}6.4T=P}I a},2t:G(d){H a;d=E.1j.4M(d||18.1j||{});H b=d.O.2l(".");d.O=b[0];H c=E.M(6,"2P")&&E.M(6,"2P")[d.O],3q=1B.3A.2J.2O(1q,1);3q.4w(d);L(H j 1i c){3q[0].4Q=c[j];3q[0].M=c[j].M;9(!b[1]||c[j].O==b[1]){H e=c[j].16(6,3q);9(a!==P)a=e;9(e===P){d.2M();d.3p()}}}9(E.V.1h)d.2m=d.2M=d.3p=d.4Q=d.M=S;I a},4M:G(c){H a=c;c=E.1k({},a);c.2M=G(){9(a.2M)a.2M();a.7L=P};c.3p=G(){9(a.3p)a.3p();a.7K=Q};9(!c.2m&&c.65)c.2m=c.65;9(E.V.1N&&c.2m.1y==3)c.2m=a.2m.12;9(!c.4K&&c.4J)c.4K=c.4J==c.2m?c.7H:c.4J;9(c.64==S&&c.63!=S){H e=U.2V,b=U.1G;c.64=c.63+(e&&e.2R||b.2R||0);c.7E=c.7D+(e&&e.2B||b.2B||0)}9(!c.3Y&&(c.61||c.60))c.3Y=c.61||c.60;9(!c.5F&&c.5D)c.5F=c.5D;9(!c.3Y&&c.2r)c.3Y=(c.2r&1?1:(c.2r&2?3:(c.2r&4?2:0)));I c}};E.1b.1k({3W:G(c,a,b){I c=="5Y"?6.2G(c,a,b):6.N(G(){E.1j.1f(6,c,b||a,b&&a)})},2G:G(d,b,c){I 6.N(G(){E.1j.1f(6,d,G(a){E(6).5X(a);I(c||b).16(6,1q)},c&&b)})},5X:G(a,b){I 6.N(G(){E.1j.28(6,a,b)})},1F:G(c,a,b){I 6.N(G(){E.1j.1F(c,a,6,Q,b)})},7x:G(c,a,b){9(6[0])I E.1j.1F(c,a,6[0],P,b)},25:G(){H a=1q;I 6.4L(G(e){6.4H=0==6.4H?1:0;e.2M();I a[6.4H].16(6,[e])||P})},7v:G(f,g){G 4G(e){H p=e.4K;1W(p&&p!=6)2a{p=p.12}29(e){p=6};9(p==6)I P;I(e.O=="4x"?f:g).16(6,[e])}I 6.4x(4G).5U(4G)},2d:G(f){5T();9(E.3T)f.16(U,[E]);J E.3l.1a(G(){I f.16(6,[E])});I 6}});E.1k({3T:P,3l:[],2d:G(){9(!E.3T){E.3T=Q;9(E.3l){E.N(E.3l,G(){6.16(U)});E.3l=S}9(E.V.35||E.V.34)U.4P("5S",E.2d,P);9(!18.7t.K)E(18).39(G(){E("#4E").28()})}}});E.N(("7s,7r,39,7q,6n,5Y,4L,7p,"+"7n,7m,7l,4x,5U,7k,24,"+"51,7j,7i,7h,3U").2l(","),G(i,o){E.1b[o]=G(f){I f?6.3W(o,f):6.1F(o)}});H x=P;G 5T(){9(x)I;x=Q;9(E.V.35||E.V.34)U.4S("5S",E.2d,P);J 9(E.V.1h){U.7f("<7d"+"7y 22=4E 7z=Q "+"3k=//:><\\/1J>");H a=U.3S("4E");9(a)a.62=G(){9(6.2C!="1l")I;E.2d()};a=S}J 9(E.V.1N)E.4B=4j(G(){9(U.2C=="5Q"||U.2C=="1l"){4A(E.4B);E.4B=S;E.2d()}},10);E.1j.1f(18,"39",E.2d)}E.1b.1k({39:G(g,d,c){9(E.1n(g))I 6.3W("39",g);H e=g.1g(" ");9(e>=0){H i=g.2J(e,g.K);g=g.2J(0,e)}c=c||G(){};H f="4z";9(d)9(E.1n(d)){c=d;d=S}J{d=E.3a(d);f="5P"}H h=6;E.3G({1d:g,O:f,M:d,1l:G(a,b){9(b=="1C"||b=="5O")h.4o(i?E("<1s/>").3g(a.40.1p(/<1J(.|\\s)*?\\/1J>/g,"")).1Y(i):a.40);56(G(){h.N(c,[a.40,b,a])},13)}});I 6},7a:G(){I E.3a(6.5M())},5M:G(){I 6.1X(G(){I E.11(6,"2Y")?E.2h(6.79):6}).1E(G(){I 6.2H&&!6.3c&&(6.2Q||/24|6b/i.14(6.11)||/2g|1P|52/i.14(6.O))}).1X(G(i,c){H b=E(6).3i();I b==S?S:b.1c==1B?E.1X(b,G(a,i){I{2H:c.2H,1Q:a}}):{2H:c.2H,1Q:b}}).21()}});E.N("5L,5K,6t,5J,5I,5H".2l(","),G(i,o){E.1b[o]=G(f){I 6.3W(o,f)}});H B=(1u 3D).3B();E.1k({21:G(d,b,a,c){9(E.1n(b)){a=b;b=S}I E.3G({O:"4z",1d:d,M:b,1C:a,1V:c})},78:G(b,a){I E.21(b,S,a,"1J")},77:G(c,b,a){I E.21(c,b,a,"45")},76:G(d,b,a,c){9(E.1n(b)){a=b;b={}}I E.3G({O:"5P",1d:d,M:b,1C:a,1V:c})},75:G(a){E.1k(E.59,a)},59:{1Z:Q,O:"4z",2z:0,5G:"74/x-73-2Y-72",6o:Q,3e:Q,M:S},49:{},3G:G(s){H f,2y=/=(\\?|%3F)/g,1v,M;s=E.1k(Q,s,E.1k(Q,{},E.59,s));9(s.M&&s.6o&&1m s.M!="1M")s.M=E.3a(s.M);9(s.1V=="4b"){9(s.O.2p()=="21"){9(!s.1d.1t(2y))s.1d+=(s.1d.1t(/\\?/)?"&":"?")+(s.4b||"5E")+"=?"}J 9(!s.M||!s.M.1t(2y))s.M=(s.M?s.M+"&":"")+(s.4b||"5E")+"=?";s.1V="45"}9(s.1V=="45"&&(s.M&&s.M.1t(2y)||s.1d.1t(2y))){f="4b"+B++;9(s.M)s.M=s.M.1p(2y,"="+f);s.1d=s.1d.1p(2y,"="+f);s.1V="1J";18[f]=G(a){M=a;1C();1l();18[f]=W;2a{2E 18[f]}29(e){}}}9(s.1V=="1J"&&s.1L==S)s.1L=P;9(s.1L===P&&s.O.2p()=="21")s.1d+=(s.1d.1t(/\\?/)?"&":"?")+"57="+(1u 3D()).3B();9(s.M&&s.O.2p()=="21"){s.1d+=(s.1d.1t(/\\?/)?"&":"?")+s.M;s.M=S}9(s.1Z&&!E.5b++)E.1j.1F("5L");9(!s.1d.1g("8g")&&s.1V=="1J"){H h=U.4l("9U")[0];H g=U.5B("1J");g.3k=s.1d;9(!f&&(s.1C||s.1l)){H j=P;g.9R=g.62=G(){9(!j&&(!6.2C||6.2C=="5Q"||6.2C=="1l")){j=Q;1C();1l();h.3b(g)}}}h.58(g);I}H k=P;H i=18.6X?1u 6X("9P.9O"):1u 6W();i.9M(s.O,s.1d,s.3e);9(s.M)i.5C("9J-9I",s.5G);9(s.5y)i.5C("9H-5x-9F",E.49[s.1d]||"9D, 9C 9B 9A 5v:5v:5v 9z");i.5C("X-9x-9v","6W");9(s.6U)s.6U(i);9(s.1Z)E.1j.1F("5H",[i,s]);H c=G(a){9(!k&&i&&(i.2C==4||a=="2z")){k=Q;9(d){4A(d);d=S}1v=a=="2z"&&"2z"||!E.6S(i)&&"3U"||s.5y&&E.6R(i,s.1d)&&"5O"||"1C";9(1v=="1C"){2a{M=E.6Q(i,s.1V)}29(e){1v="5k"}}9(1v=="1C"){H b;2a{b=i.5s("6P-5x")}29(e){}9(s.5y&&b)E.49[s.1d]=b;9(!f)1C()}J E.5r(s,i,1v);1l();9(s.3e)i=S}};9(s.3e){H d=4j(c,13);9(s.2z>0)56(G(){9(i){i.9q();9(!k)c("2z")}},s.2z)}2a{i.9o(s.M)}29(e){E.5r(s,i,S,e)}9(!s.3e)c();I i;G 1C(){9(s.1C)s.1C(M,1v);9(s.1Z)E.1j.1F("5I",[i,s])}G 1l(){9(s.1l)s.1l(i,1v);9(s.1Z)E.1j.1F("6t",[i,s]);9(s.1Z&&!--E.5b)E.1j.1F("5K")}},5r:G(s,a,b,e){9(s.3U)s.3U(a,b,e);9(s.1Z)E.1j.1F("5J",[a,s,e])},5b:0,6S:G(r){2a{I!r.1v&&9n.9l=="54:"||(r.1v>=6N&&r.1v<9j)||r.1v==6M||E.V.1N&&r.1v==W}29(e){}I P},6R:G(a,c){2a{H b=a.5s("6P-5x");I a.1v==6M||b==E.49[c]||E.V.1N&&a.1v==W}29(e){}I P},6Q:G(r,b){H c=r.5s("9i-O");H d=b=="6K"||!b&&c&&c.1g("6K")>=0;H a=d?r.9g:r.40;9(d&&a.2V.37=="5k")6G"5k";9(b=="1J")E.5f(a);9(b=="45")a=3w("("+a+")");I a},3a:G(a){H s=[];9(a.1c==1B||a.4c)E.N(a,G(){s.1a(3f(6.2H)+"="+3f(6.1Q))});J L(H j 1i a)9(a[j]&&a[j].1c==1B)E.N(a[j],G(){s.1a(3f(j)+"="+3f(6))});J s.1a(3f(j)+"="+3f(a[j]));I s.66("&").1p(/%20/g,"+")}});E.1b.1k({1A:G(b,a){I b?6.1U({1H:"1A",2N:"1A",1r:"1A"},b,a):6.1E(":1P").N(G(){6.R.19=6.3h?6.3h:"";9(E.17(6,"19")=="2s")6.R.19="2Z"}).2D()},1z:G(b,a){I b?6.1U({1H:"1z",2N:"1z",1r:"1z"},b,a):6.1E(":3R").N(G(){6.3h=6.3h||E.17(6,"19");9(6.3h=="2s")6.3h="2Z";6.R.19="2s"}).2D()},6J:E.1b.25,25:G(a,b){I E.1n(a)&&E.1n(b)?6.6J(a,b):a?6.1U({1H:"25",2N:"25",1r:"25"},a,b):6.N(G(){E(6)[E(6).3t(":1P")?"1A":"1z"]()})},9c:G(b,a){I 6.1U({1H:"1A"},b,a)},9b:G(b,a){I 6.1U({1H:"1z"},b,a)},99:G(b,a){I 6.1U({1H:"25"},b,a)},98:G(b,a){I 6.1U({1r:"1A"},b,a)},96:G(b,a){I 6.1U({1r:"1z"},b,a)},95:G(c,a,b){I 6.1U({1r:a},c,b)},1U:G(k,i,h,g){H j=E.6D(i,h,g);I 6[j.3L===P?"N":"3L"](G(){j=E.1k({},j);H f=E(6).3t(":1P"),3y=6;L(H p 1i k){9(k[p]=="1z"&&f||k[p]=="1A"&&!f)I E.1n(j.1l)&&j.1l.16(6);9(p=="1H"||p=="2N"){j.19=E.17(6,"19");j.2U=6.R.2U}}9(j.2U!=S)6.R.2U="1P";j.3M=E.1k({},k);E.N(k,G(c,a){H e=1u E.2j(3y,j,c);9(/25|1A|1z/.14(a))e[a=="25"?f?"1A":"1z":a](k);J{H b=a.3s().1t(/^([+-]=)?([\\d+-.]+)(.*)$/),1O=e.2b(Q)||0;9(b){H d=3I(b[2]),2i=b[3]||"2T";9(2i!="2T"){3y.R[c]=(d||1)+2i;1O=((d||1)/e.2b(Q))*1O;3y.R[c]=1O+2i}9(b[1])d=((b[1]=="-="?-1:1)*d)+1O;e.3N(1O,d,2i)}J e.3N(1O,a,"")}});I Q})},3L:G(a,b){9(E.1n(a)){b=a;a="2j"}9(!a||(1m a=="1M"&&!b))I A(6[0],a);I 6.N(G(){9(b.1c==1B)A(6,a,b);J{A(6,a).1a(b);9(A(6,a).K==1)b.16(6)}})},9f:G(){H a=E.32;I 6.N(G(){L(H i=0;i<a.K;i++)9(a[i].T==6)a.6I(i--,1)}).5n()}});H A=G(b,c,a){9(!b)I;H q=E.M(b,c+"3L");9(!q||a)q=E.M(b,c+"3L",a?E.2h(a):[]);I q};E.1b.5n=G(a){a=a||"2j";I 6.N(G(){H q=A(6,a);q.44();9(q.K)q[0].16(6)})};E.1k({6D:G(b,a,c){H d=b&&b.1c==8Z?b:{1l:c||!c&&a||E.1n(b)&&b,2e:b,3J:c&&a||a&&a.1c!=8Y&&a};d.2e=(d.2e&&d.2e.1c==4W?d.2e:{8X:8W,8V:6N}[d.2e])||8T;d.3r=d.1l;d.1l=G(){E(6).5n();9(E.1n(d.3r))d.3r.16(6)};I d},3J:{6B:G(p,n,b,a){I b+a*p},5q:G(p,n,b,a){I((-38.9s(p*38.8R)/2)+0.5)*a+b}},32:[],2j:G(b,c,a){6.Y=c;6.T=b;6.1e=a;9(!c.3P)c.3P={}}});E.2j.3A={4r:G(){9(6.Y.2F)6.Y.2F.16(6.T,[6.2v,6]);(E.2j.2F[6.1e]||E.2j.2F.6z)(6);9(6.1e=="1H"||6.1e=="2N")6.T.R.19="2Z"},2b:G(a){9(6.T[6.1e]!=S&&6.T.R[6.1e]==S)I 6.T[6.1e];H r=3I(E.3C(6.T,6.1e,a));I r&&r>-8O?r:3I(E.17(6.T,6.1e))||0},3N:G(c,b,e){6.5u=(1u 3D()).3B();6.1O=c;6.2D=b;6.2i=e||6.2i||"2T";6.2v=6.1O;6.4q=6.4i=0;6.4r();H f=6;G t(){I f.2F()}t.T=6.T;E.32.1a(t);9(E.32.K==1){H d=4j(G(){H a=E.32;L(H i=0;i<a.K;i++)9(!a[i]())a.6I(i--,1);9(!a.K)4A(d)},13)}},1A:G(){6.Y.3P[6.1e]=E.1x(6.T.R,6.1e);6.Y.1A=Q;6.3N(0,6.2b());9(6.1e=="2N"||6.1e=="1H")6.T.R[6.1e]="8N";E(6.T).1A()},1z:G(){6.Y.3P[6.1e]=E.1x(6.T.R,6.1e);6.Y.1z=Q;6.3N(6.2b(),0)},2F:G(){H t=(1u 3D()).3B();9(t>6.Y.2e+6.5u){6.2v=6.2D;6.4q=6.4i=1;6.4r();6.Y.3M[6.1e]=Q;H a=Q;L(H i 1i 6.Y.3M)9(6.Y.3M[i]!==Q)a=P;9(a){9(6.Y.19!=S){6.T.R.2U=6.Y.2U;6.T.R.19=6.Y.19;9(E.17(6.T,"19")=="2s")6.T.R.19="2Z"}9(6.Y.1z)6.T.R.19="2s";9(6.Y.1z||6.Y.1A)L(H p 1i 6.Y.3M)E.1x(6.T.R,p,6.Y.3P[p])}9(a&&E.1n(6.Y.1l))6.Y.1l.16(6.T);I P}J{H n=t-6.5u;6.4i=n/6.Y.2e;6.4q=E.3J[6.Y.3J||(E.3J.5q?"5q":"6B")](6.4i,n,0,1,6.Y.2e);6.2v=6.1O+((6.2D-6.1O)*6.4q);6.4r()}I Q}};E.2j.2F={2R:G(a){a.T.2R=a.2v},2B:G(a){a.T.2B=a.2v},1r:G(a){E.1x(a.T.R,"1r",a.2v)},6z:G(a){a.T.R[a.1e]=a.2v+a.2i}};E.1b.6m=G(){H c=0,3E=0,T=6[0],5t;9(T)8L(E.V){H b=E.17(T,"2X")=="4F",1D=T.12,23=T.23,2K=T.3H,4f=1N&&3x(4s)<8J;9(T.6V){5w=T.6V();1f(5w.1S+38.33(2K.2V.2R,2K.1G.2R),5w.3E+38.33(2K.2V.2B,2K.1G.2B));9(1h){H d=E("4o").17("8H");d=(d=="8G"||E.5g&&3x(4s)>=7)&&2||d;1f(-d,-d)}}J{1f(T.5l,T.5z);1W(23){1f(23.5l,23.5z);9(35&&/^t[d|h]$/i.14(1D.37)||!4f)d(23);9(4f&&!b&&E.17(23,"2X")=="4F")b=Q;23=23.23}1W(1D.37&&!/^1G|4o$/i.14(1D.37)){9(!/^8D|1I-9S.*$/i.14(E.17(1D,"19")))1f(-1D.2R,-1D.2B);9(35&&E.17(1D,"2U")!="3R")d(1D);1D=1D.12}9(4f&&b)1f(-2K.1G.5l,-2K.1G.5z)}5t={3E:3E,1S:c}}I 5t;G d(a){1f(E.17(a,"9T"),E.17(a,"8A"))}G 1f(l,t){c+=3x(l)||0;3E+=3x(t)||0}}})();',62,616,'||||||this|||if|||||||||||||||||||||||||||||||||function|var|return|else|length|for|data|each|type|false|true|style|null|elem|document|browser|undefined||options|||nodeName|parentNode||test|jQuery|apply|css|window|display|push|fn|constructor|url|prop|add|indexOf|msie|in|event|extend|complete|typeof|isFunction|className|replace|arguments|opacity|div|match|new|status|firstChild|attr|nodeType|hide|show|Array|success|parent|filter|trigger|body|height|table|script|tbody|cache|string|safari|start|hidden|value|merge|left|break|animate|dataType|while|map|find|global||get|id|offsetParent|select|toggle|selected|toUpperCase|remove|catch|try|cur|al|ready|duration|done|text|makeArray|unit|fx|swap|split|target||pushStack|toLowerCase|nextSibling|button|none|handle|guid|now|stack|tb|jsre|timeout|inArray|scrollTop|readyState|end|delete|step|one|name|nth|slice|doc|ret|preventDefault|width|call|events|checked|scrollLeft|exec|px|overflow|documentElement|grep|position|form|block|removeData|rl|timers|max|opera|mozilla|trim|tagName|Math|load|param|removeChild|disabled|insertBefore|async|encodeURIComponent|append|oldblock|val|childNodes|src|readyList|multiFilter|color|defaultView|stopPropagation|args|old|toString|is|last|first|eval|parseInt|self|domManip|prototype|getTime|curCSS|Date|top||ajax|ownerDocument|parseFloat|easing|has|queue|curAnim|custom|innerHTML|orig|currentStyle|visible|getElementById|isReady|error|static|bind|String|which|getComputedStyle|responseText|oWidth|oHeight|on|shift|json|child|RegExp|ol|lastModified|isXMLDoc|jsonp|jquery|previousSibling|dir|safari2|el|styleFloat|state|setInterval|radio|getElementsByTagName|tr|empty|html|getAttribute|pos|update|version|input|float|runtimeStyle|unshift|mouseover|getPropertyValue|GET|clearInterval|safariTimer|visibility|clean|__ie_init|absolute|handleHover|lastToggle|index|fromElement|relatedTarget|click|fix|evt|andSelf|removeEventListener|handler|cloneNode|addEventListener|triggered|nodeIndex|unique|Number|classFilter|prevObject|selectedIndex|after|submit|password|removeAttribute|file|expr|setTimeout|_|appendChild|ajaxSettings|client|active|win|sibling|deep|globalEval|boxModel|cssFloat|object|checkbox|parsererror|offsetLeft|wrapAll|dequeue|props|lastChild|swing|handleError|getResponseHeader|results|startTime|00|box|Modified|ifModified|offsetTop|evalScript|createElement|setRequestHeader|ctrlKey|callback|metaKey|contentType|ajaxSend|ajaxSuccess|ajaxError|ajaxStop|ajaxStart|serializeArray|init|notmodified|POST|loaded|appendTo|DOMContentLoaded|bindReady|mouseout|not|removeAttr|unbind|unload|Width|keyCode|charCode|onreadystatechange|clientX|pageX|srcElement|join|outerHTML|substr|zoom|parse|textarea|reset|image|odd|even|before|quickClass|quickID|prepend|quickChild|execScript|offset|scroll|processData|uuid|contents|continue|textContent|ajaxComplete|clone|setArray|webkit|nodeValue|fl|_default|100|linear|href|speed|eq|createTextNode|throw|replaceWith|splice|_toggle|xml|colgroup|304|200|alpha|Last|httpData|httpNotModified|httpSuccess|fieldset|beforeSend|getBoundingClientRect|XMLHttpRequest|ActiveXObject|col|br|abbr|pixelLeft|urlencoded|www|application|ajaxSetup|post|getJSON|getScript|elements|serialize|clientWidth|hasClass|scr|clientHeight|write|relative|keyup|keypress|keydown|change|mousemove|mouseup|mousedown|right|dblclick|resize|focus|blur|frames|instanceof|hover|offsetWidth|triggerHandler|ipt|defer|offsetHeight|border|padding|clientY|pageY|Left|Right|toElement|Bottom|Top|cancelBubble|returnValue|detachEvent|attachEvent|substring|line|weight|animated|header|font|enabled|innerText|contains|only|size|gt|lt|uFFFF|u0128|417|inner|Height|toggleClass|removeClass|addClass|replaceAll|noConflict|insertAfter|prependTo|wrap|contentWindow|contentDocument|http|iframe|children|siblings|prevAll|nextAll|wrapInner|prev|Boolean|next|parents|maxLength|maxlength|readOnly|readonly|class|htmlFor|CSS1Compat|compatMode|compatible|borderTopWidth|ie|ra|inline|it|rv|medium|borderWidth|userAgent|522|navigator|with|concat|1px|10000|array|ig|PI|NaN|400|reverse|fast|600|slow|Function|Object|setAttribute|changed|be|can|property|fadeTo|fadeOut|getAttributeNode|fadeIn|slideToggle|method|slideUp|slideDown|action|cssText|stop|responseXML|option|content|300|th|protocol|td|location|send|cap|abort|colg|cos|tfoot|thead|With|leg|Requested|opt|GMT|1970|Jan|01|Thu|area|Since|hr|If|Type|Content|meta|specified|open|link|XMLHTTP|Microsoft|img|onload|row|borderLeftWidth|head|attributes'.split('|'),0,{}))
|
js/magebuzz/jquery.scrollShow.js
ADDED
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jQuery.ScrollShow - Scrolling Slideshow.
|
3 |
+
* Copyright (c) 2007 Ariel Flesler - aflesler(at)gmail(dot)com
|
4 |
+
* Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php).
|
5 |
+
* Date: 10/30/2007
|
6 |
+
* @author Ariel Flesler
|
7 |
+
* @version 0.7
|
8 |
+
*
|
9 |
+
* @id jQuery.fn.scrollShow
|
10 |
+
* @param {Object} settings Hash of settings (detailed below).
|
11 |
+
* @return {jQuery} Returns the same jQuery object, for chaining.
|
12 |
+
**/
|
13 |
+
(function( $ ){
|
14 |
+
|
15 |
+
var defaults = {
|
16 |
+
elements:'div.item',//elements selector (relative to view)
|
17 |
+
itemSize:{
|
18 |
+
height:150,
|
19 |
+
width:150
|
20 |
+
},
|
21 |
+
view:null,//container of the elements, the one to fix the width.
|
22 |
+
navigators:null,//selector to the elements to navigate the slideshow.
|
23 |
+
navigationMode:'r',//sequential, random, localscroll
|
24 |
+
speed:600,//speed of transition, 1 for no-animation
|
25 |
+
wrappers:'simple',//simple,resize,crop,link
|
26 |
+
circular:false,//should the slideshow rewind/advance on the extremes ?.
|
27 |
+
easing:'linear',//easing equation
|
28 |
+
axis:'x',//axis to displace the slideshow
|
29 |
+
margin:true,//take margin in account?
|
30 |
+
start:null, //force the scroll to start at some position element.
|
31 |
+
setWidth:false//whether to calculate and set, the overall width of the slideshow.
|
32 |
+
};
|
33 |
+
|
34 |
+
function wrap( $els, type, size ){//wrap the photos with several different wrappers.
|
35 |
+
switch( type ){
|
36 |
+
case 'crop': $els = $els.wrap('<div class="jq-ss-crop">').parent().css('overflow','hidden');
|
37 |
+
case 'resize': return $els.css( size );
|
38 |
+
case 'simple': return $els.wrap('<div class="jq-ss-simple">').parent();
|
39 |
+
case 'link':
|
40 |
+
/* if( $els.is('img') )
|
41 |
+
return $els.wrap('<a target="_blank" class="jq-ss-link">').parent().each(function(){
|
42 |
+
this.href = this.firstChild.src;
|
43 |
+
}); */
|
44 |
+
default: return $els;
|
45 |
+
}
|
46 |
+
};
|
47 |
+
|
48 |
+
$.fn.scrollShow = function( settings ){
|
49 |
+
settings = $.extend( {}, defaults, settings );
|
50 |
+
|
51 |
+
return this.each(function(){
|
52 |
+
var
|
53 |
+
widget = this,
|
54 |
+
$view = settings.view ? $(settings.view, this) : this,
|
55 |
+
$elements = $(settings.elements, $view),
|
56 |
+
limit = $elements.length,
|
57 |
+
active = 0;
|
58 |
+
|
59 |
+
$.each( settings.wrappers.split(/\s*,\s*/), function( i, wrapper ){
|
60 |
+
$elements = wrap( $elements, wrapper, settings.itemSize );
|
61 |
+
});
|
62 |
+
$elements.css( settings.itemSize );//ensure the outer elements have fixed size.
|
63 |
+
|
64 |
+
if( !settings.navigators ){//this shouldn't get to happen
|
65 |
+
settings.navigators = '';
|
66 |
+
settings.navigationMode = 'r';
|
67 |
+
}
|
68 |
+
|
69 |
+
if( settings.navigators.constructor != Array )
|
70 |
+
settings.navigators = [settings.navigators];
|
71 |
+
|
72 |
+
$.each( settings.navigationMode.split(''), function( i, type ){
|
73 |
+
switch( type.charAt(0) ){
|
74 |
+
case 's'://sequential navigation
|
75 |
+
$(settings.navigators[i],widget)
|
76 |
+
.eq(0).bind('click', { dir: -1 }, sequential ).end()
|
77 |
+
.eq(1).bind('click', { dir: +1 }, sequential );
|
78 |
+
break;
|
79 |
+
case 'r'://random navigation
|
80 |
+
var $nav = $(settings.navigators[i] || $elements, widget),
|
81 |
+
ratio = $elements.length / $nav.length;
|
82 |
+
if( ratio === Infinity ) return;//no navigator found
|
83 |
+
$nav.each(function( pos ){
|
84 |
+
$(this).bind( 'click', { pos: Math.floor(ratio*pos) }, random );
|
85 |
+
});
|
86 |
+
break;
|
87 |
+
}
|
88 |
+
});
|
89 |
+
|
90 |
+
(function( $e, w ){
|
91 |
+
var imgw = ($e.width() + attrs('margin') + attrs('padding') + attr('border'));
|
92 |
+
|
93 |
+
do w -= imgw;
|
94 |
+
while( w > 0 && limit-- );//find the last element we can scroll To.
|
95 |
+
|
96 |
+
if( !settings.setWidth ) return;
|
97 |
+
|
98 |
+
do{
|
99 |
+
$e = $e.parent();
|
100 |
+
if( $e[0] == $view[0] )
|
101 |
+
return;
|
102 |
+
}while( $e.length > 1 );
|
103 |
+
$e.width( imgw * $elements.length );//if there's a container for the elements, calculate it's width.
|
104 |
+
|
105 |
+
})( $elements, $view.width() );
|
106 |
+
|
107 |
+
if( settings.start != null )
|
108 |
+
random( settings.start );
|
109 |
+
|
110 |
+
function attrs( name ){
|
111 |
+
return attr(name+'Left') + attr(name+'Right');
|
112 |
+
};
|
113 |
+
function attr( name ){
|
114 |
+
return parseInt($elements.css(name)) || 0;
|
115 |
+
};
|
116 |
+
|
117 |
+
function sequential( event ){
|
118 |
+
event.data.pos = active + event.data.dir;
|
119 |
+
return random( event );
|
120 |
+
};
|
121 |
+
|
122 |
+
function random( event ){
|
123 |
+
var pos = typeof event == 'number' ? event : event.data.pos;
|
124 |
+
if( pos < 0 )
|
125 |
+
pos = active == 0 && settings.circular ? limit : 0;
|
126 |
+
else if( pos > limit )
|
127 |
+
pos = active == limit && settings.circular ? 0 : limit;
|
128 |
+
|
129 |
+
$view.stop().scrollTo( $elements[pos], settings );
|
130 |
+
active = pos;
|
131 |
+
return false;
|
132 |
+
};
|
133 |
+
});
|
134 |
+
};
|
135 |
+
|
136 |
+
})( jQuery );
|
js/magebuzz/jquery.scrollTo-min.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jQuery.ScrollTo - Easy element scrolling using jQuery.
|
3 |
+
* Copyright (c) 2007 Ariel Flesler - aflesler(at)gmail(dot)com
|
4 |
+
* Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php).
|
5 |
+
* Date: 10/29/2007
|
6 |
+
* @author Ariel Flesler
|
7 |
+
* @version 1.2.2
|
8 |
+
* Compatible with jQuery 1.2.1, tested on Firefox 2.0.0.7, and IE 6, both on Windows.
|
9 |
+
**/
|
10 |
+
(function($){$.scrollTo=function(a,b){return $('html,body').scrollTo(a,b)};$.fn.scrollTo=function(e,f){f=$.extend({axis:'y',speed:1},f||{});if(f.axis.length!=2)f.queue=false;if(f.queue)f.speed=Math.ceil(f.speed/2);return this.each(function(){var d=$(this),t=e,k,l,u={};switch(typeof t){case'string':if(/^([+-]=)?\d+(px)?$/.test(t))break;t=$(t,this);case'object':k=$(t).offset()}$.each(f.axis.split(''),parse);animate(f.onAfter);function parse(i,a){var b=a=='x'?'Left':'Top',p=b.toLowerCase();var c='scroll'+b;u[c]=k?k[p]+(d.is('html,body')?0:d[0][c]-d.offset()[p]):t;if(f.margin&&typeof t=='object')u[c]-=parseInt($(t).css('margin'+b))||0;if(!i&&f.queue){if(d[0][c]!=u[c])animate(f.onAfterFirst);delete u[c]}};function animate(a){d.animate(u,f.speed,f.easing,a)}})}})(jQuery);
|
js/magebuzz/manufacturer/jquery.js
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery 1.2.1 - New Wave Javascript
|
3 |
+
*
|
4 |
+
* Copyright (c) 2007 John Resig (jquery.com)
|
5 |
+
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
6 |
+
* and GPL (GPL-LICENSE.txt) licenses.
|
7 |
+
*
|
8 |
+
* $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
|
9 |
+
* $Rev: 3353 $
|
10 |
+
*/
|
11 |
+
eval(function (p, a, c, k, e, r) {
|
12 |
+
e = function (c) {
|
13 |
+
return(c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
|
14 |
+
};
|
15 |
+
if (!''.replace(/^/, String)) {
|
16 |
+
while (c--)r[e(c)] = k[c] || e(c);
|
17 |
+
k = [function (e) {
|
18 |
+
return r[e]
|
19 |
+
}];
|
20 |
+
e = function () {
|
21 |
+
return'\\w+'
|
22 |
+
};
|
23 |
+
c = 1
|
24 |
+
}
|
25 |
+
;
|
26 |
+
while (c--)if (k[c])p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
|
27 |
+
return p
|
28 |
+
}('(G(){9(1m E!="W")H w=E;H E=18.15=G(a,b){I 6 7u E?6.5N(a,b):1u E(a,b)};9(1m $!="W")H D=$;18.$=E;H u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;E.1b=E.3A={5N:G(c,a){c=c||U;9(1m c=="1M"){H m=u.2S(c);9(m&&(m[1]||!a)){9(m[1])c=E.4D([m[1]],a);J{H b=U.3S(m[3]);9(b)9(b.22!=m[3])I E().1Y(c);J{6[0]=b;6.K=1;I 6}J c=[]}}J I 1u E(a).1Y(c)}J 9(E.1n(c))I 1u E(U)[E.1b.2d?"2d":"39"](c);I 6.6v(c.1c==1B&&c||(c.4c||c.K&&c!=18&&!c.1y&&c[0]!=W&&c[0].1y)&&E.2h(c)||[c])},4c:"1.2.1",7Y:G(){I 6.K},K:0,21:G(a){I a==W?E.2h(6):6[a]},2o:G(a){H b=E(a);b.4Y=6;I b},6v:G(a){6.K=0;1B.3A.1a.16(6,a);I 6},N:G(a,b){I E.N(6,a,b)},4I:G(a){H b=-1;6.N(G(i){9(6==a)b=i});I b},1x:G(f,d,e){H c=f;9(f.1c==3X)9(d==W)I 6.K&&E[e||"1x"](6[0],f)||W;J{c={};c[f]=d}I 6.N(G(a){L(H b 1i c)E.1x(e?6.R:6,b,E.1e(6,c[b],e,a,b))})},17:G(b,a){I 6.1x(b,a,"3C")},2g:G(e){9(1m e!="5i"&&e!=S)I 6.4n().3g(U.6F(e));H t="";E.N(e||6,G(){E.N(6.3j,G(){9(6.1y!=8)t+=6.1y!=1?6.6x:E.1b.2g([6])})});I t},5m:G(b){9(6[0])E(b,6[0].3H).6u().3d(6[0]).1X(G(){H a=6;1W(a.1w)a=a.1w;I a}).3g(6);I 6},8m:G(a){I 6.N(G(){E(6).6q().5m(a)})},8d:G(a){I 6.N(G(){E(6).5m(a)})},3g:G(){I 6.3z(1q,Q,1,G(a){6.58(a)})},6j:G(){I 6.3z(1q,Q,-1,G(a){6.3d(a,6.1w)})},6g:G(){I 6.3z(1q,P,1,G(a){6.12.3d(a,6)})},50:G(){I 6.3z(1q,P,-1,G(a){6.12.3d(a,6.2q)})},2D:G(){I 6.4Y||E([])},1Y:G(t){H b=E.1X(6,G(a){I E.1Y(t,a)});I 6.2o(/[^+>] [^+>]/.14(t)||t.1g("..")>-1?E.4V(b):b)},6u:G(e){H f=6.1X(G(){I 6.67?E(6.67)[0]:6.4R(Q)});H d=f.1Y("*").4O().N(G(){9(6[F]!=W)6[F]=S});9(e===Q)6.1Y("*").4O().N(G(i){H c=E.M(6,"2P");L(H a 1i c)L(H b 1i c[a])E.1j.1f(d[i],a,c[a][b],c[a][b].M)});I f},1E:G(t){I 6.2o(E.1n(t)&&E.2W(6,G(b,a){I t.16(b,[a])})||E.3m(t,6))},5V:G(t){I 6.2o(t.1c==3X&&E.3m(t,6,Q)||E.2W(6,G(a){I(t.1c==1B||t.4c)?E.2A(a,t)<0:a!=t}))},1f:G(t){I 6.2o(E.1R(6.21(),t.1c==3X?E(t).21():t.K!=W&&(!t.11||E.11(t,"2Y"))?t:[t]))},3t:G(a){I a?E.3m(a,6).K>0:P},7c:G(a){I 6.3t("."+a)},3i:G(b){9(b==W){9(6.K){H c=6[0];9(E.11(c,"24")){H e=c.4Z,a=[],Y=c.Y,2G=c.O=="24-2G";9(e<0)I S;L(H i=2G?e:0,33=2G?e+1:Y.K;i<33;i++){H d=Y[i];9(d.26){H b=E.V.1h&&!d.9V["1Q"].9L?d.2g:d.1Q;9(2G)I b;a.1a(b)}}I a}J I 6[0].1Q.1p(/\\r/g,"")}}J I 6.N(G(){9(b.1c==1B&&/4k|5j/.14(6.O))6.2Q=(E.2A(6.1Q,b)>=0||E.2A(6.2H,b)>=0);J 9(E.11(6,"24")){H a=b.1c==1B?b:[b];E("9h",6).N(G(){6.26=(E.2A(6.1Q,a)>=0||E.2A(6.2g,a)>=0)});9(!a.K)6.4Z=-1}J 6.1Q=b})},4o:G(a){I a==W?(6.K?6[0].3O:S):6.4n().3g(a)},6H:G(a){I 6.50(a).28()},6E:G(i){I 6.2J(i,i+1)},2J:G(){I 6.2o(1B.3A.2J.16(6,1q))},1X:G(b){I 6.2o(E.1X(6,G(a,i){I b.2O(a,i,a)}))},4O:G(){I 6.1f(6.4Y)},3z:G(f,d,g,e){H c=6.K>1,a;I 6.N(G(){9(!a){a=E.4D(f,6.3H);9(g<0)a.8U()}H b=6;9(d&&E.11(6,"1I")&&E.11(a[0],"4m"))b=6.4l("1K")[0]||6.58(U.5B("1K"));E.N(a,G(){H a=c?6.4R(Q):6;9(!5A(0,a))e.2O(b,a)})})}};G 5A(i,b){H a=E.11(b,"1J");9(a){9(b.3k)E.3G({1d:b.3k,3e:P,1V:"1J"});J E.5f(b.2g||b.6s||b.3O||"");9(b.12)b.12.3b(b)}J 9(b.1y==1)E("1J",b).N(5A);I a}E.1k=E.1b.1k=G(){H c=1q[0]||{},a=1,2c=1q.K,5e=P;9(c.1c==8o){5e=c;c=1q[1]||{}}9(2c==1){c=6;a=0}H b;L(;a<2c;a++)9((b=1q[a])!=S)L(H i 1i b){9(c==b[i])6r;9(5e&&1m b[i]==\'5i\'&&c[i])E.1k(c[i],b[i]);J 9(b[i]!=W)c[i]=b[i]}I c};H F="15"+(1u 3D()).3B(),6p=0,5c={};E.1k({8a:G(a){18.$=D;9(a)18.15=w;I E},1n:G(a){I!!a&&1m a!="1M"&&!a.11&&a.1c!=1B&&/G/i.14(a+"")},4a:G(a){I a.2V&&!a.1G||a.37&&a.3H&&!a.3H.1G},5f:G(a){a=E.36(a);9(a){9(18.6l)18.6l(a);J 9(E.V.1N)18.56(a,0);J 3w.2O(18,a)}},11:G(b,a){I b.11&&b.11.27()==a.27()},1L:{},M:G(c,d,b){c=c==18?5c:c;H a=c[F];9(!a)a=c[F]=++6p;9(d&&!E.1L[a])E.1L[a]={};9(b!=W)E.1L[a][d]=b;I d?E.1L[a][d]:a},30:G(c,b){c=c==18?5c:c;H a=c[F];9(b){9(E.1L[a]){2E E.1L[a][b];b="";L(b 1i E.1L[a])1T;9(!b)E.30(c)}}J{2a{2E c[F]}29(e){9(c.53)c.53(F)}2E E.1L[a]}},N:G(a,b,c){9(c){9(a.K==W)L(H i 1i a)b.16(a[i],c);J L(H i=0,48=a.K;i<48;i++)9(b.16(a[i],c)===P)1T}J{9(a.K==W)L(H i 1i a)b.2O(a[i],i,a[i]);J L(H i=0,48=a.K,3i=a[0];i<48&&b.2O(3i,i,3i)!==P;3i=a[++i]){}}I a},1e:G(c,b,d,e,a){9(E.1n(b))b=b.2O(c,[e]);H f=/z-?4I|7T-?7Q|1r|69|7P-?1H/i;I b&&b.1c==4W&&d=="3C"&&!f.14(a)?b+"2T":b},1o:{1f:G(b,c){E.N((c||"").2l(/\\s+/),G(i,a){9(!E.1o.3K(b.1o,a))b.1o+=(b.1o?" ":"")+a})},28:G(b,c){b.1o=c!=W?E.2W(b.1o.2l(/\\s+/),G(a){I!E.1o.3K(c,a)}).66(" "):""},3K:G(t,c){I E.2A(c,(t.1o||t).3s().2l(/\\s+/))>-1}},2k:G(e,o,f){L(H i 1i o){e.R["3r"+i]=e.R[i];e.R[i]=o[i]}f.16(e,[]);L(H i 1i o)e.R[i]=e.R["3r"+i]},17:G(e,p){9(p=="1H"||p=="2N"){H b={},42,41,d=["7J","7I","7G","7F"];E.N(d,G(){b["7C"+6]=0;b["7B"+6+"5Z"]=0});E.2k(e,b,G(){9(E(e).3t(\':3R\')){42=e.7A;41=e.7w}J{e=E(e.4R(Q)).1Y(":4k").5W("2Q").2D().17({4C:"1P",2X:"4F",19:"2Z",7o:"0",1S:"0"}).5R(e.12)[0];H a=E.17(e.12,"2X")||"3V";9(a=="3V")e.12.R.2X="7g";42=e.7e;41=e.7b;9(a=="3V")e.12.R.2X="3V";e.12.3b(e)}});I p=="1H"?42:41}I E.3C(e,p)},3C:G(h,j,i){H g,2w=[],2k=[];G 3n(a){9(!E.V.1N)I P;H b=U.3o.3Z(a,S);I!b||b.4y("3n")==""}9(j=="1r"&&E.V.1h){g=E.1x(h.R,"1r");I g==""?"1":g}9(j.1t(/4u/i))j=y;9(!i&&h.R[j])g=h.R[j];J 9(U.3o&&U.3o.3Z){9(j.1t(/4u/i))j="4u";j=j.1p(/([A-Z])/g,"-$1").2p();H d=U.3o.3Z(h,S);9(d&&!3n(h))g=d.4y(j);J{L(H a=h;a&&3n(a);a=a.12)2w.4w(a);L(a=0;a<2w.K;a++)9(3n(2w[a])){2k[a]=2w[a].R.19;2w[a].R.19="2Z"}g=j=="19"&&2k[2w.K-1]!=S?"2s":U.3o.3Z(h,S).4y(j)||"";L(a=0;a<2k.K;a++)9(2k[a]!=S)2w[a].R.19=2k[a]}9(j=="1r"&&g=="")g="1"}J 9(h.3Q){H f=j.1p(/\\-(\\w)/g,G(m,c){I c.27()});g=h.3Q[j]||h.3Q[f];9(!/^\\d+(2T)?$/i.14(g)&&/^\\d/.14(g)){H k=h.R.1S;H e=h.4v.1S;h.4v.1S=h.3Q.1S;h.R.1S=g||0;g=h.R.71+"2T";h.R.1S=k;h.4v.1S=e}}I g},4D:G(a,e){H r=[];e=e||U;E.N(a,G(i,d){9(!d)I;9(d.1c==4W)d=d.3s();9(1m d=="1M"){d=d.1p(/(<(\\w+)[^>]*?)\\/>/g,G(m,a,b){I b.1t(/^(70|6Z|6Y|9Q|4t|9N|9K|3a|9G|9E)$/i)?m:a+"></"+b+">"});H s=E.36(d).2p(),1s=e.5B("1s"),2x=[];H c=!s.1g("<9y")&&[1,"<24>","</24>"]||!s.1g("<9w")&&[1,"<6T>","</6T>"]||s.1t(/^<(9u|1K|9t|9r|9p)/)&&[1,"<1I>","</1I>"]||!s.1g("<4m")&&[2,"<1I><1K>","</1K></1I>"]||(!s.1g("<9m")||!s.1g("<9k"))&&[3,"<1I><1K><4m>","</4m></1K></1I>"]||!s.1g("<6Y")&&[2,"<1I><1K></1K><6L>","</6L></1I>"]||E.V.1h&&[1,"1s<1s>","</1s>"]||[0,"",""];1s.3O=c[1]+d+c[2];1W(c[0]--)1s=1s.5p;9(E.V.1h){9(!s.1g("<1I")&&s.1g("<1K")<0)2x=1s.1w&&1s.1w.3j;J 9(c[1]=="<1I>"&&s.1g("<1K")<0)2x=1s.3j;L(H n=2x.K-1;n>=0;--n)9(E.11(2x[n],"1K")&&!2x[n].3j.K)2x[n].12.3b(2x[n]);9(/^\\s/.14(d))1s.3d(e.6F(d.1t(/^\\s*/)[0]),1s.1w)}d=E.2h(1s.3j)}9(0===d.K&&(!E.11(d,"2Y")&&!E.11(d,"24")))I;9(d[0]==W||E.11(d,"2Y")||d.Y)r.1a(d);J r=E.1R(r,d)});I r},1x:G(c,d,a){H e=E.4a(c)?{}:E.5o;9(d=="26"&&E.V.1N)c.12.4Z;9(e[d]){9(a!=W)c[e[d]]=a;I c[e[d]]}J 9(E.V.1h&&d=="R")I E.1x(c.R,"9e",a);J 9(a==W&&E.V.1h&&E.11(c,"2Y")&&(d=="9d"||d=="9a"))I c.97(d).6x;J 9(c.37){9(a!=W){9(d=="O"&&E.11(c,"4t")&&c.12)6G"O 94 93\'t 92 91";c.90(d,a)}9(E.V.1h&&/6C|3k/.14(d)&&!E.4a(c))I c.4p(d,2);I c.4p(d)}J{9(d=="1r"&&E.V.1h){9(a!=W){c.69=1;c.1E=(c.1E||"").1p(/6O\\([^)]*\\)/,"")+(3I(a).3s()=="8S"?"":"6O(1r="+a*6A+")")}I c.1E?(3I(c.1E.1t(/1r=([^)]*)/)[1])/6A).3s():""}d=d.1p(/-([a-z])/8Q,G(z,b){I b.27()});9(a!=W)c[d]=a;I c[d]}},36:G(t){I(t||"").1p(/^\\s+|\\s+$/g,"")},2h:G(a){H r=[];9(1m a!="8P")L(H i=0,2c=a.K;i<2c;i++)r.1a(a[i]);J r=a.2J(0);I r},2A:G(b,a){L(H i=0,2c=a.K;i<2c;i++)9(a[i]==b)I i;I-1},1R:G(a,b){9(E.V.1h){L(H i=0;b[i];i++)9(b[i].1y!=8)a.1a(b[i])}J L(H i=0;b[i];i++)a.1a(b[i]);I a},4V:G(b){H r=[],2f={};2a{L(H i=0,6y=b.K;i<6y;i++){H a=E.M(b[i]);9(!2f[a]){2f[a]=Q;r.1a(b[i])}}}29(e){r=b}I r},2W:G(b,a,c){9(1m a=="1M")a=3w("P||G(a,i){I "+a+"}");H d=[];L(H i=0,4g=b.K;i<4g;i++)9(!c&&a(b[i],i)||c&&!a(b[i],i))d.1a(b[i]);I d},1X:G(c,b){9(1m b=="1M")b=3w("P||G(a){I "+b+"}");H d=[];L(H i=0,4g=c.K;i<4g;i++){H a=b(c[i],i);9(a!==S&&a!=W){9(a.1c!=1B)a=[a];d=d.8M(a)}}I d}});H v=8K.8I.2p();E.V={4s:(v.1t(/.+(?:8F|8E|8C|8B)[\\/: ]([\\d.]+)/)||[])[1],1N:/6w/.14(v),34:/34/.14(v),1h:/1h/.14(v)&&!/34/.14(v),35:/35/.14(v)&&!/(8z|6w)/.14(v)};H y=E.V.1h?"4h":"5h";E.1k({5g:!E.V.1h||U.8y=="8x",4h:E.V.1h?"4h":"5h",5o:{"L":"8w","8v":"1o","4u":y,5h:y,4h:y,3O:"3O",1o:"1o",1Q:"1Q",3c:"3c",2Q:"2Q",8u:"8t",26:"26",8s:"8r"}});E.N({1D:"a.12",8q:"15.4e(a,\'12\')",8p:"15.2I(a,2,\'2q\')",8n:"15.2I(a,2,\'4d\')",8l:"15.4e(a,\'2q\')",8k:"15.4e(a,\'4d\')",8j:"15.5d(a.12.1w,a)",8i:"15.5d(a.1w)",6q:"15.11(a,\'8h\')?a.8f||a.8e.U:15.2h(a.3j)"},G(i,n){E.1b[i]=G(a){H b=E.1X(6,n);9(a&&1m a=="1M")b=E.3m(a,b);I 6.2o(E.4V(b))}});E.N({5R:"3g",8c:"6j",3d:"6g",8b:"50",89:"6H"},G(i,n){E.1b[i]=G(){H a=1q;I 6.N(G(){L(H j=0,2c=a.K;j<2c;j++)E(a[j])[n](6)})}});E.N({5W:G(a){E.1x(6,a,"");6.53(a)},88:G(c){E.1o.1f(6,c)},87:G(c){E.1o.28(6,c)},86:G(c){E.1o[E.1o.3K(6,c)?"28":"1f"](6,c)},28:G(a){9(!a||E.1E(a,[6]).r.K){E.30(6);6.12.3b(6)}},4n:G(){E("*",6).N(G(){E.30(6)});1W(6.1w)6.3b(6.1w)}},G(i,n){E.1b[i]=G(){I 6.N(n,1q)}});E.N(["85","5Z"],G(i,a){H n=a.2p();E.1b[n]=G(h){I 6[0]==18?E.V.1N&&3y["84"+a]||E.5g&&38.33(U.2V["5a"+a],U.1G["5a"+a])||U.1G["5a"+a]:6[0]==U?38.33(U.1G["6n"+a],U.1G["6m"+a]):h==W?(6.K?E.17(6[0],n):S):6.17(n,h.1c==3X?h:h+"2T")}});H C=E.V.1N&&3x(E.V.4s)<83?"(?:[\\\\w*57-]|\\\\\\\\.)":"(?:[\\\\w\\82-\\81*57-]|\\\\\\\\.)",6k=1u 47("^>\\\\s*("+C+"+)"),6i=1u 47("^("+C+"+)(#)("+C+"+)"),6h=1u 47("^([#.]?)("+C+"*)");E.1k({55:{"":"m[2]==\'*\'||15.11(a,m[2])","#":"a.4p(\'22\')==m[2]",":":{80:"i<m[3]-0",7Z:"i>m[3]-0",2I:"m[3]-0==i",6E:"m[3]-0==i",3v:"i==0",3u:"i==r.K-1",6f:"i%2==0",6e:"i%2","3v-46":"a.12.4l(\'*\')[0]==a","3u-46":"15.2I(a.12.5p,1,\'4d\')==a","7X-46":"!15.2I(a.12.5p,2,\'4d\')",1D:"a.1w",4n:"!a.1w",7W:"(a.6s||a.7V||15(a).2g()||\'\').1g(m[3])>=0",3R:\'"1P"!=a.O&&15.17(a,"19")!="2s"&&15.17(a,"4C")!="1P"\',1P:\'"1P"==a.O||15.17(a,"19")=="2s"||15.17(a,"4C")=="1P"\',7U:"!a.3c",3c:"a.3c",2Q:"a.2Q",26:"a.26||15.1x(a,\'26\')",2g:"\'2g\'==a.O",4k:"\'4k\'==a.O",5j:"\'5j\'==a.O",54:"\'54\'==a.O",52:"\'52\'==a.O",51:"\'51\'==a.O",6d:"\'6d\'==a.O",6c:"\'6c\'==a.O",2r:\'"2r"==a.O||15.11(a,"2r")\',4t:"/4t|24|6b|2r/i.14(a.11)",3K:"15.1Y(m[3],a).K",7S:"/h\\\\d/i.14(a.11)",7R:"15.2W(15.32,G(1b){I a==1b.T;}).K"}},6a:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1u 47("^([:.#]*)("+C+"+)")],3m:G(a,c,b){H d,2b=[];1W(a&&a!=d){d=a;H f=E.1E(a,c,b);a=f.t.1p(/^\\s*,\\s*/,"");2b=b?c=f.r:E.1R(2b,f.r)}I 2b},1Y:G(t,o){9(1m t!="1M")I[t];9(o&&!o.1y)o=S;o=o||U;H d=[o],2f=[],3u;1W(t&&3u!=t){H r=[];3u=t;t=E.36(t);H l=P;H g=6k;H m=g.2S(t);9(m){H p=m[1].27();L(H i=0;d[i];i++)L(H c=d[i].1w;c;c=c.2q)9(c.1y==1&&(p=="*"||c.11.27()==p.27()))r.1a(c);d=r;t=t.1p(g,"");9(t.1g(" ")==0)6r;l=Q}J{g=/^([>+~])\\s*(\\w*)/i;9((m=g.2S(t))!=S){r=[];H p=m[2],1R={};m=m[1];L(H j=0,31=d.K;j<31;j++){H n=m=="~"||m=="+"?d[j].2q:d[j].1w;L(;n;n=n.2q)9(n.1y==1){H h=E.M(n);9(m=="~"&&1R[h])1T;9(!p||n.11.27()==p.27()){9(m=="~")1R[h]=Q;r.1a(n)}9(m=="+")1T}}d=r;t=E.36(t.1p(g,""));l=Q}}9(t&&!l){9(!t.1g(",")){9(o==d[0])d.44();2f=E.1R(2f,d);r=d=[o];t=" "+t.68(1,t.K)}J{H k=6i;H m=k.2S(t);9(m){m=[0,m[2],m[3],m[1]]}J{k=6h;m=k.2S(t)}m[2]=m[2].1p(/\\\\/g,"");H f=d[d.K-1];9(m[1]=="#"&&f&&f.3S&&!E.4a(f)){H q=f.3S(m[2]);9((E.V.1h||E.V.34)&&q&&1m q.22=="1M"&&q.22!=m[2])q=E(\'[@22="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.11(q,m[3]))?[q]:[]}J{L(H i=0;d[i];i++){H a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];9(a=="*"&&d[i].11.2p()=="5i")a="3a";r=E.1R(r,d[i].4l(a))}9(m[1]==".")r=E.4X(r,m[2]);9(m[1]=="#"){H e=[];L(H i=0;r[i];i++)9(r[i].4p("22")==m[2]){e=[r[i]];1T}r=e}d=r}t=t.1p(k,"")}}9(t){H b=E.1E(t,r);d=r=b.r;t=E.36(b.t)}}9(t)d=[];9(d&&o==d[0])d.44();2f=E.1R(2f,d);I 2f},4X:G(r,m,a){m=" "+m+" ";H c=[];L(H i=0;r[i];i++){H b=(" "+r[i].1o+" ").1g(m)>=0;9(!a&&b||a&&!b)c.1a(r[i])}I c},1E:G(t,r,h){H d;1W(t&&t!=d){d=t;H p=E.6a,m;L(H i=0;p[i];i++){m=p[i].2S(t);9(m){t=t.7O(m[0].K);m[2]=m[2].1p(/\\\\/g,"");1T}}9(!m)1T;9(m[1]==":"&&m[2]=="5V")r=E.1E(m[3],r,Q).r;J 9(m[1]==".")r=E.4X(r,m[2],h);J 9(m[1]=="["){H g=[],O=m[3];L(H i=0,31=r.K;i<31;i++){H a=r[i],z=a[E.5o[m[2]]||m[2]];9(z==S||/6C|3k|26/.14(m[2]))z=E.1x(a,m[2])||\'\';9((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1g(m[5])||O=="$="&&z.68(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1g(m[5])>=0)^h)g.1a(a)}r=g}J 9(m[1]==":"&&m[2]=="2I-46"){H e={},g=[],14=/(\\d*)n\\+?(\\d*)/.2S(m[3]=="6f"&&"2n"||m[3]=="6e"&&"2n+1"||!/\\D/.14(m[3])&&"n+"+m[3]||m[3]),3v=(14[1]||1)-0,d=14[2]-0;L(H i=0,31=r.K;i<31;i++){H j=r[i],12=j.12,22=E.M(12);9(!e[22]){H c=1;L(H n=12.1w;n;n=n.2q)9(n.1y==1)n.4U=c++;e[22]=Q}H b=P;9(3v==1){9(d==0||j.4U==d)b=Q}J 9((j.4U+d)%3v==0)b=Q;9(b^h)g.1a(j)}r=g}J{H f=E.55[m[1]];9(1m f!="1M")f=E.55[m[1]][m[2]];f=3w("P||G(a,i){I "+f+"}");r=E.2W(r,f,h)}}I{r:r,t:t}},4e:G(b,c){H d=[];H a=b[c];1W(a&&a!=U){9(a.1y==1)d.1a(a);a=a[c]}I d},2I:G(a,e,c,b){e=e||1;H d=0;L(;a;a=a[c])9(a.1y==1&&++d==e)1T;I a},5d:G(n,a){H r=[];L(;n;n=n.2q){9(n.1y==1&&(!a||n!=a))r.1a(n)}I r}});E.1j={1f:G(g,e,c,h){9(E.V.1h&&g.4j!=W)g=18;9(!c.2u)c.2u=6.2u++;9(h!=W){H d=c;c=G(){I d.16(6,1q)};c.M=h;c.2u=d.2u}H i=e.2l(".");e=i[0];c.O=i[1];H b=E.M(g,"2P")||E.M(g,"2P",{});H f=E.M(g,"2t",G(){H a;9(1m E=="W"||E.1j.4T)I a;a=E.1j.2t.16(g,1q);I a});H j=b[e];9(!j){j=b[e]={};9(g.4S)g.4S(e,f,P);J g.7N("43"+e,f)}j[c.2u]=c;6.1Z[e]=Q},2u:1,1Z:{},28:G(d,c,b){H e=E.M(d,"2P"),2L,4I;9(1m c=="1M"){H a=c.2l(".");c=a[0]}9(e){9(c&&c.O){b=c.4Q;c=c.O}9(!c){L(c 1i e)6.28(d,c)}J 9(e[c]){9(b)2E e[c][b.2u];J L(b 1i e[c])9(!a[1]||e[c][b].O==a[1])2E e[c][b];L(2L 1i e[c])1T;9(!2L){9(d.4P)d.4P(c,E.M(d,"2t"),P);J d.7M("43"+c,E.M(d,"2t"));2L=S;2E e[c]}}L(2L 1i e)1T;9(!2L){E.30(d,"2P");E.30(d,"2t")}}},1F:G(d,b,e,c,f){b=E.2h(b||[]);9(!e){9(6.1Z[d])E("*").1f([18,U]).1F(d,b)}J{H a,2L,1b=E.1n(e[d]||S),4N=!b[0]||!b[0].2M;9(4N)b.4w(6.4M({O:d,2m:e}));b[0].O=d;9(E.1n(E.M(e,"2t")))a=E.M(e,"2t").16(e,b);9(!1b&&e["43"+d]&&e["43"+d].16(e,b)===P)a=P;9(4N)b.44();9(f&&f.16(e,b)===P)a=P;9(1b&&c!==P&&a!==P&&!(E.11(e,\'a\')&&d=="4L")){6.4T=Q;e[d]()}6.4T=P}I a},2t:G(d){H a;d=E.1j.4M(d||18.1j||{});H b=d.O.2l(".");d.O=b[0];H c=E.M(6,"2P")&&E.M(6,"2P")[d.O],3q=1B.3A.2J.2O(1q,1);3q.4w(d);L(H j 1i c){3q[0].4Q=c[j];3q[0].M=c[j].M;9(!b[1]||c[j].O==b[1]){H e=c[j].16(6,3q);9(a!==P)a=e;9(e===P){d.2M();d.3p()}}}9(E.V.1h)d.2m=d.2M=d.3p=d.4Q=d.M=S;I a},4M:G(c){H a=c;c=E.1k({},a);c.2M=G(){9(a.2M)a.2M();a.7L=P};c.3p=G(){9(a.3p)a.3p();a.7K=Q};9(!c.2m&&c.65)c.2m=c.65;9(E.V.1N&&c.2m.1y==3)c.2m=a.2m.12;9(!c.4K&&c.4J)c.4K=c.4J==c.2m?c.7H:c.4J;9(c.64==S&&c.63!=S){H e=U.2V,b=U.1G;c.64=c.63+(e&&e.2R||b.2R||0);c.7E=c.7D+(e&&e.2B||b.2B||0)}9(!c.3Y&&(c.61||c.60))c.3Y=c.61||c.60;9(!c.5F&&c.5D)c.5F=c.5D;9(!c.3Y&&c.2r)c.3Y=(c.2r&1?1:(c.2r&2?3:(c.2r&4?2:0)));I c}};E.1b.1k({3W:G(c,a,b){I c=="5Y"?6.2G(c,a,b):6.N(G(){E.1j.1f(6,c,b||a,b&&a)})},2G:G(d,b,c){I 6.N(G(){E.1j.1f(6,d,G(a){E(6).5X(a);I(c||b).16(6,1q)},c&&b)})},5X:G(a,b){I 6.N(G(){E.1j.28(6,a,b)})},1F:G(c,a,b){I 6.N(G(){E.1j.1F(c,a,6,Q,b)})},7x:G(c,a,b){9(6[0])I E.1j.1F(c,a,6[0],P,b)},25:G(){H a=1q;I 6.4L(G(e){6.4H=0==6.4H?1:0;e.2M();I a[6.4H].16(6,[e])||P})},7v:G(f,g){G 4G(e){H p=e.4K;1W(p&&p!=6)2a{p=p.12}29(e){p=6};9(p==6)I P;I(e.O=="4x"?f:g).16(6,[e])}I 6.4x(4G).5U(4G)},2d:G(f){5T();9(E.3T)f.16(U,[E]);J E.3l.1a(G(){I f.16(6,[E])});I 6}});E.1k({3T:P,3l:[],2d:G(){9(!E.3T){E.3T=Q;9(E.3l){E.N(E.3l,G(){6.16(U)});E.3l=S}9(E.V.35||E.V.34)U.4P("5S",E.2d,P);9(!18.7t.K)E(18).39(G(){E("#4E").28()})}}});E.N(("7s,7r,39,7q,6n,5Y,4L,7p,"+"7n,7m,7l,4x,5U,7k,24,"+"51,7j,7i,7h,3U").2l(","),G(i,o){E.1b[o]=G(f){I f?6.3W(o,f):6.1F(o)}});H x=P;G 5T(){9(x)I;x=Q;9(E.V.35||E.V.34)U.4S("5S",E.2d,P);J 9(E.V.1h){U.7f("<7d"+"7y 22=4E 7z=Q "+"3k=//:><\\/1J>");H a=U.3S("4E");9(a)a.62=G(){9(6.2C!="1l")I;E.2d()};a=S}J 9(E.V.1N)E.4B=4j(G(){9(U.2C=="5Q"||U.2C=="1l"){4A(E.4B);E.4B=S;E.2d()}},10);E.1j.1f(18,"39",E.2d)}E.1b.1k({39:G(g,d,c){9(E.1n(g))I 6.3W("39",g);H e=g.1g(" ");9(e>=0){H i=g.2J(e,g.K);g=g.2J(0,e)}c=c||G(){};H f="4z";9(d)9(E.1n(d)){c=d;d=S}J{d=E.3a(d);f="5P"}H h=6;E.3G({1d:g,O:f,M:d,1l:G(a,b){9(b=="1C"||b=="5O")h.4o(i?E("<1s/>").3g(a.40.1p(/<1J(.|\\s)*?\\/1J>/g,"")).1Y(i):a.40);56(G(){h.N(c,[a.40,b,a])},13)}});I 6},7a:G(){I E.3a(6.5M())},5M:G(){I 6.1X(G(){I E.11(6,"2Y")?E.2h(6.79):6}).1E(G(){I 6.2H&&!6.3c&&(6.2Q||/24|6b/i.14(6.11)||/2g|1P|52/i.14(6.O))}).1X(G(i,c){H b=E(6).3i();I b==S?S:b.1c==1B?E.1X(b,G(a,i){I{2H:c.2H,1Q:a}}):{2H:c.2H,1Q:b}}).21()}});E.N("5L,5K,6t,5J,5I,5H".2l(","),G(i,o){E.1b[o]=G(f){I 6.3W(o,f)}});H B=(1u 3D).3B();E.1k({21:G(d,b,a,c){9(E.1n(b)){a=b;b=S}I E.3G({O:"4z",1d:d,M:b,1C:a,1V:c})},78:G(b,a){I E.21(b,S,a,"1J")},77:G(c,b,a){I E.21(c,b,a,"45")},76:G(d,b,a,c){9(E.1n(b)){a=b;b={}}I E.3G({O:"5P",1d:d,M:b,1C:a,1V:c})},75:G(a){E.1k(E.59,a)},59:{1Z:Q,O:"4z",2z:0,5G:"74/x-73-2Y-72",6o:Q,3e:Q,M:S},49:{},3G:G(s){H f,2y=/=(\\?|%3F)/g,1v,M;s=E.1k(Q,s,E.1k(Q,{},E.59,s));9(s.M&&s.6o&&1m s.M!="1M")s.M=E.3a(s.M);9(s.1V=="4b"){9(s.O.2p()=="21"){9(!s.1d.1t(2y))s.1d+=(s.1d.1t(/\\?/)?"&":"?")+(s.4b||"5E")+"=?"}J 9(!s.M||!s.M.1t(2y))s.M=(s.M?s.M+"&":"")+(s.4b||"5E")+"=?";s.1V="45"}9(s.1V=="45"&&(s.M&&s.M.1t(2y)||s.1d.1t(2y))){f="4b"+B++;9(s.M)s.M=s.M.1p(2y,"="+f);s.1d=s.1d.1p(2y,"="+f);s.1V="1J";18[f]=G(a){M=a;1C();1l();18[f]=W;2a{2E 18[f]}29(e){}}}9(s.1V=="1J"&&s.1L==S)s.1L=P;9(s.1L===P&&s.O.2p()=="21")s.1d+=(s.1d.1t(/\\?/)?"&":"?")+"57="+(1u 3D()).3B();9(s.M&&s.O.2p()=="21"){s.1d+=(s.1d.1t(/\\?/)?"&":"?")+s.M;s.M=S}9(s.1Z&&!E.5b++)E.1j.1F("5L");9(!s.1d.1g("8g")&&s.1V=="1J"){H h=U.4l("9U")[0];H g=U.5B("1J");g.3k=s.1d;9(!f&&(s.1C||s.1l)){H j=P;g.9R=g.62=G(){9(!j&&(!6.2C||6.2C=="5Q"||6.2C=="1l")){j=Q;1C();1l();h.3b(g)}}}h.58(g);I}H k=P;H i=18.6X?1u 6X("9P.9O"):1u 6W();i.9M(s.O,s.1d,s.3e);9(s.M)i.5C("9J-9I",s.5G);9(s.5y)i.5C("9H-5x-9F",E.49[s.1d]||"9D, 9C 9B 9A 5v:5v:5v 9z");i.5C("X-9x-9v","6W");9(s.6U)s.6U(i);9(s.1Z)E.1j.1F("5H",[i,s]);H c=G(a){9(!k&&i&&(i.2C==4||a=="2z")){k=Q;9(d){4A(d);d=S}1v=a=="2z"&&"2z"||!E.6S(i)&&"3U"||s.5y&&E.6R(i,s.1d)&&"5O"||"1C";9(1v=="1C"){2a{M=E.6Q(i,s.1V)}29(e){1v="5k"}}9(1v=="1C"){H b;2a{b=i.5s("6P-5x")}29(e){}9(s.5y&&b)E.49[s.1d]=b;9(!f)1C()}J E.5r(s,i,1v);1l();9(s.3e)i=S}};9(s.3e){H d=4j(c,13);9(s.2z>0)56(G(){9(i){i.9q();9(!k)c("2z")}},s.2z)}2a{i.9o(s.M)}29(e){E.5r(s,i,S,e)}9(!s.3e)c();I i;G 1C(){9(s.1C)s.1C(M,1v);9(s.1Z)E.1j.1F("5I",[i,s])}G 1l(){9(s.1l)s.1l(i,1v);9(s.1Z)E.1j.1F("6t",[i,s]);9(s.1Z&&!--E.5b)E.1j.1F("5K")}},5r:G(s,a,b,e){9(s.3U)s.3U(a,b,e);9(s.1Z)E.1j.1F("5J",[a,s,e])},5b:0,6S:G(r){2a{I!r.1v&&9n.9l=="54:"||(r.1v>=6N&&r.1v<9j)||r.1v==6M||E.V.1N&&r.1v==W}29(e){}I P},6R:G(a,c){2a{H b=a.5s("6P-5x");I a.1v==6M||b==E.49[c]||E.V.1N&&a.1v==W}29(e){}I P},6Q:G(r,b){H c=r.5s("9i-O");H d=b=="6K"||!b&&c&&c.1g("6K")>=0;H a=d?r.9g:r.40;9(d&&a.2V.37=="5k")6G"5k";9(b=="1J")E.5f(a);9(b=="45")a=3w("("+a+")");I a},3a:G(a){H s=[];9(a.1c==1B||a.4c)E.N(a,G(){s.1a(3f(6.2H)+"="+3f(6.1Q))});J L(H j 1i a)9(a[j]&&a[j].1c==1B)E.N(a[j],G(){s.1a(3f(j)+"="+3f(6))});J s.1a(3f(j)+"="+3f(a[j]));I s.66("&").1p(/%20/g,"+")}});E.1b.1k({1A:G(b,a){I b?6.1U({1H:"1A",2N:"1A",1r:"1A"},b,a):6.1E(":1P").N(G(){6.R.19=6.3h?6.3h:"";9(E.17(6,"19")=="2s")6.R.19="2Z"}).2D()},1z:G(b,a){I b?6.1U({1H:"1z",2N:"1z",1r:"1z"},b,a):6.1E(":3R").N(G(){6.3h=6.3h||E.17(6,"19");9(6.3h=="2s")6.3h="2Z";6.R.19="2s"}).2D()},6J:E.1b.25,25:G(a,b){I E.1n(a)&&E.1n(b)?6.6J(a,b):a?6.1U({1H:"25",2N:"25",1r:"25"},a,b):6.N(G(){E(6)[E(6).3t(":1P")?"1A":"1z"]()})},9c:G(b,a){I 6.1U({1H:"1A"},b,a)},9b:G(b,a){I 6.1U({1H:"1z"},b,a)},99:G(b,a){I 6.1U({1H:"25"},b,a)},98:G(b,a){I 6.1U({1r:"1A"},b,a)},96:G(b,a){I 6.1U({1r:"1z"},b,a)},95:G(c,a,b){I 6.1U({1r:a},c,b)},1U:G(k,i,h,g){H j=E.6D(i,h,g);I 6[j.3L===P?"N":"3L"](G(){j=E.1k({},j);H f=E(6).3t(":1P"),3y=6;L(H p 1i k){9(k[p]=="1z"&&f||k[p]=="1A"&&!f)I E.1n(j.1l)&&j.1l.16(6);9(p=="1H"||p=="2N"){j.19=E.17(6,"19");j.2U=6.R.2U}}9(j.2U!=S)6.R.2U="1P";j.3M=E.1k({},k);E.N(k,G(c,a){H e=1u E.2j(3y,j,c);9(/25|1A|1z/.14(a))e[a=="25"?f?"1A":"1z":a](k);J{H b=a.3s().1t(/^([+-]=)?([\\d+-.]+)(.*)$/),1O=e.2b(Q)||0;9(b){H d=3I(b[2]),2i=b[3]||"2T";9(2i!="2T"){3y.R[c]=(d||1)+2i;1O=((d||1)/e.2b(Q))*1O;3y.R[c]=1O+2i}9(b[1])d=((b[1]=="-="?-1:1)*d)+1O;e.3N(1O,d,2i)}J e.3N(1O,a,"")}});I Q})},3L:G(a,b){9(E.1n(a)){b=a;a="2j"}9(!a||(1m a=="1M"&&!b))I A(6[0],a);I 6.N(G(){9(b.1c==1B)A(6,a,b);J{A(6,a).1a(b);9(A(6,a).K==1)b.16(6)}})},9f:G(){H a=E.32;I 6.N(G(){L(H i=0;i<a.K;i++)9(a[i].T==6)a.6I(i--,1)}).5n()}});H A=G(b,c,a){9(!b)I;H q=E.M(b,c+"3L");9(!q||a)q=E.M(b,c+"3L",a?E.2h(a):[]);I q};E.1b.5n=G(a){a=a||"2j";I 6.N(G(){H q=A(6,a);q.44();9(q.K)q[0].16(6)})};E.1k({6D:G(b,a,c){H d=b&&b.1c==8Z?b:{1l:c||!c&&a||E.1n(b)&&b,2e:b,3J:c&&a||a&&a.1c!=8Y&&a};d.2e=(d.2e&&d.2e.1c==4W?d.2e:{8X:8W,8V:6N}[d.2e])||8T;d.3r=d.1l;d.1l=G(){E(6).5n();9(E.1n(d.3r))d.3r.16(6)};I d},3J:{6B:G(p,n,b,a){I b+a*p},5q:G(p,n,b,a){I((-38.9s(p*38.8R)/2)+0.5)*a+b}},32:[],2j:G(b,c,a){6.Y=c;6.T=b;6.1e=a;9(!c.3P)c.3P={}}});E.2j.3A={4r:G(){9(6.Y.2F)6.Y.2F.16(6.T,[6.2v,6]);(E.2j.2F[6.1e]||E.2j.2F.6z)(6);9(6.1e=="1H"||6.1e=="2N")6.T.R.19="2Z"},2b:G(a){9(6.T[6.1e]!=S&&6.T.R[6.1e]==S)I 6.T[6.1e];H r=3I(E.3C(6.T,6.1e,a));I r&&r>-8O?r:3I(E.17(6.T,6.1e))||0},3N:G(c,b,e){6.5u=(1u 3D()).3B();6.1O=c;6.2D=b;6.2i=e||6.2i||"2T";6.2v=6.1O;6.4q=6.4i=0;6.4r();H f=6;G t(){I f.2F()}t.T=6.T;E.32.1a(t);9(E.32.K==1){H d=4j(G(){H a=E.32;L(H i=0;i<a.K;i++)9(!a[i]())a.6I(i--,1);9(!a.K)4A(d)},13)}},1A:G(){6.Y.3P[6.1e]=E.1x(6.T.R,6.1e);6.Y.1A=Q;6.3N(0,6.2b());9(6.1e=="2N"||6.1e=="1H")6.T.R[6.1e]="8N";E(6.T).1A()},1z:G(){6.Y.3P[6.1e]=E.1x(6.T.R,6.1e);6.Y.1z=Q;6.3N(6.2b(),0)},2F:G(){H t=(1u 3D()).3B();9(t>6.Y.2e+6.5u){6.2v=6.2D;6.4q=6.4i=1;6.4r();6.Y.3M[6.1e]=Q;H a=Q;L(H i 1i 6.Y.3M)9(6.Y.3M[i]!==Q)a=P;9(a){9(6.Y.19!=S){6.T.R.2U=6.Y.2U;6.T.R.19=6.Y.19;9(E.17(6.T,"19")=="2s")6.T.R.19="2Z"}9(6.Y.1z)6.T.R.19="2s";9(6.Y.1z||6.Y.1A)L(H p 1i 6.Y.3M)E.1x(6.T.R,p,6.Y.3P[p])}9(a&&E.1n(6.Y.1l))6.Y.1l.16(6.T);I P}J{H n=t-6.5u;6.4i=n/6.Y.2e;6.4q=E.3J[6.Y.3J||(E.3J.5q?"5q":"6B")](6.4i,n,0,1,6.Y.2e);6.2v=6.1O+((6.2D-6.1O)*6.4q);6.4r()}I Q}};E.2j.2F={2R:G(a){a.T.2R=a.2v},2B:G(a){a.T.2B=a.2v},1r:G(a){E.1x(a.T.R,"1r",a.2v)},6z:G(a){a.T.R[a.1e]=a.2v+a.2i}};E.1b.6m=G(){H c=0,3E=0,T=6[0],5t;9(T)8L(E.V){H b=E.17(T,"2X")=="4F",1D=T.12,23=T.23,2K=T.3H,4f=1N&&3x(4s)<8J;9(T.6V){5w=T.6V();1f(5w.1S+38.33(2K.2V.2R,2K.1G.2R),5w.3E+38.33(2K.2V.2B,2K.1G.2B));9(1h){H d=E("4o").17("8H");d=(d=="8G"||E.5g&&3x(4s)>=7)&&2||d;1f(-d,-d)}}J{1f(T.5l,T.5z);1W(23){1f(23.5l,23.5z);9(35&&/^t[d|h]$/i.14(1D.37)||!4f)d(23);9(4f&&!b&&E.17(23,"2X")=="4F")b=Q;23=23.23}1W(1D.37&&!/^1G|4o$/i.14(1D.37)){9(!/^8D|1I-9S.*$/i.14(E.17(1D,"19")))1f(-1D.2R,-1D.2B);9(35&&E.17(1D,"2U")!="3R")d(1D);1D=1D.12}9(4f&&b)1f(-2K.1G.5l,-2K.1G.5z)}5t={3E:3E,1S:c}}I 5t;G d(a){1f(E.17(a,"9T"),E.17(a,"8A"))}G 1f(l,t){c+=3x(l)||0;3E+=3x(t)||0}}})();', 62, 616, '||||||this|||if|||||||||||||||||||||||||||||||||function|var|return|else|length|for|data|each|type|false|true|style|null|elem|document|browser|undefined||options|||nodeName|parentNode||test|jQuery|apply|css|window|display|push|fn|constructor|url|prop|add|indexOf|msie|in|event|extend|complete|typeof|isFunction|className|replace|arguments|opacity|div|match|new|status|firstChild|attr|nodeType|hide|show|Array|success|parent|filter|trigger|body|height|table|script|tbody|cache|string|safari|start|hidden|value|merge|left|break|animate|dataType|while|map|find|global||get|id|offsetParent|select|toggle|selected|toUpperCase|remove|catch|try|cur|al|ready|duration|done|text|makeArray|unit|fx|swap|split|target||pushStack|toLowerCase|nextSibling|button|none|handle|guid|now|stack|tb|jsre|timeout|inArray|scrollTop|readyState|end|delete|step|one|name|nth|slice|doc|ret|preventDefault|width|call|events|checked|scrollLeft|exec|px|overflow|documentElement|grep|position|form|block|removeData|rl|timers|max|opera|mozilla|trim|tagName|Math|load|param|removeChild|disabled|insertBefore|async|encodeURIComponent|append|oldblock|val|childNodes|src|readyList|multiFilter|color|defaultView|stopPropagation|args|old|toString|is|last|first|eval|parseInt|self|domManip|prototype|getTime|curCSS|Date|top||ajax|ownerDocument|parseFloat|easing|has|queue|curAnim|custom|innerHTML|orig|currentStyle|visible|getElementById|isReady|error|static|bind|String|which|getComputedStyle|responseText|oWidth|oHeight|on|shift|json|child|RegExp|ol|lastModified|isXMLDoc|jsonp|jquery|previousSibling|dir|safari2|el|styleFloat|state|setInterval|radio|getElementsByTagName|tr|empty|html|getAttribute|pos|update|version|input|float|runtimeStyle|unshift|mouseover|getPropertyValue|GET|clearInterval|safariTimer|visibility|clean|__ie_init|absolute|handleHover|lastToggle|index|fromElement|relatedTarget|click|fix|evt|andSelf|removeEventListener|handler|cloneNode|addEventListener|triggered|nodeIndex|unique|Number|classFilter|prevObject|selectedIndex|after|submit|password|removeAttribute|file|expr|setTimeout|_|appendChild|ajaxSettings|client|active|win|sibling|deep|globalEval|boxModel|cssFloat|object|checkbox|parsererror|offsetLeft|wrapAll|dequeue|props|lastChild|swing|handleError|getResponseHeader|results|startTime|00|box|Modified|ifModified|offsetTop|evalScript|createElement|setRequestHeader|ctrlKey|callback|metaKey|contentType|ajaxSend|ajaxSuccess|ajaxError|ajaxStop|ajaxStart|serializeArray|init|notmodified|POST|loaded|appendTo|DOMContentLoaded|bindReady|mouseout|not|removeAttr|unbind|unload|Width|keyCode|charCode|onreadystatechange|clientX|pageX|srcElement|join|outerHTML|substr|zoom|parse|textarea|reset|image|odd|even|before|quickClass|quickID|prepend|quickChild|execScript|offset|scroll|processData|uuid|contents|continue|textContent|ajaxComplete|clone|setArray|webkit|nodeValue|fl|_default|100|linear|href|speed|eq|createTextNode|throw|replaceWith|splice|_toggle|xml|colgroup|304|200|alpha|Last|httpData|httpNotModified|httpSuccess|fieldset|beforeSend|getBoundingClientRect|XMLHttpRequest|ActiveXObject|col|br|abbr|pixelLeft|urlencoded|www|application|ajaxSetup|post|getJSON|getScript|elements|serialize|clientWidth|hasClass|scr|clientHeight|write|relative|keyup|keypress|keydown|change|mousemove|mouseup|mousedown|right|dblclick|resize|focus|blur|frames|instanceof|hover|offsetWidth|triggerHandler|ipt|defer|offsetHeight|border|padding|clientY|pageY|Left|Right|toElement|Bottom|Top|cancelBubble|returnValue|detachEvent|attachEvent|substring|line|weight|animated|header|font|enabled|innerText|contains|only|size|gt|lt|uFFFF|u0128|417|inner|Height|toggleClass|removeClass|addClass|replaceAll|noConflict|insertAfter|prependTo|wrap|contentWindow|contentDocument|http|iframe|children|siblings|prevAll|nextAll|wrapInner|prev|Boolean|next|parents|maxLength|maxlength|readOnly|readonly|class|htmlFor|CSS1Compat|compatMode|compatible|borderTopWidth|ie|ra|inline|it|rv|medium|borderWidth|userAgent|522|navigator|with|concat|1px|10000|array|ig|PI|NaN|400|reverse|fast|600|slow|Function|Object|setAttribute|changed|be|can|property|fadeTo|fadeOut|getAttributeNode|fadeIn|slideToggle|method|slideUp|slideDown|action|cssText|stop|responseXML|option|content|300|th|protocol|td|location|send|cap|abort|colg|cos|tfoot|thead|With|leg|Requested|opt|GMT|1970|Jan|01|Thu|area|Since|hr|If|Type|Content|meta|specified|open|link|XMLHTTP|Microsoft|img|onload|row|borderLeftWidth|head|attributes'.split('|'), 0, {}))
|
js/magebuzz/manufacturer/jquery.scrollShow.js
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jQuery.ScrollShow - Scrolling Slideshow.
|
3 |
+
* Copyright (c) 2007 Ariel Flesler - aflesler(at)gmail(dot)com
|
4 |
+
* Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php).
|
5 |
+
* Date: 10/30/2007
|
6 |
+
* @author Ariel Flesler
|
7 |
+
* @version 0.7
|
8 |
+
*
|
9 |
+
* @id jQuery.fn.scrollShow
|
10 |
+
* @param {Object} settings Hash of settings (detailed below).
|
11 |
+
* @return {jQuery} Returns the same jQuery object, for chaining.
|
12 |
+
**/
|
13 |
+
(function ($) {
|
14 |
+
|
15 |
+
var defaults = {
|
16 |
+
elements: 'div.item',//elements selector (relative to view)
|
17 |
+
itemSize: {
|
18 |
+
height: 150,
|
19 |
+
width: 150
|
20 |
+
},
|
21 |
+
view: null,//container of the elements, the one to fix the width.
|
22 |
+
navigators: null,//selector to the elements to navigate the slideshow.
|
23 |
+
navigationMode: 'r',//sequential, random, localscroll
|
24 |
+
speed: 600,//speed of transition, 1 for no-animation
|
25 |
+
wrappers: 'simple',//simple,resize,crop,link
|
26 |
+
circular: false,//should the slideshow rewind/advance on the extremes ?.
|
27 |
+
easing: 'linear',//easing equation
|
28 |
+
axis: 'x',//axis to displace the slideshow
|
29 |
+
margin: true,//take margin in account?
|
30 |
+
start: null, //force the scroll to start at some position element.
|
31 |
+
setWidth: false//whether to calculate and set, the overall width of the slideshow.
|
32 |
+
};
|
33 |
+
|
34 |
+
function wrap($els, type, size) {//wrap the photos with several different wrappers.
|
35 |
+
switch (type) {
|
36 |
+
case 'crop':
|
37 |
+
$els = $els.wrap('<div class="jq-ss-crop">').parent().css('overflow', 'hidden');
|
38 |
+
case 'resize':
|
39 |
+
return $els.css(size);
|
40 |
+
case 'simple':
|
41 |
+
return $els.wrap('<div class="jq-ss-simple">').parent();
|
42 |
+
case 'link':
|
43 |
+
/* if( $els.is('img') )
|
44 |
+
return $els.wrap('<a target="_blank" class="jq-ss-link">').parent().each(function(){
|
45 |
+
this.href = this.firstChild.src;
|
46 |
+
}); */
|
47 |
+
default:
|
48 |
+
return $els;
|
49 |
+
}
|
50 |
+
};
|
51 |
+
|
52 |
+
$.fn.scrollShow = function (settings) {
|
53 |
+
settings = $.extend({}, defaults, settings);
|
54 |
+
|
55 |
+
return this.each(function () {
|
56 |
+
var
|
57 |
+
widget = this,
|
58 |
+
$view = settings.view ? $(settings.view, this) : this,
|
59 |
+
$elements = $(settings.elements, $view),
|
60 |
+
limit = $elements.length,
|
61 |
+
active = 0;
|
62 |
+
|
63 |
+
$.each(settings.wrappers.split(/\s*,\s*/), function (i, wrapper) {
|
64 |
+
$elements = wrap($elements, wrapper, settings.itemSize);
|
65 |
+
});
|
66 |
+
$elements.css(settings.itemSize);//ensure the outer elements have fixed size.
|
67 |
+
|
68 |
+
if (!settings.navigators) {//this shouldn't get to happen
|
69 |
+
settings.navigators = '';
|
70 |
+
settings.navigationMode = 'r';
|
71 |
+
}
|
72 |
+
|
73 |
+
if (settings.navigators.constructor != Array)
|
74 |
+
settings.navigators = [settings.navigators];
|
75 |
+
|
76 |
+
$.each(settings.navigationMode.split(''), function (i, type) {
|
77 |
+
switch (type.charAt(0)) {
|
78 |
+
case 's'://sequential navigation
|
79 |
+
$(settings.navigators[i], widget)
|
80 |
+
.eq(0).bind('click', { dir: -1 }, sequential).end()
|
81 |
+
.eq(1).bind('click', { dir: +1 }, sequential);
|
82 |
+
break;
|
83 |
+
case 'r'://random navigation
|
84 |
+
var $nav = $(settings.navigators[i] || $elements, widget),
|
85 |
+
ratio = $elements.length / $nav.length;
|
86 |
+
if (ratio === Infinity) return;//no navigator found
|
87 |
+
$nav.each(function (pos) {
|
88 |
+
$(this).bind('click', { pos: Math.floor(ratio * pos) }, random);
|
89 |
+
});
|
90 |
+
break;
|
91 |
+
}
|
92 |
+
});
|
93 |
+
|
94 |
+
(function ($e, w) {
|
95 |
+
var imgw = ($e.width() + attrs('margin') + attrs('padding') + attr('border'));
|
96 |
+
|
97 |
+
do w -= imgw;
|
98 |
+
while (w > 0 && limit--);//find the last element we can scroll To.
|
99 |
+
|
100 |
+
if (!settings.setWidth) return;
|
101 |
+
|
102 |
+
do {
|
103 |
+
$e = $e.parent();
|
104 |
+
if ($e[0] == $view[0])
|
105 |
+
return;
|
106 |
+
} while ($e.length > 1);
|
107 |
+
$e.width(imgw * $elements.length);//if there's a container for the elements, calculate it's width.
|
108 |
+
|
109 |
+
})($elements, $view.width());
|
110 |
+
|
111 |
+
if (settings.start != null)
|
112 |
+
random(settings.start);
|
113 |
+
|
114 |
+
function attrs(name) {
|
115 |
+
return attr(name + 'Left') + attr(name + 'Right');
|
116 |
+
};
|
117 |
+
function attr(name) {
|
118 |
+
return parseInt($elements.css(name)) || 0;
|
119 |
+
};
|
120 |
+
|
121 |
+
function sequential(event) {
|
122 |
+
event.data.pos = active + event.data.dir;
|
123 |
+
return random(event);
|
124 |
+
};
|
125 |
+
|
126 |
+
function random(event) {
|
127 |
+
var pos = typeof event == 'number' ? event : event.data.pos;
|
128 |
+
if (pos < 0)
|
129 |
+
pos = active == 0 && settings.circular ? limit : 0;
|
130 |
+
else if (pos > limit)
|
131 |
+
pos = active == limit && settings.circular ? 0 : limit;
|
132 |
+
|
133 |
+
$view.stop().scrollTo($elements[pos], settings);
|
134 |
+
active = pos;
|
135 |
+
return false;
|
136 |
+
};
|
137 |
+
});
|
138 |
+
};
|
139 |
+
|
140 |
+
})(jQuery);
|
js/magebuzz/manufacturer/jquery.scrollTo-min.js
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jQuery.ScrollTo - Easy element scrolling using jQuery.
|
3 |
+
* Copyright (c) 2007 Ariel Flesler - aflesler(at)gmail(dot)com
|
4 |
+
* Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php).
|
5 |
+
* Date: 10/29/2007
|
6 |
+
* @author Ariel Flesler
|
7 |
+
* @version 1.2.2
|
8 |
+
* Compatible with jQuery 1.2.1, tested on Firefox 2.0.0.7, and IE 6, both on Windows.
|
9 |
+
**/
|
10 |
+
(function ($) {
|
11 |
+
$.scrollTo = function (a, b) {
|
12 |
+
return $('html,body').scrollTo(a, b)
|
13 |
+
};
|
14 |
+
$.fn.scrollTo = function (e, f) {
|
15 |
+
f = $.extend({axis: 'y', speed: 1}, f || {});
|
16 |
+
if (f.axis.length != 2)f.queue = false;
|
17 |
+
if (f.queue)f.speed = Math.ceil(f.speed / 2);
|
18 |
+
return this.each(function () {
|
19 |
+
var d = $(this), t = e, k, l, u = {};
|
20 |
+
switch (typeof t) {
|
21 |
+
case'string':
|
22 |
+
if (/^([+-]=)?\d+(px)?$/.test(t))break;
|
23 |
+
t = $(t, this);
|
24 |
+
case'object':
|
25 |
+
k = $(t).offset()
|
26 |
+
}
|
27 |
+
$.each(f.axis.split(''), parse);
|
28 |
+
animate(f.onAfter);
|
29 |
+
function parse(i, a) {
|
30 |
+
var b = a == 'x' ? 'Left' : 'Top', p = b.toLowerCase();
|
31 |
+
var c = 'scroll' + b;
|
32 |
+
u[c] = k ? k[p] + (d.is('html,body') ? 0 : d[0][c] - d.offset()[p]) : t;
|
33 |
+
if (f.margin && typeof t == 'object')u[c] -= parseInt($(t).css('margin' + b)) || 0;
|
34 |
+
if (!i && f.queue) {
|
35 |
+
if (d[0][c] != u[c])animate(f.onAfterFirst);
|
36 |
+
delete u[c]
|
37 |
+
}
|
38 |
+
};
|
39 |
+
function animate(a) {
|
40 |
+
d.animate(u, f.speed, f.easing, a)
|
41 |
+
}
|
42 |
+
})
|
43 |
+
}
|
44 |
+
})(jQuery);
|
js/magebuzz/manufacturer/manufacturer_slider.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var $manufacturerSlider = jQuery.noConflict();
|
2 |
+
$manufacturerSlider(document).ready(function () {
|
3 |
+
$manufacturerSlider.easing.backout = function (x, t, b, c, d) {
|
4 |
+
var s = 1.70158;
|
5 |
+
return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
|
6 |
+
};
|
7 |
+
|
8 |
+
$manufacturerSlider('#featured-manu-screen').scrollShow({
|
9 |
+
elements: 'div.item',
|
10 |
+
view: '#featured-manu-view',
|
11 |
+
content: '#featured-manu-images',
|
12 |
+
easing: 'backout',
|
13 |
+
wrappers: 'link,crop',
|
14 |
+
navigators: 'a[id]',
|
15 |
+
navigationMode: 's',
|
16 |
+
circular: true,
|
17 |
+
start: 0
|
18 |
+
});
|
19 |
+
|
20 |
+
});
|
js/magebuzz/manufacturer_slider.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var $manufacturerSlider = jQuery.noConflict();
|
2 |
+
$manufacturerSlider(document).ready(function(){
|
3 |
+
$manufacturerSlider.easing.backout = function(x, t, b, c, d){
|
4 |
+
var s=1.70158;
|
5 |
+
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
6 |
+
};
|
7 |
+
|
8 |
+
$manufacturerSlider('#featured-manu-screen').scrollShow({
|
9 |
+
elements:'div.item',
|
10 |
+
view:'#featured-manu-view',
|
11 |
+
content:'#featured-manu-images',
|
12 |
+
easing:'backout',
|
13 |
+
wrappers:'link,crop',
|
14 |
+
navigators:'a[id]',
|
15 |
+
navigationMode:'s',
|
16 |
+
circular:true,
|
17 |
+
start:0
|
18 |
+
});
|
19 |
+
|
20 |
+
});
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>magebuzz-shop-by-manufacturer</name>
|
4 |
+
<version>0.1.5</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Shop by Manufacturer / Shop by brand</summary>
|
10 |
+
<description>A simple addition to your Magento store's search engine, our Shop By Manufacturer extension allows customers to search products based on brands / manufacturers. </description>
|
11 |
+
<notes>A simple addition to your Magento store's search engine, our Shop By Manufacturer extension allows customers to search products based on brands / manufacturers. </notes>
|
12 |
+
<authors><author><name>Magebuzz</name><user>magebuzz</user><email>magebuzz@gmail.com</email></author></authors>
|
13 |
+
<date>2016-02-05</date>
|
14 |
+
<time>09:06:37</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Magebuzz"><dir name="Manufacturer"><dir name="Block"><dir name="Adminhtml"><dir name="Manufacturer"><dir name="Edit"><file name="Form.php" hash="8df9318435bb5d79bf6d570022fd1593"/><dir name="Tab"><file name="Form.php" hash="fabe39f58daa37f1aedfc97dd9b71f05"/><file name="Meta.php" hash="713b112d90ed70d3d82ffb70b278120b"/><file name="Products.php" hash="961cc390a805e4e8f9984dcee6048872"/></dir><file name="Tabs.php" hash="20b2a9784edf644f318db1730482f5f6"/></dir><file name="Edit.php" hash="54a8fcf186afcb22620d6eb39df084b0"/><file name="Grid.php" hash="8dbbecd689037ce9eb1c28fbeae1eb54"/><file name="Serializer.php" hash="0398729adeaa1349497eb611488d5da4"/></dir><file name="Manufacturer.php" hash="31654c9fb0125f6f0a182540c352c848"/></dir><file name="Left.php" hash="d85bb3687832d0c2ddd0ecf74a55c83e"/><file name="Manufacturer.php" hash="7d093a43abcef6991f72984482a32a82"/><dir name="Product"><file name="Manufacturer.php" hash="982129c51714e159d70c4e7967d04b17"/></dir><file name="Product.php" hash="dbaf62695b0862bffddfd7a9607e0386"/><file name="Sidebar.php" hash="ae989281c852caff841e15cde63c5fbf"/><file name="View.php" hash="5d78477d673cc0c6e5af196b2782ee77"/></dir><dir name="Controller"><file name="Router.php" hash="cf67e56687cca0fe7d2394948f32419c"/></dir><dir name="Helper"><file name="Data.php" hash="7aec6bfd5302466dfdb88bbc791b8154"/></dir><dir name="Model"><file name="Manufacturer.php" hash="16fa37e4c5500a708993c885985aaaad"/><dir name="Mysql4"><dir name="Manufacturer"><file name="Collection.php" hash="19bca40de439b0bf69df532edc2b7635"/></dir><file name="Manufacturer.php" hash="a8e0e7736f131f28e3bb598b99297b67"/></dir><file name="Noterouter.php" hash="379e1d04f0884eda6e1d985e2a8cc732"/><file name="Status.php" hash="bf290aa60005a7ca37540d5128970051"/><file name="Validatemanufacturer.php" hash="317d7b5b6a21b022e91cd13e6622c6da"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ManufacturerController.php" hash="256fb96a7a7f97fa3eeb237b5094e389"/></dir><file name="IndexController.php" hash="9abe33b0ca9657702381fb353beb837b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="085bfd988f6682fedd232387e708d306"/><file name="config.xml" hash="d0882bda375a92f1c65a9b024758aaeb"/><file name="system.xml" hash="f4b0c3bfeb67c33c225132e75febbb6c"/></dir><dir name="sql"><dir name="manufacturer_setup"><file name="mysql4-install-0.1.0.php" hash="59428dade3b63bd08441d89f7ba8e29b"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="373d7469cf7264a7eaeb419d0d435ec5"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="e4115812c47420625b5c4e0f032844bc"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="manufacturer.xml" hash="44edc120ce8939ae0e6a3a30b4caede3"/></dir><dir name="template"><dir name="manufacturer"><file name="manufacturer.phtml" hash="a1a05bea4060f734412eab0bc90f950e"/><dir name="product"><file name="manufacturer.phtml" hash="f521da9d3e53e0d9bae0e668ae8487e1"/></dir><file name="sidebar.phtml" hash="a0c845510c7663980883376dcd08ab0a"/><file name="view.phtml" hash="4b3860b3e09d08941da032f08f08bbfc"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="manufacturer.xml" hash="e439568d3d33d2119c43a34c90c1c79e"/></dir><dir name="template"><dir name="manufacturer"><file name="notifications.phtml" hash="01573d47a21ac62f12fadd81beeac992"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Magebuzz_Manufacturer.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target><target name="mageweb"><dir name="js"><dir name="magebuzz"><dir name="manufacturer"><file name="jquery.js" hash="bbc26c7be79f7cf39fe6574fcab34726"/><file name="jquery.scrollShow.js" hash="3b28ab65ed9b23a7b7a7b21ad0e9b12b"/><file name="jquery.scrollTo-min.js" hash="9f0cc6ba410990a34e546dea3c1c5699"/><file name="manufacturer_slider.js" hash="40417622a1e7e2713db3ac2e91987d51"/></dir><file name="jquery.js" hash="71f98446fb78e67fffe9dcc4e992ccc0"/><file name="jquery.scrollShow.js" hash="c3e0a1a09d2ca3f0070ba3f8a30e29f7"/><file name="jquery.scrollTo-min.js" hash="38608df4691e60bf6d74868bc02acdb4"/><file name="manufacturer_slider.js" hash="e3238e743768f24b1863b3cdaaf47196"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="magebuzz"><file name="manufacturer.css" hash="4eb2a0d12a296f08094f737d71c302f1"/><dir name="manufacturer"><file name="btn_next-hover.png" hash="2c650d3c638250f0d4e61bdf7ec96cb3"/><file name="btn_next.png" hash="b70dbdd9c9cdba2df7faa885a97263bc"/><file name="btn_prev-hover.png" hash="2831bef2c42126dfcaf526ce65d55779"/><file name="btn_prev.png" hash="5b2643aa2fe83a5d0d9e881579a3c10e"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magebuzz_Manufacturer.xml" hash="3ff1e305f03a04c57fdc13a36ffea285"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/frontend/base/default/css/magebuzz/manufacturer.css
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.manufacturers {}
|
2 |
+
/* Featured Manufacturer */
|
3 |
+
.featured-manufacturers{overflow: hidden;}
|
4 |
+
.manufacturers h2.title,.featured-manufacturers h2.title{border-bottom: 1px solid #DDDDDD;font-family:Tahoma; color:#565656; padding:0 0 5px; font-weight:normal; font-size:18px; margin:10px 0;}
|
5 |
+
#featured-manu-screen{
|
6 |
+
width:1000px;
|
7 |
+
padding:0;
|
8 |
+
}
|
9 |
+
#featured-manu-screen li{
|
10 |
+
float:left;
|
11 |
+
list-style:none;
|
12 |
+
}
|
13 |
+
#featured-manu-screen .jq-ss-crop{
|
14 |
+
border:1px solid #DDDDDD;
|
15 |
+
float:left;
|
16 |
+
background:#FFFFFF;
|
17 |
+
}
|
18 |
+
#featured-manu-screen #navleft,#featured-manu-screen #navright{
|
19 |
+
font-weight:bolder;
|
20 |
+
margin-top:60px;
|
21 |
+
display:block;
|
22 |
+
text-decoration:none;
|
23 |
+
color:black;
|
24 |
+
}
|
25 |
+
#featured-manu-screen #navleft{background:url(manufacturer/btn_prev.png) top left no-repeat; width:32px; height:32px;}
|
26 |
+
#featured-manu-screen #navright{background:url(manufacturer/btn_next.png) top left no-repeat;width:32px; height:32px;}
|
27 |
+
#featured-manu-screen li:hover #navleft{background:url(manufacturer/btn_prev-hover.png) top left no-repeat;}
|
28 |
+
#featured-manu-screen li:hover #navright{background:url(manufacturer/btn_next-hover.png) top left no-repeat;}
|
29 |
+
#featured-manu-view{
|
30 |
+
width:625px;
|
31 |
+
overflow:hidden;
|
32 |
+
}
|
33 |
+
#featured-manu-images{
|
34 |
+
width:3818px !important;
|
35 |
+
width:3822px;
|
36 |
+
padding:0;
|
37 |
+
}
|
38 |
+
#featured-manu-images li{margin-right:5px;}
|
39 |
+
#featured-manu-images li img{
|
40 |
+
border:0;
|
41 |
+
}
|
42 |
+
/************************/
|
43 |
+
.manufacturers .manufacturer-grid {display:block;}
|
44 |
+
.manufacturer-grid li.item {
|
45 |
+
float:left;
|
46 |
+
width:33%;
|
47 |
+
padding: 5px 0;
|
48 |
+
}
|
49 |
+
|
50 |
+
.manufacturer-grid li.manufacturer-group {
|
51 |
+
float:left;
|
52 |
+
width:33%;
|
53 |
+
padding: 12px 0;
|
54 |
+
}
|
55 |
+
.manufacturer-grid li.item a{text-decoration:none; color:#565656;}
|
56 |
+
.manufacturer-grid li.item a:hover{text-decoration:underline;}
|
57 |
+
.group-manufacturer-grid {
|
58 |
+
display: block;
|
59 |
+
position: relative;
|
60 |
+
content: ".";
|
61 |
+
clear: both;
|
62 |
+
}
|
63 |
+
|
64 |
+
.manufacturer-grid li.item img {float:left;}
|
65 |
+
|
66 |
+
.group-manufacturer-grid li.item {
|
67 |
+
float:left;
|
68 |
+
width:33%;
|
69 |
+
padding: 12px 0;
|
70 |
+
}
|
71 |
+
.group-manufacturer-grid li.item a{text-decoration:none; color:#565656;}
|
72 |
+
.group-manufacturer-grid li.item a:hover{text-decoration:underline;}
|
73 |
+
div.manufacturer-image {width:80px;height:80px;}
|
74 |
+
|
75 |
+
a.manufacturer-name {
|
76 |
+
clear:both;
|
77 |
+
float:left;
|
78 |
+
text-align:center;
|
79 |
+
}
|
80 |
+
/* Sidebar */
|
81 |
+
.block-manufacturer{}
|
82 |
+
.block-manufacturer .block-title{}
|
83 |
+
.block-manufacturer .block-content{padding:9px;}
|
84 |
+
.manufacturer-sidebar{}
|
85 |
+
.manufacturer-sidebar ul li{float:left; width:45%; padding:0 10px 0 0;}
|
86 |
+
.manufacturer-sidebar ul li.right{padding:0;}
|
87 |
+
.manufacturer-sidebar ul li a{text-decoration:none; color:#565656;}
|
88 |
+
.manufacturer-sidebar ul li a:hover{text-decoration:underline;}
|
89 |
+
/*** Manufacturer detail page ***/
|
90 |
+
.manufacturer-description {margin-bottom:20px; width:100%;}
|
91 |
+
.manufacturer-description .manufacturer-des-image {border:1px solid #ddd; width:300px; height:200px; float:left; margin-right:10px}
|
92 |
+
.manufacturer-description img{float:left;}
|
93 |
+
.manufacturer-description .description-info{text-align:justify;}
|
skin/frontend/base/default/css/magebuzz/manufacturer/btn_next-hover.png
ADDED
Binary file
|
skin/frontend/base/default/css/magebuzz/manufacturer/btn_next.png
ADDED
Binary file
|
skin/frontend/base/default/css/magebuzz/manufacturer/btn_prev-hover.png
ADDED
Binary file
|
skin/frontend/base/default/css/magebuzz/manufacturer/btn_prev.png
ADDED
Binary file
|