Skip to content
Snippets Groups Projects
Commit 47d08785 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

Revert "fix #3019"

This reverts commit 185ab4a1.
parent 62f7fdaa
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
entry-type="users" entry-type="users"
entry-id="<?= htmlReady($user_id) ?>" entry-id="<?= htmlReady($user_id) ?>"
unit-id="<?= htmlReady($unit_id) ?>" unit-id="<?= htmlReady($unit_id) ?>"
oer-enabled='<?= htmlReady($oer_enabled) ?>'
licenses='<?= htmlReady($licenses) ?>' licenses='<?= htmlReady($licenses) ?>'
> >
</div> </div>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
entry-element-id="<?= $entry_element_id ?>" entry-element-id="<?= $entry_element_id ?>"
entry-type="sharedusers" entry-type="sharedusers"
entry-id="<?= $entry_element_id ?>" entry-id="<?= $entry_element_id ?>"
oer-enabled='<?= $oer_enabled ?>'
oer-title="<?= Config::get()->OER_TITLE ?>" oer-title="<?= Config::get()->OER_TITLE ?>"
licenses='<?= $licenses ?>' licenses='<?= $licenses ?>'
> >
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
entry-type="courses" entry-type="courses"
entry-id="<?= htmlReady(Context::getId()) ?>" entry-id="<?= htmlReady(Context::getId()) ?>"
unit-id="<?= htmlReady($unit_id) ?>" unit-id="<?= htmlReady($unit_id) ?>"
oer-enabled='<?= htmlReady($oer_enabled) ?>'
licenses='<?= htmlReady($licenses) ?>' licenses='<?= htmlReady($licenses) ?>'
> >
</div> </div>
......
...@@ -13,8 +13,6 @@ class Studip ...@@ -13,8 +13,6 @@ class Studip
{ {
$properties = [ $properties = [
new StudipProperty('studip-version', 'Stud.IP-Version', $GLOBALS['SOFTWARE_VERSION']), new StudipProperty('studip-version', 'Stud.IP-Version', $GLOBALS['SOFTWARE_VERSION']),
new StudipProperty('oer-campus-enabled', 'OERCAMPUS_ENABLED', \Config::get()->OERCAMPUS_ENABLED),
new StudipProperty('oer-enable-suggestions', 'OER_ENABLE_SUGGESTIONS', \Config::get()->OER_ENABLE_SUGGESTIONS),
]; ];
$copyrightDialog = self::getConfigOption('COPYRIGHT_DIALOG_ON_UPLOAD'); $copyrightDialog = self::getConfigOption('COPYRIGHT_DIALOG_ON_UPLOAD');
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
computed: { computed: {
...mapGetters({ ...mapGetters({
context: 'context', context: 'context',
oerCampusEnabled: 'oerCampusEnabled', oerEnabled: 'oerEnabled',
userIsTeacher: 'userIsTeacher', userIsTeacher: 'userIsTeacher',
}), }),
canEdit() { canEdit() {
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
return this.canVisit; return this.canVisit;
}, },
showOer() { showOer() {
if (!this.oerCampusEnabled) { if (!this.oerEnabled) {
return false; return false;
} }
......
...@@ -802,8 +802,7 @@ export default { ...@@ -802,8 +802,7 @@ export default {
showSuggestOerDialog: 'showSuggestOerDialog', showSuggestOerDialog: 'showSuggestOerDialog',
showPublicLinkDialog: 'showStructuralElementPublicLinkDialog', showPublicLinkDialog: 'showStructuralElementPublicLinkDialog',
showRemoveLockDialog: 'showStructuralElementRemoveLockDialog', showRemoveLockDialog: 'showStructuralElementRemoveLockDialog',
oerCampusEnabled: 'oerCampusEnabled', oerEnabled: 'oerEnabled',
oerEnableSuggestions: 'oerEnableSuggestions',
licenses: 'licenses', licenses: 'licenses',
exportState: 'exportState', exportState: 'exportState',
exportProgress: 'exportProgress', exportProgress: 'exportProgress',
...@@ -1043,9 +1042,9 @@ export default { ...@@ -1043,9 +1042,9 @@ export default {
{ id: 5, label: this.$gettext('Lesezeichen setzen'), icon: 'star', emit: 'setBookmark' }, { id: 5, label: this.$gettext('Lesezeichen setzen'), icon: 'star', emit: 'setBookmark' },
]; ];
if (this.oerEnableSuggestions) { if (this.oerEnabled) {
menu.push( menu.push(
{ id: 6, label: this.$gettext('Seite für OER Campus vorschlagen'), icon: 'oer-campus', { id: 6, label: this.$gettext('Lerninhalt für OER Campus vorschlagen'), icon: 'oer-campus',
emit: 'showSuggest' } emit: 'showSuggest' }
); );
} }
......
...@@ -24,6 +24,7 @@ const mountApp = async (STUDIP, createApp, element) => { ...@@ -24,6 +24,7 @@ const mountApp = async (STUDIP, createApp, element) => {
let entry_id = null; let entry_id = null;
let entry_type = null; let entry_type = null;
let unit_id = null; let unit_id = null;
let oer_enabled = null;
let licenses = null; let licenses = null;
let elem; let elem;
...@@ -45,6 +46,9 @@ const mountApp = async (STUDIP, createApp, element) => { ...@@ -45,6 +46,9 @@ const mountApp = async (STUDIP, createApp, element) => {
unit_id = elem.attributes['unit-id'].value; unit_id = elem.attributes['unit-id'].value;
} }
if (elem.attributes['oer-enabled'] !== undefined) {
oer_enabled = elem.attributes['oer-enabled'].value;
}
// we need a route for License SORM // we need a route for License SORM
if (elem.attributes['licenses'] !== undefined) { if (elem.attributes['licenses'] !== undefined) {
licenses = JSON.parse(elem.attributes['licenses'].value); licenses = JSON.parse(elem.attributes['licenses'].value);
...@@ -115,22 +119,13 @@ const mountApp = async (STUDIP, createApp, element) => { ...@@ -115,22 +119,13 @@ const mountApp = async (STUDIP, createApp, element) => {
'sem-classes', 'sem-classes',
'sem-types', 'sem-types',
'terms-of-use', 'terms-of-use',
'user-data-field', 'user-data-field'
'studip-properties'
], ],
httpClient, httpClient,
}), }),
}, },
}); });
axios.get(
STUDIP.URLHelper.getURL('jsonapi.php/v1/studip/properties', {}, true)
).then(response => {
response.data.data.forEach(prop => {
store.dispatch('studip-properties/storeRecord', prop);
});
});
store.dispatch('setUrlHelper', STUDIP.URLHelper); store.dispatch('setUrlHelper', STUDIP.URLHelper);
store.dispatch('setUserId', STUDIP.USER_ID); store.dispatch('setUserId', STUDIP.USER_ID);
await store.dispatch('users/loadById', {id: STUDIP.USER_ID}); await store.dispatch('users/loadById', {id: STUDIP.USER_ID});
...@@ -149,6 +144,7 @@ const mountApp = async (STUDIP, createApp, element) => { ...@@ -149,6 +144,7 @@ const mountApp = async (STUDIP, createApp, element) => {
store.dispatch('coursewareCurrentElement', elem_id); store.dispatch('coursewareCurrentElement', elem_id);
store.dispatch('oerEnabled', oer_enabled);
store.dispatch('licenses', licenses); store.dispatch('licenses', licenses);
store.dispatch('courseware-templates/loadAll'); store.dispatch('courseware-templates/loadAll');
store.dispatch('loadUserClipboards', STUDIP.USER_ID); store.dispatch('loadUserClipboards', STUDIP.USER_ID);
......
...@@ -8,6 +8,7 @@ const getDefaultState = () => { ...@@ -8,6 +8,7 @@ const getDefaultState = () => {
context: {}, context: {},
courseware: {}, courseware: {},
currentElement: {}, currentElement: {},
oerEnabled: null,
licenses: null, // we need a route for License SORM licenses: null, // we need a route for License SORM
httpClient: null, httpClient: null,
lastElement: null, lastElement: null,
...@@ -102,6 +103,9 @@ const getters = { ...@@ -102,6 +103,9 @@ const getters = {
currentStructuralElementImageURL(state, getters) { currentStructuralElementImageURL(state, getters) {
return getters.currentStructuralElement?.relationships?.image?.meta?.['download-url']; return getters.currentStructuralElement?.relationships?.image?.meta?.['download-url'];
}, },
oerEnabled(state) {
return state.oerEnabled;
},
licenses(state) { licenses(state) {
return state.licenses; return state.licenses;
}, },
...@@ -254,13 +258,6 @@ const getters = { ...@@ -254,13 +258,6 @@ const getters = {
}, },
progresses(state) { progresses(state) {
return state.progresses; return state.progresses;
},
oerCampusEnabled(state, getters, rootState, rootGetters) {
return rootGetters['studip-properties/byId']({ id: 'oer-campus-enabled'}).attributes?.value;
},
oerEnableSuggestions(state, getters, rootState, rootGetters) {
return getters.oerCampusEnabled && rootGetters['studip-properties/byId']({ id: 'oer-enable-suggestions'}).attributes?.value;
} }
}; };
...@@ -810,6 +807,10 @@ export const actions = { ...@@ -810,6 +807,10 @@ export const actions = {
context.commit('coursewareContextSet', id); context.commit('coursewareContextSet', id);
}, },
oerEnabled(context, enabled) {
context.commit('oerEnabledSet', enabled);
},
licenses(context, licenses) { licenses(context, licenses) {
context.commit('licensesSet', licenses); context.commit('licensesSet', licenses);
}, },
...@@ -1419,6 +1420,10 @@ export const mutations = { ...@@ -1419,6 +1420,10 @@ export const mutations = {
state.context = data; state.context = data;
}, },
oerEnabledSet(state, data) {
state.oerEnabled = data;
},
licensesSet(state, data) { licensesSet(state, data) {
state.licenses = data; state.licenses = data;
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment