Search in sources :

Example 46 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project OpenOLAT by OpenOLAT.

the class RegistrationController method displayFinalStep.

/**
 * OO-92
 *
 * displays the final step of the registration process. (step5)<br />
 * see also _content/finish.html
 *
 * @param user
 *            The newly created User from which to display information
 */
private void displayFinalStep(Identity persitedIdentity) {
    // set wizard step to 5
    wizInfoController.setCurStep(5);
    // hide the text we don't need anymore
    myContent.contextPut("pwdhelp", "");
    myContent.contextPut("loginhelp", "");
    myContent.contextPut("text", "");
    // show last screen
    VelocityContainer finishVC = createVelocityContainer("finish");
    List<UserPropertyHandler> userPropertyHandlers = UserManager.getInstance().getUserPropertyHandlersFor(RegistrationForm2.USERPROPERTIES_FORM_IDENTIFIER, false);
    finishVC.contextPut("userPropertyHandlers", userPropertyHandlers);
    finishVC.contextPut("user", persitedIdentity.getUser());
    finishVC.contextPut("locale", getLocale());
    finishVC.contextPut("username", registrationForm.getLogin());
    finishVC.contextPut("text", getTranslator().translate("step5.reg.text", new String[] { registrationForm.getLogin() }));
    loginButton = LinkFactory.createButton("form.login", finishVC, this);
    loginButton.setCustomEnabledLinkCSS("btn btn-primary");
    loginButton.setUserObject(persitedIdentity);
    finishVC.put("loginhref", loginButton);
    regarea.setContent(finishVC);
}
Also used : UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 47 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project OpenOLAT by OpenOLAT.

the class EPArtefactViewOptionsLinkController method popUpArtefactOptionsBox.

/**
 * opens the callout
 * @param ureq
 */
private void popUpArtefactOptionsBox(UserRequest ureq) {
    VelocityContainer artOptVC = createVelocityContainer("artefactOptions");
    if (secCallback.canRemoveArtefactFromStruct()) {
        unlinkLink = LinkFactory.createCustomLink("unlink.link", "remove", "remove.from.map", Link.LINK, artOptVC, this);
    }
    if (secCallback.canAddArtefact() && secCallback.canRemoveArtefactFromStruct() && secCallback.isOwner()) {
        // isOwner: don't show move in group maps!
        moveLink = LinkFactory.createCustomLink("move.link", "move", "artefact.options.move", Link.LINK, artOptVC, this);
    }
    reflexionLink = LinkFactory.createCustomLink("reflexion.link", "reflexion", "table.header.reflexion", Link.LINK, artOptVC, this);
    if (secCallback.canEditTags()) {
        tagsLink = LinkFactory.createCustomLink("tags.link", "tags", "artefact.tags", Link.LINK, artOptVC, this);
    }
    String title = translate("option.link");
    removeAsListenerAndDispose(artefactOptionCalloutCtrl);
    artefactOptionCalloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), artOptVC, optionLink, title, true, null);
    listenTo(artefactOptionCalloutCtrl);
    artefactOptionCalloutCtrl.activate();
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 48 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project openolat by klemens.

the class CmdMoveCopy method execute.

@Override
public Controller execute(FolderComponent fc, UserRequest ureq, WindowControl windowControl, Translator trans) {
    this.folderComponent = fc;
    this.translator = trans;
    this.fileSelection = new FileSelection(ureq, fc.getCurrentContainerPath());
    VelocityContainer main = new VelocityContainer("mc", VELOCITY_ROOT + "/movecopy.html", translator, this);
    main.contextPut("fileselection", fileSelection);
    // check if command is executed on a file list containing invalid filenames or paths
    if (fileSelection.getInvalidFileNames().size() > 0) {
        main.contextPut("invalidFileNames", fileSelection.getInvalidFileNames());
    }
    selTree = new MenuTree(null, "seltree", this);
    FolderTreeModel ftm = new FolderTreeModel(ureq.getLocale(), fc.getRootContainer(), true, false, true, fc.getRootContainer().canWrite() == VFSConstants.YES, new EditableFilter());
    selTree.setTreeModel(ftm);
    selectButton = LinkFactory.createButton(move ? "move" : "copy", main, this);
    cancelButton = LinkFactory.createButton("cancel", main, this);
    main.put("seltree", selTree);
    if (move) {
        main.contextPut("move", Boolean.TRUE);
    }
    setInitialComponent(main);
    return this;
}
Also used : FileSelection(org.olat.core.commons.modules.bc.FileSelection) MenuTree(org.olat.core.gui.components.tree.MenuTree) FolderTreeModel(org.olat.core.gui.control.generic.folder.FolderTreeModel) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 49 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project openolat by klemens.

