Search in sources :

Example 56 with CloseableModalController

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();
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Example 57 with CloseableModalController

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");
    }
}
Also used : User(org.olat.core.id.User) ErrorEditMessage(org.olat.modules.fo.ui.events.ErrorEditMessage) Message(org.olat.modules.fo.Message) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Example 58 with CloseableModalController

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();
}
Also used : Message(org.olat.modules.fo.Message) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Example 59 with CloseableModalController

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();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Example 60 with CloseableModalController

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();
}
Also used : CollectCitationMediaController(org.olat.modules.portfolio.ui.media.CollectCitationMediaController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Aggregations

CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)789 RepositoryEntry (org.olat.repository.RepositoryEntry)52 ArrayList (java.util.ArrayList)48 Identity (org.olat.core.id.Identity)42 ReferencableEntriesSearchController (org.olat.repository.controllers.ReferencableEntriesSearchController)38 VFSContainer (org.olat.core.util.vfs.VFSContainer)24 Component (org.olat.core.gui.components.Component)20 ContactMessage (org.olat.core.util.mail.ContactMessage)20 ContactFormController (org.olat.modules.co.ContactFormController)20 File (java.io.File)17 List (java.util.List)16 UserSearchController (org.olat.admin.user.UserSearchController)16 TableEvent (org.olat.core.gui.components.table.TableEvent)16 TableMultiSelectEvent (org.olat.core.gui.components.table.TableMultiSelectEvent)16 ContactList (org.olat.core.util.mail.ContactList)16 MailTemplate (org.olat.core.util.mail.MailTemplate)14 OLATResourceable (org.olat.core.id.OLATResourceable)12 MailNotificationEditController (org.olat.core.util.mail.MailNotificationEditController)12 OLATSecurityException (org.olat.core.logging.OLATSecurityException)10 Roles (org.olat.core.id.Roles)8