Version Notes
compatible with magento 1.9.3
Download this release
Release Info
Developer | Maven |
Extension | Maven_Html5uploader |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- app/code/community/Maven/Html5uploader/Block/Uploader/Multiple.php +37 -0
- app/code/community/Maven/Html5uploader/etc/config.xml +5 -0
- app/design/adminhtml/default/default/layout/maven_html5uploader.xml +5 -5
- app/design/adminhtml/default/default/template/maven/uploader/1.9.3/cms_uploader.phtml +69 -0
- app/design/adminhtml/default/default/template/maven/uploader/1.9.3/uploader.phtml +68 -0
- app/design/adminhtml/default/default/template/maven/uploader/cms_uploader.phtml +6 -2
- package.xml +5 -5
app/code/community/Maven/Html5uploader/Block/Uploader/Multiple.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: developer
|
5 |
+
* Date: 21.10.16
|
6 |
+
* Time: 18:11
|
7 |
+
*/
|
8 |
+
class Maven_Html5uploader_Block_Uploader_Multiple extends Mage_Uploader_Block_Multiple
|
9 |
+
{
|
10 |
+
public function __construct()
|
11 |
+
{
|
12 |
+
parent::__construct();
|
13 |
+
if (Mage::getStoreConfig('maven/config/enable')) {
|
14 |
+
$this->setTemplate('maven/uploader/1.9.3/uploader.phtml');
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
protected function _prepareLayout()
|
19 |
+
{
|
20 |
+
if (Mage::getStoreConfig('maven/config/enable')) {
|
21 |
+
return $this;
|
22 |
+
}
|
23 |
+
else {
|
24 |
+
parent::_prepareLayout();
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getMaxFileSize()
|
29 |
+
{
|
30 |
+
$res = array(
|
31 |
+
ini_get('post_max_size'),
|
32 |
+
ini_get('upload_max_filesize'),
|
33 |
+
);
|
34 |
+
$min = min($res);
|
35 |
+
return (int)$min * 1000000;
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Maven/Html5uploader/etc/config.xml
CHANGED
@@ -25,6 +25,11 @@
|
|
25 |
<cms_wysiwyg_images_content_uploader>Maven_Html5uploader_Block_Adminhtml_Cms_Wysiwyg_Images_Content_Uploader</cms_wysiwyg_images_content_uploader>
|
26 |
</rewrite>
|
27 |
</adminhtml>
|
|
|
|
|
|
|
|
|
|
|
28 |
</blocks>
|
29 |
<helpers>
|
30 |
<maven_html5uploader>
|
25 |
<cms_wysiwyg_images_content_uploader>Maven_Html5uploader_Block_Adminhtml_Cms_Wysiwyg_Images_Content_Uploader</cms_wysiwyg_images_content_uploader>
|
26 |
</rewrite>
|
27 |
</adminhtml>
|
28 |
+
<uploader>
|
29 |
+
<rewrite>
|
30 |
+
<multiple>Maven_Html5uploader_Block_Uploader_Multiple</multiple>
|
31 |
+
</rewrite>
|
32 |
+
</uploader>
|
33 |
</blocks>
|
34 |
<helpers>
|
35 |
<maven_html5uploader>
|
app/design/adminhtml/default/default/layout/maven_html5uploader.xml
CHANGED
@@ -2,22 +2,22 @@
|
|
2 |
<layout>
|
3 |
<editor>
|
4 |
<reference name="head">
|
5 |
-
<action method="addCss"><name>css/maven_html5upload/styles.css</name></action>
|
6 |
-
<action method="addItem">
|
7 |
<type>skin_js</type>
|
8 |
<name>js/maven_html5upload/jsuploader.js</name>
|
9 |
</action>
|
10 |
-
<action method="addItem">
|
11 |
<type>skin_js</type>
|
12 |
<name>js/maven_html5upload/uploader.js</name>
|
13 |
</action>
|
14 |
-
<action method="addItem">
|
15 |
<type>skin_js</type>
|
16 |
<name>js/maven_html5upload/script.js</name>
|
17 |
</action>
|
18 |
</reference>
|
19 |
<reference name="wysiwyg_images.uploader">
|
20 |
-
<action method="setTemplate">
|
21 |
<template>maven/uploader/cms_uploader.phtml</template>
|
22 |
</action>
|
23 |
</reference>
|
2 |
<layout>
|
3 |
<editor>
|
4 |
<reference name="head">
|
5 |
+
<action method="addCss" ifconfig="maven/config/enable"><name>css/maven_html5upload/styles.css</name></action>
|
6 |
+
<action method="addItem" ifconfig="maven/config/enable">
|
7 |
<type>skin_js</type>
|
8 |
<name>js/maven_html5upload/jsuploader.js</name>
|
9 |
</action>
|
10 |
+
<action method="addItem" ifconfig="maven/config/enable">
|
11 |
<type>skin_js</type>
|
12 |
<name>js/maven_html5upload/uploader.js</name>
|
13 |
</action>
|
14 |
+
<action method="addItem" ifconfig="maven/config/enable">
|
15 |
<type>skin_js</type>
|
16 |
<name>js/maven_html5upload/script.js</name>
|
17 |
</action>
|
18 |
</reference>
|
19 |
<reference name="wysiwyg_images.uploader">
|
20 |
+
<action method="setTemplate" ifconfig="maven/config/enable">
|
21 |
<template>maven/uploader/cms_uploader.phtml</template>
|
22 |
</action>
|
23 |
</reference>
|
app/design/adminhtml/default/default/template/maven/uploader/1.9.3/cms_uploader.phtml
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="<?php echo $this->getHtmlId() ?>" class="uploader">
|
2 |
+
<div class="buttons">
|
3 |
+
<div class="no-display" id="<?php echo $this->getHtmlId() ?>-uploadBlockTemplate"><div id="uploadBlock-{{id}}">
|
4 |
+
<form action="{{url}}" enctype="multipart/form-data" encoding="multipart/form-data" method="post" target="uploadBlockIframe-{{id}}">
|
5 |
+
<input type="file" name="image"/>
|
6 |
+
<input type="hidden" name="Filename"/>
|
7 |
+
<input type="hidden" name="form_key" value="{{formKey}}"/>
|
8 |
+
<input type="hidden" name="Upload" value="Submit Query"/>
|
9 |
+
</form>
|
10 |
+
<iframe name="uploadBlockIframe-{{id}}" style="display:none;"></iframe>
|
11 |
+
</div></div>
|
12 |
+
<div id="uploadBlocks" style="float:left;margin-right: 0.5em;"></div>
|
13 |
+
<?php echo $this->getUploadButtonHtml() ?>
|
14 |
+
</div>
|
15 |
+
<div class="clear"></div>
|
16 |
+
<div class="no-display" id="<?php echo $this->getHtmlId() ?>-template">
|
17 |
+
<div id="{{id}}" class="file-row">
|
18 |
+
<span class="file-info">{{name}} ({{size}})</span>
|
19 |
+
<span class="delete-button"><?php echo $this->getDeleteButtonHtml() ?></span>
|
20 |
+
<span class="progress-text"></span>
|
21 |
+
<div class="clear"></div>
|
22 |
+
</div>
|
23 |
+
</div>
|
24 |
+
<div class="no-display" id="<?php echo $this->getHtmlId() ?>-template-progress">
|
25 |
+
{{percent}}% {{uploaded}} / {{total}}
|
26 |
+
</div>
|
27 |
+
</div>
|
28 |
+
|
29 |
+
<div class="maven_html5upload">
|
30 |
+
<form id="upload"
|
31 |
+
action="<?php echo Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('adminhtml/ajax/cmsupload' ,array('form_key' => Mage::getSingleton('core/session')->getFormKey()));?>"
|
32 |
+
method="POST"
|
33 |
+
enctype="multipart/form-data"
|
34 |
+
data-remove-action="<?php echo Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('adminhtml/ajax/remove' ,array('form_key' => Mage::getSingleton('core/session')->getFormKey()));?>"
|
35 |
+
>
|
36 |
+
<fieldset>
|
37 |
+
<input type="hidden" id="MAX_FILE_SIZE" name="MAX_FILE_SIZE" value="<?php echo $this->getMaxFileSize(); ?>" />
|
38 |
+
<div>
|
39 |
+
<label for="fileselect"><?php echo $this->__('Files to upload:'); ?></label>
|
40 |
+
<input type="file" id="fileselect" name="fileselect[]" multiple="multiple" />
|
41 |
+
<div id="filedrag"><?php echo $this->__('or drop files here'); ?></div>
|
42 |
+
</div>
|
43 |
+
|
44 |
+
<div id="submitbutton">
|
45 |
+
<button type="submit"><?php echo $this->__('Upload Files'); ?></button>
|
46 |
+
</div>
|
47 |
+
|
48 |
+
</fieldset>
|
49 |
+
|
50 |
+
</form>
|
51 |
+
|
52 |
+
<div id="progress"></div>
|
53 |
+
|
54 |
+
<div id="maven_messages">
|
55 |
+
</div>
|
56 |
+
<script type="text/javascript">
|
57 |
+
//<![CDATA[
|
58 |
+
|
59 |
+
var uploader = new JsUploader('<?php echo $this->getHtmlId() ?>', <?php echo $this->getJsonConfig() ?>);
|
60 |
+
(function() {
|
61 |
+
// call initialization file
|
62 |
+
if (window.File && window.FileList && window.FileReader) {
|
63 |
+
Init();
|
64 |
+
}
|
65 |
+
})();
|
66 |
+
//]]>
|
67 |
+
</script>
|
68 |
+
</div>
|
69 |
+
|
app/design/adminhtml/default/default/template/maven/uploader/1.9.3/uploader.phtml
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="<?php echo $this->getHtmlId() ?>" class="uploader">
|
2 |
+
<div class="buttons">
|
3 |
+
<div class="no-display" id="<?php echo $this->getHtmlId() ?>-uploadBlockTemplate"><div id="uploadBlock-{{id}}">
|
4 |
+
<form action="{{url}}" enctype="multipart/form-data" encoding="multipart/form-data" method="post" target="uploadBlockIframe-{{id}}">
|
5 |
+
<input type="file" name="image"/>
|
6 |
+
<input type="hidden" name="Filename"/>
|
7 |
+
<input type="hidden" name="Upload" value="Submit Query"/>
|
8 |
+
</form>
|
9 |
+
<iframe name="uploadBlockIframe-{{id}}" style="display:none;"></iframe>
|
10 |
+
</div></div>
|
11 |
+
<div id="uploadBlocks" style="float:left;margin-right: 0.5em;"></div>
|
12 |
+
<?php echo $this->getUploadButtonHtml() ?>
|
13 |
+
</div>
|
14 |
+
<div class="clear"></div>
|
15 |
+
<div class="no-display" id="<?php echo $this->getHtmlId() ?>-template">
|
16 |
+
<div id="{{id}}" class="file-row">
|
17 |
+
<span class="file-info">{{name}} ({{size}})</span>
|
18 |
+
<span class="delete-button"><?php echo $this->getDeleteButtonHtml() ?></span>
|
19 |
+
<span class="progress-text"></span>
|
20 |
+
<div class="clear"></div>
|
21 |
+
</div>
|
22 |
+
</div>
|
23 |
+
<div class="no-display" id="<?php echo $this->getHtmlId() ?>-template-progress">
|
24 |
+
{{percent}}% {{uploaded}} / {{total}}
|
25 |
+
</div>
|
26 |
+
</div>
|
27 |
+
|
28 |
+
<div class="maven_html5upload">
|
29 |
+
<form id="upload"
|
30 |
+
action="<?php echo Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('adminhtml/ajax/upload' ,array('form_key' => Mage::getSingleton('core/session')->getFormKey()));?>"
|
31 |
+
method="POST"
|
32 |
+
enctype="multipart/form-data"
|
33 |
+
data-remove-action="<?php echo Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('adminhtml/ajax/remove' ,array('form_key' => Mage::getSingleton('core/session')->getFormKey()));?>"
|
34 |
+
>
|
35 |
+
<fieldset>
|
36 |
+
<input type="hidden" id="MAX_FILE_SIZE" name="MAX_FILE_SIZE" value="<?php echo $this->getMaxFileSize(); ?>" />
|
37 |
+
<div>
|
38 |
+
<label for="fileselect"><?php echo $this->__('Files to upload:'); ?></label>
|
39 |
+
<input type="file" id="fileselect" name="fileselect[]" multiple="multiple" />
|
40 |
+
<div id="filedrag"><?php echo $this->__('or drop files here'); ?></div>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<div id="submitbutton">
|
44 |
+
<button type="submit"><?php echo $this->__('Upload Files'); ?></button>
|
45 |
+
</div>
|
46 |
+
|
47 |
+
</fieldset>
|
48 |
+
|
49 |
+
</form>
|
50 |
+
|
51 |
+
<div id="progress"></div>
|
52 |
+
|
53 |
+
<div id="maven_messages">
|
54 |
+
</div>
|
55 |
+
<script type="text/javascript">
|
56 |
+
//<![CDATA[
|
57 |
+
|
58 |
+
var uploader = new JsUploader('<?php echo $this->getHtmlId() ?>', <?php echo $this->getJsonConfig() ?>);
|
59 |
+
(function() {
|
60 |
+
// call initialization file
|
61 |
+
if (window.File && window.FileList && window.FileReader) {
|
62 |
+
Init();
|
63 |
+
}
|
64 |
+
})();
|
65 |
+
//]]>
|
66 |
+
</script>
|
67 |
+
</div>
|
68 |
+
|
app/design/adminhtml/default/default/template/maven/uploader/cms_uploader.phtml
CHANGED
@@ -55,8 +55,12 @@
|
|
55 |
</div>
|
56 |
<script type="text/javascript">
|
57 |
//<![CDATA[
|
58 |
-
|
59 |
-
<?php
|
|
|
|
|
|
|
|
|
60 |
(function() {
|
61 |
// call initialization file
|
62 |
if (window.File && window.FileList && window.FileReader) {
|
55 |
</div>
|
56 |
<script type="text/javascript">
|
57 |
//<![CDATA[
|
58 |
+
<?php $magentoVersion = Mage::getVersion(); ?>
|
59 |
+
<?php if (version_compare($magentoVersion, '1.9.3', '>=')): ?>
|
60 |
+
var uploader = new JsUploader('<?php echo $this->getHtmlId() ?>', <?php echo $this->getJsonConfig() ?>);
|
61 |
+
<?php else: ?>
|
62 |
+
<?php echo $this->getJsObjectName() ?> = new JsUploader('<?php echo $this->getHtmlId() ?>', <?php echo $this->getConfigJson() ?>);
|
63 |
+
<?php endif; ?>
|
64 |
(function() {
|
65 |
// call initialization file
|
66 |
if (window.File && window.FileList && window.FileReader) {
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Maven_Html5uploader</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>html5 uploader</summary>
|
10 |
<description>html5 uploader</description>
|
11 |
-
<notes>
|
12 |
<authors><author><name>Maven</name><user>maven_ecommerce</user><email>extension@mavenecommerce.com</email></author></authors>
|
13 |
-
<date>2016-10-
|
14 |
-
<time>
|
15 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Maven_Html5uploader.xml" hash="371bae7f48b36a55dfc75e454bc27197"/></dir></target><target name="magecommunity"><dir name="Maven"><dir name="Html5uploader"><dir name="Block"><dir name="Adminhtml"><dir name="Cms"><dir name="Wysiwyg"><dir name="Images"><dir name="Content"><file name="Uploader.php" hash="36d978c49d5ac31f3d8f4e43aa78af96"/></dir></dir></dir></dir><dir name="Media"><file name="Uploader.php" hash="823f5d66fc7525e03bb1bbbcafa70ab4"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="00356d33a3154bc72167910b964250c7"/></dir><dir name="Model"><dir name="Media"><file name="Uploader.php" hash="2a24a508f809a20eb0f35d896ce27756"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="AjaxController.php" hash="333b8b22b09a38971ff736cb54a91bcc"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="e65a851233905187a222f08258bf0be5"/><file name="config.xml" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>5.6.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Maven_Html5uploader</name>
|
4 |
+
<version>1.0.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>html5 uploader</summary>
|
10 |
<description>html5 uploader</description>
|
11 |
+
<notes>compatible with magento 1.9.3</notes>
|
12 |
<authors><author><name>Maven</name><user>maven_ecommerce</user><email>extension@mavenecommerce.com</email></author></authors>
|
13 |
+
<date>2016-10-24</date>
|
14 |
+
<time>07:59:08</time>
|
15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Maven_Html5uploader.xml" hash="371bae7f48b36a55dfc75e454bc27197"/></dir></target><target name="magecommunity"><dir name="Maven"><dir name="Html5uploader"><dir name="Block"><dir name="Adminhtml"><dir name="Cms"><dir name="Wysiwyg"><dir name="Images"><dir name="Content"><file name="Uploader.php" hash="36d978c49d5ac31f3d8f4e43aa78af96"/></dir></dir></dir></dir><dir name="Media"><file name="Uploader.php" hash="823f5d66fc7525e03bb1bbbcafa70ab4"/></dir></dir><dir name="Uploader"><file name="Multiple.php" hash="33515ddc4932b2c713be9cf2e9d71688"/></dir></dir><dir name="Helper"><file name="Data.php" hash="00356d33a3154bc72167910b964250c7"/></dir><dir name="Model"><dir name="Media"><file name="Uploader.php" hash="2a24a508f809a20eb0f35d896ce27756"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="AjaxController.php" hash="333b8b22b09a38971ff736cb54a91bcc"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="e65a851233905187a222f08258bf0be5"/><file name="config.xml" hash="ad75c2c32e793a8a122fe02f8ac561eb"/><file name="system.xml" hash="bfbd8132d85bce5589ed5609c048ad54"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="maven_html5uploader.xml" hash="5e29f3fb116504013c14b2ddce5b0288"/></dir><dir name="template"><dir name="maven"><dir name="uploader"><dir name="1.9.3"><file name="cms_uploader.phtml" hash="eaf4138c67b33910b1e5384c5f669ad6"/><file name="uploader.phtml" hash="40bdd8c589fc7e1ee865b55fa8e423d3"/></dir><file name="cms_uploader.phtml" hash="1f2d7a72af5db2c37eb16afc9c10b3d9"/><file name="uploader.phtml" hash="e00309ef045611d25e85f276f3fd2f89"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Maven_Html5uploader.csv" hash="dae82c5696e999c45bb282adc7d4dafb"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="js"><dir name="maven_html5upload"><file name="jsuploader.js" hash="f259cec4c426d3a8c9e0a41e5e6aa287"/><file name="script.js" hash="4cc3e20174da2abd5c4b9c23df2531e5"/><file name="uploader.js" hash="cabe276db64bf5924b21498a9d13fb0d"/></dir></dir><dir name="css"><dir name="maven_html5upload"><file name="progress.png" hash="c66546fae9226a2f690aead728b6e7a2"/><file name="styles.css" hash="bb2a68be5fe319143db9c75286c54401"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>5.6.0</max></php></required></dependencies>
|
18 |
</package>
|