diff options
-rw-r--r-- | css/admin.scss | 3 | ||||
-rw-r--r-- | lib/Controller/SettingsController.php | 7 | ||||
-rw-r--r-- | lib/Settings/Admin.php | 49 | ||||
-rw-r--r-- | src/admin.js | 35 | ||||
-rw-r--r-- | src/components/AdminSettings.vue | 233 | ||||
-rw-r--r-- | templates/admin.php | 53 |
6 files changed, 247 insertions, 133 deletions
diff --git a/css/admin.scss b/css/admin.scss index 423e0036..fc3e9391 100644 --- a/css/admin.scss +++ b/css/admin.scss @@ -3,9 +3,6 @@ } #richdocuments { - input[name='wopi_url'] { - width: 300px; - } #use_group_select, #edit_group_select { width: 200px; display: block; } diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 2aeab1b4..45f6ed28 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -168,7 +168,12 @@ class SettingsController extends Controller{ } } } catch (\Exception $e){ - // Ignore + if ($wopi_url !== null) { + return new JSONResponse([ + 'status' => 'error', + 'data' => ['message' => 'Failed to connect to the remote server'] + ], 500); + } } $this->capabilitiesService->clear(); diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index b50d893f..08aa8640 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -27,6 +27,7 @@ use OCA\Richdocuments\AppConfig; use OCA\Richdocuments\Capabilities; use OCA\Richdocuments\TemplateManager; use OCP\AppFramework\Http\TemplateResponse; +use OCP\Http\Client\IClientService; use OCP\IConfig; use OCP\Settings\ISettings; @@ -44,6 +45,9 @@ class Admin implements ISettings { /** @var array */ private $capabilities; + /** @var IClientService */ + private $clientService; + /** * Admin template settings * @@ -51,33 +55,42 @@ class Admin implements ISettings { * @param TemplateManager $manager * @param Capabilities $capabilities */ - public function __construct(IConfig $config, - AppConfig $appConfig, - TemplateManager $manager, - Capabilities $capabilities) { + public function __construct( + IConfig $config, + AppConfig $appConfig, + TemplateManager $manager, + Capabilities $capabilities, + IClientService $clientService + ) { $this->config = $config; $this->appConfig = $appConfig; $this->manager = $manager; $this->capabilities = $capabilities->getCapabilities()['richdocuments']; + $this->clientService = $clientService; } /** * @return TemplateResponse */ public function getForm() { + $demoServers = []; + return new TemplateResponse( 'richdocuments', 'admin', [ - 'wopi_url' => $this->config->getAppValue('richdocuments', 'wopi_url'), - 'edit_groups' => $this->config->getAppValue('richdocuments', 'edit_groups'), - 'use_groups' => $this->config->getAppValue('richdocuments', 'use_groups'), - 'doc_format' => $this->config->getAppValue('richdocuments', 'doc_format'), - 'external_apps' => $this->config->getAppValue('richdocuments', 'external_apps'), - 'canonical_webroot' => $this->config->getAppValue('richdocuments', 'canonical_webroot'), - 'disable_certificate_verification' => $this->config->getAppValue('richdocuments', 'disable_certificate_verification'), - 'templates' => $this->manager->getSystemFormatted(), - 'templatesAvailable' => array_key_exists('templates', $this->capabilities) && $this->capabilities['templates'], - 'settings' => $this->appConfig->getAppSettings(), + 'settings' => [ + 'wopi_url' => $this->config->getAppValue('richdocuments', 'wopi_url'), + 'edit_groups' => $this->config->getAppValue('richdocuments', 'edit_groups'), + 'use_groups' => $this->config->getAppValue('richdocuments', 'use_groups'), + 'doc_format' => $this->config->getAppValue('richdocuments', 'doc_format'), + 'external_apps' => $this->config->getAppValue('richdocuments', 'external_apps'), + 'canonical_webroot' => $this->config->getAppValue('richdocuments', 'canonical_webroot'), + 'disable_certificate_verification' => $this->config->getAppValue('richdocuments', 'disable_certificate_verification', '') !== '', + 'templates' => $this->manager->getSystemFormatted(), + 'templatesAvailable' => array_key_exists('templates', $this->capabilities) && $this->capabilities['templates'], + 'settings' => $this->appConfig->getAppSettings(), + 'demo_servers' => $this->fetchDemoServers() + ] ], 'blank' ); @@ -99,4 +112,12 @@ class Admin implements ISettings { return 0; } + private function fetchDemoServers() { + // FIXME: add caching + $demoServerList = 'http://col.la/nextclouddemoservers'; + $client = $this->clientService->newClient(); + $response = $client->get($demoServerList); + return json_decode($response->getBody(), true)['servers'] ?? []; + } + } diff --git a/src/admin.js b/src/admin.js index 150c2916..e5203398 100644 --- a/src/admin.js +++ b/src/admin.js @@ -49,21 +49,6 @@ const documentsSettings = { return app1 }, - save: function() { - $('#wopi_apply, #disable_certificate_verification').attr('disabled', true) - var data = { - wopi_url: $('#wopi_url').val().replace(/\/$/, ''), - disable_certificate_verification: document.getElementById('disable_certificate_verification').checked - } - - OC.msg.startAction('#documents-admin-msg', t('richdocuments', 'Saving…')) - $.post( - OC.filePath('richdocuments', 'ajax', 'admin.php'), - data, - documentsSettings.afterSave - ) - }, - saveGroups: function(data) { $.post( OC.filePath('richdocuments', 'ajax', 'admin.php'), @@ -78,11 +63,6 @@ const documentsSettings = { ) }, - afterSave: function(response) { - $('#wopi_apply, #disable_certificate_verification').attr('disabled', false) - OC.msg.finishedAction('#documents-admin-msg', response) - }, - saveExternalApps: function(externalAppsData) { var data = { 'external_apps': externalAppsData @@ -148,9 +128,7 @@ const documentsSettings = { documentsSettings.initGroups() documentsSettings.initExternalApps() - var page = $('#richdocuments') - - $('#wopi_apply').on('click', documentsSettings.save) + var page = $('#richdocuments-advanced') // destroy or create app name and token fields depending on whether the checkbox is on or off $(document).on('change', '#enable_external_apps_cb-richdocuments', function() { @@ -208,17 +186,6 @@ const documentsSettings = { $('#external-apps-section').append(app1) }) - $(document).on('click', '#test_wopi_apply', function() { - var groups = page.find('#test_server_group_select').val() - var testserver = page.find('#test_wopi_url').val() - - if (groups !== '' && testserver !== '') { - documentsSettings.saveTestWopi(groups, testserver) - } else { - OC.msg.finishedError('#test-documents-admin-msg', 'Both fields required') - } - }) - $(document).on('change', '.doc-format-ooxml', function() { var ooxml = this.checked documentsSettings.saveDocFormat(ooxml ? 'ooxml' : 'odf') diff --git a/src/components/AdminSettings.vue b/src/components/AdminSettings.vue index c7d1ba67..0716ad4e 100644 --- a/src/components/AdminSettings.vue +++ b/src/components/AdminSettings.vue @@ -21,52 +21,118 @@ --> <template> - <div class="section"> - <h2>Secure view settings</h2> - - <p>{{ t('richdocuments', 'Secure view enables you to secure documents by embedding a watermark') }}</p> - <settings-checkbox v-model="settings.watermark.enabled" label="Enable watermarking" hint="" - :disabled="updating" @input="update" /> - <settings-input-text v-if="settings.watermark.enabled" v-model="settings.watermark.text" label="Watermark text" - :hint="t('richdocuments', 'Supported placeholders: {userId}, {date}')" - :disabled="updating" @update="update" /> - <div v-if="settings.watermark.enabled"> - <settings-checkbox v-model="settings.watermark.allTags" label="Show watermark on tagged files" :disabled="updating" - @input="update" /> - <p v-if="settings.watermark.allTags" class="checkbox-details"> - <settings-select-tag v-model="settings.watermark.allTagsList" label="Select tags to enforce watermarking" @input="update" /> - </p> - <settings-checkbox v-model="settings.watermark.allGroups" label="Show watermark for users of groups" :disabled="updating" - @input="update" /> - <p v-if="settings.watermark.allGroups" class="checkbox-details"> - <settings-select-group v-model="settings.watermark.allGroupsList" label="Select tags to enforce watermarking" @input="update" /> - </p> - <settings-checkbox v-model="settings.watermark.shareAll" label="Show watermark for all shares" hint="" - :disabled="updating" @input="update" /> - <settings-checkbox v-if="!settings.watermark.shareAll" v-model="settings.watermark.shareRead" label="Show watermark for read only shares" - hint="" - :disabled="updating" @input="update" /> + <div> + <div class="section"> + <h2>Collabora Online</h2> + <p>{{ t('richdocuments', 'Collabora Online is a powerful LibreOffice-based online office suite with collaborative editing, which supports all major documents, spreadsheet and presentation file formats and works together with all modern browsers.') }}</p> - <h3>Link shares</h3> - <settings-checkbox v-model="settings.watermark.linkAll" label="Show watermark for all link shares" hint="" - :disabled="updating" @input="update" /> - <settings-checkbox v-if="!settings.watermark.linkAll" v-model="settings.watermark.linkSecure" label="Show watermark for download hidden shares" - hint="" - :disabled="updating" @input="update" /> - <settings-checkbox v-if="!settings.watermark.linkAll" v-model="settings.watermark.linkRead" label="Show watermark for read only link shares" - hint="" - :disabled="updating" @input="update" /> - <settings-checkbox v-if="!settings.watermark.linkAll" v-model="settings.watermark.linkTags" label="Show watermark on link shares with specific system tags" + <div v-if="settings.wopi_url !== ''"> + <div v-if="serverError == 2" id="security-warning-state-failure"> + <span class="icon icon-close-white" /><span class="message">Could not establish connection to the Collabora Online server.</span> + </div> + <div v-else-if="serverError == 1" id="security-warning-state-failure"> + <span class="icon icon-loading" /><span class="message">Settings new server</span> + </div> + <div v-else id="security-warning-state-ok"> + <span class="icon icon-checkmark-white" /><span class="message">Collabora Online server is reachable.</span> + </div> + </div> + <div v-else id="security-warning-state-warning"> + <span class="icon icon-error-white" /><span class="message">Please configure a Collabora Online server to start editing documents</span> + </div> + + <fieldset> + <div> + <input id="customserver" v-model="serverMode" type="radio" + name="serverMode" value="custom" class="radio" + :disabled="updating"> + <label for="customserver">Use your own server</label><br> + <p class="option-inline"> + <em>{{ t('richdocuments', 'Collabora Online requires a seperate server acting as a WOPI-like Client to provide editing capabilities.') }}</em> + </p> + <div v-if="serverMode === 'custom'" class="option-inline"> + <form @submit="updateServer"> + <p> + <label for="wopi_url">URL (and Port) of Collabora Online-server</label><br> + <input id="wopi_url" v-model="settings.wopi_url" type="text" + :disabled="updating"> + <input type="submit" value="Save" :disabled="updating" + @click="updateServer"><br> + </p> + <p> + <input id="disable_certificate_verification" v-model="settings.disable_certificate_verification" type="checkbox" + class="checkbox" :disabled="updating" @change="updateServer"> + <label for="disable_certificate_verification">{{ t('richdocuments', 'Disable certificate verification (insecure)') }}</label><br> + <em>{{ t('Enable if your Collabora Online server uses a self signed certificate') }}</em> + </p> + </form> + </div> + </div> + <div> + <input id="demoserver" v-model="serverMode" type="radio" + name="serverMode" value="demo" class="radio" + :disabled="updating"> + <label for="demoserver">Use a demo server</label><br> + <div class="option-inline"> + <p><em>{{ t('richdocuments', 'You can use a demo server provided by Collabora and other service providers for giving Collabora Online a try.') }}</em></p> + <p> + <multiselect v-if="serverMode === 'demo'" v-model="settings.demoUrl" :custom-label="demoServerLabel" + track-by="demo_url" label="demo_url" placeholder="Select a demo server" + :options="demoServers" :searchable="false" :allow-empty="false" + :disabled="updating" @input="setDemoServer" /> + </p> + </div> + </div> + </fieldset> + </div> + + <div id="secure-view-settings" class="section"> + <h2>{{ t('richdocuments', 'Secure view settings') }}</h2> + <p>{{ t('richdocuments', 'Secure view enables you to secure documents by embedding a watermark') }}</p> + <settings-checkbox v-model="settings.watermark.enabled" label="Enable watermarking" hint="" :disabled="updating" @input="update" /> - <p v-if="!settings.watermark.linkAll && settings.watermark.linkTags" class="checkbox-details"> - <settings-select-tag v-model="settings.watermark.linkTagsList" label="Select tags to enforce watermarking" @input="update" /> - </p> + <settings-input-text v-if="settings.watermark.enabled" v-model="settings.watermark.text" label="Watermark text" + :hint="t('richdocuments', 'Supported placeholders: {userId}, {date}')" + :disabled="updating" @update="update" /> + <div v-if="settings.watermark.enabled"> + <settings-checkbox v-model="settings.watermark.allTags" label="Show watermark on tagged files" :disabled="updating" + @input="update" /> + <p v-if="settings.watermark.allTags" class="checkbox-details"> + <settings-select-tag v-model="settings.watermark.allTagsList" label="Select tags to enforce watermarking" @input="update" /> + </p> + <settings-checkbox v-model="settings.watermark.allGroups" label="Show watermark for users of groups" :disabled="updating" + @input="update" /> + <p v-if="settings.watermark.allGroups" class="checkbox-details"> + <settings-select-group v-model="settings.watermark.allGroupsList" label="Select tags to enforce watermarking" @input="update" /> + </p> + <settings-checkbox v-model="settings.watermark.shareAll" label="Show watermark for all shares" hint="" + :disabled="updating" @input="update" /> + <settings-checkbox v-if="!settings.watermark.shareAll" v-model="settings.watermark.shareRead" label="Show watermark for read only shares" + hint="" + :disabled="updating" @input="update" /> + + <h3>Link shares</h3> + <settings-checkbox v-model="settings.watermark.linkAll" label="Show watermark for all link shares" hint="" + :disabled="updating" @input="update" /> + <settings-checkbox v-if="!settings.watermark.linkAll" v-model="settings.watermark.linkSecure" label="Show watermark for download hidden shares" + hint="" + :disabled="updating" @input="update" /> + <settings-checkbox v-if="!settings.watermark.linkAll" v-model="settings.watermark.linkRead" label="Show watermark for read only link shares" + hint="" + :disabled="updating" @input="update" /> + <settings-checkbox v-if="!settings.watermark.linkAll" v-model="settings.watermark.linkTags" label="Show watermark on link shares with specific system tags" + :disabled="updating" @input="update" /> + <p v-if="!settings.watermark.linkAll && settings.watermark.linkTags" class="checkbox-details"> + <settings-select-tag v-model="settings.watermark.linkTagsList" label="Select tags to enforce watermarking" @input="update" /> + </p> + </div> </div> </div> </template> <script> import Vue from 'vue' +import { Multiselect } from 'nextcloud-vue' import axios from 'nextcloud-axios' import SettingsCheckbox from './SettingsCheckbox' import SettingsInputText from './SettingsInputText' @@ -74,13 +140,18 @@ import SettingsSelectTag from './SettingsSelectTag' import SettingsSelectGroup from './SettingsSelectGroup' import { generateUrl } from 'nextcloud-router' +const SERVER_STATE_OK = 0 +const SERVER_STATE_LOADING = 1 +const SERVER_STATE_CONNECTION_ERROR = 2 + export default { name: 'AdminSettings', components: { SettingsCheckbox, SettingsInputText, SettingsSelectTag, - SettingsSelectGroup + SettingsSelectGroup, + Multiselect }, props: { initial: { @@ -90,10 +161,14 @@ export default { }, data() { return { + serverMode: 'custom', + serverError: SERVER_STATE_OK, updating: false, groups: [], tags: [], settings: { + demoUrl: null, + wopi_url: null, watermark: { enabled: false, shareAll: false, @@ -112,21 +187,27 @@ export default { } } }, + computed: { + demoServers() { + return this.initial.demo_servers + } + }, beforeMount() { - for (let key in this.initial) { - if (!this.initial.hasOwnProperty(key)) { + for (let key in this.initial.settings) { + if (!this.initial.settings.hasOwnProperty(key)) { continue } let [ parent, setting ] = key.split('_') if (parent === 'watermark') { - Vue.set(this.settings[parent], setting, this.initial[key]) + Vue.set(this.settings[parent], setting, this.initial.settings[key]) } else { - Vue.set(this.settings, key, this.initial[key]) + Vue.set(this.settings, key, this.initial.settings[key]) } } - Vue.set(this.settings, 'data', this.initial) + Vue.set(this.settings, 'data', this.initial.settings) + this.checkIfDemoServerIsActive() }, methods: { update() { @@ -139,12 +220,47 @@ export default { OC.Notification.showTemporary('Failed to save settings') console.error(error) }) + }, + async updateServer() { + const data = { + wopi_url: this.settings.wopi_url, + disable_certificate_verification: this.settings.disable_certificate_verification + } + this.serverError = SERVER_STATE_LOADING + this.updating = true + + try { + await axios.post( + OC.filePath('richdocuments', 'ajax', 'admin.php'), + data + ) + this.serverError = SERVER_STATE_OK + } catch (e) { + console.error(e) + this.serverError = SERVER_STATE_CONNECTION_ERROR + } + this.updating = false + this.checkIfDemoServerIsActive() + }, + checkIfDemoServerIsActive() { + this.settings.demoUrl = this.initial.demo_servers.find((server) => server.demo_url === this.settings.wopi_url) + if (this.settings.demoUrl) { + this.serverMode = 'demo' + } + }, + demoServerLabel(server) { + return `${server.provider_name} — ${server.provider_location}` + }, + async setDemoServer(server) { + this.settings.wopi_url = server.demo_url + this.settings.disable_certificate_verification = false + await this.updateServer() } } } </script> -<style scoped> +<style lang="scss" scoped> p { margin-bottom: 15px; } @@ -153,9 +269,34 @@ export default { margin-top: -10px; margin-bottom: 20px; } - input, + + input[type='text'], .multiselect { width: 100%; max-width: 400px; } + + input#wopi_url { + width: 300px; + } + + #secure-view-settings { + margin-top: 20px; + } + + .section { + border-bottom: 1px solid var(--color-border); + } + + #security-warning-state-failure, + #security-warning-state-warning, + #security-warning-state-ok { + margin-top: 10px; + margin-bottom: 20px; + } + + .option-inline { + margin-left: 25px; + margin-top: 10px; + } </style> diff --git a/templates/admin.php b/templates/admin.php index 66913fc3..e36ec123 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -5,54 +5,38 @@ script('files', 'jquery.fileupload'); /** @var array $_ */ ?> -<div class="section" id="richdocuments"> +<div id="admin-vue" data-initial="<?php p(json_encode($_['settings'], true)); ?>"></div> + +<div class="section" id="richdocuments-advanced"> + <h2> - <?php p($l->t('Collabora Online')) ?> + <?php p($l->t('Advanced Settings')) ?> </h2> <p> - <em><?php p($l->t('Collabora Online is a powerful LibreOffice-based online office suite with collaborative editing, which supports all major documents, spreadsheet and presentation file formats and works together with all modern browsers.')) ?></em> - </p> - <p> - <label for="wopi_url"><?php p($l->t('URL (and Port) of Collabora Online-server')) ?></label> - <br /> - <input type="text" name="wopi_url" id="wopi_url" placeholder="https://office.example.org:9980" value="<?php p($_['wopi_url'])?>"><button type="button" id="wopi_apply"><?php p($l->t('Apply')) ?></button> - <span id="documents-admin-msg" class="msg"></span> - <br /> - <em><?php p($l->t('Collabora Online requires a seperate server acting as a WOPI-like Client to provide editing capabilities.')) ?></em> - </p> - <p> - <input type="checkbox" class="checkbox" id="disable_certificate_verification" <?php p($_['disable_certificate_verification'] === 'yes' ? 'checked' : '') ?> /> - <label for="disable_certificate_verification"><?php p($l->t('Disable certificate verification (insecure)')) ?></label><br /> - <em><?php p($l->t('Enable if your Collabora Online server uses a self signed certificate')) ?></em> - </p> - <p> <input type="checkbox" class="use-groups-enable checkbox" id="use_groups_enable-richdocuments" /> <label for="use_groups_enable-richdocuments"><?php p($l->t('Restrict usage to specific groups')) ?></label> <br/> <em><?php p($l->t('Collabora Online is enabled for all users by default. When this setting is active, only members of the specified groups can use it.')) ?></em><br /> - <input type="hidden" id="use_group_select" value="<?php p($_['use_groups'])?>" title="<?php p($l->t('All')); ?>"> + <input type="hidden" id="use_group_select" value="<?php p($_['settings']['use_groups'])?>" title="<?php p($l->t('All')); ?>"> </p> <p> <input type="checkbox" class="edit-groups-enable checkbox" id="edit_groups_enable-richdocuments" /> <label for="edit_groups_enable-richdocuments"><?php p($l->t('Restrict edit to specific groups')) ?></label> <br/> <em><?php p($l->t('All users can edit documents with Collabora Online by default. When this setting is active, only the members of the specified groups can edit and the others can only view documents.')) ?></em><br /> - <input type="hidden" id="edit_group_select" value="<?php p($_['edit_groups'])?>" title="<?php p($l->t('All')); ?>"> + <input type="hidden" id="edit_group_select" value="<?php p($_['settings']['edit_groups'])?>" title="<?php p($l->t('All')); ?>"> </p> - <h3> - <?php p($l->t('Advanced Settings')) ?> - </h3> <p> - <input type="checkbox" class="doc-format-ooxml checkbox" id="doc_format_ooxml_enable-richdocuments" <?php p($_['doc_format'] === 'ooxml' ? 'checked' : '') ?> /> + <input type="checkbox" class="doc-format-ooxml checkbox" id="doc_format_ooxml_enable-richdocuments" <?php p($_['settings']['doc_format'] === 'ooxml' ? 'checked' : '') ?> /> <label for="doc_format_ooxml_enable-richdocuments"><?php p($l->t('Use Office Open XML (OOXML) instead of OpenDocument Format (ODF) by default for new files')) ?></label> </p> <p> - <input type="checkbox" class="checkbox" id="enable_external_apps_cb-richdocuments" <?php p($_['external_apps'] !== '' ? 'checked' : '') ?> /> + <input type="checkbox" class="checkbox" id="enable_external_apps_cb-richdocuments" <?php p($_['settings']['external_apps'] !== '' ? 'checked' : '') ?> /> <label for="enable_external_apps_cb-richdocuments"><?php p($l->t('Enable access for external apps')) ?></label> - <div id="enable-external-apps-section" class="indent <?php if ($_['external_apps'] === '') p('hidden') ?>" > + <div id="enable-external-apps-section" class="indent <?php if ($_['settings']['external_apps'] === '') p('hidden') ?>" > <div id="external-apps-section"> - <input type="hidden" id="external-apps-raw" name="external-apps-raw" value="<?php p($_['external_apps']) ?>"> + <input type="hidden" id="external-apps-raw" name="external-apps-raw" value="<?php p($_['settings']['external_apps']) ?>"> </div> <button type="button" id="external-apps-save-button"><?php p($l->t('Save')) ?></button> @@ -61,30 +45,30 @@ script('files', 'jquery.fileupload'); </div> </p> <p> - <input type="checkbox" class="checkbox" id="enable_canonical_webroot_cb-richdocuments" <?php p($_['canonical_webroot'] !== '' ? 'checked' : '') ?> /> + <input type="checkbox" class="checkbox" id="enable_canonical_webroot_cb-richdocuments" <?php p($_['settings']['canonical_webroot'] !== '' ? 'checked' : '') ?> /> <label for="enable_canonical_webroot_cb-richdocuments"><?php p($l->t('Use Canonical webroot')) ?></label> - <div id="enable-canonical-webroot-section" class="indent <?php if ($_['canonical_webroot'] === '') p('hidden') ?>" > - <input type="text" id="canonical-webroot" name="canonical-webroot-name" value="<?php p($_['canonical_webroot']) ?>"> + <div id="enable-canonical-webroot-section" class="indent <?php if ($_['settings']['canonical_webroot'] === '') p('hidden') ?>" > + <input type="text" id="canonical-webroot" name="canonical-webroot-name" value="<?php p($_['settings']['canonical_webroot']) ?>"> <br/> <p class="rd-settings-documentation"><em><?php p($l->t('Canonical webroot, in case there are multiple, for Collabora to use. Provide the one with least restrictions. Eg: Use non-shibbolized webroot if this instance is accessed by both shibbolized and non-shibbolized webroots. You can ignore this setting if only one webroot is used to access this instance.')) ?></em></p> </div> </p> </div> -<?php if ($_['templatesAvailable'] === true) { ?> +<?php if ($_['settings']['templatesAvailable'] === true) { ?> <form class="section" id="richdocuments-templates" method="post" action="/template/"> <input class="hidden-visually" id="add-template" type="file" /> <h2> <?php p($l->t('Global templates')) ?> <label for="add-template" class="icon-add" title="<?php p($l->t('Add a new template')); ?>"></label> </h2> - <div id="emptycontent" class="<?php p(empty($_['templates'])?:'hidden') ?>"> + <div id="emptycontent" class="<?php p(empty($_['settings']['templates'])?:'hidden') ?>"> <div class="icon-file"></div> <h2> <?php p($l->t('No templates defined.')); ?> </h2> <label for="add-template"><?php p($l->t('Add a new one?')); ?></label> </div> - <ul class="<?php p(!empty($_['templates'])?:'hidden') ?>"> + <ul class="<?php p(!empty($_['settings']['templates'])?:'hidden') ?>"> <li class="hidden template-model"> <figure> <img src="" alt="<?php p($l->t('template preview')) ?>" /> @@ -93,7 +77,7 @@ script('files', 'jquery.fileupload'); <a href="" class="delete-template icon-delete"></a> <div class="delete-cover"></div> </li> - <?php foreach ($_['templates'] as $template) {?> + <?php foreach ($_['settings']['templates'] as $template) {?> <li> <figure> <?php if (isset($template['preview'])) { ?> @@ -111,4 +95,3 @@ script('files', 'jquery.fileupload'); </form> <?php } ?> -<div id="admin-vue" data-initial="<?php p(json_encode($_['settings'], true)); ?>"></div> |