Version Notes
- compatible with magento 1.9;
- compatible with responsive design;
- compatible with jQuery 1.10 and later;
- minor bugs fixed;
Download this release
Release Info
Developer | Alexander |
Extension | Altima_lookbook_free |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.1
- app/code/local/Altima/Lookbook/Block/Adminhtml/Lookbook/Edit/Form/Element/Hotspots.php +1 -1
- app/code/local/Altima/Lookbook/Block/Adminhtml/Lookbook/Edit/Form/Element/Lookbookimage.php +1 -1
- app/code/local/Altima/Lookbook/Block/Adminhtml/System/Config/Template/Renderer/Category.php +1 -1
- app/code/local/Altima/Lookbook/Helper/Data.php +33 -38
- app/code/local/Altima/Lookbook/controllers/Adminhtml/Lookbook/LookbookController.php +256 -0
- app/code/local/Altima/Lookbook/etc/config.xml +27 -27
- app/code/local/Altima/Lookbook/sql/lookbook_setup/mysql4-upgrade-1.0.3-1.1.0.php +29 -0
- app/code/local/Altima/Lookbook/sql/lookbook_setup/mysql4-upgrade-1.1.0-1.1.1.php +29 -0
- app/design/adminhtml/default/default/layout/lookbook.xml +4 -4
- app/etc/modules/Altima_Lookbook.xml +1 -1
- package.xml +4 -4
app/code/local/Altima/Lookbook/Block/Adminhtml/Lookbook/Edit/Form/Element/Hotspots.php
CHANGED
@@ -76,7 +76,7 @@ class Altima_Lookbook_Block_Adminhtml_Lookbook_Edit_Form_Element_Hotspots extend
|
|
76 |
function checkSKU(){
|
77 |
result = "";
|
78 |
request = new Ajax.Request(
|
79 |
-
"'. Mage::getUrl("
|
80 |
{
|
81 |
method: \'post\',
|
82 |
asynchronous: false,
|
76 |
function checkSKU(){
|
77 |
result = "";
|
78 |
request = new Ajax.Request(
|
79 |
+
"'. Mage::getUrl("adminhtml/lookbook_lookbook/getproduct", array('_secure'=>true)).'",
|
80 |
{
|
81 |
method: \'post\',
|
82 |
asynchronous: false,
|
app/code/local/Altima/Lookbook/Block/Adminhtml/Lookbook/Edit/Form/Element/Lookbookimage.php
CHANGED
@@ -30,7 +30,7 @@ class Altima_Lookbook_Block_Adminhtml_Lookbook_Edit_Form_Element_Lookbookimage e
|
|
30 |
public function getElementHtml()
|
31 |
{
|
32 |
$block_class = Mage::getBlockSingleton('lookbook/adminhtml_lookbook');
|
33 |
-
$upload_action = Mage::getUrl('
|
34 |
$media_url = Mage::getBaseUrl('media');
|
35 |
$upload_folder_path = str_replace("/",DS, Mage::getBaseDir("media").DS);
|
36 |
$helper = Mage::helper('lookbook');
|
30 |
public function getElementHtml()
|
31 |
{
|
32 |
$block_class = Mage::getBlockSingleton('lookbook/adminhtml_lookbook');
|
33 |
+
$upload_action = Mage::getUrl('adminhtml/lookbook_lookbook/upload', array('_secure'=>true)).'?isAjax=true';
|
34 |
$media_url = Mage::getBaseUrl('media');
|
35 |
$upload_folder_path = str_replace("/",DS, Mage::getBaseDir("media").DS);
|
36 |
$helper = Mage::helper('lookbook');
|
app/code/local/Altima/Lookbook/Block/Adminhtml/System/Config/Template/Renderer/Category.php
CHANGED
@@ -158,7 +158,7 @@ class Altima_Lookbook_Block_Adminhtml_System_Config_Template_Renderer_Category
|
|
158 |
|
159 |
public function getLoadTreeUrl($expanded=null)
|
160 |
{
|
161 |
-
return $this->getUrl('
|
162 |
}
|
163 |
|
164 |
/**
|
158 |
|
159 |
public function getLoadTreeUrl($expanded=null)
|
160 |
{
|
161 |
+
return $this->getUrl('adminhtml/lookbook_lookbook/categoriesJson', array('_current'=>true));
|
162 |
}
|
163 |
|
164 |
/**
|
app/code/local/Altima/Lookbook/Helper/Data.php
CHANGED
@@ -93,37 +93,37 @@ class Altima_Lookbook_Helper_Data extends Mage_Core_Helper_Abstract
|
|
93 |
*By doing this new image will be created in Root/media/lookbook/101X65/example.jpg
|
94 |
*/
|
95 |
|
96 |
-
public function getResizedUrl($imgUrl
|
|
|
|
|
|
|
97 |
|
98 |
-
$imgPath=$this->splitImageValue($imgUrl,"path");
|
99 |
-
$imgName=$this->splitImageValue($imgUrl,"name");
|
100 |
-
|
101 |
/**
|
102 |
* Path with Directory Seperator
|
103 |
*/
|
104 |
-
$imgPath=str_replace("/",DS
|
105 |
-
|
106 |
/**
|
107 |
* Absolute full path of Image
|
108 |
*/
|
109 |
-
$imgPathFull=Mage::getBaseDir("media").DS
|
110 |
-
|
111 |
/**
|
112 |
* If Y is not set set it to as X
|
113 |
*/
|
114 |
-
$width
|
115 |
-
$y
|
116 |
-
|
117 |
/**
|
118 |
* Resize folder is widthXheight
|
119 |
*/
|
120 |
-
$resizeFolder
|
121 |
-
|
122 |
/**
|
123 |
* Image resized path will then be
|
124 |
*/
|
125 |
-
$imageResizedPath=Mage::getBaseDir("media").DS
|
126 |
-
|
127 |
/**
|
128 |
* First check in cache i.e image resized path
|
129 |
* If not in cache then create image of the width=X and height = Y
|
@@ -133,41 +133,36 @@ class Altima_Lookbook_Helper_Data extends Mage_Core_Helper_Abstract
|
|
133 |
$imageObj->constrainOnly(FALSE);
|
134 |
$imageObj->keepAspectRatio(TRUE);
|
135 |
$imageObj->keepTransparency(TRUE);
|
136 |
-
/***********************************/
|
137 |
-
//$imageObj->resize($width,$height);
|
138 |
$imageObj->keepFrame(FALSE);
|
139 |
-
if (($width / $height) > ($imageObj->getOriginalWidth() / $imageObj->getOriginalHeight())){
|
140 |
-
|
141 |
-
}else{
|
142 |
-
|
143 |
-
}
|
144 |
$cropX = 0;
|
145 |
$cropY = 0;
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
$imageObj->crop($cropY,$cropX,$cropX,$cropY);
|
156 |
-
/********************/
|
157 |
$imageObj->save($imageResizedPath);
|
158 |
endif;
|
159 |
-
|
160 |
/**
|
161 |
* Else image is in cache replace the Image Path with / for http path.
|
162 |
*/
|
163 |
-
$imgUrl=str_replace(DS,"/"
|
164 |
-
|
165 |
/**
|
166 |
* Return full http path of the image
|
167 |
*/
|
168 |
-
return Mage::getBaseUrl("media")
|
169 |
}
|
170 |
-
|
171 |
/**
|
172 |
* Splits images Path and Name
|
173 |
*
|
93 |
*By doing this new image will be created in Root/media/lookbook/101X65/example.jpg
|
94 |
*/
|
95 |
|
96 |
+
public function getResizedUrl($imgUrl, $x, $y = NULL) {
|
97 |
+
|
98 |
+
$imgPath = $this->splitImageValue($imgUrl, "path");
|
99 |
+
$imgName = $this->splitImageValue($imgUrl, "name");
|
100 |
|
|
|
|
|
|
|
101 |
/**
|
102 |
* Path with Directory Seperator
|
103 |
*/
|
104 |
+
$imgPath = str_replace("/", DS, $imgPath);
|
105 |
+
|
106 |
/**
|
107 |
* Absolute full path of Image
|
108 |
*/
|
109 |
+
$imgPathFull = Mage::getBaseDir("media") . DS . $imgPath . DS . $imgName;
|
110 |
+
|
111 |
/**
|
112 |
* If Y is not set set it to as X
|
113 |
*/
|
114 |
+
$width = $x;
|
115 |
+
$y ? $height = $y : $height = $x;
|
116 |
+
|
117 |
/**
|
118 |
* Resize folder is widthXheight
|
119 |
*/
|
120 |
+
$resizeFolder = $width . "X" . $height;
|
121 |
+
|
122 |
/**
|
123 |
* Image resized path will then be
|
124 |
*/
|
125 |
+
$imageResizedPath = Mage::getBaseDir("media") . DS . $imgPath . DS . $resizeFolder . DS . $imgName;
|
126 |
+
|
127 |
/**
|
128 |
* First check in cache i.e image resized path
|
129 |
* If not in cache then create image of the width=X and height = Y
|
133 |
$imageObj->constrainOnly(FALSE);
|
134 |
$imageObj->keepAspectRatio(TRUE);
|
135 |
$imageObj->keepTransparency(TRUE);
|
|
|
|
|
136 |
$imageObj->keepFrame(FALSE);
|
137 |
+
if (($width / $height) > ($imageObj->getOriginalWidth() / $imageObj->getOriginalHeight())) {
|
138 |
+
$imageObj->resize($width, null);
|
139 |
+
} else {
|
140 |
+
$imageObj->resize(null, $height);
|
141 |
+
}
|
142 |
$cropX = 0;
|
143 |
$cropY = 0;
|
144 |
+
if ($imageObj->getOriginalWidth() > $width) {
|
145 |
+
$cropX = intval(($imageObj->getOriginalWidth() - $width) / 2);
|
146 |
+
}
|
147 |
+
if ($imageObj->getOriginalHeight() > $height) {
|
148 |
+
$cropY = intval(($imageObj->getOriginalHeight() - $height) / 2);
|
149 |
+
}
|
150 |
+
|
151 |
+
$imageObj->crop($cropY, $cropX, $cropX, $cropY);
|
|
|
|
|
|
|
152 |
$imageObj->save($imageResizedPath);
|
153 |
endif;
|
154 |
+
|
155 |
/**
|
156 |
* Else image is in cache replace the Image Path with / for http path.
|
157 |
*/
|
158 |
+
$imgUrl = str_replace(DS, "/", $imgPath);
|
159 |
+
|
160 |
/**
|
161 |
* Return full http path of the image
|
162 |
*/
|
163 |
+
return Mage::getBaseUrl("media") . $imgUrl . "/" . $resizeFolder . "/" . $imgName;
|
164 |
}
|
165 |
+
|
166 |
/**
|
167 |
* Splits images Path and Name
|
168 |
*
|
app/code/local/Altima/Lookbook/controllers/Adminhtml/Lookbook/LookbookController.php
ADDED
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Altima Lookbook Free Extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Altima
|
16 |
+
* @package Altima_LookbookFree
|
17 |
+
* @author Altima Web Systems http://altimawebsystems.com/
|
18 |
+
* @email support@altima.net.au
|
19 |
+
* @copyright Copyright (c) 2012 Altima Web Systems (http://altimawebsystems.com/)
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
class Altima_Lookbook_Adminhtml_Lookbook_LookbookController extends Mage_Adminhtml_Controller_Action
|
23 |
+
{
|
24 |
+
|
25 |
+
protected function _initAction() {
|
26 |
+
$this->loadLayout()
|
27 |
+
->_setActiveMenu('cms')
|
28 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Lookbook slides manager'), Mage::helper('adminhtml')->__('Lookbook slides manager'));
|
29 |
+
|
30 |
+
return $this;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function indexAction() {
|
34 |
+
$this->_initAction()
|
35 |
+
->renderLayout();
|
36 |
+
}
|
37 |
+
|
38 |
+
public function editAction() {
|
39 |
+
$slides_count = Mage::getModel('lookbook/lookbook')->getCollection()
|
40 |
+
->getSize();
|
41 |
+
$id = $this->getRequest()->getParam('id');
|
42 |
+
if ($slides_count<5 || $id) {
|
43 |
+
|
44 |
+
$model = Mage::getModel('lookbook/lookbook')->load($id);
|
45 |
+
|
46 |
+
if ($model->getId() || $id == 0) {
|
47 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
48 |
+
if (!empty($data)) {
|
49 |
+
$model->setData($data);
|
50 |
+
}
|
51 |
+
|
52 |
+
Mage::register('lookbook_data', $model);
|
53 |
+
|
54 |
+
$this->loadLayout();
|
55 |
+
$this->_setActiveMenu('cms');
|
56 |
+
|
57 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Lookbook slides manager'), Mage::helper('adminhtml')->__('Lookbook slides manager'));
|
58 |
+
|
59 |
+
$this->_addContent($this->getLayout()->createBlock('lookbook/adminhtml_lookbook_edit'))
|
60 |
+
->_addLeft($this->getLayout()->createBlock('lookbook/adminhtml_lookbook_edit_tabs'));
|
61 |
+
|
62 |
+
$this->renderLayout();
|
63 |
+
} else {
|
64 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('lookbook')->__('Slide does not exist'));
|
65 |
+
$this->_redirect('*/*/');
|
66 |
+
}
|
67 |
+
}
|
68 |
+
else
|
69 |
+
{
|
70 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('lookbook')->__('Only up to 5 slides could be uploaded in Free Lookbook extension.'));
|
71 |
+
$this->_redirect('*/*/');
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
public function newAction() {
|
76 |
+
$this->_forward('edit');
|
77 |
+
}
|
78 |
+
|
79 |
+
public function saveAction() {
|
80 |
+
if ($data = $this->getRequest()->getPost()) {
|
81 |
+
|
82 |
+
$model = Mage::getModel('lookbook/lookbook');
|
83 |
+
$model->setData($data)
|
84 |
+
->setId($this->getRequest()->getParam('id'));
|
85 |
+
|
86 |
+
try {
|
87 |
+
|
88 |
+
if ($model->getId() && isset($data['identifier_create_redirect']))
|
89 |
+
{
|
90 |
+
$model->setData('save_rewrites_history', (bool)$data['identifier_create_redirect']);
|
91 |
+
}
|
92 |
+
|
93 |
+
$model->save();
|
94 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('lookbook')->__('Lookbook slide was successfully saved'));
|
95 |
+
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
96 |
+
|
97 |
+
if ($this->getRequest()->getParam('back')) {
|
98 |
+
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
99 |
+
return;
|
100 |
+
}
|
101 |
+
$this->_redirect('*/*/');
|
102 |
+
return;
|
103 |
+
} catch (Exception $e) {
|
104 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
105 |
+
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
106 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
107 |
+
return;
|
108 |
+
}
|
109 |
+
}
|
110 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('lookbook')->__('Unable to find lookbook slide to save'));
|
111 |
+
$this->_redirect('*/*/');
|
112 |
+
}
|
113 |
+
|
114 |
+
public function deleteAction() {
|
115 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
116 |
+
try {
|
117 |
+
$model = Mage::getModel('lookbook/lookbook');
|
118 |
+
|
119 |
+
$model->setId($this->getRequest()->getParam('id'))
|
120 |
+
->delete();
|
121 |
+
|
122 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Lookbook slide was successfully deleted'));
|
123 |
+
$this->_redirect('*/*/');
|
124 |
+
} catch (Exception $e) {
|
125 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
126 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
127 |
+
}
|
128 |
+
}
|
129 |
+
$this->_redirect('*/*/');
|
130 |
+
}
|
131 |
+
|
132 |
+
public function uploadAction()
|
133 |
+
{
|
134 |
+
|
135 |
+
$upload_dir = Mage::getBaseDir('media').'/lookbook/';
|
136 |
+
if (!file_exists($upload_dir)) mkdir($upload_dir, 0755, true);
|
137 |
+
|
138 |
+
$uploader = Mage::getModel('lookbook/fileuploader');
|
139 |
+
|
140 |
+
$config_check = $uploader->checkServerSettings();
|
141 |
+
|
142 |
+
if ($config_check === true){
|
143 |
+
$result = $uploader->handleUpload($upload_dir);
|
144 |
+
}
|
145 |
+
else
|
146 |
+
{
|
147 |
+
$result = $config_check;
|
148 |
+
}
|
149 |
+
|
150 |
+
// to pass data through iframe you will need to encode all html tags
|
151 |
+
$this->getResponse()->setBody(htmlspecialchars(json_encode($result), ENT_NOQUOTES));
|
152 |
+
}
|
153 |
+
|
154 |
+
|
155 |
+
public function getproductAction(){
|
156 |
+
$sku = $this->getRequest()->getParam('text');
|
157 |
+
$product_id = Mage::getModel('catalog/product')->getIdBySku($sku);
|
158 |
+
$status = Mage::getModel('catalog/product')->load($product_id)->getStatus();
|
159 |
+
if ($product_id) {
|
160 |
+
if ($status==1)
|
161 |
+
{
|
162 |
+
$result= 1;
|
163 |
+
}
|
164 |
+
else
|
165 |
+
{
|
166 |
+
$result = "is disabled";
|
167 |
+
}
|
168 |
+
|
169 |
+
}
|
170 |
+
else
|
171 |
+
{
|
172 |
+
$result = "doesn't exists";
|
173 |
+
}
|
174 |
+
$this->getResponse()->setBody($result);
|
175 |
+
}
|
176 |
+
|
177 |
+
public function massDeleteAction() {
|
178 |
+
$lookbookIds = $this->getRequest()->getParam('lookbook');
|
179 |
+
if(!is_array($lookbookIds)) {
|
180 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select slide(s)'));
|
181 |
+
} else {
|
182 |
+
try {
|
183 |
+
foreach ($lookbookIds as $lookbookId) {
|
184 |
+
$lookbook = Mage::getModel('lookbook/lookbook')->load($lookbookId);
|
185 |
+
$lookbook->delete();
|
186 |
+
}
|
187 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
188 |
+
Mage::helper('adminhtml')->__(
|
189 |
+
'Total of %d record(s) were successfully deleted', count($lookbookIds)
|
190 |
+
)
|
191 |
+
);
|
192 |
+
} catch (Exception $e) {
|
193 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
194 |
+
}
|
195 |
+
}
|
196 |
+
$this->_redirect('*/*/index');
|
197 |
+
}
|
198 |
+
|
199 |
+
public function massStatusAction()
|
200 |
+
{
|
201 |
+
$lookbookIds = $this->getRequest()->getParam('lookbook');
|
202 |
+
if(!is_array($lookbookIds)) {
|
203 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select slide(s)'));
|
204 |
+
} else {
|
205 |
+
try {
|
206 |
+
foreach ($lookbookIds as $lookbookId) {
|
207 |
+
$lookbook = Mage::getSingleton('lookbook/lookbook')
|
208 |
+
->load($lookbookId)
|
209 |
+
->setStatus($this->getRequest()->getParam('status'))
|
210 |
+
->setIsMassupdate(true)
|
211 |
+
->save();
|
212 |
+
}
|
213 |
+
$this->_getSession()->addSuccess(
|
214 |
+
$this->__('Total of %d record(s) were successfully updated', count($lookbookIds))
|
215 |
+
);
|
216 |
+
} catch (Exception $e) {
|
217 |
+
$this->_getSession()->addError($e->getMessage());
|
218 |
+
}
|
219 |
+
}
|
220 |
+
$this->_redirect('*/*/index');
|
221 |
+
}
|
222 |
+
|
223 |
+
public function exportCsvAction()
|
224 |
+
{
|
225 |
+
$fileName = 'lookbook.csv';
|
226 |
+
$content = $this->getLayout()->createBlock('lookbook/adminhtml_lookbook_grid')
|
227 |
+
->getCsv();
|
228 |
+
|
229 |
+
$this->_sendUploadResponse($fileName, $content);
|
230 |
+
}
|
231 |
+
|
232 |
+
public function exportXmlAction()
|
233 |
+
{
|
234 |
+
$fileName = 'lookbook.xml';
|
235 |
+
$content = $this->getLayout()->createBlock('lookbook/adminhtml_lookbook_grid')
|
236 |
+
->getXml();
|
237 |
+
|
238 |
+
$this->_sendUploadResponse($fileName, $content);
|
239 |
+
}
|
240 |
+
|
241 |
+
protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
|
242 |
+
{
|
243 |
+
$response = $this->getResponse();
|
244 |
+
$response->setHeader('HTTP/1.1 200 OK','');
|
245 |
+
$response->setHeader('Pragma', 'public', true);
|
246 |
+
$response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
|
247 |
+
$response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
|
248 |
+
$response->setHeader('Last-Modified', date('r'));
|
249 |
+
$response->setHeader('Accept-Ranges', 'bytes');
|
250 |
+
$response->setHeader('Content-Length', strlen($content));
|
251 |
+
$response->setHeader('Content-type', $contentType);
|
252 |
+
$response->setBody($content);
|
253 |
+
$response->sendResponse();
|
254 |
+
die;
|
255 |
+
}
|
256 |
+
}
|
app/code/local/Altima/Lookbook/etc/config.xml
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
<config>
|
25 |
<modules>
|
26 |
<Altima_Lookbook>
|
27 |
-
<version>1.1.
|
28 |
</Altima_Lookbook>
|
29 |
</modules>
|
30 |
<frontend>
|
@@ -47,13 +47,13 @@
|
|
47 |
</frontend>
|
48 |
<admin>
|
49 |
<routers>
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
</routers>
|
58 |
</admin>
|
59 |
<adminhtml>
|
@@ -62,9 +62,9 @@
|
|
62 |
<children>
|
63 |
<lookbook translate="title" module="lookbook">
|
64 |
<title>LookBook Free</title>
|
65 |
-
|
66 |
</lookbook>
|
67 |
-
|
68 |
</cms>
|
69 |
</menu>
|
70 |
<acl>
|
@@ -93,13 +93,13 @@
|
|
93 |
</admin>
|
94 |
</resources>
|
95 |
</acl>
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
</adminhtml>
|
104 |
<default>
|
105 |
<lookbook>
|
@@ -160,15 +160,15 @@
|
|
160 |
</lookbook>
|
161 |
</helpers>
|
162 |
<events>
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
</global>
|
174 |
</config>
|
24 |
<config>
|
25 |
<modules>
|
26 |
<Altima_Lookbook>
|
27 |
+
<version>1.1.1</version>
|
28 |
</Altima_Lookbook>
|
29 |
</modules>
|
30 |
<frontend>
|
47 |
</frontend>
|
48 |
<admin>
|
49 |
<routers>
|
50 |
+
<adminhtml>
|
51 |
+
<args>
|
52 |
+
<modules>
|
53 |
+
<lookbook before="Mage_Adminhtml">Altima_Lookbook_Adminhtml</lookbook>
|
54 |
+
</modules>
|
55 |
+
</args>
|
56 |
+
</adminhtml>
|
57 |
</routers>
|
58 |
</admin>
|
59 |
<adminhtml>
|
62 |
<children>
|
63 |
<lookbook translate="title" module="lookbook">
|
64 |
<title>LookBook Free</title>
|
65 |
+
<action>adminhtml/lookbook_lookbook</action>
|
66 |
</lookbook>
|
67 |
+
</children>
|
68 |
</cms>
|
69 |
</menu>
|
70 |
<acl>
|
93 |
</admin>
|
94 |
</resources>
|
95 |
</acl>
|
96 |
+
<layout>
|
97 |
+
<updates>
|
98 |
+
<lookbook>
|
99 |
+
<file>lookbook.xml</file>
|
100 |
+
</lookbook>
|
101 |
+
</updates>
|
102 |
+
</layout>
|
103 |
</adminhtml>
|
104 |
<default>
|
105 |
<lookbook>
|
160 |
</lookbook>
|
161 |
</helpers>
|
162 |
<events>
|
163 |
+
<cms_page_render>
|
164 |
+
<observers>
|
165 |
+
<lookbook_layout_generate_observer>
|
166 |
+
<type>singleton</type>
|
167 |
+
<class>lookbook/layout_generate_observer</class>
|
168 |
+
<method>addHeadItems</method>
|
169 |
+
</lookbook_layout_generate_observer>
|
170 |
+
</observers>
|
171 |
+
</cms_page_render>
|
172 |
+
</events>
|
173 |
</global>
|
174 |
</config>
|
app/code/local/Altima/Lookbook/sql/lookbook_setup/mysql4-upgrade-1.0.3-1.1.0.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Altima Lookbook Free Extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Altima
|
16 |
+
* @package Altima_LookbookFree
|
17 |
+
* @author Altima Web Systems http://altimawebsystems.com/
|
18 |
+
* @email support@altima.net.au
|
19 |
+
* @copyright Copyright (c) 2012 Altima Web Systems (http://altimawebsystems.com/)
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
|
24 |
+
$installer = $this;
|
25 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
26 |
+
|
27 |
+
$installer->startSetup();
|
28 |
+
|
29 |
+
$installer->endSetup();
|
app/code/local/Altima/Lookbook/sql/lookbook_setup/mysql4-upgrade-1.1.0-1.1.1.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Altima Lookbook Free Extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Altima
|
16 |
+
* @package Altima_LookbookFree
|
17 |
+
* @author Altima Web Systems http://altimawebsystems.com/
|
18 |
+
* @email support@altima.net.au
|
19 |
+
* @copyright Copyright (c) 2012 Altima Web Systems (http://altimawebsystems.com/)
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
|
24 |
+
$installer = $this;
|
25 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
26 |
+
|
27 |
+
$installer->startSetup();
|
28 |
+
|
29 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/lookbook.xml
CHANGED
@@ -22,12 +22,12 @@
|
|
22 |
*/
|
23 |
-->
|
24 |
<layout version="0.1.0">
|
25 |
-
<
|
26 |
<reference name="content">
|
27 |
<block type="lookbook/adminhtml_lookbook" name="lookbook" />
|
28 |
</reference>
|
29 |
-
</
|
30 |
-
<
|
31 |
<reference name="head">
|
32 |
<action method="addCss"><stylesheet>lookbook/css/annotation.css</stylesheet></action>
|
33 |
<action method="addCss"><stylesheet>lookbook/css/fileuploader.css</stylesheet></action>
|
@@ -38,5 +38,5 @@
|
|
38 |
<action method="addJs"><script>lookbook/fileuploader.js</script></action>
|
39 |
<action method="addJs"><script>lookbook/json2.min.js</script></action>
|
40 |
</reference>
|
41 |
-
</
|
42 |
</layout>
|
22 |
*/
|
23 |
-->
|
24 |
<layout version="0.1.0">
|
25 |
+
<adminhtml_lookbook_lookbook_index>
|
26 |
<reference name="content">
|
27 |
<block type="lookbook/adminhtml_lookbook" name="lookbook" />
|
28 |
</reference>
|
29 |
+
</adminhtml_lookbook_lookbook_index>
|
30 |
+
<adminhtml_lookbook_lookbook_edit>
|
31 |
<reference name="head">
|
32 |
<action method="addCss"><stylesheet>lookbook/css/annotation.css</stylesheet></action>
|
33 |
<action method="addCss"><stylesheet>lookbook/css/fileuploader.css</stylesheet></action>
|
38 |
<action method="addJs"><script>lookbook/fileuploader.js</script></action>
|
39 |
<action method="addJs"><script>lookbook/json2.min.js</script></action>
|
40 |
</reference>
|
41 |
+
</adminhtml_lookbook_lookbook_edit>
|
42 |
</layout>
|
app/etc/modules/Altima_Lookbook.xml
CHANGED
@@ -33,4 +33,4 @@
|
|
33 |
</depends>
|
34 |
</Altima_Lookbook>
|
35 |
</modules>
|
36 |
-
</config>
|
33 |
</depends>
|
34 |
</Altima_Lookbook>
|
35 |
</modules>
|
36 |
+
</config>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Altima_lookbook_free</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
@@ -13,9 +13,9 @@
|
|
13 |
- compatible with jQuery 1.10 and later;
|
14 |
- minor bugs fixed;</notes>
|
15 |
<authors><author><name>Alexander</name><user>altimaweb</user><email>alex@altima.net.au</email></author></authors>
|
16 |
-
<date>
|
17 |
-
<time>
|
18 |
-
<contents><target name="magelocal"><dir name="Altima"><dir name="Lookbook"><dir name="Block"><dir name="Adminhtml"><dir name="Lookbook"><dir name="Edit"><dir name="Form"><dir name="Element"><file name="Hotspots.php" hash="
|
19 |
<compatible/>
|
20 |
<dependencies><required><php><min>5.2.6</min><max>6.0.0</max></php></required></dependencies>
|
21 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Altima_lookbook_free</name>
|
4 |
+
<version>1.1.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
13 |
- compatible with jQuery 1.10 and later;
|
14 |
- minor bugs fixed;</notes>
|
15 |
<authors><author><name>Alexander</name><user>altimaweb</user><email>alex@altima.net.au</email></author></authors>
|
16 |
+
<date>2015-11-04</date>
|
17 |
+
<time>13:16:28</time>
|
18 |
+
<contents><target name="magelocal"><dir name="Altima"><dir name="Lookbook"><dir name="Block"><dir name="Adminhtml"><dir name="Lookbook"><dir name="Edit"><dir name="Form"><dir name="Element"><file name="Hotspots.php" hash="6b3b866ca2983d9afe6aa291fdacc1e0"/><file name="Lookbookimage.php" hash="6a3101ca448d360c2f4b3be9bbf08a17"/></dir></dir><file name="Form.php" hash="75c3d3d346ca75c7e3d3dd2fd7f404c7"/><dir name="Tab"><file name="Form.php" hash="2d813d81668d60e08aa13a4fee036370"/></dir><file name="Tabs.php" hash="3184418447b9cfc17465571388d7bbf1"/></dir><file name="Edit.php" hash="2f033459fdd187211f5b2eff52b6cd8d"/><file name="Grid.php" hash="52947065501de5b26e74600571d8ea4a"/></dir><file name="Lookbook.php" hash="999956cf21484191e84be7e3436f4937"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Categories.php" hash="57b1b69ef9afc7467c0d68c5287f223e"/></dir></dir><dir name="Template"><dir name="Renderer"><file name="Category.php" hash="940435babaf9f5de8e4835527516b04f"/></dir></dir></dir></dir><dir name="Template"><dir name="Grid"><dir name="Renderer"><file name="Image.php" hash="a7c75180119c92af1ab2ece65e7e6c96"/></dir></dir></dir></dir><file name="Lookbook.php" hash="c321657bdc8efa02fb17bc3db9b1d307"/></dir><dir name="Helper"><file name="Data.php" hash="55918e10cf59b330d9850239c16d0e20"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Effect.php" hash="b8557d1df6eac72d2e5972e14356382c"/></dir></dir><file name="Fileuploader.php" hash="f987f0b2170a16ab9a1fa2f2f99ce2a6"/><dir name="Layout"><dir name="Generate"><file name="Observer.php" hash="792f5fc1de12558a544277f547b67a43"/></dir></dir><file name="Lookbook.php" hash="e124750626bb8e455315c9fff49d10b0"/><dir name="Mysql4"><dir name="Lookbook"><file name="Collection.php" hash="a3cdcd4fc2e2d7ee6cb73564752c9f4a"/></dir><file name="Lookbook.php" hash="375f39626cc600f6179d6c7558cc58eb"/></dir><file name="Status.php" hash="8ec99dd61315524a21dbaeb5672530a2"/><file name="Uploadedfileform.php" hash="88fa3bbf7e11ca6628011b2ce16e43a3"/><file name="Uploadedfilexhr.php" hash="e459a403415cc4a70b74fd30db1359d9"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Lookbook"><file name="LookbookController.php" hash="ebe9e83fefbf80131bd46d71da2d21cb"/></dir><file name="LookbookController.php" hash="b7d81c63f3760eb0994b3e650c140846"/></dir><file name="IndexController.php" hash="4189437cd54bcb1e158a0ff7d0ad74da"/></dir><dir name="etc"><file name="config.xml" hash="0acede4497756c8c353b93405e2247c9"/><file name="system.xml" hash="5950567fda5ddd0f1f2201ffc2afe1da"/></dir><dir name="sql"><dir name="lookbook_setup"><file name="mysql4-install-1.0.2.php" hash="6204532de54973756bc209187a72a7bd"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="9cb4e8ce14b6e56dbbfc9b7530a9c4e9"/><file name="mysql4-upgrade-1.0.2-1.1.0.php" hash="9cb4e8ce14b6e56dbbfc9b7530a9c4e9"/><file name="mysql4-upgrade-1.0.3-1.1.0.php" hash="9cb4e8ce14b6e56dbbfc9b7530a9c4e9"/><file name="mysql4-upgrade-1.1.0-1.1.1.php" hash="9cb4e8ce14b6e56dbbfc9b7530a9c4e9"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Altima_Lookbook.xml" hash="60835352736220599841b8ae82f38bbe"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="lookbook.xml" hash="187468043a1f2209971e51dd1206eb12"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="lookbook.xml" hash="861adceb1cee60ddfbe1407d87e3e400"/></dir><dir name="template"><dir name="lookbook"><file name="lookbook.phtml" hash="3581c9a13f6b462db619a2e99b8eb9a8"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="lookbook"><dir name="css"><file name="hotspots.css" hash="b23373cc2396f428f5f9ca3211621c13"/></dir><dir name="images"><file name="adv-bg.png" hash="06af9432757479345a304c8d8b8b3939"/><file name="camera-loader.gif" hash="cd2e13291ecdcac7f575beea6d84b099"/><file name="camera_skins.png" hash="44234b21bebe6b318aab47d9e9bbbee9"/><file name="caption-bg.png" hash="b09e2b8f7382607b51b0392ba46f5963"/><file name="info-bg.png" hash="6b2e3b329380a9bf3c298e3a6c34a7fa"/><dir name="patterns"><file name="overlay1.png" hash="1f146c3ca45b7de58990fe35674f3c12"/><file name="overlay10.png" hash="e1eb49ee07e74a2c4fee9dad5f17a513"/><file name="overlay2.png" hash="ddcf42fed3bf5234b7846a74bf17fc6d"/><file name="overlay3.png" hash="d3deed31d1eed4f17432ff93aefd9daf"/><file name="overlay4.png" hash="8df992721519d21ba39626a8615393c4"/><file name="overlay5.png" hash="a839858206fe25a686265e5868a00fbf"/><file name="overlay6.png" hash="de8c31ab33ca41114addad876a7d057b"/><file name="overlay7.png" hash="8475f8c4b675c531f5fca9d0f8266889"/><file name="overlay8.png" hash="a13c787a719e0619ce82ba73bacd9498"/><file name="overlay9.png" hash="06b734ded54bbe1761e3b67acd2575e5"/></dir></dir><dir name="js"><file name="camera.min.js" hash="1b5a08887b085bc5a68aac7dcf506466"/><file name="hotspots.js" hash="03ece85ea477dfc717fea0c181696930"/><file name="jquery-migrate-1.2.1.min.js" hash="eb05d8d73b5b13d8d84308a4751ece96"/><file name="jquery.easing.1.3.js" hash="6516449ed5089677ed3d7e2f11fc8942"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="lookbook"><dir name="css"><file name="annotation.css" hash="a47fa611c7abbe1913145b120b09a260"/><file name="fileuploader.css" hash="8678f7cde252ff89caead1d92511da5f"/></dir><dir name="images"><file name="btn_bg.gif" hash="37c51a4d48a92da9648dcd3ca011039f"/><file name="btn_gray_bg.gif" hash="8be512788b8044fe31aa8d00cc16ba7b"/><file name="btn_over_bg.gif" hash="f91641168454c03d1fa72731ec97a2b3"/><file name="cancel_btn_icon.png" hash="343e0534818e33d4e3886aa4694602d7"/><file name="cross.png" hash="42492684e24356a4081134894eabeb9e"/><file name="delete_btn_icon.png" hash="04485bbcca5d645427061365185b4a76"/><file name="icon_btn_add.png" hash="3a99c7c227e5e6feb656e1649a8264ab"/><file name="link_external.png" hash="7cc8feaca790904979edda0ba930d6cd"/><file name="loading.gif" hash="2da0807814ad64841cd597c4e8a653d1"/><file name="ok_btn_icon.png" hash="bf2b8c5bb1c784e8d907f5d6345f0e5e"/><file name="upload_btn_icon.png" hash="1ede630273613ffe452dede682e5e028"/></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="lookbook"><dir name="icons"><dir name="default"><file name="hotspot-icon.png" hash="fa27397b9eb8b54df13e62a5a1b6c8b8"/></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="lookbook"><file name="fileuploader.js" hash="64cb3de32e4a6cc1710dd08bb0da582a"/><file name="jquery-ui-1.9.1.js" hash="e3afa2a5c2ef212277864dfd43408ce4"/><file name="jquery.annotate.js" hash="8cf07aa72745a50817186870828eca0b"/><file name="jquery.mobile.customized.min.js" hash="ea59fe8222cc61ffdbd41119ce23fd25"/><file name="json2.min.js" hash="041eedd4d7676d33b6ccd2056734e4b3"/></dir><dir name="jquery"><file name="jquery-1.8.2.min.js" hash="0b6ecf17e30037994d3ffee51b525914"/><file name="jquery.noconflict.js" hash="3179f2255b046d5f2e9a71e365287bef"/></dir></dir></target></contents>
|
19 |
<compatible/>
|
20 |
<dependencies><required><php><min>5.2.6</min><max>6.0.0</max></php></required></dependencies>
|
21 |
</package>
|