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);
}
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();
}
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;
}
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());
}
}
}
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;
}
Aggregations