use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class MessageListController method doMoveMessage.
private void doMoveMessage(UserRequest ureq, MessageView message) {
removeAsListenerAndDispose(moveCtrl);
removeAsListenerAndDispose(cmc);
if (foCallback.mayEditMessageAsModerator()) {
moveCtrl = new ForumMessageListController(ureq, getWindowControl(), forum, true);
moveCtrl.loadAllMessages();
moveCtrl.setSelectView(message);
listenTo(moveCtrl);
// push the modal dialog with the table as content
String title = "";
cmc = new CloseableModalController(getWindowControl(), "close", moveCtrl.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class MessageListController method doReply.
private void doReply(UserRequest ureq, MessageView parent, boolean quote) {
// user has clicked on button 'reply'
if (foCallback.mayReplyMessage()) {
Message newMessage = forumManager.createMessage(forum, getIdentity(), guestOnly);
Message parentMessage = forumManager.getMessageById(parent.getKey());
if (parentMessage == null) {
handleEditError(ureq);
return;
}
String reString = "";
if (parent != null && parent.isThreadTop()) {
// add reString only for the first answer
reString = translate("msg.title.re");
}
newMessage.setTitle(reString + parentMessage.getTitle());
if (quote) {
// load message to form as quotation
StringBuilder quoteSb = new StringBuilder();
quoteSb.append("<p></p><div class=\"o_quote_wrapper\"><div class=\"o_quote_author mceNonEditable\">");
String date = formatter.formatDateAndTime(parentMessage.getCreationDate());
String creatorName;
if (StringHelper.containsNonWhitespace(parentMessage.getPseudonym())) {
creatorName = parentMessage.getPseudonym();
} else if (parentMessage.isGuest()) {
creatorName = translate("guest");
} else {
User creator = parentMessage.getCreator().getUser();
creatorName = creator.getProperty(UserConstants.FIRSTNAME, getLocale()) + " " + creator.getProperty(UserConstants.LASTNAME, getLocale());
}
quoteSb.append(translate("msg.quote.intro", new String[] { date, creatorName })).append("</div><blockquote class=\"o_quote\">").append(parentMessage.getBody()).append("</blockquote></div>").append("<p></p>");
newMessage.setBody(quoteSb.toString());
}
replyMessageCtrl = new MessageEditController(ureq, getWindowControl(), forum, foCallback, newMessage, parentMessage, EditMode.reply);
listenTo(replyMessageCtrl);
String title = quote ? translate("msg.quote") : translate("msg.reply");
cmc = new CloseableModalController(getWindowControl(), "close", replyMessageCtrl.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
} else {
showInfo("may.not.reply.msg");
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class ThreadListController method doNewThread.
private void doNewThread(UserRequest ureq) {
removeAsListenerAndDispose(newThreadCtrl);
removeAsListenerAndDispose(cmc);
// user has clicked on button 'open new thread'.
Message m = forumManager.createMessage(forum, getIdentity(), guestOnly);
newThreadCtrl = new MessageEditController(ureq, getWindowControl(), forum, foCallback, m, null, EditMode.newThread);
listenTo(newThreadCtrl);
String title = translate("msg.create");
cmc = new CloseableModalController(getWindowControl(), "close", newThreadCtrl.getInitialComponent(), true, title);
listenTo(newThreadCtrl);
cmc.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class ForumPseudonymsAdminController method doNewPseudonym.
private void doNewPseudonym(UserRequest ureq) {
if (newPseudoCtrl != null)
return;
newPseudoCtrl = new NewPseudonymController(ureq, getWindowControl());
listenTo(newPseudoCtrl);
String title = translate("new.pseudonym");
cmc = new CloseableModalController(getWindowControl(), "close", newPseudoCtrl.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class MediaCenterController method doAddCitationMedia.
private void doAddCitationMedia(UserRequest ureq) {
if (citationUploadCtrl != null)
return;
citationUploadCtrl = new CollectCitationMediaController(ureq, getWindowControl());
listenTo(citationUploadCtrl);
String title = translate("add.citation");
cmc = new CloseableModalController(getWindowControl(), null, citationUploadCtrl.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
}
Aggregations