Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>tags/v15.0.0beta1
// TODO: move this to the generated config.js | // TODO: move this to the generated config.js | ||||
$publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes'); | $publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes'); | ||||
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', true); | $showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', true); | ||||
$isIE = \OCP\Util::isIE(); | |||||
// renders the controls and table headers template | // renders the controls and table headers template | ||||
$tmpl = new OCP\Template('files', 'list', ''); | $tmpl = new OCP\Template('files', 'list', ''); | ||||
$tmpl->assign('publicUploadEnabled', $publicUploadEnabled); | $tmpl->assign('publicUploadEnabled', $publicUploadEnabled); | ||||
$tmpl->assign('showgridview', $showgridview); | |||||
// gridview not available for ie | |||||
$tmpl->assign('showgridview', $showgridview && !$isIE); | |||||
$tmpl->assign('isIE', $isIE); | |||||
$tmpl->printPage(); | $tmpl->printPage(); | ||||
<?php endif;?> | <?php endif;?> | ||||
<input type="hidden" class="max_human_file_size" | <input type="hidden" class="max_human_file_size" | ||||
value="(max <?php isset($_['uploadMaxHumanFilesize']) ? p($_['uploadMaxHumanFilesize']) : ''; ?>)"> | value="(max <?php isset($_['uploadMaxHumanFilesize']) ? p($_['uploadMaxHumanFilesize']) : ''; ?>)"> | ||||
<!-- IF NOT IE, SHOW GRIDVIEW --> | |||||
<?php if (!$_['isIE']) { ?> | |||||
<input type="checkbox" class="hidden-visually" id="showgridview" | <input type="checkbox" class="hidden-visually" id="showgridview" | ||||
<?php if($_['showgridview']) { ?>checked="checked" <?php } ?>/> | <?php if($_['showgridview']) { ?>checked="checked" <?php } ?>/> | ||||
<label id="view-toggle" for="showgridview" class="button <?php p($_['showgridview'] ? 'icon-toggle-filelist' : 'icon-toggle-pictures') ?>" | <label id="view-toggle" for="showgridview" class="button <?php p($_['showgridview'] ? 'icon-toggle-filelist' : 'icon-toggle-pictures') ?>" | ||||
title="<?php p($l->t('Toggle grid view'))?>"></label> | title="<?php p($l->t('Toggle grid view'))?>"></label> | ||||
<?php } ?> | |||||
</div> | </div> | ||||
<div id="emptycontent" class="hidden"> | <div id="emptycontent" class="hidden"> |
display: flex; | display: flex; | ||||
height: 36px; | height: 36px; | ||||
width: 36px; | width: 36px; | ||||
padding: 9px; // width - border - icon width = 18px | |||||
align-items: center; | align-items: center; | ||||
justify-content: center; | justify-content: center; | ||||
} | } |
multiselect = false; | multiselect = false; | ||||
} | } | ||||
// No grid for IE! | |||||
if (OC.Util.isIE()) { | |||||
self.$filePicker.find('#picker-view-toggle').remove(); | |||||
self.$filePicker.find('#filestable').removeClass('view-grid'); | |||||
} | |||||
$('body').append(self.$filePicker); | $('body').append(self.$filePicker); | ||||
self.$showGridView = $('input#picker-showgridview'); | self.$showGridView = $('input#picker-showgridview'); | ||||
self.$showGridView.on('change', _.bind(self._onGridviewChange, self)); | self.$showGridView.on('change', _.bind(self._onGridviewChange, self)); | ||||
self._getGridSettings(); | |||||
if (!OC.Util.isIE()) { | |||||
self._getGridSettings(); | |||||
} | |||||
self.$filePicker.ready(function() { | self.$filePicker.ready(function() { | ||||
self.$filelist = self.$filePicker.find('.filelist tbody'); | self.$filelist = self.$filePicker.find('.filelist tbody'); |