diff --git a/src/main/java/org/olat/course/nodes/WikiCourseNode.java b/src/main/java/org/olat/course/nodes/WikiCourseNode.java index faf51a6fdd5067fb167417e4115b8e8d290adae8..5dabf59951d6e7b5d9d7b563d105f30cc75f5cc4 100644 --- a/src/main/java/org/olat/course/nodes/WikiCourseNode.java +++ b/src/main/java/org/olat/course/nodes/WikiCourseNode.java @@ -56,6 +56,7 @@ import org.olat.course.ICourse; import org.olat.course.condition.Condition; import org.olat.course.condition.interpreter.ConditionExpression; import org.olat.course.condition.interpreter.ConditionInterpreter; +import org.olat.course.editor.ConditionAccessEditConfig; import org.olat.course.editor.CourseEditorEnv; import org.olat.course.editor.NodeEditController; import org.olat.course.editor.StatusDescription; @@ -83,11 +84,19 @@ import org.olat.repository.handlers.RepositoryHandlerFactory; * @author Felix Jost */ public class WikiCourseNode extends AbstractAccessableCourseNode { + private static final long serialVersionUID = -5800975339569440113L; private static final Logger log = Tracing.createLoggerFor(WikiCourseNode.class); public static final String TYPE = "wiki"; + + private static final int CURRENT_VERSION = 2; + public static final String CONFIG_KEY_REPOSITORY_SOFTKEY = "reporef"; + public static final String CONFIG_KEY_EDIT_BY_COACH = "edit.by.coach"; + public static final String CONFIG_KEY_EDIT_BY_PARTICIPANT = "edit.by.participant"; + + public static final String EDIT_CONDITION = "editarticle"; private Condition preConditionEdit; public WikiCourseNode() { @@ -105,6 +114,31 @@ public class WikiCourseNode extends AbstractAccessableCourseNode { config.setBooleanEntry(NodeEditController.CONFIG_STARTPAGE, false); config.setConfigurationVersion(1); } + if (config.getConfigurationVersion() < 2) { + config.setBooleanEntry(CONFIG_KEY_EDIT_BY_COACH, Boolean.TRUE); + config.setBooleanEntry(CONFIG_KEY_EDIT_BY_PARTICIPANT, Boolean.TRUE); + removeDefaultPreconditions(); + } + + config.setConfigurationVersion(CURRENT_VERSION); + } + + private void removeDefaultPreconditions() { + if (hasCustomPreConditions()) { + boolean defaultPreconditions = + !preConditionEdit.isExpertMode() + && !preConditionEdit.isEasyModeCoachesAndAdmins() + && !preConditionEdit.isEasyModeAlwaysAllowCoachesAndAdmins() + && !preConditionEdit.isAssessmentMode() + && !preConditionEdit.isAssessmentModeViewResults(); + if (defaultPreconditions) { + removeCustomPreconditions(); + } + } + } + + public void removeCustomPreconditions() { + preConditionEdit = null; } @Override @@ -121,10 +155,17 @@ public class WikiCourseNode extends AbstractAccessableCourseNode { @Override public TabbableController createEditController(UserRequest ureq, WindowControl wControl, BreadcrumbPanel stackPanel, ICourse course,UserCourseEnvironment euce) { - WikiEditController childTabCntrllr = new WikiEditController(getModuleConfiguration(), ureq, wControl, this, course,euce); + WikiEditController childTabCntrllr = new WikiEditController(ureq, wControl, stackPanel, this, course,euce); CourseNode chosenNode = course.getEditorTreeModel().getCourseNode(euce.getCourseEditorEnv().getCurrentCourseNodeId()); return new NodeEditController(ureq, wControl, course, chosenNode, euce, childTabCntrllr); } + + @Override + public ConditionAccessEditConfig getAccessEditConfig() { + return hasCustomPreConditions() + ? ConditionAccessEditConfig.custom() + : ConditionAccessEditConfig.regular(false); + } @Override public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, @@ -139,9 +180,6 @@ public class WikiCourseNode extends AbstractAccessableCourseNode { @Override public StatusDescription isConfigValid() { - /* - * first check the one click cache - */ if(oneClickStatusCache!=null) { return oneClickStatusCache[0]; } @@ -242,37 +280,40 @@ public class WikiCourseNode extends AbstractAccessableCourseNode { @Override public List<ConditionExpression> getConditionExpressions() { - List<ConditionExpression> parentConditions = super.getConditionExpressions(); - List<ConditionExpression> conditions = new ArrayList<>(); - if(parentConditions != null && parentConditions.size() > 0) { - conditions.addAll(parentConditions); - } - Condition editCondition = getPreConditionEdit(); - if(editCondition != null && StringHelper.containsNonWhitespace(editCondition.getConditionExpression())) { - ConditionExpression ce = new ConditionExpression(editCondition.getConditionId()); - ce.setExpressionString(editCondition.getConditionExpression()); - conditions.add(ce); + if (hasCustomPreConditions()) { + List<ConditionExpression> parentConditions = super.getConditionExpressions(); + List<ConditionExpression> conditions = new ArrayList<>(); + if(parentConditions != null && parentConditions.size() > 0) { + conditions.addAll(parentConditions); + } + Condition editCondition = getPreConditionEdit(); + if(editCondition != null && StringHelper.containsNonWhitespace(editCondition.getConditionExpression())) { + ConditionExpression ce = new ConditionExpression(editCondition.getConditionId()); + ce.setExpressionString(editCondition.getConditionExpression()); + conditions.add(ce); + } + return conditions; } - return conditions; + return super.getConditionExpressions(); + } + + public boolean hasCustomPreConditions() { + return preConditionEdit != null; } public Condition getPreConditionEdit() { if (preConditionEdit == null) { preConditionEdit = new Condition(); } - preConditionEdit.setConditionId("editarticle"); + preConditionEdit.setConditionId(EDIT_CONDITION); return preConditionEdit; } - /** - * - * @param preConditionEdit - */ public void setPreConditionEdit(Condition preConditionEdit) { if (preConditionEdit == null) { preConditionEdit = getPreConditionEdit(); } - preConditionEdit.setConditionId("editarticle"); + preConditionEdit.setConditionId(EDIT_CONDITION); this.preConditionEdit = preConditionEdit; } @@ -285,10 +326,12 @@ public class WikiCourseNode extends AbstractAccessableCourseNode { */ @Override public void calcAccessAndVisibility(ConditionInterpreter ci, NodeEvaluation nodeEval) { - super.calcAccessAndVisibility(ci, nodeEval); - - boolean editor = (getPreConditionEdit().getConditionExpression() == null ? true : ci.evaluateCondition(getPreConditionEdit())); - nodeEval.putAccessStatus("editarticle", editor); + super.calcAccessAndVisibility(ci, nodeEval); + + if (hasCustomPreConditions()) { + boolean editor = (getPreConditionEdit().getConditionExpression() == null ? true : ci.evaluateCondition(getPreConditionEdit())); + nodeEval.putAccessStatus(EDIT_CONDITION, editor); + } } @Override diff --git a/src/main/java/org/olat/course/nodes/wiki/WikiConfigController.java b/src/main/java/org/olat/course/nodes/wiki/WikiConfigController.java new file mode 100644 index 0000000000000000000000000000000000000000..ece7c1f484d83e45483d8d9006373a1d8c1ac1f5 --- /dev/null +++ b/src/main/java/org/olat/course/nodes/wiki/WikiConfigController.java @@ -0,0 +1,262 @@ +/** + * <a href="http://www.openolat.org"> + * OpenOLAT - Online Learning and Training</a><br> + * <p> + * Licensed under the Apache License, Version 2.0 (the "License"); <br> + * you may not use this file except in compliance with the License.<br> + * You may obtain a copy of the License at the + * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a> + * <p> + * Unless required by applicable law or agreed to in writing,<br> + * software distributed under the License is distributed on an "AS IS" BASIS, <br> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> + * See the License for the specific language governing permissions and <br> + * limitations under the License. + * <p> + * Initial code contributed and copyrighted by<br> + * frentix GmbH, http://www.frentix.com + * <p> + */ +package org.olat.course.nodes.wiki; + +import static org.olat.core.gui.translator.TranslatorHelper.translateAll; + +import java.util.Collection; + +import org.olat.basesecurity.GroupRoles; +import org.olat.basesecurity.OrganisationRoles; +import org.olat.core.commons.services.notifications.SubscriptionContext; +import org.olat.core.gui.UserRequest; +import org.olat.core.gui.components.form.flexible.FormItem; +import org.olat.core.gui.components.form.flexible.FormItemContainer; +import org.olat.core.gui.components.form.flexible.elements.FormLink; +import org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement; +import org.olat.core.gui.components.form.flexible.elements.StaticTextElement; +import org.olat.core.gui.components.form.flexible.impl.FormBasicController; +import org.olat.core.gui.components.form.flexible.impl.FormEvent; +import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer; +import org.olat.core.gui.components.link.Link; +import org.olat.core.gui.components.stack.BreadcrumbPanel; +import org.olat.core.gui.control.Controller; +import org.olat.core.gui.control.Event; +import org.olat.core.gui.control.WindowControl; +import org.olat.core.gui.control.generic.closablewrapper.CloseableModalController; +import org.olat.core.id.Roles; +import org.olat.core.util.StringHelper; +import org.olat.course.ICourse; +import org.olat.course.editor.NodeEditController; +import org.olat.course.nodes.AbstractFeedCourseNode; +import org.olat.course.nodes.CourseNodeFactory; +import org.olat.course.nodes.WikiCourseNode; +import org.olat.course.run.environment.CourseEnvironment; +import org.olat.fileresource.types.WikiResource; +import org.olat.modules.ModuleConfiguration; +import org.olat.modules.wiki.DryRunAssessmentProvider; +import org.olat.modules.wiki.WikiManager; +import org.olat.modules.wiki.WikiSecurityCallback; +import org.olat.modules.wiki.WikiSecurityCallbackImpl; +import org.olat.repository.RepositoryEntry; +import org.olat.repository.RepositoryService; +import org.olat.repository.controllers.ReferencableEntriesSearchController; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * + * Initial date: 2 Mar 2020<br> + * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com + * + */ +public class WikiConfigController extends FormBasicController { + + private static final String ROLE_COACH = "config.role.coach"; + private static final String ROLE_PARTICIPANT = "config.role.participant"; + private static final String[] EDIT_KEYS = new String[] { + ROLE_COACH, + ROLE_PARTICIPANT + }; + + private StaticTextElement wikiNotChoosenEl; + private FormLink previewLink; + private FormLink chooseLink; + private FormLink replaceLink; + private FormLink editLink; + private MultipleSelectionElement editRolesEl; + + private CloseableModalController cmc; + private ReferencableEntriesSearchController repositorySearchCtrl; + private Controller wikiCtrl; + + private final BreadcrumbPanel stackPanel; + private final WikiCourseNode courseNode; + private final ModuleConfiguration config; + private final ICourse course; + private RepositoryEntry wikiEntry; + + @Autowired + private RepositoryService repositoryService; + + public WikiConfigController(UserRequest ureq, WindowControl wControl, BreadcrumbPanel stackPanel, + WikiCourseNode courseNode, ICourse course) { + super(ureq, wControl, LAYOUT_BAREBONE); + this.stackPanel = stackPanel; + this.courseNode = courseNode; + this.course = course; + this.config = courseNode.getModuleConfiguration(); + this.wikiEntry = courseNode.getReferencedRepositoryEntry(); + initForm(ureq); + } + + @Override + protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) { + FormLayoutContainer generalCont = FormLayoutContainer.createDefaultFormLayout("general", getTranslator()); + formLayout.add(generalCont); + generalCont.setRootForm(mainForm); + generalCont.setFormTitle(translate("header")); + generalCont.setFormContextHelp("Communication and Collaboration#_bb_wiki"); + + wikiNotChoosenEl = uifactory.addStaticTextElement("chosenwiki", "chosenwiki", + translate("no.entry.chosen"), generalCont); + previewLink = uifactory.addFormLink("command.preview", "", translate("command.preview"), generalCont, + Link.NONTRANSLATED); + previewLink.setIconLeftCSS("o_icon o_icon-fw o_icon_preview"); + + FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator()); + buttonsCont.setRootForm(mainForm); + generalCont.add(buttonsCont); + chooseLink = uifactory.addFormLink("command.create", buttonsCont, "btn btn-default o_xsmall"); + chooseLink.setElementCssClass("o_sel_survey_choose_repofile"); + replaceLink = uifactory.addFormLink("command.change", buttonsCont, "btn btn-default o_xsmall"); + editLink = uifactory.addFormLink("edit", buttonsCont, "btn btn-default o_xsmall"); + + + if (!courseNode.hasCustomPreConditions()) { + FormLayoutContainer rightsCont = FormLayoutContainer.createDefaultFormLayout("rights", getTranslator()); + formLayout.add(rightsCont); + rightsCont.setFormTitle(translate("config.rights")); + + editRolesEl = uifactory.addCheckboxesVertical("config.edit", rightsCont, EDIT_KEYS, + translateAll(getTranslator(), EDIT_KEYS), 1); + editRolesEl.select(ROLE_COACH, + config.getBooleanSafe(WikiCourseNode.CONFIG_KEY_EDIT_BY_COACH)); + editRolesEl.select(ROLE_PARTICIPANT, + config.getBooleanSafe(WikiCourseNode.CONFIG_KEY_EDIT_BY_PARTICIPANT)); + editRolesEl.addActionListener(FormEvent.ONCHANGE); + } + + updateUI(); + } + + private void updateUI() { + boolean feedSelected = wikiEntry != null; + if (feedSelected) { + String displayname = StringHelper.escapeHtml(wikiEntry.getDisplayname()); + previewLink.setI18nKey(displayname); + flc.setDirty(true); + } + wikiNotChoosenEl.setVisible(!feedSelected); + chooseLink.setVisible(!feedSelected); + previewLink.setVisible(feedSelected); + replaceLink.setVisible(feedSelected); + editLink.setVisible(feedSelected); + } + + @Override + protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) { + if (source == chooseLink || source == replaceLink) { + doSelectFeed(ureq); + } else if (source == previewLink) { + doPreviewFeed(ureq); + } else if (source == editLink) { + doEditFeed(ureq); + } else if (source == editRolesEl) { + doUpdatedEditRoles(ureq); + } + super.formInnerEvent(ureq, source, event); + } + + @Override + public void event(UserRequest urequest, Controller source, Event event) { + if (source == repositorySearchCtrl) { + if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRY_SELECTED) { + wikiEntry = repositorySearchCtrl.getSelectedEntry(); + if (wikiEntry != null) { + //TODO uh set copnfig + AbstractFeedCourseNode.setReference(courseNode.getModuleConfiguration(), wikiEntry); + WikiEditController.setWikiRepoReference(wikiEntry, config); + fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT); + updateUI(); + } + } + cmc.deactivate(); + cleanUp(); + } else if (source == cmc) { + cmc.deactivate(); + cleanUp(); + } + } + + private void cleanUp() { + removeAsListenerAndDispose(repositorySearchCtrl); + removeAsListenerAndDispose(wikiCtrl); + removeAsListenerAndDispose(cmc); + repositorySearchCtrl = null; + wikiCtrl = null; + cmc = null; + } + + private void doSelectFeed(UserRequest ureq) { + repositorySearchCtrl = new ReferencableEntriesSearchController(getWindowControl(), ureq, WikiResource.TYPE_NAME, + translate("command.choose")); + listenTo(repositorySearchCtrl); + cmc = new CloseableModalController(getWindowControl(), translate("close"), + repositorySearchCtrl.getInitialComponent(), true, translate("command.create")); + cmc.activate(); + } + + private void doPreviewFeed(UserRequest ureq) { + if (wikiEntry == null) { + showError("error.repoentrymissing"); + } else { + Roles roles = ureq.getUserSession().getRoles(); + boolean isAdministrator = (roles.isAdministrator() || roles.isLearnResourceManager()) + && repositoryService.hasRoleExpanded(getIdentity(), wikiEntry, + OrganisationRoles.administrator.name(), OrganisationRoles.learnresourcemanager.name()); + boolean isResourceOwner = repositoryService.hasRole(getIdentity(), wikiEntry, GroupRoles.owner.name()); + + CourseEnvironment cenv = course.getCourseEnvironment(); + SubscriptionContext subsContext = WikiManager.createTechnicalSubscriptionContextForCourse(cenv, courseNode); + WikiSecurityCallback callback = new WikiSecurityCallbackImpl(null, isAdministrator, false, false, isResourceOwner, subsContext); + wikiCtrl = WikiManager.getInstance().createWikiMainController(ureq, getWindowControl(), wikiEntry.getOlatResource(), + callback, DryRunAssessmentProvider.create(), null); + listenTo(wikiCtrl); + stackPanel.pushController(translate("preview"), wikiCtrl); + } + } + + private void doEditFeed(UserRequest ureq) { + if (wikiEntry == null) { + showError("error.repoentrymissing"); + } else { + CourseNodeFactory.getInstance().launchReferencedRepoEntryEditor(ureq, getWindowControl(), courseNode); + } + } + + private void doUpdatedEditRoles(UserRequest ureq) { + Collection<String> selectedEditKeys = editRolesEl.getSelectedKeys(); + config.setBooleanEntry(WikiCourseNode.CONFIG_KEY_EDIT_BY_COACH, selectedEditKeys.contains(ROLE_COACH)); + config.setBooleanEntry(WikiCourseNode.CONFIG_KEY_EDIT_BY_PARTICIPANT, selectedEditKeys.contains(ROLE_PARTICIPANT)); + + fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT); + } + + @Override + protected void formOK(UserRequest ureq) { + // + } + + @Override + protected void doDispose() { + // + } + +} diff --git a/src/main/java/org/olat/course/nodes/wiki/WikiEditController.java b/src/main/java/org/olat/course/nodes/wiki/WikiEditController.java index 1a736b7e48789317bee3dd4b1bec8975e2995b38..2b33f445fad53e87945bf66d94730364c2027fde 100644 --- a/src/main/java/org/olat/course/nodes/wiki/WikiEditController.java +++ b/src/main/java/org/olat/course/nodes/wiki/WikiEditController.java @@ -25,47 +25,28 @@ package org.olat.course.nodes.wiki; -import org.olat.NewControllerFactory; -import org.olat.basesecurity.GroupRoles; -import org.olat.basesecurity.OrganisationRoles; -import org.olat.core.commons.services.notifications.SubscriptionContext; import org.olat.core.gui.UserRequest; import org.olat.core.gui.components.Component; -import org.olat.core.gui.components.link.Link; -import org.olat.core.gui.components.link.LinkFactory; -import org.olat.core.gui.components.panel.Panel; +import org.olat.core.gui.components.stack.BreadcrumbPanel; import org.olat.core.gui.components.tabbedpane.TabbedPane; import org.olat.core.gui.components.velocity.VelocityContainer; import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.ControllerEventListener; import org.olat.core.gui.control.Event; import org.olat.core.gui.control.WindowControl; -import org.olat.core.gui.control.generic.closablewrapper.CloseableModalController; import org.olat.core.gui.control.generic.tabbable.ActivateableTabbableDefaultController; -import org.olat.core.id.Roles; import org.olat.core.logging.AssertException; -import org.olat.core.util.StringHelper; import org.olat.course.ICourse; import org.olat.course.assessment.AssessmentHelper; import org.olat.course.condition.Condition; import org.olat.course.condition.ConditionEditController; import org.olat.course.editor.NodeEditController; import org.olat.course.nodes.WikiCourseNode; -import org.olat.course.run.environment.CourseEnvironment; import org.olat.course.run.userview.UserCourseEnvironment; import org.olat.course.tree.CourseEditorTreeModel; -import org.olat.fileresource.types.WikiResource; import org.olat.modules.ModuleConfiguration; -import org.olat.modules.wiki.DryRunAssessmentProvider; -import org.olat.modules.wiki.WikiMainController; -import org.olat.modules.wiki.WikiManager; -import org.olat.modules.wiki.WikiSecurityCallback; -import org.olat.modules.wiki.WikiSecurityCallbackImpl; import org.olat.repository.RepositoryEntry; import org.olat.repository.RepositoryManager; -import org.olat.repository.RepositoryService; -import org.olat.repository.controllers.ReferencableEntriesSearchController; -import org.springframework.beans.factory.annotation.Autowired; /** * Description: <BR/>Edit controller for single page course nodes <P/> Initial @@ -76,205 +57,81 @@ import org.springframework.beans.factory.annotation.Autowired; public class WikiEditController extends ActivateableTabbableDefaultController implements ControllerEventListener { public static final String PANE_TAB_ACCESSIBILITY = "pane.tab.accessibility"; public static final String PANE_TAB_WIKICONFIG = "pane.tab.wikiconfig"; - public static final String PANE_TAB_WIKIDISPLAYCONFIG = "pane.tab.wikidisplayconfig"; private static final String[] paneKeys = { PANE_TAB_WIKICONFIG, PANE_TAB_ACCESSIBILITY }; - private static final String CHOSEN_ENTRY = "chosen_entry"; - private static final String CONFIG_KEY_REPOSITORY_SOFTKEY = "reporef"; - - private ModuleConfiguration moduleConfiguration; - private WikiCourseNode wikiCourseNode; - private ConditionEditController accessCondContr; private TabbedPane tabs; - private Panel main; - private VelocityContainer content; - private ReferencableEntriesSearchController searchController; - private WikiMainController wikiCtr; - private CloseableModalController cmcWikiCtr; - private CloseableModalController cmcSearchController; - private Link previewLink; - private Link chooseButton; - private Link changeButton; - private Link editLink; + private WikiConfigController configCtrl; private VelocityContainer editAccessVc; + private ConditionEditController accessCondCtrl; private ConditionEditController editCondContr; - private ICourse course; - - @Autowired - private RepositoryService repositoryService; - /** - * Constructor for wiki page editor controller - * - * @param config The node module configuration - * @param ureq The user request - * @param wikiCourseNode The current wiki page course node - * @param course - */ - public WikiEditController(ModuleConfiguration config, UserRequest ureq, WindowControl wControl, WikiCourseNode wikiCourseNode, - ICourse course, UserCourseEnvironment euce) { + private final WikiCourseNode wikiCourseNode; + + public WikiEditController(UserRequest ureq, WindowControl wControl, BreadcrumbPanel stackPanel, + WikiCourseNode wikiCourseNode, ICourse course, UserCourseEnvironment euce) { super(ureq, wControl); - this.moduleConfiguration = config; this.wikiCourseNode = wikiCourseNode; - //o_clusterOk by guido: save to hold reference to course inside editor - this.course = course; - main = new Panel("wikimain"); + configCtrl = new WikiConfigController(ureq, wControl, stackPanel, wikiCourseNode, course); + listenTo(configCtrl); - content = createVelocityContainer("edit"); - chooseButton = LinkFactory.createButtonSmall("command.create", content, this); - chooseButton.setElementCssClass("o_sel_wiki_choose_repofile"); - changeButton = LinkFactory.createButtonSmall("command.change", content, this); - changeButton.setElementCssClass("o_sel_wiki_choose_repofile"); - - editAccessVc = this.createVelocityContainer("edit_access"); - CourseEditorTreeModel editorModel = course.getEditorTreeModel(); - // Accessibility precondition - Condition accessCondition = wikiCourseNode.getPreConditionAccess(); - accessCondContr = new ConditionEditController(ureq, getWindowControl(), euce, accessCondition, - AssessmentHelper.getAssessableNodes(editorModel, wikiCourseNode)); - listenTo(accessCondContr); - editAccessVc.put("readerCondition", accessCondContr.getInitialComponent()); - - //wiki read / write preconditions - Condition editCondition = wikiCourseNode.getPreConditionEdit(); - editCondContr = new ConditionEditController(ureq, getWindowControl(), euce, editCondition, AssessmentHelper - .getAssessableNodes(editorModel, wikiCourseNode)); - listenTo(editCondContr); - editAccessVc.put("editCondition", editCondContr.getInitialComponent()); - - - if (config.get(CONFIG_KEY_REPOSITORY_SOFTKEY) != null) { - // fetch repository entry to display the repository entry title of the - // chosen wiki - RepositoryEntry re = getWikiRepoReference(config, false); - if (re == null) { // we cannot display the entrie's name, because the - // repository entry had been deleted between the time - // when it was chosen here, and now - this.showError("error.repoentrymissing"); - content.contextPut("showPreviewLink", Boolean.FALSE); - content.contextPut(CHOSEN_ENTRY, translate("no.entry.chosen")); - } else { - // no securitycheck on wiki, editable by everybody - editLink = LinkFactory.createButtonSmall("edit", content, this); - content.contextPut("showPreviewLink", Boolean.TRUE); - String displayname = StringHelper.escapeHtml(re.getDisplayname()); - previewLink = LinkFactory.createCustomLink("command.preview", "command.preview", displayname, Link.NONTRANSLATED, content, this); - previewLink.setIconLeftCSS("o_icon o_icon-fw o_icon_preview"); - previewLink.setCustomEnabledLinkCSS("o_preview"); - previewLink.setTitle(getTranslator().translate("command.preview")); - } - } else { - // no valid config yet - content.contextPut("showPreviewLink", Boolean.FALSE); - content.contextPut(CHOSEN_ENTRY, translate("no.entry.chosen")); + if (wikiCourseNode.hasCustomPreConditions()) { + editAccessVc = this.createVelocityContainer("edit_access"); + CourseEditorTreeModel editorModel = course.getEditorTreeModel(); + // Accessibility precondition + Condition accessCondition = wikiCourseNode.getPreConditionAccess(); + accessCondCtrl = new ConditionEditController(ureq, getWindowControl(), euce, accessCondition, + AssessmentHelper.getAssessableNodes(editorModel, wikiCourseNode)); + listenTo(accessCondCtrl); + editAccessVc.put("readerCondition", accessCondCtrl.getInitialComponent()); + + //wiki read / write preconditions + Condition editCondition = wikiCourseNode.getPreConditionEdit(); + editCondContr = new ConditionEditController(ureq, getWindowControl(), euce, editCondition, AssessmentHelper + .getAssessableNodes(editorModel, wikiCourseNode)); + listenTo(editCondContr); + editAccessVc.put("editCondition", editCondContr.getInitialComponent()); } - - main.setContent(content); } @Override public void event(UserRequest ureq, Component source, Event event) { - if (source == previewLink) { - doPreview(ureq); - } else if (source == chooseButton || source == changeButton) { - searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, WikiResource.TYPE_NAME, translate("command.choose")); - listenTo(searchController); - cmcSearchController = new CloseableModalController(getWindowControl(), translate("close"), searchController.getInitialComponent(), true, translate("command.create")); - cmcSearchController.activate(); - } else if (source == editLink) { - RepositoryEntry repositoryEntry = wikiCourseNode.getReferencedRepositoryEntry(); - if (repositoryEntry == null) { - // do nothing - return; - } - String bPath = "[RepositoryEntry:" + repositoryEntry.getKey() + "][Editor:0]"; - NewControllerFactory.getInstance().launch(bPath, ureq, getWindowControl()); - } + // } @Override - public void event(UserRequest urequest, Controller source, Event event) { - if (source == searchController) { - cmcSearchController.deactivate(); - // repository search controller done - if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRY_SELECTED) { - RepositoryEntry re = searchController.getSelectedEntry(); - if (re != null) { - setWikiRepoReference(re, moduleConfiguration); - content.contextPut("showPreviewLink", Boolean.TRUE); - String displayname = StringHelper.escapeHtml(re.getDisplayname()); - previewLink = LinkFactory.createCustomLink("command.preview", "command.preview", displayname, Link.NONTRANSLATED, content, this); - previewLink.setIconLeftCSS("o_icon o_icon-fw o_icon_preview"); - previewLink.setCustomEnabledLinkCSS("o_preview"); - previewLink.setTitle(getTranslator().translate("command.preview")); - // no securitycheck on wiki, editable by everybody - editLink = LinkFactory.createButtonSmall("edit", content, this); - // fire event so the updated config is saved by the - // editormaincontroller - fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT); - } - } // else cancelled repo search - } else if (source == accessCondContr) { + public void event(UserRequest ureq, Controller source, Event event) { + if (source == configCtrl) { + fireEvent(ureq, event); + } else if (source == accessCondCtrl) { if (event == Event.CHANGED_EVENT) { - Condition cond = accessCondContr.getCondition(); + Condition cond = accessCondCtrl.getCondition(); wikiCourseNode.setPreConditionAccess(cond); - fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT); + fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT); } } else if (source == editCondContr) { if (event == Event.CHANGED_EVENT) { Condition cond = editCondContr.getCondition(); wikiCourseNode.setPreConditionEdit(cond); - fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT); + fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT); } - } else if (source == cmcWikiCtr) { - if (event == CloseableModalController.CLOSE_MODAL_EVENT) { - cmcWikiCtr.dispose(); - wikiCtr.dispose(); - } - } - } - - private void doPreview(UserRequest ureq) { - // Preview as modal dialogue only if the config is valid - RepositoryEntry re = getWikiRepoReference(moduleConfiguration, false); - if (re == null) { // we cannot preview it, because the repository entry - // had been deleted between the time when it was - // chosen here, and now - showError("error.repoentrymissing"); - } else { - Roles roles = ureq.getUserSession().getRoles(); - boolean isAdministrator = (roles.isAdministrator() || roles.isLearnResourceManager()) - && repositoryService.hasRoleExpanded(getIdentity(), re, - OrganisationRoles.administrator.name(), OrganisationRoles.learnresourcemanager.name()); - boolean isResourceOwner = repositoryService.hasRole(getIdentity(), re, GroupRoles.owner.name()); - - CourseEnvironment cenv = course.getCourseEnvironment(); - SubscriptionContext subsContext = WikiManager.createTechnicalSubscriptionContextForCourse(cenv, wikiCourseNode); - WikiSecurityCallback callback = new WikiSecurityCallbackImpl(null, isAdministrator, false, false, isResourceOwner, subsContext); - wikiCtr = WikiManager.getInstance().createWikiMainController(ureq, getWindowControl(), re.getOlatResource(), - callback, DryRunAssessmentProvider.create(), null); - cmcWikiCtr = new CloseableModalController(getWindowControl(), translate("command.close"), wikiCtr.getInitialComponent()); - listenTo(cmcWikiCtr); - cmcWikiCtr.activate(); } } @Override public void addTabs(TabbedPane tabbedPane) { tabs = tabbedPane; - tabbedPane.addTab(translate(PANE_TAB_ACCESSIBILITY), editAccessVc); - tabbedPane.addTab(translate(PANE_TAB_WIKICONFIG), main); + if (editAccessVc != null) { + tabbedPane.addTab(translate(PANE_TAB_ACCESSIBILITY), editAccessVc); + + } + tabbedPane.addTab(translate(PANE_TAB_WIKICONFIG), configCtrl.getInitialComponent()); } @Override protected void doDispose() { - //child controllers registered with listenTo() get disposed in BasicController - if (wikiCtr != null) { - wikiCtr.dispose(); - wikiCtr = null; - } + // } @Override @@ -297,7 +154,7 @@ public class WikiEditController extends ActivateableTabbableDefaultController im */ public static RepositoryEntry getWikiRepoReference(ModuleConfiguration config, boolean strict) { if (config == null) throw new AssertException("missing config in wiki course node"); - String repoSoftkey = (String) config.get(WikiEditController.CONFIG_KEY_REPOSITORY_SOFTKEY); + String repoSoftkey = (String) config.get(WikiCourseNode.CONFIG_KEY_REPOSITORY_SOFTKEY); if (repoSoftkey == null) throw new AssertException("invalid config when being asked for references"); RepositoryManager rm = RepositoryManager.getInstance(); return rm.lookupRepositoryEntryBySoftkey(repoSoftkey, strict); @@ -309,7 +166,7 @@ public class WikiEditController extends ActivateableTabbableDefaultController im * @param moduleConfiguration */ public static void setWikiRepoReference(RepositoryEntry re, ModuleConfiguration moduleConfiguration) { - moduleConfiguration.set(CONFIG_KEY_REPOSITORY_SOFTKEY, re.getSoftkey()); + moduleConfiguration.set(WikiCourseNode.CONFIG_KEY_REPOSITORY_SOFTKEY, re.getSoftkey()); } /** @@ -317,7 +174,7 @@ public class WikiEditController extends ActivateableTabbableDefaultController im * @return boolean */ public static boolean isModuleConfigValid(ModuleConfiguration moduleConfiguration) { - return (moduleConfiguration.get(CONFIG_KEY_REPOSITORY_SOFTKEY) != null); + return (moduleConfiguration.get(WikiCourseNode.CONFIG_KEY_REPOSITORY_SOFTKEY) != null); } @@ -334,7 +191,7 @@ public class WikiEditController extends ActivateableTabbableDefaultController im if (strict) throw new AssertException("missing config in Wiki"); else return null; } - String repoSoftkey = (String) config.get(WikiEditController.CONFIG_KEY_REPOSITORY_SOFTKEY); + String repoSoftkey = (String) config.get(WikiCourseNode.CONFIG_KEY_REPOSITORY_SOFTKEY); if (repoSoftkey == null) { if (strict) throw new AssertException("invalid config when being asked for references"); else return null; @@ -348,7 +205,7 @@ public class WikiEditController extends ActivateableTabbableDefaultController im * @param moduleConfig */ public static void removeWikiReference(ModuleConfiguration moduleConfig) { - moduleConfig.remove(WikiEditController.CONFIG_KEY_REPOSITORY_SOFTKEY); + moduleConfig.remove(WikiCourseNode.CONFIG_KEY_REPOSITORY_SOFTKEY); } } diff --git a/src/main/java/org/olat/course/nodes/wiki/WikiLearningPathNodeHandler.java b/src/main/java/org/olat/course/nodes/wiki/WikiLearningPathNodeHandler.java index ab1e8c470530026a2b32f29a4c244ed53f657f47..afc381a9319d6428c6bf70aa4d9a5919de1634c3 100644 --- a/src/main/java/org/olat/course/nodes/wiki/WikiLearningPathNodeHandler.java +++ b/src/main/java/org/olat/course/nodes/wiki/WikiLearningPathNodeHandler.java @@ -74,7 +74,9 @@ public class WikiLearningPathNodeHandler implements LearningPathNodeHandler { @Override public void onMigrated(CourseNode courseNode) { - // + if (courseNode instanceof WikiCourseNode) { + ((WikiCourseNode)courseNode).removeCustomPreconditions(); + } } } diff --git a/src/main/java/org/olat/course/nodes/wiki/WikiRunController.java b/src/main/java/org/olat/course/nodes/wiki/WikiRunController.java index 9aa483571466edd2aa6c883815ae6112073c06a9..c34a609dee8f55a2a7c22aa8231eecc98efe3266 100644 --- a/src/main/java/org/olat/course/nodes/wiki/WikiRunController.java +++ b/src/main/java/org/olat/course/nodes/wiki/WikiRunController.java @@ -113,7 +113,9 @@ public class WikiRunController extends BasicController implements Activateable2 callback = new WikiReadOnlySecurityCallback(isGuestOnly, (isAdmininstrator || isResourceOwner)); assessmentProvider = DryRunAssessmentProvider.create(); } else { - callback = new WikiSecurityCallbackImpl(ne, isAdmininstrator, isGuestOnly, false, isResourceOwner, subsContext); + Boolean courseEditRight = Boolean.valueOf(hasEditRights(wikiCourseNode, userCourseEnv, ne)); + callback = new WikiSecurityCallbackImpl(courseEditRight, isAdmininstrator, isGuestOnly, false, + isResourceOwner, subsContext); assessmentProvider = userCourseEnv.isParticipant() ? PersistingAssessmentProvider.create(wikiEntry, getIdentity()) : DryRunAssessmentProvider.create(); @@ -154,6 +156,20 @@ public class WikiRunController extends BasicController implements Activateable2 putInitialPanel(new Panel("uups.no.clone.controller")); } } + + private boolean hasEditRights(WikiCourseNode courseNode, UserCourseEnvironment userCourseEnv, NodeEvaluation ne) { + if (courseNode.hasCustomPreConditions()) { + return ne.isCapabilityAccessible(WikiCourseNode.EDIT_CONDITION); + } + + ModuleConfiguration moduleConfig = courseNode.getModuleConfiguration(); + if ((moduleConfig.getBooleanSafe(WikiCourseNode.CONFIG_KEY_EDIT_BY_COACH) && userCourseEnv.isCoach()) + || (moduleConfig.getBooleanSafe(WikiCourseNode.CONFIG_KEY_EDIT_BY_PARTICIPANT) && userCourseEnv.isParticipant())) { + return true; + } + + return false; + } @Override public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) { diff --git a/src/main/java/org/olat/course/nodes/wiki/_content/edit.html b/src/main/java/org/olat/course/nodes/wiki/_content/edit.html deleted file mode 100644 index e89831383cd0b16a45d9ecb7ddda545cde085b3f..0000000000000000000000000000000000000000 --- a/src/main/java/org/olat/course/nodes/wiki/_content/edit.html +++ /dev/null @@ -1,27 +0,0 @@ -<fieldset class="o_form form-horizontal clearfix"> - <legend>$r.contextHelpWithWrapper("Communication and Collaboration#_bb_wiki") - $r.translate("header")</legend> - - #if ($showPreviewLink) - <div class="form-group"> - <label class="control-label col-sm-3">$r.translate("chosenwiki")</label> - <div class="col-sm-9"><p class="form-control-static">$r.render("command.preview")</p></div> - </div> - <div class="form-group"> - <div class="col-sm-offset-3 col-sm-9"> - $r.render("command.change") - #if($r.available("edit")) - $r.render("edit") - #end - </div> - </div> - #else - <div class="form-group"> - <label class="control-label col-sm-3">$r.translate("chosenwiki")</label> - <div class="col-sm-9"><p class="form-control-static">$chosen_entry</p></div> - </div> - <div class="form-group"> - <div class="col-sm-offset-3 col-sm-9">$r.render("command.create")</div> - </div> - #end -</fieldset> \ No newline at end of file diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_ar.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_ar.properties index ae1be6ecc8ea615df419d7eec1925106be4e40cd..9370bf7489ad38594ebb4eb6305654981c4ceb4e 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_ar.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_ar.properties @@ -56,7 +56,6 @@ chosenwiki=\u0627\u0644\u0648\u064A\u0643\u0649 \u0627\u0644\u0645\u062D\u062F\u062F command.change=\u0627\u0633\u062A\u0628\u062F\u0627\u0644 \u0627\u0644\u0648\u064A\u0643\u0649 command.choose=\u0627\u062E\u062A\u064A\u0627\u0631 \u0648\u064A\u0643\u0649 -command.close=\u0625\u063A\u0644\u0627\u0642 \u0627\u0644\u0639\u0631\u0636 command.create=\u0627\u062E\u062A\u064A\u0627\u0631 \u0623\u0648 \u0625\u0646\u0634\u0627\u0621 \u0623\u0648 \u0627\u0633\u062A\u064A\u0631\u0627\u062F \u0648\u064A\u0643\u0649 command.preview=\u0639\u0631\u0636 \u0627\u0644\u0645\u0639\u0627\u064A\u0646\u0629 command.show=\u0639\u0631\u0636 \u0627\u0644\u0648\u064A\u0643\u0649 @@ -77,4 +76,3 @@ header=\u0627\u062E\u062A\u064A\u0627\u0631 \u0648\u064A\u0643\u0649 no.entry.chosen=<i>\u0644\u0645 \u064A\u062A\u0645 \u0627\u062E\u062A\u064A\u0627\u0631 \u0623\u0649 \u0648\u064A\u0643\u0649</i> pane.tab.accessibility=\u0648\u0635\u0648\u0644 pane.tab.wikiconfig=\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0648\u064A\u0643\u0649 \u0627\u0644\u062A\u0639\u0644\u064A\u0645\u0649 -pane.tab.wikidisplayconfig=\u0639\u0631\u0636 diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_bg.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_bg.properties index ddb87c48176c791ad4b600842ace43c2c685df0b..41e72cf5f3e666c3b697e4ca12a77f2303ffefcf 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_bg.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_bg.properties @@ -56,7 +56,6 @@ chosenwiki=\u0418\u0437\u0431\u0440\u0430\u043D\u043E \u0423\u0438\u043A\u0438 command.change=\u0421\u043C\u0435\u043D\u0435\u0442\u0435 \u0423\u0438\u043A\u0438 command.choose=\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u0423\u0438\u043A\u0438 -command.close=\u0417\u0430\u0442\u0432\u043E\u0440\u0435\u0442\u0435 \u043F\u0440\u043E\u0437\u043E\u0440\u0435\u0446 command.preview=\u041F\u043E\u043A\u0430\u0436\u0435\u0442\u0435 \u043F\u0440\u0435\u0433\u043B\u0435\u0434 command.show=\u041F\u043E\u043A\u0430\u0436\u0435\u0442\u0435 \u0423\u0438\u043A\u0438 command.showpopup=\u041F\u043E\u043A\u0430\u0436\u0435\u0442\u0435 \u0423\u0438\u043A\u0438 \u0432 \u043D\u043E\u0432 \u043F\u0440\u043E\u0437\u043E\u0440\u0435\u0446 @@ -76,4 +75,3 @@ header=\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u0423\u0438\u043A\u0438 no.entry.chosen=<i>\u041D\u0435 \u0435 \u0438\u0437\u0431\u0440\u0430\u043D\u043E \u0423\u0438\u043A\u0438</i> pane.tab.accessibility=\u0414\u043E\u0441\u0442\u044A\u043F pane.tab.wikiconfig=\u0423\u0438\u043A\u0438 \u0443\u0447\u0435\u0431\u043D\u043E \u0441\u044A\u0434\u044A\u0440\u0436\u0430\u043D\u0438\u0435 -pane.tab.wikidisplayconfig=\u041F\u043E\u043A\u0430\u0436\u0435\u0442\u0435 diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_cs.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_cs.properties index cbd2d7a3881624591e5fe4bed8320273b5ad43e3..f2e11dacc264cf2c350ebc5c0bea2e44e48babc7 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_cs.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_cs.properties @@ -46,7 +46,6 @@ chosenwiki=Vybran\u00FD Wiki studijn\u00ED materi\u00E1l command.change=P\u0159esunout studijn\u00ED materi\u00E1l Wiki command.choose=Vybrat studijn\u00ED materi\u00E1l Wiki -command.close=Zav\u0159\u00EDt n\u00E1hled command.preview=N\u00E1hled command.show=Zobrazit studijn\u00ED materi\u00E1l Wiki command.showpopup=Zobrazit studijn\u00ED materi\u00E1l Wiki v nov\u00E9m okn\u011B @@ -66,4 +65,3 @@ header=Vyberte studijn\u00ED materi\u00E1l Wiki no.entry.chosen=<i>\u017D\u00E1dn\u00FD Wiki studijn\u00ED materi\u00E1l nebyl vybr\u00E1n</i> pane.tab.accessibility=P\u0159\u00EDstup pane.tab.wikiconfig=Studijn\u00ED materi\u00E1l -pane.tab.wikidisplayconfig=Zobrazit diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_da.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_da.properties index 72adff973d251245ffb619a3d292736bd2a53e2d..af07f5e41053e137f06fb39d7f5711ced5dc0fff 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_da.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_da.properties @@ -46,7 +46,6 @@ chosenwiki=Valgte Wiki command.change=Erstat Wiki command.choose=V\u00E6lg Wiki -command.close=Luk command.preview=Forh\u00E5ndsvisning command.show=Vis wiki command.showpopup=Vis Wiki i et nyt vindue @@ -64,4 +63,3 @@ header=V\u00E6lg Wiki no.entry.chosen=<i>Ingen Wiki er valgt</i> pane.tab.accessibility=Adgange pane.tab.wikiconfig=L\u00E6ringsindhold -pane.tab.wikidisplayconfig=Visning diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_de.properties index 6234681ba7cb5972cc51a062dd6c1380c7546ccf..fe4ba6f3d2f3e68f82349552199932114f0f9099 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_de.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_de.properties @@ -58,12 +58,15 @@ chosenwiki=Gew\u00E4hltes Wiki command.change=Wiki auswechseln command.create=Wiki w\u00E4hlen, erstellen oder importieren command.choose=Wiki w\u00E4hlen -command.close=Ansicht schliessen command.preview=Vorschau anzeigen command.show=Wiki anzeigen command.showpopup=Wiki in neuem Fenster anzeigen condition.accessibility.title=Zugang condition.editable.title=Artikel bearbeiten / erstellen +config.edit=Artikel bearbeiten +config.rights=Benutzerberechtigungen +config.role.coach=Betreuer +config.role.participant=Teilnehmer display.config=Wiki-Menu in Kursmenu? display.config.fieldsettitle=Konfiguration error.launch=Wiki konnte nicht gestartet werden. @@ -78,4 +81,4 @@ header=Wiki ausw\u00E4hlen no.entry.chosen=<i>Kein Wiki ausgew\u00E4hlt</i> pane.tab.accessibility=Zugang pane.tab.wikiconfig=Wiki-Lerninhalt -pane.tab.wikidisplayconfig=Anzeige +preview=Vorschau diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_el.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_el.properties index 3c58e3a5346983d6a2bcbef2156b672402d116f0..29caf6bb8de81347876f9789615a04e9a5af2f36 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_el.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_el.properties @@ -44,7 +44,6 @@ chosenwiki=\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03BF Wiki command.change=\u0391\u03BD\u03C4\u03B9\u03BA\u03B1\u03C4\u03AC\u03C3\u03C4\u03B1\u03C3\u03B7 Wiki command.choose=\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE Wiki -command.close=\u039A\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF \u03B5\u03BC\u03C6\u03AC\u03BD\u03B9\u03C3\u03B7\u03C2 command.create=\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE, \u03B4\u03B7\u03BC\u03B9\u03BF\u03C5\u03C1\u03B3\u03AF\u03B1 \u03AE \u03B5\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE Wiki command.preview=\u0395\u03BC\u03C6\u03AC\u03BD\u03B9\u03C3\u03B7 \u03C0\u03C1\u03BF\u03B5\u03C0\u03B9\u03C3\u03BA\u03CC\u03C0\u03B7\u03C3\u03B7\u03C2 command.show=\u0395\u03BC\u03C6\u03AC\u03BD\u03B9\u03C3\u03B7 Wiki @@ -65,5 +64,4 @@ header=Select Wiki no.entry.chosen=<i>\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03C4\u03B7\u03BA\u03B5 Wiki</i> pane.tab.accessibility=\u03A0\u03C1\u03CC\u03C3\u03B2\u03B1\u03C3\u03B7 pane.tab.wikiconfig=\u03A0\u03B5\u03C1\u03B9\u03B5\u03C7\u03CC\u03BC\u03B5\u03BD\u03BF \u03BC\u03AC\u03B8\u03B7\u03C3\u03B7\u03C2 Wiki -pane.tab.wikidisplayconfig=\u0395\u03BC\u03C6\u03AC\u03BD\u03B9\u03C3\u03B7 title_wiki=Wiki diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_en.properties index 4854ff5f1a3b73d003775bbd1f2fd6b27d7d5598..46efef79f42e60294d494193c3d9aa278c1a68f0 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_en.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_en.properties @@ -56,13 +56,16 @@ chosenwiki=Selected Wiki command.change=Replace Wiki command.choose=Choose Wiki -command.close=Close view command.create=Choose, create or import Wiki command.preview=Show preview command.show=Show Wiki command.showpopup=Show Wiki in new window condition.accessibility.title=Access condition.editable.title=Create/edit material +config.edit=Edit Material +config.rights=User rights +config.role.coach=Coach +config.role.participant=Participant display.config=Wiki menu in course menu? display.config.fieldsettitle=Configuration error.launch=Unable to start Wiki. @@ -77,5 +80,5 @@ header=Select Wiki no.entry.chosen=<i>No Wiki selected</i> pane.tab.accessibility=Access pane.tab.wikiconfig=Wiki learning content -pane.tab.wikidisplayconfig=Display +preview=Preview title_wiki=Wiki diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_es.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_es.properties index 94cf7cc6b867624c05704007eaeab3bff2f65699..682449ce885f3a34309aa527f9c558bb279705e5 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_es.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_es.properties @@ -56,7 +56,6 @@ chosenwiki=Contenido did\u00E1ctico Wiki elegido command.change=Substituye contenido did\u00E1ctico Wiki command.choose=Elige contenido did\u00E1ctico Wiki -command.close=Cerrar command.preview=Mostrar vista previa command.show=Muesta contenido did\u00E1ctico Wiki command.showpopup=Muesta contenido did\u00E1ctico Wiki en p\u00E1gina nueva @@ -76,4 +75,3 @@ header=Elegir contenido did\u00E1ctico Wiki no.entry.chosen=<i>Ningun Wiki fue elegido</i> pane.tab.accessibility=Acceso pane.tab.wikiconfig=Contenido did\u00E1ctico Wiki -pane.tab.wikidisplayconfig=Presentaci\u00F3n diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_fr.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_fr.properties index 41050b51542c9109547946e437b2d6057bedac03..00a38486739dcca65c4fe5bf8c28c0c5bc67c040 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_fr.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_fr.properties @@ -56,7 +56,6 @@ chosenwiki=Wiki s\u00E9lectionn\u00E9 command.change=Remplacer wiki command.choose=Choisir wiki -command.close=Fermer aper\u00E7u command.create=S\u00E9lectionner, cr\u00E9er ou importer wiki command.preview=Afficher aper\u00E7u command.show=Afficher wiki @@ -77,5 +76,4 @@ header=Choisir wiki no.entry.chosen=<i>aucun wiki s\u00E9lectionn\u00E9</i> pane.tab.accessibility=Acc\u00E8s pane.tab.wikiconfig=Contenu didactique Wiki -pane.tab.wikidisplayconfig=Affichage title_wiki=Wiki diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_it.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_it.properties index d2d460f8acb4ea02a11a8f263004efde31f07966..1ae98b73b6626bfa952c51dbf9f8210c27ffec72 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_it.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_it.properties @@ -56,7 +56,6 @@ chosenwiki=Wiki selezionato command.change=Sostituire wiki command.choose=Selezionare wiki -command.close=Chiudere command.create=Selezionare, creare o importare un wiki command.preview=Mostrare anteprima command.show=Mostrare wiki @@ -77,5 +76,4 @@ header=Selezione del wiki no.entry.chosen=<i>Nessun wiki selezionato</i> pane.tab.accessibility=Accesso pane.tab.wikiconfig=Contenuto didattico wiki -pane.tab.wikidisplayconfig=Visualizzazione title_wiki=Wiki diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_jp.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_jp.properties index 621e7525db2cedccf216545da918680dcf341acc..5e2e82940af476dc9dc9b34f8bbc8610a343fb65 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_jp.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_jp.properties @@ -48,7 +48,6 @@ chosenwiki=\u9078\u629E\u6E08\u307FWiki command.change=Wiki\u3092\u7F6E\u63DB\u3059\u308B command.choose=Wiki\u3092\u9078\u629E\u3059\u308B -command.close=\u30D3\u30E5\u30FC\u3092\u9589\u3058\u308B command.create=Wik\u3092\u9078\u629E\u3001\u4F5C\u6210\u307E\u305F\u306F\u30A4\u30F3\u30DD\u30FC\u30C8\u3059\u308B command.preview=\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u8868\u793A\u3059\u308B command.show=Wiki\u3092\u8868\u793A\u3059\u308B @@ -68,4 +67,3 @@ header=Wiki\u3092\u9078\u629E\u3059\u308B no.entry.chosen=<i>Wiki\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002</i> pane.tab.accessibility=\u30A2\u30AF\u30BB\u30B9 pane.tab.wikiconfig=Wiki\u5B66\u7FD2\u30B3\u30F3\u30C6\u30F3\u30C4 -pane.tab.wikidisplayconfig=\u8868\u793A diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_lt.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_lt.properties index 92e06495ff113f38fff6f8fa276d6da96f2c6855..f6ac75e26efca1f91d4decd2dedea4c3d94a9f6c 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_lt.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_lt.properties @@ -18,7 +18,6 @@ chosenwiki=Pasirinktas turinys command.change=Wiki mokymo turin\u012F pakeisti kitu command.choose=Pasirinkti Wiki mokymo turin\u012F -command.close=U\u017Edaryti command.preview=Per\u017Ei\u016Bra command.show=Rodyti Wiki mokymo turin\u012F command.showpopup=Wiki mokymo turin\u012F rodyti naujame lange @@ -35,4 +34,3 @@ header=I\u0161rinkite Wiki mokymo turin\u012F no.entry.chosen=<i>Turinys nepasirinktas</i> pane.tab.accessibility=Prieiga pane.tab.wikiconfig=Mokymo turinys -pane.tab.wikidisplayconfig=Pavaizduoti diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_nl_NL.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_nl_NL.properties index bfcf630df581065fb562709e9d5abf23e38b33bd..da733aba2da086fb9d3016f8523f196d06ddd1f8 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_nl_NL.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_nl_NL.properties @@ -56,7 +56,6 @@ chosenwiki=Selecteer Wiki command.change=Vervang Wiki command.choose=Kies Wiki -command.close=Sluit weergave command.create=Eem Wiki kiezen, aanmaken of importeren command.preview=Toon voorvertoning command.show=Toon Wiki @@ -77,5 +76,4 @@ header=Selecteer Wiki no.entry.chosen=<i>Geen Wiki geselecteerd</i> pane.tab.accessibility=Toegang pane.tab.wikiconfig=Wiki leerinhoud -pane.tab.wikidisplayconfig=Weergave title_wiki=Wiki diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_pl.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_pl.properties index 2cc891758b831b410d33bacd7a88fdc969e5d787..fd16d7f2eb7eddb3f46b9c5f21948c4ee93fb7b3 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_pl.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_pl.properties @@ -56,7 +56,6 @@ chosenwiki=Wybrany portal Wiki command.change=Zmie\u0144 portal Wiki command.choose=Wybierz portal Wiki -command.close=Zamknij widok command.create=Wybierz, utw\u00F3rz lub zaimportuj Wiki command.preview=Podgl\u0105d command.show=Poka\u017C portal Wiki @@ -77,5 +76,4 @@ header=Wybierz portal Wiki no.entry.chosen=<i>Portal Wiki nie zosta\u0142 wybrany</i> pane.tab.accessibility=Dost\u0119p pane.tab.wikiconfig=Konfiguracja Wiki -pane.tab.wikidisplayconfig=Wy\u015Bwietl title_wiki=Wiki diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_pt_BR.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_pt_BR.properties index 5705a0c5b0516ee1730f8df45d71ba45e70a849a..7900e647dfe201f2615cbf5c3cc66a8287ffeebf 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_pt_BR.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_pt_BR.properties @@ -56,7 +56,6 @@ chosenwiki=Conte\u00FAdo did\u00E1tico Wiki selecionado command.change=Substituir conte\u00FAdo did\u00E1tico Wiki command.choose=Escolher conte\u00FAdo did\u00E1tico Wiki -command.close=Fechar visualiza\u00E7\u00E3o command.create=<b>Data de vencimento</b> Data de in\u00EDcio command.preview=Visualiza\u00E7\u00E3o command.show=Exibir conte\u00FAdo did\u00E1tico Wiki @@ -77,5 +76,4 @@ header=Escolher conte\u00FAdo did\u00E1tico Wiki no.entry.chosen=<i>Nenhum conte\u00FAdo did\u00E1tico Wiki selecionado</i> pane.tab.accessibility=Acesso pane.tab.wikiconfig=Conte\u00FAdo did\u00E1tico -pane.tab.wikidisplayconfig=Exibir title_wiki=Wiki diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_pt_PT.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_pt_PT.properties index 1176f6fb07e70ba2dfad5ad26d086405c41e38d1..e425d8bbf0220889fde16b7d2f640a63916e8520 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_pt_PT.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_pt_PT.properties @@ -46,7 +46,6 @@ chosenwiki=Conte\u00FAdo did\u00E1tico Wiki selecionado command.change=Substituir conte\u00FAdo did\u00E1tico Wiki command.choose=Escolher conte\u00FAdo did\u00E1tico Wiki -command.close=Fechar visualiza\u00E7\u00E3o command.preview=Visualiza\u00E7\u00E3o command.show=Exibir conte\u00FAdo did\u00E1tico Wiki command.showpopup=Exibir conte\u00FAdo did\u00E1tico Wiki em nova janela @@ -64,4 +63,3 @@ header=Escolher conte\u00FAdo did\u00E1tico Wiki no.entry.chosen=<i>Nenhum conte\u00FAdo did\u00E1tico Wiki selecionado</i> pane.tab.accessibility=Acesso pane.tab.wikiconfig=Conte\u00FAdo did\u00E1tico -pane.tab.wikidisplayconfig=Exibir diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_ru.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_ru.properties index b1bcc43af2fa79e6edf0469da4c3058635d13bfc..09de776218f02b2f638c7a757e71d7e10dd3dc0c 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_ru.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_ru.properties @@ -18,7 +18,6 @@ chosenwiki=\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u0430\u044F \u0432\u0438\u043A\u0438 command.change=\u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u0432\u0438\u043A\u0438 command.choose=\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0438\u043A\u0438 -command.close=\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u043F\u043E\u043A\u0430\u0437 command.create=\u0412\u044B\u0431\u0440\u0430\u0442\u044C, \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0438\u043B\u0438 \u0438\u043C\u043F\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0412\u0438\u043A\u0438 command.preview=\u041F\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 command.show=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432\u0438\u043A\u0438 @@ -39,4 +38,3 @@ header=\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0438\u043A\u0438 no.entry.chosen=<i>\u041D\u0435 \u0431\u044B\u043B\u043E \u0432\u044B\u0431\u0440\u0430\u043D\u043E \u043D\u0438 \u043E\u0434\u043D\u043E\u0439 \u0432\u0438\u043A\u0438</i> pane.tab.accessibility=\u0414\u043E\u0441\u0442\u0443\u043F pane.tab.wikiconfig=\u0423\u0447\u0435\u0431\u043D\u043E\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u0435 \u0432\u0438\u043A\u0438 -pane.tab.wikidisplayconfig=\u041F\u043E\u043A\u0430\u0437 diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_sq.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_sq.properties index c7420030152451821ed377e55a897562eb12f340..b28c1d5fdfc20c0704e55a93bca8a223edf90c3d 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_sq.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_sq.properties @@ -18,7 +18,6 @@ chosenwiki=Wiki t\u00EB p\u00EBrzgjedhur command.change=Z\u00EBvend\u00EBso Wiki command.choose=P\u00EBrzgjedh Wiki -command.close=Mbylle pamjen command.preview=Paraafisho command.show=Shfaq Wiki command.showpopup=Shfaq Wiki n\u00EB nj\u00EB dritare t\u00EB re @@ -36,4 +35,3 @@ header=P\u00EBrzgjedh Wiki no.entry.chosen=<i>Asjnj\u00EB Wiki t\u00EB p\u00EBrzgjedhur</i> pane.tab.accessibility=Qasshm\u00EBria pane.tab.wikiconfig=P\u00EBrmbajtje m\u00EBsimi -pane.tab.wikidisplayconfig=Shfaq diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_zh_CN.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_zh_CN.properties index 530939bf702459b033cfe37d22408fa9d11e6040..f009bb4acf19fbb369818f1aebbcde870fc5737f 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_zh_CN.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_zh_CN.properties @@ -56,7 +56,6 @@ chosenwiki=\u9009\u4E2D\u7684Wiki\u5B66\u4E60\u5185\u5BB9 command.change=\u66FF\u6362Wiki\u5B66\u4E60\u5185\u5BB9 command.choose=\u9009\u62E9Wiki\u5B66\u4E60\u5185\u5BB9 -command.close=\u5173\u95ED\u89C6\u56FE command.create=\u9009\u62E9\uFF0C\u521B\u5EFA\u6216\u8005\u5BFC\u5165\u7EF4\u57FA command.preview=\u9884\u89C8 command.show=\u663E\u793AWiki\u5B66\u4E60\u5185\u5BB9 @@ -77,4 +76,3 @@ header=\u9009\u62E9Wiki\u5B66\u4E60\u5185\u5BB9 no.entry.chosen=<i>\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55Wiki\u5B66\u4E60\u5185\u5BB9</i> pane.tab.accessibility=\u8BBF\u95EE pane.tab.wikiconfig=\u5B66\u4E60\u5185\u5BB9 -pane.tab.wikidisplayconfig=\u663E\u793A diff --git a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_zh_TW.properties b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_zh_TW.properties index bbbd4891c006ef3eb3961cf1723b401e05ffb4f2..c5c68efd3f3164b4a228c9f83b32674867cca210 100644 --- a/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_zh_TW.properties +++ b/src/main/java/org/olat/course/nodes/wiki/_i18n/LocalStrings_zh_TW.properties @@ -27,7 +27,6 @@ chosenwiki=\u9078\u53D6\u7684 Wiki command.change=\u53D6\u4EE3 Wiki command.choose=\u9078\u53D6 Wiki -command.close=\u95DC\u9589\u8996\u7A97 command.preview=\u986F\u793A\u9810\u89BD command.show=\u986F\u793A Wiki command.showpopup=\u5728\u65B0\u8996\u7A97\u986F\u793A Wiki @@ -47,5 +46,4 @@ header=\u9078\u64C7 Wiki no.entry.chosen=<i>\u6C92\u6709 Wiki \u88AB\u9078\u53D6</i> pane.tab.accessibility=\u5B58\u53D6 pane.tab.wikiconfig=Wiki \u5B78\u7FD2\u5167\u5BB9 -pane.tab.wikidisplayconfig=\u986F\u793A title_wiki=Wiki diff --git a/src/main/java/org/olat/modules/wiki/WikiSecurityCallbackImpl.java b/src/main/java/org/olat/modules/wiki/WikiSecurityCallbackImpl.java index 0b9205ff4f635d2b095ff2112472ff42eaab0436..423fa17c044ca4d0555dae564ac2cb8c073f200c 100644 --- a/src/main/java/org/olat/modules/wiki/WikiSecurityCallbackImpl.java +++ b/src/main/java/org/olat/modules/wiki/WikiSecurityCallbackImpl.java @@ -25,7 +25,6 @@ package org.olat.modules.wiki; import org.olat.core.commons.services.notifications.SubscriptionContext; -import org.olat.course.run.userview.NodeEvaluation; import org.olat.modules.fo.ForumCallback; /** @@ -34,24 +33,17 @@ import org.olat.modules.fo.ForumCallback; */ public class WikiSecurityCallbackImpl implements WikiSecurityCallback { - private NodeEvaluation ne; + private Boolean courseEditRight; private boolean isAdministator; private boolean isGuestOnly; private boolean isGroupWiki; private boolean isResourceOwner; private SubscriptionContext subscriptionContext; - /** - * - * @param ne - * @param isOlatAdmin - * @param isGuestOnly - * @param isGroupWiki - */ - public WikiSecurityCallbackImpl(NodeEvaluation ne, boolean isAdministator, + public WikiSecurityCallbackImpl(Boolean courseEditRight, boolean isAdministator, boolean isGuestOnly, boolean isGroupWiki, boolean isResourceOwner, SubscriptionContext subscriptionContext){ - this.ne = ne; + this.courseEditRight = courseEditRight; this.isAdministator = isAdministator; this.isGuestOnly = isGuestOnly; this.isGroupWiki = isGroupWiki; @@ -59,36 +51,25 @@ public class WikiSecurityCallbackImpl implements WikiSecurityCallback { this.subscriptionContext = subscriptionContext; } - /** - * - * @return true if administrator or allowed by preconditions - */ @Override public boolean mayEditAndCreateArticle() { if(isGuestOnly) return false; if(isGroupWiki || isAdministator) { return true; } - if(ne != null && ne.isCapabilityAccessible("access") && ne.isCapabilityAccessible("editarticle")) { + if(courseEditRight != null && courseEditRight.booleanValue()) { return true; } //wiki is started from repo, and it's visible to this user, so creating pages is allowed - return ne == null; + return courseEditRight == null; } - /** - * - * @return true if admin or resource owner or used in group context - */ @Override public boolean mayEditWikiMenu(){ if(isGuestOnly) return false; return isGroupWiki || isAdministator || isResourceOwner; } - /** - * @return the subscriptionContext. if null, then no subscription must be offered - */ @Override public SubscriptionContext getSubscriptionContext() { return (isGuestOnly ? null : subscriptionContext);