mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
wip file upload
This commit is contained in:
@@ -46,8 +46,6 @@ class SetupController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('POST' === $request->getMethod()) {
|
if ('POST' === $request->getMethod()) {
|
||||||
var_dump($request);
|
|
||||||
die('here');
|
|
||||||
$form->submit($request->request->all());
|
$form->submit($request->request->all());
|
||||||
|
|
||||||
if ($form->isValid()) {
|
if ($form->isValid()) {
|
||||||
|
|||||||
@@ -82,16 +82,6 @@
|
|||||||
var height = this.height;
|
var height = this.height;
|
||||||
var width = this.width;
|
var width = this.width;
|
||||||
|
|
||||||
//check dimensions
|
|
||||||
if (height > 42 || width > 52) {
|
|
||||||
$('#error-text').text(errorDimension);
|
|
||||||
$('#error-text').show();
|
|
||||||
$('#help-text').hide();
|
|
||||||
$('#personalize-image-container').hide();
|
|
||||||
$('#general_personalize-logo-choice_personalizeLogoInput').val("");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//check file extension
|
//check file extension
|
||||||
var ext = $('#general_personalize-logo-choice_personalizeLogoInput').val().split('.').pop().toLowerCase();
|
var ext = $('#general_personalize-logo-choice_personalizeLogoInput').val().split('.').pop().toLowerCase();
|
||||||
if (ext != 'png') {
|
if (ext != 'png') {
|
||||||
@@ -102,6 +92,17 @@
|
|||||||
$('#personalize-image-container').hide();
|
$('#personalize-image-container').hide();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//check dimensions
|
||||||
|
if (height > 42 || width > 52) {
|
||||||
|
$('#error-text').text(errorDimension);
|
||||||
|
$('#error-text').show();
|
||||||
|
$('#help-text').hide();
|
||||||
|
$('#personalize-image-container').hide();
|
||||||
|
$('#general_personalize-logo-choice_personalizeLogoInput').val("");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
fileToUpload = input.files[0];
|
fileToUpload = input.files[0];
|
||||||
$('#personalize-image-container').show();
|
$('#personalize-image-container').show();
|
||||||
$('#error-text').hide();
|
$('#error-text').hide();
|
||||||
|
|||||||
@@ -30,8 +30,7 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
{{ form_start(form, {'method': 'POST', 'action' : path('setup_display_globals'), 'attr': {'class' : 'form-horizontal', 'id': 'setupForm'}}) }}
|
||||||
{{ form_start(form, {'method': 'POST', 'action' : path('setup_display_globals'), 'attr': {'class' : 'form-horizontal'}}) }}
|
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
{% for daform in form %}
|
{% for daform in form %}
|
||||||
{% if daform.vars['label'] != null %}
|
{% if daform.vars['label'] != null %}
|
||||||
|
|||||||
Reference in New Issue
Block a user