use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class CPTreeController method event.
/**
* Event-handling from components
*/
protected void event(UserRequest ureq, Component source, Event event) {
if (source == importLink) {
uploadCtr = new CPFileImportController(ureq, getWindowControl(), cp, currentPage);
listenTo(uploadCtr);
String title = translate("cpfileuploadcontroller.form.title");
cmc = new CloseableModalController(getWindowControl(), translate("close"), uploadCtr.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
} else if (source == newLink) {
fireEvent(ureq, new Event("New Page"));
} else if (source == copyLink) {
if (currentPage.isOrgaPage()) {
showInfo("cptreecontroller.orga.cannot.be.copied");
} else {
String newIdentifier = copyPage(currentPage);
contentCtr.displayPageWithMetadataEditor(ureq, newIdentifier);
}
} else if (source == deleteLink) {
if (currentPage.isOrgaPage()) {
showInfo("cptreecontroller.orga.cannot.be.deleted");
} else {
List<String> buttonLables = new ArrayList<String>();
buttonLables.add(translate("cptreecontrolller.delete.items.and.files"));
buttonLables.add(translate("cptreecontrolller.delete.items.only"));
buttonLables.add(translate("cancel"));
dialogCtr = DialogBoxUIFactory.createGenericDialog(ureq, getWindowControl(), translate("cptreecontroller.q_delete_title"), translate("cptreecontroller.q_delete_text", getCurrentPageInfoStringHTML()), buttonLables);
listenTo(dialogCtr);
dialogCtr.activate();
}
} else if (source == treeCtr) {
if (event instanceof TreeEvent) {
TreeEvent te = (TreeEvent) event;
String selectedNodeID = treeModel.getIdentifierForNodeID(te.getNodeId());
currentPage = new CPPage(selectedNodeID, cp);
fireEvent(ureq, new TreeEvent(TreeEvent.COMMAND_TREENODE_CLICKED, selectedNodeID));
} else if (event instanceof TreeDropEvent) {
TreeDropEvent te = (TreeDropEvent) event;
doDrop(ureq, te.getDroppedNodeId(), te.getTargetNodeId(), te.isAsChild());
}
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class OAuthAdminController method doAddOpenIDConnectIFCustom.
private void doAddOpenIDConnectIFCustom(UserRequest ureq) {
addConfigCtrl = new AddOpenIDConnectIFFullConfigurableController(ureq, getWindowControl());
listenTo(addConfigCtrl);
String title = translate("add.openidconnectif.custom");
cmc = new CloseableModalController(getWindowControl(), null, addConfigCtrl.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class OAuthRegistrationController method formOK.
@Override
protected void formOK(UserRequest ureq) {
String lang = langEl.getSelectedKey();
String username = usernameEl.getValue();
OAuthUser oauthUser = registration.getOauthUser();
User newUser = userManager.createUser(null, null, null);
for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
FormItem propertyItem = this.flc.getFormComponent(userPropertyHandler.getName());
userPropertyHandler.updateUserFromFormItem(newUser, propertyItem);
}
// Init preferences
newUser.getPreferences().setLanguage(lang);
newUser.getPreferences().setInformSessionTimeout(true);
String id;
if (StringHelper.containsNonWhitespace(oauthUser.getId())) {
id = oauthUser.getId();
} else if (StringHelper.containsNonWhitespace(oauthUser.getEmail())) {
id = oauthUser.getEmail();
} else {
id = username;
}
authenticatedIdentity = securityManager.createAndPersistIdentityAndUser(username, null, newUser, registration.getAuthProvider(), id, null);
// Add user to system users group
SecurityGroup olatuserGroup = securityManager.findSecurityGroupByName(Constants.GROUP_OLATUSERS);
securityManager.addIdentityToSecurityGroup(authenticatedIdentity, olatuserGroup);
// open disclaimer
removeAsListenerAndDispose(disclaimerController);
disclaimerController = new DisclaimerController(ureq, getWindowControl());
listenTo(disclaimerController);
cmc = new CloseableModalController(getWindowControl(), translate("close"), disclaimerController.getInitialComponent(), true, translate("disclaimer.title"));
cmc.activate();
listenTo(cmc);
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class StudentCoursesController method contact.
private void contact(UserRequest ureq) {
removeAsListenerAndDispose(cmc);
ContactMessage cmsg = new ContactMessage(getIdentity());
ContactList contactList = new ContactList("to");
contactList.add(student);
cmsg.addEmailTo(contactList);
contactCtrl = new ContactFormController(ureq, getWindowControl(), true, false, false, cmsg);
listenTo(contactCtrl);
cmc = new CloseableModalController(getWindowControl(), translate("close"), contactCtrl.getInitialComponent());
cmc.activate();
listenTo(cmc);
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class ParticipantLectureBlocksController method doAppeal.
private void doAppeal(UserRequest ureq, LectureBlockAndRollCall row) {
if (appealCtrl != null)
return;
LectureBlock block = lectureService.getLectureBlock(row.getLectureBlockRef());
List<Identity> teachers = lectureService.getTeachers(block);
List<Identity> onwers = repositoryService.getMembers(entry, GroupRoles.owner.name());
ContactList contactList = new ContactList(translate("appeal.contact.list"));
contactList.addAllIdentites(teachers);
contactList.addAllIdentites(onwers);
StringBuilder teacherNames = new StringBuilder();
for (Identity teacher : teachers) {
if (teacherNames.length() > 0)
teacherNames.append(", ");
teacherNames.append(teacher.getUser().getFirstName()).append(" ").append(teacher.getUser().getLastName());
}
String date = Formatter.getInstance(getLocale()).formatDate(block.getStartDate());
String[] args = new String[] { row.getLectureBlockTitle(), teacherNames.toString(), date };
ContactMessage cmsg = new ContactMessage(getIdentity());
cmsg.addEmailTo(contactList);
cmsg.setSubject(translate("appeal.subject", args));
cmsg.setBodyText(translate("appeal.body", args));
appealCtrl = new ContactFormController(ureq, getWindowControl(), true, false, false, cmsg);
appealCtrl.setUserObject(row);
appealCtrl.setContactFormTitle(translate("new.appeal.title"));
listenTo(appealCtrl);
String title = translate("appeal.title", new String[] { row.getLectureBlockTitle() });
cmc = new CloseableModalController(getWindowControl(), "close", appealCtrl.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
Aggregations