Commit 743a5b1f authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

QfqPage.js: instantiates FileUpload. Requires additional setting 'fileUploadTo' now.

parent 8562ca01
......@@ -20,6 +20,7 @@ if (!QfqNS) {
submitTo: "typo3conf/ext/qfq/qfq/api/save.php",
deleteUrl: "typo3conf/ext/qfq/qfq/api/delete.php",
refreshUrl: "typo3conf/ext/qfq/qfq/api/load.php",
fileUploadTo: "typo3conf/ext/qfq/qfq/api/upload.php",
pageState: new QfqNS.PageState()
}, settings
);
......@@ -55,6 +56,16 @@ if (!QfqNS) {
QfqNS.Log.error(e.message);
this.qfqForm = null;
}
try {
if (this.qfqForm) {
var sip = this.qfqForm.getSip();
this.fileUploader = new QfqNS.FileUpload('#' + this.settings.formId, this.settings.fileUploadTo, sip);
}
} catch (e) {
QfqNS.Log.error(e.message);
this.fileUploader = null;
}
};
/**
......
......@@ -93,6 +93,7 @@
<form id="myForm" class="form-horizontal">
<input type="hidden" name="s" value="badcaffee1234">
<div class="tab-content">
<!--pill: Person-->
......@@ -624,6 +625,18 @@
<!--pill: Arbeitsgruppe-->
<div role="tabpanel" class="tab-pane" id="arbeitsgruppe">
<div class="form-group">
<div class="col-md-2">
<label for="fileupload" class="control-label">File upload</label>
</div>
<div class="col-md-6">
<input id="fileupload" type="file" name="fileupload" class="form-control">
</div>
<div class=" col-md-4">
<p class="help-block"></p>
</div>
</div>
<!--Sekretariat fuer Arbeitsgruppe (subrecord)-->
<!--Arbeitsgruppe (subrecord)-->
</div>
......@@ -959,7 +972,8 @@
tabsId: 'myTabs',
formId: 'myForm',
submitTo: 'api/' + $("#submitTo").val(),
deleteUrl: 'api/' + $("#deleteUrl").val()
deleteUrl: 'api/' + $("#deleteUrl").val(),
fileUploadTo: 'api/uploadhandler.php'
});
$("#submitTo").on("change", function (evt) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment