diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Upload.php b/lib/Alchemy/Phrasea/Controller/Prod/Upload.php index eee6ef7153..ffa7d74a0e 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Upload.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Upload.php @@ -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) + )); } /** diff --git a/templates/web/common/menubar.html.twig b/templates/web/common/menubar.html.twig index a9b2255dd4..557af546e5 100644 --- a/templates/web/common/menubar.html.twig +++ b/templates/web/common/menubar.html.twig @@ -61,7 +61,7 @@ {% if module == "prod" %} {% if app['authentication'].getUser().ACL.has_access_to_module('upload') %}
  • - {% set link = path('upload_form') %} + {% set link = path('upload_html5_form') %} {% if not app['browser'].supportFileAPI() %} {% set link = path('upload_flash_form') %} diff --git a/templates/web/prod/upload/upload-flash.html.twig b/templates/web/prod/upload/upload-flash.html.twig index 493861b28e..d55a4b917b 100644 --- a/templates/web/prod/upload/upload-flash.html.twig +++ b/templates/web/prod/upload/upload-flash.html.twig @@ -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' %}

    - {% trans 'Use the HTML5 uploader' %} + {% trans 'Use the HTML5 uploader' %} @@ -167,7 +167,6 @@ $('#uploadBox #status-' + selectedCollId).show(); }); - //global file order, start uploads from swf.queue, following //order of "file_order" var file_order = []; diff --git a/templates/web/prod/upload/upload.html.twig b/templates/web/prod/upload/upload.html.twig index 5c153c36b2..c7a4101e80 100644 --- a/templates/web/prod/upload/upload.html.twig +++ b/templates/web/prod/upload/upload.html.twig @@ -46,7 +46,7 @@ {% trans 'Your browser does not support all HTML5 features properly.' %} {% endif %}

    - {% trans 'Use the Flash uploader' %} + {% trans 'Use the Flash uploader' %} @@ -143,6 +143,21 @@