use of org.olat.course.editor.EditorMainController in project OpenOLAT by OpenOLAT.
the class CourseRuntimeController method doEdit.
@Override
protected void doEdit(UserRequest ureq) {
if ((reSecurity.isEntryAdmin() || hasCourseRight(CourseRights.RIGHT_COURSEEDITOR))) {
removeCustomCSS();
popToRoot(ureq);
cleanUp();
CourseNode currentCourseNode = getCurrentCourseNode();
WindowControl bwControl = getSubWindowControl("Editor");
EditorMainController ctrl = CourseFactory.createEditorController(ureq, addToHistory(ureq, bwControl), toolbarPanel, getRepositoryEntry(), currentCourseNode);
// user activity logger which was initialized with course run
if (ctrl != null) {
editorCtrl = pushController(ureq, "Editor", ctrl);
listenTo(editorCtrl);
setIsInEditor(true);
currentToolCtr = editorCtrl;
setActiveTool(editLink);
}
}
}
use of org.olat.course.editor.EditorMainController in project OpenOLAT by OpenOLAT.
the class ModifyCourseEvent method createEditorController.
/**
* Create an editor controller for the given course resourceable
*
* @param ureq
* @param wControl
* @param courseEntry
* @return editor controller for the given course resourceable; if the editor
* is already locked, it returns a controller with a lock message
*/
public static EditorMainController createEditorController(UserRequest ureq, WindowControl wControl, TooledStackedPanel toolbar, RepositoryEntry courseEntry, CourseNode selectedNode) {
ICourse course = loadCourse(courseEntry);
EditorMainController emc = new EditorMainController(ureq, wControl, toolbar, course, selectedNode);
if (emc.getLockEntry() == null) {
Translator translator = Util.createPackageTranslator(RunMainController.class, ureq.getLocale());
wControl.setWarning(translator.translate("error.editoralreadylocked", new String[] { "?" }));
return null;
} else if (!emc.getLockEntry().isSuccess()) {
// get i18n from the course runmaincontroller to say that this editor is
// already locked by another person
Translator translator = Util.createPackageTranslator(RunMainController.class, ureq.getLocale());
String lockerName = CoreSpringFactory.getImpl(UserManager.class).getUserDisplayName(emc.getLockEntry().getOwner());
wControl.setWarning(translator.translate("error.editoralreadylocked", new String[] { lockerName }));
return null;
}
// set the logger if editor is started
// since 5.2 groups / areas can be created from the editor -> should be logged.
emc.addLoggingResourceable(LoggingResourceable.wrap(course));
return emc;
}
use of org.olat.course.editor.EditorMainController in project openolat by klemens.
the class CourseRuntimeController method doEdit.
@Override
protected void doEdit(UserRequest ureq) {
if ((reSecurity.isEntryAdmin() || hasCourseRight(CourseRights.RIGHT_COURSEEDITOR))) {
removeCustomCSS();
popToRoot(ureq);
cleanUp();
CourseNode currentCourseNode = getCurrentCourseNode();
WindowControl bwControl = getSubWindowControl("Editor");
EditorMainController ctrl = CourseFactory.createEditorController(ureq, addToHistory(ureq, bwControl), toolbarPanel, getRepositoryEntry(), currentCourseNode);
// user activity logger which was initialized with course run
if (ctrl != null) {
editorCtrl = pushController(ureq, "Editor", ctrl);
listenTo(editorCtrl);
setIsInEditor(true);
currentToolCtr = editorCtrl;
setActiveTool(editLink);
}
}
}
use of org.olat.course.editor.EditorMainController in project openolat by klemens.
the class ModifyCourseEvent method createEditorController.
/**
* Create an editor controller for the given course resourceable
*
* @param ureq
* @param wControl
* @param courseEntry
* @return editor controller for the given course resourceable; if the editor
* is already locked, it returns a controller with a lock message
*/
public static EditorMainController createEditorController(UserRequest ureq, WindowControl wControl, TooledStackedPanel toolbar, RepositoryEntry courseEntry, CourseNode selectedNode) {
ICourse course = loadCourse(courseEntry);
EditorMainController emc = new EditorMainController(ureq, wControl, toolbar, course, selectedNode);
if (emc.getLockEntry() == null) {
Translator translator = Util.createPackageTranslator(RunMainController.class, ureq.getLocale());
wControl.setWarning(translator.translate("error.editoralreadylocked", new String[] { "?" }));
return null;
} else if (!emc.getLockEntry().isSuccess()) {
// get i18n from the course runmaincontroller to say that this editor is
// already locked by another person
Translator translator = Util.createPackageTranslator(RunMainController.class, ureq.getLocale());
String lockerName = CoreSpringFactory.getImpl(UserManager.class).getUserDisplayName(emc.getLockEntry().getOwner());
wControl.setWarning(translator.translate("error.editoralreadylocked", new String[] { lockerName }));
return null;
}
// set the logger if editor is started
// since 5.2 groups / areas can be created from the editor -> should be logged.
emc.addLoggingResourceable(LoggingResourceable.wrap(course));
return emc;
}
Aggregations