Version Notes
New Feature: Integrated with our Slider Module which is used by our Magento themes
Improvement: Code refactorization
Download this release
Release Info
Developer | ModulesGarden |
Extension | Modulesgarden_Base |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.1.0
- app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Banners.php +48 -0
- app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Banners/Edit.php +57 -0
- app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Banners/Edit/Form.php +118 -0
- app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Banners/Grid.php +111 -0
- app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Sliders.php +42 -0
- app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Sliders/Edit.php +61 -0
- app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Sliders/Edit/Form.php +98 -0
- app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Sliders/Grid.php +88 -0
- app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Sliders/Tabs.php +56 -0
- app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Installedmodulesgarden.php +1 -1
- app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Installedmodulesgardenthemes.php +1 -1
- app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Installedothers.php +10 -11
- app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Installedratio.php +40 -31
- app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Modulesgarden.php +5 -6
- app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Store.php +1 -2
- app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Twitter.php +19 -8
- app/code/community/Modulesgarden/Base/Controller/Adminhtml/Sliders.php +39 -0
- app/code/community/Modulesgarden/Base/Helper/Data.php +11 -12
- app/code/community/Modulesgarden/Base/Model/Adminnotification/Core.php +167 -0
- app/code/community/Modulesgarden/Base/Model/Adminnotification/Inbox.php +10 -12
- app/code/community/Modulesgarden/Base/Model/Adminnotification/Item.php +40 -0
- app/code/community/Modulesgarden/Base/Model/Banner.php +58 -0
- app/code/community/Modulesgarden/Base/Model/Check/Client.php +100 -0
- app/code/community/Modulesgarden/Base/Model/Extension.php +3 -3
- app/code/community/Modulesgarden/Base/Model/Extension/Client.php +195 -184
- app/code/community/Modulesgarden/Base/Model/Extension/Item.php +44 -0
- app/code/community/Modulesgarden/Base/Model/Extension/Modulesgarden/Item.php +84 -0
- app/code/community/Modulesgarden/Base/Model/Mage.php +123 -161
- app/code/community/Modulesgarden/Base/Model/Observer.php +35 -84
- app/code/community/Modulesgarden/Base/Model/Resource/Banner.php +34 -0
- app/code/community/Modulesgarden/Base/Model/Resource/Banner/Collection.php +45 -0
- app/code/community/Modulesgarden/Base/Model/Resource/Extension.php +54 -2
- app/code/community/Modulesgarden/Base/Model/Resource/Slider.php +34 -0
- app/code/community/Modulesgarden/Base/Model/Resource/Slider/Collection.php +34 -0
- app/code/community/Modulesgarden/Base/Model/Slider.php +54 -0
- app/code/community/Modulesgarden/Base/Model/System/Config/Source/Notificationevents.php +15 -14
- app/code/community/Modulesgarden/Base/controllers/Adminhtml/Plugins/BannersController.php +115 -0
- app/code/community/Modulesgarden/Base/controllers/Adminhtml/Plugins/SlidersController.php +94 -0
- app/code/community/Modulesgarden/Base/etc/adminhtml.xml +60 -22
- app/code/community/Modulesgarden/Base/etc/config.xml +116 -87
- app/code/community/Modulesgarden/Base/etc/system.xml +9 -8
- app/code/community/Modulesgarden/Base/sql/modulesgardenbase_setup/upgrade-1.0.0-1.1.0.php +60 -0
- app/design/adminhtml/default/default/layout/modulesgardenbase.xml +40 -7
- app/design/adminhtml/default/default/template/modulesgardenbase/system/config/form/fieldset/installedmodulesgarden.phtml +16 -18
- app/design/adminhtml/default/default/template/modulesgardenbase/system/config/form/fieldset/installedmodulesgardenthemes.phtml +5 -8
- app/design/adminhtml/default/default/template/modulesgardenbase/system/config/form/fieldset/installedothers.phtml +21 -21
- app/design/adminhtml/default/default/template/modulesgardenbase/system/config/form/fieldset/installedratio.phtml +40 -34
- app/design/adminhtml/default/default/template/modulesgardenbase/system/config/form/fieldset/store.phtml +38 -39
- app/design/adminhtml/default/default/template/modulesgardenbase/system/config/form/fieldset/twitter.phtml +25 -22
- package.xml +7 -6
- shell/modulesgarden/base.php +51 -0
- skin/adminhtml/base/default/modulesgardenbase/img/modulesgarden.png +0 -0
app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Banners.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-05, 10:02:49)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
|
29 |
+
class Modulesgarden_Base_Block_Adminhtml_Plugins_Banners extends Mage_Adminhtml_Block_Widget_Grid_Container {
|
30 |
+
|
31 |
+
public function __construct() {
|
32 |
+
$this->_blockGroup = 'modulesgarden_base';
|
33 |
+
$this->_controller = 'adminhtml_plugins_banners';
|
34 |
+
$this->_headerText = Mage::helper('modulesgarden_base')->__('Banners List');
|
35 |
+
|
36 |
+
parent::__construct();
|
37 |
+
}
|
38 |
+
|
39 |
+
public function getCreateUrl() {
|
40 |
+
$slider_id = Mage::app()->getRequest()->getParam('id');
|
41 |
+
return $this->getUrl('*/plugins_banners/edit', array('slider_id' => $slider_id));
|
42 |
+
}
|
43 |
+
|
44 |
+
protected function _toHtml(){
|
45 |
+
return '<div class="main-col-inner">'.parent::_toHtml().'</div>';
|
46 |
+
}
|
47 |
+
|
48 |
+
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Banners/Edit.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-05, 11:00:02)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Block_Adminhtml_Plugins_Banners_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
|
29 |
+
|
30 |
+
public function __construct() {
|
31 |
+
parent::__construct();
|
32 |
+
$header = Mage::getSingleton('modulesgarden_base/banner')->isEmpty() ? 'New Banner Details' : 'Edit Banner Details';
|
33 |
+
|
34 |
+
$this->_blockGroup = 'modulesgarden_base';
|
35 |
+
$this->_controller = 'adminhtml_plugins_banners';
|
36 |
+
$this->_headerText = Mage::helper('modulesgarden_base')->__($header);
|
37 |
+
$this->_mode = 'edit';
|
38 |
+
|
39 |
+
$this->_addButton('saveandcontinue', array(
|
40 |
+
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
41 |
+
'onclick' => 'saveAndContinueEdit()',
|
42 |
+
'class' => 'save',
|
43 |
+
), -100);
|
44 |
+
|
45 |
+
$this->_formScripts[] = " function saveAndContinueEdit(){
|
46 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
47 |
+
}";
|
48 |
+
|
49 |
+
$this->_removeButton('reset');
|
50 |
+
}
|
51 |
+
|
52 |
+
public function getBackUrl() {
|
53 |
+
$slider_id = Mage::app()->getRequest()->getParam('slider_id');
|
54 |
+
return $this->getUrl('*/plugins_sliders/edit', array('id' => $slider_id));
|
55 |
+
}
|
56 |
+
|
57 |
+
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Banners/Edit/Form.php
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-05, 11:00:14)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Block_Adminhtml_Plugins_Banners_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {
|
29 |
+
|
30 |
+
protected function _prepareForm() {
|
31 |
+
$form = new Varien_Data_Form();
|
32 |
+
$form->setUseContainer(true);
|
33 |
+
$form->setId('edit_form');
|
34 |
+
$form->setEnctype('multipart/form-data');
|
35 |
+
$form->setAction($this->getUrl('*/*/save'));
|
36 |
+
$form->setMethod('post');
|
37 |
+
|
38 |
+
$sliderGetId = Mage::app()->getRequest()->getParam('slider_id');
|
39 |
+
$h = Mage::helper('modulesgarden_base');
|
40 |
+
|
41 |
+
$banner = Mage::getSingleton('modulesgarden_base/banner');
|
42 |
+
$isEditMode = !$banner->isEmpty();
|
43 |
+
|
44 |
+
$fieldset = $form->addFieldset('modulesgarden_base_banner_form', array(
|
45 |
+
'legend' => $h->__('Banner')
|
46 |
+
));
|
47 |
+
|
48 |
+
$fieldset->addField('enabled', 'select', array(
|
49 |
+
'name' => 'enabled',
|
50 |
+
'label' => $h->__('Enabled'),
|
51 |
+
'class' => 'required-entry',
|
52 |
+
'required' => true,
|
53 |
+
'options' => array(
|
54 |
+
0 => 'No',
|
55 |
+
1 => 'Yes',
|
56 |
+
)
|
57 |
+
));
|
58 |
+
|
59 |
+
$fieldset->addField('title', 'text', array(
|
60 |
+
'name' => 'title',
|
61 |
+
'label' => $h->__('Title'),
|
62 |
+
'class' => 'required-entry',
|
63 |
+
'required' => true,
|
64 |
+
));
|
65 |
+
$fieldset->addField('description', 'textarea', array(
|
66 |
+
'name' => 'description',
|
67 |
+
'label' => $h->__('Description'),
|
68 |
+
));
|
69 |
+
$fieldset->addField('url_title', 'text', array(
|
70 |
+
'name' => 'url_title',
|
71 |
+
'label' => $h->__('Url Title'),
|
72 |
+
));
|
73 |
+
$fieldset->addField('url', 'text', array(
|
74 |
+
'name' => 'url',
|
75 |
+
'label' => $h->__('Url'),
|
76 |
+
'class' => 'validate-url'
|
77 |
+
));
|
78 |
+
|
79 |
+
$fieldset->addField('filename', 'file', array(
|
80 |
+
'label' => $h->__('Image'),
|
81 |
+
'name' => 'filename',
|
82 |
+
));
|
83 |
+
|
84 |
+
if ($isEditMode && $banner->getFilename()) {
|
85 |
+
$fieldset->addField('filename_img', 'note', array(
|
86 |
+
'label' => $h->__('Image Preview'),
|
87 |
+
'text' => '<img src="' . $banner->getFileUrl() . '" />',
|
88 |
+
));
|
89 |
+
}
|
90 |
+
|
91 |
+
$fieldset->addField('sort_order', 'text', array(
|
92 |
+
'name' => 'sort_order',
|
93 |
+
'label' => $h->__('Sort Order'),
|
94 |
+
'class' => 'validate-not-negative-number',
|
95 |
+
'value' => '0',
|
96 |
+
));
|
97 |
+
|
98 |
+
$fieldset->addField('slider_id', 'hidden', array(
|
99 |
+
'name' => 'slider_id',
|
100 |
+
'required' => true,
|
101 |
+
'value' => $sliderGetId,
|
102 |
+
));
|
103 |
+
|
104 |
+
|
105 |
+
if (!$banner->isEmpty()) {
|
106 |
+
$fieldset->addField('banner_id', 'hidden', array(
|
107 |
+
'name' => 'banner_id',
|
108 |
+
'value' => $banner->getBannerId()
|
109 |
+
));
|
110 |
+
|
111 |
+
$form->setValues($banner->getData());
|
112 |
+
}
|
113 |
+
|
114 |
+
$this->setForm($form);
|
115 |
+
return parent::_prepareForm();
|
116 |
+
}
|
117 |
+
|
118 |
+
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Banners/Grid.php
ADDED
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-05, 10:04:32)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Block_Adminhtml_Plugins_Banners_Grid extends Mage_Adminhtml_Block_Widget_Grid {
|
29 |
+
|
30 |
+
protected $sliderId;
|
31 |
+
|
32 |
+
public function __construct() {
|
33 |
+
parent::__construct();
|
34 |
+
|
35 |
+
$this->setId('modulesgarden_base_BannersGrid');
|
36 |
+
$this->setDefaultSort('title');
|
37 |
+
$this->setDefaultDir('ASC');
|
38 |
+
$this->setSaveParametersInSession(false);
|
39 |
+
}
|
40 |
+
|
41 |
+
protected function _prepareCollection() {
|
42 |
+
$collection = Mage::getResourceModel('modulesgarden_base/banner_collection');
|
43 |
+
|
44 |
+
$this->sliderId = Mage::app()->getRequest()->getParam('id');
|
45 |
+
|
46 |
+
if ($this->sliderId) {
|
47 |
+
$collection->addFieldToFilter('main_table.slider_id', $this->sliderId);
|
48 |
+
}
|
49 |
+
|
50 |
+
$this->setCollection($collection);
|
51 |
+
return parent::_prepareCollection();
|
52 |
+
}
|
53 |
+
|
54 |
+
protected function _prepareColumns() {
|
55 |
+
$h = Mage::helper('modulesgarden_base');
|
56 |
+
|
57 |
+
$this->addColumn('banner_id', array(
|
58 |
+
'header' => $h->__('ID'),
|
59 |
+
'align' => 'right',
|
60 |
+
'width' => '50px',
|
61 |
+
'index' => 'banner_id',
|
62 |
+
));
|
63 |
+
|
64 |
+
$this->addColumn('title', array(
|
65 |
+
'header' => $h->__('Title'),
|
66 |
+
'align' => 'left',
|
67 |
+
'index' => 'title',
|
68 |
+
));
|
69 |
+
|
70 |
+
$this->addColumn('url_title', array(
|
71 |
+
'header' => $h->__('Url Title'),
|
72 |
+
'align' => 'left',
|
73 |
+
'index' => 'url_title',
|
74 |
+
));
|
75 |
+
|
76 |
+
$this->addColumn('url', array(
|
77 |
+
'header' => $h->__('Url'),
|
78 |
+
'align' => 'left',
|
79 |
+
'index' => 'url',
|
80 |
+
));
|
81 |
+
|
82 |
+
$this->addColumn('sort_order', array(
|
83 |
+
'header' => $h->__('Sort Order'),
|
84 |
+
'align' => 'left',
|
85 |
+
'index' => 'sort_order',
|
86 |
+
));
|
87 |
+
|
88 |
+
$this->addColumn('enabled', array(
|
89 |
+
'header' => $h->__('Enabled'),
|
90 |
+
'align' => 'left',
|
91 |
+
'index' => 'enabled',
|
92 |
+
'width' => '120px',
|
93 |
+
'type' => 'options',
|
94 |
+
'sortable' => false,
|
95 |
+
'options' => array(
|
96 |
+
0 => $h->__('No'),
|
97 |
+
1 => $h->__('Yes'),
|
98 |
+
)
|
99 |
+
));
|
100 |
+
|
101 |
+
return parent::_prepareColumns();
|
102 |
+
}
|
103 |
+
|
104 |
+
public function getRowUrl($row) {
|
105 |
+
return $this->getUrl('*/plugins_banners/edit', array(
|
106 |
+
'id' => $row->getBannerId(),
|
107 |
+
'slider_id' => $this->sliderId,
|
108 |
+
));
|
109 |
+
}
|
110 |
+
|
111 |
+
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Sliders.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-04, 14:44:48)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Block_Adminhtml_Plugins_Sliders extends Mage_Adminhtml_Block_Widget_Grid_Container {
|
29 |
+
|
30 |
+
public function __construct() {
|
31 |
+
$this->_blockGroup = 'modulesgarden_base';
|
32 |
+
$this->_controller = 'adminhtml_plugins_sliders';
|
33 |
+
$this->_headerText = Mage::helper('modulesgarden_base')->__('Sliders List');
|
34 |
+
|
35 |
+
parent::__construct();
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getCreateUrl() {
|
39 |
+
return $this->getUrl('*/*/edit');
|
40 |
+
}
|
41 |
+
|
42 |
+
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Sliders/Edit.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-05, 08:47:18)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Block_Adminhtml_Plugins_Sliders_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
|
29 |
+
|
30 |
+
public function __construct() {
|
31 |
+
parent::__construct();
|
32 |
+
$header = Mage::getSingleton('modulesgarden_base/slider')->isEmpty() ? 'New Slider Details' : 'Edit Slider Details';
|
33 |
+
|
34 |
+
$this->_blockGroup = 'modulesgarden_base';
|
35 |
+
$this->_controller = 'adminhtml_plugins_sliders';
|
36 |
+
$this->_headerText = Mage::helper('modulesgarden_base')->__($header);
|
37 |
+
$this->_mode = 'edit';
|
38 |
+
|
39 |
+
$this->_removeButton('reset');
|
40 |
+
|
41 |
+
$this->_addButton('saveandcontinue', array(
|
42 |
+
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
43 |
+
'onclick' => 'saveAndContinueEdit()',
|
44 |
+
'class' => 'save',
|
45 |
+
), -100);
|
46 |
+
|
47 |
+
$this->_formScripts[] = " function saveAndContinueEdit(){
|
48 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
49 |
+
}";
|
50 |
+
}
|
51 |
+
|
52 |
+
public function getBackUrl() {
|
53 |
+
return $this->getUrl('*/*/index');
|
54 |
+
}
|
55 |
+
|
56 |
+
// @todo better way to resolve it
|
57 |
+
protected function _toHtml() {
|
58 |
+
return '<div class="main-col-inner">' . parent::_toHtml() . '</div>';
|
59 |
+
}
|
60 |
+
|
61 |
+
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Sliders/Edit/Form.php
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-05, 08:49:27)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Block_Adminhtml_Plugins_Sliders_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {
|
29 |
+
|
30 |
+
protected function _prepareForm() {
|
31 |
+
$form = new Varien_Data_Form();
|
32 |
+
$form->setUseContainer(true);
|
33 |
+
$form->setId('edit_form');
|
34 |
+
|
35 |
+
$h = Mage::helper('modulesgarden_base');
|
36 |
+
$slider = Mage::getSingleton('modulesgarden_base/slider');
|
37 |
+
$isEditMode = !$slider->isEmpty();
|
38 |
+
|
39 |
+
$fieldset = $form->addFieldset('modulesgarden_basesliders_form', array(
|
40 |
+
'legend' => $h->__('Slider')
|
41 |
+
));
|
42 |
+
|
43 |
+
if (!Mage::app()->isSingleStoreMode()) {
|
44 |
+
$fieldset->addField('store_view_id', 'select', array(
|
45 |
+
'name' => 'store_view_id',
|
46 |
+
'label' => $h->__('Store View'),
|
47 |
+
'required' => true,
|
48 |
+
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
|
49 |
+
));
|
50 |
+
} else {
|
51 |
+
$fieldset->addField('store_view_id', 'hidden', array(
|
52 |
+
'name' => 'store_view_id',
|
53 |
+
'value' => Mage::app()->getStore(true)->getId(),
|
54 |
+
));
|
55 |
+
}
|
56 |
+
|
57 |
+
$fieldset->addField('code', 'text', array(
|
58 |
+
'name' => 'code',
|
59 |
+
'label' => $h->__('Code'),
|
60 |
+
'class' => 'required-entry',
|
61 |
+
'required' => true,
|
62 |
+
'disabled' => $isEditMode
|
63 |
+
));
|
64 |
+
$fieldset->addField('title', 'text', array(
|
65 |
+
'name' => 'title',
|
66 |
+
'label' => $h->__('Title'),
|
67 |
+
'class' => 'required-entry',
|
68 |
+
'required' => true,
|
69 |
+
));
|
70 |
+
$fieldset->addField('enabled', 'select', array(
|
71 |
+
'name' => 'enabled',
|
72 |
+
'label' => $h->__('Enabled'),
|
73 |
+
'class' => 'required-entry',
|
74 |
+
'required' => true,
|
75 |
+
'options' => array(
|
76 |
+
0 => 'No',
|
77 |
+
1 => 'Yes',
|
78 |
+
)
|
79 |
+
));
|
80 |
+
|
81 |
+
|
82 |
+
if (!$slider->isEmpty()) {
|
83 |
+
$fieldset->addField('slider_id', 'hidden', array(
|
84 |
+
'name' => 'slider_id',
|
85 |
+
'value' => $slider->getSliderId()
|
86 |
+
));
|
87 |
+
|
88 |
+
$form->setValues($slider->getData());
|
89 |
+
}
|
90 |
+
|
91 |
+
$form->setAction($this->getUrl('*/*/save'))
|
92 |
+
->setMethod('post');
|
93 |
+
|
94 |
+
$this->setForm($form);
|
95 |
+
return parent::_prepareForm();
|
96 |
+
}
|
97 |
+
|
98 |
+
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Sliders/Grid.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-04, 14:46:45)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Block_Adminhtml_Plugins_Sliders_Grid extends Mage_Adminhtml_Block_Widget_Grid {
|
29 |
+
|
30 |
+
public function __construct() {
|
31 |
+
parent::__construct();
|
32 |
+
|
33 |
+
$this->setId('modulesgarden_base_SlidersGrid');
|
34 |
+
$this->setDefaultSort('title');
|
35 |
+
$this->setDefaultDir('ASC');
|
36 |
+
$this->setSaveParametersInSession(false);
|
37 |
+
}
|
38 |
+
|
39 |
+
protected function _prepareCollection() {
|
40 |
+
$collection = Mage::getResourceModel('modulesgarden_base/slider_collection');
|
41 |
+
$this->setCollection($collection);
|
42 |
+
return parent::_prepareCollection();
|
43 |
+
}
|
44 |
+
|
45 |
+
protected function _prepareColumns() {
|
46 |
+
$h = Mage::helper('modulesgarden_base');
|
47 |
+
|
48 |
+
$this->addColumn('slider_id', array(
|
49 |
+
'header' => $h->__('ID'),
|
50 |
+
'align' => 'right',
|
51 |
+
'width' => '50px',
|
52 |
+
'index' => 'slider_id',
|
53 |
+
));
|
54 |
+
|
55 |
+
$this->addColumn('code', array(
|
56 |
+
'header' => $h->__('Code'),
|
57 |
+
'align' => 'left',
|
58 |
+
'index' => 'code',
|
59 |
+
'width' => '200px',
|
60 |
+
));
|
61 |
+
|
62 |
+
$this->addColumn('title', array(
|
63 |
+
'header' => $h->__('Title'),
|
64 |
+
'align' => 'left',
|
65 |
+
'index' => 'title',
|
66 |
+
));
|
67 |
+
|
68 |
+
$this->addColumn('enabled', array(
|
69 |
+
'header' => $h->__('Enabled'),
|
70 |
+
'align' => 'left',
|
71 |
+
'index' => 'enabled',
|
72 |
+
'width' => '120px',
|
73 |
+
'type' => 'options',
|
74 |
+
'sortable' => false,
|
75 |
+
'options' => array(
|
76 |
+
0 => $h->__('No'),
|
77 |
+
1 => $h->__('Yes'),
|
78 |
+
)
|
79 |
+
));
|
80 |
+
|
81 |
+
return parent::_prepareColumns();
|
82 |
+
}
|
83 |
+
|
84 |
+
public function getRowUrl($row) {
|
85 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getSliderId()));
|
86 |
+
}
|
87 |
+
|
88 |
+
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/Plugins/Sliders/Tabs.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-05, 09:10:19)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Block_Adminhtml_Plugins_Sliders_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
|
29 |
+
|
30 |
+
public function __construct() {
|
31 |
+
parent::__construct();
|
32 |
+
$this->setId('modulesgarden_base_slider_tabs');
|
33 |
+
$this->setTitle(Mage::helper('modulesgarden_base')->__('Slider'));
|
34 |
+
}
|
35 |
+
|
36 |
+
protected function _beforeToHtml() {
|
37 |
+
$layout = $this->getLayout();
|
38 |
+
|
39 |
+
$this->addTab('slider_form', array(
|
40 |
+
'label' => Mage::helper('modulesgarden_base')->__('Details'),
|
41 |
+
'content' => $layout->createBlock('modulesgarden_base/adminhtml_plugins_sliders_edit')->toHtml(),
|
42 |
+
));
|
43 |
+
|
44 |
+
$sliderId = Mage::app()->getRequest()->getParam('id');
|
45 |
+
|
46 |
+
if($sliderId) {
|
47 |
+
$this->addTab('settings', array(
|
48 |
+
'label' => Mage::helper('modulesgarden_base')->__('Banners'),
|
49 |
+
'content' => $layout->createBlock('modulesgarden_base/adminhtml_plugins_banners')->toHtml(),
|
50 |
+
));
|
51 |
+
}
|
52 |
+
|
53 |
+
return parent::_beforeToHtml();
|
54 |
+
}
|
55 |
+
|
56 |
+
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Installedmodulesgarden.php
CHANGED
@@ -35,7 +35,7 @@ class Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Installedmo
|
|
35 |
}
|
36 |
|
37 |
public function getExtensions(){
|
38 |
-
return Mage::getResourceModel('
|
39 |
}
|
40 |
|
41 |
}
|
35 |
}
|
36 |
|
37 |
public function getExtensions(){
|
38 |
+
return Mage::getResourceModel('modulesgarden_base/extension')->getModulesgardenExtensions();
|
39 |
}
|
40 |
|
41 |
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Installedmodulesgardenthemes.php
CHANGED
@@ -35,7 +35,7 @@ class Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Installedmo
|
|
35 |
}
|
36 |
|
37 |
public function getExtensions(){
|
38 |
-
return Mage::getResourceModel('
|
39 |
}
|
40 |
|
41 |
}
|
35 |
}
|
36 |
|
37 |
public function getExtensions(){
|
38 |
+
return Mage::getResourceModel('modulesgarden_base/extension')->getModulesgardenThemes();
|
39 |
}
|
40 |
|
41 |
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Installedothers.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-10-31, 10:30:00)
|
@@ -20,22 +20,21 @@
|
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
-
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
28 |
-
|
29 |
class Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Installedothers extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
|
30 |
|
31 |
-
|
|
|
|
|
|
|
|
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
public function getExtensions(){
|
38 |
-
return Mage::getResourceModel('modulesgardenbase/extension')->getNonModulesgardenCollection();
|
39 |
-
}
|
40 |
|
41 |
}
|
1 |
<?php
|
2 |
|
3 |
+
/* * ********************************************************************
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-10-31, 10:30:00)
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
+
* ******************************************************************** */
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
|
|
28 |
class Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Installedothers extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
|
29 |
|
30 |
+
protected $_template = 'modulesgardenbase/system/config/form/fieldset/installedothers.phtml';
|
31 |
+
|
32 |
+
public function render(Varien_Data_Form_Element_Abstract $element) {
|
33 |
+
return $this->toHtml();
|
34 |
+
}
|
35 |
|
36 |
+
public function getExtensions() {
|
37 |
+
return Mage::getResourceModel('modulesgarden_base/extension')->getOtherExtensions();
|
38 |
+
}
|
|
|
|
|
|
|
|
|
39 |
|
40 |
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Installedratio.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-10-31, 12:07:11)
|
@@ -20,45 +20,54 @@
|
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
-
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
28 |
-
|
29 |
class Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Installedratio extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
|
30 |
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
-
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
$this->_calculated = Mage::getModel('modulesgardenbase/mage')->calculateCustomization();
|
39 |
}
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
}
|
44 |
-
|
45 |
-
public function getRatio() {
|
46 |
-
return $this->_calculated['ratio'];
|
47 |
-
}
|
48 |
-
|
49 |
-
public function getRatioLabel() {
|
50 |
-
$labels = array_reverse(Modulesgarden_Base_Model_Mage::$ratioLabels, true);
|
51 |
-
$ratio = $this->getRatio();
|
52 |
-
|
53 |
-
foreach($labels as $minRatio => $label) {
|
54 |
-
if($ratio >= $minRatio) {
|
55 |
-
return Mage::helper('modulesgardenbase')->__($label);
|
56 |
-
}
|
57 |
-
}
|
58 |
}
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
}
|
1 |
<?php
|
2 |
|
3 |
+
/* * ********************************************************************
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-10-31, 12:07:11)
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
+
* ******************************************************************** */
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
|
|
28 |
class Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Installedratio extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
|
29 |
|
30 |
+
protected $_template = 'modulesgardenbase/system/config/form/fieldset/installedratio.phtml';
|
31 |
+
protected $_response;
|
32 |
+
protected $_hasError = false;
|
33 |
+
protected $_errorMessage = '';
|
34 |
+
|
35 |
+
public function _construct() {
|
36 |
+
parent::_construct();
|
37 |
|
38 |
+
$client = new Modulesgarden_Base_Model_Check_Client;
|
39 |
|
40 |
+
try {
|
41 |
+
$this->_response = $client->fetch()->getResponse();
|
|
|
|
|
42 |
}
|
43 |
+
catch(Exception $e) {
|
44 |
+
$this->_hasError = true;
|
45 |
+
$this->_errorMessage = $e->getMessage();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
+
}
|
48 |
+
|
49 |
+
public function hasError() {
|
50 |
+
return $this->_hasError;
|
51 |
+
}
|
52 |
+
|
53 |
+
public function getErrorMessage() {
|
54 |
+
return $this->_errorMessage;
|
55 |
+
}
|
56 |
+
|
57 |
+
public function render(Varien_Data_Form_Element_Abstract $element) {
|
58 |
+
return $this->toHtml();
|
59 |
+
}
|
60 |
+
|
61 |
+
public function getRatio() {
|
62 |
+
return $this->_response->summary->ratio;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function getRatioLabel() {
|
66 |
+
return $this->_response->summary->label;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function getDebugString() {
|
70 |
+
return print_r( (array) $this->_response, true);
|
71 |
+
}
|
72 |
|
73 |
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Modulesgarden.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-11-13, 12:00:32)
|
@@ -20,16 +20,15 @@
|
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
-
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
28 |
-
|
29 |
class Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Modulesgarden extends Mage_Adminhtml_Block_System_Config_Form_Fieldset {
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
|
35 |
}
|
1 |
<?php
|
2 |
|
3 |
+
/* * ********************************************************************
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-11-13, 12:00:32)
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
+
* ******************************************************************** */
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
|
|
28 |
class Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Modulesgarden extends Mage_Adminhtml_Block_System_Config_Form_Fieldset {
|
29 |
|
30 |
+
protected function _getFrontendClass($element) {
|
31 |
+
return parent::_getFrontendClass($element) . ' modulesgarden_form_container';
|
32 |
+
}
|
33 |
|
34 |
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Store.php
CHANGED
@@ -25,7 +25,6 @@
|
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
28 |
-
|
29 |
class Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Store extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
|
30 |
|
31 |
protected $_template = 'modulesgardenbase/system/config/form/fieldset/store.phtml';
|
@@ -35,7 +34,7 @@ class Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Store exten
|
|
35 |
}
|
36 |
|
37 |
public function getExtensions() {
|
38 |
-
return Mage::getResourceModel('
|
39 |
return $item->getPrice();
|
40 |
});
|
41 |
}
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
|
|
28 |
class Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Store extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
|
29 |
|
30 |
protected $_template = 'modulesgardenbase/system/config/form/fieldset/store.phtml';
|
34 |
}
|
35 |
|
36 |
public function getExtensions() {
|
37 |
+
return Mage::getResourceModel('modulesgarden_base/extension')->getExtensionsObjectsFromModulesgardenCom(function($item) {
|
38 |
return $item->getPrice();
|
39 |
});
|
40 |
}
|
app/code/community/Modulesgarden/Base/Block/Adminhtml/System/Config/Form/Fieldset/Twitter.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-11-12, 14:00:46)
|
@@ -20,18 +20,29 @@
|
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
-
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
28 |
-
|
29 |
class Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Twitter extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
|
30 |
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
-
public function render(Varien_Data_Form_Element_Abstract $element) {
|
34 |
-
return $this->toHtml();
|
35 |
-
}
|
36 |
-
|
37 |
}
|
1 |
<?php
|
2 |
|
3 |
+
/* * ********************************************************************
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-11-12, 14:00:46)
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
+
* ******************************************************************** */
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
|
|
28 |
class Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Twitter extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
|
29 |
|
30 |
+
protected $_template = 'modulesgardenbase/system/config/form/fieldset/twitter.phtml';
|
31 |
+
|
32 |
+
public function render(Varien_Data_Form_Element_Abstract $element) {
|
33 |
+
return $this->toHtml();
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getTwitterUrl() {
|
37 |
+
return (string) Mage::getConfig()->getNode('default/modulesgarden_base/twitter/url');
|
38 |
+
}
|
39 |
+
|
40 |
+
public function getTwitterId() {
|
41 |
+
return (string) Mage::getConfig()->getNode('default/modulesgarden_base/twitter/id');
|
42 |
+
}
|
43 |
+
|
44 |
+
public function getTwitterLimit() {
|
45 |
+
return (string) Mage::getConfig()->getNode('default/modulesgarden_base/twitter/limit');
|
46 |
+
}
|
47 |
|
|
|
|
|
|
|
|
|
48 |
}
|
app/code/community/Modulesgarden/Base/Controller/Adminhtml/Sliders.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-05, 10:15:19)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Controller_Adminhtml_Sliders extends Mage_Adminhtml_Controller_Action {
|
29 |
+
|
30 |
+
protected function _isAllowed() {
|
31 |
+
return Mage::getSingleton('admin/session')->isAllowed('modulesgarden_base/sliders');
|
32 |
+
}
|
33 |
+
|
34 |
+
protected function _initAction() {
|
35 |
+
$this->loadLayout()->_setActiveMenu('modulesgarden_base/plugins/sliders');
|
36 |
+
return $this;
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
app/code/community/Modulesgarden/Base/Helper/Data.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-11-03, 08:13:58)
|
@@ -20,20 +20,19 @@
|
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
-
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
28 |
-
|
29 |
class Modulesgarden_Base_Helper_Data extends Mage_Core_Helper_Abstract {
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
}
|
1 |
<?php
|
2 |
|
3 |
+
/* * ********************************************************************
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-11-03, 08:13:58)
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
+
* ******************************************************************** */
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
|
|
28 |
class Modulesgarden_Base_Helper_Data extends Mage_Core_Helper_Abstract {
|
29 |
+
|
30 |
+
public function arrayToBase64(array $array) {
|
31 |
+
return base64_encode($this->arrayToString($array));
|
32 |
+
}
|
33 |
+
|
34 |
+
public function arrayToString(array $array) {
|
35 |
+
return str_replace(array('Array', ' '), array('', ''), print_r($array, true));
|
36 |
+
}
|
37 |
+
|
38 |
}
|
app/code/community/Modulesgarden/Base/Model/Adminnotification/Core.php
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-11-12, 10:35:44)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Marcin Kozak <marcin.ko@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Model_Adminnotification_Core {
|
29 |
+
|
30 |
+
/**
|
31 |
+
*
|
32 |
+
* @var array
|
33 |
+
*/
|
34 |
+
protected $events;
|
35 |
+
|
36 |
+
/**
|
37 |
+
*
|
38 |
+
* @var Modulesgarden_Base_Model_Extension_Client
|
39 |
+
*/
|
40 |
+
protected $client;
|
41 |
+
|
42 |
+
/**
|
43 |
+
*
|
44 |
+
* @var Modulesgarden_Base_Model_Resource_Extension
|
45 |
+
*/
|
46 |
+
protected $resource;
|
47 |
+
|
48 |
+
/**
|
49 |
+
*
|
50 |
+
* @var Modulesgarden_Base_Helper_Data
|
51 |
+
*/
|
52 |
+
protected $helper;
|
53 |
+
|
54 |
+
public function __construct() {
|
55 |
+
$this->events = explode(',', Mage::getStoreConfig('mgbase_store/notifications/events'));
|
56 |
+
$this->client = new Modulesgarden_Base_Model_Extension_Client();
|
57 |
+
|
58 |
+
$version = (string) Mage::getConfig()->getNode()->modules->Modulesgarden_Base->version;
|
59 |
+
$this->helper = Mage::helper('modulesgarden_base');
|
60 |
+
$this->resource = Mage::getResourceModel('modulesgarden_base/extension');
|
61 |
+
|
62 |
+
$serverAddr = filter_input(INPUT_SERVER, 'SERVER_ADDR');
|
63 |
+
$serverName = filter_input(INPUT_SERVER, 'SERVER_NAME');
|
64 |
+
|
65 |
+
$this->client->registerModuleInstance($version, $serverAddr, $serverName);
|
66 |
+
}
|
67 |
+
|
68 |
+
protected function hasEvent($event) {
|
69 |
+
return in_array($event, $this->events);
|
70 |
+
}
|
71 |
+
|
72 |
+
protected function canBeAppended($title) {
|
73 |
+
return ! Modulesgarden_Base_Model_Adminnotification_Inbox::exists($title);
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
*
|
78 |
+
* @return array (Modulesgarden_Base_Model_Adminnotification_Item)
|
79 |
+
*/
|
80 |
+
public function getUpgrades() {
|
81 |
+
$messages = array();
|
82 |
+
|
83 |
+
if( ! $this->hasEvent(Modulesgarden_Base_Model_System_Config_Source_Notificationevents::UPGRADES) ) {
|
84 |
+
return $messages;
|
85 |
+
}
|
86 |
+
|
87 |
+
foreach($this->resource->getModulesgardenCollection() as $installedMgExtension) {
|
88 |
+
if($installedMgExtension->isUpgardeAvailable()) {
|
89 |
+
$title = $this->helper->__('Upgarde Of "%s" Extension From ModulesGarden Is Available (%s)', $installedMgExtension->getFriendlyName(), $installedMgExtension->getLatestVersion());
|
90 |
+
|
91 |
+
if( $this->canBeAppended($title) ) {
|
92 |
+
$description = $this->helper->__('New version: %s. Download extension from modulesgarden.com and install it in your magento.', $installedMgExtension->getLatestVersion());
|
93 |
+
$messages[] = new Modulesgarden_Base_Model_Adminnotification_Item($title, $description, $installedMgExtension->getChangelogUrl());
|
94 |
+
}
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
return $messages;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
*
|
103 |
+
* @return array (Modulesgarden_Base_Model_Adminnotification_Item)
|
104 |
+
*/
|
105 |
+
public function getReleases() {
|
106 |
+
$messages = array();
|
107 |
+
|
108 |
+
if( ! $this->hasEvent(Modulesgarden_Base_Model_System_Config_Source_Notificationevents::RELEASES) ) {
|
109 |
+
return $messages;
|
110 |
+
}
|
111 |
+
|
112 |
+
foreach($this->resource->getExtensionsObjectsFromModulesgardenCom() as $extensionFromStore) {
|
113 |
+
if($extensionFromStore->getIsNew()) {
|
114 |
+
$title = $this->helper->__('New Extension From ModulesGarden: %s', $extensionFromStore->getFriendlyName());
|
115 |
+
|
116 |
+
if( $this->canBeAppended($title) ) {
|
117 |
+
$description = $this->helper->__('Download extension from modulesgarden.com and install it in your magento.');
|
118 |
+
$messages[] = new Modulesgarden_Base_Model_Adminnotification_Item($title, $description, $extensionFromStore->getChangelogUrl());
|
119 |
+
}
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
return $messages;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
*
|
128 |
+
* @return array (Modulesgarden_Base_Model_Adminnotification_Item)
|
129 |
+
*/
|
130 |
+
public function getPromotions() {
|
131 |
+
$messages = array();
|
132 |
+
|
133 |
+
if( ! $this->hasEvent(Modulesgarden_Base_Model_System_Config_Source_Notificationevents::PROMOTIONS) ) {
|
134 |
+
return $messages;
|
135 |
+
}
|
136 |
+
|
137 |
+
$promotions = $this->client->getActivePromotions();
|
138 |
+
|
139 |
+
if( ! ($promotions && isset($promotions->data->promotions))) {
|
140 |
+
return $messages;
|
141 |
+
}
|
142 |
+
|
143 |
+
$url = (string) Mage::getConfig()->getNode('default/modulesgarden_base/urls/company');
|
144 |
+
|
145 |
+
foreach($promotions->data->promotions as $promo) {
|
146 |
+
$title = $this->helper->__('New Promotion From ModulesGarden: %s', $promo->notes);
|
147 |
+
|
148 |
+
if($this->canBeAppended($title)) {
|
149 |
+
$description = $this->helper->__('Promotion Code: %s', $promo->code);
|
150 |
+
$messages[] = new Modulesgarden_Base_Model_Adminnotification_Item($title, $description, $url);
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
return $messages;
|
155 |
+
}
|
156 |
+
|
157 |
+
public function getAll() {
|
158 |
+
$messages = array();
|
159 |
+
|
160 |
+
$messages = array_merge($messages, $this->getUpgrades());
|
161 |
+
$messages = array_merge($messages, $this->getReleases());
|
162 |
+
$messages = array_merge($messages, $this->getPromotions());
|
163 |
+
|
164 |
+
return $messages;
|
165 |
+
}
|
166 |
+
|
167 |
+
}
|
app/code/community/Modulesgarden/Base/Model/Adminnotification/Inbox.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-11-12, 10:35:44)
|
@@ -20,20 +20,18 @@
|
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
-
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
28 |
-
|
29 |
class Modulesgarden_Base_Model_Adminnotification_Inbox extends Mage_AdminNotification_Model_Inbox {
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
}
|
1 |
<?php
|
2 |
|
3 |
+
/* * ********************************************************************
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-11-12, 10:35:44)
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
+
* ******************************************************************** */
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
|
|
28 |
class Modulesgarden_Base_Model_Adminnotification_Inbox extends Mage_AdminNotification_Model_Inbox {
|
29 |
+
|
30 |
+
public static function exists($title) {
|
31 |
+
$resource = Mage::getSingleton('core/resource');
|
32 |
+
$sql = sprintf('SELECT 1 FROM %s WHERE title = :title', $resource->getTableName('adminnotification_inbox'));
|
33 |
+
|
34 |
+
return (bool) $resource->getConnection('core_read')->fetchOne($sql, compact('title'));
|
35 |
+
}
|
36 |
+
|
|
|
37 |
}
|
app/code/community/Modulesgarden/Base/Model/Adminnotification/Item.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-11-12, 10:35:44)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Marcin Kozak <marcin.ko@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Model_Adminnotification_Item {
|
29 |
+
|
30 |
+
public $title;
|
31 |
+
public $description;
|
32 |
+
public $url;
|
33 |
+
|
34 |
+
public function __construct($title, $description, $url = '') {
|
35 |
+
$this->title = $title;
|
36 |
+
$this->description = $description;
|
37 |
+
$this->url = $url;
|
38 |
+
}
|
39 |
+
|
40 |
+
}
|
app/code/community/Modulesgarden/Base/Model/Banner.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-04, 14:35:18)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Model_Banner extends Mage_Core_Model_Abstract {
|
29 |
+
|
30 |
+
protected $_slider;
|
31 |
+
|
32 |
+
protected function _construct() {
|
33 |
+
$this->_init('modulesgarden_base/banner');
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getSlider() {
|
37 |
+
if ($this->_slider === null) {
|
38 |
+
$this->_slider = Mage::getModel('modulesgarden_base/slider')->load($this->getSliderId());
|
39 |
+
}
|
40 |
+
return $this->_slider;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function getFileUrl() {
|
44 |
+
return Mage::getBaseUrl('media') . 'modulesgarden_base_sliders/' . $this->getFilename();
|
45 |
+
}
|
46 |
+
|
47 |
+
public function delete() {
|
48 |
+
if ($this->getFilename()) {
|
49 |
+
$path = Mage::getBaseDir('media') . DS . 'modulesgarden_base_sliders' . DS . $this->getFilename();
|
50 |
+
if (file_exists($path)) {
|
51 |
+
@unlink($path);
|
52 |
+
}
|
53 |
+
}
|
54 |
+
parent::delete();
|
55 |
+
return $this;
|
56 |
+
}
|
57 |
+
|
58 |
+
}
|
app/code/community/Modulesgarden/Base/Model/Check/Client.php
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2015-11-19, 14:39:18)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Marcin Kozak <marcin.ko@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Model_Check_Client {
|
29 |
+
|
30 |
+
/**
|
31 |
+
*
|
32 |
+
* @var \Zend_Http_Client
|
33 |
+
*/
|
34 |
+
protected $curl;
|
35 |
+
|
36 |
+
/**
|
37 |
+
*
|
38 |
+
* @var \Modulesgarden_Base_Model_Mage
|
39 |
+
*/
|
40 |
+
protected $mage;
|
41 |
+
|
42 |
+
/**
|
43 |
+
*
|
44 |
+
* @var string
|
45 |
+
*/
|
46 |
+
protected $url;
|
47 |
+
|
48 |
+
/**
|
49 |
+
*
|
50 |
+
* @var \Zend_Http_Response
|
51 |
+
*/
|
52 |
+
protected $response;
|
53 |
+
|
54 |
+
public function __construct() {
|
55 |
+
$this->url = (string) Mage::getConfig()->getNode('default/modulesgarden_base/urls/check');
|
56 |
+
$this->mage = new Modulesgarden_Base_Model_Mage();
|
57 |
+
$this->curl = curl_init($this->url);
|
58 |
+
|
59 |
+
curl_setopt($this->curl, CURLOPT_HEADER, 0);
|
60 |
+
curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, 'PUT');
|
61 |
+
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);
|
62 |
+
curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, 1);
|
63 |
+
curl_setopt($this->curl, CURLOPT_TIMEOUT, 5);
|
64 |
+
curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, false);
|
65 |
+
curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, false);
|
66 |
+
curl_setopt($this->curl, CURLOPT_POSTREDIR, 3);
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
*
|
71 |
+
* @return \Modulesgarden_Base_Model_Information_Client
|
72 |
+
*/
|
73 |
+
public function fetch() {
|
74 |
+
$data = array(
|
75 |
+
'check' => $this->mage->toArray()
|
76 |
+
);
|
77 |
+
|
78 |
+
curl_setopt($this->curl, CURLOPT_POSTFIELDS, json_encode($data));
|
79 |
+
|
80 |
+
$response = curl_exec($this->curl);
|
81 |
+
|
82 |
+
if($response === false) {
|
83 |
+
$error = curl_error($this->curl);
|
84 |
+
Mage::log($error, null, 'modulesgarden_base.log');
|
85 |
+
throw new Exception($error);
|
86 |
+
}
|
87 |
+
|
88 |
+
$this->response = json_decode($response);
|
89 |
+
|
90 |
+
return $this;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
*
|
95 |
+
* @return \Zend_Http_Response
|
96 |
+
*/
|
97 |
+
public function getResponse() {
|
98 |
+
return $this->response;
|
99 |
+
}
|
100 |
+
}
|
app/code/community/Modulesgarden/Base/Model/Extension.php
CHANGED
@@ -112,7 +112,7 @@ class Modulesgarden_Base_Model_Extension extends Varien_Object {
|
|
112 |
*/
|
113 |
public function isAlreadyInstalled() {
|
114 |
$this->_applyVersionFileDetails();
|
115 |
-
$modulesgardenExtensionsInstalled = Mage::getResourceModel('
|
116 |
foreach ($modulesgardenExtensionsInstalled as $ext) {
|
117 |
if (trim(strtolower(htmlspecialchars_decode($ext->getFriendlyName()))) == trim(strtolower(htmlspecialchars_decode($this->getFriendlyName())))) {
|
118 |
return true;
|
@@ -124,7 +124,7 @@ class Modulesgarden_Base_Model_Extension extends Varien_Object {
|
|
124 |
protected function _applyRemoteDetails() {
|
125 |
if (!$this->_remoteDetailsApplied) {
|
126 |
$this->_applyVersionFileDetails();
|
127 |
-
Mage::getResourceModel('
|
128 |
$this->_remoteDetailsApplied = true;
|
129 |
}
|
130 |
return $this;
|
@@ -132,7 +132,7 @@ class Modulesgarden_Base_Model_Extension extends Varien_Object {
|
|
132 |
|
133 |
protected function _applyVersionFileDetails() {
|
134 |
if (!$this->_versionFileApplied) {
|
135 |
-
Mage::getResourceModel('
|
136 |
$this->_versionFileApplied = true;
|
137 |
}
|
138 |
return $this;
|
112 |
*/
|
113 |
public function isAlreadyInstalled() {
|
114 |
$this->_applyVersionFileDetails();
|
115 |
+
$modulesgardenExtensionsInstalled = Mage::getResourceModel('modulesgarden_base/extension')->getModulesgardenCollection();
|
116 |
foreach ($modulesgardenExtensionsInstalled as $ext) {
|
117 |
if (trim(strtolower(htmlspecialchars_decode($ext->getFriendlyName()))) == trim(strtolower(htmlspecialchars_decode($this->getFriendlyName())))) {
|
118 |
return true;
|
124 |
protected function _applyRemoteDetails() {
|
125 |
if (!$this->_remoteDetailsApplied) {
|
126 |
$this->_applyVersionFileDetails();
|
127 |
+
Mage::getResourceModel('modulesgarden_base/extension')->applyRemoteDetails($this);
|
128 |
$this->_remoteDetailsApplied = true;
|
129 |
}
|
130 |
return $this;
|
132 |
|
133 |
protected function _applyVersionFileDetails() {
|
134 |
if (!$this->_versionFileApplied) {
|
135 |
+
Mage::getResourceModel('modulesgarden_base/extension')->applyVersionFileDetails($this);
|
136 |
$this->_versionFileApplied = true;
|
137 |
}
|
138 |
return $this;
|
app/code/community/Modulesgarden/Base/Model/Extension/Client.php
CHANGED
@@ -27,194 +27,205 @@
|
|
27 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
28 |
*/
|
29 |
class Modulesgarden_Base_Model_Extension_Client {
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
}
|
68 |
-
|
69 |
-
public function setURL($url) {
|
70 |
-
$this->url = $url;
|
71 |
-
}
|
72 |
-
|
73 |
-
/**
|
74 |
-
* @param type $currentVersion
|
75 |
-
*/
|
76 |
-
public function getLatestModuleVersion() {
|
77 |
-
$request = array(
|
78 |
-
'action' => 'getLatestModuleVersion',
|
79 |
-
);
|
80 |
-
|
81 |
-
return $this->send($request);
|
82 |
-
}
|
83 |
-
|
84 |
-
public function getActivePromotions() {
|
85 |
-
$request = array(
|
86 |
-
'action' => 'getActivePromotions'
|
87 |
-
);
|
88 |
-
|
89 |
-
return $this->send($request);
|
90 |
-
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Register new module instance
|
94 |
-
* @param type $moduleVersion
|
95 |
-
* @param type $serverIP
|
96 |
-
* @param type $serverName
|
97 |
-
* @return type
|
98 |
-
*/
|
99 |
-
public function registerModuleInstance($moduleVersion, $serverIP, $serverName) {
|
100 |
-
$request = array(
|
101 |
-
'action' => 'registerModuleInstance',
|
102 |
-
'data' => array
|
103 |
-
(
|
104 |
-
'moduleVersion' => $moduleVersion,
|
105 |
-
'serverIP' => $serverIP,
|
106 |
-
'serverName' => $serverName,
|
107 |
-
)
|
108 |
-
);
|
109 |
-
|
110 |
-
return $this->send($request);
|
111 |
-
}
|
112 |
-
|
113 |
-
/**
|
114 |
-
* Get all available products
|
115 |
-
* @return type
|
116 |
-
*/
|
117 |
-
public function getAvailableProducts($platform = null) {
|
118 |
-
$requst = array(
|
119 |
-
'action' => 'getAvailableProducts',
|
120 |
-
'data' => array(
|
121 |
-
'platform' => $platform
|
122 |
-
)
|
123 |
-
);
|
124 |
-
|
125 |
-
return $this->send($requst);
|
126 |
-
}
|
127 |
-
|
128 |
-
private function send($data = array()) {
|
129 |
-
if (!$data) {
|
130 |
-
return false;
|
131 |
-
}
|
132 |
-
|
133 |
-
if (empty($data['action'])) {
|
134 |
-
return false;
|
135 |
-
}
|
136 |
-
|
137 |
-
//Add module name and access hash
|
138 |
-
$data['hash'] = $this->accessHash;
|
139 |
-
$data['module'] = $this->module;
|
140 |
-
|
141 |
-
//Are we have ane cache?
|
142 |
-
|
143 |
-
$json = $this->getFromCache($data);
|
144 |
-
|
145 |
-
if( ! empty($json) ) {
|
146 |
-
return $json;
|
147 |
-
}
|
148 |
-
|
149 |
-
//Encode data
|
150 |
-
$jsonData = json_encode($data);
|
151 |
-
|
152 |
-
//Prepare Curl
|
153 |
-
$ch = curl_init($this->url);
|
154 |
-
curl_setopt($ch, CURLOPT_HEADER, 0);
|
155 |
-
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
|
156 |
-
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
|
157 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
158 |
-
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
159 |
-
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
|
160 |
-
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
161 |
-
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
162 |
-
curl_setopt($ch, CURLOPT_POSTREDIR, 3);
|
163 |
-
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: text/xml'));
|
164 |
-
|
165 |
-
$ret = curl_exec($ch);
|
166 |
-
|
167 |
-
if (!$ret) {
|
168 |
-
$this->error = 'Did not receive any data. ' . curl_error($ch);
|
169 |
-
return false;
|
170 |
-
}
|
171 |
-
|
172 |
-
$json = json_decode($ret);
|
173 |
-
if (!$json) {
|
174 |
-
$this->error = 'Invalid Format';
|
175 |
-
return false;
|
176 |
-
}
|
177 |
-
|
178 |
-
if (!$json->status) {
|
179 |
-
$this->error = $json->message;
|
180 |
-
return false;
|
181 |
-
}
|
182 |
-
|
183 |
-
$this->saveCache($data, $json);
|
184 |
-
|
185 |
-
return $json;
|
186 |
-
}
|
187 |
-
|
188 |
-
public function getError() {
|
189 |
-
return $this->error;
|
190 |
-
}
|
191 |
-
|
192 |
-
protected function setError($error) {
|
193 |
-
$this->error = $error;
|
194 |
-
}
|
195 |
|
196 |
-
|
197 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
Mage::app()->getCache()->save(urlencode(serialize($json)), $key, array(), $this->cache[$action]);
|
206 |
-
}
|
207 |
}
|
|
|
|
|
208 |
|
209 |
-
|
210 |
-
$
|
211 |
-
|
212 |
-
|
213 |
-
if($object !== false) {
|
214 |
-
return unserialize(urldecode($object));
|
215 |
-
}
|
216 |
-
|
217 |
-
return null;
|
218 |
}
|
219 |
|
220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
28 |
*/
|
29 |
class Modulesgarden_Base_Model_Extension_Client {
|
30 |
+
|
31 |
+
CONST MODULE_NAME = 'Modules Garden Widget For Magento';
|
32 |
+
CONST MODULE_KEY = 'fhKzDqtZ3NloER4kV0olIHRIqba8VDf8';
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Cache life time.
|
36 |
+
*/
|
37 |
+
protected $cache = array();
|
38 |
+
|
39 |
+
/**
|
40 |
+
*
|
41 |
+
* @var \Zend_Http_Client
|
42 |
+
*/
|
43 |
+
protected $curl;
|
44 |
+
|
45 |
+
/**
|
46 |
+
*
|
47 |
+
* @var string
|
48 |
+
*/
|
49 |
+
protected $url;
|
50 |
+
|
51 |
+
/**
|
52 |
+
*
|
53 |
+
* @var \Zend_Http_Response
|
54 |
+
*/
|
55 |
+
protected $response;
|
56 |
+
|
57 |
+
//This name will be send to modulesgarden.com
|
58 |
+
protected $module = '';
|
59 |
+
//Module Name
|
60 |
+
protected $moduleName = '';
|
61 |
+
//Encryption Key
|
62 |
+
protected $accessHash = '';
|
63 |
+
|
64 |
+
public function __construct($moduleName = '', $accessHash = '') {
|
65 |
+
$this->url = (string) Mage::getConfig()->getNode('default/modulesgarden_base/urls/store');
|
66 |
+
$this->curl = curl_init($this->url);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
+
$this->module = $moduleName;
|
69 |
+
$this->moduleName = $moduleName ? strtolower(str_replace(' ', '', $moduleName)) : self::MODULE_NAME;
|
70 |
+
$this->accessHash = $accessHash ? trim($accessHash) : self::MODULE_KEY;
|
71 |
+
|
72 |
+
curl_setopt($this->curl, CURLOPT_HEADER, 0);
|
73 |
+
curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, 'PUT');
|
74 |
+
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);
|
75 |
+
curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, 1);
|
76 |
+
curl_setopt($this->curl, CURLOPT_TIMEOUT, 5);
|
77 |
+
curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, false);
|
78 |
+
curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, false);
|
79 |
+
curl_setopt($this->curl, CURLOPT_POSTREDIR, 3);
|
80 |
+
curl_setopt($this->curl, CURLOPT_HTTPHEADER, array('Content-type: text/xml'));
|
81 |
+
}
|
82 |
+
|
83 |
+
protected function initCache() {
|
84 |
+
$this->cache = array(
|
85 |
+
'getLatestModuleVersion' => (int) Mage::getConfig()->getNode('default/modulesgarden_base/urls/cache/latest_module_version'),
|
86 |
+
'registerModuleInstance' => (int) Mage::getConfig()->getNode('default/modulesgarden_base/urls/cache/register_module_instance'),
|
87 |
+
'getAvailableProducts' => (int) Mage::getConfig()->getNode('default/modulesgarden_base/urls/cache/available_products'),
|
88 |
+
'getActivePromotions' => (int) Mage::getConfig()->getNode('default/modulesgarden_base/urls/cache/active_promotions'),
|
89 |
+
);
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* @param type $currentVersion
|
94 |
+
*/
|
95 |
+
public function getLatestModuleVersion() {
|
96 |
+
$request = array(
|
97 |
+
'action' => 'getLatestModuleVersion',
|
98 |
+
);
|
99 |
+
|
100 |
+
return $this->send($request);
|
101 |
+
}
|
102 |
+
|
103 |
+
public function getActivePromotions() {
|
104 |
+
$request = array(
|
105 |
+
'action' => 'getActivePromotions',
|
106 |
+
);
|
107 |
+
|
108 |
+
return $this->send($request);
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Register new module instance
|
113 |
+
* @param type $moduleVersion
|
114 |
+
* @param type $serverIP
|
115 |
+
* @param type $serverName
|
116 |
+
* @return type
|
117 |
+
*/
|
118 |
+
public function registerModuleInstance($moduleVersion, $serverIP, $serverName) {
|
119 |
+
$request = array(
|
120 |
+
'action' => 'registerModuleInstance',
|
121 |
+
'data' => array(
|
122 |
+
'moduleVersion' => $moduleVersion,
|
123 |
+
'serverIP' => $serverIP,
|
124 |
+
'serverName' => $serverName,
|
125 |
+
),
|
126 |
+
);
|
127 |
+
|
128 |
+
return $this->send($request);
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Get all available products
|
133 |
+
* @return type
|
134 |
+
*/
|
135 |
+
public function getAvailableProducts($platform = null) {
|
136 |
+
$requst = array(
|
137 |
+
'action' => 'getAvailableProducts',
|
138 |
+
'data' => array(
|
139 |
+
'platform' => $platform,
|
140 |
+
),
|
141 |
+
);
|
142 |
+
|
143 |
+
return $this->send($requst);
|
144 |
+
}
|
145 |
+
|
146 |
+
private function send($data = array()) {
|
147 |
+
if (!$data) {
|
148 |
+
return false;
|
149 |
+
}
|
150 |
+
|
151 |
+
if (empty($data['action'])) {
|
152 |
+
return false;
|
153 |
+
}
|
154 |
+
|
155 |
+
//Add module name and access hash
|
156 |
+
$data['hash'] = $this->accessHash;
|
157 |
+
$data['module'] = $this->module;
|
158 |
+
|
159 |
+
//Are we have ane cache?
|
160 |
+
|
161 |
+
$json = $this->getFromCache($data);
|
162 |
+
|
163 |
+
if (!empty($json)) {
|
164 |
+
return $json;
|
165 |
}
|
166 |
+
|
167 |
+
//Encode data
|
168 |
+
$jsonData = json_encode($data);
|
169 |
+
|
170 |
+
//Prepare Curl
|
171 |
+
curl_setopt($this->curl, CURLOPT_POSTFIELDS, $jsonData);
|
172 |
+
|
173 |
+
$this->response = curl_exec($this->curl);
|
174 |
|
175 |
+
//echo '<pre>'; var_dump($data, $this->response); exit;
|
176 |
+
|
177 |
+
if( ! $this->response) {
|
178 |
+
$this->error = 'Did not receive any data. ' . curl_error($this->curl);
|
179 |
+
return false;
|
|
|
|
|
180 |
}
|
181 |
+
|
182 |
+
$json = json_decode($this->response);
|
183 |
|
184 |
+
if (!$json) {
|
185 |
+
$this->setError('Invalid Format');
|
186 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
}
|
188 |
|
189 |
+
if (!$json->status) {
|
190 |
+
$this->setError($json->message);
|
191 |
+
return false;
|
192 |
+
}
|
193 |
+
|
194 |
+
$this->saveCache($data, $json);
|
195 |
+
|
196 |
+
return $json;
|
197 |
+
}
|
198 |
+
|
199 |
+
public function getError() {
|
200 |
+
return $this->error;
|
201 |
+
}
|
202 |
+
|
203 |
+
protected function setError($error) {
|
204 |
+
$this->error = $error;
|
205 |
+
}
|
206 |
+
|
207 |
+
private function getCacheKeyByData($data) {
|
208 |
+
return $this->moduleName . '_' . serialize($data);
|
209 |
+
}
|
210 |
+
|
211 |
+
private function saveCache($data, $json) {
|
212 |
+
$key = $this->getCacheKeyByData($data);
|
213 |
+
$action = $data['action'];
|
214 |
+
|
215 |
+
if (isset($this->cache[$action])) {
|
216 |
+
Mage::app()->getCache()->save(urlencode(serialize($json)), $key, array(), $this->cache[$action]);
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
private function getFromCache($data) {
|
221 |
+
$key = $this->getCacheKeyByData($data);
|
222 |
+
$object = Mage::app()->getCache()->load($key);
|
223 |
+
|
224 |
+
if ($object !== false) {
|
225 |
+
return unserialize(urldecode($object));
|
226 |
+
}
|
227 |
+
|
228 |
+
return null;
|
229 |
+
}
|
230 |
+
|
231 |
+
}
|
app/code/community/Modulesgarden/Base/Model/Extension/Item.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2015-11-19, 14:01:42)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Marcin Kozak <marcin.ko@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Model_Extension_Item {
|
29 |
+
protected $name;
|
30 |
+
protected $version;
|
31 |
+
|
32 |
+
public function __construct($name, $version) {
|
33 |
+
$this->name = (string) $name;
|
34 |
+
$this->version = (string) $version;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function getName() {
|
38 |
+
return $this->name;
|
39 |
+
}
|
40 |
+
|
41 |
+
public function getVersion() {
|
42 |
+
return $this->version;
|
43 |
+
}
|
44 |
+
}
|
app/code/community/Modulesgarden/Base/Model/Extension/Modulesgarden/Item.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2015-11-19, 14:01:42)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Marcin Kozak <marcin.ko@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Model_Extension_Modulesgarden_Item extends Modulesgarden_Base_Model_Extension_Item {
|
29 |
+
|
30 |
+
const TYPE_THEME = 'theme';
|
31 |
+
const TYPE_MODULE = 'module';
|
32 |
+
|
33 |
+
protected $type;
|
34 |
+
protected $_versionFileApplied = false;
|
35 |
+
protected $_remoteDetailsApplied = false;
|
36 |
+
|
37 |
+
protected $wikiUrl;
|
38 |
+
protected $friendlyName;
|
39 |
+
protected $latestVersion;
|
40 |
+
protected $iconUrl;
|
41 |
+
protected $price;
|
42 |
+
protected $description;
|
43 |
+
protected $changelogUrl;
|
44 |
+
|
45 |
+
|
46 |
+
public function __construct($type, $name, $version) {
|
47 |
+
parent::__construct($name, $version);
|
48 |
+
|
49 |
+
$this->type = $type;
|
50 |
+
}
|
51 |
+
|
52 |
+
public function getWikiUrl() {
|
53 |
+
return $this->wikiUrl;
|
54 |
+
}
|
55 |
+
|
56 |
+
public function getFriendlyName() {
|
57 |
+
return $this->friendlyName ?: $this->getName();
|
58 |
+
}
|
59 |
+
|
60 |
+
public function getLatestVersion() {
|
61 |
+
return $this->latestVersion;
|
62 |
+
}
|
63 |
+
|
64 |
+
public function getIconUrl($default = '') {
|
65 |
+
return $this->iconUrl ?: $default;
|
66 |
+
}
|
67 |
+
|
68 |
+
public function getPrice() {
|
69 |
+
return $this->price;
|
70 |
+
}
|
71 |
+
|
72 |
+
public function getDescription() {
|
73 |
+
return $this->description;
|
74 |
+
}
|
75 |
+
|
76 |
+
public function getChangelogUrl() {
|
77 |
+
return $this->changelogUrl;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function isUpgardeAvailable() {
|
81 |
+
return $this->getVersion() && $this->getLatestVersion() && version_compare($this->getLatestVersion(), $this->getVersion()) === 1;
|
82 |
+
}
|
83 |
+
|
84 |
+
}
|
app/code/community/Modulesgarden/Base/Model/Mage.php
CHANGED
@@ -1,161 +1,123 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**********************************************************************
|
4 |
-
* Customization Services by ModulesGarden.com
|
5 |
-
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
-
* (
|
7 |
-
*
|
8 |
-
*
|
9 |
-
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
-
* CONTACT -> contact@modulesgarden.com
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
14 |
-
*
|
15 |
-
* This software is furnished under a license and may be used and copied
|
16 |
-
* only in accordance with the terms of such license and with the
|
17 |
-
* inclusion of the above copyright notice. This software or any other
|
18 |
-
* copies thereof may not be provided or otherwise made available to any
|
19 |
-
* other person. No title to and ownership of the software is hereby
|
20 |
-
* transferred.
|
21 |
-
*
|
22 |
-
*
|
23 |
-
**********************************************************************/
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @author
|
27 |
-
*/
|
28 |
-
|
29 |
-
class Modulesgarden_Base_Model_Mage {
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
);
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
if (isset(self::$_MD5SUMS_CORE[$customization['magento']['version']])){
|
125 |
-
$md5sumCore = $this->_getMd5Sum(MAGENTO_ROOT.'/app/code/core/Mage');
|
126 |
-
if ($md5sumCore == self::$_MD5SUMS_CORE[$customization['magento']['version']]){
|
127 |
-
$customization['magento']['core'] = 'OK';
|
128 |
-
} else {
|
129 |
-
$customization['magento']['core'] = 'WRONG: ' . $md5sumCore;
|
130 |
-
$customization['ratio'] += self::RATIO_CORE_EDITED;
|
131 |
-
}
|
132 |
-
}
|
133 |
-
// === check whether index.php was edited ===
|
134 |
-
if (isset(self::$_MD5SUMS_CORE_INDEX[$customization['magento']['version']])){
|
135 |
-
$md5sumIndex = $this->_getMd5Sum(MAGENTO_ROOT.'/index.php');
|
136 |
-
if ($md5sumIndex == self::$_MD5SUMS_CORE_INDEX[$customization['magento']['version']]){
|
137 |
-
$customization['magento']['index'] = 'OK';
|
138 |
-
} else {
|
139 |
-
$customization['magento']['index'] = 'WRONG: ' . $md5sumIndex;
|
140 |
-
$customization['ratio'] += self::RATIO_CORE_INDEX_EDITED;
|
141 |
-
}
|
142 |
-
}
|
143 |
-
|
144 |
-
// === check whether magento version is old ===
|
145 |
-
if (!Mage::helper('core')->isModuleEnabled('Enterprise_Enterprise')){
|
146 |
-
if (version_compare(Mage::getVersion(), '1.7.0.2', '<')){
|
147 |
-
$customization['ratio'] += self::RATIO_CORE_OLD_VERSION;
|
148 |
-
}
|
149 |
-
}
|
150 |
-
// @todo checking EE version
|
151 |
-
|
152 |
-
self::$_calculation = $customization;
|
153 |
-
return self::$_calculation;
|
154 |
-
}
|
155 |
-
|
156 |
-
protected function _getMd5Sum($path){
|
157 |
-
$commandReturn = exec('find '.$path.' -type f | xargs cat | md5sum'); // | sort -u
|
158 |
-
return trim(str_replace(' -', '', $commandReturn));
|
159 |
-
}
|
160 |
-
|
161 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2015-11-19, 10:36:28)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
**********************************************************************/
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Marcin Kozak <marcin.ko@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
|
29 |
+
class Modulesgarden_Base_Model_Mage {
|
30 |
+
|
31 |
+
protected $version;
|
32 |
+
protected $edition;
|
33 |
+
protected $index;
|
34 |
+
protected $core;
|
35 |
+
protected $extensions = array();
|
36 |
+
protected $models = array();
|
37 |
+
protected $blocks = array();
|
38 |
+
protected $coreModels = array();
|
39 |
+
|
40 |
+
public function __construct() {
|
41 |
+
$this->version = Mage::getVersion();
|
42 |
+
$this->edition = Mage::helper('core')->isModuleEnabled('Enterprise_Enterprise') ? 'EE' : 'CE';
|
43 |
+
|
44 |
+
$root = Mage::getBaseDir();
|
45 |
+
|
46 |
+
$this->index = $this->getPathMd5Sum($root . '/index.php');
|
47 |
+
$this->core = $this->getPathMd5Sum($root . '/app/code/core/Mage');
|
48 |
+
|
49 |
+
$this->fetchOverwrittenModels();
|
50 |
+
$this->fetchOverwrittenBlocks();
|
51 |
+
$this->fetchExtensions();
|
52 |
+
$this->fetchCoreModels();
|
53 |
+
}
|
54 |
+
|
55 |
+
protected function fetchExtensions() {
|
56 |
+
$extensions = (array) Mage::getConfig()->getNode('modules')->children();
|
57 |
+
|
58 |
+
foreach($extensions as $name => $settings) {
|
59 |
+
if( ! $this->isMageExtension($name) ) {
|
60 |
+
$this->extensions[$name] = (string) $settings->version;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
protected function isMageExtension($name) {
|
66 |
+
return strrpos($name, 'Mage_', -strlen($name)) !== FALSE;
|
67 |
+
}
|
68 |
+
|
69 |
+
protected function fetchOverwrittenModels() {
|
70 |
+
$models = Mage::getConfig()->getNode()->xpath('//global/models//rewrite');
|
71 |
+
|
72 |
+
foreach($models as $model){
|
73 |
+
foreach ($model as $key => $object){
|
74 |
+
$this->models[(string)$key] = (string)$object;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
protected function fetchOverwrittenBlocks() {
|
80 |
+
$blocks = Mage::getConfig()->getNode()->xpath('//global/blocks//rewrite');
|
81 |
+
|
82 |
+
foreach($blocks as $block){
|
83 |
+
foreach ($block as $key => $object){
|
84 |
+
$this->blocks[(string)$key] = (string)$object;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
protected function fetchCoreModels() {
|
90 |
+
$coreModelsNames = array(
|
91 |
+
'catalog/product',
|
92 |
+
'sales/order',
|
93 |
+
'sales/quote',
|
94 |
+
'customer/customer',
|
95 |
+
);
|
96 |
+
|
97 |
+
foreach($coreModelsNames as $coreModelName) {
|
98 |
+
$this->coreModels[$coreModelName] = get_class(Mage::getModel($coreModelName));
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
public function getPathMd5Sum($path) {
|
103 |
+
$command = sprintf('find %s -type f | xargs cat | md5sum', $path);
|
104 |
+
$response = exec($command);
|
105 |
+
|
106 |
+
return trim(str_replace(' -', '', $response));
|
107 |
+
}
|
108 |
+
|
109 |
+
public function toArray() {
|
110 |
+
return array(
|
111 |
+
'version' => $this->version,
|
112 |
+
'edition' => $this->edition,
|
113 |
+
'index_md5_sum' => $this->index,
|
114 |
+
'core_md5_sum' => $this->core,
|
115 |
+
'extensions' => $this->extensions,
|
116 |
+
'core_models' => $this->coreModels,
|
117 |
+
'overwritten' => array(
|
118 |
+
'blocks' => $this->blocks,
|
119 |
+
'models' => $this->models,
|
120 |
+
)
|
121 |
+
);
|
122 |
+
}
|
123 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Modulesgarden/Base/Model/Observer.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-10-30, 13:23:34)
|
@@ -20,93 +20,44 @@
|
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
-
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
28 |
-
|
29 |
class Modulesgarden_Base_Model_Observer {
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
}
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* By Cron
|
49 |
-
*/
|
50 |
-
public function fetchNotifications(){
|
51 |
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
);
|
72 |
-
}
|
73 |
-
|
74 |
-
}
|
75 |
-
}
|
76 |
-
}
|
77 |
-
if (in_array(Modulesgarden_Base_Model_System_Config_Source_Notificationevents::RELEASES, $events)){
|
78 |
-
$extensionsFromStore = Mage::getResourceModel('modulesgardenbase/extension')->getExtensionsObjectsFromModulesgardenCom();
|
79 |
-
foreach ($extensionsFromStore as $extensionFromStore){
|
80 |
-
if ($extensionFromStore->getIsNew()){
|
81 |
-
$msgTitle = $helper->__('New Extension From ModulesGarden: %s', $extensionFromStore->getFriendlyName());
|
82 |
-
|
83 |
-
if (!Modulesgarden_Base_Model_Adminnotification_Inbox::exists($msgTitle)){
|
84 |
-
Mage::getModel('modulesgardenbase/adminnotification_inbox')->addMajor(
|
85 |
-
$msgTitle,
|
86 |
-
$helper->__('Download extension from modulesgarden.com and install it in your magento.'),
|
87 |
-
$extensionFromStore->getChangelogUrl()
|
88 |
-
);
|
89 |
-
}
|
90 |
-
|
91 |
-
}
|
92 |
-
}
|
93 |
-
}
|
94 |
-
if (in_array(Modulesgarden_Base_Model_System_Config_Source_Notificationevents::PROMOTIONS, $events)){
|
95 |
-
$promotions = $client->getActivePromotions();
|
96 |
-
if ($promotions && isset($promotions->data->promotions)){
|
97 |
-
foreach ($promotions->data->promotions as $promo){
|
98 |
-
$msgTitle = $helper->__('New Promotion From ModulesGarden: %s', $promo->notes);
|
99 |
-
|
100 |
-
if (!Modulesgarden_Base_Model_Adminnotification_Inbox::exists($msgTitle)){
|
101 |
-
Mage::getModel('modulesgardenbase/adminnotification_inbox')->addMajor(
|
102 |
-
$msgTitle,
|
103 |
-
$helper->__('Promotion Code: %s', $promo->code),
|
104 |
-
'http://www.modulesgarden.com'
|
105 |
-
);
|
106 |
-
}
|
107 |
-
}
|
108 |
-
}
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
}
|
1 |
<?php
|
2 |
|
3 |
+
/* * ********************************************************************
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-10-30, 13:23:34)
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
+
* ******************************************************************** */
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
|
|
28 |
class Modulesgarden_Base_Model_Observer {
|
29 |
+
|
30 |
+
protected $_mgSections = array(
|
31 |
+
'mgbase_installed_extensions' => 'Installed Extensions',
|
32 |
+
'mgbase_store' => 'Store'
|
33 |
+
);
|
34 |
+
|
35 |
+
public function adminhtml_block_html_before(Varien_Event_Observer $observer) {
|
36 |
+
$block = $observer->getEvent()->getBlock();
|
37 |
+
$section = Mage::app()->getRequest()->getParam('section');
|
38 |
+
|
39 |
+
if ($block instanceof Mage_Adminhtml_Block_System_Config_Edit AND in_array($section, array_keys($this->_mgSections))) {
|
40 |
+
if ($section === 'mgbase_installed_extensions') {
|
41 |
+
$block->unsetChild('save_button');
|
42 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
+
$block->setTitle('<img src="' . Mage::getBaseUrl('skin') . '/adminhtml/base/default/modulesgardenbase/img/mgcommerce-logo.png" style="vertical-align: bottom;" /> ' . $block->__($this->_mgSections[$section]));
|
45 |
+
$block->setHeaderCss('modulesgarden_base_config_header');
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* By Cron
|
51 |
+
*/
|
52 |
+
public function fetchNotifications() {
|
53 |
+
$notificationsCore = new Modulesgarden_Base_Model_Adminnotification_Core;
|
54 |
+
$messages = $notificationsCore->getAll();
|
55 |
+
|
56 |
+
/* @var $message Modulesgarden_Base_Model_Adminnotification_Item */
|
57 |
+
|
58 |
+
foreach($messages as $message) {
|
59 |
+
Mage::getModel('modulesgarden_base/adminnotification_inbox')->addMajor($message->title, $message->description, $message->url);
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
app/code/community/Modulesgarden/Base/Model/Resource/Banner.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-04, 14:37:54)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Model_Resource_Banner extends Mage_Core_Model_Resource_Db_Abstract {
|
29 |
+
|
30 |
+
protected function _construct() {
|
31 |
+
$this->_init('modulesgarden_base/banners', 'banner_id');
|
32 |
+
}
|
33 |
+
|
34 |
+
}
|
app/code/community/Modulesgarden/Base/Model/Resource/Banner/Collection.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-04, 14:40:53)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Model_Resource_Banner_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
29 |
+
|
30 |
+
protected function _construct() {
|
31 |
+
$this->_init('modulesgarden_base/banner');
|
32 |
+
}
|
33 |
+
|
34 |
+
protected function _beforeLoad() {
|
35 |
+
$this->getSelect()
|
36 |
+
->order('sort_order ASC')
|
37 |
+
->join(array(
|
38 |
+
'sl' => Mage::getSingleton('core/resource')->getTableName('modulesgarden_base/sliders')),
|
39 |
+
'main_table.slider_id = sl.slider_id',
|
40 |
+
array());
|
41 |
+
|
42 |
+
return parent::_beforeLoad();
|
43 |
+
}
|
44 |
+
|
45 |
+
}
|
app/code/community/Modulesgarden/Base/Model/Resource/Extension.php
CHANGED
@@ -28,6 +28,51 @@
|
|
28 |
class Modulesgarden_Base_Model_Resource_Extension {
|
29 |
|
30 |
protected static $_remoteResponse;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
public function getModulesgardenCollection() {
|
33 |
return $this->_getCollection(true);
|
@@ -40,12 +85,19 @@ class Modulesgarden_Base_Model_Resource_Extension {
|
|
40 |
public function getNonDefaultCollection() {
|
41 |
return $this->_getCollection(false, false, true);
|
42 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
protected function _getCollection($modulesgardenOnly = null, $nonModulesgardenOnly = null, $skipMage = false) {
|
45 |
$collection = new Varien_Data_Collection();
|
46 |
$modulesArray = (array) Mage::getConfig()->getNode('modules')->children();
|
47 |
foreach ($modulesArray as $module => $moduleDetails) {
|
48 |
-
$ext = Mage::getModel('
|
49 |
$ext->setName($module);
|
50 |
$ext->setActive((string) $moduleDetails->active == 'true');
|
51 |
$ext->setCodePool((string) $moduleDetails->codePool);
|
@@ -105,7 +157,7 @@ class Modulesgarden_Base_Model_Resource_Extension {
|
|
105 |
$extToReturn = array();
|
106 |
$extensions = $this->getExtensionsFromModulesgardenCom();
|
107 |
foreach ($extensions as $remoteExt) {
|
108 |
-
$ext = Mage::getModel('
|
109 |
$ext->setFriendlyName($remoteExt->name);
|
110 |
$this->applyRemoteDetails($ext);
|
111 |
$extToReturn[] = $ext;
|
28 |
class Modulesgarden_Base_Model_Resource_Extension {
|
29 |
|
30 |
protected static $_remoteResponse;
|
31 |
+
protected $otherExtensions = array();
|
32 |
+
protected $mgModules = array();
|
33 |
+
protected $mgThemes = array();
|
34 |
+
|
35 |
+
public function __construct() {
|
36 |
+
$modulesArray = (array) Mage::getConfig()->getNode('modules')->children();
|
37 |
+
|
38 |
+
foreach($modulesArray as $module => $moduleDetails) {
|
39 |
+
if( self::isModulesgardenTheme($module) ) {
|
40 |
+
$type = Modulesgarden_Base_Model_Extension_Modulesgarden_Item::TYPE_THEME;
|
41 |
+
$this->mgThemes[] = new Modulesgarden_Base_Model_Extension_Modulesgarden_Item($type, $module, $moduleDetails->version);
|
42 |
+
}
|
43 |
+
elseif( self::isModulesgardenModule($module) ) {
|
44 |
+
$type = Modulesgarden_Base_Model_Extension_Modulesgarden_Item::TYPE_MODULE;
|
45 |
+
$this->mgModules[] = new Modulesgarden_Base_Model_Extension_Modulesgarden_Item($type, $module, $moduleDetails->version);
|
46 |
+
}
|
47 |
+
elseif( ! self::isMageModule($module) ) {
|
48 |
+
$this->otherExtensions[] = new Modulesgarden_Base_Model_Extension_Item($module, $moduleDetails->version);
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
protected static function isModulesgardenModule($name) {
|
54 |
+
return strpos($name, 'Modulesgarden_') === 0;
|
55 |
+
}
|
56 |
+
|
57 |
+
protected static function isMageModule($name) {
|
58 |
+
return strpos($name, 'Mage_') === 0;
|
59 |
+
}
|
60 |
+
|
61 |
+
protected static function isModulesgardenTheme($name) {
|
62 |
+
return self::isModulesgardenModule($name) AND strpos($name, 'Theme') !== false;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function getModulesgardenExtensions() {
|
66 |
+
return $this->mgModules;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function getModulesgardenThemes() {
|
70 |
+
return $this->mgThemes;
|
71 |
+
}
|
72 |
+
|
73 |
+
public function getOtherExtensions() {
|
74 |
+
return $this->otherExtensions;
|
75 |
+
}
|
76 |
|
77 |
public function getModulesgardenCollection() {
|
78 |
return $this->_getCollection(true);
|
85 |
public function getNonDefaultCollection() {
|
86 |
return $this->_getCollection(false, false, true);
|
87 |
}
|
88 |
+
|
89 |
+
public function getOtherExtensionsCollection() {
|
90 |
+
$collection = new Varien_Data_Collection();
|
91 |
+
$modulesArray = (array) Mage::getConfig()->getNode('modules')->children();
|
92 |
+
|
93 |
+
|
94 |
+
}
|
95 |
|
96 |
protected function _getCollection($modulesgardenOnly = null, $nonModulesgardenOnly = null, $skipMage = false) {
|
97 |
$collection = new Varien_Data_Collection();
|
98 |
$modulesArray = (array) Mage::getConfig()->getNode('modules')->children();
|
99 |
foreach ($modulesArray as $module => $moduleDetails) {
|
100 |
+
$ext = Mage::getModel('modulesgarden_base/extension');
|
101 |
$ext->setName($module);
|
102 |
$ext->setActive((string) $moduleDetails->active == 'true');
|
103 |
$ext->setCodePool((string) $moduleDetails->codePool);
|
157 |
$extToReturn = array();
|
158 |
$extensions = $this->getExtensionsFromModulesgardenCom();
|
159 |
foreach ($extensions as $remoteExt) {
|
160 |
+
$ext = Mage::getModel('modulesgarden_base/extension');
|
161 |
$ext->setFriendlyName($remoteExt->name);
|
162 |
$this->applyRemoteDetails($ext);
|
163 |
$extToReturn[] = $ext;
|
app/code/community/Modulesgarden/Base/Model/Resource/Slider.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-04, 14:37:59)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Model_Resource_Slider extends Mage_Core_Model_Resource_Db_Abstract {
|
29 |
+
|
30 |
+
protected function _construct() {
|
31 |
+
$this->_init('modulesgarden_base/sliders', 'slider_id');
|
32 |
+
}
|
33 |
+
|
34 |
+
}
|
app/code/community/Modulesgarden/Base/Model/Resource/Slider/Collection.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-04, 14:41:02)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Model_Resource_Slider_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
29 |
+
|
30 |
+
protected function _construct() {
|
31 |
+
$this->_init('modulesgarden_base/slider');
|
32 |
+
}
|
33 |
+
|
34 |
+
}
|
app/code/community/Modulesgarden/Base/Model/Slider.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-04, 14:35:13)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Model_Slider extends Mage_Core_Model_Abstract {
|
29 |
+
|
30 |
+
protected function _construct() {
|
31 |
+
$this->_init('modulesgarden_base/slider');
|
32 |
+
}
|
33 |
+
|
34 |
+
public function loadByCode($code) {
|
35 |
+
$coll = $this->getCollection()
|
36 |
+
->addFieldToFilter('code', $code)
|
37 |
+
->load();
|
38 |
+
|
39 |
+
return count($coll) ? $coll->getFirstItem() : $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function isEnabledForCurrentStoreView() {
|
43 |
+
return in_array($this->getStoreViewId(), array(0, Mage::app()->getStore()->getStoreId()));
|
44 |
+
}
|
45 |
+
|
46 |
+
public function getEnabledBanners() {
|
47 |
+
$collection = Mage::getResourceModel('modulesgarden_base/banner_collection')
|
48 |
+
->addFieldToFilter('main_table.enabled', 1)
|
49 |
+
->addFieldToFilter('main_table.slider_id', $this->getSliderId());
|
50 |
+
|
51 |
+
return $collection;
|
52 |
+
}
|
53 |
+
|
54 |
+
}
|
app/code/community/Modulesgarden/Base/Model/System/Config/Source/Notificationevents.php
CHANGED
@@ -27,19 +27,20 @@
|
|
27 |
*/
|
28 |
class Modulesgarden_Base_Model_System_Config_Source_Notificationevents {
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
44 |
|
45 |
}
|
27 |
*/
|
28 |
class Modulesgarden_Base_Model_System_Config_Source_Notificationevents {
|
29 |
|
30 |
+
CONST UPGRADES = 'upgrade';
|
31 |
+
CONST RELEASES = 'release';
|
32 |
+
CONST PROMOTIONS = 'promotions';
|
33 |
+
CONST OTHER = 'other';
|
34 |
+
|
35 |
+
public function toOptionArray() {
|
36 |
+
$helper = Mage::helper('modulesgarden_base');
|
37 |
+
|
38 |
+
return array(
|
39 |
+
array('value' => self::UPGRADES, 'label' => $helper->__('Upgrade Is Ready')),
|
40 |
+
array('value' => self::RELEASES, 'label' => $helper->__('ModulesGarden Release New Extension')),
|
41 |
+
array('value' => self::PROMOTIONS, 'label' => $helper->__('Promotions/Discounts')),
|
42 |
+
array('value' => self::OTHER, 'label' => $helper->__('Other Important Messages')),
|
43 |
+
);
|
44 |
+
}
|
45 |
|
46 |
}
|
app/code/community/Modulesgarden/Base/controllers/Adminhtml/Plugins/BannersController.php
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-05, 10:15:19)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Adminhtml_Plugins_BannersController extends Modulesgarden_Base_Controller_Adminhtml_Sliders {
|
29 |
+
|
30 |
+
public function editAction() {
|
31 |
+
$r = $this->getRequest();
|
32 |
+
|
33 |
+
$banner = Mage::getSingleton('modulesgarden_base/banner');
|
34 |
+
|
35 |
+
if ($r->getParam('id')) {
|
36 |
+
$banner->load($r->getParam('id'));
|
37 |
+
}
|
38 |
+
|
39 |
+
$this->_initAction();
|
40 |
+
$this->renderLayout();
|
41 |
+
}
|
42 |
+
|
43 |
+
public function saveAction() {
|
44 |
+
$r = $this->getRequest();
|
45 |
+
$banner = Mage::getModel('modulesgarden_base/banner');
|
46 |
+
|
47 |
+
if (!$r->getPost('slider_id')) {
|
48 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('It looks like slider id is empty.'));
|
49 |
+
return $this->_redirect('*/plugins_sliders/index');
|
50 |
+
}
|
51 |
+
|
52 |
+
if ($r->getPost('banner_id')) { // edit
|
53 |
+
$banner->load($r->getPost('banner_id'));
|
54 |
+
if ($banner->isEmpty()) {
|
55 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('It looks like banner with id #%d does not exists!', $r->getPost('banner_id')));
|
56 |
+
return $this->_redirect('*/plugins_sliders/index');
|
57 |
+
}
|
58 |
+
} else { // adding
|
59 |
+
}
|
60 |
+
|
61 |
+
if (isset($_FILES['filename']['name']) && (file_exists($_FILES['filename']['tmp_name']))) {
|
62 |
+
try {
|
63 |
+
$uploader = new Varien_File_Uploader('filename');
|
64 |
+
$uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
|
65 |
+
$uploader->setAllowRenameFiles(false);
|
66 |
+
$uploader->setFilesDispersion(false);
|
67 |
+
$uploader->save(Mage::getBaseDir('media') . DS . 'modulesgarden_base_sliders' . DS, $_FILES['filename']['name']);
|
68 |
+
|
69 |
+
$banner->setFilename($_FILES['filename']['name']);
|
70 |
+
} catch (Exception $e) {
|
71 |
+
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
try {
|
76 |
+
$banner->setSliderId($r->getPost('slider_id'));
|
77 |
+
$banner->setTitle($r->getPost('title'));
|
78 |
+
$banner->setDescription($r->getPost('description'));
|
79 |
+
$banner->setEnabled($r->getPost('enabled'));
|
80 |
+
$banner->setUrlTitle($r->getPost('url_title'));
|
81 |
+
$banner->setUrl($r->getPost('url'));
|
82 |
+
$banner->setSortOrder($r->getPost('sort_order'));
|
83 |
+
|
84 |
+
$banner->save();
|
85 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Banner has been saved.'));
|
86 |
+
} catch (Exception $e) {
|
87 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Banner has not been saved. ' . $e->getMessage()));
|
88 |
+
}
|
89 |
+
|
90 |
+
if( $r->getParam('back') ) {
|
91 |
+
return $this->_redirect('*/*/edit', array(
|
92 |
+
'id' => $banner->getId(),
|
93 |
+
'slider_id' => $r->getPost('slider_id'),
|
94 |
+
));
|
95 |
+
}
|
96 |
+
else {
|
97 |
+
return $this->_redirect('*/plugins_sliders/edit', array('id' => $r->getPost('slider_id')));
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
public function deleteAction() {
|
102 |
+
$id = $this->getRequest()->getParam('id');
|
103 |
+
if ($id) {
|
104 |
+
$banner = Mage::getModel('modulesgarden_base/banner')->load($id);
|
105 |
+
if ($banner->delete()) {
|
106 |
+
Mage::getSingleton('core/session')->addSuccess($this->__('Banner has been deleted.'));
|
107 |
+
$slider_id = $banner->getSliderId();
|
108 |
+
}
|
109 |
+
}
|
110 |
+
return $this->_redirect('*/plugins_sliders/edit', array(
|
111 |
+
'id' => isset($slider_id) ? $slider_id : null
|
112 |
+
));
|
113 |
+
}
|
114 |
+
|
115 |
+
}
|
app/code/community/Modulesgarden/Base/controllers/Adminhtml/Plugins/SlidersController.php
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-04, 15:10:09)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
class Modulesgarden_Base_Adminhtml_Plugins_SlidersController extends Modulesgarden_Base_Controller_Adminhtml_Sliders {
|
29 |
+
|
30 |
+
public function indexAction() {
|
31 |
+
$this->_initAction();
|
32 |
+
$this->renderLayout();
|
33 |
+
}
|
34 |
+
|
35 |
+
public function editAction() {
|
36 |
+
$this->_initAction();
|
37 |
+
$r = $this->getRequest();
|
38 |
+
|
39 |
+
$slider = Mage::getSingleton('modulesgarden_base/slider');
|
40 |
+
if ($r->getParam('id')) {
|
41 |
+
$slider->load($r->getParam('id'));
|
42 |
+
}
|
43 |
+
|
44 |
+
$this->renderLayout();
|
45 |
+
}
|
46 |
+
|
47 |
+
public function saveAction() {
|
48 |
+
$r = $this->getRequest();
|
49 |
+
$slider = Mage::getModel('modulesgarden_base/slider');
|
50 |
+
|
51 |
+
|
52 |
+
if ($r->getPost('slider_id')) { // edit
|
53 |
+
$slider->load($r->getPost('slider_id'));
|
54 |
+
if ($slider->isEmpty()) {
|
55 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('It looks like slider with id #%d does not exists!', $r->getPost('slider_id')));
|
56 |
+
return $this->_redirect('*/*/index');
|
57 |
+
}
|
58 |
+
} else { // adding
|
59 |
+
}
|
60 |
+
|
61 |
+
try {
|
62 |
+
$slider->setStoreViewId($r->getPost('store_view_id'));
|
63 |
+
$slider->setCode($r->getPost('code'));
|
64 |
+
$slider->setTitle($r->getPost('title'));
|
65 |
+
$slider->setEnabled($r->getPost('enabled'));
|
66 |
+
|
67 |
+
$slider->save();
|
68 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Slider has been saved.'));
|
69 |
+
} catch (Exception $e) {
|
70 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Slider has not been saved. Code is not unique probably.'));
|
71 |
+
}
|
72 |
+
|
73 |
+
if( $r->getParam('back') ) {
|
74 |
+
return $this->_redirect('*/*/edit', array(
|
75 |
+
'id' => $slider->getId(),
|
76 |
+
));
|
77 |
+
}
|
78 |
+
else {
|
79 |
+
return $this->_redirect('*/*/index');
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
public function deleteAction() {
|
84 |
+
$slider_id = $this->getRequest()->getParam('id');
|
85 |
+
$slider = $slider = Mage::getModel('modulesgarden_base/slider')
|
86 |
+
->load($slider_id);
|
87 |
+
|
88 |
+
$slider->delete();
|
89 |
+
|
90 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Slider has been deleted.'));
|
91 |
+
return $this->_redirect('*/*/index');
|
92 |
+
}
|
93 |
+
|
94 |
+
}
|
app/code/community/Modulesgarden/Base/etc/adminhtml.xml
CHANGED
@@ -1,25 +1,63 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<config>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
</config>
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<config>
|
3 |
+
<menu>
|
4 |
+
<modulesgarden_base translate="title" module="modulesgarden_base">
|
5 |
+
<sort_order>4000</sort_order>
|
6 |
+
<title>ModulesGarden Base</title>
|
7 |
+
<children>
|
8 |
+
<installed_extensions module="modulesgarden_base">
|
9 |
+
<sort_order>0</sort_order>
|
10 |
+
<title>Installed Extensions</title>
|
11 |
+
<action>adminhtml/system_config/edit/section/mgbase_installed_extensions</action>
|
12 |
+
</installed_extensions>
|
13 |
+
<installed_store module="modulesgarden_base">
|
14 |
+
<sort_order>1</sort_order>
|
15 |
+
<title>Store</title>
|
16 |
+
<action>adminhtml/system_config/edit/section/mgbase_store</action>
|
17 |
+
</installed_store>
|
18 |
+
<plugins module="modulesgarden_base">
|
19 |
+
<sort_order>2</sort_order>
|
20 |
+
<title>Plugins</title>
|
21 |
+
<children>
|
22 |
+
<sliders module="modulesgarden_base">
|
23 |
+
<sort_order>0</sort_order>
|
24 |
+
<title>Sliders</title>
|
25 |
+
<action>adminhtml/plugins_sliders</action>
|
26 |
+
</sliders>
|
27 |
+
</children>
|
28 |
+
</plugins>
|
29 |
+
</children>
|
30 |
+
</modulesgarden_base>
|
31 |
+
</menu>
|
32 |
+
<acl>
|
33 |
+
<resources>
|
34 |
+
<admin>
|
35 |
+
<children>
|
36 |
+
<system>
|
37 |
+
<children>
|
38 |
+
<config>
|
39 |
+
<children>
|
40 |
+
<mgbase_installed_extensions>
|
41 |
+
<title>Modulesgarden Base - Installed Extensions</title>
|
42 |
+
</mgbase_installed_extensions>
|
43 |
+
<mgbase_store>
|
44 |
+
<title>Modulesgarden Base - Store</title>
|
45 |
+
</mgbase_store>
|
46 |
+
</children>
|
47 |
+
</config>
|
48 |
+
</children>
|
49 |
+
</system>
|
50 |
+
<modulesgarden_base>
|
51 |
+
<title>Modulesgarden Base Plugins</title>
|
52 |
+
<sort_order>1500</sort_order>
|
53 |
+
<children>
|
54 |
+
<sliders translate="title">
|
55 |
+
<title>Sliders</title>
|
56 |
+
</sliders>
|
57 |
+
</children>
|
58 |
+
</modulesgarden_base>
|
59 |
+
</children>
|
60 |
+
</admin>
|
61 |
+
</resources>
|
62 |
+
</acl>
|
63 |
</config>
|
app/code/community/Modulesgarden/Base/etc/config.xml
CHANGED
@@ -1,90 +1,119 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<config>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
</config>
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<config>
|
3 |
+
<modules>
|
4 |
+
<Modulesgarden_Base>
|
5 |
+
<version>1.1.0</version>
|
6 |
+
</Modulesgarden_Base>
|
7 |
+
</modules>
|
8 |
+
<adminhtml>
|
9 |
+
<translate>
|
10 |
+
<modules>
|
11 |
+
<modulesgarden_base>
|
12 |
+
<files>
|
13 |
+
<default>Modulesgarden_Base.csv</default>
|
14 |
+
</files>
|
15 |
+
</modulesgarden_base>
|
16 |
+
</modules>
|
17 |
+
</translate>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<modulesgarden_base>
|
21 |
+
<file>modulesgardenbase.xml</file>
|
22 |
+
</modulesgarden_base>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
<events>
|
26 |
+
<adminhtml_block_html_before>
|
27 |
+
<observers>
|
28 |
+
<modulesgarden_base_config>
|
29 |
+
<class>modulesgarden_base/observer</class>
|
30 |
+
<method>adminhtml_block_html_before</method>
|
31 |
+
<type>model</type>
|
32 |
+
</modulesgarden_base_config>
|
33 |
+
</observers>
|
34 |
+
</adminhtml_block_html_before>
|
35 |
+
</events>
|
36 |
+
</adminhtml>
|
37 |
+
<admin>
|
38 |
+
<routers>
|
39 |
+
<adminhtml>
|
40 |
+
<args>
|
41 |
+
<modules>
|
42 |
+
<modulesgarden_base before="Mage_Adminhtml">Modulesgarden_Base_Adminhtml</modulesgarden_base>
|
43 |
+
</modules>
|
44 |
+
</args>
|
45 |
+
</adminhtml>
|
46 |
+
</routers>
|
47 |
+
</admin>
|
48 |
+
<global>
|
49 |
+
<blocks>
|
50 |
+
<modulesgarden_base>
|
51 |
+
<class>Modulesgarden_Base_Block</class>
|
52 |
+
</modulesgarden_base>
|
53 |
+
</blocks>
|
54 |
+
<models>
|
55 |
+
<modulesgarden_base>
|
56 |
+
<class>Modulesgarden_Base_Model</class>
|
57 |
+
<resourceModel>modulesgarden_base_resource</resourceModel>
|
58 |
+
</modulesgarden_base>
|
59 |
+
<modulesgarden_base_resource>
|
60 |
+
<class>Modulesgarden_Base_Model_Resource</class>
|
61 |
+
<entities>
|
62 |
+
<sliders>
|
63 |
+
<table>modulesgarden_base_sliders</table>
|
64 |
+
</sliders>
|
65 |
+
<banners>
|
66 |
+
<table>modulesgarden_base_banners</table>
|
67 |
+
</banners>
|
68 |
+
</entities>
|
69 |
+
</modulesgarden_base_resource>
|
70 |
+
</models>
|
71 |
+
<helpers>
|
72 |
+
<modulesgarden_base>
|
73 |
+
<class>Modulesgarden_Base_Helper</class>
|
74 |
+
</modulesgarden_base>
|
75 |
+
</helpers>
|
76 |
+
<resources>
|
77 |
+
<modulesgardenbase_setup>
|
78 |
+
<setup>
|
79 |
+
<module>Modulesgarden_Base</module>
|
80 |
+
</setup>
|
81 |
+
</modulesgardenbase_setup>
|
82 |
+
</resources>
|
83 |
+
</global>
|
84 |
+
<default>
|
85 |
+
<modulesgarden_base>
|
86 |
+
<notifications>
|
87 |
+
<create_system_notification>upgrade,release,promotion,other</create_system_notification>
|
88 |
+
</notifications>
|
89 |
+
<cache>
|
90 |
+
<latest_module_version>43200</latest_module_version> <!-- 12 hours -->
|
91 |
+
<register_module_instance>43200</register_module_instance> <!-- 12 hours -->
|
92 |
+
<available_products>3600</available_products> <!-- 1 hour -->
|
93 |
+
<active_promotions>3600</active_promotions> <!-- 1 hour -->
|
94 |
+
</cache>
|
95 |
+
<urls>
|
96 |
+
<company><![CDATA[http://modulesgarden.com]]></company>
|
97 |
+
<store><![CDATA[https://modulesgarden.com/manage/modules/addons/ModuleInformation/server.php]]></store>
|
98 |
+
<check><![CDATA[https://modulesgarden.com/manage/magento_base/information.php]]></check>
|
99 |
+
</urls>
|
100 |
+
<twitter>
|
101 |
+
<url><![CDATA[https://twitter.com/search?q=%23Magento%20AND%20from%3A%40ModulesGarden]]></url>
|
102 |
+
<limit>5</limit>
|
103 |
+
<id>532534423783079936</id>
|
104 |
+
</twitter>
|
105 |
+
</modulesgarden_base>
|
106 |
+
</default>
|
107 |
+
<crontab>
|
108 |
+
<jobs>
|
109 |
+
<modulesgarden_base_notifications>
|
110 |
+
<schedule>
|
111 |
+
<cron_expr>0 6 * * *</cron_expr><!-- 6:00 AM -->
|
112 |
+
</schedule>
|
113 |
+
<run>
|
114 |
+
<model>modulesgarden_base/observer::fetchNotifications</model>
|
115 |
+
</run>
|
116 |
+
</modulesgarden_base_notifications>
|
117 |
+
</jobs>
|
118 |
+
</crontab>
|
119 |
</config>
|
app/code/community/Modulesgarden/Base/etc/system.xml
CHANGED
@@ -17,28 +17,28 @@
|
|
17 |
<show_in_store>1</show_in_store>
|
18 |
<groups>
|
19 |
<modulesgarden>
|
20 |
-
<frontend_model>
|
21 |
<sort_order>5</sort_order>
|
22 |
<show_in_default>1</show_in_default>
|
23 |
<show_in_website>1</show_in_website>
|
24 |
<show_in_store>1</show_in_store>
|
25 |
</modulesgarden>
|
26 |
<modulesgardenthemes>
|
27 |
-
<frontend_model>
|
28 |
<sort_order>5</sort_order>
|
29 |
<show_in_default>1</show_in_default>
|
30 |
<show_in_website>1</show_in_website>
|
31 |
<show_in_store>1</show_in_store>
|
32 |
</modulesgardenthemes>
|
33 |
<others>
|
34 |
-
<frontend_model>
|
35 |
<sort_order>10</sort_order>
|
36 |
<show_in_default>1</show_in_default>
|
37 |
<show_in_website>1</show_in_website>
|
38 |
<show_in_store>1</show_in_store>
|
39 |
</others>
|
40 |
<customization_ratio>
|
41 |
-
<frontend_model>
|
42 |
<sort_order>15</sort_order>
|
43 |
<show_in_default>1</show_in_default>
|
44 |
<show_in_website>1</show_in_website>
|
@@ -46,6 +46,7 @@
|
|
46 |
</customization_ratio>
|
47 |
</groups>
|
48 |
</mgbase_installed_extensions>
|
|
|
49 |
<mgbase_store translate="label">
|
50 |
<class>separator-top</class>
|
51 |
<label><![CDATA[Store & Notifications]]></label>
|
@@ -56,7 +57,7 @@
|
|
56 |
<show_in_store>1</show_in_store>
|
57 |
<groups>
|
58 |
<store>
|
59 |
-
<frontend_model>
|
60 |
<sort_order>5</sort_order>
|
61 |
<show_in_default>1</show_in_default>
|
62 |
<show_in_website>1</show_in_website>
|
@@ -64,7 +65,7 @@
|
|
64 |
</store>
|
65 |
<notifications translate="label">
|
66 |
<label>Notifications Management</label>
|
67 |
-
<frontend_model>
|
68 |
<sort_order>10</sort_order>
|
69 |
<show_in_default>1</show_in_default>
|
70 |
<show_in_website>0</show_in_website>
|
@@ -73,7 +74,7 @@
|
|
73 |
<events translate="label">
|
74 |
<label>Add System Notification When</label>
|
75 |
<frontend_type>multiselect</frontend_type>
|
76 |
-
<source_model>
|
77 |
<sort_order>1</sort_order>
|
78 |
<show_in_default>1</show_in_default>
|
79 |
<show_in_website>0</show_in_website>
|
@@ -83,7 +84,7 @@
|
|
83 |
</fields>
|
84 |
</notifications>
|
85 |
<twitter>
|
86 |
-
<frontend_model>
|
87 |
<sort_order>15</sort_order>
|
88 |
<show_in_default>1</show_in_default>
|
89 |
<show_in_website>1</show_in_website>
|
17 |
<show_in_store>1</show_in_store>
|
18 |
<groups>
|
19 |
<modulesgarden>
|
20 |
+
<frontend_model>modulesgarden_base/adminhtml_system_config_form_fieldset_installedmodulesgarden</frontend_model>
|
21 |
<sort_order>5</sort_order>
|
22 |
<show_in_default>1</show_in_default>
|
23 |
<show_in_website>1</show_in_website>
|
24 |
<show_in_store>1</show_in_store>
|
25 |
</modulesgarden>
|
26 |
<modulesgardenthemes>
|
27 |
+
<frontend_model>modulesgarden_base/adminhtml_system_config_form_fieldset_installedmodulesgardenthemes</frontend_model>
|
28 |
<sort_order>5</sort_order>
|
29 |
<show_in_default>1</show_in_default>
|
30 |
<show_in_website>1</show_in_website>
|
31 |
<show_in_store>1</show_in_store>
|
32 |
</modulesgardenthemes>
|
33 |
<others>
|
34 |
+
<frontend_model>modulesgarden_base/adminhtml_system_config_form_fieldset_installedothers</frontend_model>
|
35 |
<sort_order>10</sort_order>
|
36 |
<show_in_default>1</show_in_default>
|
37 |
<show_in_website>1</show_in_website>
|
38 |
<show_in_store>1</show_in_store>
|
39 |
</others>
|
40 |
<customization_ratio>
|
41 |
+
<frontend_model>modulesgarden_base/adminhtml_system_config_form_fieldset_installedratio</frontend_model>
|
42 |
<sort_order>15</sort_order>
|
43 |
<show_in_default>1</show_in_default>
|
44 |
<show_in_website>1</show_in_website>
|
46 |
</customization_ratio>
|
47 |
</groups>
|
48 |
</mgbase_installed_extensions>
|
49 |
+
|
50 |
<mgbase_store translate="label">
|
51 |
<class>separator-top</class>
|
52 |
<label><![CDATA[Store & Notifications]]></label>
|
57 |
<show_in_store>1</show_in_store>
|
58 |
<groups>
|
59 |
<store>
|
60 |
+
<frontend_model>modulesgarden_base/adminhtml_system_config_form_fieldset_store</frontend_model>
|
61 |
<sort_order>5</sort_order>
|
62 |
<show_in_default>1</show_in_default>
|
63 |
<show_in_website>1</show_in_website>
|
65 |
</store>
|
66 |
<notifications translate="label">
|
67 |
<label>Notifications Management</label>
|
68 |
+
<frontend_model>modulesgarden_base/adminhtml_system_config_form_fieldset_modulesgarden</frontend_model>
|
69 |
<sort_order>10</sort_order>
|
70 |
<show_in_default>1</show_in_default>
|
71 |
<show_in_website>0</show_in_website>
|
74 |
<events translate="label">
|
75 |
<label>Add System Notification When</label>
|
76 |
<frontend_type>multiselect</frontend_type>
|
77 |
+
<source_model>modulesgarden_base/system_config_source_notificationevents</source_model>
|
78 |
<sort_order>1</sort_order>
|
79 |
<show_in_default>1</show_in_default>
|
80 |
<show_in_website>0</show_in_website>
|
84 |
</fields>
|
85 |
</notifications>
|
86 |
<twitter>
|
87 |
+
<frontend_model>modulesgarden_base/adminhtml_system_config_form_fieldset_twitter</frontend_model>
|
88 |
<sort_order>15</sort_order>
|
89 |
<show_in_default>1</show_in_default>
|
90 |
<show_in_website>1</show_in_website>
|
app/code/community/Modulesgarden/Base/sql/modulesgardenbase_setup/upgrade-1.0.0-1.1.0.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* * ********************************************************************
|
4 |
+
* Customization Services by ModulesGarden.com
|
5 |
+
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
+
* (2014-08-07, 12:00:53)
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* CREATED BY MODULESGARDEN -> http://modulesgarden.com
|
10 |
+
* CONTACT -> contact@modulesgarden.com
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* This software is furnished under a license and may be used and copied
|
16 |
+
* only in accordance with the terms of such license and with the
|
17 |
+
* inclusion of the above copyright notice. This software or any other
|
18 |
+
* copies thereof may not be provided or otherwise made available to any
|
19 |
+
* other person. No title to and ownership of the software is hereby
|
20 |
+
* transferred.
|
21 |
+
*
|
22 |
+
*
|
23 |
+
* ******************************************************************** */
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
+
*/
|
28 |
+
|
29 |
+
$installer = $this;
|
30 |
+
$installer->startSetup();
|
31 |
+
|
32 |
+
$installer->run("
|
33 |
+
|
34 |
+
CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('modulesgarden_base/sliders')."` (
|
35 |
+
`slider_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
36 |
+
`store_view_id` int(10) unsigned NOT NULL,
|
37 |
+
`code` varchar(100) NOT NULL,
|
38 |
+
`title` varchar(250) NOT NULL,
|
39 |
+
`enabled` tinyint(1) unsigned NOT NULL,
|
40 |
+
PRIMARY KEY (`slider_id`)
|
41 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
42 |
+
|
43 |
+
CREATE TABLE IF NOT EXISTS `".Mage::getSingleton('core/resource')->getTableName('modulesgarden_base/banners')."` (
|
44 |
+
`banner_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
45 |
+
`slider_id` int(10) unsigned NOT NULL,
|
46 |
+
`sort_order` int(10) unsigned NOT NULL DEFAULT '1',
|
47 |
+
`title` varchar(250) NOT NULL,
|
48 |
+
`description` text,
|
49 |
+
`url_title` varchar(250) DEFAULT NULL,
|
50 |
+
`url` varchar(250) DEFAULT NULL,
|
51 |
+
`filename` varchar(250) DEFAULT NULL,
|
52 |
+
`enabled` tinyint(3) unsigned NOT NULL,
|
53 |
+
PRIMARY KEY (`banner_id`)
|
54 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
55 |
+
|
56 |
+
");
|
57 |
+
|
58 |
+
@mkdir(Mage::getBaseDir('media') . DS . 'modulesgarden_base_sliders', 0777);
|
59 |
+
|
60 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/modulesgardenbase.xml
CHANGED
@@ -1,10 +1,43 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<layout>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
</layout>
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<layout>
|
3 |
+
<adminhtml_system_config_edit>
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addCss">
|
6 |
+
<name>modulesgardenbase/css/modulesgarden.css</name>
|
7 |
+
</action>
|
8 |
+
</reference>
|
9 |
+
</adminhtml_system_config_edit>
|
10 |
+
|
11 |
+
<adminhtml_plugins_sliders_index>
|
12 |
+
<reference name="head">
|
13 |
+
<action method="setTitle">
|
14 |
+
<title>Sliders / Plugins / ModulesGarden Base / Magento Admin</title>
|
15 |
+
</action>
|
16 |
+
</reference>
|
17 |
+
<reference name="content">
|
18 |
+
<block type="modulesgarden_base/adminhtml_plugins_sliders" name="modulesgarden_base_adminhtml_plugins_sliders" />
|
19 |
+
</reference>
|
20 |
+
</adminhtml_plugins_sliders_index>
|
21 |
+
|
22 |
+
<adminhtml_plugins_sliders_edit>
|
23 |
+
<reference name="head">
|
24 |
+
<action method="setTitle">
|
25 |
+
<title>Slider Details / Plugins / ModulesGarden Base / Magento Admin</title>
|
26 |
+
</action>
|
27 |
+
</reference>
|
28 |
+
<reference name="left">
|
29 |
+
<block type="modulesgarden_base/adminhtml_plugins_sliders_tabs" name="modulesgarden_base_adminhtml_plugins_sliders_tabs" />
|
30 |
+
</reference>
|
31 |
+
</adminhtml_plugins_sliders_edit>
|
32 |
+
|
33 |
+
<adminhtml_plugins_banners_edit>
|
34 |
+
<reference name="head">
|
35 |
+
<action method="setTitle">
|
36 |
+
<title>Banner Details / Slider Details / Plugins / ModulesGarden Base / Magento Admin</title>
|
37 |
+
</action>
|
38 |
+
</reference>
|
39 |
+
<reference name="content">
|
40 |
+
<block type="modulesgarden_base/adminhtml_plugins_banners_edit" name="modulesgarden_base_adminhtml_plugins_banners_edit" />
|
41 |
+
</reference>
|
42 |
+
</adminhtml_plugins_banners_edit>
|
43 |
</layout>
|
app/design/adminhtml/default/default/template/modulesgardenbase/system/config/form/fieldset/installedmodulesgarden.phtml
CHANGED
@@ -41,30 +41,28 @@
|
|
41 |
</thead>
|
42 |
<tbody>
|
43 |
<?php foreach ($this->getExtensions() as $k => $extension): ?>
|
44 |
-
<?php
|
45 |
-
<
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
<?php if ($extension->isUpgardeAvailable()){ ?>
|
50 |
<strong style="padding-left: 10px;">
|
51 |
<?php echo $this->__('Upgrade Available!'); ?>
|
52 |
<a href="<?php echo $extension->getChangelogUrl(); ?>" target="_blank"><?php echo $extension->getLatestVersion(); ?></a>
|
53 |
</strong>
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
<a href="<?php echo $extension->getWikiUrl(); ?>" target="_blank"><?php echo $this->__('Documentation'); ?></a>
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
<a href="<?php echo $extension->getChangelogUrl(); ?>" target="_blank"><?php echo $this->__('Changelog'); ?></a>
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
<?php endif ?>
|
68 |
<?php endforeach ?>
|
69 |
</tbody>
|
70 |
</table>
|
41 |
</thead>
|
42 |
<tbody>
|
43 |
<?php foreach ($this->getExtensions() as $k => $extension): ?>
|
44 |
+
<tr class="<?php echo $k % 2 == 0 ? 'even' : ''; ?>">
|
45 |
+
<td class="a-left"><?php echo $extension->getFriendlyName(); ?></td>
|
46 |
+
<td class="a-left">
|
47 |
+
<?php echo $extension->getVersion(); ?>
|
48 |
+
<?php if ($extension->isUpgardeAvailable()) { ?>
|
|
|
49 |
<strong style="padding-left: 10px;">
|
50 |
<?php echo $this->__('Upgrade Available!'); ?>
|
51 |
<a href="<?php echo $extension->getChangelogUrl(); ?>" target="_blank"><?php echo $extension->getLatestVersion(); ?></a>
|
52 |
</strong>
|
53 |
+
<?php } ?>
|
54 |
+
</td>
|
55 |
+
<td class="a-center">
|
56 |
+
<?php if ($extension->getWikiUrl()) { ?>
|
57 |
<a href="<?php echo $extension->getWikiUrl(); ?>" target="_blank"><?php echo $this->__('Documentation'); ?></a>
|
58 |
+
<?php } ?>
|
59 |
+
</td>
|
60 |
+
<td class="a-center last">
|
61 |
+
<?php if ($extension->getChangelogUrl()) { ?>
|
62 |
<a href="<?php echo $extension->getChangelogUrl(); ?>" target="_blank"><?php echo $this->__('Changelog'); ?></a>
|
63 |
+
<?php } ?>
|
64 |
+
</td>
|
65 |
+
</tr>
|
|
|
66 |
<?php endforeach ?>
|
67 |
</tbody>
|
68 |
</table>
|
app/design/adminhtml/default/default/template/modulesgardenbase/system/config/form/fieldset/installedmodulesgardenthemes.phtml
CHANGED
@@ -49,9 +49,8 @@
|
|
49 |
</tr>
|
50 |
</thead>
|
51 |
<tbody>
|
52 |
-
<?php $
|
53 |
-
|
54 |
-
<?php if($extension->isModulesgardenTheme()): $themesCount++; ?>
|
55 |
<tr class="<?php echo $k%2==0 ? 'even' : ''; ?>">
|
56 |
<td class="a-left"><?php echo $extension->getFriendlyName(); ?></td>
|
57 |
<td class="a-left">
|
@@ -74,13 +73,11 @@
|
|
74 |
<?php } ?>
|
75 |
</td>
|
76 |
</tr>
|
77 |
-
<?php
|
78 |
-
<?php
|
79 |
-
|
80 |
-
<?php if($themesCount === 0): ?>
|
81 |
<tr>
|
82 |
<td colspan="4">
|
83 |
-
<?php echo $this->__('
|
84 |
</td>
|
85 |
</tr>
|
86 |
<?php endif ?>
|
49 |
</tr>
|
50 |
</thead>
|
51 |
<tbody>
|
52 |
+
<?php if( count($this->getExtensions()) ): ?>
|
53 |
+
<?php foreach ($this->getExtensions() as $k => $extension): ?>
|
|
|
54 |
<tr class="<?php echo $k%2==0 ? 'even' : ''; ?>">
|
55 |
<td class="a-left"><?php echo $extension->getFriendlyName(); ?></td>
|
56 |
<td class="a-left">
|
73 |
<?php } ?>
|
74 |
</td>
|
75 |
</tr>
|
76 |
+
<?php endforeach ?>
|
77 |
+
<?php else: ?>
|
|
|
|
|
78 |
<tr>
|
79 |
<td colspan="4">
|
80 |
+
<?php echo $this->__('You do not have any installed themes of ModulesGarden') ?>
|
81 |
</td>
|
82 |
</tr>
|
83 |
<?php endif ?>
|
app/design/adminhtml/default/default/template/modulesgardenbase/system/config/form/fieldset/installedothers.phtml
CHANGED
@@ -27,31 +27,31 @@
|
|
27 |
?>
|
28 |
|
29 |
<div class="modulesgarden_form_container">
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
</div>
|
34 |
|
35 |
<div class="modulesgarden_grid_container">
|
36 |
<div class="grid">
|
37 |
-
|
38 |
-
|
39 |
<thead>
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
</div>
|
57 |
|
27 |
?>
|
28 |
|
29 |
<div class="modulesgarden_form_container">
|
30 |
+
<div class="content-header skip-header">
|
31 |
+
<h3 class="modulesgardenbase_config_header"><?php echo $this->__('Other Modules'); ?></h3>
|
32 |
+
</div>
|
33 |
</div>
|
34 |
|
35 |
<div class="modulesgarden_grid_container">
|
36 |
<div class="grid">
|
37 |
+
<div class="hor-scroll">
|
38 |
+
<table cellspacing="0" class="data">
|
39 |
<thead>
|
40 |
+
<tr class="headings">
|
41 |
+
<th class=" no-link" style="width:50%;"><span class="nobr"><?php echo $this->__('Extension Name'); ?></span></th>
|
42 |
+
<th class=" no-link"><span class="nobr"><?php echo $this->__('Your Version'); ?></span></th>
|
43 |
+
</tr>
|
44 |
+
</thead>
|
45 |
+
<tbody>
|
46 |
+
<?php foreach ($this->getExtensions() as $k => $extension) { ?>
|
47 |
+
<tr class="<?php echo $k % 2 == 0 ? 'even' : ''; ?>">
|
48 |
+
<td class="a-left"><?php echo $extension->getName(); ?></td>
|
49 |
+
<td class="a-left last"><?php echo $extension->getVersion(); ?></td>
|
50 |
+
</tr>
|
51 |
+
<?php } ?>
|
52 |
+
</tbody>
|
53 |
+
</table>
|
54 |
+
</div>
|
55 |
+
</div>
|
56 |
</div>
|
57 |
|
app/design/adminhtml/default/default/template/modulesgardenbase/system/config/form/fieldset/installedratio.phtml
CHANGED
@@ -24,50 +24,56 @@
|
|
24 |
/**
|
25 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
26 |
*/
|
|
|
|
|
27 |
?>
|
28 |
|
29 |
<div class="modulesgarden_form_container">
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
<div style="line-height:25px;">
|
40 |
-
<?php echo $this->__('Your Ratio Is:'); ?>
|
41 |
-
<strong><?php echo $this->getRatio(); ?></strong> (<strong><?php echo $this->getRatioLabel(); ?></strong>)
|
42 |
-
<div class="field-tooltip"><div><?php echo $this->__('These ratio is used by ModulesGarden for quotation of a Custom Projects. It tells us how much your system is non-standard.'); ?></div></div>
|
43 |
-
<br/>
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
<div id="mg_debug_info" style="display:none;background-color: #eee;padding: 5px;margin-top:10px;">
|
52 |
-
<pre><?php echo $this->getDebugString(); ?></pre>
|
53 |
-
</div>
|
54 |
-
</div>
|
55 |
-
</div>
|
56 |
</div>
|
57 |
|
58 |
<script type="text/javascript">
|
59 |
-
function showMgDebugInfo(){
|
60 |
-
|
61 |
document.getElementById("mg_hide_debug_info").style.display = 'inline-block';
|
62 |
-
|
63 |
-
|
64 |
return false;
|
65 |
-
}
|
66 |
-
function hideMgDebugInfo(){
|
67 |
-
|
68 |
document.getElementById("mg_show_debug_info").style.display = 'inline-block';
|
69 |
-
|
70 |
-
|
71 |
return false;
|
72 |
-
}
|
73 |
</script>
|
24 |
/**
|
25 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
26 |
*/
|
27 |
+
|
28 |
+
/* @var $this Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Installedratio */
|
29 |
?>
|
30 |
|
31 |
<div class="modulesgarden_form_container">
|
32 |
+
<div class="content-header skip-header">
|
33 |
+
<h3 class="modulesgardenbase_config_header"><?php echo $this->__('Customization Ratio'); ?></h3>
|
34 |
+
</div>
|
35 |
+
|
36 |
+
<div class="entry-edit">
|
37 |
+
<div class="entry-edit-head">
|
38 |
+
<h4 class="icon-head head-edit-form fieldset-legend"> </h4>
|
39 |
+
</div>
|
40 |
+
<div class="fieldset ">
|
41 |
+
<?php if($this->hasError()): ?>
|
42 |
+
<p><?php echo $this->getErrorMessage() ?></p>
|
43 |
+
<?php else: ?>
|
44 |
+
<div style="line-height:25px;">
|
45 |
+
<?php echo $this->__('Your Ratio Is:'); ?>
|
46 |
+
<strong><?php echo $this->getRatio(); ?></strong> (<strong><?php echo $this->getRatioLabel(); ?></strong>)
|
47 |
+
<div class="field-tooltip"><div><?php echo $this->__('These ratio is used by ModulesGarden for quotation of a Custom Projects. It tells us how much your system is non-standard.'); ?></div></div>
|
48 |
+
<br/>
|
49 |
|
50 |
+
<?php echo $this->__('Debug Details:'); ?>
|
51 |
+
<button onclick="return showMgDebugInfo();" id="mg_show_debug_info"><?php echo $this->__('Show'); ?></button>
|
52 |
+
<button onclick="return hideMgDebugInfo();" id="mg_hide_debug_info" style="display:none"><?php echo $this->__('Hide'); ?></button>
|
53 |
+
<div class="field-tooltip"><div><?php echo $this->__('This details are used by ModulesGarden for quotation of a Custom Projects. Please, provide it to us in case of a quotation request. It tells us more deeply, how much your system is non-standard.'); ?></div></div>
|
54 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
+
<div id="mg_debug_info" style="display:none;background-color: #eee;padding: 5px;margin-top:10px;">
|
57 |
+
<pre><?php echo $this->getDebugString(); ?></pre>
|
58 |
+
</div>
|
59 |
+
<?php endif ?>
|
60 |
+
</div>
|
61 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
62 |
</div>
|
63 |
|
64 |
<script type="text/javascript">
|
65 |
+
function showMgDebugInfo() {
|
66 |
+
document.getElementById("mg_show_debug_info").style.display = 'none';
|
67 |
document.getElementById("mg_hide_debug_info").style.display = 'inline-block';
|
68 |
+
document.getElementById("mg_debug_info").style.display = 'block';
|
69 |
+
|
70 |
return false;
|
71 |
+
}
|
72 |
+
function hideMgDebugInfo() {
|
73 |
+
document.getElementById("mg_hide_debug_info").style.display = 'none';
|
74 |
document.getElementById("mg_show_debug_info").style.display = 'inline-block';
|
75 |
+
document.getElementById("mg_debug_info").style.display = 'none';
|
76 |
+
|
77 |
return false;
|
78 |
+
}
|
79 |
</script>
|
app/design/adminhtml/default/default/template/modulesgardenbase/system/config/form/fieldset/store.phtml
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
/**********************************************************************
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-10-31, 13:03:09)
|
@@ -20,7 +19,7 @@
|
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
-
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
@@ -29,47 +28,47 @@ $defaultIcon = Mage::getBaseUrl('skin') . '/adminhtml/base/default/modulesgarden
|
|
29 |
?>
|
30 |
|
31 |
<div class="modulesgarden_grid_container mg_store_container">
|
32 |
-
|
33 |
-
|
34 |
<tr>
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
</tr>
|
66 |
-
|
67 |
-
|
68 |
</div>
|
69 |
|
70 |
<script type="text/javascript">
|
71 |
-
document.observe("dom:loaded", function() {
|
72 |
-
|
73 |
-
|
74 |
-
});
|
75 |
</script>
|
1 |
<?php
|
2 |
+
/* * ********************************************************************
|
|
|
3 |
* Customization Services by ModulesGarden.com
|
4 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
5 |
* (2014-10-31, 13:03:09)
|
19 |
* transferred.
|
20 |
*
|
21 |
*
|
22 |
+
* ******************************************************************** */
|
23 |
|
24 |
/**
|
25 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
28 |
?>
|
29 |
|
30 |
<div class="modulesgarden_grid_container mg_store_container">
|
31 |
+
<table class="extension" cellspacing="0">
|
32 |
+
<?php foreach ($this->getExtensions() as $extension) { ?>
|
33 |
<tr>
|
34 |
+
<td class="img">
|
35 |
+
<img src="<?php echo $extension->getIconUrl($defaultIcon); ?>" />
|
36 |
+
</td>
|
37 |
+
<td class="content">
|
38 |
+
<h3><a href="<?php echo $extension->getFeaturesUrl(); ?>" target="_blank"><?php echo $extension->getFriendlyName(); ?></a></h3>
|
39 |
+
<small>Version <?php echo $extension->getLatestVersion(); ?></small>
|
40 |
|
41 |
+
<div>
|
42 |
+
<?php if ($extension->isAlreadyInstalled()) { ?>
|
43 |
+
<span class="storelabel installed"><?php echo $this->__('Already Installed'); ?></span>
|
44 |
+
<?php } ?>
|
45 |
+
<?php if ($extension->getIsNew()) { ?>
|
46 |
+
<a class="storelabel new" href="<?php echo $extension->getChangelogUrl(); ?>" target="_blank"><?php echo $this->__('New Version Available'); ?></a>
|
47 |
+
<?php } ?>
|
48 |
+
<?php if ($extension->getIsPromotion()) { ?>
|
49 |
+
<span class="storelabel promotion"><?php echo $this->__('Promotion'); ?></span>
|
50 |
+
<?php } ?>
|
51 |
+
</div>
|
52 |
|
53 |
+
<p class="description"><?php echo $extension->getDescription(); ?></p>
|
54 |
+
</td>
|
55 |
+
<td class="price">
|
56 |
+
<?php if ($extension->getPrice() > 0) { ?>
|
57 |
+
<strong>$<?php echo $extension->getPrice(); ?></strong>
|
58 |
+
<a href="<?php echo $extension->getBuyUrl(); ?>" class="form-button" target="_blank"><?php echo $this->__('Buy Now'); ?></a>
|
59 |
+
<?php } else { ?>
|
60 |
+
<strong><?php echo $this->__('FREE'); ?></strong>
|
61 |
+
<a href="<?php echo $extension->getFeaturesUrl(); ?>" class="form-button" target="_blank"><?php echo $this->__('Download'); ?></a>
|
62 |
+
<?php } ?>
|
63 |
+
</td>
|
64 |
</tr>
|
65 |
+
<?php } ?>
|
66 |
+
</table>
|
67 |
</div>
|
68 |
|
69 |
<script type="text/javascript">
|
70 |
+
document.observe("dom:loaded", function () {
|
71 |
+
// simple fix for "save" button color
|
72 |
+
$$('.form-buttons').invoke('addClassName', 'modulesgarden_form_container');
|
73 |
+
});
|
74 |
</script>
|
app/design/adminhtml/default/default/template/modulesgardenbase/system/config/form/fieldset/twitter.phtml
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
/**********************************************************************
|
4 |
* Customization Services by ModulesGarden.com
|
5 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
6 |
* (2014-11-12, 14:02:17)
|
@@ -20,36 +19,40 @@
|
|
20 |
* transferred.
|
21 |
*
|
22 |
*
|
23 |
-
|
24 |
|
25 |
/**
|
26 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
27 |
*/
|
28 |
|
|
|
29 |
?>
|
30 |
|
31 |
<div class="section-config active modulesgarden_form_container">
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
<
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
42 |
</div>
|
43 |
|
44 |
<script type="text/javascript">
|
45 |
-
function mgShowTwitterBox(){
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
}
|
53 |
|
54 |
-
mgShowTwitterBox();
|
55 |
</script>
|
1 |
<?php
|
2 |
+
/* * ********************************************************************
|
|
|
3 |
* Customization Services by ModulesGarden.com
|
4 |
* Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
|
5 |
* (2014-11-12, 14:02:17)
|
19 |
* transferred.
|
20 |
*
|
21 |
*
|
22 |
+
* ******************************************************************** */
|
23 |
|
24 |
/**
|
25 |
* @author Grzegorz Draganik <grzegorz@modulesgarden.com>
|
26 |
*/
|
27 |
|
28 |
+
/* @var $this Modulesgarden_Base_Block_Adminhtml_System_Config_Form_Fieldset_Twitter */
|
29 |
?>
|
30 |
|
31 |
<div class="section-config active modulesgarden_form_container">
|
32 |
+
<div class="entry-edit-head collapseable">
|
33 |
+
<a id="mgbase_store_twitter-head" href="#" onclick="Fieldset.toggleCollapse('mgbase_store_twitter'); return false;" class="open">
|
34 |
+
<?php echo $this->__('Latest News About Our Magento Extensions & Themes'); ?>
|
35 |
+
</a>
|
36 |
+
</div>
|
37 |
+
<input id="mgbase_store_twitter-state" name="config_state[mgbase_store_twitter]" type="hidden" value="1">
|
38 |
+
<fieldset id="mgbase_store_twitter" class="config collapseable">
|
39 |
+
<button onclick="return mgShowTwitterBox();"><?php echo $this->__('Tweets by @ModulesGarden'); ?></button>
|
40 |
+
</fieldset>
|
41 |
+
<script type="text/javascript">
|
42 |
+
//<![CDATA[
|
43 |
+
Fieldset.applyCollapse('mgbase_store_twitter');
|
44 |
+
//]]>
|
45 |
+
</script>
|
46 |
</div>
|
47 |
|
48 |
<script type="text/javascript">
|
49 |
+
function mgShowTwitterBox() {
|
50 |
+
var twitterBoxCode = '<a class="twitter-timeline" data-dnt="true" href="<?php echo $this->getTwitterUrl() ?>" data-tweet-limit="<?php echo $this->getTwitterLimit() ?>" data-widget-id="<?php echo $this->getTwitterId() ?>"></a>';
|
51 |
+
document.getElementById('mgbase_store_twitter').innerHTML = twitterBoxCode;
|
52 |
+
|
53 |
+
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
|
54 |
+
return false;
|
55 |
+
}
|
|
|
56 |
|
57 |
+
mgShowTwitterBox();
|
58 |
</script>
|
package.xml
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Modulesgarden_Base</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>ModulesGarden Base For Magento is a free addition to any of our extensions and themes. It allows you to be up to date with currently installed ModulesGarden extensions and themes as well as view other ModulesGarden products for Magento.</summary>
|
10 |
<description>ModulesGarden Base For Magento is a free addition to any of our extensions and themes. It allows you to be up to date with currently installed ModulesGarden extensions and themes as well as view other ModulesGarden products for Magento. The extensions will enable you to receive notifications about a new version of the extension you already have, a new extension or upgrade of an existing extension, ModulesGarden extensions or themes promotions/discounts, and the latest ModulesGarden tweets concerning Magento.</description>
|
11 |
-
<notes>
|
|
|
12 |
<authors><author><name>ModulesGarden</name><user>ModulesGarden</user><email>peter@inbsgroup.com</email></author></authors>
|
13 |
-
<date>2015-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Modulesgarden"><dir name="Base"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><file name="Installedmodulesgarden.php" hash="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.2.13</min><max>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Modulesgarden_Base</name>
|
4 |
+
<version>1.1.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>ModulesGarden Base For Magento is a free addition to any of our extensions and themes. It allows you to be up to date with currently installed ModulesGarden extensions and themes as well as view other ModulesGarden products for Magento.</summary>
|
10 |
<description>ModulesGarden Base For Magento is a free addition to any of our extensions and themes. It allows you to be up to date with currently installed ModulesGarden extensions and themes as well as view other ModulesGarden products for Magento. The extensions will enable you to receive notifications about a new version of the extension you already have, a new extension or upgrade of an existing extension, ModulesGarden extensions or themes promotions/discounts, and the latest ModulesGarden tweets concerning Magento.</description>
|
11 |
+
<notes>New Feature: Integrated with our Slider Module which is used by our Magento themes
|
12 |
+
Improvement: Code refactorization</notes>
|
13 |
<authors><author><name>ModulesGarden</name><user>ModulesGarden</user><email>peter@inbsgroup.com</email></author></authors>
|
14 |
+
<date>2015-12-18</date>
|
15 |
+
<time>15:30:18</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Modulesgarden"><dir name="Base"><dir name="Block"><dir name="Adminhtml"><dir name="Plugins"><dir name="Banners"><dir name="Edit"><file name="Form.php" hash="4f2cc26b1468054d27c5f930558e55d8"/></dir><file name="Edit.php" hash="5cb6795d62a5bcca75ff7ae38d5cc371"/><file name="Grid.php" hash="1e5790bb183f79d19d01c08800f0f423"/></dir><file name="Banners.php" hash="1bc9e817ce4cfb8531f6c0fd864021c7"/><dir name="Sliders"><dir name="Edit"><file name="Form.php" hash="34199891305ff033c345286769953a3f"/></dir><file name="Edit.php" hash="8c7127c91780b5eea71e55f13aab063c"/><file name="Grid.php" hash="28c1d2467a15d56778b40ae64bca698b"/><file name="Tabs.php" hash="cf8393eb4f0d4cddfe8e73de60c453e1"/></dir><file name="Sliders.php" hash="0ac6cfbf31c0e179d9c63415a9532b4a"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><file name="Installedmodulesgarden.php" hash="c75b59f8c0dc78d42ec3e1d124ae28f7"/><file name="Installedmodulesgardenthemes.php" hash="210fe117c7f937ddd3895e3a5773d007"/><file name="Installedothers.php" hash="9bdbafd56d482247e0a0cfd3aea67abe"/><file name="Installedratio.php" hash="1af23448eeeec054a31eaf5954bc9ebe"/><file name="Modulesgarden.php" hash="d1f1b7fa422b50ae7300bba1d6acde3b"/><file name="Store.php" hash="f30e894ac949e4bac9a7d100fa37658d"/><file name="Twitter.php" hash="05fff5c0068bb82e276fc92e12fb95af"/></dir></dir></dir></dir></dir></dir><dir name="Controller"><dir name="Adminhtml"><file name="Sliders.php" hash="4ac260a4f747cbfe29142094237bdf2c"/></dir></dir><dir name="Helper"><file name="Data.php" hash="b2d75b900ddddf64108af55197e8cf90"/></dir><dir name="Model"><dir name="Adminnotification"><file name="Core.php" hash="81fd244a854195a939d03dbc16530f60"/><file name="Inbox.php" hash="9deb21a240e23605f46f07887293b645"/><file name="Item.php" hash="85081c212c9a9fc4f24f516e8a1e437e"/></dir><file name="Banner.php" hash="ed12a6a0b707ba6a1475fb150408df51"/><dir name="Check"><file name="Client.php" hash="5a4669193bce2067110ff0afb2cdfe87"/></dir><dir name="Extension"><file name="Client.php" hash="80794a4e3f07fa7c2b19424fcdb5fa19"/><file name="Item.php" hash="220fab9faa26e82ab5b879eee386f6fa"/><dir name="Modulesgarden"><file name="Item.php" hash="03105578eded97a79c6ce32f367625b2"/></dir></dir><file name="Extension.php" hash="56d75705ec339f03aeac45fde629fab0"/><file name="Mage.php" hash="5b18dc077af3063cf6209b70fdbc73ca"/><file name="Observer.php" hash="2dae774b290365f8483a66df777f61ef"/><dir name="Resource"><dir name="Banner"><file name="Collection.php" hash="0b88e2ad79f38bad73b6369b7d5cb253"/></dir><file name="Banner.php" hash="7c03e761e1e89859477853bffef2a7b1"/><file name="Extension.php" hash="abc62e680c3500b790323b954469a115"/><dir name="Slider"><file name="Collection.php" hash="784e3ffdc9858642cfdc579b09f3f262"/></dir><file name="Slider.php" hash="3b4dff4b8de8911b0e0e1b8431679847"/></dir><file name="Slider.php" hash="cd99697754d0a4cc14d1683b803abbe7"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Notificationevents.php" hash="b0db3d64e89093e8e3b92aefdeb47eb5"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Plugins"><file name="BannersController.php" hash="0dbfbde72a68ba525b016056a27f78ea"/><file name="SlidersController.php" hash="35250e3f84cb6bf82555a0428b706ffc"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="4fd5f736abdaaf900e840297b11c91f6"/><file name="config.xml" hash="4d5e0e84b856f930696e7ecc6c655474"/><file name="system.xml" hash="4764acd75e31141733ee22a6bcdb96b8"/></dir><dir name="sql"><dir name="modulesgardenbase_setup"><file name="upgrade-1.0.0-1.1.0.php" hash="fd72a7d65f00cd3ce92e8b3474bff836"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="modulesgardenbase.xml" hash="8235b1482d863d789568b907fa465e54"/></dir><dir name="template"><dir name="modulesgardenbase"><dir name="system"><dir name="config"><dir name="form"><dir name="fieldset"><file name="installedmodulesgarden.phtml" hash="d62c590eb3d32b38c18e47129d2f4e1a"/><file name="installedmodulesgardenthemes.phtml" hash="c68d32873c4edc2d931dc8b6a99ec337"/><file name="installedothers.phtml" hash="41104b689bc7fae96477e62020ede4e0"/><file name="installedratio.phtml" hash="db09f239a6b1446c18c9193b61329940"/><file name="store.phtml" hash="d0099392709361154f03d12253cb1955"/><file name="twitter.phtml" hash="c23e2d602e5b74d558e394ab58438b33"/></dir></dir></dir></dir><dir name="widget"><dir name="form"><file name="container.phtml" hash="7d255229c84eccfbe5f3edc15b88fddf"/></dir><file name="form.phtml" hash="885d4544407aed221582e79697b64e47"/><dir name="grid"><file name="container.phtml" hash="2560f0b75910ab22936a1cd05cab2e20"/></dir><file name="tabs.phtml" hash="ab51533c04ac6df20a721f33add3d8c8"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Modulesgarden_Base.xml" hash="7e08916cafe861737ef2c91956ba6600"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="modulesgardenbase"><dir name="css"><file name="modulesgarden.css" hash="650577b300aee71663f56162c3281473"/></dir><dir name="img"><file name="arrows.png" hash="8f6063c353557f32422521b2d7944734"/><file name="arrows_both.png" hash="0c1e461aa5a44b095a7522d08fa620bf"/><file name="arrows_down.png" hash="28b63c1742de966de6627d09047655d4"/><file name="arrows_down_dr.png" hash="58a61fbd2450542546e1a8bb46f990a7"/><file name="arrows_right.png" hash="e0e361c5792b26f5da2a2122b9f88d3f"/><file name="arrows_right_dr.png" hash="8b7af3a05c2b921313b39ae4fca2c3bf"/><file name="arrows_up.png" hash="f5210ec0865d4f2e59f878fc18506c61"/><dir name="icons"><file name="add_btn_icon.gif" hash="29ba6721f6188ffb67d1ce971a17509a"/><file name="bkg_btn-close2.gif" hash="efbc20287cea1d26712b4d9bd4a4d7b5"/><file name="btn_add-image_icon.gif" hash="b85039dd1dd204f348b6df6f3b11dcf7"/><file name="btn_add-widget_icon.gif" hash="eb7c1817b3706ce99cd1e4a0fbb619e7"/><file name="btn_go.gif" hash="0bfe09ca976da5ff1a6474305a40c95b"/><file name="btn_save_icon.gif" hash="bb25772f4f864f0ab4fd27255f027641"/><file name="btn_show-hide_icon.gif" hash="3e906aa321395f8828d457936dd5c4d9"/><file name="cancel_btn_icon.gif" hash="30a7d2003e8456ae2fb18eb52ad43305"/><file name="entry_edit_head_arrow_down.gif" hash="c0cc1a81d382db0f93d1acb243331c68"/><file name="entry_edit_head_arrow_down2.gif" hash="fd5c4bcf6ba5012262acb3b5108498ea"/><file name="entry_edit_head_arrow_up.gif" hash="fe7b94bd5c8984930143d3875523de3b"/><file name="error-msg.png" hash="dbcd59735bdd1fc9d8817f1ed3913ca9"/><file name="error_msg_icon.gif" hash="8855b0d4f318bf14e5f721617298447c"/><file name="icon_btn_add.gif" hash="29ba6721f6188ffb67d1ce971a17509a"/><file name="module.png" hash="7dfc67e00048390302bbabd7562e5510"/><file name="more_arrow.gif" hash="6702a983eba5b8273c60102c2d16d43e"/><file name="reload.png" hash="a6550016386975aa94cd36ae00e641b8"/><file name="save_btn_icon.gif" hash="bb25772f4f864f0ab4fd27255f027641"/></dir><file name="mgcommerce-logo.png" hash="8757e70e181c7360dbf280a94250a3ac"/><file name="modulesgarden.png" hash="10f9cfa4d996e66a0d3497b8e7f41fc1"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="shell"><dir name="modulesgarden"><file name="base.php" hash="7781643f9a469697ea39b1be815d7c93"/></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
+
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|
shell/modulesgarden/base.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once (__DIR__ . '/../abstract.php');
|
4 |
+
require_once (__DIR__ . '/../../app/Mage.php');
|
5 |
+
|
6 |
+
class Modulesgarden_Base_Shell extends Mage_Shell_Abstract {
|
7 |
+
|
8 |
+
protected $response;
|
9 |
+
|
10 |
+
public function run() {
|
11 |
+
if( $this->getArg('check') ) {
|
12 |
+
$this->check();
|
13 |
+
|
14 |
+
if( $this->getArg('save') ) {
|
15 |
+
$this->saveCheck();
|
16 |
+
}
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
public function usageHelp()
|
21 |
+
{
|
22 |
+
return <<<USAGE
|
23 |
+
Usage: php -f modulesgarden/base.php -- [options]
|
24 |
+
|
25 |
+
check Show Magento instance condition
|
26 |
+
save Save the "check" command response in the var file
|
27 |
+
help This help
|
28 |
+
|
29 |
+
USAGE;
|
30 |
+
}
|
31 |
+
|
32 |
+
protected function check() {
|
33 |
+
$client = new Modulesgarden_Base_Model_Check_Client;
|
34 |
+
$this->response = $client->fetch()->getResponse();
|
35 |
+
|
36 |
+
print_r($this->response);
|
37 |
+
}
|
38 |
+
|
39 |
+
protected function saveCheck() {
|
40 |
+
$fileName = 'modulesgarden_base_check.log';
|
41 |
+
|
42 |
+
Mage::log(print_r($this->response, true), null, $fileName);
|
43 |
+
$filename = Mage::getBaseDir('var') . '/log/' . $fileName;
|
44 |
+
|
45 |
+
print_r(sprintf("The response was saved in the file %s\n\r", $filename));
|
46 |
+
}
|
47 |
+
|
48 |
+
}
|
49 |
+
|
50 |
+
$shell = new Modulesgarden_Base_Shell();
|
51 |
+
$shell->run();
|
skin/adminhtml/base/default/modulesgardenbase/img/modulesgarden.png
CHANGED
Binary file
|