Version Notes
First stable release
Download this release
Release Info
Developer | ImageRecycle |
Extension | ImageRecycle_image_pdf_optimize |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
- app/code/community/Imagerecycle/Imagerecycle/etc/config.xml +1 -1
- app/design/adminhtml/default/default/layout/imagerecycle_imagerecycle.xml +13 -0
- app/design/adminhtml/default/default/template/imagerecycle/imagerecycle/images.phtml +370 -0
- app/etc/modules/Imagerecycle_ImageRecycle.xml +9 -0
- package.xml +5 -5
app/code/community/Imagerecycle/Imagerecycle/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Imagerecycle_Imagerecycle>
|
5 |
-
<version>1.0.
|
6 |
</Imagerecycle_Imagerecycle>
|
7 |
</modules>
|
8 |
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Imagerecycle_Imagerecycle>
|
5 |
+
<version>1.0.1</version>
|
6 |
</Imagerecycle_Imagerecycle>
|
7 |
</modules>
|
8 |
|
app/design/adminhtml/default/default/layout/imagerecycle_imagerecycle.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout>
|
3 |
+
<imagerecycle_index_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="imagerecycle/images" name="recycleimage" template="imagerecycle/imagerecycle/images.phtml" />
|
6 |
+
</reference>
|
7 |
+
<reference name="head">
|
8 |
+
<action method="addJs"><script>imagerecycle/imagerecycle/jquery.min.js</script></action>
|
9 |
+
<action method="addJs"><script>imagerecycle/imagerecycle/script.js</script></action>
|
10 |
+
<action method="addCss"><name>imagerecycle/imagerecycle/imagerecycle.css</name></action>
|
11 |
+
</reference>
|
12 |
+
</imagerecycle_index_index>
|
13 |
+
</layout>
|
app/design/adminhtml/default/default/template/imagerecycle/imagerecycle/images.phtml
ADDED
@@ -0,0 +1,370 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Images to show
|
4 |
+
$images = $this->getImages();
|
5 |
+
$totalImages = count($images);
|
6 |
+
// Get current url without page param
|
7 |
+
$requestParams = $this->getRequest()->getParams();
|
8 |
+
if( isset($requestParams['page']) ){
|
9 |
+
unset($requestParams['page']);
|
10 |
+
}
|
11 |
+
$order_by = isset($requestParams['order_by'])? $requestParams['order_by']: "" ;
|
12 |
+
if(isset($requestParams['dir']) && $requestParams['dir']=='desc') {
|
13 |
+
$dir = 'desc';
|
14 |
+
$new_dir = 'asc';
|
15 |
+
}else {
|
16 |
+
$dir = 'asc';
|
17 |
+
$new_dir = 'desc';
|
18 |
+
}
|
19 |
+
|
20 |
+
$url = Mage::helper("adminhtml")->getUrl("*/*/index");
|
21 |
+
if($order_by != '') {
|
22 |
+
$sortedUrl = $url . "order_by/".$order_by."/dir/".$dir.'/';
|
23 |
+
}else {
|
24 |
+
$sortedUrl = $url;
|
25 |
+
}
|
26 |
+
|
27 |
+
?>
|
28 |
+
|
29 |
+
<div class="content-header">
|
30 |
+
<div style="float:right; margin-top: 3px; position: relative">
|
31 |
+
<a id="ir-setting" href="javascript:void(0)">Setting<i class="icon-setting"></i></a>
|
32 |
+
<div class="ir-setting hidden">
|
33 |
+
<p style="margin-top: 8px; color: #6565cb; font-weight: bold"><?php echo Mage::helper('imagerecycle')->__('Image recycle setttings') ?></p>
|
34 |
+
<table class="form-table">
|
35 |
+
<tbody>
|
36 |
+
<input id="installed_time" class="formData" name="_mageio_settings[installed_time]" type="hidden" value="<?php echo $this->settings['installed_time'] ; ?>" size="50"/>
|
37 |
+
<input id="mageio_api_api_url" class="formData" name="_mageio_settings[mageio_api_api_url]" type="hidden" value="<?php echo $this->settings['mageio_api_api_url'] ; ?>" size="50"/>
|
38 |
+
<tr>
|
39 |
+
<th scope="row"><?php echo Mage::helper('imagerecycle')->__('API key : ') ?></th>
|
40 |
+
<td colspan="2">
|
41 |
+
<input id="mageio_api_api_key" class="formData" name="_mageio_settings[mageio_api_api_key]" type="text" value="<?php echo $this->escapeHtml($this->settings['mageio_api_api_key']) ; ?>" size="50"/>
|
42 |
+
</td>
|
43 |
+
</tr>
|
44 |
+
<tr>
|
45 |
+
<th scope="row"><?php echo Mage::helper('imagerecycle')->__('API secret : ') ?></th>
|
46 |
+
<td colspan="2">
|
47 |
+
<input id="mageio_api_api_secret" class="formData" name="_mageio_settings[mageio_api_api_secret]" type="text" value="<?php echo $this->escapeHtml($this->settings['mageio_api_api_secret']) ; ?>" size="50"/>
|
48 |
+
</td>
|
49 |
+
</tr>
|
50 |
+
<tr>
|
51 |
+
<th scope="row"><?php echo Mage::helper('imagerecycle')->__('Exclude folders : ') ?></th>
|
52 |
+
<td colspan="2">
|
53 |
+
<?php $exclude_folders = !empty($this->settings['exclude_folders'])? $this->settings['exclude_folders']: "app,var,cache,adminhtml"; ?>
|
54 |
+
<input id="exclude_folders" class="formData" name="_mageio_settings[exclude_folders]" type="text" value="<?php echo $this->escapeHtml($exclude_folders) ; ?>" size="50"/>
|
55 |
+
</td>
|
56 |
+
</tr>
|
57 |
+
<tr>
|
58 |
+
<th scope="row" ><?php echo Mage::helper('imagerecycle')->__('Image resize') ?></th>
|
59 |
+
<td colspan="2">
|
60 |
+
<?php
|
61 |
+
$resize_auto = !is_null($this->settings['resize_auto'])? $this->settings['resize_auto']: 0;
|
62 |
+
?>
|
63 |
+
<select id="resize_auto" name="_mageio_settings[resize_auto]">
|
64 |
+
<option value="0" <?php if($resize_auto==0) { echo 'selected="selected"';}?> >No</option>
|
65 |
+
<option value="1" <?php if($resize_auto==1) { echo 'selected="selected"';}?> >Yes</option>
|
66 |
+
</select>
|
67 |
+
</td>
|
68 |
+
</tr>
|
69 |
+
<tr>
|
70 |
+
<td colspan="3">
|
71 |
+
<?php echo Mage::helper('imagerecycle')->__('<strong>Use with caution!</strong> All new images will size more than setting will be resized automatically on upload') ?>
|
72 |
+
</td>
|
73 |
+
</tr>
|
74 |
+
<tr>
|
75 |
+
<th scope="row" colspan="2"><?php echo Mage::helper('imagerecycle')->__('Image resize, max size (px)') ?></th>
|
76 |
+
<td>
|
77 |
+
<input id="resize_image" class="formData" name="_mageio_settings[resize_image]" type="text" value="<?php echo $this->escapeHtml($this->settings['resize_image']) ; ?>" size="10"/>
|
78 |
+
</td>
|
79 |
+
</tr>
|
80 |
+
<tr>
|
81 |
+
<th scope="row" colspan="2">
|
82 |
+
<?php echo Mage::helper('imagerecycle')->__('Min file size to optimize (Kb)') ?></th>
|
83 |
+
<td>
|
84 |
+
<?php $minSize = !is_null($this->settings['min_size'])?$this->settings['min_size'] : 1; ?>
|
85 |
+
<input id="min_size" class="formData" name="_mageio_settings[min_size]" type="text" value="<?php echo $this->escapeHtml($minSize) ; ?>" size="10"/>
|
86 |
+
</td>
|
87 |
+
</th>
|
88 |
+
</tr>
|
89 |
+
<tr>
|
90 |
+
<th scope="row" colspan="2">
|
91 |
+
<?php echo Mage::helper('imagerecycle')->__('Max file size to optimize (Kb)') ?></th>
|
92 |
+
<td>
|
93 |
+
<input id="max_size" class="formData" name="_mageio_settings[max_size]" type="text" value="<?php echo $this->escapeHtml($this->settings['max_size']) ; ?>" size="10"/>
|
94 |
+
</td>
|
95 |
+
</th>
|
96 |
+
</tr>
|
97 |
+
<tr>
|
98 |
+
<th scope="row" colspan="2">
|
99 |
+
<input id="compression_type" class="formData" name="_mageio_settings[compression_type]" type="hidden" value="lossy" size="50"/>
|
100 |
+
<?php echo Mage::helper('imagerecycle')->__('Compression type - PDF:') ?> </th>
|
101 |
+
<td>
|
102 |
+
<select id="compression_type_pdf" class="formData" name="_mageio_settings[compression_type_pdf]" >
|
103 |
+
<option value="lossy" <?php if($this->settings['compression_type_pdf']=='lossy') echo 'selected="selected"';?> >Best saving</option>
|
104 |
+
<option value="lossless" <?php if($this->settings['compression_type_pdf']=='lossless') echo 'selected="selected"';?>>Original quality</option>
|
105 |
+
<option value="none" <?php if($this->settings['compression_type_pdf']=='none') echo 'selected="selected"';?>>No compression</option>
|
106 |
+
</select>
|
107 |
+
</td>
|
108 |
+
</th>
|
109 |
+
</tr>
|
110 |
+
<tr>
|
111 |
+
<th scope="row" colspan="2">
|
112 |
+
<?php echo Mage::helper('imagerecycle')->__('Compression type - PNG:') ?> </th>
|
113 |
+
<td>
|
114 |
+
<select id="compression_type_png" class="formData" name="_mageio_settings[compression_type_png]" >
|
115 |
+
<option value="lossy" <?php if($this->settings['compression_type_png']=='lossy') echo 'selected="selected"';?> >Best saving</option>
|
116 |
+
<option value="lossless" <?php if($this->settings['compression_type_png']=='lossless') echo 'selected="selected"';?>>Original quality</option>
|
117 |
+
<option value="none" <?php if($this->settings['compression_type_png']=='none') echo 'selected="selected"';?>>No compression</option>
|
118 |
+
</select>
|
119 |
+
</td>
|
120 |
+
</th>
|
121 |
+
</tr>
|
122 |
+
<tr>
|
123 |
+
<th scope="row" colspan="2">
|
124 |
+
<?php echo Mage::helper('imagerecycle')->__('Compression type - JPG:') ?> </th>
|
125 |
+
<td>
|
126 |
+
<select id="compression_type_jpg" class="formData" name="_mageio_settings[compression_type_jpg]" >
|
127 |
+
<option value="lossy" <?php if($this->settings['compression_type_jpg']=='lossy') echo 'selected="selected"';?> >Best saving</option>
|
128 |
+
<option value="lossless" <?php if($this->settings['compression_type_jpg']=='lossless') echo 'selected="selected"';?>>Original quality</option>
|
129 |
+
<option value="none" <?php if($this->settings['compression_type_jpg']=='none') echo 'selected="selected"';?>>No compression</option>
|
130 |
+
</select>
|
131 |
+
</td>
|
132 |
+
</th>
|
133 |
+
</tr>
|
134 |
+
<tr>
|
135 |
+
<th scope="row" colspan="2">
|
136 |
+
<?php echo Mage::helper('imagerecycle')->__('Compression type - GIF:') ?> </th>
|
137 |
+
<td>
|
138 |
+
<select id="compression_type_gif" class="formData" name="_mageio_settings[compression_type_gif]" >
|
139 |
+
<option value="lossy" <?php if($this->settings['compression_type_gif']=='lossy') echo 'selected="selected"';?> >Best saving</option>
|
140 |
+
<option value="lossless" <?php if($this->settings['compression_type_gif']=='lossless') echo 'selected="selected"';?>>Original quality</option>
|
141 |
+
<option value="none" <?php if($this->settings['compression_type_gif']=='none') echo 'selected="selected"';?>>No compression</option>
|
142 |
+
</select>
|
143 |
+
</td>
|
144 |
+
</th>
|
145 |
+
</tr>
|
146 |
+
<tr>
|
147 |
+
<th scope="row"></th>
|
148 |
+
<td width="50%" style="text-align:center">
|
149 |
+
<a id="ir-setting-save" class="button ir-action" style="padding: 0 15px 1px" href="#"><?php echo Mage::helper('imagerecycle')->__('Save') ?>
|
150 |
+
<span id="ir-setting-loader">
|
151 |
+
<img src="<?php echo $this->getSkinUrl('images/ajax-loader-tr.gif') ?>" width="18px" height="18px" />
|
152 |
+
</span>
|
153 |
+
</a>
|
154 |
+
<span id="ir-setting-msg"></span>
|
155 |
+
</td>
|
156 |
+
<td></td>
|
157 |
+
</tr>
|
158 |
+
</tbody>
|
159 |
+
</table>
|
160 |
+
</div>
|
161 |
+
</div>
|
162 |
+
<h3 class="icon-head" style="color: #009999">
|
163 |
+
<?php echo Mage::helper('imagerecycle')->__('Images Recycle Manager') ?>
|
164 |
+
</h3>
|
165 |
+
</div>
|
166 |
+
<div>
|
167 |
+
|
168 |
+
<div class="scan-msg-box" style="display: none">
|
169 |
+
<div>
|
170 |
+
<p><?php echo Mage::helper('imagerecycle')->__("It may takes a few minutes for the first time of using Mage Image Recycle.") ?></p>
|
171 |
+
<p>
|
172 |
+
<?php echo Mage::helper('imagerecycle')->__("Images finder processing..") ?>
|
173 |
+
</p>
|
174 |
+
<p style="margin-top: 25px">
|
175 |
+
<img class="ir-loader" src="<?php echo $this->getSkinUrl('images/ajax-loader-tr.gif') ?>" width="50" height="50" />
|
176 |
+
<p class="ir-scan-msg"></p>
|
177 |
+
</p>
|
178 |
+
</div>
|
179 |
+
</div>
|
180 |
+
|
181 |
+
<form id="irForm" method="post" action="<?php echo Mage::helper("adminhtml")->getUrl("imagerecycle/index/optimize", array('page' => $this->page)) ?>">
|
182 |
+
<p class="msg-warning bulk-action-error" style="display:none"><?php echo Mage::helper('imagerecycle')->__("Please select one Action") ?></p>
|
183 |
+
<div class="clear-left"></div>
|
184 |
+
|
185 |
+
<div class="row row1">
|
186 |
+
<div style="float: left">
|
187 |
+
<select class="ir-bulk-action" name="bulk_action">
|
188 |
+
<option value="-1"><?php echo Mage::helper('imagerecycle')->__("Bulk Action") ?></option>
|
189 |
+
<option value="optimize_selected"><?php echo Mage::helper('imagerecycle')->__("Optimize selsected") ?></option>
|
190 |
+
<option value="optimize_all"><?php echo Mage::helper('imagerecycle')->__("Optimize all") ?></option>
|
191 |
+
</select>
|
192 |
+
<button class="button do-bulk-action"><?php echo Mage::helper('imagerecycle')->__("Apply") ?></button>
|
193 |
+
</div>
|
194 |
+
|
195 |
+
<div class="pagination-wrapper">
|
196 |
+
<span style="float:left; margin-right: 8px; margin-top: 8px">
|
197 |
+
<i>Total <?php echo (!$totalImages ? "0 item" : ($this->totalImages > 1 ? "$this->totalImages items" : "1 item")) ?></i>
|
198 |
+
</span>
|
199 |
+
<?php if($pagination = $this->pagination): ?>
|
200 |
+
<ul class="pagination">
|
201 |
+
<li class="<?php if ($this->page == $pagination->start): ?>disabled<?php endif ?>"><a href="<?php echo $sortedUrl . "page/$pagination->start" ?>">Start</a></li>
|
202 |
+
<li class="<?php if ($this->page == $pagination->start): ?>disabled<?php endif ?>"><a href="<?php echo $sortedUrl . "page/$pagination->prev" ?>">Prev</a></li>
|
203 |
+
<?php foreach($pagination->range as $page): ?>
|
204 |
+
<li class="<?php if ($page == $pagination->current): ?>active<?php endif ?>"><a href="<?php echo $sortedUrl . "page/$page" ?>"><?php echo $page ?></a></li>
|
205 |
+
<?php endforeach ?>
|
206 |
+
<li class="<?php if ($this->page == $pagination->end): ?>disabled<?php endif ?>"><a href="<?php echo $sortedUrl . "page/$pagination->next" ?>">Next</a></li>
|
207 |
+
<li class="<?php if ($this->page == $pagination->end): ?>disabled<?php endif ?>"><a href="<?php echo $sortedUrl . "page/$pagination->end" ?>">End</a></li>
|
208 |
+
</ul>
|
209 |
+
<?php endif ?>
|
210 |
+
</div>
|
211 |
+
</div>
|
212 |
+
|
213 |
+
<table class="image-recycle">
|
214 |
+
<thead>
|
215 |
+
<tr>
|
216 |
+
<th colspan="1" class="check-column"><input type="checkbox" class="ir-checkbox check-all" name="check_all" /></th>
|
217 |
+
<th colspan="2"><?php echo Mage::helper('imagerecycle')->__('Image') ?></th>
|
218 |
+
<th colspan="5">
|
219 |
+
<?php if($order_by=='filename') :?>
|
220 |
+
<a href="<?php echo $url . "order_by/filename/dir/".$new_dir;?>">
|
221 |
+
<?php echo Mage::helper('imagerecycle')->__('Filename') ?>
|
222 |
+
<span class="<?php if($new_dir == 'desc'): ?>ir-arrow-up<?php else: ?>ir-arrow-down<?php endif ?>"></span></a>
|
223 |
+
<?php else:?>
|
224 |
+
<a href="<?php echo $url . "order_by/filename/dir/asc";?>">
|
225 |
+
<?php echo Mage::helper('imagerecycle')->__('Filename') ?>
|
226 |
+
</a>
|
227 |
+
<?php endif ?>
|
228 |
+
|
229 |
+
</th>
|
230 |
+
<th colspan="2">
|
231 |
+
<?php if($order_by=='size') :?>
|
232 |
+
<a href="<?php echo $url . "order_by/size/dir/".$new_dir;?>">
|
233 |
+
<?php echo Mage::helper('imagerecycle')->__('Size') ?>
|
234 |
+
<span class="<?php if($new_dir == 'desc'): ?>ir-arrow-up<?php else: ?>ir-arrow-down<?php endif ?>"></span></a>
|
235 |
+
<?php else:?>
|
236 |
+
<a href="<?php echo $url . "order_by/size/dir/asc";?>">
|
237 |
+
<?php echo Mage::helper('imagerecycle')->__('Size') ?>
|
238 |
+
</a>
|
239 |
+
<?php endif ?>(Kb)
|
240 |
+
</th>
|
241 |
+
<th colspan="2">
|
242 |
+
<?php if($order_by=='status') :?>
|
243 |
+
<a href="<?php echo $url . "order_by/status/dir/".$new_dir;?>">
|
244 |
+
<?php echo Mage::helper('imagerecycle')->__('Status') ?>
|
245 |
+
<span class="<?php if($new_dir == 'desc'): ?>ir-arrow-up<?php else: ?>ir-arrow-down<?php endif ?>"></span></a>
|
246 |
+
<?php else:?>
|
247 |
+
<a href="<?php echo $url . "order_by/status/dir/asc";?>">
|
248 |
+
<?php echo Mage::helper('imagerecycle')->__('Status') ?>
|
249 |
+
</a>
|
250 |
+
<?php endif ?>
|
251 |
+
</th>
|
252 |
+
<th colspan="2"><?php echo Mage::helper('imagerecycle')->__('Action') ?></th>
|
253 |
+
</tr>
|
254 |
+
</thead>
|
255 |
+
<tfoot>
|
256 |
+
<tr>
|
257 |
+
<th colspan="1" class="check-column"><input type="checkbox" class="ir-checkbox check-all" name="check_all" /></th>
|
258 |
+
<th colspan="2"><?php echo Mage::helper('imagerecycle')->__('Image') ?></th>
|
259 |
+
<th colspan="5">
|
260 |
+
<?php if($order_by=='filename') :?>
|
261 |
+
<a href="<?php echo $url . "order_by/filename/dir/".$new_dir;?>">
|
262 |
+
<?php echo Mage::helper('imagerecycle')->__('Filename') ?>
|
263 |
+
<span class="<?php if($new_dir == 'desc'): ?>ir-arrow-up<?php else: ?>ir-arrow-down<?php endif ?>"></span></a>
|
264 |
+
<?php else:?>
|
265 |
+
<a href="<?php echo $url . "order_by/filename/dir/asc";?>">
|
266 |
+
<?php echo Mage::helper('imagerecycle')->__('Filename') ?>
|
267 |
+
</a>
|
268 |
+
<?php endif ?>
|
269 |
+
|
270 |
+
</th>
|
271 |
+
<th colspan="2">
|
272 |
+
<?php if($order_by=='size') :?>
|
273 |
+
<a href="<?php echo $url . "order_by/size/dir/".$new_dir;?>">
|
274 |
+
<?php echo Mage::helper('imagerecycle')->__('Size') ?>
|
275 |
+
<span class="<?php if($new_dir == 'desc'): ?>ir-arrow-up<?php else: ?>ir-arrow-down<?php endif ?>"></span></a>
|
276 |
+
<?php else:?>
|
277 |
+
<a href="<?php echo $url . "order_by/size/dir/asc";?>">
|
278 |
+
<?php echo Mage::helper('imagerecycle')->__('Size') ?>
|
279 |
+
</a>
|
280 |
+
<?php endif ?>(Kb)
|
281 |
+
</th>
|
282 |
+
<th colspan="2">
|
283 |
+
<?php if($order_by=='status') :?>
|
284 |
+
<a href="<?php echo $url . "order_by/status/dir/".$new_dir;?>">
|
285 |
+
<?php echo Mage::helper('imagerecycle')->__('Status') ?>
|
286 |
+
<span class="<?php if($new_dir == 'desc'): ?>ir-arrow-up<?php else: ?>ir-arrow-down<?php endif ?>"></span></a>
|
287 |
+
<?php else:?>
|
288 |
+
<a href="<?php echo $url . "order_by/status/dir/asc";?>">
|
289 |
+
<?php echo Mage::helper('imagerecycle')->__('Status') ?>
|
290 |
+
</a>
|
291 |
+
<?php endif ?>
|
292 |
+
</th>
|
293 |
+
<th colspan="2"><?php echo Mage::helper('imagerecycle')->__('Action') ?></th>
|
294 |
+
</tr>
|
295 |
+
</tfoot>
|
296 |
+
<tbody>
|
297 |
+
|
298 |
+
<?php foreach($images as $k => $image): ;?>
|
299 |
+
<?php if($k > 50) break; ?>
|
300 |
+
<?php $alternate = ($k%2==0) ? 'even' : ''; ?>
|
301 |
+
<tr class="<?php echo $alternate ?>">
|
302 |
+
<th colspan="1" class="check-column">
|
303 |
+
<input type="checkbox" value="<?php echo $image['filename'] ?>" name="images[]" class="ir-checkbox" />
|
304 |
+
</th>
|
305 |
+
<th colspan="2" class="item-image">
|
306 |
+
<?php if($image['filetype']=='pdf') { ?>
|
307 |
+
<img class="image-small" src="<?php echo $this->getBaseUrl();?>/skin/adminhtml/default/default/imagerecycle/imagerecycle/images/pdf.png" />
|
308 |
+
<?php }else { ?>
|
309 |
+
<img class="image-small" src="<?php echo $this->getBaseUrl().$image['filename'] ?>" />
|
310 |
+
<img class="image-origin" src="<?php echo $this->getBaseUrl().$image['filename'] ?>" />
|
311 |
+
<?php } ?>
|
312 |
+
</th>
|
313 |
+
<td colspan="5" style="font-size:14px"><?php echo $image['filename'] ?></td>
|
314 |
+
<td colspan="2" style="font-size:15px"><span class="filesize"><?php echo number_format($image['size']/1000, 2, '.', ''); ?></span></td>
|
315 |
+
<td colspan="2" class="ir-status">
|
316 |
+
<?php if($image['optimized']) : $file = realpath($image['filename']); ?>
|
317 |
+
<span class="optimizationStatus">Optimized at <?php echo round(($image['optimized_datas']['size_before']-filesize($file))/$image['optimized_datas']['size_before']*100,2);?>%</span>
|
318 |
+
<?php endif; ?>
|
319 |
+
|
320 |
+
</td>
|
321 |
+
<td colspan="2">
|
322 |
+
<?php if($image['optimized']) { ?>
|
323 |
+
<a class="button revert ir-action" href="#" data-image-realpath="<?php echo $image['filename'] ?>"><?php echo Mage::helper('imagerecycle')->__('Revert to original') ?></a>
|
324 |
+
<?php } else { ?>
|
325 |
+
<a class="button optimize ir-action" href="#" data-image-realpath="<?php echo $image['filename'] ?>"><?php echo Mage::helper('imagerecycle')->__('Optimize') ?></a>
|
326 |
+
<?php } ?>
|
327 |
+
</td>
|
328 |
+
</tr>
|
329 |
+
<?php endforeach ?>
|
330 |
+
</tbody>
|
331 |
+
</table>
|
332 |
+
|
333 |
+
<div class="row row2" style="margin-top: 15px; padding: 0">
|
334 |
+
<div style="float: left">
|
335 |
+
<select class="ir-bulk-action" name="bulk_action">
|
336 |
+
<option value="-1"><?php echo Mage::helper('imagerecycle')->__("Bulk Action") ?></option>
|
337 |
+
<option value="optimize_selected"><?php echo Mage::helper('imagerecycle')->__("Optimize selsected") ?></option>
|
338 |
+
<option value="optimize_all"><?php echo Mage::helper('imagerecycle')->__("Optimize all") ?></option>
|
339 |
+
</select>
|
340 |
+
<button class="button do-bulk-action"><?php echo Mage::helper('imagerecycle')->__("Apply") ?></button>
|
341 |
+
</div>
|
342 |
+
|
343 |
+
<div class="pagination-wrapper">
|
344 |
+
<span style="float:left; margin-right: 8px; margin-top: 8px">
|
345 |
+
<i>Total <?php echo (!$totalImages ? "0 item" : ($this->totalImages > 1 ? "$this->totalImages items" : "1 item")) ?></i>
|
346 |
+
</span>
|
347 |
+
<?php if($pagination = $this->pagination): ?>
|
348 |
+
<ul class="pagination">
|
349 |
+
<li class="<?php if ($this->page == $pagination->start): ?>disabled<?php endif ?>"><a href="<?php echo $sortedUrl . "page/$pagination->start" ?>">Start</a></li>
|
350 |
+
<li class="<?php if ($this->page == $pagination->start): ?>disabled<?php endif ?>"><a href="<?php echo $sortedUrl . "page/$pagination->prev" ?>">Prev</a></li>
|
351 |
+
<?php foreach($pagination->range as $page): ?>
|
352 |
+
<li class="<?php if ($page == $pagination->current): ?>active<?php endif ?>"><a href="<?php echo $sortedUrl . "page/$page" ?>"><?php echo $page ?></a></li>
|
353 |
+
<?php endforeach ?>
|
354 |
+
<li class="<?php if ($this->page == $pagination->end): ?>disabled<?php endif ?>"><a href="<?php echo $sortedUrl . "page/$pagination->next" ?>">Next</a></li>
|
355 |
+
<li class="<?php if ($this->page == $pagination->end): ?>disabled<?php endif ?>"><a href="<?php echo $sortedUrl . "page/$pagination->end" ?>">End</a></li>
|
356 |
+
</ul>
|
357 |
+
<?php endif ?>
|
358 |
+
</div>
|
359 |
+
</div>
|
360 |
+
<!-- Form_key is required -->
|
361 |
+
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
362 |
+
</form>
|
363 |
+
</div>
|
364 |
+
|
365 |
+
<script type="text/javascript">
|
366 |
+
var optimize_url = '<?php echo Mage::helper("adminhtml")->getUrl("imagerecycle/index/optimize") ?>';
|
367 |
+
var optimizeall_url = '<?php echo Mage::helper("adminhtml")->getUrl("imagerecycle/index/optimizeAll") ?>';
|
368 |
+
var revert_url = '<?php echo Mage::helper("adminhtml")->getUrl("imagerecycle/index/revert") ?>';
|
369 |
+
var saveConfig_url = '<?php echo Mage::helper("adminhtml")->getUrl("imagerecycle/index/saveConfig") ?>?isAjax=true' ;
|
370 |
+
</script>
|
app/etc/modules/Imagerecycle_ImageRecycle.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Imagerecycle_Imagerecycle>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Imagerecycle_Imagerecycle>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ImageRecycle_image_pdf_optimize</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
@@ -34,9 +34,9 @@ The jpg, png, gif optimization algorithm is capable of reducing the image size b
|
|
34 |
- Define optimization quality per file type, jpg, png, gif</description>
|
35 |
<notes>First stable release</notes>
|
36 |
<authors><author><name>ImageRecycle</name><user>ImageRecycle</user><email>contact@imagerecycle.com</email></author></authors>
|
37 |
-
<date>2015-07-
|
38 |
-
<time>
|
39 |
-
<contents><target name="magecommunity"><dir name="Imagerecycle"><dir name="Imagerecycle"><dir name="Block"><file name="Images.php" hash="b9b9fe9c0d0a177fc4b68267a88b0e9e"/></dir><dir name="Helper"><file name="Data.php" hash="0c20c4a7fab920f9e05f3eb9dcd087e5"/></dir><dir name="Model"><file name="Observer.php" hash="ecd7abe292e072f6c02badfb8815ba4b"/><dir name="Resource"><dir name="Images"><file name="Collection.php" hash="a8f7aba5403f8469959053630e509898"/></dir><file name="Images.php" hash="82c27d80a05aa3af8329100ad1ca2762"/><file name="Setup.php" hash="7950a28c598f21168a319fcbf7946583"/></dir></dir><dir name="classes"><file name="ioa.class.php" hash="fe94031507a893481a7db8dd2b5dfdde"/></dir><dir name="controllers"><file name="IndexController.php" hash="0a20b9a53bdf7f76705c33b46f4f6c30"/></dir><dir name="etc"><file name="adminhtml.xml" hash="66cb48702ff1456d6ca9fbff533f3ee4"/><file name="config.xml" hash="55543338ab5453522a4a1642df12eda7"/></dir><dir name="sql"><dir name="imagerecycle_setup"><file name="mysql4-install-1.0.0.php" hash="e9113b9c19d91ed6cebd34180c90ff76"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="imagerecycle"><dir name="imagerecycle"><file name="bluebox.js" hash="36304b24f301b11d5abc23d6b5c1ef45"/><file name="jquery.min.js" hash="8101d596b2b8fa35fe3a634ea342d7c3"/><file name="script.js" hash="1f324e0446a2667ef8784b4213908790"/></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="imagerecycle"><dir name="imagerecycle"><file name="imagerecycle.css" hash="5c70db79a6e7ac29b0b1e9927ae6f31f"/><dir name="images"><file name="ajax-loader-tr.gif" hash="1ae32bc8232ff2527c627e5b38eb319a"/><file name="gift-message-collapse.gif" hash="5b710f5faa9c7352a39c10e3ebbee6fc"/><file name="gift-message-expand.gif" hash="fd53a70cbb1ea048754657a63787e9cb"/><file name="grouped_to_order_icon.png" hash="4bdae9a6199655027b8b8aeee8f80ce4"/><file name="i_question-mark.png" hash="23201b7ac207eebd9be0776ea44098a4"/><file name="pdf.png" hash="9c819141f3537f9f3ea181369332be85"/></dir></dir></dir></dir></dir></dir></target></contents>
|
40 |
<compatible/>
|
41 |
-
<dependencies><required><php><min>5.3.0</min><max>5.6.0</max></php></required></dependencies>
|
42 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ImageRecycle_image_pdf_optimize</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
34 |
- Define optimization quality per file type, jpg, png, gif</description>
|
35 |
<notes>First stable release</notes>
|
36 |
<authors><author><name>ImageRecycle</name><user>ImageRecycle</user><email>contact@imagerecycle.com</email></author></authors>
|
37 |
+
<date>2015-07-18</date>
|
38 |
+
<time>08:27:42</time>
|
39 |
+
<contents><target name="magecommunity"><dir name="Imagerecycle"><dir name="Imagerecycle"><dir name="Block"><file name="Images.php" hash="b9b9fe9c0d0a177fc4b68267a88b0e9e"/></dir><dir name="Helper"><file name="Data.php" hash="0c20c4a7fab920f9e05f3eb9dcd087e5"/></dir><dir name="Model"><file name="Observer.php" hash="ecd7abe292e072f6c02badfb8815ba4b"/><dir name="Resource"><dir name="Images"><file name="Collection.php" hash="a8f7aba5403f8469959053630e509898"/></dir><file name="Images.php" hash="82c27d80a05aa3af8329100ad1ca2762"/><file name="Setup.php" hash="7950a28c598f21168a319fcbf7946583"/></dir></dir><dir name="classes"><file name="ioa.class.php" hash="fe94031507a893481a7db8dd2b5dfdde"/></dir><dir name="controllers"><file name="IndexController.php" hash="0a20b9a53bdf7f76705c33b46f4f6c30"/></dir><dir name="etc"><file name="adminhtml.xml" hash="66cb48702ff1456d6ca9fbff533f3ee4"/><file name="config.xml" hash="55543338ab5453522a4a1642df12eda7"/></dir><dir name="sql"><dir name="imagerecycle_setup"><file name="mysql4-install-1.0.0.php" hash="e9113b9c19d91ed6cebd34180c90ff76"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="imagerecycle"><dir name="imagerecycle"><file name="bluebox.js" hash="36304b24f301b11d5abc23d6b5c1ef45"/><file name="jquery.min.js" hash="8101d596b2b8fa35fe3a634ea342d7c3"/><file name="script.js" hash="1f324e0446a2667ef8784b4213908790"/></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="imagerecycle"><dir name="imagerecycle"><file name="imagerecycle.css" hash="5c70db79a6e7ac29b0b1e9927ae6f31f"/><dir name="images"><file name="ajax-loader-tr.gif" hash="1ae32bc8232ff2527c627e5b38eb319a"/><file name="gift-message-collapse.gif" hash="5b710f5faa9c7352a39c10e3ebbee6fc"/><file name="gift-message-expand.gif" hash="fd53a70cbb1ea048754657a63787e9cb"/><file name="grouped_to_order_icon.png" hash="4bdae9a6199655027b8b8aeee8f80ce4"/><file name="i_question-mark.png" hash="23201b7ac207eebd9be0776ea44098a4"/><file name="pdf.png" hash="9c819141f3537f9f3ea181369332be85"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Imagerecycle_ImageRecycle.xml" hash="a20d14dfe71ec27c3f048cbb2eb03d1d"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="imagerecycle_imagerecycle.xml" hash="f26968bc8644e3e3d7c412a73d7f3ba0"/></dir></dir></dir></dir><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="imagerecycle"><dir name="imagerecycle"><file name="images.phtml" hash="bc8903cf82eb2c98040eba5c6f51e6b1"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
40 |
<compatible/>
|
41 |
+
<dependencies><required><php><min>5.3.0</min><max>5.6.0</max></php><extension><name>curl</name><min></min><max></max></extension></required></dependencies>
|
42 |
</package>
|