Version Notes
First stable release
Download this release
Release Info
Developer | Ben Heinkel |
Extension | photoslurp_for_magento |
Version | 1.0.23 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.23
- app/code/community/Photoslurp/PhotoslurpWidget/Block/Adminhtml/PhotoslurpWidgetbackend.php +0 -5
- app/code/community/Photoslurp/PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget.php +0 -17
- app/code/community/Photoslurp/PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget/Edit.php +0 -44
- app/code/community/Photoslurp/PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget/Edit/Tab/Form.php +0 -133
- app/code/community/Photoslurp/PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget/Edit/Tab/Form2.php +0 -33
- app/code/community/Photoslurp/PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget/Edit/Tabs.php +0 -35
- app/code/community/Photoslurp/PhotoslurpWidget/Block/Widget.php +0 -84
- app/code/community/Photoslurp/PhotoslurpWidget/Helper/Data.php +0 -10
- app/code/community/Photoslurp/PhotoslurpWidget/Model/Cron.php +0 -80
- app/code/community/Photoslurp/PhotoslurpWidget/Model/Mysql4/Photoslurpwidget.php +0 -8
- app/code/community/Photoslurp/PhotoslurpWidget/Model/Mysql4/Photoslurpwidget/Collection.php +0 -12
- app/code/community/Photoslurp/PhotoslurpWidget/Model/Photoslurpwidget.php +0 -12
- app/code/community/Photoslurp/PhotoslurpWidget/controllers/Adminhtml/PhotoslurpwidgetController.php +0 -148
- app/code/community/Photoslurp/PhotoslurpWidget/etc/config.xml +0 -139
- app/code/community/Photoslurp/PhotoslurpWidget/etc/system.xml +0 -42
- app/code/community/Photoslurp/PsWidget/Block/Adminhtml/PsWidgetbackend.php +5 -0
- app/code/community/Photoslurp/PsWidget/Block/Adminhtml/Pswidget.php +17 -0
- app/code/community/Photoslurp/PsWidget/Block/Adminhtml/Pswidget/Edit.php +44 -0
- app/code/community/Photoslurp/{PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget → PsWidget/Block/Adminhtml/Pswidget}/Edit/Form.php +1 -1
- app/code/community/Photoslurp/PsWidget/Block/Adminhtml/Pswidget/Edit/Tab/Form.php +257 -0
- app/code/community/Photoslurp/{PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget → PsWidget/Block/Adminhtml/Pswidget}/Edit/Tab/Form1.php +39 -36
- app/code/community/Photoslurp/PsWidget/Block/Adminhtml/Pswidget/Edit/Tab/Form2.php +28 -0
- app/code/community/Photoslurp/PsWidget/Block/Adminhtml/Pswidget/Edit/Tab/Form3.php +216 -0
- app/code/community/Photoslurp/PsWidget/Block/Adminhtml/Pswidget/Edit/Tabs.php +41 -0
- app/code/community/Photoslurp/{PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget → PsWidget/Block/Adminhtml/Pswidget}/Grid.php +58 -20
- app/code/community/Photoslurp/PsWidget/Block/Widget.php +70 -0
- app/code/community/Photoslurp/PsWidget/Helper/Data.php +35 -0
- app/code/community/Photoslurp/PsWidget/Model/Cron.php +174 -0
- app/code/community/Photoslurp/PsWidget/Model/Mysql4/Pswidget.php +8 -0
- app/code/community/Photoslurp/PsWidget/Model/Mysql4/Pswidget/Collection.php +12 -0
- app/code/community/Photoslurp/PsWidget/Model/Mysql4/Pswidgetlang.php +8 -0
- app/code/community/Photoslurp/PsWidget/Model/Mysql4/Pswidgetlang/Collection.php +12 -0
- app/code/community/Photoslurp/PsWidget/Model/Pswidget.php +12 -0
- app/code/community/Photoslurp/PsWidget/Model/Pswidgetlang.php +11 -0
- app/code/community/Photoslurp/PsWidget/Model/Source/Export.php +20 -0
- app/code/community/Photoslurp/PsWidget/Model/Source/Store.php +9 -0
- app/code/community/Photoslurp/PsWidget/controllers/Adminhtml/Pswidget/PswidgetController.php +197 -0
- app/code/community/Photoslurp/{PhotoslurpWidget/controllers/Adminhtml/PhotoslurpwidgetbackendController.php → PsWidget/controllers/Adminhtml/Pswidget/PswidgetbackendController.php} +10 -4
- app/code/community/Photoslurp/{PhotoslurpWidget → PsWidget}/etc/adminhtml.xml +5 -1
- app/code/community/Photoslurp/PsWidget/etc/config.xml +158 -0
- app/code/community/Photoslurp/PsWidget/etc/system.xml +85 -0
- app/code/community/Photoslurp/{PhotoslurpWidget/sql/photoslurpwidget_setup/mysql4-install-0.1.0.php → PsWidget/sql/pswidget_setup/mysql4-install-1.0.0.php} +76 -81
- app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.0-1.0.1.php +14 -0
- app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.1-1.0.2.php +23 -0
- app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.10-1.0.11.php +12 -0
- app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.17-1.0.18.php +20 -0
- app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.2-1.0.3.php +29 -0
- app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.21-1.0.22.php +8 -0
- app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.4-1.0.5.php +10 -0
- app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.5-1.0.6.php +17 -0
- app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.6-1.0.7.php +10 -0
- app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.8-1.0.9.php +10 -0
- app/design/adminhtml/default/default/layout/photoslurpwidget.xml +0 -29
- app/design/adminhtml/default/default/layout/pswidget.xml +29 -0
- app/design/adminhtml/default/default/template/photoslurpwidget/photoslurpwidgetbackend.phtml +0 -24
- app/design/adminhtml/default/default/template/pswidget/pswidgetbackend.phtml +26 -0
- app/design/frontend/base/default/layout/photoslurpwidget.xml +0 -26
- app/design/frontend/base/default/layout/pswidget.xml +52 -0
- app/design/frontend/base/default/template/photoslurpwidget/widget.phtml +0 -188
- app/design/frontend/base/default/template/{photoslurpwidget → pswidget}/style.phtml +11 -13
- app/design/frontend/base/default/template/{photoslurpwidget → pswidget}/tracking.phtml +28 -26
- app/design/frontend/base/default/template/pswidget/widget.phtml +281 -0
- app/etc/modules/{Photoslurp_PhotoslurpWidget.xml → Photoslurp_PsWidget.xml} +3 -3
- js/photoslurp/admin.js +110 -33
- package.xml +4 -4
app/code/community/Photoslurp/PhotoslurpWidget/Block/Adminhtml/PhotoslurpWidgetbackend.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Photoslurp_PhotoslurpWidget_Block_Adminhtml_PhotoslurpWidgetbackend extends Mage_Adminhtml_Block_Template {
|
4 |
-
|
5 |
-
}
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget.php
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
class Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget extends Mage_Adminhtml_Block_Widget_Grid_Container{
|
5 |
-
|
6 |
-
public function __construct()
|
7 |
-
{
|
8 |
-
|
9 |
-
$this->_controller = "adminhtml_photoslurpwidget";
|
10 |
-
$this->_blockGroup = "photoslurpwidget";
|
11 |
-
$this->_headerText = Mage::helper("photoslurpwidget")->__("Photoslurp Widget Manager");
|
12 |
-
$this->_addButtonLabel = Mage::helper("photoslurpwidget")->__("Add New Item");
|
13 |
-
parent::__construct();
|
14 |
-
|
15 |
-
}
|
16 |
-
|
17 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget/Edit.php
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
|
8 |
-
parent::__construct();
|
9 |
-
$this->_objectId = "id";
|
10 |
-
$this->_blockGroup = "photoslurpwidget";
|
11 |
-
$this->_controller = "adminhtml_photoslurpwidget";
|
12 |
-
$this->_updateButton("save", "label", Mage::helper("photoslurpwidget")->__("Save Item"));
|
13 |
-
$this->_updateButton("delete", "label", Mage::helper("photoslurpwidget")->__("Delete Item"));
|
14 |
-
|
15 |
-
$this->_addButton("saveandcontinue", array(
|
16 |
-
"label" => Mage::helper("photoslurpwidget")->__("Save And Continue Edit"),
|
17 |
-
"onclick" => "saveAndContinueEdit()",
|
18 |
-
"class" => "save",
|
19 |
-
), -100);
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
$this->_formScripts[] = "
|
24 |
-
|
25 |
-
function saveAndContinueEdit(){
|
26 |
-
editForm.submit($('edit_form').action+'back/edit/');
|
27 |
-
}
|
28 |
-
";
|
29 |
-
}
|
30 |
-
|
31 |
-
public function getHeaderText()
|
32 |
-
{
|
33 |
-
if( Mage::registry("photoslurpwidget_data") && Mage::registry("photoslurpwidget_data")->getId() ){
|
34 |
-
|
35 |
-
return Mage::helper("photoslurpwidget")->__("Edit Item '%s'", $this->htmlEscape(Mage::registry("photoslurpwidget_data")->getId()));
|
36 |
-
|
37 |
-
}
|
38 |
-
else{
|
39 |
-
|
40 |
-
return Mage::helper("photoslurpwidget")->__("Add Item");
|
41 |
-
|
42 |
-
}
|
43 |
-
}
|
44 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget/Edit/Tab/Form.php
DELETED
@@ -1,133 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
-
{
|
5 |
-
protected function _prepareForm()
|
6 |
-
{
|
7 |
-
$form = new Varien_Data_Form();
|
8 |
-
$this->setForm($form);
|
9 |
-
$fieldset = $form->addFieldset("photoslurpwidget_form", array("legend" => Mage::helper("photoslurpwidget")->__("Configuration parameters")));
|
10 |
-
|
11 |
-
$fieldset->addField('widget_enable', 'select', array(
|
12 |
-
'label' => Mage::helper('photoslurpwidget')->__('Enable'),
|
13 |
-
'values' => Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid::getValueArrayYesNo(),
|
14 |
-
'name' => 'widget_enable',
|
15 |
-
"class" => "required-entry",
|
16 |
-
"required" => true,
|
17 |
-
|
18 |
-
));
|
19 |
-
|
20 |
-
$fieldset->addField("widget_container_id", "text", array(
|
21 |
-
"label" => Mage::helper("photoslurpwidget")->__("Widget Container Id"),
|
22 |
-
"class" => "required-entry",
|
23 |
-
"required" => true,
|
24 |
-
"name" => "widget_container_id",
|
25 |
-
'after_element_html' => "<i>Please choose a unique HTML container ID to hold the widget</i>"
|
26 |
-
));
|
27 |
-
|
28 |
-
$fieldset->addField("widget_id", "text", array(
|
29 |
-
"label" => Mage::helper("photoslurpwidget")->__("Widget Id"),
|
30 |
-
"class" => "required-entry",
|
31 |
-
"required" => true,
|
32 |
-
"name" => "widget_id",
|
33 |
-
'after_element_html' => "<br><i>A unique identifier for each of the widgets you use on your website</i>"
|
34 |
-
));
|
35 |
-
|
36 |
-
$fieldset->addField('widget_type', 'select', array(
|
37 |
-
'label' => Mage::helper('photoslurpwidget')->__('Widget Type'),
|
38 |
-
'values' => Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid::getValueArray5(),
|
39 |
-
'name' => 'widget_type',
|
40 |
-
"class" => "required-entry",
|
41 |
-
"required" => true,
|
42 |
-
'after_element_html' => '<i>This is either set to carousel or gallery depending on how you would like to display your pictures. Carousel has been specifically designed to be placed on your product pages, and Gallery to be used as a separate gallery page<i>'
|
43 |
-
|
44 |
-
));
|
45 |
-
|
46 |
-
$fieldset->addField("album_id", "text", array(
|
47 |
-
"label" => Mage::helper("photoslurpwidget")->__("Album Id"),
|
48 |
-
"class" => "required-entry",
|
49 |
-
"required" => true,
|
50 |
-
"name" => "album_id",
|
51 |
-
'after_element_html' => '<i>This is the ID number of your campaign</i>'
|
52 |
-
));
|
53 |
-
|
54 |
-
$fieldset->addField("page_limit", "text", array(
|
55 |
-
"label" => Mage::helper("photoslurpwidget")->__("Page Limit"),
|
56 |
-
"class" => "required-entry",
|
57 |
-
"required" => true,
|
58 |
-
"name" => "page_limit",
|
59 |
-
"value" => 30,
|
60 |
-
'after_element_html' => '<i>The number of images to load per page for both the Gallery and Carousel modes</i>'
|
61 |
-
));
|
62 |
-
|
63 |
-
$fieldset->addField('page_type', 'select', array(
|
64 |
-
'label' => Mage::helper('photoslurpwidget')->__('Page Type'),
|
65 |
-
'values' => Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid::getValueArray10(),
|
66 |
-
'name' => 'page_type',
|
67 |
-
"class" => "required-entry",
|
68 |
-
"required" => true,
|
69 |
-
'after_element_html' => '<i>This parameter is used in analytics calculations</i>'
|
70 |
-
));
|
71 |
-
$fieldset->addField('show_submit', 'select', array(
|
72 |
-
'label' => Mage::helper('photoslurpwidget')->__('Show Submit'),
|
73 |
-
'values' => Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid::getValueArrayYesNo(),
|
74 |
-
'name' => 'show_submit',
|
75 |
-
'after_element_html' => '<i>This parameter will enable the frontend upload widget, and display a Submit button</i>'
|
76 |
-
));
|
77 |
-
$fieldset->addField("submit_text", "text", array(
|
78 |
-
"label" => Mage::helper("photoslurpwidget")->__("Submit Text"),
|
79 |
-
"name" => "submit_text",
|
80 |
-
'after_element_html' => '<i>This is the text that will be displayed on the Submit button</i>'
|
81 |
-
));
|
82 |
-
|
83 |
-
$fieldset->addField("add_photos_img", "text", array(
|
84 |
-
"label" => Mage::helper("photoslurpwidget")->__("Add Photos Img"),
|
85 |
-
"name" => "add_photos_img",
|
86 |
-
'after_element_html' => '<i>This requires a URL to an image that will be displayed when there are no images yet in a particular album (for example when the productId parameter is used, and there are no photos for particular product yet). A banner inviting users to submit images is recommended to be used here</i>'
|
87 |
-
));
|
88 |
-
|
89 |
-
$fieldset->addField("note_add_pics_text", "text", array(
|
90 |
-
"label" => Mage::helper("photoslurpwidget")->__("Note Add Pics Text"),
|
91 |
-
"name" => "note_add_pics_text",
|
92 |
-
'after_element_html' => '<i>This is the text to be added on the top of your Gallery or Carousel, and can be used to let your users know how they can add their own pictures</i>'
|
93 |
-
));
|
94 |
-
|
95 |
-
$fieldset->addField('note_add_pics_icons', 'multiselect', array(
|
96 |
-
'label' => Mage::helper('photoslurpwidget')->__('Note Add Pics Icons'),
|
97 |
-
'values' => Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid::getValueArray15(),
|
98 |
-
'name' => 'note_add_pics_icons',
|
99 |
-
'after_element_html' => '<i>This is related to noteAddPicsText and will add the icons of the services you have chosen to include in your campaign, letting users know which services they can use to add their own pictures</i>'
|
100 |
-
));
|
101 |
-
$fieldset->addField('social_icons', 'select', array(
|
102 |
-
'label' => Mage::helper('photoslurpwidget')->__('Social Icons'),
|
103 |
-
'values' => Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid::getValueArrayYesNo(),
|
104 |
-
'name' => 'social_icons',
|
105 |
-
'after_element_html' => '<i>Enable social icons in the lightbox to allow users to share pictures back to social networks</i>'
|
106 |
-
));
|
107 |
-
$fieldset->addField("image_height", "text", array(
|
108 |
-
"label" => Mage::helper("photoslurpwidget")->__("Image Height, px"),
|
109 |
-
"class" => "required-entry",
|
110 |
-
"required" => true,
|
111 |
-
"name" => "image_height",
|
112 |
-
"value" => 200,
|
113 |
-
'after_element_html' => '<i>This is an option specific to the Carousel widget type, and sets the height of the thumbnail images and therefore the carousel</i>'
|
114 |
-
));
|
115 |
-
|
116 |
-
$fieldset->addField("image_width", "text", array(
|
117 |
-
"label" => Mage::helper("photoslurpwidget")->__("Image Width, px"),
|
118 |
-
"class" => "required-entry",
|
119 |
-
"required" => true,
|
120 |
-
"name" => "image_width",
|
121 |
-
"value" => 200,
|
122 |
-
'after_element_html' => '<i>This option is specific to the Gallery widget type, and sets the width of each thumbnail in the Gallery view</i>'
|
123 |
-
));
|
124 |
-
|
125 |
-
if (Mage::getSingleton("adminhtml/session")->getPhotoslurpwidgetData()) {
|
126 |
-
$form->setValues(Mage::getSingleton("adminhtml/session")->getPhotoslurpwidgetData());
|
127 |
-
Mage::getSingleton("adminhtml/session")->setPhotoslurpwidgetData(null);
|
128 |
-
} elseif (Mage::registry("photoslurpwidget_data")) {
|
129 |
-
$form->setValues(Mage::registry("photoslurpwidget_data")->getData());
|
130 |
-
}
|
131 |
-
return parent::_prepareForm();
|
132 |
-
}
|
133 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget/Edit/Tab/Form2.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Edit_Tab_Form2 extends Mage_Adminhtml_Block_Widget_Form
|
3 |
-
{
|
4 |
-
protected function _prepareForm()
|
5 |
-
{
|
6 |
-
|
7 |
-
$form = new Varien_Data_Form();
|
8 |
-
$this->setForm($form);
|
9 |
-
$fieldset = $form->addFieldset("photoslurpwidget_form", array("legend"=>Mage::helper("photoslurpwidget")->__("Custom CSS")));
|
10 |
-
|
11 |
-
$fieldset->addField('style_custom_enable', 'select', array(
|
12 |
-
'label' => Mage::helper('photoslurpwidget')->__('Overwrite Default'),
|
13 |
-
'values' => Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid::getValueArrayYesNo(),
|
14 |
-
'name' => 'style_custom_enable',
|
15 |
-
'after_element_html' => '<i>For further customization of the actual widgets, we recommend you overwrite the default widget CSS styles with your own</i>'
|
16 |
-
));
|
17 |
-
|
18 |
-
$fieldset->addField("style_custom", "textarea", array(
|
19 |
-
"label" => Mage::helper("photoslurpwidget")->__("Your Own CSS"),
|
20 |
-
"name" => "style_custom"
|
21 |
-
));
|
22 |
-
|
23 |
-
if (Mage::getSingleton("adminhtml/session")->getPhotoslurpwidgetData())
|
24 |
-
{
|
25 |
-
$form->setValues(Mage::getSingleton("adminhtml/session")->getPhotoslurpwidgetData());
|
26 |
-
Mage::getSingleton("adminhtml/session")->setPhotoslurpwidgetData(null);
|
27 |
-
}
|
28 |
-
elseif(Mage::registry("photoslurpwidget_data")) {
|
29 |
-
$form->setValues(Mage::registry("photoslurpwidget_data")->getData());
|
30 |
-
}
|
31 |
-
return parent::_prepareForm();
|
32 |
-
}
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget/Edit/Tabs.php
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
$this->setId("photoslurpwidget_tabs");
|
9 |
-
$this->setDestElementId("edit_form");
|
10 |
-
$this->setTitle(Mage::helper("photoslurpwidget")->__("Widget information"));
|
11 |
-
}
|
12 |
-
|
13 |
-
protected function _beforeToHtml()
|
14 |
-
{
|
15 |
-
$this->addTab("form_section", array(
|
16 |
-
"label" => Mage::helper("photoslurpwidget")->__("Configuration"),
|
17 |
-
"title" => Mage::helper("photoslurpwidget")->__("Configuration"),
|
18 |
-
"content" => $this->getLayout()->createBlock("photoslurpwidget/adminhtml_photoslurpwidget_edit_tab_form")->toHtml(),
|
19 |
-
));
|
20 |
-
|
21 |
-
$this->addTab("form_section1", array(
|
22 |
-
"label" => Mage::helper("photoslurpwidget")->__("Style parameters"),
|
23 |
-
"title" => Mage::helper("photoslurpwidget")->__("Style parameters"),
|
24 |
-
"content" => $this->getLayout()->createBlock("photoslurpwidget/adminhtml_photoslurpwidget_edit_tab_form1")->toHtml(),
|
25 |
-
));
|
26 |
-
|
27 |
-
$this->addTab("form_section2", array(
|
28 |
-
"label" => Mage::helper("photoslurpwidget")->__("Custom CSS"),
|
29 |
-
"title" => Mage::helper("photoslurpwidget")->__("Custom CSS"),
|
30 |
-
"content" => $this->getLayout()->createBlock("photoslurpwidget/adminhtml_photoslurpwidget_edit_tab_form2")->toHtml(),
|
31 |
-
));
|
32 |
-
return parent::_beforeToHtml();
|
33 |
-
}
|
34 |
-
|
35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/Block/Widget.php
DELETED
@@ -1,84 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Photoslurp_PhotoslurpWidget_Block_Widget extends Mage_Core_Block_Template{
|
3 |
-
|
4 |
-
protected $_product = null;
|
5 |
-
|
6 |
-
public function __construct()
|
7 |
-
{
|
8 |
-
parent::__construct();
|
9 |
-
$this->setTemplate('photoslurpwidget/widget.phtml');
|
10 |
-
}
|
11 |
-
|
12 |
-
public function getProduct()
|
13 |
-
{
|
14 |
-
if (!$this->_product) {
|
15 |
-
$this->_product = Mage::registry('product');
|
16 |
-
}
|
17 |
-
return $this->_product;
|
18 |
-
}
|
19 |
-
|
20 |
-
public function getWidget(){
|
21 |
-
|
22 |
-
return $this->_widget = Mage::getModel('photoslurpwidget/photoslurpwidget')->getCollection()
|
23 |
-
-> addFilter($field='id', $value = $this->getData('id'))
|
24 |
-
-> addFilter($field='widget_enable', $value='1')
|
25 |
-
-> getFirstItem();
|
26 |
-
}
|
27 |
-
|
28 |
-
public function getProductPageWidget()
|
29 |
-
{
|
30 |
-
return $this->_widget = Mage::getModel('photoslurpwidget/photoslurpwidget')->getCollection()
|
31 |
-
-> addFilter($field='widget_enable', $value='1')
|
32 |
-
-> addFilter($field='page_type', $value='2')
|
33 |
-
-> getFirstItem();
|
34 |
-
}
|
35 |
-
|
36 |
-
public function getAllWidgets()
|
37 |
-
{
|
38 |
-
return $this->_widget = Mage::getModel('photoslurpwidget/photoslurpwidget')->getCollection()
|
39 |
-
-> addFilter($field='widget_enable', $value='1');
|
40 |
-
}
|
41 |
-
|
42 |
-
public function getIsFacebookIconEnabled()
|
43 |
-
{
|
44 |
-
if (in_array(1, explode(",", $this->getWidget()->getNoteAddPicsIcons()))) {
|
45 |
-
return true;
|
46 |
-
}
|
47 |
-
return false;
|
48 |
-
}
|
49 |
-
|
50 |
-
public function getIsTwitterIconEnabled()
|
51 |
-
{
|
52 |
-
if (in_array(2, explode(",", $this->getWidget()->getNoteAddPicsIcons()))) {
|
53 |
-
return true;
|
54 |
-
}
|
55 |
-
return false;
|
56 |
-
}
|
57 |
-
|
58 |
-
public function getIsInstagramIconEnabled()
|
59 |
-
{
|
60 |
-
if (in_array(3, explode(",", $this->getWidget()->getNoteAddPicsIcons()))) {
|
61 |
-
return true;
|
62 |
-
}
|
63 |
-
return false;
|
64 |
-
}
|
65 |
-
|
66 |
-
public function prepareStyleText($text, $id)
|
67 |
-
{
|
68 |
-
$cssModified = '';
|
69 |
-
$pattern = '/[^{}]*{(?:[^{}]+|(?R))*}/';
|
70 |
-
preg_match_all($pattern, $text, $cssBlocks);
|
71 |
-
foreach($cssBlocks[0] as $cssBlock) {
|
72 |
-
$cssBlock = trim($cssBlock);
|
73 |
-
preg_match('/[^{}]*{/', $cssBlock, $selector);
|
74 |
-
if(!preg_match('/^@/', $selector[0])) {
|
75 |
-
$selectorModified = preg_replace(array('/,/', '/^/'), array(",\n#$id ", "\n#$id "), $selector[0]);
|
76 |
-
$cssBlockModified = preg_replace("/$selector[0]/", $selectorModified, $cssBlock);
|
77 |
-
}else{
|
78 |
-
$cssBlockModified = "\n$cssBlock";
|
79 |
-
}
|
80 |
-
$cssModified .= $cssBlockModified;
|
81 |
-
}
|
82 |
-
return $cssModified;
|
83 |
-
}
|
84 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/Helper/Data.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Photoslurp_PhotoslurpWidget_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
-
{
|
4 |
-
const FILE_NAME = 'photoslurp_export.csv';
|
5 |
-
|
6 |
-
public function getFileName(){
|
7 |
-
return self::FILE_NAME;
|
8 |
-
}
|
9 |
-
}
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/Model/Cron.php
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Photoslurp_PhotoslurpWidget_Model_Cron{
|
3 |
-
|
4 |
-
private $delimiter = '|';
|
5 |
-
|
6 |
-
public function photoslurpExport(){//cron
|
7 |
-
if (Mage::getStoreConfig('export/export_configuration/cron_enable')){
|
8 |
-
$this->export();
|
9 |
-
}
|
10 |
-
}
|
11 |
-
|
12 |
-
public function manualExport(){
|
13 |
-
$this->export();
|
14 |
-
}
|
15 |
-
|
16 |
-
private function export(){
|
17 |
-
$collection = Mage::getResourceModel('catalog/product_collection')
|
18 |
-
->addAttributeToFilter('visibility',array("neq"=>1)) //except not visible individually
|
19 |
-
->addAttributeToSelect('image')
|
20 |
-
->addAttributeToSelect('name')
|
21 |
-
->addAttributeToSelect('price');
|
22 |
-
|
23 |
-
$headers = array();
|
24 |
-
$headers[] = 'sku';
|
25 |
-
$currencyCodes = Mage::app()->getStore()->getAvailableCurrencyCodes(true);
|
26 |
-
foreach ($currencyCodes as $code){
|
27 |
-
$headers[] = 'price_'.$code;
|
28 |
-
}
|
29 |
-
|
30 |
-
$headers[] = 'image_url';
|
31 |
-
|
32 |
-
$rows = array();
|
33 |
-
foreach ($collection as $product) {
|
34 |
-
$rows[$product->getId()]= array();
|
35 |
-
$rows[$product->getId()][] = $product->getSku();
|
36 |
-
|
37 |
-
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
|
38 |
-
foreach ($currencyCodes as $code){
|
39 |
-
$rows[$product->getId()][] = $this->convertPrice($product->getPrice(),$baseCurrencyCode,$code) ;
|
40 |
-
}
|
41 |
-
|
42 |
-
$rows[$product->getId()][] = $product->getImageUrl();
|
43 |
-
}
|
44 |
-
|
45 |
-
$stores = Mage::app()->getStores();
|
46 |
-
|
47 |
-
foreach ($stores as $store) {
|
48 |
-
$headers[] = 'title_'.$store->getCode();
|
49 |
-
$headers[] = 'description_'.$store->getCode();
|
50 |
-
$headers[] = 'url_'.$store->getCode();
|
51 |
-
|
52 |
-
$collection = Mage::getResourceModel('catalog/product_collection')
|
53 |
-
->addAttributeToFilter('visibility',array("neq"=>1)) //except not visible individually
|
54 |
-
->setStoreId($store->getId())
|
55 |
-
->addAttributeToSelect('name')
|
56 |
-
->addAttributeToSelect('description');
|
57 |
-
|
58 |
-
foreach ($collection as $product){
|
59 |
-
$product->setStoreId($store->getId());
|
60 |
-
$rows[$product->getId()][] = $product->getName();
|
61 |
-
$rows[$product->getId()][] = $product->getDescription();
|
62 |
-
$rows[$product->getId()][] = $product->getProductUrl();
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
$filename = Mage::helper('photoslurpwidget')->getFileName();
|
67 |
-
$fp = fopen($filename, 'w');
|
68 |
-
|
69 |
-
fputcsv($fp, $headers, $this->delimiter);
|
70 |
-
foreach ($rows as $row){
|
71 |
-
fputcsv($fp, $row, $this->delimiter);
|
72 |
-
}
|
73 |
-
|
74 |
-
fclose($fp);
|
75 |
-
}
|
76 |
-
|
77 |
-
private function convertPrice($price,$from,$to){
|
78 |
-
return Mage::helper('directory')->currencyConvert($price, $from, $to);
|
79 |
-
}
|
80 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/Model/Mysql4/Photoslurpwidget.php
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Photoslurp_PhotoslurpWidget_Model_Mysql4_Photoslurpwidget extends Mage_Core_Model_Mysql4_Abstract
|
3 |
-
{
|
4 |
-
protected function _construct()
|
5 |
-
{
|
6 |
-
$this->_init("photoslurpwidget/photoslurpwidget", "id");
|
7 |
-
}
|
8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/Model/Mysql4/Photoslurpwidget/Collection.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Photoslurp_PhotoslurpWidget_Model_Mysql4_Photoslurpwidget_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
-
{
|
4 |
-
|
5 |
-
public function _construct(){
|
6 |
-
$this->_init("photoslurpwidget/photoslurpwidget");
|
7 |
-
}
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
}
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/Model/Photoslurpwidget.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Photoslurp_PhotoslurpWidget_Model_Photoslurpwidget extends Mage_Core_Model_Abstract
|
4 |
-
{
|
5 |
-
protected function _construct(){
|
6 |
-
|
7 |
-
$this->_init("photoslurpwidget/photoslurpwidget");
|
8 |
-
|
9 |
-
}
|
10 |
-
|
11 |
-
}
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/controllers/Adminhtml/PhotoslurpwidgetController.php
DELETED
@@ -1,148 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Photoslurp_PhotoslurpWidget_Adminhtml_PhotoslurpwidgetController extends Mage_Adminhtml_Controller_Action
|
4 |
-
{
|
5 |
-
protected function _initAction()
|
6 |
-
{
|
7 |
-
$this->loadLayout()->_setActiveMenu("photoslurpwidget/photoslurpwidget")->_addBreadcrumb(Mage::helper("adminhtml")->__("Photoslurpwidget Manager"),Mage::helper("adminhtml")->__("Photoslurpwidget Manager"));
|
8 |
-
return $this;
|
9 |
-
}
|
10 |
-
public function indexAction()
|
11 |
-
{
|
12 |
-
$this->_title($this->__("Photoslurp Widget"));
|
13 |
-
$this->_title($this->__("Manager Photoslurpwidget"));
|
14 |
-
|
15 |
-
$this->_initAction();
|
16 |
-
$this->renderLayout();
|
17 |
-
}
|
18 |
-
public function editAction()
|
19 |
-
{
|
20 |
-
$this->_title($this->__("Photoslurp Widget"));
|
21 |
-
$this->_title($this->__("Photoslurpwidget"));
|
22 |
-
$this->_title($this->__("Edit Item"));
|
23 |
-
|
24 |
-
$id = $this->getRequest()->getParam("id");
|
25 |
-
$model = Mage::getModel("photoslurpwidget/photoslurpwidget")->load($id);
|
26 |
-
if ($model->getId()) {
|
27 |
-
Mage::register("photoslurpwidget_data", $model);
|
28 |
-
$this->loadLayout();
|
29 |
-
$this->_setActiveMenu("photoslurpwidget/photoslurpwidget");
|
30 |
-
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Photoslurp Widget Manager"), Mage::helper("adminhtml")->__("Photoslurpwidget Manager"));
|
31 |
-
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Photoslurpwidget Description"), Mage::helper("adminhtml")->__("Photoslurpwidget Description"));
|
32 |
-
$this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
|
33 |
-
$this->_addContent($this->getLayout()->createBlock("photoslurpwidget/adminhtml_photoslurpwidget_edit"))->_addLeft($this->getLayout()->createBlock("photoslurpwidget/adminhtml_photoslurpwidget_edit_tabs"));
|
34 |
-
$this->renderLayout();
|
35 |
-
}
|
36 |
-
else {
|
37 |
-
Mage::getSingleton("adminhtml/session")->addError(Mage::helper("photoslurpwidget")->__("Item does not exist."));
|
38 |
-
$this->_redirect("*/*/");
|
39 |
-
}
|
40 |
-
}
|
41 |
-
|
42 |
-
public function newAction()
|
43 |
-
{
|
44 |
-
|
45 |
-
$this->_title($this->__("PhotoslurpWidget"));
|
46 |
-
$this->_title($this->__("Photoslurpwidget"));
|
47 |
-
$this->_title($this->__("New Item"));
|
48 |
-
|
49 |
-
$id = $this->getRequest()->getParam("id");
|
50 |
-
$model = Mage::getModel("photoslurpwidget/photoslurpwidget")->load($id);
|
51 |
-
|
52 |
-
$data = Mage::getSingleton("adminhtml/session")->getFormData(true);
|
53 |
-
if (!empty($data)) {
|
54 |
-
$model->setData($data);
|
55 |
-
}
|
56 |
-
|
57 |
-
Mage::register("photoslurpwidget_data", $model);
|
58 |
-
|
59 |
-
$this->loadLayout();
|
60 |
-
$this->_setActiveMenu("photoslurpwidget/photoslurpwidget");
|
61 |
-
|
62 |
-
$this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
|
63 |
-
|
64 |
-
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Photoslurp Widget Manager"), Mage::helper("adminhtml")->__("Photoslurpwidget Manager"));
|
65 |
-
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Photoslurp Widget Description"), Mage::helper("adminhtml")->__("Photoslurpwidget Description"));
|
66 |
-
|
67 |
-
|
68 |
-
$this->_addContent($this->getLayout()->createBlock("photoslurpwidget/adminhtml_photoslurpwidget_edit"))->_addLeft($this->getLayout()->createBlock("photoslurpwidget/adminhtml_photoslurpwidget_edit_tabs"));
|
69 |
-
|
70 |
-
$this->renderLayout();
|
71 |
-
|
72 |
-
}
|
73 |
-
public function saveAction()
|
74 |
-
{
|
75 |
-
|
76 |
-
$post_data=$this->getRequest()->getPost();
|
77 |
-
|
78 |
-
|
79 |
-
if ($post_data) {
|
80 |
-
|
81 |
-
try {
|
82 |
-
|
83 |
-
|
84 |
-
$post_data['note_add_pics_icons']=implode(',',$post_data['note_add_pics_icons']);
|
85 |
-
|
86 |
-
$model = Mage::getModel("photoslurpwidget/photoslurpwidget")
|
87 |
-
->addData($post_data)
|
88 |
-
->setId($this->getRequest()->getParam("id"))
|
89 |
-
->save();
|
90 |
-
|
91 |
-
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Photoslurpwidget was successfully saved"));
|
92 |
-
Mage::getSingleton("adminhtml/session")->setPhotoslurpwidgetData(false);
|
93 |
-
|
94 |
-
if ($this->getRequest()->getParam("back")) {
|
95 |
-
$this->_redirect("*/*/edit", array("id" => $model->getId()));
|
96 |
-
return;
|
97 |
-
}
|
98 |
-
$this->_redirect("*/*/");
|
99 |
-
return;
|
100 |
-
}
|
101 |
-
catch (Exception $e) {
|
102 |
-
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
103 |
-
Mage::getSingleton("adminhtml/session")->setPhotoslurpwidgetData($this->getRequest()->getPost());
|
104 |
-
$this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
|
105 |
-
return;
|
106 |
-
}
|
107 |
-
|
108 |
-
}
|
109 |
-
$this->_redirect("*/*/");
|
110 |
-
}
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
public function deleteAction()
|
115 |
-
{
|
116 |
-
if( $this->getRequest()->getParam("id") > 0 ) {
|
117 |
-
try {
|
118 |
-
$model = Mage::getModel("photoslurpwidget/photoslurpwidget");
|
119 |
-
$model->setId($this->getRequest()->getParam("id"))->delete();
|
120 |
-
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item was successfully deleted"));
|
121 |
-
$this->_redirect("*/*/");
|
122 |
-
}
|
123 |
-
catch (Exception $e) {
|
124 |
-
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
125 |
-
$this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
|
126 |
-
}
|
127 |
-
}
|
128 |
-
$this->_redirect("*/*/");
|
129 |
-
}
|
130 |
-
|
131 |
-
|
132 |
-
public function massRemoveAction()
|
133 |
-
{
|
134 |
-
try {
|
135 |
-
$ids = $this->getRequest()->getPost('ids', array());
|
136 |
-
foreach ($ids as $id) {
|
137 |
-
$model = Mage::getModel("photoslurpwidget/photoslurpwidget");
|
138 |
-
$model->setId($id)->delete();
|
139 |
-
}
|
140 |
-
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item(s) was successfully removed"));
|
141 |
-
}
|
142 |
-
catch (Exception $e) {
|
143 |
-
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
144 |
-
}
|
145 |
-
$this->_redirect('*/*/');
|
146 |
-
}
|
147 |
-
|
148 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/etc/config.xml
DELETED
@@ -1,139 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Photoslurp_PhotoslurpWidget>
|
5 |
-
<version>0.1.0</version>
|
6 |
-
</Photoslurp_PhotoslurpWidget>
|
7 |
-
</modules>
|
8 |
-
<frontend>
|
9 |
-
<routers>
|
10 |
-
<photoslurpwidget>
|
11 |
-
<use>standard</use>
|
12 |
-
<args>
|
13 |
-
<module>Photoslurp_PhotoslurpWidget</module>
|
14 |
-
<frontName>photoslurpwidget</frontName>
|
15 |
-
</args>
|
16 |
-
</photoslurpwidget>
|
17 |
-
</routers>
|
18 |
-
<layout>
|
19 |
-
<updates>
|
20 |
-
<photoslurpwidget>
|
21 |
-
<file>photoslurpwidget.xml</file>
|
22 |
-
</photoslurpwidget>
|
23 |
-
</updates>
|
24 |
-
</layout>
|
25 |
-
</frontend>
|
26 |
-
<global>
|
27 |
-
<helpers>
|
28 |
-
<photoslurpwidget>
|
29 |
-
<class>Photoslurp_PhotoslurpWidget_Helper</class>
|
30 |
-
</photoslurpwidget>
|
31 |
-
</helpers>
|
32 |
-
<blocks>
|
33 |
-
<photoslurpwidget>
|
34 |
-
<class>Photoslurp_PhotoslurpWidget_Block</class>
|
35 |
-
</photoslurpwidget>
|
36 |
-
</blocks>
|
37 |
-
<models>
|
38 |
-
<photoslurpwidget>
|
39 |
-
<class>Photoslurp_PhotoslurpWidget_Model</class>
|
40 |
-
<resourceModel>photoslurpwidget_mysql4</resourceModel>
|
41 |
-
</photoslurpwidget>
|
42 |
-
<photoslurpwidget_mysql4>
|
43 |
-
<class>Photoslurp_PhotoslurpWidget_Model_Mysql4</class>
|
44 |
-
<entities>
|
45 |
-
<photoslurpwidget>
|
46 |
-
<table>photoslurp_widget</table>
|
47 |
-
</photoslurpwidget>
|
48 |
-
</entities>
|
49 |
-
</photoslurpwidget_mysql4>
|
50 |
-
</models>
|
51 |
-
<resources>
|
52 |
-
<photoslurpwidget_setup>
|
53 |
-
<setup>
|
54 |
-
<module>Photoslurp_PhotoslurpWidget</module>
|
55 |
-
</setup>
|
56 |
-
<connection>
|
57 |
-
<use>core_setup</use>
|
58 |
-
</connection>
|
59 |
-
</photoslurpwidget_setup>
|
60 |
-
<photoslurpwidget_write>
|
61 |
-
<connection>
|
62 |
-
<use>core_write</use>
|
63 |
-
</connection>
|
64 |
-
</photoslurpwidget_write>
|
65 |
-
<photoslurpwidget_read>
|
66 |
-
<connection>
|
67 |
-
<use>core_read</use>
|
68 |
-
</connection>
|
69 |
-
</photoslurpwidget_read>
|
70 |
-
</resources>
|
71 |
-
</global>
|
72 |
-
<admin>
|
73 |
-
<routers>
|
74 |
-
<photoslurpwidget>
|
75 |
-
<use>admin</use>
|
76 |
-
<args>
|
77 |
-
<module>Photoslurp_PhotoslurpWidget</module>
|
78 |
-
<frontName>admin_photoslurpwidget</frontName>
|
79 |
-
</args>
|
80 |
-
</photoslurpwidget>
|
81 |
-
</routers>
|
82 |
-
</admin>
|
83 |
-
<adminhtml>
|
84 |
-
<menu>
|
85 |
-
<photoslurpwidget module="photoslurpwidget">
|
86 |
-
<title>Photoslurp</title>
|
87 |
-
<sort_order>90</sort_order>
|
88 |
-
<children>
|
89 |
-
<photoslurpwidget module="photoslurpwidget">
|
90 |
-
<title>Manage Widgets</title>
|
91 |
-
<sort_order>0</sort_order>
|
92 |
-
<action>admin_photoslurpwidget/adminhtml_photoslurpwidget</action>
|
93 |
-
</photoslurpwidget>
|
94 |
-
<photoslurpwidgetbackend module="photoslurpwidget">
|
95 |
-
<title>Export Products</title>
|
96 |
-
<sort_order>1</sort_order>
|
97 |
-
<action>admin_photoslurpwidget/adminhtml_photoslurpwidgetbackend</action>
|
98 |
-
</photoslurpwidgetbackend>
|
99 |
-
</children>
|
100 |
-
</photoslurpwidget>
|
101 |
-
</menu>
|
102 |
-
<acl>
|
103 |
-
<resources>
|
104 |
-
<all>
|
105 |
-
<title>Allow Everything</title>
|
106 |
-
</all>
|
107 |
-
<admin>
|
108 |
-
<children>
|
109 |
-
<photoslurpwidget translate="title" module="photoslurpwidget">
|
110 |
-
<title>Photoslurp Widget</title>
|
111 |
-
<sort_order>1000</sort_order>
|
112 |
-
<children>
|
113 |
-
<photoslurpwidget translate="title">
|
114 |
-
<title>Manage Widgets</title>
|
115 |
-
<sort_order>0</sort_order>
|
116 |
-
</photoslurpwidget>
|
117 |
-
</children>
|
118 |
-
</photoslurpwidget>
|
119 |
-
</children>
|
120 |
-
</admin>
|
121 |
-
</resources>
|
122 |
-
</acl>
|
123 |
-
<layout>
|
124 |
-
<updates>
|
125 |
-
<photoslurpwidget>
|
126 |
-
<file>photoslurpwidget.xml</file>
|
127 |
-
</photoslurpwidget>
|
128 |
-
</updates>
|
129 |
-
</layout>
|
130 |
-
</adminhtml>
|
131 |
-
<crontab>
|
132 |
-
<jobs>
|
133 |
-
<photoslurpwidget_photoslurpexport>
|
134 |
-
<schedule><cron_expr>0 2 * * *</cron_expr></schedule>
|
135 |
-
<run><model>photoslurpwidget/cron::photoslurpExport</model></run>
|
136 |
-
</photoslurpwidget_photoslurpexport>
|
137 |
-
</jobs>
|
138 |
-
</crontab>
|
139 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PhotoslurpWidget/etc/system.xml
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<tabs>
|
4 |
-
<photoslurp translate="label" module="photoslurpwidget">
|
5 |
-
<label>Photoslurp</label>
|
6 |
-
<sort_order>100</sort_order>
|
7 |
-
</photoslurp>
|
8 |
-
</tabs>
|
9 |
-
<sections>
|
10 |
-
<export translate="label" module="photoslurpwidget">
|
11 |
-
<label>Product Export</label>
|
12 |
-
<tab>photoslurp</tab>
|
13 |
-
<frontend_type>text</frontend_type>
|
14 |
-
<sort_order>20</sort_order>
|
15 |
-
<show_in_default>1</show_in_default>
|
16 |
-
<show_in_website>1</show_in_website>
|
17 |
-
<show_in_store>1</show_in_store>
|
18 |
-
<groups>
|
19 |
-
<export_configuration translate="label">
|
20 |
-
<label>Export Configuration</label>
|
21 |
-
<frontend_type>text</frontend_type>
|
22 |
-
<sort_order>0</sort_order>
|
23 |
-
<show_in_default>1</show_in_default>
|
24 |
-
<show_in_website>1</show_in_website>
|
25 |
-
<show_in_store>1</show_in_store>
|
26 |
-
<fields>
|
27 |
-
<cron_enable translate="label">
|
28 |
-
<label>Auto export</label>
|
29 |
-
<frontend_type>select</frontend_type>
|
30 |
-
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
31 |
-
<sort_order>0</sort_order>
|
32 |
-
<show_in_default>1</show_in_default>
|
33 |
-
<show_in_website>1</show_in_website>
|
34 |
-
<show_in_store>1</show_in_store>
|
35 |
-
<comment>Export every 24 hours.</comment>
|
36 |
-
</cron_enable>
|
37 |
-
</fields>
|
38 |
-
</export_configuration>
|
39 |
-
</groups>
|
40 |
-
</export>
|
41 |
-
</sections>
|
42 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Photoslurp/PsWidget/Block/Adminhtml/PsWidgetbackend.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Photoslurp_PsWidget_Block_Adminhtml_PsWidgetbackend extends Mage_Adminhtml_Block_Template {
|
4 |
+
|
5 |
+
}
|
app/code/community/Photoslurp/PsWidget/Block/Adminhtml/Pswidget.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class Photoslurp_PsWidget_Block_Adminhtml_Pswidget extends Mage_Adminhtml_Block_Widget_Grid_Container{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
|
9 |
+
$this->_controller = "adminhtml_pswidget";
|
10 |
+
$this->_blockGroup = "pswidget";
|
11 |
+
$this->_headerText = Mage::helper("pswidget")->__("Photoslurp Widget Manager");
|
12 |
+
$this->_addButtonLabel = Mage::helper("pswidget")->__("Add New Item");
|
13 |
+
parent::__construct();
|
14 |
+
|
15 |
+
}
|
16 |
+
|
17 |
+
}
|
app/code/community/Photoslurp/PsWidget/Block/Adminhtml/Pswidget/Edit.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
|
8 |
+
parent::__construct();
|
9 |
+
$this->_objectId = "id";
|
10 |
+
$this->_blockGroup = "pswidget";
|
11 |
+
$this->_controller = "adminhtml_pswidget";
|
12 |
+
$this->_updateButton("save", "label", Mage::helper("pswidget")->__("Save Item"));
|
13 |
+
$this->_updateButton("delete", "label", Mage::helper("pswidget")->__("Delete Item"));
|
14 |
+
|
15 |
+
$this->_addButton("saveandcontinue", array(
|
16 |
+
"label" => Mage::helper("pswidget")->__("Save And Continue Edit"),
|
17 |
+
"onclick" => "saveAndContinueEdit()",
|
18 |
+
"class" => "save",
|
19 |
+
), -100);
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
+
$this->_formScripts[] = "
|
24 |
+
|
25 |
+
function saveAndContinueEdit(){
|
26 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
27 |
+
}
|
28 |
+
";
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getHeaderText()
|
32 |
+
{
|
33 |
+
if( Mage::registry("pswidget_data") && Mage::registry("pswidget_data")->getId() ){
|
34 |
+
|
35 |
+
return Mage::helper("pswidget")->__("Edit Item '%s'", $this->htmlEscape(Mage::registry("pswidget_data")->getId()));
|
36 |
+
|
37 |
+
}
|
38 |
+
else{
|
39 |
+
|
40 |
+
return Mage::helper("pswidget")->__("Add Item");
|
41 |
+
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
app/code/community/Photoslurp/{PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget → PsWidget/Block/Adminhtml/Pswidget}/Edit/Form.php
RENAMED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
class
|
3 |
{
|
4 |
protected function _prepareForm()
|
5 |
{
|
1 |
<?php
|
2 |
+
class Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
3 |
{
|
4 |
protected function _prepareForm()
|
5 |
{
|
app/code/community/Photoslurp/PsWidget/Block/Adminhtml/Pswidget/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$stores = Mage::app()->getStores();
|
8 |
+
$stores_count = count($stores);
|
9 |
+
|
10 |
+
|
11 |
+
$form = new Varien_Data_Form();
|
12 |
+
$this->setForm($form);
|
13 |
+
$fieldset = $form->addFieldset("pswidget_form", array("legend" => Mage::helper("pswidget")->__("Configuration parameters")));
|
14 |
+
|
15 |
+
$fieldset->addField('widget_enable', 'select', array(
|
16 |
+
'label' => Mage::helper('pswidget')->__('Enable'),
|
17 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
18 |
+
'name' => 'widget_enable',
|
19 |
+
"class" => "required-entry",
|
20 |
+
"required" => true,
|
21 |
+
|
22 |
+
));
|
23 |
+
|
24 |
+
$fieldset->addField("user_name", "text", array(
|
25 |
+
"label" => Mage::helper("pswidget")->__("User Name"),
|
26 |
+
"class" => "required-entry",
|
27 |
+
"required" => true,
|
28 |
+
"name" => "user_name",
|
29 |
+
'after_element_html' => "<br><i>Your Photoslurp user name</i>"
|
30 |
+
));
|
31 |
+
|
32 |
+
// $fieldset->addField("widget_container_id", "text", array(
|
33 |
+
// "label" => Mage::helper("pswidget")->__("Widget Container Id"),
|
34 |
+
// "class" => "required-entry",
|
35 |
+
// "required" => true,
|
36 |
+
// "name" => "widget_container_id",
|
37 |
+
// 'after_element_html' => "<i>Please choose a unique HTML container ID to hold the widget</i>"
|
38 |
+
// ));
|
39 |
+
|
40 |
+
$fieldset->addField("widget_id", "text", array(
|
41 |
+
"label" => Mage::helper("pswidget")->__("Widget Id"),
|
42 |
+
"class" => "required-entry",
|
43 |
+
"required" => true,
|
44 |
+
"name" => "widget_id",
|
45 |
+
'after_element_html' => "<br><i>A unique identifier for each of the widgets you use on your website</i>"
|
46 |
+
));
|
47 |
+
|
48 |
+
$fieldset->addField("album_id", "text", array(
|
49 |
+
"label" => Mage::helper("pswidget")->__("Album Id"),
|
50 |
+
"class" => "required-entry",
|
51 |
+
"required" => true,
|
52 |
+
"name" => "album_id",
|
53 |
+
'after_element_html' => '<i>This is the ID number of your campaign</i>'
|
54 |
+
));
|
55 |
+
|
56 |
+
$fieldset->addField('widget_type', 'select', array(
|
57 |
+
'label' => Mage::helper('pswidget')->__('Widget Type'),
|
58 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArray5(),
|
59 |
+
'name' => 'widget_type',
|
60 |
+
"class" => "required-entry",
|
61 |
+
"required" => true,
|
62 |
+
'after_element_html' => '<i>This is either set to carousel or gallery depending on how you would like to display your pictures. Carousel has been specifically designed to be placed on your product pages, and Gallery to be used as a separate gallery page<i>'
|
63 |
+
));
|
64 |
+
|
65 |
+
$fieldset->addField('page_type', 'select', array(
|
66 |
+
'label' => Mage::helper('pswidget')->__('Page Type'),
|
67 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArray10(),
|
68 |
+
'name' => 'page_type',
|
69 |
+
"class" => "required-entry",
|
70 |
+
"required" => true,
|
71 |
+
'after_element_html' => '<i>This parameter is used in analytics calculations</i>'
|
72 |
+
));
|
73 |
+
|
74 |
+
$fieldset->addField('position', 'select', array(
|
75 |
+
'label' => Mage::helper('pswidget')->__('Position'),
|
76 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayPosition(),
|
77 |
+
'name' => 'position',
|
78 |
+
"class" => "required-entry",
|
79 |
+
"required" => true,
|
80 |
+
'after_element_html' => '<i>Position on product page</i>'
|
81 |
+
));
|
82 |
+
|
83 |
+
$fieldset->addField("page_limit", "text", array(
|
84 |
+
"label" => Mage::helper("pswidget")->__("Page Limit"),
|
85 |
+
"class" => "required-entry",
|
86 |
+
"required" => true,
|
87 |
+
"name" => "page_limit",
|
88 |
+
"value" => 15,
|
89 |
+
'after_element_html' => '<i>The number of images to load per page for both the Gallery and Carousel modes</i>'
|
90 |
+
));
|
91 |
+
|
92 |
+
$fieldset->addField("toc_link", "text", array(
|
93 |
+
"label" => Mage::helper("pswidget")->__("T&C Link for Frontend Uploader"),
|
94 |
+
"required" => true,
|
95 |
+
"name" => "toc_link",
|
96 |
+
'after_element_html' => '<i>The link to your T&C page that users will have to agree to when uploading photos using the frontend uploader</i>',
|
97 |
+
));
|
98 |
+
|
99 |
+
$fieldset->addField('random_order', 'select', array(
|
100 |
+
'label' => Mage::helper('pswidget')->__('Photo Order'),
|
101 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayPhotoOrder(),
|
102 |
+
'name' => 'random_order'
|
103 |
+
));
|
104 |
+
|
105 |
+
$fieldset->addField('allow_empty', 'select', array(
|
106 |
+
'label' => Mage::helper('pswidget')->__('Allow Empty'),
|
107 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
108 |
+
'name' => 'allow_empty',
|
109 |
+
'after_element_html' => '<i>When set to no, this option will ensure that all photos are returned on product pages when a product does not have any photos associated with it</i>'
|
110 |
+
));
|
111 |
+
|
112 |
+
$fieldset->addField('show_submit', 'select', array(
|
113 |
+
'label' => Mage::helper('pswidget')->__('Show Submit'),
|
114 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
115 |
+
'name' => 'show_submit',
|
116 |
+
'after_element_html' => '<i>This parameter will enable the frontend upload widget, and display a Submit button</i>'
|
117 |
+
));
|
118 |
+
|
119 |
+
|
120 |
+
|
121 |
+
$i = 0;
|
122 |
+
foreach($stores as $store){
|
123 |
+
if ($i == 0) {
|
124 |
+
$fieldset->addField("submit_text_".$store->getId(), "text", array(
|
125 |
+
"label" => Mage::helper("pswidget")->__("Submit Text"),
|
126 |
+
"name" => "submit_text_".$store->getId(),
|
127 |
+
"class" => "submit_text",
|
128 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'
|
129 |
+
|
130 |
+
));
|
131 |
+
} else if ($i == $stores_count - 1) {
|
132 |
+
$fieldset->addField("submit_text_".$store->getId(), "text", array(
|
133 |
+
"name" => "submit_text_".$store->getId(),
|
134 |
+
"class" => "submit_text",
|
135 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'. '<br><i>This is the text that will be displayed on the Submit button</i>'
|
136 |
+
));
|
137 |
+
}else{
|
138 |
+
$fieldset->addField("submit_text_".$store->getId(), "text", array(
|
139 |
+
"name" => "submit_text_".$store->getId(),
|
140 |
+
"class" => "submit_text",
|
141 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'
|
142 |
+
|
143 |
+
));
|
144 |
+
}
|
145 |
+
$i++;
|
146 |
+
};
|
147 |
+
|
148 |
+
$i = 0;
|
149 |
+
foreach($stores as $store){
|
150 |
+
if ($i == 0) {
|
151 |
+
$fieldset->addField("shop_this_look_text_".$store->getId(), "text", array(
|
152 |
+
"label" => Mage::helper("pswidget")->__("Shop This Look Text"),
|
153 |
+
"name" => "shop_this_look_text_".$store->getId(),
|
154 |
+
"class" => "shop_this_look_text",
|
155 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'
|
156 |
+
|
157 |
+
));
|
158 |
+
} else if ($i == $stores_count - 1) {
|
159 |
+
$fieldset->addField("shop_this_look_text_".$store->getId(), "text", array(
|
160 |
+
"name" => "shop_this_look_text_".$store->getId(),
|
161 |
+
"class" => "shop_this_look_text",
|
162 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'
|
163 |
+
));
|
164 |
+
}else{
|
165 |
+
$fieldset->addField("shop_this_look_text_".$store->getId(), "text", array(
|
166 |
+
"name" => "shop_this_look_text_".$store->getId(),
|
167 |
+
"class" => "shop_this_look_text",
|
168 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'
|
169 |
+
|
170 |
+
));
|
171 |
+
}
|
172 |
+
$i++;
|
173 |
+
};
|
174 |
+
|
175 |
+
$fieldset->addField("add_photos_img", "text", array(
|
176 |
+
"label" => Mage::helper("pswidget")->__("Add Photos Img"),
|
177 |
+
"name" => "add_photos_img",
|
178 |
+
'after_element_html' => '<i>This requires a URL to an image that will be displayed when there are no images yet in a particular album (for example when the productId parameter is used, and there are no photos for particular product yet). A banner inviting users to submit images is recommended to be used here</i>'
|
179 |
+
));
|
180 |
+
|
181 |
+
$i = 0;
|
182 |
+
foreach($stores as $store){
|
183 |
+
if ($i == 0) {
|
184 |
+
$fieldset->addField("note_add_pics_text_".$store->getId(), "text", array(
|
185 |
+
"label" => Mage::helper("pswidget")->__("Note Add Pics Text"),
|
186 |
+
"name" => "note_add_pics_text_".$store->getId(),
|
187 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'
|
188 |
+
|
189 |
+
));
|
190 |
+
} else if ($i == $stores_count - 1) {
|
191 |
+
$fieldset->addField("note_add_pics_text_".$store->getId(), "text", array(
|
192 |
+
"name" => "note_add_pics_text_".$store->getId(),
|
193 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'. '<br><i>This is the text to be added on the top of your Gallery or Carousel, and can be used to let your users know how they can add their own pictures</i>'
|
194 |
+
));
|
195 |
+
}else{
|
196 |
+
$fieldset->addField("note_add_pics_text_".$store->getId(), "text", array(
|
197 |
+
"name" => "note_add_pics_text_".$store->getId(),
|
198 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'
|
199 |
+
|
200 |
+
));
|
201 |
+
}
|
202 |
+
$i++;
|
203 |
+
};
|
204 |
+
|
205 |
+
$fieldset->addField('social_icons', 'select', array(
|
206 |
+
'label' => Mage::helper('pswidget')->__('Social Icons'),
|
207 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
208 |
+
'value' => 1,
|
209 |
+
'name' => 'social_icons',
|
210 |
+
'after_element_html' => '<i>Enable social icons in the lightbox to allow users to share pictures back to social networks</i>'
|
211 |
+
));
|
212 |
+
|
213 |
+
$fieldset->addField("image_height", "text", array(
|
214 |
+
"label" => Mage::helper("pswidget")->__("Image Height, px"),
|
215 |
+
"class" => "required-entry",
|
216 |
+
"required" => true,
|
217 |
+
"name" => "image_height",
|
218 |
+
"value" => 200,
|
219 |
+
'after_element_html' => '<i>This is an option specific to the Carousel widget type, and sets the height of the thumbnail images and therefore the carousel</i>'
|
220 |
+
));
|
221 |
+
|
222 |
+
$fieldset->addField("image_width", "text", array(
|
223 |
+
"label" => Mage::helper("pswidget")->__("Image Width, px"),
|
224 |
+
"class" => "required-entry",
|
225 |
+
"required" => true,
|
226 |
+
"name" => "image_width",
|
227 |
+
"value" => 200,
|
228 |
+
'after_element_html' => '<i>This option is specific to the Gallery widget type, and sets the width of each thumbnail in the Gallery view</i>'
|
229 |
+
));
|
230 |
+
|
231 |
+
if (Mage::getSingleton("adminhtml/session")->getPswidgetData()) {
|
232 |
+
$form->setValues(Mage::getSingleton("adminhtml/session")->getPswidgetData());
|
233 |
+
Mage::getSingleton("adminhtml/session")->setPswidgetData(null);
|
234 |
+
} elseif (Mage::registry("pswidget_data")) {
|
235 |
+
|
236 |
+
$values = Mage::registry("pswidget_data")->getData();
|
237 |
+
|
238 |
+
if(Mage::registry("pswidget_translations")){
|
239 |
+
foreach (Mage::registry("pswidget_translations") as $translation){
|
240 |
+
$widget_lang_data = $translation->getData();
|
241 |
+
$form_data['submit_text_'.$widget_lang_data['id_lang']] = $widget_lang_data['submit_text'];
|
242 |
+
$form_data['shop_this_look_text_'.$widget_lang_data['id_lang']] = $widget_lang_data['shop_this_look_text'];
|
243 |
+
$form_data['note_add_pics_text_'.$widget_lang_data['id_lang']] = $widget_lang_data['note_add_pics_text'];
|
244 |
+
$values = array_merge($values, $form_data);
|
245 |
+
}
|
246 |
+
}
|
247 |
+
|
248 |
+
|
249 |
+
if (!empty($values)) {
|
250 |
+
if($values['image_height'] <= 0) $values['image_height'] = 200;
|
251 |
+
if($values['image_width'] <= 0) $values['image_width'] = 200;
|
252 |
+
$form->setValues($values);
|
253 |
+
}
|
254 |
+
}
|
255 |
+
return parent::_prepareForm();
|
256 |
+
}
|
257 |
+
}
|
app/code/community/Photoslurp/{PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget → PsWidget/Block/Adminhtml/Pswidget}/Edit/Tab/Form1.php
RENAMED
@@ -1,88 +1,88 @@
|
|
1 |
<?php
|
2 |
-
class
|
3 |
{
|
4 |
protected function _prepareForm()
|
5 |
{
|
6 |
|
7 |
$form = new Varien_Data_Form();
|
8 |
$this->setForm($form);
|
9 |
-
$fieldset = $form->addFieldset("
|
10 |
|
11 |
$groups = array(
|
12 |
array(
|
13 |
'code' =>'submissionform',
|
14 |
'label' => 'Submission Form',
|
15 |
'fields' => array(
|
16 |
-
array('code'=>'style_submissionform_colourtop','label'=>'Colour Top', 'afterhtml'=>'<i>Default #4F5F6F</i>'),
|
17 |
-
array('code'=>'style_submissionform_colourbutton','label'=>'Colour Button', 'afterhtml'=>'<i>Default #5DADE2</i>'),
|
18 |
-
array('code'=>'style_submissionform_font','label'=>'Font', 'afterhtml'=>'<i>Default "Open Sans"</i>')
|
19 |
)
|
20 |
),
|
21 |
array(
|
22 |
'code' =>'taggingtitle',
|
23 |
'label' => 'Tagging Title',
|
24 |
'fields' => array(
|
25 |
-
array('code'=>'style_taggingtitle_font_family','label'=>'Font Family'),
|
26 |
-
array('code'=>'style_taggingtitle_font_style','label'=>'Font Style'),
|
27 |
-
array('code'=>'style_taggingtitle_font_weight','label'=>'Font Weight'),
|
28 |
-
array('code'=>'style_taggingtitle_font_color','label'=>'Font Color'),
|
29 |
-
array('code'=>'style_taggingtitle_font_size','label'=>'Font Size')
|
30 |
)
|
31 |
),
|
32 |
array(
|
33 |
'code' =>'thumbnail',
|
34 |
'label' => 'Thumbnail',
|
35 |
'fields' => array(
|
36 |
-
array('code'=>'style_thumbnail_bg_color','label'=>'Background Color'),
|
37 |
-
array('code'=>'style_thumbnail_border_color','label'=>'Border Color')
|
38 |
)
|
39 |
),
|
40 |
array(
|
41 |
'code' =>'carousel',
|
42 |
'label' => 'Carousel',
|
43 |
'fields' => array(
|
44 |
-
array('code'=>'style_carousel_bg_color','label'=>'Background Color'),
|
45 |
)
|
46 |
),
|
47 |
array(
|
48 |
'code' =>'popup',
|
49 |
'label' => 'Popup',
|
50 |
'fields' => array(
|
51 |
-
array('code'=>'style_popup_bg_color','label'=>'Background Color'),
|
52 |
-
array('code'=>'style_popup_title_font_family','label'=>'Title Font Family'),
|
53 |
-
array('code'=>'style_popup_title_font_style','label'=>'Title Font Style'),
|
54 |
-
array('code'=>'style_popup_title_font_weight','label'=>'Title Font Weight'),
|
55 |
-
array('code'=>'style_popup_title_font_color','label'=>'Title Font Color')
|
56 |
)
|
57 |
),
|
58 |
array(
|
59 |
'code' =>'source',
|
60 |
'label' => 'Source',
|
61 |
'fields' => array(
|
62 |
-
array('code'=>'style_source_font_family','label'=>'Font Family'),
|
63 |
-
array('code'=>'style_source_font_style','label'=>'Font Style'),
|
64 |
-
array('code'=>'style_source_font_weight','label'=>'Font Weight'),
|
65 |
-
array('code'=>'style_source_font_color','label'=>'Font Color')
|
66 |
)
|
67 |
),
|
68 |
array(
|
69 |
'code' =>'productcaptionshop',
|
70 |
'label' => 'Product Caption Shop',
|
71 |
'fields' => array(
|
72 |
-
array('code'=>'style_productcaptionshop_font_family','label'=>'Font Family'),
|
73 |
-
array('code'=>'style_productcaptionshop_font_style','label'=>'Font Style'),
|
74 |
-
array('code'=>'style_productcaptionshop_font_weight','label'=>'Font Weight'),
|
75 |
-
array('code'=>'style_productcaptionshop_font_color','label'=>'Font Color')
|
76 |
)
|
77 |
),
|
78 |
array(
|
79 |
'code' =>'productdescription',
|
80 |
'label' => 'Product Description',
|
81 |
'fields' => array(
|
82 |
-
array('code'=>'style_productdescription_font_family','label'=>'Font Family'),
|
83 |
-
array('code'=>'style_productdescription_font_style','label'=>'Font Style'),
|
84 |
-
array('code'=>'style_productdescription_font_weight','label'=>'Font Weight'),
|
85 |
-
array('code'=>'style_productdescription_font_color','label'=>'Font Color')
|
86 |
)
|
87 |
)
|
88 |
);
|
@@ -94,21 +94,24 @@ class Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Edit_Tab_Form
|
|
94 |
));
|
95 |
foreach($group['fields'] as $field){
|
96 |
$fieldset->addField($field['code'], "text", array(
|
97 |
-
"label" => Mage::helper("
|
98 |
"name" => $field['code'],
|
|
|
99 |
'after_element_html'=> $field['afterhtml']
|
100 |
));
|
101 |
}
|
102 |
}
|
103 |
|
104 |
|
105 |
-
if (Mage::getSingleton("adminhtml/session")->
|
106 |
{
|
107 |
-
$form->setValues(Mage::getSingleton("adminhtml/session")->
|
108 |
-
Mage::getSingleton("adminhtml/session")->
|
109 |
}
|
110 |
-
elseif(Mage::registry("
|
111 |
-
|
|
|
|
|
112 |
}
|
113 |
return parent::_prepareForm();
|
114 |
}
|
1 |
<?php
|
2 |
+
class Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Edit_Tab_Form1 extends Mage_Adminhtml_Block_Widget_Form
|
3 |
{
|
4 |
protected function _prepareForm()
|
5 |
{
|
6 |
|
7 |
$form = new Varien_Data_Form();
|
8 |
$this->setForm($form);
|
9 |
+
$fieldset = $form->addFieldset("pswidget_form", array("legend"=>Mage::helper("pswidget")->__("Style parameters")));
|
10 |
|
11 |
$groups = array(
|
12 |
array(
|
13 |
'code' =>'submissionform',
|
14 |
'label' => 'Submission Form',
|
15 |
'fields' => array(
|
16 |
+
array('code'=>'style_submissionform_colourtop','label'=>'Colour Top','value'=>'', 'afterhtml'=>'<i>Default #4F5F6F</i>'),
|
17 |
+
array('code'=>'style_submissionform_colourbutton','label'=>'Colour Button','value'=>'', 'afterhtml'=>'<i>Default #5DADE2</i>'),
|
18 |
+
array('code'=>'style_submissionform_font','label'=>'Font','value'=>'', 'afterhtml'=>'<i>Default "Open Sans"</i>')
|
19 |
)
|
20 |
),
|
21 |
array(
|
22 |
'code' =>'taggingtitle',
|
23 |
'label' => 'Tagging Title',
|
24 |
'fields' => array(
|
25 |
+
array('code'=>'style_taggingtitle_font_family','value'=>'','label'=>'Font Family', 'afterhtml'=>''),
|
26 |
+
array('code'=>'style_taggingtitle_font_style','value'=>'','label'=>'Font Style', 'afterhtml'=>''),
|
27 |
+
array('code'=>'style_taggingtitle_font_weight','value'=>'','label'=>'Font Weight', 'afterhtml'=>''),
|
28 |
+
array('code'=>'style_taggingtitle_font_color','value'=>'','label'=>'Font Color', 'afterhtml'=>''),
|
29 |
+
array('code'=>'style_taggingtitle_font_size','value'=>'','label'=>'Font Size', 'afterhtml'=>'')
|
30 |
)
|
31 |
),
|
32 |
array(
|
33 |
'code' =>'thumbnail',
|
34 |
'label' => 'Thumbnail',
|
35 |
'fields' => array(
|
36 |
+
array('code'=>'style_thumbnail_bg_color','label'=>'Background Color','value'=>'', 'afterhtml'=>''),
|
37 |
+
array('code'=>'style_thumbnail_border_color','label'=>'Border Color','value'=>'#fff', 'afterhtml'=>'')
|
38 |
)
|
39 |
),
|
40 |
array(
|
41 |
'code' =>'carousel',
|
42 |
'label' => 'Carousel',
|
43 |
'fields' => array(
|
44 |
+
array('code'=>'style_carousel_bg_color','label'=>'Background Color','value'=>'', 'afterhtml'=>''),
|
45 |
)
|
46 |
),
|
47 |
array(
|
48 |
'code' =>'popup',
|
49 |
'label' => 'Popup',
|
50 |
'fields' => array(
|
51 |
+
array('code'=>'style_popup_bg_color','label'=>'Background Color','value'=>'', 'afterhtml'=>''),
|
52 |
+
array('code'=>'style_popup_title_font_family','label'=>'Title Font Family','value'=>'', 'afterhtml'=>''),
|
53 |
+
array('code'=>'style_popup_title_font_style','label'=>'Title Font Style','value'=>'', 'afterhtml'=>''),
|
54 |
+
array('code'=>'style_popup_title_font_weight','label'=>'Title Font Weight','value'=>'', 'afterhtml'=>''),
|
55 |
+
array('code'=>'style_popup_title_font_color','label'=>'Title Font Color','value'=>'', 'afterhtml'=>'')
|
56 |
)
|
57 |
),
|
58 |
array(
|
59 |
'code' =>'source',
|
60 |
'label' => 'Source',
|
61 |
'fields' => array(
|
62 |
+
array('code'=>'style_source_font_family','label'=>'Font Family','value'=>'', 'afterhtml'=>''),
|
63 |
+
array('code'=>'style_source_font_style','label'=>'Font Style','value'=>'', 'afterhtml'=>''),
|
64 |
+
array('code'=>'style_source_font_weight','label'=>'Font Weight','value'=>'', 'afterhtml'=>''),
|
65 |
+
array('code'=>'style_source_font_color','label'=>'Font Color','value'=>'', 'afterhtml'=>'')
|
66 |
)
|
67 |
),
|
68 |
array(
|
69 |
'code' =>'productcaptionshop',
|
70 |
'label' => 'Product Caption Shop',
|
71 |
'fields' => array(
|
72 |
+
array('code'=>'style_productcaptionshop_font_family','label'=>'Font Family','value'=>'', 'afterhtml'=>''),
|
73 |
+
array('code'=>'style_productcaptionshop_font_style','label'=>'Font Style','value'=>'', 'afterhtml'=>''),
|
74 |
+
array('code'=>'style_productcaptionshop_font_weight','label'=>'Font Weight','value'=>'', 'afterhtml'=>''),
|
75 |
+
array('code'=>'style_productcaptionshop_font_color','label'=>'Font Color','value'=>'', 'afterhtml'=>'')
|
76 |
)
|
77 |
),
|
78 |
array(
|
79 |
'code' =>'productdescription',
|
80 |
'label' => 'Product Description',
|
81 |
'fields' => array(
|
82 |
+
array('code'=>'style_productdescription_font_family','label'=>'Font Family','value'=>'', 'afterhtml'=>''),
|
83 |
+
array('code'=>'style_productdescription_font_style','label'=>'Font Style','value'=>'', 'afterhtml'=>''),
|
84 |
+
array('code'=>'style_productdescription_font_weight','label'=>'Font Weight','value'=>'', 'afterhtml'=>''),
|
85 |
+
array('code'=>'style_productdescription_font_color','label'=>'Font Color','value'=>'', 'afterhtml'=>'')
|
86 |
)
|
87 |
)
|
88 |
);
|
94 |
));
|
95 |
foreach($group['fields'] as $field){
|
96 |
$fieldset->addField($field['code'], "text", array(
|
97 |
+
"label" => Mage::helper("pswidget")->__($field['label']),
|
98 |
"name" => $field['code'],
|
99 |
+
"value"=> $field['value'],
|
100 |
'after_element_html'=> $field['afterhtml']
|
101 |
));
|
102 |
}
|
103 |
}
|
104 |
|
105 |
|
106 |
+
if (Mage::getSingleton("adminhtml/session")->getPswidgetData())
|
107 |
{
|
108 |
+
$form->setValues(Mage::getSingleton("adminhtml/session")->getPswidgetData());
|
109 |
+
Mage::getSingleton("adminhtml/session")->setPswidgetData(null);
|
110 |
}
|
111 |
+
elseif(Mage::registry("pswidget_data")) {
|
112 |
+
if (Mage::registry("pswidget_data")->getData()) {
|
113 |
+
$form->setValues(Mage::registry("pswidget_data")->getData());
|
114 |
+
}
|
115 |
}
|
116 |
return parent::_prepareForm();
|
117 |
}
|
app/code/community/Photoslurp/PsWidget/Block/Adminhtml/Pswidget/Edit/Tab/Form2.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Edit_Tab_Form2 extends Mage_Adminhtml_Block_Widget_Form
|
3 |
+
{
|
4 |
+
protected function _prepareForm()
|
5 |
+
{
|
6 |
+
|
7 |
+
$form = new Varien_Data_Form();
|
8 |
+
$this->setForm($form);
|
9 |
+
$fieldset = $form->addFieldset("pswidget_form", array("legend"=>Mage::helper("pswidget")->__("Custom CSS")));
|
10 |
+
|
11 |
+
$fieldset->addField("style_custom", "textarea", array(
|
12 |
+
"label" => Mage::helper("pswidget")->__("Custom CSS"),
|
13 |
+
"name" => "style_custom",
|
14 |
+
'after_element_html' => '<i>Enter your custom CSS code here. Only requires dot notation with !important flag. Eg: .galleria-info-product-description { margin-top:50px !important }</i>'
|
15 |
+
|
16 |
+
));
|
17 |
+
|
18 |
+
if (Mage::getSingleton("adminhtml/session")->getPswidgetData())
|
19 |
+
{
|
20 |
+
$form->setValues(Mage::getSingleton("adminhtml/session")->getPswidgetData());
|
21 |
+
Mage::getSingleton("adminhtml/session")->setPswidgetData(null);
|
22 |
+
}
|
23 |
+
elseif(Mage::registry("pswidget_data")) {
|
24 |
+
$form->setValues(Mage::registry("pswidget_data")->getData());
|
25 |
+
}
|
26 |
+
return parent::_prepareForm();
|
27 |
+
}
|
28 |
+
}
|
app/code/community/Photoslurp/PsWidget/Block/Adminhtml/Pswidget/Edit/Tab/Form3.php
ADDED
@@ -0,0 +1,216 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Edit_Tab_Form3 extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$stores = Mage::app()->getStores();
|
8 |
+
$stores_count = count($stores);
|
9 |
+
|
10 |
+
|
11 |
+
$form = new Varien_Data_Form();
|
12 |
+
$this->setForm($form);
|
13 |
+
$fieldset2 = $form->addFieldset("pswidget_form_additional", array("legend" => Mage::helper("pswidget")->__("Advanced parameters")));
|
14 |
+
|
15 |
+
// advanced section
|
16 |
+
$fieldset2->addField("autoscroll_limit", "text", array(
|
17 |
+
"label" => Mage::helper("pswidget")->__("Autoscroll Limit"),
|
18 |
+
"name" => "autoscroll_limit",
|
19 |
+
'after_element_html' => '<i>The number of pages to load before showing a Load More button. Leave blank for infinite scroll</i>'
|
20 |
+
));
|
21 |
+
|
22 |
+
$i = 0;
|
23 |
+
foreach($stores as $store){
|
24 |
+
if ($i == 0) {
|
25 |
+
$fieldset2->addField("load_more_text_".$store->getId(), "text", array(
|
26 |
+
"label" => Mage::helper("pswidget")->__("Load More Text"),
|
27 |
+
"name" => "load_more_text_".$store->getId(),
|
28 |
+
"class" => "load_more_text",
|
29 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'
|
30 |
+
|
31 |
+
));
|
32 |
+
} else if ($i == $stores_count - 1) {
|
33 |
+
$fieldset2->addField("load_more_text_".$store->getId(), "text", array(
|
34 |
+
"name" => "load_more_text_".$store->getId(),
|
35 |
+
"class" => "load_more_text",
|
36 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'. '<br><i>Related to the autoscrollLimit parameter, this parameter relates to the text that will be displayed on the Load More button</i>'
|
37 |
+
));
|
38 |
+
}else{
|
39 |
+
$fieldset2->addField("load_more_text_".$store->getId(), "text", array(
|
40 |
+
"name" => "load_more_text_".$store->getId(),
|
41 |
+
"class" => "load_more_text",
|
42 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'
|
43 |
+
|
44 |
+
));
|
45 |
+
}
|
46 |
+
$i++;
|
47 |
+
};
|
48 |
+
|
49 |
+
$fieldset2->addField('enable_ga', 'select', array(
|
50 |
+
'label' => Mage::helper('pswidget')->__('Enable GA'),
|
51 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
52 |
+
'name' => 'enable_ga',
|
53 |
+
'after_element_html' => '<i>Enable Google Analytics. When this is enabled, all events collected from Photoslurp widgets will also be sent to the Google analytics property already configured on your website</i>'
|
54 |
+
));
|
55 |
+
|
56 |
+
$fieldset2->addField("init_delay", "text", array(
|
57 |
+
"label" => Mage::helper("pswidget")->__("Init Delay"),
|
58 |
+
"name" => "init_delay",
|
59 |
+
'after_element_html' => '<i>In cases where other page elements end up interfering with the Photoslurp widget, a millisecond value can be set here to delay it’s loading and prevent interference</i>'
|
60 |
+
));
|
61 |
+
|
62 |
+
$i = 0;
|
63 |
+
foreach($stores as $store){
|
64 |
+
if ($i == 0) {
|
65 |
+
$fieldset2->addField("cta_button_".$store->getId(), "text", array(
|
66 |
+
"label" => Mage::helper("pswidget")->__("CTA Button"),
|
67 |
+
"name" => "cta_button_".$store->getId(),
|
68 |
+
"class" => "cta_button",
|
69 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'
|
70 |
+
|
71 |
+
));
|
72 |
+
} else if ($i == $stores_count - 1) {
|
73 |
+
$fieldset2->addField("cta_button_".$store->getId(), "text", array(
|
74 |
+
"name" => "cta_button_".$store->getId(),
|
75 |
+
"class" => "cta_button",
|
76 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'. '<br><i>The text to be placed on a CTA button in the lightbox underneath the product image. Blank disables button</i>'
|
77 |
+
));
|
78 |
+
}else{
|
79 |
+
$fieldset2->addField("cta_button_".$store->getId(), "text", array(
|
80 |
+
"name" => "cta_button_".$store->getId(),
|
81 |
+
"class" => "cta_button",
|
82 |
+
'after_element_html' => '<br><b>['.$store->getCode().']</b>'
|
83 |
+
|
84 |
+
));
|
85 |
+
}
|
86 |
+
$i++;
|
87 |
+
};
|
88 |
+
|
89 |
+
$fieldset2->addField('social_count', 'select', array(
|
90 |
+
'label' => Mage::helper('pswidget')->__('Social Count'),
|
91 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
92 |
+
'name' => 'social_count',
|
93 |
+
'after_element_html' => '<i>Yes will show the number of likes and comments for each image in the lightbox when user hovers over it</i>'
|
94 |
+
));
|
95 |
+
|
96 |
+
$fieldset2->addField('thumb_overlay', 'select', array(
|
97 |
+
'label' => Mage::helper('pswidget')->__('Thumb Overlay'),
|
98 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
99 |
+
'name' => 'thumb_overlay',
|
100 |
+
'after_element_html' => '<i>Enable mouseover effect on thumbnails in Gallery mode showing author details</i>'
|
101 |
+
));
|
102 |
+
|
103 |
+
$fieldset2->addField('varying_thumb_sizes', 'select', array(
|
104 |
+
'label' => Mage::helper('pswidget')->__('Varying Thumb Sizes'),
|
105 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
106 |
+
'name' => 'varying_thumb_sizes',
|
107 |
+
'after_element_html' => '<i>Enable varying sized thumbnails in Gallery mode</i>'
|
108 |
+
));
|
109 |
+
|
110 |
+
$fieldset2->addField('auto_scroll_carousel', 'select', array(
|
111 |
+
'label' => Mage::helper('pswidget')->__('Auto Scroll Carousel'),
|
112 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
113 |
+
'name' => 'auto_scroll_carousel',
|
114 |
+
'after_element_html' => '<i>Enable auto scrolling of images in carousel mode</i>'
|
115 |
+
));
|
116 |
+
|
117 |
+
$fieldset2->addField('one_photo_per_line', 'select', array(
|
118 |
+
'label' => Mage::helper('pswidget')->__('One Photo Per Line'),
|
119 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
120 |
+
'name' => 'one_photo_per_line',
|
121 |
+
'after_element_html' => '<i>When enabled, ensures that only one photo per line is shown in Gallery mode on mobile</i>'
|
122 |
+
));
|
123 |
+
|
124 |
+
$fieldset2->addField("analytics_cookie_ttl", "text", array(
|
125 |
+
"label" => Mage::helper("pswidget")->__("Analytics Cookie TTL"),
|
126 |
+
"name" => "analytics_cookie_ttl",
|
127 |
+
'after_element_html' => '<i>Sets the TTL (in days) of the cookie we set on user’s browsers for their interactions to count towards our conversion analytics</i>',
|
128 |
+
'value'=>30
|
129 |
+
));
|
130 |
+
|
131 |
+
$fieldset2->addField("submission_form_css_url", "text", array(
|
132 |
+
"label" => Mage::helper("pswidget")->__("Use a custom CSS file for the frontend uploader"),
|
133 |
+
"name" => "submission_form_css_url",
|
134 |
+
'after_element_html' => '<i>Enter a custom CSS URL here to change the look and feel of the frontend uploader</i>'
|
135 |
+
));
|
136 |
+
|
137 |
+
$fieldset2->addField('strict_products', 'select', array(
|
138 |
+
'label' => Mage::helper('pswidget')->__('Strict Products'),
|
139 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
140 |
+
'name' => 'strict_products',
|
141 |
+
'after_element_html' => '<i>Ensures that product related photos are shown first, followed by all other photos in the campaign. Note: This parameter will overwrite allowEmpty</i>'
|
142 |
+
));
|
143 |
+
|
144 |
+
$fieldset2->addField('empty_threshold', 'select', array(
|
145 |
+
'label' => Mage::helper('pswidget')->__('Empty Threshold'),
|
146 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
147 |
+
'name' => 'empty_threshold',
|
148 |
+
'after_element_html' => '<i>Set a threshold of the minimum number of product related images that should exist before showing our carousel</i>'
|
149 |
+
));
|
150 |
+
|
151 |
+
$fieldset2->addField('in_stock_only', 'select', array(
|
152 |
+
'label' => Mage::helper('pswidget')->__('In Stock Only'),
|
153 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
154 |
+
'name' => 'in_stock_only',
|
155 |
+
"value" => 0,
|
156 |
+
'after_element_html' => '<i>Only returns photos to products that are in stock. Feature needs to be enabled for your account</i>'
|
157 |
+
));
|
158 |
+
|
159 |
+
$fieldset2->addField('rights_cleared_only', 'select', array(
|
160 |
+
'label' => Mage::helper('pswidget')->__('Rights Cleared Only'),
|
161 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
162 |
+
'name' => 'rights_cleared_only',
|
163 |
+
"value" => 0,
|
164 |
+
'after_element_html' => '<i>Only return photos for which media rights have been granted</i>'
|
165 |
+
));
|
166 |
+
|
167 |
+
$fieldset2->addField('assigned_only', 'select', array(
|
168 |
+
'label' => Mage::helper('pswidget')->__('Assigned Only'),
|
169 |
+
'values' => Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArrayYesNo(),
|
170 |
+
'name' => 'assigned_only',
|
171 |
+
"value" => 0,
|
172 |
+
'after_element_html' => '<i>Only return photos that have products associated with them</i>'
|
173 |
+
));
|
174 |
+
|
175 |
+
$fieldset2->addField('visible_products', 'text', array(
|
176 |
+
'label' => Mage::helper('pswidget')->__('Visible Products'),
|
177 |
+
'name' => 'visible_products',
|
178 |
+
'class' => 'validate-digits-range digits-range-2-6',
|
179 |
+
'after_element_html' => '<i>Accepts a number between 2-6</i>'
|
180 |
+
));
|
181 |
+
|
182 |
+
$fieldset2->addField("collections", "text", array(
|
183 |
+
"label" => Mage::helper("pswidget")->__("Collections"),
|
184 |
+
"name" => "collections",
|
185 |
+
'after_element_html' => '<i>Enter the name of one or more collections to filter results by</i>'
|
186 |
+
));
|
187 |
+
|
188 |
+
|
189 |
+
$fieldset2->addField("additional_params", "textarea", array(
|
190 |
+
"label" => Mage::helper("pswidget")->__("Additional Params"),
|
191 |
+
"name" => "additional_params"
|
192 |
+
));
|
193 |
+
|
194 |
+
if (Mage::getSingleton("adminhtml/session")->getPswidgetData()) {
|
195 |
+
$form->setValues(Mage::getSingleton("adminhtml/session")->getPswidgetData());
|
196 |
+
Mage::getSingleton("adminhtml/session")->setPswidgetData(null);
|
197 |
+
} elseif (Mage::registry("pswidget_data")) {
|
198 |
+
|
199 |
+
$values = Mage::registry("pswidget_data")->getData();
|
200 |
+
|
201 |
+
if(Mage::registry("pswidget_translations")){
|
202 |
+
foreach (Mage::registry("pswidget_translations") as $translation){
|
203 |
+
$widget_lang_data = $translation->getData();
|
204 |
+
$form_data['cta_button_'.$widget_lang_data['id_lang']] = $widget_lang_data['cta_button'];
|
205 |
+
$form_data['load_more_text_'.$widget_lang_data['id_lang']] = $widget_lang_data['load_more_text'];
|
206 |
+
$values = array_merge($values, $form_data);
|
207 |
+
}
|
208 |
+
}
|
209 |
+
|
210 |
+
if (!empty($values)) {
|
211 |
+
$form->setValues($values);
|
212 |
+
}
|
213 |
+
}
|
214 |
+
return parent::_prepareForm();
|
215 |
+
}
|
216 |
+
}
|
app/code/community/Photoslurp/PsWidget/Block/Adminhtml/Pswidget/Edit/Tabs.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId("pswidget_tabs");
|
9 |
+
$this->setDestElementId("edit_form");
|
10 |
+
$this->setTitle(Mage::helper("pswidget")->__("Widget information"));
|
11 |
+
}
|
12 |
+
|
13 |
+
protected function _beforeToHtml()
|
14 |
+
{
|
15 |
+
$this->addTab("form_section", array(
|
16 |
+
"label" => Mage::helper("pswidget")->__("Configuration"),
|
17 |
+
"title" => Mage::helper("pswidget")->__("Configuration"),
|
18 |
+
"content" => $this->getLayout()->createBlock("pswidget/adminhtml_pswidget_edit_tab_form")->toHtml(),
|
19 |
+
));
|
20 |
+
|
21 |
+
$this->addTab("form_section1", array(
|
22 |
+
"label" => Mage::helper("pswidget")->__("Style parameters"),
|
23 |
+
"title" => Mage::helper("pswidget")->__("Style parameters"),
|
24 |
+
"content" => $this->getLayout()->createBlock("pswidget/adminhtml_pswidget_edit_tab_form1")->toHtml(),
|
25 |
+
));
|
26 |
+
|
27 |
+
$this->addTab("form_section2", array(
|
28 |
+
"label" => Mage::helper("pswidget")->__("Custom CSS"),
|
29 |
+
"title" => Mage::helper("pswidget")->__("Custom CSS"),
|
30 |
+
"content" => $this->getLayout()->createBlock("pswidget/adminhtml_pswidget_edit_tab_form2")->toHtml(),
|
31 |
+
));
|
32 |
+
|
33 |
+
$this->addTab("form_section3", array(
|
34 |
+
"label" => Mage::helper("pswidget")->__("Advanced parameters"),
|
35 |
+
"title" => Mage::helper("pswidget")->__("Advanced parameters"),
|
36 |
+
"content" => $this->getLayout()->createBlock("pswidget/adminhtml_pswidget_edit_tab_form3")->toHtml(),
|
37 |
+
));
|
38 |
+
return parent::_beforeToHtml();
|
39 |
+
}
|
40 |
+
|
41 |
+
}
|
app/code/community/Photoslurp/{PhotoslurpWidget/Block/Adminhtml/Photoslurpwidget → PsWidget/Block/Adminhtml/Pswidget}/Grid.php
RENAMED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
|
6 |
public function __construct()
|
7 |
{
|
8 |
parent::__construct();
|
9 |
-
$this->setId("
|
10 |
$this->setDefaultSort("id");
|
11 |
$this->setDefaultDir("DESC");
|
12 |
$this->setSaveParametersInSession(true);
|
@@ -14,46 +14,46 @@ class Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid extends
|
|
14 |
|
15 |
protected function _prepareCollection()
|
16 |
{
|
17 |
-
$collection = Mage::getModel("
|
18 |
$this->setCollection($collection);
|
19 |
return parent::_prepareCollection();
|
20 |
}
|
21 |
protected function _prepareColumns()
|
22 |
{
|
23 |
$this->addColumn("id", array(
|
24 |
-
"header" => Mage::helper("
|
25 |
"align" =>"right",
|
26 |
"width" => "50px",
|
27 |
"type" => "number",
|
28 |
"index" => "id",
|
29 |
));
|
30 |
$this->addColumn('widget_enable', array(
|
31 |
-
'header' => Mage::helper('
|
32 |
'index' => 'widget_enable',
|
33 |
'type' => 'options',
|
34 |
-
'options'=>
|
35 |
));
|
36 |
|
37 |
$this->addColumn('page_type', array(
|
38 |
-
'header' => Mage::helper('
|
39 |
'index' => 'page_type',
|
40 |
'type' => 'options',
|
41 |
-
'options'=>
|
42 |
));
|
43 |
$this->addColumn('widget_type', array(
|
44 |
-
'header' => Mage::helper('
|
45 |
'index' => 'widget_type',
|
46 |
'type' => 'options',
|
47 |
-
'options'=>
|
48 |
));
|
49 |
|
50 |
$this->addColumn("album_id", array(
|
51 |
-
"header" => Mage::helper("
|
52 |
"index" => "album_id",
|
53 |
));
|
54 |
|
55 |
$this->addColumn("page_limit", array(
|
56 |
-
"header" => Mage::helper("
|
57 |
"index" => "page_limit",
|
58 |
));
|
59 |
|
@@ -72,10 +72,10 @@ class Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid extends
|
|
72 |
$this->setMassactionIdField('id');
|
73 |
$this->getMassactionBlock()->setFormFieldName('ids');
|
74 |
$this->getMassactionBlock()->setUseSelectAll(true);
|
75 |
-
$this->getMassactionBlock()->addItem('
|
76 |
-
'label'=> Mage::helper('
|
77 |
-
'url' => $this->getUrl('*/
|
78 |
-
'confirm' => Mage::helper('
|
79 |
));
|
80 |
return $this;
|
81 |
}
|
@@ -91,7 +91,7 @@ class Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid extends
|
|
91 |
static public function getValueArray5()
|
92 |
{
|
93 |
$data_array=array();
|
94 |
-
foreach(
|
95 |
$data_array[]=array('value'=>$k,'label'=>$v);
|
96 |
}
|
97 |
return($data_array);
|
@@ -110,12 +110,33 @@ class Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid extends
|
|
110 |
static public function getValueArray10()
|
111 |
{
|
112 |
$data_array=array();
|
113 |
-
foreach(
|
114 |
$data_array[]=array('value'=>$k,'label'=>$v);
|
115 |
}
|
116 |
return($data_array);
|
117 |
|
118 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
static public function getOptionArray15()
|
121 |
{
|
@@ -128,7 +149,7 @@ class Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid extends
|
|
128 |
static public function getValueArray15()
|
129 |
{
|
130 |
$data_array=array();
|
131 |
-
foreach(
|
132 |
$data_array[]=array('value'=>$k,'label'=>$v);
|
133 |
}
|
134 |
return($data_array);
|
@@ -145,12 +166,29 @@ class Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid extends
|
|
145 |
static public function getValueArrayYesNo()
|
146 |
{
|
147 |
$data_array=array();
|
148 |
-
foreach(
|
149 |
$data_array[]=array('value'=>$k,'label'=>$v);
|
150 |
}
|
151 |
return($data_array);
|
152 |
|
153 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
|
156 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
{
|
5 |
|
6 |
public function __construct()
|
7 |
{
|
8 |
parent::__construct();
|
9 |
+
$this->setId("pswidgetGrid");
|
10 |
$this->setDefaultSort("id");
|
11 |
$this->setDefaultDir("DESC");
|
12 |
$this->setSaveParametersInSession(true);
|
14 |
|
15 |
protected function _prepareCollection()
|
16 |
{
|
17 |
+
$collection = Mage::getModel("pswidget/pswidget")->getCollection();
|
18 |
$this->setCollection($collection);
|
19 |
return parent::_prepareCollection();
|
20 |
}
|
21 |
protected function _prepareColumns()
|
22 |
{
|
23 |
$this->addColumn("id", array(
|
24 |
+
"header" => Mage::helper("pswidget")->__("ID"),
|
25 |
"align" =>"right",
|
26 |
"width" => "50px",
|
27 |
"type" => "number",
|
28 |
"index" => "id",
|
29 |
));
|
30 |
$this->addColumn('widget_enable', array(
|
31 |
+
'header' => Mage::helper('pswidget')->__('Enable'),
|
32 |
'index' => 'widget_enable',
|
33 |
'type' => 'options',
|
34 |
+
'options'=>Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getOptionArrayYesNo(),
|
35 |
));
|
36 |
|
37 |
$this->addColumn('page_type', array(
|
38 |
+
'header' => Mage::helper('pswidget')->__('Page Type'),
|
39 |
'index' => 'page_type',
|
40 |
'type' => 'options',
|
41 |
+
'options'=>Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getOptionArray10(),
|
42 |
));
|
43 |
$this->addColumn('widget_type', array(
|
44 |
+
'header' => Mage::helper('pswidget')->__('Widget Type'),
|
45 |
'index' => 'widget_type',
|
46 |
'type' => 'options',
|
47 |
+
'options'=>Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getOptionArray5(),
|
48 |
));
|
49 |
|
50 |
$this->addColumn("album_id", array(
|
51 |
+
"header" => Mage::helper("pswidget")->__("Album Id"),
|
52 |
"index" => "album_id",
|
53 |
));
|
54 |
|
55 |
$this->addColumn("page_limit", array(
|
56 |
+
"header" => Mage::helper("pswidget")->__("Page Limit"),
|
57 |
"index" => "page_limit",
|
58 |
));
|
59 |
|
72 |
$this->setMassactionIdField('id');
|
73 |
$this->getMassactionBlock()->setFormFieldName('ids');
|
74 |
$this->getMassactionBlock()->setUseSelectAll(true);
|
75 |
+
$this->getMassactionBlock()->addItem('remove_pswidget', array(
|
76 |
+
'label'=> Mage::helper('pswidget')->__('Remove Pswidget'),
|
77 |
+
'url' => $this->getUrl('*/adminhtml_pswidget/massRemove'),
|
78 |
+
'confirm' => Mage::helper('pswidget')->__('Are you sure?')
|
79 |
));
|
80 |
return $this;
|
81 |
}
|
91 |
static public function getValueArray5()
|
92 |
{
|
93 |
$data_array=array();
|
94 |
+
foreach(Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getOptionArray5() as $k=>$v){
|
95 |
$data_array[]=array('value'=>$k,'label'=>$v);
|
96 |
}
|
97 |
return($data_array);
|
110 |
static public function getValueArray10()
|
111 |
{
|
112 |
$data_array=array();
|
113 |
+
foreach(Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getOptionArray10() as $k=>$v){
|
114 |
$data_array[]=array('value'=>$k,'label'=>$v);
|
115 |
}
|
116 |
return($data_array);
|
117 |
|
118 |
}
|
119 |
+
|
120 |
+
static public function getOptionArrayPosition()
|
121 |
+
{
|
122 |
+
$data_array=array();
|
123 |
+
$data_array['product-content-bottom']='Product content bottom';
|
124 |
+
$data_array['product-content-top']='Product content top';
|
125 |
+
$data_array['product-media']='Product media';
|
126 |
+
$data_array['product-page-bottom']='Product page bottom';
|
127 |
+
$data_array['product-page-top']='Product page top';
|
128 |
+
|
129 |
+
return($data_array);
|
130 |
+
}
|
131 |
+
static public function getValueArrayPosition()
|
132 |
+
{
|
133 |
+
$data_array=array();
|
134 |
+
foreach(Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getOptionArrayPosition() as $k=>$v){
|
135 |
+
$data_array[]=array('value'=>$k,'label'=>$v);
|
136 |
+
}
|
137 |
+
return($data_array);
|
138 |
+
|
139 |
+
}
|
140 |
|
141 |
static public function getOptionArray15()
|
142 |
{
|
149 |
static public function getValueArray15()
|
150 |
{
|
151 |
$data_array=array();
|
152 |
+
foreach(Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getOptionArray15() as $k=>$v){
|
153 |
$data_array[]=array('value'=>$k,'label'=>$v);
|
154 |
}
|
155 |
return($data_array);
|
166 |
static public function getValueArrayYesNo()
|
167 |
{
|
168 |
$data_array=array();
|
169 |
+
foreach(Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getOptionArrayYesNo() as $k=>$v){
|
170 |
$data_array[]=array('value'=>$k,'label'=>$v);
|
171 |
}
|
172 |
return($data_array);
|
173 |
|
174 |
}
|
175 |
+
|
176 |
+
static public function getOptionArrayPhotoOrder()
|
177 |
+
{
|
178 |
+
$data_array=array();
|
179 |
+
$data_array[0]='Newest first';
|
180 |
+
$data_array[1]='Random';
|
181 |
+
return($data_array);
|
182 |
+
}
|
183 |
+
static public function getValueArrayPhotoOrder()
|
184 |
+
{
|
185 |
+
$data_array=array();
|
186 |
+
foreach(Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getOptionArrayPhotoOrder() as $k=>$v){
|
187 |
+
$data_array[]=array('value'=>$k,'label'=>$v);
|
188 |
+
}
|
189 |
+
return($data_array);
|
190 |
+
|
191 |
+
}
|
192 |
|
193 |
|
194 |
}
|
app/code/community/Photoslurp/PsWidget/Block/Widget.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Photoslurp_PsWidget_Block_Widget extends Mage_Core_Block_Template{
|
3 |
+
|
4 |
+
protected $_product = null;
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
$this->setTemplate('pswidget/widget.phtml');
|
10 |
+
}
|
11 |
+
|
12 |
+
public function getProduct()
|
13 |
+
{
|
14 |
+
if (!$this->_product) {
|
15 |
+
$this->_product = Mage::registry('product');
|
16 |
+
}
|
17 |
+
return $this->_product;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getWidget(){
|
21 |
+
|
22 |
+
if ($this->getData('page_type') == 'product') {
|
23 |
+
$_widget = Mage::getModel('pswidget/pswidget')->getCollection()
|
24 |
+
-> addFilter($field='widget_enable', $value= '1')
|
25 |
+
-> addFilter($field='page_type', $value = '2')
|
26 |
+
-> addFilter($field='position', $value = $this->getPosition())
|
27 |
+
-> getFirstItem();
|
28 |
+
} else {
|
29 |
+
$_widget = Mage::getModel('pswidget/pswidget')->getCollection()
|
30 |
+
-> addFilter($field='id', $value = $this->getData('id'))
|
31 |
+
-> addFilter($field='widget_enable', $value='1')
|
32 |
+
-> getFirstItem();
|
33 |
+
}
|
34 |
+
|
35 |
+
return $_widget;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getAllWidgets()
|
39 |
+
{
|
40 |
+
return Mage::getModel('pswidget/pswidget')->getCollection()
|
41 |
+
-> addFilter($field='widget_enable', $value='1');
|
42 |
+
}
|
43 |
+
|
44 |
+
public function getLangValue($id_widget, $id_lang, $field){
|
45 |
+
return Mage::getModel("pswidget/pswidgetlang")->getCollection()
|
46 |
+
-> addFilter('id_widget', $id_widget)
|
47 |
+
-> addFilter('id_lang', $id_lang)
|
48 |
+
-> getFirstItem()
|
49 |
+
->getData($field);
|
50 |
+
}
|
51 |
+
|
52 |
+
public function prepareStyleText($text, $id)
|
53 |
+
{
|
54 |
+
$cssModified = '';
|
55 |
+
$pattern = '/[^{}]*{(?:[^{}]+|(?R))*}/';
|
56 |
+
preg_match_all($pattern, $text, $cssBlocks);
|
57 |
+
foreach($cssBlocks[0] as $cssBlock) {
|
58 |
+
$cssBlock = trim($cssBlock);
|
59 |
+
preg_match('/[^{}]*{/', $cssBlock, $selector);
|
60 |
+
if(!preg_match('/^@/', $selector[0])) {
|
61 |
+
$selectorModified = preg_replace(array('/,/', '/^/'), array(",\n#$id ", "\n#$id "), $selector[0]);
|
62 |
+
$cssBlockModified = preg_replace("/$selector[0]/", $selectorModified, $cssBlock);
|
63 |
+
}else{
|
64 |
+
$cssBlockModified = "\n$cssBlock";
|
65 |
+
}
|
66 |
+
$cssModified .= $cssBlockModified;
|
67 |
+
}
|
68 |
+
return $cssModified;
|
69 |
+
}
|
70 |
+
}
|
app/code/community/Photoslurp/PsWidget/Helper/Data.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Photoslurp_PsWidget_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
const FILE_NAME = 'photoslurp_export.csv';
|
5 |
+
|
6 |
+
public function findWritablePath(){
|
7 |
+
|
8 |
+
$config_path = Mage::getStoreConfig('export/export_configuration/path');
|
9 |
+
|
10 |
+
if($config_path){
|
11 |
+
$filename = $config_path;
|
12 |
+
$dirname = dirname($filename);
|
13 |
+
if (!is_dir($dirname))
|
14 |
+
{
|
15 |
+
mkdir($dirname, 0755, true);
|
16 |
+
}
|
17 |
+
return Mage::getBaseDir('base').'/'.$filename;
|
18 |
+
}
|
19 |
+
|
20 |
+
if(is_writable(Mage::getBaseDir('base'))){
|
21 |
+
return Mage::getBaseDir('base').'/'.self::FILE_NAME;
|
22 |
+
}
|
23 |
+
|
24 |
+
if(is_writable(Mage::getBaseDir('media'))){
|
25 |
+
return Mage::getBaseDir('media').'/'.self::FILE_NAME;
|
26 |
+
}
|
27 |
+
|
28 |
+
return false;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getExportedFileName(){
|
32 |
+
return $this->findWritablePath();
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
app/code/community/Photoslurp/PsWidget/Model/Cron.php
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Photoslurp_PsWidget_Model_Cron{
|
3 |
+
|
4 |
+
private $delimiter = '|';
|
5 |
+
|
6 |
+
private $_productHelper = null;
|
7 |
+
|
8 |
+
public function __construct()
|
9 |
+
{
|
10 |
+
$this->_productHelper = Mage::helper('catalog/product');
|
11 |
+
}
|
12 |
+
|
13 |
+
public function photoslurpExport(){//cron
|
14 |
+
if (Mage::getStoreConfig('export/export_configuration/cron_enable')){
|
15 |
+
$this->export(Mage::getStoreConfig('export/export_configuration/export_type'));
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
public function manualExport($product_type){
|
20 |
+
$this->export($product_type);
|
21 |
+
}
|
22 |
+
|
23 |
+
private function export($product_type){
|
24 |
+
|
25 |
+
$filename = Mage::helper('pswidget')->findWritablePath();
|
26 |
+
$fp = fopen($filename, 'w');
|
27 |
+
|
28 |
+
if($fp != false){
|
29 |
+
|
30 |
+
fwrite($fp, '# exported at ' . date('d-m-Y') . PHP_EOL);
|
31 |
+
|
32 |
+
$websites = $this->getExportWebsites();
|
33 |
+
|
34 |
+
$collection = Mage::getModel('catalog/product')->getCollection()
|
35 |
+
->joinTable('cataloginventory/stock_item', 'product_id=entity_id', array('stock_status' => 'is_in_stock'))
|
36 |
+
->addAttributeToSelect(array('image','price'), 'left')
|
37 |
+
->addAttributeToFilter('visibility',array("neq"=>1))
|
38 |
+
->addAttributeToFilter('status', 1)
|
39 |
+
->addWebsiteFilter($websites);
|
40 |
+
|
41 |
+
$collection->getSelect()->columns(array('store_ids' => "GROUP_CONCAT(store.store_id)"));
|
42 |
+
$collection->getSelect()->joinInner(array('store'=> Mage::getSingleton('core/resource')->getTableName('core/store')),"product_website.website_id=store.website_id");
|
43 |
+
$collection->getSelect()->group('e.entity_id');
|
44 |
+
|
45 |
+
if($product_type == 'simple'){
|
46 |
+
$collection ->addAttributeToFilter('type_id', array('eq' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE));
|
47 |
+
}
|
48 |
+
|
49 |
+
if($product_type == 'parent'){
|
50 |
+
$collection ->addAttributeToFilter('type_id', array('neq' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE));
|
51 |
+
}
|
52 |
+
|
53 |
+
$this->addProductStoreData($collection);
|
54 |
+
|
55 |
+
$header = array("sku");
|
56 |
+
$currency_codes = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
|
57 |
+
foreach ($currency_codes as $code){
|
58 |
+
$header[] = 'price_'.$code;
|
59 |
+
}
|
60 |
+
$header[]='in_stock';
|
61 |
+
$header[]='image_url';
|
62 |
+
$stores = $this->getExportStores();
|
63 |
+
foreach ($stores as $store){
|
64 |
+
$language_code = Mage::getStoreConfig('general/locale/code', $store->getId()).'_'.$store->getId();
|
65 |
+
$header[] = 'title_'.$language_code;
|
66 |
+
$header[] = 'description_'.$language_code;
|
67 |
+
$header[] = 'url_'.$language_code;
|
68 |
+
}
|
69 |
+
|
70 |
+
fputcsv($fp, $header, $this->delimiter);
|
71 |
+
|
72 |
+
Mage::getSingleton('core/resource_iterator')->walk(
|
73 |
+
$collection->getSelect(),
|
74 |
+
array(array($this, 'productCallback')),
|
75 |
+
array(
|
76 |
+
'fp' => $fp,
|
77 |
+
'stores'=> $stores,
|
78 |
+
'currency_codes' => $currency_codes,
|
79 |
+
'base_currency_code' => Mage::app()->getBaseCurrencyCode())
|
80 |
+
);
|
81 |
+
|
82 |
+
fclose($fp);
|
83 |
+
|
84 |
+
}else{
|
85 |
+
$errormsg = Mage::helper("pswidget")->__("Saving the export file (%s) on your server did not work. Please check your server's directory permissions.",$filename);
|
86 |
+
Mage::log($errormsg, null, "photoslurp.log");
|
87 |
+
Mage::throwException($errormsg);
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
private function getExportWebsites(){
|
92 |
+
$stores = $this->getExportStores();
|
93 |
+
$websites = array();
|
94 |
+
foreach($stores as $store){
|
95 |
+
$websites[] = $store->getWebsiteId();
|
96 |
+
}
|
97 |
+
$websites = array_unique($websites);
|
98 |
+
return $websites;
|
99 |
+
}
|
100 |
+
|
101 |
+
private function getExportStores(){
|
102 |
+
$stores = array();
|
103 |
+
if($storesExportEnabled = Mage::getStoreConfig('export/export_configuration/store_id')){
|
104 |
+
$storesExportEnabled = explode(",", $storesExportEnabled);
|
105 |
+
foreach($storesExportEnabled as $storeId){
|
106 |
+
$stores[] = Mage::getModel('core/store')->load($storeId);
|
107 |
+
}
|
108 |
+
}else{
|
109 |
+
$stores = Mage::app()->getStores();
|
110 |
+
}
|
111 |
+
|
112 |
+
foreach($stores as $store){
|
113 |
+
$language_code = Mage::getStoreConfig('general/locale/code', $store->getId());
|
114 |
+
$store->setLangCode($language_code);
|
115 |
+
}
|
116 |
+
|
117 |
+
return $stores;
|
118 |
+
}
|
119 |
+
|
120 |
+
private function addProductStoreData($collection){
|
121 |
+
|
122 |
+
$stores = $this->getExportStores();
|
123 |
+
|
124 |
+
foreach ($stores as $store){
|
125 |
+
$storeId = $store->getId();
|
126 |
+
$collection->joinAttribute('name_'.$storeId, 'catalog_product/name', 'entity_id', null, 'left',$storeId);
|
127 |
+
$collection->joinAttribute('description_'.$storeId, 'catalog_product/description', 'entity_id', null, 'left',$storeId);
|
128 |
+
$collection->joinAttribute('url_key_'.$storeId, 'catalog_product/url_key', 'entity_id', null, 'left',$storeId);
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
public function productCallback($args){
|
133 |
+
|
134 |
+
$product = Mage::getModel('catalog/product');
|
135 |
+
$product->setData($args['row']);
|
136 |
+
|
137 |
+
$insertData = array();
|
138 |
+
|
139 |
+
$insertData['sku'] = $args['row']['sku'];
|
140 |
+
|
141 |
+
$price = $args['row']['price'];
|
142 |
+
foreach ($args['currency_codes'] as $code){
|
143 |
+
$insertData['price_'.$code] = $this->convertPrice($price,$args['base_currency_code'],$code) ;
|
144 |
+
}
|
145 |
+
|
146 |
+
$insertData['in_stock'] = ($args['row']['stock_status'])?'in stock':'out of stock';
|
147 |
+
|
148 |
+
if($product->getImage() && ($product->getImage() != 'no_selection')){
|
149 |
+
$insertData['image_url'] = Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage());
|
150 |
+
}else{
|
151 |
+
$insertData['image_url'] = '';
|
152 |
+
}
|
153 |
+
|
154 |
+
$stores = $args['stores'];
|
155 |
+
$productStores = explode(',',$product->getStoreIds());
|
156 |
+
|
157 |
+
$pattern = '/"/';
|
158 |
+
$replacement = '$0"';
|
159 |
+
|
160 |
+
foreach($stores as $store){
|
161 |
+
$langcode = $store->getLangCode().'_'.$store->getId();
|
162 |
+
$isProductInStore = in_array($store->getId(), $productStores);
|
163 |
+
$insertData['title_'.$langcode] = $isProductInStore ? sprintf('"%s"', preg_replace($pattern,$replacement,$args['row']['name_'.$store->getId()])) : '';
|
164 |
+
$insertData['description_'.$langcode] = $isProductInStore ? sprintf('"%s"', preg_replace($pattern,$replacement,$args['row']['description_'.$store->getId()])) : '';
|
165 |
+
$insertData['url_'.$langcode] = $isProductInStore ? $store->getBaseUrl() . $args['row']['url_key_'.$store->getId()].$this->_productHelper->getProductUrlSuffix($store->getId()) . '?___store=' . $store->getCode() : '';
|
166 |
+
}
|
167 |
+
|
168 |
+
fwrite ($args['fp'], implode($insertData, $this->delimiter) . PHP_EOL);
|
169 |
+
}
|
170 |
+
|
171 |
+
private function convertPrice($price,$from,$to){
|
172 |
+
return Mage::helper('directory')->currencyConvert($price, $from, $to);
|
173 |
+
}
|
174 |
+
}
|
app/code/community/Photoslurp/PsWidget/Model/Mysql4/Pswidget.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Photoslurp_PsWidget_Model_Mysql4_Pswidget extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
$this->_init("pswidget/pswidget", "id");
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Photoslurp/PsWidget/Model/Mysql4/Pswidget/Collection.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Photoslurp_PsWidget_Model_Mysql4_Pswidget_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
public function _construct(){
|
6 |
+
$this->_init("pswidget/pswidget");
|
7 |
+
}
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
}
|
12 |
+
|
app/code/community/Photoslurp/PsWidget/Model/Mysql4/Pswidgetlang.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Photoslurp_PsWidget_Model_Mysql4_Pswidgetlang extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
$this->_init("pswidget/pswidgetlang", "id");
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Photoslurp/PsWidget/Model/Mysql4/Pswidgetlang/Collection.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Photoslurp_PsWidget_Model_Mysql4_Pswidgetlang_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
public function _construct(){
|
6 |
+
$this->_init("pswidget/pswidgetlang");
|
7 |
+
}
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
}
|
12 |
+
|
app/code/community/Photoslurp/PsWidget/Model/Pswidget.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Photoslurp_PsWidget_Model_Pswidget extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct(){
|
6 |
+
|
7 |
+
$this->_init("pswidget/pswidget");
|
8 |
+
|
9 |
+
}
|
10 |
+
|
11 |
+
}
|
12 |
+
|
app/code/community/Photoslurp/PsWidget/Model/Pswidgetlang.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Photoslurp_PsWidget_Model_Pswidgetlang extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct(){
|
6 |
+
|
7 |
+
$this->_init("pswidget/pswidgetlang");
|
8 |
+
|
9 |
+
}
|
10 |
+
}
|
11 |
+
|
app/code/community/Photoslurp/PsWidget/Model/Source/Export.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Photoslurp_PsWidget_Model_Source_Export
|
3 |
+
{
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Options getter
|
7 |
+
*
|
8 |
+
* @return array
|
9 |
+
*/
|
10 |
+
public function toOptionArray()
|
11 |
+
{
|
12 |
+
return array(
|
13 |
+
array('value' => 'all', 'label'=>Mage::helper('adminhtml')->__('All Visible')),
|
14 |
+
array('value' => 'parent', 'label'=>Mage::helper('adminhtml')->__('Parent Only')),
|
15 |
+
array('value' => 'simple', 'label'=>Mage::helper('adminhtml')->__('Child Only')),
|
16 |
+
// array('value' => 'all_visible', 'label'=>Mage::helper('adminhtml')->__('Visible Only')),
|
17 |
+
);
|
18 |
+
}
|
19 |
+
|
20 |
+
}
|
app/code/community/Photoslurp/PsWidget/Model/Source/Store.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Photoslurp_PsWidget_Model_Source_Store
|
3 |
+
{
|
4 |
+
|
5 |
+
public function toOptionArray() {
|
6 |
+
return Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, false);
|
7 |
+
}
|
8 |
+
|
9 |
+
}
|
app/code/community/Photoslurp/PsWidget/controllers/Adminhtml/Pswidget/PswidgetController.php
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Photoslurp_PsWidget_Adminhtml_Pswidget_PswidgetController extends Mage_Adminhtml_Controller_Action
|
4 |
+
{
|
5 |
+
protected function _initAction()
|
6 |
+
{
|
7 |
+
$this->loadLayout()->_setActiveMenu("pswidget/pswidget")->_addBreadcrumb(Mage::helper("adminhtml")->__("Pswidget Manager"),Mage::helper("adminhtml")->__("Pswidget Manager"));
|
8 |
+
return $this;
|
9 |
+
}
|
10 |
+
|
11 |
+
protected function _isAllowed()
|
12 |
+
{
|
13 |
+
return Mage::getSingleton('admin/session')->isAllowed('pswidget/pswidget');
|
14 |
+
}
|
15 |
+
|
16 |
+
public function indexAction()
|
17 |
+
{
|
18 |
+
$this->_title($this->__("Photoslurp Widget"));
|
19 |
+
$this->_title($this->__("Manager Pswidget"));
|
20 |
+
|
21 |
+
$this->_initAction();
|
22 |
+
$this->renderLayout();
|
23 |
+
}
|
24 |
+
public function editAction()
|
25 |
+
{
|
26 |
+
$this->_title($this->__("Photoslurp Widget"));
|
27 |
+
$this->_title($this->__("Pswidget"));
|
28 |
+
$this->_title($this->__("Edit Item"));
|
29 |
+
|
30 |
+
$id = $this->getRequest()->getParam("id");
|
31 |
+
$model = Mage::getModel("pswidget/pswidget")->load($id);
|
32 |
+
|
33 |
+
$translations = array();
|
34 |
+
foreach(Mage::app()->getStores() as $store){
|
35 |
+
$translations[] = Mage::getModel("pswidget/pswidgetlang")->load($this->getIdWidgetLang($id,$store->getId()));
|
36 |
+
}
|
37 |
+
|
38 |
+
if ($model->getId()) {
|
39 |
+
Mage::register("pswidget_data", $model);
|
40 |
+
Mage::register("pswidget_translations", $translations);
|
41 |
+
|
42 |
+
$this->loadLayout();
|
43 |
+
$this->_setActiveMenu("pswidget/pswidget");
|
44 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Photoslurp Widget Manager"), Mage::helper("adminhtml")->__("Pswidget Manager"));
|
45 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Pswidget Description"), Mage::helper("adminhtml")->__("Pswidget Description"));
|
46 |
+
$this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
|
47 |
+
$this->_addContent($this->getLayout()->createBlock("pswidget/adminhtml_pswidget_edit"))->_addLeft($this->getLayout()->createBlock("pswidget/adminhtml_pswidget_edit_tabs"));
|
48 |
+
$this->renderLayout();
|
49 |
+
}
|
50 |
+
else {
|
51 |
+
Mage::getSingleton("adminhtml/session")->addError(Mage::helper("pswidget")->__("Item does not exist."));
|
52 |
+
$this->_redirect("*/*/");
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
public function newAction()
|
57 |
+
{
|
58 |
+
|
59 |
+
$this->_title($this->__("PsWidget"));
|
60 |
+
$this->_title($this->__("Pswidget"));
|
61 |
+
$this->_title($this->__("New Item"));
|
62 |
+
|
63 |
+
$id = $this->getRequest()->getParam("id");
|
64 |
+
$model = Mage::getModel("pswidget/pswidget")->load($id);
|
65 |
+
|
66 |
+
$data = Mage::getSingleton("adminhtml/session")->getFormData(true);
|
67 |
+
if (!empty($data)) {
|
68 |
+
$model->setData($data);
|
69 |
+
}
|
70 |
+
|
71 |
+
Mage::register("pswidget_data", $model);
|
72 |
+
|
73 |
+
$this->loadLayout();
|
74 |
+
$this->_setActiveMenu("pswidget/pswidget");
|
75 |
+
|
76 |
+
$this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
|
77 |
+
|
78 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Photoslurp Widget Manager"), Mage::helper("adminhtml")->__("Pswidget Manager"));
|
79 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Photoslurp Widget Description"), Mage::helper("adminhtml")->__("Pswidget Description"));
|
80 |
+
|
81 |
+
|
82 |
+
$this->_addContent($this->getLayout()->createBlock("pswidget/adminhtml_pswidget_edit"))->_addLeft($this->getLayout()->createBlock("pswidget/adminhtml_pswidget_edit_tabs"));
|
83 |
+
|
84 |
+
$this->renderLayout();
|
85 |
+
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
+
public function saveAction()
|
90 |
+
{
|
91 |
+
|
92 |
+
$post_data=$this->getRequest()->getPost();
|
93 |
+
|
94 |
+
if ($post_data) {
|
95 |
+
|
96 |
+
try {
|
97 |
+
|
98 |
+
$model = Mage::getModel("pswidget/pswidget")
|
99 |
+
->addData($post_data)
|
100 |
+
->setId($this->getRequest()->getParam("id"))
|
101 |
+
->save();
|
102 |
+
|
103 |
+
foreach(Mage::app()->getStores() as $store) {
|
104 |
+
$this->saveTranslations(
|
105 |
+
$model->getId(),
|
106 |
+
$store->getId(),
|
107 |
+
array(
|
108 |
+
'submit_text' => $post_data['submit_text_'.$store->getId()],
|
109 |
+
'cta_button' => $post_data['cta_button_'.$store->getId()],
|
110 |
+
'load_more_text' => $post_data['load_more_text_'.$store->getId()],
|
111 |
+
'shop_this_look_text' => $post_data['shop_this_look_text_'.$store->getId()],
|
112 |
+
'note_add_pics_text' => $post_data['note_add_pics_text_'.$store->getId()]
|
113 |
+
)
|
114 |
+
);
|
115 |
+
}
|
116 |
+
|
117 |
+
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Pswidget was successfully saved"));
|
118 |
+
Mage::getSingleton("adminhtml/session")->setPswidgetData(false);
|
119 |
+
|
120 |
+
if ($this->getRequest()->getParam("back")) {
|
121 |
+
$this->_redirect("*/*/edit", array("id" => $model->getId()));
|
122 |
+
return;
|
123 |
+
}
|
124 |
+
$this->_redirect("*/*/");
|
125 |
+
return;
|
126 |
+
}
|
127 |
+
catch (Exception $e) {
|
128 |
+
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
129 |
+
Mage::getSingleton("adminhtml/session")->setPswidgetData($this->getRequest()->getPost());
|
130 |
+
$this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
|
131 |
+
return;
|
132 |
+
}
|
133 |
+
|
134 |
+
}
|
135 |
+
$this->_redirect("*/*/");
|
136 |
+
}
|
137 |
+
|
138 |
+
|
139 |
+
|
140 |
+
public function deleteAction()
|
141 |
+
{
|
142 |
+
if( $this->getRequest()->getParam("id") > 0 ) {
|
143 |
+
try {
|
144 |
+
$model = Mage::getModel("pswidget/pswidget");
|
145 |
+
$model->setId($this->getRequest()->getParam("id"))->delete();
|
146 |
+
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item was successfully deleted"));
|
147 |
+
$this->_redirect("*/*/");
|
148 |
+
}
|
149 |
+
catch (Exception $e) {
|
150 |
+
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
151 |
+
$this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
|
152 |
+
}
|
153 |
+
}
|
154 |
+
$this->_redirect("*/*/");
|
155 |
+
}
|
156 |
+
|
157 |
+
|
158 |
+
public function massRemoveAction()
|
159 |
+
{
|
160 |
+
try {
|
161 |
+
$ids = $this->getRequest()->getPost('ids', array());
|
162 |
+
foreach ($ids as $id) {
|
163 |
+
$model = Mage::getModel("pswidget/pswidget");
|
164 |
+
$model->setId($id)->delete();
|
165 |
+
}
|
166 |
+
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item(s) was successfully removed"));
|
167 |
+
}
|
168 |
+
catch (Exception $e) {
|
169 |
+
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
170 |
+
}
|
171 |
+
$this->_redirect('*/*/');
|
172 |
+
}
|
173 |
+
|
174 |
+
private function saveTranslations($id_widget,$id_lang,$data = array()){
|
175 |
+
try {
|
176 |
+
Mage::getModel("pswidget/pswidgetlang")
|
177 |
+
->setIdWidget($id_widget)
|
178 |
+
->setIdLang($id_lang)
|
179 |
+
->addData($data)
|
180 |
+
->setId($this->getIdWidgetLang($id_widget, $id_lang))
|
181 |
+
->save();
|
182 |
+
}
|
183 |
+
catch (Exception $e) {
|
184 |
+
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
185 |
+
Mage::getSingleton("adminhtml/session")->setPswidgetData($this->getRequest()->getPost());
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
private function getIdWidgetLang($id_widget,$id_lang){
|
190 |
+
return Mage::getModel("pswidget/pswidgetlang")->getCollection()
|
191 |
+
-> addFilter('id_widget', $id_widget)
|
192 |
+
-> addFilter('id_lang', $id_lang)
|
193 |
+
-> getFirstItem()
|
194 |
+
-> getId();
|
195 |
+
}
|
196 |
+
|
197 |
+
}
|
app/code/community/Photoslurp/{PhotoslurpWidget/controllers/Adminhtml/PhotoslurpwidgetbackendController.php → PsWidget/controllers/Adminhtml/Pswidget/PswidgetbackendController.php}
RENAMED
@@ -1,6 +1,11 @@
|
|
1 |
<?php
|
2 |
-
class
|
3 |
{
|
|
|
|
|
|
|
|
|
|
|
4 |
public function indexAction()
|
5 |
{
|
6 |
$this->loadLayout();
|
@@ -10,14 +15,15 @@ class Photoslurp_PhotoslurpWidget_Adminhtml_PhotoslurpwidgetbackendController ex
|
|
10 |
|
11 |
public function exportAction()
|
12 |
{
|
|
|
13 |
try {
|
14 |
-
$model = Mage::getModel('
|
15 |
-
$model->manualExport();
|
16 |
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Products have been exported'));
|
17 |
}
|
18 |
catch (Exception $e){
|
19 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
20 |
}
|
21 |
-
$this->_redirect('*/
|
22 |
}
|
23 |
}
|
1 |
<?php
|
2 |
+
class Photoslurp_PsWidget_Adminhtml_Pswidget_PswidgetbackendController extends Mage_Adminhtml_Controller_Action
|
3 |
{
|
4 |
+
protected function _isAllowed()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('admin/session')->isAllowed('pswidget/pswidgetbackend');
|
7 |
+
}
|
8 |
+
|
9 |
public function indexAction()
|
10 |
{
|
11 |
$this->loadLayout();
|
15 |
|
16 |
public function exportAction()
|
17 |
{
|
18 |
+
$params = $this->getRequest()->getParams();
|
19 |
try {
|
20 |
+
$model = Mage::getModel('pswidget/cron');
|
21 |
+
$model->manualExport($params['product_type']);
|
22 |
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Products have been exported'));
|
23 |
}
|
24 |
catch (Exception $e){
|
25 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
26 |
}
|
27 |
+
$this->_redirect('*/pswidget_pswidgetbackend');
|
28 |
}
|
29 |
}
|
app/code/community/Photoslurp/{PhotoslurpWidget → PsWidget}/etc/adminhtml.xml
RENAMED
@@ -8,10 +8,14 @@
|
|
8 |
<children>
|
9 |
<config>
|
10 |
<children>
|
11 |
-
<export translate="title" module="
|
12 |
<title>Product Export Section</title>
|
13 |
<sort_order>0</sort_order>
|
14 |
</export>
|
|
|
|
|
|
|
|
|
15 |
</children>
|
16 |
</config>
|
17 |
</children>
|
8 |
<children>
|
9 |
<config>
|
10 |
<children>
|
11 |
+
<export translate="title" module="pswidget">
|
12 |
<title>Product Export Section</title>
|
13 |
<sort_order>0</sort_order>
|
14 |
</export>
|
15 |
+
<tracking translate="title" module="pswidget">
|
16 |
+
<title>Order Tracking Section</title>
|
17 |
+
<sort_order>0</sort_order>
|
18 |
+
</tracking>
|
19 |
</children>
|
20 |
</config>
|
21 |
</children>
|
app/code/community/Photoslurp/PsWidget/etc/config.xml
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Photoslurp_PsWidget>
|
5 |
+
<version>1.0.23</version>
|
6 |
+
</Photoslurp_PsWidget>
|
7 |
+
</modules>
|
8 |
+
<default>
|
9 |
+
<tracking>
|
10 |
+
<tracking_configuration>
|
11 |
+
<tracking_enable>1</tracking_enable>
|
12 |
+
</tracking_configuration>
|
13 |
+
</tracking>
|
14 |
+
<export>
|
15 |
+
<export_configuration>
|
16 |
+
<cron_enable>1</cron_enable>
|
17 |
+
</export_configuration>
|
18 |
+
</export>
|
19 |
+
</default>
|
20 |
+
<frontend>
|
21 |
+
<routers>
|
22 |
+
<pswidget>
|
23 |
+
<use>standard</use>
|
24 |
+
<args>
|
25 |
+
<module>Photoslurp_PsWidget</module>
|
26 |
+
<frontName>pswidget</frontName>
|
27 |
+
</args>
|
28 |
+
</pswidget>
|
29 |
+
</routers>
|
30 |
+
<layout>
|
31 |
+
<updates>
|
32 |
+
<pswidget>
|
33 |
+
<file>pswidget.xml</file>
|
34 |
+
</pswidget>
|
35 |
+
</updates>
|
36 |
+
</layout>
|
37 |
+
</frontend>
|
38 |
+
<global>
|
39 |
+
<helpers>
|
40 |
+
<pswidget>
|
41 |
+
<class>Photoslurp_PsWidget_Helper</class>
|
42 |
+
</pswidget>
|
43 |
+
</helpers>
|
44 |
+
<blocks>
|
45 |
+
<pswidget>
|
46 |
+
<class>Photoslurp_PsWidget_Block</class>
|
47 |
+
</pswidget>
|
48 |
+
</blocks>
|
49 |
+
<models>
|
50 |
+
<pswidget>
|
51 |
+
<class>Photoslurp_PsWidget_Model</class>
|
52 |
+
<resourceModel>pswidget_mysql4</resourceModel>
|
53 |
+
</pswidget>
|
54 |
+
<pswidget_mysql4>
|
55 |
+
<class>Photoslurp_PsWidget_Model_Mysql4</class>
|
56 |
+
<entities>
|
57 |
+
<pswidget>
|
58 |
+
<table>photoslurp_widget</table>
|
59 |
+
</pswidget>
|
60 |
+
<pswidgetlang>
|
61 |
+
<table>photoslurp_widget_lang</table>
|
62 |
+
</pswidgetlang>
|
63 |
+
</entities>
|
64 |
+
</pswidget_mysql4>
|
65 |
+
</models>
|
66 |
+
<resources>
|
67 |
+
<pswidget_setup>
|
68 |
+
<setup>
|
69 |
+
<module>Photoslurp_PsWidget</module>
|
70 |
+
</setup>
|
71 |
+
<connection>
|
72 |
+
<use>core_setup</use>
|
73 |
+
</connection>
|
74 |
+
</pswidget_setup>
|
75 |
+
<pswidget_write>
|
76 |
+
<connection>
|
77 |
+
<use>core_write</use>
|
78 |
+
</connection>
|
79 |
+
</pswidget_write>
|
80 |
+
<pswidget_read>
|
81 |
+
<connection>
|
82 |
+
<use>core_read</use>
|
83 |
+
</connection>
|
84 |
+
</pswidget_read>
|
85 |
+
</resources>
|
86 |
+
</global>
|
87 |
+
<admin>
|
88 |
+
<routers>
|
89 |
+
<adminhtml>
|
90 |
+
<args>
|
91 |
+
<modules>
|
92 |
+
<pswidget before="Mage_Adminhtml">Photoslurp_PsWidget_Adminhtml</pswidget>
|
93 |
+
</modules>
|
94 |
+
</args>
|
95 |
+
</adminhtml>
|
96 |
+
</routers>
|
97 |
+
</admin>
|
98 |
+
<adminhtml>
|
99 |
+
<menu>
|
100 |
+
<pswidget module="pswidget">
|
101 |
+
<title>Photoslurp</title>
|
102 |
+
<sort_order>90</sort_order>
|
103 |
+
<children>
|
104 |
+
<pswidget module="pswidget">
|
105 |
+
<title>Manage Widgets</title>
|
106 |
+
<sort_order>0</sort_order>
|
107 |
+
<action>adminhtml/pswidget_pswidget</action>
|
108 |
+
</pswidget>
|
109 |
+
<pswidgetbackend module="pswidget">
|
110 |
+
<title>Export Products</title>
|
111 |
+
<sort_order>1</sort_order>
|
112 |
+
<action>adminhtml/pswidget_pswidgetbackend</action>
|
113 |
+
</pswidgetbackend>
|
114 |
+
</children>
|
115 |
+
</pswidget>
|
116 |
+
</menu>
|
117 |
+
<acl>
|
118 |
+
<resources>
|
119 |
+
<all>
|
120 |
+
<title>Allow Everything</title>
|
121 |
+
</all>
|
122 |
+
<admin>
|
123 |
+
<children>
|
124 |
+
<pswidget translate="title" module="pswidget">
|
125 |
+
<title>Photoslurp Widget</title>
|
126 |
+
<sort_order>1000</sort_order>
|
127 |
+
<children>
|
128 |
+
<pswidget translate="title">
|
129 |
+
<title>Manage Widgets</title>
|
130 |
+
<sort_order>0</sort_order>
|
131 |
+
</pswidget>
|
132 |
+
<pswidgetbackend translate="title">
|
133 |
+
<title>Export</title>
|
134 |
+
<sort_order>0</sort_order>
|
135 |
+
</pswidgetbackend>
|
136 |
+
</children>
|
137 |
+
</pswidget>
|
138 |
+
</children>
|
139 |
+
</admin>
|
140 |
+
</resources>
|
141 |
+
</acl>
|
142 |
+
<layout>
|
143 |
+
<updates>
|
144 |
+
<pswidget>
|
145 |
+
<file>pswidget.xml</file>
|
146 |
+
</pswidget>
|
147 |
+
</updates>
|
148 |
+
</layout>
|
149 |
+
</adminhtml>
|
150 |
+
<crontab>
|
151 |
+
<jobs>
|
152 |
+
<pswidget_photoslurpexport>
|
153 |
+
<schedule><cron_expr>0 2 * * *</cron_expr></schedule>
|
154 |
+
<run><model>pswidget/cron::photoslurpExport</model></run>
|
155 |
+
</pswidget_photoslurpexport>
|
156 |
+
</jobs>
|
157 |
+
</crontab>
|
158 |
+
</config>
|
app/code/community/Photoslurp/PsWidget/etc/system.xml
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<photoslurp translate="label" module="pswidget">
|
5 |
+
<label>Photoslurp</label>
|
6 |
+
<sort_order>100</sort_order>
|
7 |
+
</photoslurp>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<export translate="label" module="pswidget">
|
11 |
+
<label>Product Export</label>
|
12 |
+
<tab>photoslurp</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>20</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<groups>
|
17 |
+
<export_configuration translate="label">
|
18 |
+
<label>Export Configuration</label>
|
19 |
+
<frontend_type>text</frontend_type>
|
20 |
+
<sort_order>0</sort_order>
|
21 |
+
<show_in_default>1</show_in_default>
|
22 |
+
<fields>
|
23 |
+
<store_id translate="label">
|
24 |
+
<label>Store View</label>
|
25 |
+
<frontend_type>multiselect</frontend_type>
|
26 |
+
<source_model>Photoslurp_PsWidget_Model_Source_Store</source_model>
|
27 |
+
<sort_order>0</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>0</show_in_website>
|
30 |
+
<show_in_store>0</show_in_store>
|
31 |
+
</store_id>
|
32 |
+
<cron_enable translate="label">
|
33 |
+
<label>Auto export</label>
|
34 |
+
<frontend_type>select</frontend_type>
|
35 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
36 |
+
<sort_order>1</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<comment>Export every 24 hours.</comment>
|
39 |
+
</cron_enable>
|
40 |
+
<export_type translate="label">
|
41 |
+
<label>Export Type</label>
|
42 |
+
<frontend_type>select</frontend_type>
|
43 |
+
<source_model>Photoslurp_PsWidget_Model_Source_Export</source_model>
|
44 |
+
<sort_order>2</sort_order>
|
45 |
+
<show_in_default>1</show_in_default>
|
46 |
+
<show_in_website>0</show_in_website>
|
47 |
+
<show_in_store>0</show_in_store>
|
48 |
+
</export_type>
|
49 |
+
<path translate="label">
|
50 |
+
<label>Path</label>
|
51 |
+
<frontend_type>text</frontend_type>
|
52 |
+
<sort_order>3</sort_order>
|
53 |
+
<show_in_default>1</show_in_default>
|
54 |
+
<comment>Export path. Ex: path/to/file.csv</comment>
|
55 |
+
</path>
|
56 |
+
</fields>
|
57 |
+
</export_configuration>
|
58 |
+
</groups>
|
59 |
+
</export>
|
60 |
+
<tracking translate="label" module="pswidget">
|
61 |
+
<label>Order Tracking</label>
|
62 |
+
<tab>photoslurp</tab>
|
63 |
+
<frontend_type>text</frontend_type>
|
64 |
+
<sort_order>20</sort_order>
|
65 |
+
<show_in_default>1</show_in_default>
|
66 |
+
<groups>
|
67 |
+
<tracking_configuration translate="label">
|
68 |
+
<label>Order Tracking Configuration</label>
|
69 |
+
<frontend_type>text</frontend_type>
|
70 |
+
<sort_order>0</sort_order>
|
71 |
+
<show_in_default>1</show_in_default>
|
72 |
+
<fields>
|
73 |
+
<tracking_enable translate="label">
|
74 |
+
<label>Order tracking</label>
|
75 |
+
<frontend_type>select</frontend_type>
|
76 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
77 |
+
<sort_order>0</sort_order>
|
78 |
+
<show_in_default>1</show_in_default>
|
79 |
+
</tracking_enable>
|
80 |
+
</fields>
|
81 |
+
</tracking_configuration>
|
82 |
+
</groups>
|
83 |
+
</tracking>
|
84 |
+
</sections>
|
85 |
+
</config>
|
app/code/community/Photoslurp/{PhotoslurpWidget/sql/photoslurpwidget_setup/mysql4-install-0.1.0.php → PsWidget/sql/pswidget_setup/mysql4-install-1.0.0.php}
RENAMED
@@ -1,82 +1,77 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
$installer->startSetup();
|
4 |
-
$sql=<<<SQLTEXT
|
5 |
-
|
6 |
-
CREATE TABLE
|
7 |
-
id int(11) NOT NULL AUTO_INCREMENT,
|
8 |
-
widget_enable tinyint(1) DEFAULT NULL,
|
9 |
-
widget_container_id varchar(255) DEFAULT NULL,
|
10 |
-
widget_id varchar(255) DEFAULT NULL,
|
11 |
-
widget_type varchar(255) DEFAULT NULL,
|
12 |
-
album_id varchar(255) DEFAULT NULL,
|
13 |
-
product_id varchar(255) DEFAULT NULL,
|
14 |
-
lang varchar(255) DEFAULT NULL,
|
15 |
-
page_limit int(11) DEFAULT NULL,
|
16 |
-
page_type varchar(255) DEFAULT NULL,
|
17 |
-
show_submit tinyint(1) DEFAULT NULL,
|
18 |
-
submit_text text DEFAULT NULL,
|
19 |
-
add_photos_img text DEFAULT NULL,
|
20 |
-
note_add_pics_text text DEFAULT NULL,
|
21 |
-
note_add_pics_icons varchar(255) DEFAULT NULL,
|
22 |
-
social_icons tinyint(1) DEFAULT NULL,
|
23 |
-
image_height int(11) DEFAULT NULL,
|
24 |
-
image_width int(11) DEFAULT NULL,
|
25 |
-
|
26 |
-
style_submissionform_colourtop varchar(255) DEFAULT NULL,
|
27 |
-
style_submissionform_colourbutton varchar(255) DEFAULT NULL,
|
28 |
-
style_submissionform_font varchar(255) DEFAULT NULL,
|
29 |
-
|
30 |
-
style_taggingtitle_font_family varchar(255) DEFAULT NULL,
|
31 |
-
style_taggingtitle_font_style varchar(255) DEFAULT NULL,
|
32 |
-
style_taggingtitle_font_weight varchar(255) DEFAULT NULL,
|
33 |
-
style_taggingtitle_font_color varchar(255) DEFAULT NULL,
|
34 |
-
style_taggingtitle_font_size varchar(255) DEFAULT NULL,
|
35 |
-
|
36 |
-
style_thumbnail_bg_color varchar(255) DEFAULT NULL,
|
37 |
-
style_thumbnail_border_color varchar(255) DEFAULT NULL,
|
38 |
-
|
39 |
-
style_carousel_bg_color varchar(255) DEFAULT NULL,
|
40 |
-
|
41 |
-
style_popup_bg_color varchar(255) DEFAULT NULL,
|
42 |
-
style_popup_title_font_family varchar(255) DEFAULT NULL,
|
43 |
-
style_popup_title_font_style varchar(255) DEFAULT NULL,
|
44 |
-
style_popup_title_font_weight varchar(255) DEFAULT NULL,
|
45 |
-
style_popup_title_font_color varchar(255) DEFAULT NULL,
|
46 |
-
|
47 |
-
style_source_font_family varchar(255) DEFAULT NULL,
|
48 |
-
style_source_font_style varchar(255) DEFAULT NULL,
|
49 |
-
style_source_font_weight varchar(255) DEFAULT NULL,
|
50 |
-
style_source_font_color varchar(255) DEFAULT NULL,
|
51 |
-
|
52 |
-
style_productcaptionshop_font_family varchar(255) DEFAULT NULL,
|
53 |
-
style_productcaptionshop_font_style varchar(255) DEFAULT NULL,
|
54 |
-
style_productcaptionshop_font_weight varchar(255) DEFAULT NULL,
|
55 |
-
style_productcaptionshop_font_color varchar(255) DEFAULT NULL,
|
56 |
-
|
57 |
-
style_productdescription_font_family varchar(255) DEFAULT NULL,
|
58 |
-
style_productdescription_font_style varchar(255) DEFAULT NULL,
|
59 |
-
style_productdescription_font_weight varchar(255) DEFAULT NULL,
|
60 |
-
style_productdescription_font_color varchar(255) DEFAULT NULL,
|
61 |
-
|
62 |
-
style_custom longtext DEFAULT NULL,
|
63 |
-
style_custom_enable tinyint(1) DEFAULT NULL,
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
$installer->run($sql);
|
78 |
-
//demo
|
79 |
-
//Mage::getModel('core/url_rewrite')->setId(null);
|
80 |
-
//demo
|
81 |
-
$installer->endSetup();
|
82 |
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
$sql=<<<SQLTEXT
|
5 |
+
|
6 |
+
CREATE TABLE IF NOT EXISTS {$installer->getTable('pswidget/pswidget')} (
|
7 |
+
id int(11) NOT NULL AUTO_INCREMENT,
|
8 |
+
widget_enable tinyint(1) DEFAULT NULL,
|
9 |
+
widget_container_id varchar(255) DEFAULT NULL,
|
10 |
+
widget_id varchar(255) DEFAULT NULL,
|
11 |
+
widget_type varchar(255) DEFAULT NULL,
|
12 |
+
album_id varchar(255) DEFAULT NULL,
|
13 |
+
product_id varchar(255) DEFAULT NULL,
|
14 |
+
lang varchar(255) DEFAULT NULL,
|
15 |
+
page_limit int(11) DEFAULT NULL,
|
16 |
+
page_type varchar(255) DEFAULT NULL,
|
17 |
+
show_submit tinyint(1) DEFAULT NULL,
|
18 |
+
submit_text text DEFAULT NULL,
|
19 |
+
add_photos_img text DEFAULT NULL,
|
20 |
+
note_add_pics_text text DEFAULT NULL,
|
21 |
+
note_add_pics_icons varchar(255) DEFAULT NULL,
|
22 |
+
social_icons tinyint(1) DEFAULT NULL,
|
23 |
+
image_height int(11) DEFAULT NULL,
|
24 |
+
image_width int(11) DEFAULT NULL,
|
25 |
+
|
26 |
+
style_submissionform_colourtop varchar(255) DEFAULT NULL,
|
27 |
+
style_submissionform_colourbutton varchar(255) DEFAULT NULL,
|
28 |
+
style_submissionform_font varchar(255) DEFAULT NULL,
|
29 |
+
|
30 |
+
style_taggingtitle_font_family varchar(255) DEFAULT NULL,
|
31 |
+
style_taggingtitle_font_style varchar(255) DEFAULT NULL,
|
32 |
+
style_taggingtitle_font_weight varchar(255) DEFAULT NULL,
|
33 |
+
style_taggingtitle_font_color varchar(255) DEFAULT NULL,
|
34 |
+
style_taggingtitle_font_size varchar(255) DEFAULT NULL,
|
35 |
+
|
36 |
+
style_thumbnail_bg_color varchar(255) DEFAULT NULL,
|
37 |
+
style_thumbnail_border_color varchar(255) DEFAULT NULL,
|
38 |
+
|
39 |
+
style_carousel_bg_color varchar(255) DEFAULT NULL,
|
40 |
+
|
41 |
+
style_popup_bg_color varchar(255) DEFAULT NULL,
|
42 |
+
style_popup_title_font_family varchar(255) DEFAULT NULL,
|
43 |
+
style_popup_title_font_style varchar(255) DEFAULT NULL,
|
44 |
+
style_popup_title_font_weight varchar(255) DEFAULT NULL,
|
45 |
+
style_popup_title_font_color varchar(255) DEFAULT NULL,
|
46 |
+
|
47 |
+
style_source_font_family varchar(255) DEFAULT NULL,
|
48 |
+
style_source_font_style varchar(255) DEFAULT NULL,
|
49 |
+
style_source_font_weight varchar(255) DEFAULT NULL,
|
50 |
+
style_source_font_color varchar(255) DEFAULT NULL,
|
51 |
+
|
52 |
+
style_productcaptionshop_font_family varchar(255) DEFAULT NULL,
|
53 |
+
style_productcaptionshop_font_style varchar(255) DEFAULT NULL,
|
54 |
+
style_productcaptionshop_font_weight varchar(255) DEFAULT NULL,
|
55 |
+
style_productcaptionshop_font_color varchar(255) DEFAULT NULL,
|
56 |
+
|
57 |
+
style_productdescription_font_family varchar(255) DEFAULT NULL,
|
58 |
+
style_productdescription_font_style varchar(255) DEFAULT NULL,
|
59 |
+
style_productdescription_font_weight varchar(255) DEFAULT NULL,
|
60 |
+
style_productdescription_font_color varchar(255) DEFAULT NULL,
|
61 |
+
|
62 |
+
style_custom longtext DEFAULT NULL,
|
63 |
+
style_custom_enable tinyint(1) DEFAULT NULL,
|
64 |
+
|
65 |
+
PRIMARY KEY (id)
|
66 |
+
)
|
67 |
+
ENGINE = INNODB
|
68 |
+
AVG_ROW_LENGTH = 4096
|
69 |
+
CHARACTER SET utf8
|
70 |
+
COLLATE utf8_general_ci;
|
71 |
+
|
72 |
+
SQLTEXT;
|
73 |
+
|
74 |
+
$installer->run($sql);
|
75 |
+
|
76 |
+
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
|
77 |
|
app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.0-1.0.1.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
$connection = $installer->getConnection();
|
5 |
+
|
6 |
+
$installer->startSetup();
|
7 |
+
|
8 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'random_order',
|
9 |
+
"tinyint(1) DEFAULT NULL");
|
10 |
+
|
11 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'allow_empty',
|
12 |
+
'tinyint(1) DEFAULT NULL');
|
13 |
+
|
14 |
+
$installer->endSetup();
|
app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.1-1.0.2.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
$sql=<<<SQLTEXT
|
6 |
+
|
7 |
+
CREATE TABLE IF NOT EXISTS {$installer->getTable('pswidget/pswidgetlang')} (
|
8 |
+
id int(11) NOT NULL AUTO_INCREMENT,
|
9 |
+
id_widget int(11) NOT NULL,
|
10 |
+
id_lang int(11) NOT NULL,
|
11 |
+
submit_text text DEFAULT NULL,
|
12 |
+
note_add_pics_text text DEFAULT NULL,
|
13 |
+
PRIMARY KEY (id)
|
14 |
+
)
|
15 |
+
ENGINE = INNODB
|
16 |
+
AVG_ROW_LENGTH = 4096
|
17 |
+
CHARACTER SET utf8
|
18 |
+
COLLATE utf8_general_ci;
|
19 |
+
|
20 |
+
SQLTEXT;
|
21 |
+
|
22 |
+
$installer->run($sql);
|
23 |
+
$installer->endSetup();
|
app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.10-1.0.11.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$connection = $installer->getConnection();
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'submission_form_url', "text NULL");
|
8 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'in_stock_only', "tinyint(1) NULL");
|
9 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'rights_cleared_only', "tinyint(1) NULL");
|
10 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'assigned_only', "tinyint(1) NULL");
|
11 |
+
|
12 |
+
$installer->endSetup();
|
app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.17-1.0.18.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$connection = $installer->getConnection();
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'visible_products', "varchar(255) NULL");
|
7 |
+
|
8 |
+
if (Mage::getModel('admin/block')) {
|
9 |
+
|
10 |
+
if(!Mage::getModel('admin/block')->getCollection()->addFieldToFilter('block_name', 'pswidget/widget')->getFirstItem()->getId()){
|
11 |
+
$installer->getConnection()->insertMultiple(
|
12 |
+
$installer->getTable('admin/permission_block'),
|
13 |
+
array(
|
14 |
+
array('block_name' => 'pswidget/widget', 'is_allowed' => 1),
|
15 |
+
)
|
16 |
+
);
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
$installer->endSetup();
|
app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.2-1.0.3.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$connection = $installer->getConnection();
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'position',
|
8 |
+
"varchar(255) NULL");
|
9 |
+
|
10 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'additional_params',
|
11 |
+
"text NULL");
|
12 |
+
|
13 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidgetlang'), 'shop_this_look_text',
|
14 |
+
"text NULL");
|
15 |
+
|
16 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'autoscroll_limit',
|
17 |
+
"int NULL");
|
18 |
+
|
19 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidgetlang'), 'cta_button',
|
20 |
+
"text NULL");
|
21 |
+
|
22 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'enable_ga',
|
23 |
+
"tinyint(1) NULL");
|
24 |
+
|
25 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'submission_form_css_url',
|
26 |
+
"text NULL");
|
27 |
+
|
28 |
+
|
29 |
+
$installer->endSetup();
|
app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.21-1.0.22.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$connection = $installer->getConnection();
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'collections', "varchar(255) NULL");
|
7 |
+
|
8 |
+
$installer->endSetup();
|
app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.4-1.0.5.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$connection = $installer->getConnection();
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'social_count',
|
8 |
+
"tinyint(1) NULL");
|
9 |
+
|
10 |
+
$installer->endSetup();
|
app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.5-1.0.6.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$connection = $installer->getConnection();
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidgetlang'), 'load_more_text', "text NULL");
|
8 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'init_delay', "int NULL");
|
9 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'thumb_overlay', "tinyint(1) NULL");
|
10 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'varying_thumb_sizes', "tinyint(1) NULL");
|
11 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'auto_scroll_carousel', "tinyint(1) NULL");
|
12 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'one_photo_per_line', "tinyint(1) NULL");
|
13 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'analytics_cookie_ttl', "int NULL");
|
14 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'lightbox', "tinyint(1) NULL");
|
15 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'fix_widget_analytics', "tinyint(1) NULL");
|
16 |
+
|
17 |
+
$installer->endSetup();
|
app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.6-1.0.7.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$connection = $installer->getConnection();
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'user_name', "varchar(255) NULL");
|
8 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'toc_link', "text NULL");
|
9 |
+
|
10 |
+
$installer->endSetup();
|
app/code/community/Photoslurp/PsWidget/sql/pswidget_setup/mysql4-upgrade-1.0.8-1.0.9.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$connection = $installer->getConnection();
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'strict_products', "tinyint(1) NULL");
|
8 |
+
$installer->getConnection()->addColumn($installer->getTable('pswidget/pswidget'), 'empty_threshold', "tinyint(1) NULL");
|
9 |
+
|
10 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/photoslurpwidget.xml
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout version="0.1.0">
|
3 |
-
|
4 |
-
<photoslurpwidget_adminhtml_photoslurpwidget_index>
|
5 |
-
<reference name="content">
|
6 |
-
<block type="photoslurpwidget/adminhtml_photoslurpwidget" name="photoslurpwidget" />
|
7 |
-
</reference>
|
8 |
-
</photoslurpwidget_adminhtml_photoslurpwidget_index>
|
9 |
-
|
10 |
-
<photoslurpwidget_adminhtml_photoslurpwidget_edit>
|
11 |
-
<reference name="head">
|
12 |
-
<action method="addJs"><script>photoslurp/admin.js</script></action>
|
13 |
-
</reference>
|
14 |
-
</photoslurpwidget_adminhtml_photoslurpwidget_edit>
|
15 |
-
|
16 |
-
<photoslurpwidget_adminhtml_photoslurpwidget_new>
|
17 |
-
<reference name="head">
|
18 |
-
<action method="addJs"><script>photoslurp/admin.js</script></action>
|
19 |
-
</reference>
|
20 |
-
</photoslurpwidget_adminhtml_photoslurpwidget_new>
|
21 |
-
|
22 |
-
<photoslurpwidget_adminhtml_photoslurpwidgetbackend_index>
|
23 |
-
<reference name="content">
|
24 |
-
<block type="adminhtml/template" name="photoslurpwidgetbackend" template="photoslurpwidget/photoslurpwidgetbackend.phtml"/>
|
25 |
-
<!--<block type="photoslurpwidget/adminhtml_photoslurpwidgetbackend" name="photoslurpwidgetbackend" template="photoslurpwidget/photoslurpwidgetbackend.phtml"/>-->
|
26 |
-
</reference>
|
27 |
-
</photoslurpwidget_adminhtml_photoslurpwidgetbackend_index>
|
28 |
-
|
29 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/layout/pswidget.xml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
|
4 |
+
<adminhtml_pswidget_pswidget_index>
|
5 |
+
<reference name="content">
|
6 |
+
<block type="pswidget/adminhtml_pswidget" name="pswidget" />
|
7 |
+
</reference>
|
8 |
+
</adminhtml_pswidget_pswidget_index>
|
9 |
+
|
10 |
+
<adminhtml_pswidget_pswidget_edit>
|
11 |
+
<reference name="head">
|
12 |
+
<action method="addJs"><script>photoslurp/admin.js</script></action>
|
13 |
+
</reference>
|
14 |
+
</adminhtml_pswidget_pswidget_edit>
|
15 |
+
|
16 |
+
<adminhtml_pswidget_pswidget_new>
|
17 |
+
<reference name="head">
|
18 |
+
<action method="addJs"><script>photoslurp/admin.js</script></action>
|
19 |
+
</reference>
|
20 |
+
</adminhtml_pswidget_pswidget_new>
|
21 |
+
|
22 |
+
<adminhtml_pswidget_pswidgetbackend_index>
|
23 |
+
<reference name="content">
|
24 |
+
<block type="adminhtml/template" name="pswidgetbackend" template="pswidget/pswidgetbackend.phtml"/>
|
25 |
+
<!--<block type="pswidget/adminhtml_pswidgetbackend" name="pswidgetbackend" template="pswidget/pswidgetbackend.phtml"/>-->
|
26 |
+
</reference>
|
27 |
+
</adminhtml_pswidget_pswidgetbackend_index>
|
28 |
+
|
29 |
+
</layout>
|
app/design/adminhtml/default/default/template/photoslurpwidget/photoslurpwidgetbackend.phtml
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php $helper = Mage::helper('photoslurpwidget'); ?>
|
2 |
-
|
3 |
-
<div class="content-header">
|
4 |
-
<h3 class="icon-head head-adminhtml-photoslurpwidget">Photoslurp Product Export</h3>
|
5 |
-
</div>
|
6 |
-
|
7 |
-
<div>
|
8 |
-
<form method="get" action="<?php echo Mage::helper("adminhtml")->getUrl("photoslurpwidget/adminhtml_photoslurpwidgetbackend/export/") ?>">
|
9 |
-
<button type="submit"><?php echo Mage::helper('adminhtml')->__('Export products')?></button>
|
10 |
-
</form>
|
11 |
-
</div>
|
12 |
-
|
13 |
-
<br>
|
14 |
-
|
15 |
-
<?php if (file_exists($helper->getFileName())):?>
|
16 |
-
<p>
|
17 |
-
<?php echo Mage::helper('adminhtml')->__('Access link:')?>
|
18 |
-
<a href="<?php echo Mage::helper('adminhtml')->__('%s%s', Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB),$helper->getFileName())?>" download><?php echo Mage::helper('adminhtml')->__('%s%s', Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB),$helper->getFileName())?></a>
|
19 |
-
</p>
|
20 |
-
<?php endif; ?>
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/pswidget/pswidgetbackend.phtml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $helper = Mage::helper('pswidget'); ?>
|
2 |
+
|
3 |
+
<div class="content-header">
|
4 |
+
<h3 class="icon-head head-adminhtml-pswidget">Photoslurp Product Export</h3>
|
5 |
+
</div>
|
6 |
+
|
7 |
+
<div>
|
8 |
+
<form method="get" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/pswidget_pswidgetbackend/export/") ?>">
|
9 |
+
<input type="hidden" name="product_type" value="<?php echo Mage::getStoreConfig('export/export_configuration/export_type') ?>">
|
10 |
+
<p><button type="submit"><?php echo Mage::helper('adminhtml')->__('Export products')?></button></p>
|
11 |
+
<?php if (file_exists($helper->getExportedFileName())):?>
|
12 |
+
<p>
|
13 |
+
<?php $link = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).str_replace(Mage::getBaseDir('base').'/','',$helper->getExportedFileName()) ?>
|
14 |
+
<?php echo Mage::helper('adminhtml')->__('Access link:')?>
|
15 |
+
<a href="<?php echo $link ?>" download><?php echo $link ?></a>
|
16 |
+
</p>
|
17 |
+
<?php endif; ?>
|
18 |
+
<p><a href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/system_config/edit/section/export")?>"> <?php echo $this->__('Settings') ?></a></p>
|
19 |
+
</form>
|
20 |
+
</div>
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
|
app/design/frontend/base/default/layout/photoslurpwidget.xml
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout version="0.1.0">
|
3 |
-
|
4 |
-
<default>
|
5 |
-
<reference name="head">
|
6 |
-
<block type="photoslurpwidget/widget" template="photoslurpwidget/style.phtml"/>
|
7 |
-
</reference>
|
8 |
-
</default>
|
9 |
-
|
10 |
-
<catalog_product_view>
|
11 |
-
<reference name="product.info.additional">
|
12 |
-
<block type="photoslurpwidget/widget" template="photoslurpwidget/widget.phtml" name="photoslurpwidget">
|
13 |
-
<!--<action method="setData"><name>id</name><value>3</value></action>-->
|
14 |
-
<action method="setData"><name>type</name><value>product</value></action>
|
15 |
-
</block>
|
16 |
-
</reference>
|
17 |
-
</catalog_product_view>
|
18 |
-
|
19 |
-
<checkout_onepage_success>
|
20 |
-
<reference name="before_body_end">
|
21 |
-
<block name="photoslurp_tracking" template="photoslurpwidget/tracking.phtml" type="core/template" />
|
22 |
-
</reference>
|
23 |
-
</checkout_onepage_success>
|
24 |
-
|
25 |
-
</layout>
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/layout/pswidget.xml
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
|
4 |
+
<default>
|
5 |
+
<reference name="head">
|
6 |
+
<block type="pswidget/widget" template="pswidget/style.phtml"/>
|
7 |
+
</reference>
|
8 |
+
</default>
|
9 |
+
|
10 |
+
<catalog_product_view>
|
11 |
+
|
12 |
+
<reference name="after_body_start" >
|
13 |
+
<block type="pswidget/widget" template="pswidget/widget.phtml" name="pswidget.product.page.top">
|
14 |
+
<action method="setData"><name>page_type</name><value>product</value></action>
|
15 |
+
<action method="setData"><name>position</name><value>product-page-top</value></action>
|
16 |
+
</block>
|
17 |
+
</reference>
|
18 |
+
<reference name="before_body_end" >
|
19 |
+
<block type="pswidget/widget" template="pswidget/widget.phtml" name="pswidget.product.page.bottom">
|
20 |
+
<action method="setData"><name>page_type</name><value>product</value></action>
|
21 |
+
<action method="setData"><name>position</name><value>product-page-bottom</value></action>
|
22 |
+
</block>
|
23 |
+
</reference>
|
24 |
+
<reference name="content">
|
25 |
+
<block type="pswidget/widget" template="pswidget/widget.phtml" name="pswidget.product.content.top" before="-">
|
26 |
+
<action method="setData"><name>page_type</name><value>product</value></action>
|
27 |
+
<action method="setData"><name>position</name><value>product-content-top</value></action>
|
28 |
+
</block>
|
29 |
+
</reference>
|
30 |
+
<reference name="content">
|
31 |
+
<block type="pswidget/widget" template="pswidget/widget.phtml" name="pswidget.product.content.bottom" after="-">
|
32 |
+
<action method="setData"><name>page_type</name><value>product</value></action>
|
33 |
+
<action method="setData"><name>position</name><value>product-content-bottom</value></action>
|
34 |
+
</block>
|
35 |
+
</reference>
|
36 |
+
<reference name="product.info.media.after">
|
37 |
+
<block type="pswidget/widget" template="pswidget/widget.phtml" name="pswidget.product.media">
|
38 |
+
<action method="setData"><name>page_type</name><value>product</value></action>
|
39 |
+
<action method="setData"><name>position</name><value>product-media</value></action>
|
40 |
+
</block>
|
41 |
+
</reference>
|
42 |
+
|
43 |
+
</catalog_product_view>
|
44 |
+
|
45 |
+
<checkout_onepage_success>
|
46 |
+
<reference name="before_body_end">
|
47 |
+
<block name="photoslurp_tracking" template="pswidget/tracking.phtml" type="core/template" />
|
48 |
+
</reference>
|
49 |
+
</checkout_onepage_success>
|
50 |
+
|
51 |
+
</layout>
|
52 |
+
|
app/design/frontend/base/default/template/photoslurpwidget/widget.phtml
DELETED
@@ -1,188 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$_product = $this->getProduct();
|
4 |
-
|
5 |
-
if ($this->getData('type') == 'product') {
|
6 |
-
$_widget = $this->getProductPageWidget();
|
7 |
-
} else {
|
8 |
-
$_widget = $this->getWidget();
|
9 |
-
}
|
10 |
-
|
11 |
-
?>
|
12 |
-
|
13 |
-
<?php if($_widget->getId()):
|
14 |
-
|
15 |
-
$_widget_container_id = $_widget->getWidgetContainerId();
|
16 |
-
$_widget_type = Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid::getValueArray5()[$_widget->getWidgetType()]['label'];
|
17 |
-
$_album_id = $_widget -> getAlbumId();
|
18 |
-
$_lang = Mage::app()->getStore()->getCode();//$_widget -> getLang();
|
19 |
-
$_widget_id = $_widget -> getWidgetId();
|
20 |
-
$_image_height = $_widget -> getImageHeight();
|
21 |
-
$_image_width = $_widget -> getImageWidth();
|
22 |
-
$_show_submit = $_widget -> getShowSubmit();
|
23 |
-
$_submit_text = $_widget -> getSubmitText();
|
24 |
-
$_page_limit = $_widget -> getPageLimit();
|
25 |
-
$_page_type = Photoslurp_PhotoslurpWidget_Block_Adminhtml_Photoslurpwidget_Grid::getValueArray10()[$_widget -> getPageType()]['label'];
|
26 |
-
$_product_id = ($_product)?$_product->getSku():'';
|
27 |
-
$_add_photos_img = $_widget -> getAddPhotosImg();
|
28 |
-
$_social_icons = $_widget -> getSocialIcons();
|
29 |
-
$_note_add_pics_text = $_widget -> getNoteAddPicsText();
|
30 |
-
$_note_add_pics_icons_arr = explode(",", $_widget->getNoteAddPicsIcons());
|
31 |
-
|
32 |
-
$_facebook = ($this->getIsFacebookIconEnabled())?'true':'false';
|
33 |
-
$_twitter = ($this->getIsTwitterIconEnabled())?'true':'false';
|
34 |
-
$_instagram = ($this->getIsInstagramIconEnabled())?'true':'false';
|
35 |
-
|
36 |
-
//STYLE PARAMETERS
|
37 |
-
|
38 |
-
$_style_submissionform_colourtop = $_widget->getData('style_submissionform_colourtop');
|
39 |
-
$_style_submissionform_colourbutton = $_widget->getData('style_submissionform_colourbutton');
|
40 |
-
$_style_submissionform_font = $_widget->getData('style_submissionform_font');
|
41 |
-
|
42 |
-
$_style_taggingtitle_font_family = $_widget->getData('style_taggingtitle_font_family');
|
43 |
-
$_style_taggingtitle_font_style = $_widget->getData('style_taggingtitle_font_style');
|
44 |
-
$_style_taggingtitle_font_weight = $_widget->getData('style_taggingtitle_font_weight');
|
45 |
-
$_style_taggingtitle_font_color = $_widget->getData('style_taggingtitle_font_color');
|
46 |
-
$_style_taggingtitle_font_size = $_widget->getData('style_taggingtitle_font_size');
|
47 |
-
|
48 |
-
$_style_thumbnail_bg_color = $_widget->getData('style_thumbnail_bg_color');
|
49 |
-
$_style_thumbnail_border_color = $_widget->getData('style_thumbnail_border_color');
|
50 |
-
|
51 |
-
$_style_carousel_bg_color = $_widget->getData('style_carousel_bg_color');
|
52 |
-
|
53 |
-
$_style_popup_bg_color = $_widget->getData('style_popup_bg_color');
|
54 |
-
$_style_popup_title_font_family = $_widget->getData('style_popup_title_font_family');
|
55 |
-
$_style_popup_title_font_style = $_widget->getData('style_popup_title_font_style');
|
56 |
-
$_style_popup_title_font_weight = $_widget->getData('style_popup_title_font_weight');
|
57 |
-
$_style_popup_title_font_color = $_widget->getData('style_popup_title_font_color');
|
58 |
-
|
59 |
-
$_style_source_font_family = $_widget->getData('style_source_font_family');
|
60 |
-
$_style_source_font_style = $_widget->getData('style_source_font_style');
|
61 |
-
$_style_source_font_weight = $_widget->getData('style_source_font_weight');
|
62 |
-
$_style_source_font_color = $_widget->getData('style_source_font_color');
|
63 |
-
|
64 |
-
$_style_productcaptionshop_font_family = $_widget->getData('style_productcaptionshop_font_family');
|
65 |
-
$_style_productcaptionshop_font_style = $_widget->getData('style_productcaptionshop_font_style');
|
66 |
-
$_style_productcaptionshop_font_weight = $_widget->getData('style_productcaptionshop_font_weight');
|
67 |
-
$_style_productcaptionshop_font_color = $_widget->getData('style_productcaptionshop_font_color');
|
68 |
-
|
69 |
-
$_style_productdescription_font_family = $_widget->getData('style_productdescription_font_family');
|
70 |
-
$_style_productdescription_font_style = $_widget->getData('style_productdescription_font_style');
|
71 |
-
$_style_productdescription_font_weight = $_widget->getData('style_productdescription_font_weight');
|
72 |
-
$_style_productdescription_font_color = $_widget->getData('style_productdescription_font_color');
|
73 |
-
?>
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
<div id="<?php echo $_widget_container_id ?>" style="clear:both" class="ps-container">
|
79 |
-
<script data-type="photoslurp">
|
80 |
-
|
81 |
-
if(!photoSlurpWidgetSettings) {
|
82 |
-
var photoSlurpWidgetSettings = {};
|
83 |
-
}
|
84 |
-
|
85 |
-
(function() {
|
86 |
-
photoSlurpWidgetSettings['<?php echo $_widget_container_id ?>'] = {
|
87 |
-
widgetType: '<?php echo $_widget_type ?>',
|
88 |
-
albumId: <?php echo $_album_id ?>,
|
89 |
-
lang: '<?php echo $_lang ?>',
|
90 |
-
widgetId: '<?php echo $_widget_id ?>',
|
91 |
-
imageHeight: '<?php echo $this->__('%spx',$_image_height) ?>',
|
92 |
-
imageWidth: '<?php echo $this->__('%spx',$_image_width) ?>',
|
93 |
-
showSubmit: <?php echo $_show_submit ?>,
|
94 |
-
submitText: '<?php echo $_submit_text ?>',
|
95 |
-
page_limit: <?php echo $_page_limit ?>,
|
96 |
-
pageType: '<?php echo $_page_type ?>',
|
97 |
-
productId: '<?php echo $_product_id ?>',
|
98 |
-
addPhotosImg: '<?php echo $_add_photos_img ?>',
|
99 |
-
socialIcons: <?php echo $_social_icons ?>,
|
100 |
-
noteAddPicsText:'<?php echo $_note_add_pics_text ?>',
|
101 |
-
noteAddPicsIcons: {
|
102 |
-
facebook: <?php echo $_facebook ?>,
|
103 |
-
twitter: <?php echo $_twitter ?>,
|
104 |
-
instagram: <?php echo $_instagram ?>
|
105 |
-
},
|
106 |
-
|
107 |
-
|
108 |
-
style: {
|
109 |
-
submissionForm: {
|
110 |
-
colourTop: '<?php echo $_style_submissionform_colourtop ?>', //Default #4F5F6F
|
111 |
-
colourButton: '<?php echo $_style_submissionform_colourbutton ?>', //Default #5DADE2
|
112 |
-
font: '<?php echo $_style_submissionform_font ?>'//Default "Open Sans"
|
113 |
-
},
|
114 |
-
taggingTitle: {
|
115 |
-
font: {
|
116 |
-
family: '<?php echo $_style_taggingtitle_font_family ?>',
|
117 |
-
style: '<?php echo $_style_taggingtitle_font_style ?>',
|
118 |
-
weight: '<?php echo $_style_taggingtitle_font_weight ?>',
|
119 |
-
color: '<?php echo $_style_taggingtitle_font_color ?>',
|
120 |
-
size: '<?php echo $_style_taggingtitle_font_size ?>'
|
121 |
-
}
|
122 |
-
},
|
123 |
-
thumbnail: {
|
124 |
-
bg: {
|
125 |
-
color: '<?php echo $_style_thumbnail_bg_color ?>'
|
126 |
-
},
|
127 |
-
border: {
|
128 |
-
color: '<?php echo $_style_thumbnail_border_color ?>'
|
129 |
-
}
|
130 |
-
},
|
131 |
-
carousel: {
|
132 |
-
bg: {
|
133 |
-
color: '<?php echo $_style_carousel_bg_color ?>'
|
134 |
-
}
|
135 |
-
},
|
136 |
-
popup: {
|
137 |
-
bg: {
|
138 |
-
color: '<?php echo $_style_popup_bg_color ?>'
|
139 |
-
},
|
140 |
-
title: {
|
141 |
-
font: {
|
142 |
-
family: '<?php echo $_style_popup_title_font_family ?>',
|
143 |
-
style: '<?php echo $_style_popup_title_font_style ?>',
|
144 |
-
weight: '<?php echo $_style_popup_title_font_weight ?>',
|
145 |
-
color: '<?php echo $_style_popup_title_font_color ?>'
|
146 |
-
}
|
147 |
-
},
|
148 |
-
source: {
|
149 |
-
font: {
|
150 |
-
family: '<?php echo $_style_source_font_family ?>',
|
151 |
-
style: '<?php echo $_style_source_font_style ?>',
|
152 |
-
weight: '<?php echo $_style_source_font_weight ?>',
|
153 |
-
color: '<?php echo $_style_source_font_color ?>'
|
154 |
-
}
|
155 |
-
},
|
156 |
-
product_caption_shop: {
|
157 |
-
font: {
|
158 |
-
family: '<?php echo $_style_productcaptionshop_font_family ?>',
|
159 |
-
style: '<?php echo $_style_productcaptionshop_font_style ?>',
|
160 |
-
weight: '<?php echo $_style_productcaptionshop_font_weight ?>',
|
161 |
-
color: '<?php echo $_style_productcaptionshop_font_color ?>'
|
162 |
-
}
|
163 |
-
},
|
164 |
-
product_description: {
|
165 |
-
font: {
|
166 |
-
family: '<?php echo $_style_productdescription_font_family ?>',
|
167 |
-
style: '<?php echo $_style_productdescription_font_style ?>',
|
168 |
-
weight: '<?php echo $_style_productdescription_font_weight ?>',
|
169 |
-
color: '<?php echo $_style_productdescription_font_color ?>'
|
170 |
-
}
|
171 |
-
}
|
172 |
-
}
|
173 |
-
}
|
174 |
-
};
|
175 |
-
var script = document.createElement('script');
|
176 |
-
script.async = true;
|
177 |
-
script.src = 'http://www.photoslurp.com/static/widget/v1/widget_loader.js';
|
178 |
-
var entry = document.getElementsByTagName('script')[0];
|
179 |
-
entry.parentNode.insertBefore(script, entry);
|
180 |
-
})();
|
181 |
-
|
182 |
-
</script>
|
183 |
-
<a href="//corp.photoslurp.com" target="_blank" class="ps-poweredby-link">
|
184 |
-
<div class="ps-logo-widget-carousel"></div>
|
185 |
-
</a>
|
186 |
-
</div>
|
187 |
-
|
188 |
-
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/{photoslurpwidget → pswidget}/style.phtml
RENAMED
@@ -1,13 +1,11 @@
|
|
1 |
-
<?php
|
2 |
-
$_product = $this->getProduct();
|
3 |
-
$_widgets = $this->getAllWidgets();
|
4 |
-
?>
|
5 |
-
|
6 |
-
<?php foreach($_widgets as $widget)
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
<?php endforeach; ?>
|
13 |
-
|
1 |
+
<?php
|
2 |
+
$_product = $this->getProduct();
|
3 |
+
$_widgets = $this->getAllWidgets();
|
4 |
+
?>
|
5 |
+
|
6 |
+
<?php foreach($_widgets as $widget): $_containerId = 'ps_container'.$widget->getId();?>
|
7 |
+
<style type="text/css" data-photoslurp-css-id="<?php echo $_containerId ?>">
|
8 |
+
<?php echo $this->prepareStyleText($widget->getStyleCustom(),$_containerId) ; ?>
|
9 |
+
</style>
|
10 |
+
<?php endforeach; ?>
|
11 |
+
|
|
|
|
app/design/frontend/base/default/template/{photoslurpwidget → pswidget}/tracking.phtml
RENAMED
@@ -1,26 +1,28 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
s.
|
22 |
-
s.
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
1 |
+
<?php if(Mage::getStoreConfig('tracking/tracking_configuration/tracking_enable')):?>
|
2 |
+
<?php
|
3 |
+
$_order = Mage::getSingleton('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
|
4 |
+
$_items = $_order->getAllVisibleItems();
|
5 |
+
$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
|
6 |
+
?>
|
7 |
+
|
8 |
+
<!-- Start Photoslurp Embed Code -->
|
9 |
+
<script type="text/javascript">
|
10 |
+
var photoSlurpTrackingSettings = {
|
11 |
+
products: {
|
12 |
+
<?php foreach ($_items as $item):?>
|
13 |
+
'<?php echo $item->getProduct()->getSku() ?>': {count:<?php echo $item->getQtyOrdered() ?>, price:<?php echo $item->getPrice() ?>, currency: '<?php echo $currency_code ?>'},
|
14 |
+
<?php endforeach; ?>
|
15 |
+
}
|
16 |
+
};
|
17 |
+
(function() {
|
18 |
+
var d=document,
|
19 |
+
h=d.getElementsByTagName('head')[0],
|
20 |
+
s=d.createElement('script');
|
21 |
+
s.type='text/javascript';
|
22 |
+
s.async=true;
|
23 |
+
s.src='//static.photoslurp.com/widget/v1/tracking_notify.js';
|
24 |
+
h.appendChild(s);
|
25 |
+
}());
|
26 |
+
</script>
|
27 |
+
<!-- End Photoslurp Embed Code -->
|
28 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/pswidget/widget.phtml
ADDED
@@ -0,0 +1,281 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<?php
|
3 |
+
|
4 |
+
$_locale = Mage::app()->getLocale()->getLocaleCode();
|
5 |
+
|
6 |
+
$_store_id = Mage::app()->getStore()->getStoreId();
|
7 |
+
|
8 |
+
$_product = $this->getProduct();
|
9 |
+
|
10 |
+
$_skus = array();
|
11 |
+
|
12 |
+
if ($_product){
|
13 |
+
|
14 |
+
$_skus[] = $_product->getSku();
|
15 |
+
|
16 |
+
if($_product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE){
|
17 |
+
|
18 |
+
$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$_product);
|
19 |
+
foreach($childProducts as $child) {
|
20 |
+
$_skus[] = $child->getSku();
|
21 |
+
}
|
22 |
+
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
$_product_id_str = "['".implode("','",$_skus)."']";
|
27 |
+
|
28 |
+
$_widget = $this->getWidget();
|
29 |
+
|
30 |
+
?>
|
31 |
+
|
32 |
+
<?php if($_widget->getId()):
|
33 |
+
|
34 |
+
$_widget_types = Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArray5();
|
35 |
+
$_page_types = Photoslurp_PsWidget_Block_Adminhtml_Pswidget_Grid::getValueArray10();
|
36 |
+
|
37 |
+
$_widget_container_id = 'ps_container'.$_widget->getId();//$_widget->getWidgetContainerId();
|
38 |
+
$_widget_type = $_widget_types[$_widget->getWidgetType()]['label'];
|
39 |
+
$_random_order = $_widget -> getRandomOrder();
|
40 |
+
$_allow_empty = $_widget -> getAllowEmpty();
|
41 |
+
$_autoscroll_limit = $_widget -> getAutoscrollLimit();
|
42 |
+
$_album_id = $_widget -> getAlbumId();
|
43 |
+
$_lang = $_locale.'_'.$_store_id;
|
44 |
+
$_widget_id = $_widget -> getWidgetId();
|
45 |
+
$_image_height = $_widget -> getImageHeight();
|
46 |
+
$_image_width = $_widget -> getImageWidth();
|
47 |
+
$_show_submit = $_widget -> getShowSubmit();
|
48 |
+
$_submit_text = $this->getLangValue($_widget->getId(),$_store_id,'submit_text');
|
49 |
+
$_shop_this_look_text = $this->getLangValue($_widget->getId(),$_store_id,'shop_this_look_text');
|
50 |
+
$_cta_button = $this->getLangValue($_widget->getId(),$_store_id,'cta_button');
|
51 |
+
$_load_more_text = $this->getLangValue($_widget->getId(),$_store_id,'load_more_text');
|
52 |
+
|
53 |
+
$_enable_ga = $_widget -> getEnableGa();
|
54 |
+
$_page_limit = $_widget -> getPageLimit();
|
55 |
+
$_page_type = $_page_types[$_widget -> getPageType()]['label'];
|
56 |
+
|
57 |
+
$_add_photos_img = $_widget -> getAddPhotosImg();
|
58 |
+
$_social_icons = $_widget -> getSocialIcons();
|
59 |
+
$_social_count = $_widget -> getSocialCount();
|
60 |
+
|
61 |
+
$_note_add_pics_text = $this->getLangValue($_widget->getId(),$_store_id,'note_add_pics_text');
|
62 |
+
|
63 |
+
$_submission_form_css_url = $_widget -> getSubmissionFormCssUrl();
|
64 |
+
|
65 |
+
$_init_delay = $_widget -> getInitDelay();
|
66 |
+
$_thumb_overlay = $_widget -> getThumbOverlay();
|
67 |
+
$_varying_thumb_sizes = $_widget -> getVaryingThumbSizes();
|
68 |
+
$_auto_scroll_carousel = $_widget -> getAutoScrollCarousel();
|
69 |
+
$_one_photo_per_line = $_widget -> getOnePhotoPerLine();
|
70 |
+
|
71 |
+
$_analytics_cookie_ttl = $_widget -> getAnalyticsCookieTtl();
|
72 |
+
|
73 |
+
$_toc_link = $_widget -> getTocLink();
|
74 |
+
|
75 |
+
$_strict_products = $_widget -> getStrictProducts();
|
76 |
+
$_empty_threshold = $_widget -> getEmptyThreshold();
|
77 |
+
|
78 |
+
$_in_stock_only = $_widget -> getInStockOnly();
|
79 |
+
$_rights_cleared_only = $_widget -> getRightsClearedOnly();
|
80 |
+
$_assigned_only = $_widget -> getAssignedOnly();
|
81 |
+
$_visible_products = $_widget -> getVisibleProducts();
|
82 |
+
|
83 |
+
$_additional_params = $_widget -> getAdditionalParams();
|
84 |
+
$_collections = $_widget -> getCollections();
|
85 |
+
|
86 |
+
|
87 |
+
//STYLE PARAMETERS
|
88 |
+
|
89 |
+
$_style_submissionform_colourtop = $_widget->getData('style_submissionform_colourtop');
|
90 |
+
$_style_submissionform_colourbutton = $_widget->getData('style_submissionform_colourbutton');
|
91 |
+
$_style_submissionform_font = $_widget->getData('style_submissionform_font');
|
92 |
+
|
93 |
+
$_style_taggingtitle_font_family = $_widget->getData('style_taggingtitle_font_family');
|
94 |
+
$_style_taggingtitle_font_style = $_widget->getData('style_taggingtitle_font_style');
|
95 |
+
$_style_taggingtitle_font_weight = $_widget->getData('style_taggingtitle_font_weight');
|
96 |
+
$_style_taggingtitle_font_color = $_widget->getData('style_taggingtitle_font_color');
|
97 |
+
$_style_taggingtitle_font_size = $_widget->getData('style_taggingtitle_font_size');
|
98 |
+
|
99 |
+
$_style_thumbnail_bg_color = $_widget->getData('style_thumbnail_bg_color');
|
100 |
+
$_style_thumbnail_border_color = $_widget->getData('style_thumbnail_border_color');
|
101 |
+
|
102 |
+
$_style_carousel_bg_color = $_widget->getData('style_carousel_bg_color');
|
103 |
+
|
104 |
+
$_style_popup_bg_color = $_widget->getData('style_popup_bg_color');
|
105 |
+
$_style_popup_title_font_family = $_widget->getData('style_popup_title_font_family');
|
106 |
+
$_style_popup_title_font_style = $_widget->getData('style_popup_title_font_style');
|
107 |
+
$_style_popup_title_font_weight = $_widget->getData('style_popup_title_font_weight');
|
108 |
+
$_style_popup_title_font_color = $_widget->getData('style_popup_title_font_color');
|
109 |
+
|
110 |
+
$_style_source_font_family = $_widget->getData('style_source_font_family');
|
111 |
+
$_style_source_font_style = $_widget->getData('style_source_font_style');
|
112 |
+
$_style_source_font_weight = $_widget->getData('style_source_font_weight');
|
113 |
+
$_style_source_font_color = $_widget->getData('style_source_font_color');
|
114 |
+
|
115 |
+
$_style_productcaptionshop_font_family = $_widget->getData('style_productcaptionshop_font_family');
|
116 |
+
$_style_productcaptionshop_font_style = $_widget->getData('style_productcaptionshop_font_style');
|
117 |
+
$_style_productcaptionshop_font_weight = $_widget->getData('style_productcaptionshop_font_weight');
|
118 |
+
$_style_productcaptionshop_font_color = $_widget->getData('style_productcaptionshop_font_color');
|
119 |
+
|
120 |
+
$_style_productdescription_font_family = $_widget->getData('style_productdescription_font_family');
|
121 |
+
$_style_productdescription_font_style = $_widget->getData('style_productdescription_font_style');
|
122 |
+
$_style_productdescription_font_weight = $_widget->getData('style_productdescription_font_weight');
|
123 |
+
$_style_productdescription_font_color = $_widget->getData('style_productdescription_font_color');
|
124 |
+
?>
|
125 |
+
|
126 |
+
|
127 |
+
|
128 |
+
|
129 |
+
<div id="<?php echo $_widget_container_id ?>" style="clear:both" class="ps-container">
|
130 |
+
<script data-type="photoslurp">
|
131 |
+
|
132 |
+
if(!photoSlurpWidgetSettings) {
|
133 |
+
var photoSlurpWidgetSettings = {};
|
134 |
+
}
|
135 |
+
|
136 |
+
(function() {
|
137 |
+
photoSlurpWidgetSettings['<?php echo $_widget_container_id ?>'] = {
|
138 |
+
widgetType: '<?php echo $_widget_type ?>',
|
139 |
+
randomOrder: <?php echo ($_random_order)?'true':'false' ?>,
|
140 |
+
allowEmpty: <?php echo ($_allow_empty)?'true':'false' ?>,
|
141 |
+
albumId: <?php echo $_album_id ?>,
|
142 |
+
lang: '<?php echo $_lang ?>',
|
143 |
+
widgetId: '<?php echo $_widget_id ?>',
|
144 |
+
<?php
|
145 |
+
if($_widget->getWidgetType() == '1'){
|
146 |
+
echo $this->__(" imageHeight: '%spx',\n",$_image_height);
|
147 |
+
}else{
|
148 |
+
echo $this->__(" imageWidth: '%spx',\n",$_image_width);
|
149 |
+
}
|
150 |
+
?>
|
151 |
+
showSubmit: <?php echo ($_show_submit)?'true':'false' ?>,
|
152 |
+
submitText: '<?php echo addslashes($_submit_text) ?>',
|
153 |
+
shopThisLookText:'<?php echo addslashes($_shop_this_look_text) ?>',
|
154 |
+
autoscrollLimit: <?php echo $_autoscroll_limit ?>,
|
155 |
+
pageLimit: <?php echo $_page_limit ?>,
|
156 |
+
pageType: '<?php echo $_page_type ?>',
|
157 |
+
productId: <?php echo $_product_id_str ?>,
|
158 |
+
addPhotosImg: '<?php echo $_add_photos_img ?>',
|
159 |
+
socialIcons: <?php echo ($_social_icons)?'true':'false' ?>,
|
160 |
+
noteAddPicsText:'<?php echo addslashes($_note_add_pics_text) ?>',
|
161 |
+
noteAddPicsIcons: {
|
162 |
+
facebook: false,
|
163 |
+
twitter: false,
|
164 |
+
instagram: false
|
165 |
+
},
|
166 |
+
<?php
|
167 |
+
if ($_collections) {
|
168 |
+
$strings = explode(",",$_collections);
|
169 |
+
for($i = 0; $i < count($strings); $i++){
|
170 |
+
$strings[$i] = trim($strings[$i]);
|
171 |
+
}
|
172 |
+
$str = "'".implode("','",$strings)."'";
|
173 |
+
echo $this->__(" collection: [%s],\n", $str);
|
174 |
+
}
|
175 |
+
if ($_load_more_text) echo $this->__(" loadMoreText: '%s',\n", addslashes($_load_more_text));
|
176 |
+
if ($_init_delay) echo $this->__(" initDelay: %s,\n", $_init_delay);
|
177 |
+
if ($_cta_button) echo $this->__(" ctaButton: '%s',\n", addslashes($_cta_button)) ;
|
178 |
+
if ($_analytics_cookie_ttl) echo $this->__(" analyticsCookieTTL: %s,\n", $_analytics_cookie_ttl) ;
|
179 |
+
if ($_toc_link) echo $this->__(" tocLink: '%s',\n", addslashes($_toc_link));
|
180 |
+
if ($_submission_form_css_url) echo $this->__(" submissionFormCSSURL: '%s',\n", $_submission_form_css_url) ;
|
181 |
+
if ($_visible_products) echo $this->__(" visibleProducts: '%s',\n", $_visible_products);
|
182 |
+
|
183 |
+
$anvanced_enabled = array();
|
184 |
+
if($_enable_ga) $anvanced_enabled[] = 'enableGa';
|
185 |
+
if($_social_count) $anvanced_enabled[] = 'socialCount';
|
186 |
+
if($_thumb_overlay) $anvanced_enabled[] = 'thumbOverlay';
|
187 |
+
if($_varying_thumb_sizes) $anvanced_enabled[] = 'varyingThumbSizes';
|
188 |
+
if($_auto_scroll_carousel) $anvanced_enabled[] = 'autoScrollCarousel';
|
189 |
+
if($_one_photo_per_line) $anvanced_enabled[] = 'onePhotoPerLine';
|
190 |
+
if($_strict_products) $anvanced_enabled[] = 'strictProducts';
|
191 |
+
if($_empty_threshold) $anvanced_enabled[] = 'emptyThreshold';
|
192 |
+
if($_in_stock_only) $anvanced_enabled[] = 'inStockOnly';
|
193 |
+
if($_rights_cleared_only) $anvanced_enabled[] = 'rightsClearedOnly';
|
194 |
+
if($_assigned_only) $anvanced_enabled[] = 'assignedOnly';
|
195 |
+
|
196 |
+
foreach ($anvanced_enabled as $item){
|
197 |
+
echo $this->__(" %s : true,\n",$item );
|
198 |
+
}
|
199 |
+
?>
|
200 |
+
style: {
|
201 |
+
submissionForm: {
|
202 |
+
colourTop: '<?php echo $_style_submissionform_colourtop ?>', //Default #4F5F6F
|
203 |
+
colourButton: '<?php echo $_style_submissionform_colourbutton ?>', //Default #5DADE2
|
204 |
+
font: '<?php echo $_style_submissionform_font ?>'//Default "Open Sans"
|
205 |
+
},
|
206 |
+
taggingTitle: {
|
207 |
+
font: {
|
208 |
+
family: '<?php echo $_style_taggingtitle_font_family ?>',
|
209 |
+
style: '<?php echo $_style_taggingtitle_font_style ?>',
|
210 |
+
weight: '<?php echo $_style_taggingtitle_font_weight ?>',
|
211 |
+
color: '<?php echo $_style_taggingtitle_font_color ?>',
|
212 |
+
size: '<?php echo $_style_taggingtitle_font_size ?>'
|
213 |
+
}
|
214 |
+
},
|
215 |
+
thumbnail: {
|
216 |
+
bg: {
|
217 |
+
color: '<?php echo $_style_thumbnail_bg_color ?>'
|
218 |
+
},
|
219 |
+
border: {
|
220 |
+
color: '<?php echo $_style_thumbnail_border_color ?>'
|
221 |
+
}
|
222 |
+
},
|
223 |
+
carousel: {
|
224 |
+
bg: {
|
225 |
+
color: '<?php echo $_style_carousel_bg_color ?>'
|
226 |
+
}
|
227 |
+
},
|
228 |
+
popup: {
|
229 |
+
bg: {
|
230 |
+
color: '<?php echo $_style_popup_bg_color ?>'
|
231 |
+
},
|
232 |
+
title: {
|
233 |
+
font: {
|
234 |
+
family: '<?php echo $_style_popup_title_font_family ?>',
|
235 |
+
style: '<?php echo $_style_popup_title_font_style ?>',
|
236 |
+
weight: '<?php echo $_style_popup_title_font_weight ?>',
|
237 |
+
color: '<?php echo $_style_popup_title_font_color ?>'
|
238 |
+
}
|
239 |
+
},
|
240 |
+
source: {
|
241 |
+
font: {
|
242 |
+
family: '<?php echo $_style_source_font_family ?>',
|
243 |
+
style: '<?php echo $_style_source_font_style ?>',
|
244 |
+
weight: '<?php echo $_style_source_font_weight ?>',
|
245 |
+
color: '<?php echo $_style_source_font_color ?>'
|
246 |
+
}
|
247 |
+
},
|
248 |
+
product_caption_shop: {
|
249 |
+
font: {
|
250 |
+
family: '<?php echo $_style_productcaptionshop_font_family ?>',
|
251 |
+
style: '<?php echo $_style_productcaptionshop_font_style ?>',
|
252 |
+
weight: '<?php echo $_style_productcaptionshop_font_weight ?>',
|
253 |
+
color: '<?php echo $_style_productcaptionshop_font_color ?>'
|
254 |
+
}
|
255 |
+
},
|
256 |
+
product_description: {
|
257 |
+
font: {
|
258 |
+
family: '<?php echo $_style_productdescription_font_family ?>',
|
259 |
+
style: '<?php echo $_style_productdescription_font_style ?>',
|
260 |
+
weight: '<?php echo $_style_productdescription_font_weight ?>',
|
261 |
+
color: '<?php echo $_style_productdescription_font_color ?>'
|
262 |
+
}
|
263 |
+
}
|
264 |
+
}
|
265 |
+
},
|
266 |
+
<?php echo $_additional_params ?>
|
267 |
+
};
|
268 |
+
var script = document.createElement('script');
|
269 |
+
script.async = true;
|
270 |
+
script.src = '//www.photoslurp.com/static/widget/v1/widget_loader.js';
|
271 |
+
var entry = document.getElementsByTagName('script')[0];
|
272 |
+
entry.parentNode.insertBefore(script, entry);
|
273 |
+
})();
|
274 |
+
|
275 |
+
</script>
|
276 |
+
<a href="//hi.photoslurp.com/partners/<?php echo $_widget->getUserName(); ?>?utm_source=referral&utm_medium=powered-by-photoslurp" target="_blank" class="ps-poweredby-link" title="Powered by Photoslurp">
|
277 |
+
<div class="ps-logo-widget-carousel"></div>
|
278 |
+
</a>
|
279 |
+
</div>
|
280 |
+
|
281 |
+
<?php endif; ?>
|
app/etc/modules/{Photoslurp_PhotoslurpWidget.xml → Photoslurp_PsWidget.xml}
RENAMED
@@ -1,10 +1,10 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
<modules>
|
4 |
-
<
|
5 |
<active>true</active>
|
6 |
<codePool>community</codePool>
|
7 |
-
<version>
|
8 |
-
</
|
9 |
</modules>
|
10 |
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
<modules>
|
4 |
+
<Photoslurp_PsWidget>
|
5 |
<active>true</active>
|
6 |
<codePool>community</codePool>
|
7 |
+
<version>1.0.0</version>
|
8 |
+
</Photoslurp_PsWidget>
|
9 |
</modules>
|
10 |
</config>
|
js/photoslurp/admin.js
CHANGED
@@ -1,33 +1,110 @@
|
|
1 |
-
document.observe('dom:loaded', function() {
|
2 |
-
|
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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
document.observe('dom:loaded', function() {
|
2 |
+
|
3 |
+
Event.observe($('widget_type'),'change', function(){
|
4 |
+
var widget_type = this.getValue();
|
5 |
+
switchFields(widget_type);
|
6 |
+
switchAutoscrollLimit(widget_type);
|
7 |
+
switchEmptyThreshold(widget_type)
|
8 |
+
});
|
9 |
+
|
10 |
+
Event.observe($('allow_empty'),'change', function(){
|
11 |
+
switchAddPhotosImage(this.getValue());
|
12 |
+
});
|
13 |
+
|
14 |
+
Event.observe($('show_submit'),'change', function(){
|
15 |
+
switchSubmitText(this.getValue());
|
16 |
+
});
|
17 |
+
|
18 |
+
Event.observe($('page_type'),'change', function(){
|
19 |
+
switchPosition(this.getValue());
|
20 |
+
});
|
21 |
+
|
22 |
+
function switchSubmitText (show_submit){
|
23 |
+
if (show_submit == 1) {
|
24 |
+
$$('.submit_text').each(function(el) {
|
25 |
+
el.up('tr').show();
|
26 |
+
})
|
27 |
+
}
|
28 |
+
else if (show_submit == 0) {
|
29 |
+
$$('.submit_text').each(function(el) {
|
30 |
+
el.up('tr').hide();
|
31 |
+
})
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
function switchAddPhotosImage (allow_empty){
|
36 |
+
if (allow_empty == 1) {
|
37 |
+
$('add_photos_img').up('tr').show()
|
38 |
+
}
|
39 |
+
else if (allow_empty == 0) {
|
40 |
+
$('add_photos_img').up('tr').hide()
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
function switchFields(val){
|
45 |
+
|
46 |
+
var img_width = $('image_width');
|
47 |
+
var img_height = $('image_height');
|
48 |
+
var varying_thumb_sizes = $('varying_thumb_sizes');
|
49 |
+
var auto_scroll_carousel = $('auto_scroll_carousel');
|
50 |
+
var one_photo_per_line = $('one_photo_per_line');
|
51 |
+
|
52 |
+
if(val == 1){//carousel mode
|
53 |
+
img_width.removeClassName('required-entry');
|
54 |
+
img_width.up('tr').hide();
|
55 |
+
if(!img_height.hasClassName('required-entry')){
|
56 |
+
img_height.addClassName('required-entry');
|
57 |
+
}
|
58 |
+
img_height.up('tr').show();
|
59 |
+
varying_thumb_sizes.up('tr').hide();
|
60 |
+
auto_scroll_carousel.up('tr').show();
|
61 |
+
one_photo_per_line.up('tr').hide();
|
62 |
+
}else{
|
63 |
+
if(!img_width.hasClassName('required-entry')){
|
64 |
+
img_width.addClassName('required-entry');
|
65 |
+
}
|
66 |
+
img_width.up('tr').show();
|
67 |
+
img_height.removeClassName('required-entry');
|
68 |
+
img_height.up('tr').hide();
|
69 |
+
varying_thumb_sizes.up('tr').show();
|
70 |
+
auto_scroll_carousel.up('tr').hide();
|
71 |
+
one_photo_per_line.up('tr').show();
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
function switchPosition(val){
|
76 |
+
if(val == 2){
|
77 |
+
$('position').up('tr').show()
|
78 |
+
}else{
|
79 |
+
$('position').up('tr').hide()
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
function switchAutoscrollLimit (widget_type){
|
84 |
+
if (widget_type == 2) {//type gallery
|
85 |
+
$('autoscroll_limit').up('tr').show()
|
86 |
+
}
|
87 |
+
else {
|
88 |
+
$('autoscroll_limit').up('tr').hide()
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
function switchEmptyThreshold (widget_type){
|
93 |
+
var empty_threshold_el = $('empty_threshold');
|
94 |
+
if (widget_type == 1) {//type gallery
|
95 |
+
empty_threshold_el.up('tr').show()
|
96 |
+
}
|
97 |
+
else {
|
98 |
+
empty_threshold_el.setValue(0);
|
99 |
+
empty_threshold_el.up('tr').hide()
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
switchFields($('widget_type').getValue());
|
104 |
+
switchAddPhotosImage($('allow_empty').getValue());
|
105 |
+
switchSubmitText($('show_submit').getValue());
|
106 |
+
switchPosition($('page_type').getValue());
|
107 |
+
switchAutoscrollLimit ($('widget_type').getValue());
|
108 |
+
switchEmptyThreshold ($('widget_type').getValue())
|
109 |
+
|
110 |
+
});
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>photoslurp_for_magento</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL-v3</license>
|
7 |
<channel>community</channel>
|
@@ -25,9 +25,9 @@ Learn more about Photoslurp’s visual commerce and marketing platform at w
|
|
25 |
</description>
|
26 |
<notes>First stable release</notes>
|
27 |
<authors><author><name>Ben Heinkel</name><user>benheinkel</user><email>ben@photoslurp.com</email></author></authors>
|
28 |
-
<date>
|
29 |
-
<time>14:
|
30 |
-
<contents><target name="magecommunity"><dir name="Photoslurp"><dir name="
|
31 |
<compatible/>
|
32 |
<dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
|
33 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>photoslurp_for_magento</name>
|
4 |
+
<version>1.0.23</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL-v3</license>
|
7 |
<channel>community</channel>
|
25 |
</description>
|
26 |
<notes>First stable release</notes>
|
27 |
<authors><author><name>Ben Heinkel</name><user>benheinkel</user><email>ben@photoslurp.com</email></author></authors>
|
28 |
+
<date>2017-01-19</date>
|
29 |
+
<time>14:02:42</time>
|
30 |
+
<contents><target name="magecommunity"><dir name="Photoslurp"><dir name="PsWidget"><dir name="Block"><dir name="Adminhtml"><file name="PsWidgetbackend.php" hash="b0b408f4f1073b2aed8f39df3c0d9d7c"/><dir name="Pswidget"><dir name="Edit"><file name="Form.php" hash="07056712bfb2df959976073610745765"/><dir name="Tab"><file name="Form.php" hash="d1dbf85eade093e7c455566e3a0d0f4e"/><file name="Form1.php" hash="50898da40c8a990d8a5e619d6045f220"/><file name="Form2.php" hash="1e92b67f6378787f5e0065fa59596cae"/><file name="Form3.php" hash="ba1321996a4fa9934f9ced2fd898dfd3"/></dir><file name="Tabs.php" hash="5dbfd05fa55c50acbe54834c26dc97b1"/></dir><file name="Edit.php" hash="b333a1cf1ca6aaac74df4ef91cd51e75"/><file name="Grid.php" hash="a6776b5283ac806f3f520307b49886ee"/></dir><file name="Pswidget.php" hash="ae5c762b95a3620c863014ead2c51fa9"/></dir><file name="Widget.php" hash="cdb9316fb49a3b386dd8653ae9bab10d"/></dir><dir name="Helper"><file name="Data.php" hash="17803c49800b8107cfe0c9dde2dad7c8"/></dir><dir name="Model"><file name="Cron.php" hash="2577cc07c29db7f277b0c6dcdde3371c"/><dir name="Mysql4"><dir name="Pswidget"><file name="Collection.php" hash="ee7e2a99a9e6c38ff163878514cac4b4"/></dir><file name="Pswidget.php" hash="547b6cc9aa1172d7671c0978cc48af0d"/><dir name="Pswidgetlang"><file name="Collection.php" hash="4570b57b1392c018f3bb22747eddd026"/></dir><file name="Pswidgetlang.php" hash="d1569f8430700adbc5489a4770d81672"/></dir><file name="Pswidget.php" hash="c963bd2ffa02f7e97894e3cadc974ad5"/><file name="Pswidgetlang.php" hash="9a40bda5f3695b8725283d3095558c2e"/><dir name="Source"><file name="Export.php" hash="203d9c552e3a0e8b829d13ca83b44fa6"/><file name="Store.php" hash="1f20d8f385d0fabaca4b3af5cd3924c6"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Pswidget"><file name="PswidgetController.php" hash="a6f14840227c6cd739edf36a2e4867bc"/><file name="PswidgetbackendController.php" hash="db19f4de2bba7974148df71f9461c031"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="edcf078f0341d62edb7513350fd0c9a7"/><file name="config.xml" hash="ae4e404b25efe5e1429b6805df329e22"/><file name="system.xml" hash="303d0134618b143e81ed8daa7171e911"/></dir><dir name="sql"><dir name="pswidget_setup"><file name="mysql4-install-1.0.0.php" hash="0a7842e9b9d63ca47b69e4fb838216f9"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="58a54f4673f2d3adaa99d257c5a12123"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="4f8d333b80208a1d2274b212d571ef13"/><file name="mysql4-upgrade-1.0.10-1.0.11.php" hash="27a8126cd27372a57d37342e9baff14e"/><file name="mysql4-upgrade-1.0.17-1.0.18.php" hash="adbb0ea0357d1a55d8004d18bf6b34d4"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="26da4479c7dd5c7438bb6493ed13bbc9"/><file name="mysql4-upgrade-1.0.21-1.0.22.php" hash="4eb1a7b1657bc66aeeaa447639582993"/><file name="mysql4-upgrade-1.0.4-1.0.5.php" hash="974aeac2421feaf1875eff5202c01f71"/><file name="mysql4-upgrade-1.0.5-1.0.6.php" hash="76e05edf7eef2702df21ad463983d129"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="f41bf19ff684ba4cefbba479022d82cc"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="80469dfc31ac50b80c82264e3a5b21e8"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pswidget.xml" hash="fcbd9b296b1a153c1cdbdc39cb79eeec"/></dir><dir name="template"><dir name="pswidget"><file name="pswidgetbackend.phtml" hash="384a53871152aa8495f83f940ecac9f7"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pswidget.xml" hash="fb35c29a3fa177282a438f53ad8c377d"/></dir><dir name="template"><dir name="pswidget"><file name="style.phtml" hash="7fbdab2088119db02ebaa0d36d526b14"/><file name="tracking.phtml" hash="db0b2a3e0c7ce48dd0a348e1672e0559"/><file name="widget.phtml" hash="0c4384472c014b68380392b4e06b674f"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Photoslurp_PsWidget.xml" hash="d7596ef6fa89cd0424cdb8cae80a2910"/></dir></target><target name="mageweb"><dir name="js"><dir name="photoslurp"><file name="admin.js" hash="e5393ce77d92949e048dbfe9d1157328"/></dir></dir></target></contents>
|
31 |
<compatible/>
|
32 |
<dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
|
33 |
</package>
|