mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
hide "use flash uploader" with ie >= 10
#time 8h
This commit is contained in:
@@ -80,6 +80,8 @@ class Upload implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->get('/flash-version/', $this->call('getFlashUploadForm'))
|
||||
->bind('upload_flash_form');
|
||||
$controllers->get('/html5-version/', $this->call('getHtml5UploadForm'))
|
||||
->bind('upload_html5_form');
|
||||
|
||||
/**
|
||||
* UPLOAD route
|
||||
@@ -119,11 +121,24 @@ class Upload implements ControllerProviderInterface
|
||||
|
||||
return $app['twig']->render(
|
||||
'prod/upload/upload-flash.html.twig', array(
|
||||
'sessionId' => session_id(),
|
||||
'collections' => $this->getGrantedCollections($app['authentication']->getUser()),
|
||||
'maxFileSize' => $maxFileSize,
|
||||
'maxFileSizeReadable' => \p4string::format_octets($maxFileSize)
|
||||
));
|
||||
'sessionId' => session_id(),
|
||||
'collections' => $this->getGrantedCollections($app['authentication']->getUser()),
|
||||
'maxFileSize' => $maxFileSize,
|
||||
'maxFileSizeReadable' => \p4string::format_octets($maxFileSize)
|
||||
));
|
||||
}
|
||||
|
||||
public function getHtml5UploadForm(Application $app, Request $request)
|
||||
{
|
||||
$maxFileSize = $this->getUploadMaxFileSize();
|
||||
|
||||
return $app['twig']->render(
|
||||
'prod/upload/upload.html.twig', array(
|
||||
'sessionId' => session_id(),
|
||||
'collections' => $this->getGrantedCollections($app['authentication']->getUser()),
|
||||
'maxFileSize' => $maxFileSize,
|
||||
'maxFileSizeReadable' => \p4string::format_octets($maxFileSize)
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -61,7 +61,7 @@
|
||||
{% if module == "prod" %}
|
||||
{% if app['authentication'].getUser().ACL.has_access_to_module('upload') %}
|
||||
<li>
|
||||
{% set link = path('upload_form') %}
|
||||
{% set link = path('upload_html5_form') %}
|
||||
|
||||
{% if not app['browser'].supportFileAPI() %}
|
||||
{% set link = path('upload_flash_form') %}
|
||||
|
@@ -41,7 +41,7 @@
|
||||
{% trans 'You are using the Flash uploader.'%}
|
||||
{% trans 'This version does not allow you to access all the features offered by the HTML5 uploader' %}
|
||||
</p>
|
||||
<a href="{{ path('upload_form') }}" class="dialog full-dialog">{% trans 'Use the HTML5 uploader' %}</a>
|
||||
<a href="{{ path('upload_html5_form') }}" class="dialog full-dialog">{% trans 'Use the HTML5 uploader' %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -167,7 +167,6 @@
|
||||
|
||||
$('#uploadBox #status-' + selectedCollId).show();
|
||||
});
|
||||
|
||||
//global file order, start uploads from swf.queue, following
|
||||
//order of "file_order"
|
||||
var file_order = [];
|
||||
|
@@ -46,7 +46,7 @@
|
||||
{% trans 'Your browser does not support all HTML5 features properly.' %}
|
||||
{% endif %}
|
||||
</p>
|
||||
<a href="{{ path('upload_flash_form') }}" class="dialog full-dialog">{% trans 'Use the Flash uploader' %}</a>
|
||||
<a id="UPLOAD_FLASH_LINK" href="{{ path('upload_flash_form') }}" class="dialog full-dialog">{% trans 'Use the Flash uploader' %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -143,6 +143,21 @@
|
||||
<script>
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
var userAgent = navigator.userAgent.toLowerCase();
|
||||
$.browser = {
|
||||
version: (userAgent.match( /.+(?:rv|it|ra|ie|me)[/: ]([\d.]+)/ ) || [])[1],
|
||||
chrome: /chrome/.test( userAgent ),
|
||||
safari: /webkit/.test( userAgent ) && !/chrome/.test( userAgent ),
|
||||
opera: /opera/.test( userAgent ),
|
||||
msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
|
||||
mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
|
||||
};
|
||||
|
||||
if($.browser.msie && parseFloat($.browser.version)>=10) {
|
||||
$("#UPLOAD_FLASH_LINK").hide();
|
||||
}
|
||||
|
||||
//Upload management
|
||||
var UploaderManager = new p4.UploaderManager({
|
||||
container: $('#uploadBox'),
|
||||
|
Reference in New Issue
Block a user