Do not load previews when they are disabled. Ref #425
This commit is contained in:
parent
4865408bb4
commit
453d6760fb
@ -41,11 +41,12 @@ namespace OCA\Documents;
|
|||||||
|
|
||||||
$tmpl = new \OCP\Template('documents', 'documents', 'user');
|
$tmpl = new \OCP\Template('documents', 'documents', 'user');
|
||||||
|
|
||||||
|
$previewsEnabled = \OC::$server->getConfig()->getSystemValue('enable_previews', false);
|
||||||
$unstable = \OCP\Config::getAppValue('documents', 'unstable', 'false');
|
$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('enable_previews', $previewsEnabled);
|
||||||
$tmpl->assign('useUnstable', $unstable);
|
$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));
|
||||||
|
@ -70,7 +70,9 @@ $.widget('oc.documentGrid', {
|
|||||||
}(a);
|
}(a);
|
||||||
ready(previewURL);
|
ready(previewURL);
|
||||||
};
|
};
|
||||||
|
if ( $('#previews_enabled').length ) {
|
||||||
img.src = previewURL;
|
img.src = previewURL;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_load : function (){
|
_load : function (){
|
||||||
|
@ -35,4 +35,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" id="webodf-unstable" value="<?php p($_['useUnstable']) ?>" />
|
<input type="hidden" id="webodf-unstable" value="<?php p($_['useUnstable']) ?>" />
|
||||||
|
<?php if ($_['enable_previews']): ?>
|
||||||
|
<input type="hidden" id="previews_enabled" value="<?php p($_['enable_previews']) ?>" />
|
||||||
|
<?php endif; ?>
|
||||||
<input type="hidden" name="allowShareWithLink" id="allowShareWithLink" value="<?php p($_['allowShareWithLink']) ?>" />
|
<input type="hidden" name="allowShareWithLink" id="allowShareWithLink" value="<?php p($_['allowShareWithLink']) ?>" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user