Fix switching to unstable mode
This commit is contained in:
parent
f4f11678d8
commit
6afe897884
@ -40,9 +40,12 @@ namespace OCA\Documents;
|
|||||||
|
|
||||||
$tmpl = new \OCP\Template('documents', 'documents', 'user');
|
$tmpl = new \OCP\Template('documents', 'documents', 'user');
|
||||||
|
|
||||||
|
$unstable = \OCP\Config::getAppValue('documents', 'unstable', 'false');
|
||||||
$maxUploadFilesize = \OCP\Util::maxUploadFilesize("/");
|
$maxUploadFilesize = \OCP\Util::maxUploadFilesize("/");
|
||||||
$savePath = \OCP\Config::getUserValue(\OCP\User::getUser(), 'documents', 'save_path', '/');
|
$savePath = \OCP\Config::getUserValue(\OCP\User::getUser(), 'documents', 'save_path', '/');
|
||||||
|
|
||||||
|
|
||||||
|
$tmpl->assign('useUnstable', $unstable);
|
||||||
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
|
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
|
||||||
$tmpl->assign('uploadMaxHumanFilesize', \OCP\Util::humanFileSize($maxUploadFilesize));
|
$tmpl->assign('uploadMaxHumanFilesize', \OCP\Util::humanFileSize($maxUploadFilesize));
|
||||||
$tmpl->assign('savePath', $savePath);
|
$tmpl->assign('savePath', $savePath);
|
||||||
|
@ -88,6 +88,7 @@ var documentsMain = {
|
|||||||
|
|
||||||
onStartup: function() {
|
onStartup: function() {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
documentsMain.useUnstable = $('#webodf-unstable').val()==='true';
|
||||||
documentsMain.UI.init();
|
documentsMain.UI.init();
|
||||||
|
|
||||||
if (!OC.currentUser){
|
if (!OC.currentUser){
|
||||||
|
@ -14,14 +14,14 @@
|
|||||||
target="file_upload_target_1">
|
target="file_upload_target_1">
|
||||||
<?php if($_['uploadMaxFilesize'] >= 0):?>
|
<?php if($_['uploadMaxFilesize'] >= 0):?>
|
||||||
<input type="hidden" name="MAX_FILE_SIZE" id="max_upload"
|
<input type="hidden" name="MAX_FILE_SIZE" id="max_upload"
|
||||||
value="<?php p($_['uploadMaxFilesize']) ?>">
|
value="<?php p($_['uploadMaxFilesize']) ?>" />
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
<!-- Send the requesttoken, this is needed for older IE versions
|
<!-- Send the requesttoken, this is needed for older IE versions
|
||||||
because they don't send the CSRF token via HTTP header in this case -->
|
because they don't send the CSRF token via HTTP header in this case -->
|
||||||
<input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" id="requesttoken">
|
<input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" id="requesttoken" />
|
||||||
<input type="hidden" class="max_human_file_size"
|
<input type="hidden" class="max_human_file_size"
|
||||||
value="(max <?php p($_['uploadMaxHumanFilesize']); ?>)">
|
value="(max <?php p($_['uploadMaxHumanFilesize']); ?>)" />
|
||||||
<input type="hidden" name="dir" value="<?php p($_['savePath']) ?>" id="dir">
|
<input type="hidden" name="dir" value="<?php p($_['savePath']) ?>" id="dir" />
|
||||||
<input type="file" id="file_upload_start" name='files[]' />
|
<input type="file" id="file_upload_start" name='files[]' />
|
||||||
<a href="#" class="upload svg">
|
<a href="#" class="upload svg">
|
||||||
<label><?php p('Upload') ?></label></a>
|
<label><?php p('Upload') ?></label></a>
|
||||||
@ -33,3 +33,4 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<input type="hidden" id="webodf-unstable" value="<?php p($_['useUnstable']) ?>" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user