diff --git a/app/views/contents/courseware/courseware.php b/app/views/contents/courseware/courseware.php index b2f484744db3d40ba13854fda1f8bb374b23546a..b50a96370144bbbf4cf8978a10ed934057d382a7 100644 --- a/app/views/contents/courseware/courseware.php +++ b/app/views/contents/courseware/courseware.php @@ -1,9 +1,8 @@ -<div +<div id="courseware-index-app" entry-element-id="<?= $entry_element_id ?>" entry-type="users" entry-id="<?= $user_id ?>" oer-enabled='<?= $oer_enabled ?>' - oer-title="<?= Config::get()->OER_TITLE ?>" licenses='<?= $licenses ?>' > </div> diff --git a/app/views/course/courseware/index.php b/app/views/course/courseware/index.php index 8f372d26763131a62a5de888d0d2539021f3e164..518f765a3c09103c408db98ac63c4edaefd75c54 100644 --- a/app/views/course/courseware/index.php +++ b/app/views/course/courseware/index.php @@ -4,7 +4,6 @@ entry-type="courses" entry-id="<?= Context::getId() ?>" oer-enabled="<?= Config::get()->OERCAMPUS_ENABLED?>" - oer-title="<?= Config::get()->OER_TITLE ?>" licenses='<?= $licenses ?>' > -</div> \ No newline at end of file +</div> diff --git a/app/views/file/add_files_window.php b/app/views/file/add_files_window.php index cefd7a897e25e1a33d046a70e787a0d21808b100..0973ed8e647cdab93194af85cd36388cfa5d9ebe 100644 --- a/app/views/file/add_files_window.php +++ b/app/views/file/add_files_window.php @@ -17,7 +17,7 @@ if ($folder_id) { <div class="files_source_selector" data-folder_id="<?= htmlReady($folder_id) ?>" <? if ($hidden) echo ' style="display: none;"'; ?>> <h2 class="dialog-subtitle"><?= _('Quelle auswählen') ?></h2> <div class="file_select_possibilities"> - <? if ($range instanceof Course && !$range->getSemClass()['studygroup_mode'] && $GLOBALS['perm']->have_studip_perm('tutor', $range->id) + <? if ($range instanceof Course && !$range->getSemClass()['studygroup_mode'] && $GLOBALS['perm']->have_studip_perm('tutor', $range->id) && $GLOBALS['LIBRARY_CATALOGS'] && $show_library_functions && $library_search_description) : ?> <div> <a class="important-item" data-dialog="size=medium-43" @@ -66,7 +66,7 @@ if ($folder_id) { <a href="<?= $controller->link_for('oer/addfile/choose_file', array_merge($options, ['from_plugin' => ""])) ?>" data-dialog="size=800x800"> <?= Icon::create('oer-campus')->asImg(50) ?> - <?= htmlReady(Config::get()->OER_TITLE) ?> + <?= _('OER Campus') ?> </a> <? endif ?> <? foreach (PluginManager::getInstance()->getPlugins('FilesystemPlugin') as $plugin) : ?> diff --git a/app/views/oer/embed/_link.php b/app/views/oer/embed/_link.php index ff32f89381787189bfc55c95b807b46655b4f6ba..684a388a1da7cad266a00a2a5d9ed6cb5aa3e869 100644 --- a/app/views/oer/embed/_link.php +++ b/app/views/oer/embed/_link.php @@ -1,6 +1,6 @@ <div style="text-align: right;"> <a href="<?= URLHelper::getLink("dispatch.php/oer/market/details/{$id}") ?>" - title="<?= htmlReady(sprintf(_('Zum %s wechseln'), Config::get()->OER_TITLE)) ?>"> + title="<?= htmlReady(_('Zum OER Campus wechseln')) ?>"> <?= Icon::create('oer-campus')->asImg(['class' => 'text-bottom']) ?> <?= htmlReady($material['name']) ?> </a> diff --git a/app/views/oer/endpoints/index.php b/app/views/oer/endpoints/index.php index dfedc0160789148d3dec387255c965e9b0a0cb3c..794dfab1ceb5223536e1dde78d26b19c298b94c5 100644 --- a/app/views/oer/endpoints/index.php +++ b/app/views/oer/endpoints/index.php @@ -1,4 +1,4 @@ -<h1><?= htmlReady(Config::get()->OER_TITLE) ?></h1> +<h1><?= _('OER Campus') ?></h1> <h2><?= _('Version') ?></h2> <?= _('Stud.IP') ?>: <?= htmlReady($GLOBALS['SOFTWARE_VERSION']) ?> diff --git a/app/views/oer/market/abo.php b/app/views/oer/market/abo.php index 053873134acde694f999389b248377c15cd9066f..16dde466d34dd87d898188021da3a5dede1edeb3 100644 --- a/app/views/oer/market/abo.php +++ b/app/views/oer/market/abo.php @@ -5,7 +5,7 @@ <label> <input type="checkbox" name="abo" value="1"<?= $abo ? " checked" : "" ?>> - <?= sprintf(_('Ich möchte Nachrichten bekommen über neue Inhalte im %s'), Config::get()->OER_TITLE) ?> + <?= _('Ich möchte Nachrichten bekommen über neue Inhalte im OER Campus') ?> </label> <div data-dialog-button> diff --git a/db/migrations/5.3.2_remove_oer_title.php b/db/migrations/5.3.2_remove_oer_title.php new file mode 100644 index 0000000000000000000000000000000000000000..2df3e964870d29af458c2bc33a211d1e0b313b2b --- /dev/null +++ b/db/migrations/5.3.2_remove_oer_title.php @@ -0,0 +1,46 @@ +<?php + + +class RemoveOerTitle extends Migration +{ + public function description() + { + return 'Removes the option OER_TITLE from the config'; + } + + + public function up() + { + DBManager::get()->exec( + "DELETE FROM `config_values` + WHERE `field` = 'OER_TITLE'" + ); + DBManager::get()->exec( + "DELETE FROM `config` + WHERE `field` = 'OER_TITLE'" + ); + } + + + public function down() + { + $query = "INSERT INTO `config` + SET `field` = :field, + `value` = :value, + `type` = :type, + `range` = :range, + `section` = :section, + `mkdate` = UNIX_TIMESTAMP(), + `chdate` = UNIX_TIMESTAMP(), + `description` = :description"; + $config_statement = DBManager::get()->prepare($query); + $config_statement->execute([ + ':field' => 'OER_TITLE', + ':value' => 'OER Campus', + ':type' => 'string', + ':range' => 'global', + ':section' => 'OERCampus', + ':description' => 'Name des OER Campus in Stud.IP', + ]); + } +} diff --git a/lib/models/OERMaterial.php b/lib/models/OERMaterial.php index 7612f70f9853ad411cc6cb40333ea58016f8865e..9fb45d96bc3056520acbe8daaa2bc05d7f4f74f9 100644 --- a/lib/models/OERMaterial.php +++ b/lib/models/OERMaterial.php @@ -593,7 +593,7 @@ class OERMaterial extends SimpleORMap $statement->execute([$GLOBALS['user']->id]); $usernames = $statement->fetchAll(PDO::FETCH_COLUMN, 0); $messsaging = new messaging(); - $subject = sprintf(_("Neues Material im %s"), Config::get()->OER_TITLE); + $subject = _("Neues Material im OER Campus"); if ($this->users[0]) { $user_name = $this->users[0]['external_contact'] ? $this->users[0]['oeruser']['name'] @@ -603,9 +603,8 @@ class OERMaterial extends SimpleORMap } $oldbase = URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']); $message = sprintf( - _('%1$s hat soeben neues Material auf dem %2$s zur verfügung gestellt. Viel Spaß! <br> %3$s'), + _('%1$s hat soeben neues Material auf dem OER Campus zur verfügung gestellt. Viel Spaß! <br> %2$s'), $user_name, - Config::get()->OER_TITLE, URLHelper::getURL("dispatch.php/oer/market/details/".$this->getId()) ); URLHelper::setBaseURL($oldbase); @@ -620,7 +619,7 @@ class OERMaterial extends SimpleORMap $subject, '', 'normal', - [Config::get()->OER_TITLE], + [_('OER Campus')], false ); } diff --git a/lib/navigation/AdminNavigation.php b/lib/navigation/AdminNavigation.php index 2081af91aa6572448bc2c1a7e27fdfa32dcd71da..c208ffd9e38b6898317ef1091b3412d3b229f9fc 100644 --- a/lib/navigation/AdminNavigation.php +++ b/lib/navigation/AdminNavigation.php @@ -143,7 +143,7 @@ class AdminNavigation extends Navigation $navigation->addSubNavigation( 'oer', new Navigation( - Config::get()->OER_TITLE, + _('OER Campus'), URLHelper::getURL("dispatch.php/oer/admin/hosts") ) ); diff --git a/lib/navigation/OERNavigation.php b/lib/navigation/OERNavigation.php index 2e116137c9f17e1eb7c225817d0c7228630f0b1c..3fc03d4275fc3e008895ca43fd3c1f648be98501 100644 --- a/lib/navigation/OERNavigation.php +++ b/lib/navigation/OERNavigation.php @@ -23,9 +23,9 @@ class OERNavigation extends Navigation */ public function __construct() { - parent::__construct(Config::get()->OER_TITLE); + parent::__construct(_('OER Campus')); - $this->setImage(Icon::create('oer-campus', Icon::ROLE_NAVIGATION, ["title" => Config::get()->OER_TITLE])); + $this->setImage(Icon::create('oer-campus', Icon::ROLE_NAVIGATION, ["title" => _('OER Campus')])); } /** @@ -37,7 +37,7 @@ class OERNavigation extends Navigation global $perm; parent::initSubNavigation(); - $navigation = new Navigation(Config::get()->OER_TITLE, 'dispatch.php/oer/market'); + $navigation = new Navigation(_('OER Campus'), 'dispatch.php/oer/market'); $this->addSubNavigation('market', $navigation); if ($perm->have_perm('autor')) { diff --git a/resources/vue/components/courseware/CoursewareActionWidget.vue b/resources/vue/components/courseware/CoursewareActionWidget.vue index cc1738d55a129aa8dd88ba9bcd67161c1b8c07b7..a32c7491d17f5082111cf4fff385e69cec37acaa 100644 --- a/resources/vue/components/courseware/CoursewareActionWidget.vue +++ b/resources/vue/components/courseware/CoursewareActionWidget.vue @@ -44,7 +44,7 @@ </li> <li v-if="!isOwner" class="cw-action-widget-oer"> <button @click="suggestOER"> - <translate>Material für %{oerTitle} vorschlagen</translate> + <translate>Material für den OER Campus vorschlagen</translate> </button> </li> <li v-if="!isRoot && canEdit" class="cw-action-widget-trash"> diff --git a/resources/vue/components/courseware/CoursewareExportWidget.vue b/resources/vue/components/courseware/CoursewareExportWidget.vue index 2c821b735cdf66da5b26295b6d17f42bdb9cdd50..6dea7158198dc72f15e88e9dc67412948987a658 100644 --- a/resources/vue/components/courseware/CoursewareExportWidget.vue +++ b/resources/vue/components/courseware/CoursewareExportWidget.vue @@ -14,7 +14,7 @@ </li> <li v-if="showOer" class="cw-export-widget-oer"> <button @click="oerElement"> - <translate>Seite auf %{oerTitle} veröffentlichen</translate> + <translate>Seite auf dem OER Campus veröffentlichen</translate> </button> </li> <li v-if="!showExportArchiv && !showExportPdf && !showOer"> @@ -41,7 +41,6 @@ export default { ...mapGetters({ context: 'context', oerEnabled: 'oerEnabled', - oerTitle: 'oerTitle', userIsTeacher: 'userIsTeacher', }), canEdit() { diff --git a/resources/vue/components/courseware/CoursewareStructuralElement.vue b/resources/vue/components/courseware/CoursewareStructuralElement.vue index 1b2dfc473b522f8ec64b65e379550668d96a17ed..208419e2b64dc7d039b995ffe5ab68b2d463c371 100644 --- a/resources/vue/components/courseware/CoursewareStructuralElement.vue +++ b/resources/vue/components/courseware/CoursewareStructuralElement.vue @@ -528,7 +528,7 @@ > <template v-slot:dialogContent> <p><translate>Das folgende Courseware-Material wird %{ ownerName } - zur Veröffentlichung im %{ oerTitle } vorgeschlagen:</translate></p> + zur Veröffentlichung im OER Campus vorgeschlagen:</translate></p> <table class="cw-structural-element-info"> <tr> <td><translate>Titel</translate>:</td> @@ -724,7 +724,6 @@ export default { showSuggestOerDialog: 'showSuggestOerDialog', showLinkDialog: 'showStructuralElementLinkDialog', oerEnabled: 'oerEnabled', - oerTitle: 'oerTitle', licenses: 'licenses', exportState: 'exportState', exportProgress: 'exportProgress', @@ -741,7 +740,7 @@ export default { textOer() { return { - title: this.$gettextInterpolate('Seite auf %{ oerTitle } veröffentlichen', {oerTitle: this.oerTitle}), + title: this.$gettext('Seite auf dem OER Campus veröffentlichen'), confirm: this.$gettext('Veröffentlichen'), close: this.$gettext('Schließen'), }; @@ -749,7 +748,7 @@ export default { textSuggestOer() { return { - title: this.$gettextInterpolate('Material für %{ oerTitle } vorschlagen', {oerTitle: this.oerTitle}), + title: this.$gettext('Material für den OER Campus vorschlagen'), confirm: this.$gettext('Material vorschlagen'), close: this.$gettext('Schließen'), }; @@ -906,7 +905,7 @@ export default { let menu = [ { id: 4, label: this.$gettext('Informationen anzeigen'), icon: 'info', emit: 'showInfo' }, { id: 5, label: this.$gettext('Lesezeichen setzen'), icon: 'star', emit: 'setBookmark' }, - { id: 6, label: this.$gettextInterpolate('Material für %{ oerTitle } vorschlagen', {oerTitle: this.oerTitle}), icon: 'oer-campus', emit: 'showSuggest' }, + { id: 6, label: this.$gettext('Material für den OER Campus vorschlagen', icon: 'oer-campus', emit: 'showSuggest' }, ]; if (this.canEdit) { diff --git a/resources/vue/courseware-index-app.js b/resources/vue/courseware-index-app.js index c2e4a1e52d82402a2dbff0c1ff0f97006597b7ef..3d95d7dcd81c140e0b62c8bb5d414bf42f96c00f 100644 --- a/resources/vue/courseware-index-app.js +++ b/resources/vue/courseware-index-app.js @@ -23,7 +23,6 @@ const mountApp = (STUDIP, createApp, element) => { let entry_id = null; let entry_type = null; let oer_enabled = null; - let oer_title = null; let licenses = null; let elem; @@ -44,10 +43,6 @@ const mountApp = (STUDIP, createApp, element) => { if (elem.attributes['oer-enabled'] !== undefined) { oer_enabled = elem.attributes['oer-enabled'].value; } - - if (elem.attributes['oer-title'] !== undefined) { - oer_title = elem.attributes['oer-title'].value; - } // we need a route for License SORM if (elem.attributes['licenses'] !== undefined) { licenses = JSON.parse(elem.attributes['licenses'].value); @@ -133,7 +128,6 @@ const mountApp = (STUDIP, createApp, element) => { store.dispatch('coursewareCurrentElement', elem_id); store.dispatch('oerEnabled', oer_enabled); - store.dispatch('oerTitle', oer_title); store.dispatch('licenses', licenses); const pluginManager = new PluginManager(); diff --git a/resources/vue/mixins/courseware/export.js b/resources/vue/mixins/courseware/export.js index f15c314ecb50a6f5b2ff33be07bc31600c9f02c3..3e591f0010cbfd0cbfcf6617c05bba7da3d7db24 100644 --- a/resources/vue/mixins/courseware/export.js +++ b/resources/vue/mixins/courseware/export.js @@ -11,7 +11,6 @@ export default { containerById: 'courseware-containers/byId', folderById: 'folders/byId', filesById: 'files/byId', - oerTitle: 'oerTitle', structuralElementById: 'courseware-structural-elements/byId', }), }, @@ -187,7 +186,7 @@ export default { data: formData, headers: { "Content-Type": "multipart/form-data"} }).then( () => { - this.companionInfo({ info: this.$gettextInterpolate('Die Seite wurde an %{ oerTitle } gesendet.', {oerTitle: this.oerTitle}) }); + this.companionInfo({ info: this.$gettext('Die Seite wurde an den OER Campus gesendet.') }); }).catch(error => { this.companionError({ info: this.$gettext('Beim Veröffentlichen der Seite ist ein Fehler aufgetreten.') }); console.debug(error); diff --git a/resources/vue/store/courseware/courseware.module.js b/resources/vue/store/courseware/courseware.module.js index 49ac520a5d43ef84ec139b7f03458c3cc224c73e..e627d3745556991f920f2d61847743919573a5ee 100644 --- a/resources/vue/store/courseware/courseware.module.js +++ b/resources/vue/store/courseware/courseware.module.js @@ -9,7 +9,6 @@ const getDefaultState = () => { courseware: {}, currentElement: {}, oerEnabled: null, - oerTitle: null, licenses: null, // we need a route for License SORM httpClient: null, lastElement: null, @@ -79,9 +78,6 @@ const getters = { oerEnabled(state) { return state.oerEnabled; }, - oerTitle(state) { - return state.oerTitle; - }, licenses(state) { return state.licenses; }, @@ -734,10 +730,6 @@ export const actions = { context.commit('oerEnabledSet', enabled); }, - oerTitle(context, title) { - context.commit('oerTitleSet', title); - }, - licenses(context, licenses) { context.commit('licensesSet', licenses); }, @@ -1245,10 +1237,6 @@ export const mutations = { state.oerEnabled = data; }, - oerTitleSet(state, data) { - state.oerTitle = data; - }, - licensesSet(state, data) { state.licenses = data; },