use of org.olat.core.commons.modules.glossary.GlossaryMainController in project openolat by klemens.
the class GlossaryHandler method createEditorController.
@Override
public Controller createEditorController(RepositoryEntry re, UserRequest ureq, WindowControl wControl, TooledStackedPanel toolbar) {
VFSContainer glossaryFolder = GlossaryManager.getInstance().getGlossaryRootFolder(re.getOlatResource());
Properties glossProps = GlossaryItemManager.getInstance().getGlossaryConfig(glossaryFolder);
boolean editableByUser = "true".equals(glossProps.getProperty(GlossaryItemManager.EDIT_USERS));
GlossarySecurityCallback secCallback;
if (ureq.getUserSession().getRoles().isGuestOnly()) {
secCallback = new GlossarySecurityCallbackImpl();
} else {
secCallback = new GlossarySecurityCallbackImpl(true, true, editableByUser, ureq.getIdentity().getKey());
}
GlossaryMainController gctr = new GlossaryMainController(wControl, ureq, glossaryFolder, re.getOlatResource(), secCallback, false);
// use on column layout
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, gctr);
// dispose content on layout dispose
layoutCtr.addDisposableChildController(gctr);
return layoutCtr;
}
Aggregations