Added some config features for display

This commit is contained in:
PMKuipers 2024-08-14 12:17:55 +02:00
parent 13523670cb
commit fd9d50873e
7 changed files with 25 additions and 25 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4528,7 +4528,7 @@ export default {
self.loadingcourses = false; self.loadingcourses = false;
return; return;
}).catch(notification.exception); }).catch(notification.exception);
if (!this.toolboxcoursesonly && this.enablebadges) { if (!this.toolboxcoursesonly && this.enablebadges) {
this.filterSystembadges(); this.filterSystembadges();
if (this.allowcoursebadges) { if (this.allowcoursebadges) {
@ -4652,7 +4652,7 @@ export default {
</ul> </ul>
</div> </div>
</b-tab> </b-tab>
<b-tab :title="text.sitebadges" v-if="!coaching"> <b-tab :title="text.sitebadges">
<div class="t-toolbox-badges-filter"> <div class="t-toolbox-badges-filter">
<input v-model="filters.systembadges" @input="filterSystembadges" :placeholder="text.filter"></input> <input v-model="filters.systembadges" @input="filterSystembadges" :placeholder="text.filter"></input>
&nbsp; <a @click="resetSystembadges" v-if="filters.systembadges" href='#' &nbsp; <a @click="resetSystembadges" v-if="filters.systembadges" href='#'

View File

@ -579,41 +579,38 @@ export default {
>&nbsp;</template >&nbsp;</template
><b-form-select v-model="bubblevalue" ><b-form-select v-model="bubblevalue"
@change='selectedchanged' @change='selectedchanged'
> ><b-form-select-option
<b-form-select-option
:disabled="!defaultselectable" :disabled="!defaultselectable"
:value="null" :value="null"
:class="(defaultselectable)?'font-italic text-primary ':'font-italic'" :class="(defaultselectable)?'font-italic text-primary ':'font-italic'"
><slot name="defaultlabel">{{text.select}}</slot></b-form-select-option> ><slot name="defaultlabel">{{text.select}}</slot></b-form-select-option
</b-form-select-option-group> ><template v-if="grouped"
<template v-if="grouped"> ><template v-for="(g,gi) in this.options"
<template v-for="(g,gi) in this.options"> ><b-form-select-option-group
<b-form-select-option-group
v-if="g[optionsfield] && g[optionsfield].length > 0" v-if="g[optionsfield] && g[optionsfield].length > 0"
:label="g[labelfield]" :label="g[labelfield]"
> ><b-form-select-option
<b-form-select-option
v-for="(o,i) in g[optionsfield]" v-for="(o,i) in g[optionsfield]"
:key="i" :key="i"
:value="o" :value="o"
><slot :value="o">{{o[titlefield]}}</slot></b-form-select-option> ><slot :value="o">{{o[titlefield]}}</slot></b-form-select-option>
</b-form-select-option-group> </b-form-select-option-group
</template> ></template
</template> ></template
<template v-else> ><template v-else>
<b-form-select-option <b-form-select-option
v-for="(o,i) in this.options" v-for="(o,i) in this.options"
:key="i" :key="i"
:value="o" :value="o"
><slot :value="o">{{o[titlefield]}}</slot></b-form-select-option> ><slot :value="o">{{o[titlefield]}}</slot></b-form-select-option
</template> ></template
</b-form-select ></b-form-select
><template v-if="showarrows" ><template v-if="showarrows"
>&nbsp;<b-button :variant='variant' @click="next" :disabled="atLast()" >&nbsp;<b-button :variant='variant' @click="next" :disabled="atLast()"
><i v-if='arrows' class='fa fa-caret-right s-prevnext-arrow'></i ><i v-if='arrows' class='fa fa-caret-right s-prevnext-arrow'></i
><template v-else>{{text.next}}</template></b-button ><template v-else>{{text.next}}</template></b-button
></template> ></template
</div> ></div>
`, `,
}); });

View File

@ -189,7 +189,8 @@ class utilityservice extends \external_api {
"toolboxleft" => new \external_value(PARAM_BOOL, 'Start toolbox default on left side'), "toolboxleft" => new \external_value(PARAM_BOOL, 'Start toolbox default on left side'),
"toolboxcoursesonly" => new \external_value(PARAM_BOOL, 'Show only courses in the toolbox'), "toolboxcoursesonly" => new \external_value(PARAM_BOOL, 'Show only courses in the toolbox'),
"enablebadges" => new \external_value(PARAM_BOOL, 'Badges are enabled in this instance'), "enablebadges" => new \external_value(PARAM_BOOL, 'Badges are enabled in this instance'),
"badges_allowcoursebadges" => new \external_value(PARAM_BOOL, 'Badges are enabled in this instance'), "badges_allowcoursebadges" => new \external_value(PARAM_BOOL, 'Course badges are enabled in this instance'),
"showprevnextarrows" => new \external_value(PARAM_BOOL, 'Show arrows next to the student selector'),
]); ]);
} }
@ -208,6 +209,8 @@ class utilityservice extends \external_api {
"toolboxcoursesonly" => get_config("local_treestudyplan", "toolboxcoursesonly"), "toolboxcoursesonly" => get_config("local_treestudyplan", "toolboxcoursesonly"),
"enablebadges" => !empty($CFG->enablebadges), "enablebadges" => !empty($CFG->enablebadges),
"badges_allowcoursebadges" => !empty($CFG->badges_allowcoursebadges), "badges_allowcoursebadges" => !empty($CFG->badges_allowcoursebadges),
"showprevnextarrows" => get_config("local_treestudyplan", "showprevnextarrows"),
]; ];
} }