the class NotificationSubscriptionAndNewsController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.components.Component,
 *      org.olat.core.gui.control.Event)
 */
@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == tabbedPane) {
        if (event instanceof TabbedPaneChangedEvent) {
            TabbedPaneChangedEvent tabbedEvent = (TabbedPaneChangedEvent) event;
            // user clicks the tab the first time
            if (tabbedEvent.getNewComponent() == subscriptionPanel && subscriptionCtr == null) {
                subscriptionCtr = new NotificationSubscriptionController(ureq, getWindowControl(), subscriberIdentity, false);
                listenTo(subscriptionCtr);
                subscriptionPanel.setContent(subscriptionCtr.getInitialComponent());
            } else // user clicks the tab the first time
            if (tabbedEvent.getNewComponent() == rssPanel && rssPanel.getContent() == null) {
                VelocityContainer notificationsRssVC = createVelocityContainer("notificationsRSS");
                String rssLink = PersonalRSSUtil.getPersonalRssLink(ureq);
                notificationsRssVC.contextPut("rssLink", rssLink);
                User user = subscriberIdentity.getUser();
                String fullName = user.getProperty(UserConstants.FIRSTNAME, getLocale()) + " " + user.getProperty(UserConstants.LASTNAME, getLocale());
                notificationsRssVC.contextPut("fullName", fullName);
                rssPanel.setContent(notificationsRssVC);
            }
            // fxdiff BAKS-7 Resume function
            tabbedPane.addToHistory(ureq, getWindowControl());
        }
    }
}
Also used : User(org.olat.core.id.User) TabbedPaneChangedEvent(org.olat.core.gui.components.tabbedpane.TabbedPaneChangedEvent) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 50 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project openolat by klemens.

the class EdubasePeekViewController method createPeekviewComponent.

private Component createPeekviewComponent(ModuleConfiguration modulConfiguration) {
    VelocityContainer container = createVelocityContainer(PEEKVIEW_CONTAINER);
    ;
    // BookSections
    List<BookSection> bookSections = modulConfiguration.getList(EdubaseCourseNode.CONFIG_BOOK_SECTIONS, BookSection.class).stream().sorted(new PositionComparator()).limit(NUMBER_BOOK_SECTION_DESC_DISABLED).collect(Collectors.toList());
    container.contextPut("bookSections", bookSections);
    // Add a link to show all BookSections (go to node)
    Link allItemsLink = LinkFactory.createLink("peekview.allItemsLink", container, this);
    allItemsLink.setIconRightCSS("o_icon o_icon_start");
    allItemsLink.setCustomEnabledLinkCSS("pull-right");
    return container;
}
Also used : PositionComparator(org.olat.modules.edubase.model.PositionComparator) BookSection(org.olat.modules.edubase.BookSection) Link(org.olat.core.gui.components.link.Link) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Aggregations

VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)162 Component (org.olat.core.gui.components.Component)22 ArrayList (java.util.ArrayList)16 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)14 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)14 CloseableCalloutWindowController (org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)14 Link (org.olat.core.gui.components.link.Link)12 Panel (org.olat.core.gui.components.panel.Panel)12 UserRequest (org.olat.core.gui.UserRequest)10 JSAndCSSComponent (org.olat.core.gui.components.htmlheader.jscss.JSAndCSSComponent)10 List (java.util.List)8 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)8 WindowControl (org.olat.core.gui.control.WindowControl)8 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)8 Translator (org.olat.core.gui.translator.Translator)8 OLATResourceable (org.olat.core.id.OLATResourceable)8 HashMap (java.util.HashMap)6 Collectors (java.util.stream.Collectors)6 Mapper (org.olat.core.dispatcher.mapper.Mapper)6 BarSeries (org.olat.core.gui.components.chart.BarSeries)6