use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.
the class SharedFolderHandler method readyToDelete.
@Override
public boolean readyToDelete(RepositoryEntry entry, Identity identity, Roles roles, Locale locale, ErrorList errors) {
ReferenceManager refM = CoreSpringFactory.getImpl(ReferenceManager.class);
String referencesSummary = refM.getReferencesToSummary(entry.getOlatResource(), locale);
if (referencesSummary != null) {
Translator translator = Util.createPackageTranslator(RepositoryManager.class, locale);
errors.setError(translator.translate("details.delete.error.references", new String[] { referencesSummary, entry.getDisplayname() }));
return false;
}
return true;
}
use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.
the class GlossaryHandler method readyToDelete.
@Override
public boolean readyToDelete(RepositoryEntry entry, Identity identity, Roles roles, Locale locale, ErrorList errors) {
ReferenceManager refM = CoreSpringFactory.getImpl(ReferenceManager.class);
String referencesSummary = refM.getReferencesToSummary(entry.getOlatResource(), locale);
if (referencesSummary != null) {
Translator translator = Util.createPackageTranslator(RepositoryManager.class, locale);
errors.setError(translator.translate("details.delete.error.references", new String[] { referencesSummary, entry.getDisplayname() }));
return false;
}
return true;
}
use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.
the class GenericCourseNode method createPreviewController.
/**
* default implementation of the previewController
*
* @see org.olat.course.nodes.CourseNode#createPreviewController(org.olat.core.gui.UserRequest,
* @see org.olat.core.gui.control.WindowControl,
* @see org.olat.course.run.userview.UserCourseEnvironment,
* @see org.olat.course.run.userview.NodeEvaluation)
*/
// no userCourseEnv or NodeEvaluation needed here
@Override
public Controller createPreviewController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne) {
Translator translator = Util.createPackageTranslator(GenericCourseNode.class, ureq.getLocale());
String text = translator.translate("preview.notavailable");
return MessageUIFactory.createInfoMessage(ureq, wControl, null, text);
}
use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.
the class IQSELFCourseNode 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) {
Controller runController;
ModuleConfiguration config = getModuleConfiguration();
AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
boolean onyx = IQEditController.CONFIG_VALUE_QTI2.equals(config.get(IQEditController.CONFIG_KEY_TYPE_QTI));
if (onyx) {
Translator trans = Util.createPackageTranslator(IQEditController.class, ureq.getLocale());
runController = MessageUIFactory.createInfoMessage(ureq, wControl, "", trans.translate("error.onyx"));
} else {
RepositoryEntry testEntry = getReferencedRepositoryEntry();
if (ImsQTI21Resource.TYPE_NAME.equals(testEntry.getOlatResource().getResourceableTypeName())) {
runController = new QTI21AssessmentRunController(ureq, wControl, userCourseEnv, this);
} else {
IQSecurityCallback sec = new CourseIQSecurityCallback(this, am, ureq.getIdentity());
runController = new IQRunController(userCourseEnv, getModuleConfiguration(), sec, ureq, wControl, this);
}
}
Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, runController, this, "o_iqself_icon");
return new NodeRunConstructionResult(ctrl);
}
use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.
the class IQTESTCourseNode method getDetailsEditController.
/**
* @see org.olat.course.nodes.AssessableCourseNode#getDetailsEditController(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.WindowControl,
* org.olat.course.run.userview.UserCourseEnvironment)
*/
@Override
public Controller getDetailsEditController(UserRequest ureq, WindowControl wControl, BreadcrumbPanel stackPanel, UserCourseEnvironment coachCourseEnv, UserCourseEnvironment assessedUserCourseEnv) {
Controller detailsCtrl = null;
RepositoryEntry ref = getReferencedRepositoryEntry();
if (ref != null) {
OLATResource resource = ref.getOlatResource();
Long courseResourceableId = assessedUserCourseEnv.getCourseEnvironment().getCourseResourceableId();
Identity assessedIdentity = assessedUserCourseEnv.getIdentityEnvironment().getIdentity();
if (ImsQTI21Resource.TYPE_NAME.equals(resource.getResourceableTypeName())) {
RepositoryEntry courseEntry = assessedUserCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
detailsCtrl = new QTI21AssessmentDetailsController(ureq, wControl, (TooledStackedPanel) stackPanel, courseEntry, this, coachCourseEnv, assessedUserCourseEnv);
} else if (OnyxModule.isOnyxTest(ref.getOlatResource())) {
Translator trans = Util.createPackageTranslator(IQEditController.class, ureq.getLocale());
detailsCtrl = MessageUIFactory.createInfoMessage(ureq, wControl, "", trans.translate("error.onyx"));
} else {
detailsCtrl = new QTI12ResultDetailsController(ureq, wControl, courseResourceableId, getIdent(), coachCourseEnv, assessedIdentity, ref, AssessmentInstance.QMD_ENTRY_TYPE_ASSESS);
}
}
return detailsCtrl;
}
Aggregations