Search in sources :

Example 1 with CORunController

use of org.olat.course.nodes.co.CORunController in project OpenOLAT by OpenOLAT.

the class COCourseNode method createNodeRunConstructionResult.

/**
 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl,
 *      org.olat.course.run.userview.UserCourseEnvironment,
 *      org.olat.course.run.userview.NodeEvaluation)
 */
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Controller controller;
    // Do not allow guests to send anonymous emails
    Roles roles = ureq.getUserSession().getRoles();
    if (roles.isGuestOnly()) {
        Translator trans = Util.createPackageTranslator(COCourseNode.class, ureq.getLocale());
        String title = trans.translate("guestnoaccess.title");
        String message = trans.translate("guestnoaccess.message");
        controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else if (userCourseEnv.isCourseReadOnly()) {
        Translator trans = Util.createPackageTranslator(COCourseNode.class, ureq.getLocale());
        String title = trans.translate("freezenoaccess.title");
        String message = trans.translate("freezenoaccess.message");
        controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
        controller = new CORunController(getModuleConfiguration(), ureq, wControl, userCourseEnv);
    }
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_co_icon");
    return new NodeRunConstructionResult(ctrl);
}
Also used : CORunController(org.olat.course.nodes.co.CORunController) Translator(org.olat.core.gui.translator.Translator) Roles(org.olat.core.id.Roles) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) CORunController(org.olat.course.nodes.co.CORunController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) COEditController(org.olat.course.nodes.co.COEditController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 2 with CORunController

use of org.olat.course.nodes.co.CORunController in project openolat by klemens.

the class COCourseNode method createNodeRunConstructionResult.

/**
 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl,
 *      org.olat.course.run.userview.UserCourseEnvironment,
 *      org.olat.course.run.userview.NodeEvaluation)
 */
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Controller controller;
    // Do not allow guests to send anonymous emails
    Roles roles = ureq.getUserSession().getRoles();
    if (roles.isGuestOnly()) {
        Translator trans = Util.createPackageTranslator(COCourseNode.class, ureq.getLocale());
        String title = trans.translate("guestnoaccess.title");
        String message = trans.translate("guestnoaccess.message");
        controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else if (userCourseEnv.isCourseReadOnly()) {
        Translator trans = Util.createPackageTranslator(COCourseNode.class, ureq.getLocale());
        String title = trans.translate("freezenoaccess.title");
        String message = trans.translate("freezenoaccess.message");
        controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
        controller = new CORunController(getModuleConfiguration(), ureq, wControl, userCourseEnv);
    }
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_co_icon");
    return new NodeRunConstructionResult(ctrl);
}
Also used : CORunController(org.olat.course.nodes.co.CORunController) Translator(org.olat.core.gui.translator.Translator) Roles(org.olat.core.id.Roles) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) CORunController(org.olat.course.nodes.co.CORunController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) COEditController(org.olat.course.nodes.co.COEditController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Aggregations

Controller (org.olat.core.gui.control.Controller)2 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)2 Translator (org.olat.core.gui.translator.Translator)2 Roles (org.olat.core.id.Roles)2 ConditionEditController (org.olat.course.condition.ConditionEditController)2 NodeEditController (org.olat.course.editor.NodeEditController)2 COEditController (org.olat.course.nodes.co.COEditController)2 CORunController (org.olat.course.nodes.co.CORunController)2 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)2