Browse Source

#214 Add file too large notification (require moxl update)

pull/238/head
Christine Ho 10 years ago
parent
commit
7d4e953685
  1. 6
      app/widgets/Upload/Upload.php
  2. 1
      app/widgets/Upload/locales.ini

6
app/widgets/Upload/Upload.php

@ -7,6 +7,7 @@ class Upload extends \Movim\Widget\Base {
{
$this->addjs('upload.js');
$this->registerEvent('upload_request_handle', 'onRequested');
$this->registerEvent('upload_request_errornotacceptable', 'onErrorNotAcceptable');
header('Access-Control-Allow-Origin: *');
}
@ -16,6 +17,11 @@ class Upload extends \Movim\Widget\Base {
RPC::call('Upload.request', $get, $put);
}
function onErrorNotAcceptable()
{
Notification::append(null, $this->__('upload.error_filesize'));
}
function ajaxRequest()
{
$view = $this->tpl();

1
app/widgets/Upload/locales.ini

@ -1,3 +1,4 @@
[upload]
title = Upload a file
choose = Choose a file to upload
error_filesize = File too large
Loading…
Cancel
Save