Search in sources :

Example 11 with LinkPopupSettings

use of org.olat.core.gui.components.link.LinkPopupSettings in project OpenOLAT by OpenOLAT.

the class PageRunController method initTools.

@Override
public void initTools() {
    editLink(!openInEditMode);
    stackPanel.addTool(editLink, Align.left);
    editMetadataLink = LinkFactory.createToolLink("edit.page.metadata", translate("edit.page.metadata"), this);
    editMetadataLink.setIconLeftCSS("o_icon o_icon-lg o_icon_edit_metadata");
    editMetadataLink.setVisible(secCallback.canEditPageMetadata(page, assignments));
    stackPanel.addTool(editMetadataLink, Align.left);
    if (secCallback.canExportBinder()) {
        Dropdown exportTools = new Dropdown("export.page", "export.page", false, getTranslator());
        exportTools.setElementCssClass("o_sel_pf_export_tools");
        exportTools.setIconCSS("o_icon o_icon_download");
        stackPanel.addTool(exportTools, Align.left);
        printLink = LinkFactory.createToolLink("export.page.onepage", translate("export.page.onepage"), this);
        printLink.setIconLeftCSS("o_icon o_icon_print");
        printLink.setPopup(new LinkPopupSettings(950, 750, "binder"));
        exportTools.addComponent(printLink);
    }
    moveToTrashLink = LinkFactory.createToolLink("delete.page", translate("delete.page"), this);
    moveToTrashLink.setIconLeftCSS("o_icon o_icon-lg o_icon_delete_item");
    moveToTrashLink.setElementCssClass("o_sel_pf_move_page_to_trash");
    moveToTrashLink.setVisible(secCallback.canDeletePage(page));
    stackPanel.addTool(moveToTrashLink, Align.right);
    if (secCallback.canRestorePage(page)) {
        restoreLink = LinkFactory.createToolLink("restore.page", translate("restore.page"), this);
        restoreLink.setIconLeftCSS("o_icon o_icon-lg o_icon_restore");
        stackPanel.addTool(restoreLink, Align.left);
        deleteLink = LinkFactory.createToolLink("delete.def.page", translate("delete.def.page"), this);
        deleteLink.setIconLeftCSS("o_icon o_icon-lg o_icon_delete_item");
        deleteLink.setElementCssClass("o_sel_pf_delete_page");
        stackPanel.addTool(deleteLink, Align.left);
    }
}
Also used : LinkPopupSettings(org.olat.core.gui.components.link.LinkPopupSettings) Dropdown(org.olat.core.gui.components.dropdown.Dropdown)

Example 12 with LinkPopupSettings

use of org.olat.core.gui.components.link.LinkPopupSettings in project openolat by klemens.

the class TableOfContentController method initTools.

@Override
public void initTools() {
    if (secCallback.canEditMetadataBinder()) {
        editBinderMetadataLink = LinkFactory.createToolLink("edit.binder.metadata", translate("edit.binder.metadata"), this);
        editBinderMetadataLink.setIconLeftCSS("o_icon o_icon-lg o_icon_new_portfolio");
        stackPanel.addTool(editBinderMetadataLink, Align.left);
    }
    if (secCallback.canMoveToTrashBinder(binder)) {
        moveToTrashBinderLink = LinkFactory.createToolLink("delete.binder", translate("delete.binder"), this);
        moveToTrashBinderLink.setIconLeftCSS("o_icon o_icon-lg o_icon_delete_item");
        stackPanel.addTool(moveToTrashBinderLink, Align.left);
    }
    if (secCallback.canExportBinder()) {
        Dropdown exportTools = new Dropdown("export.binder", "export.binder", false, getTranslator());
        exportTools.setElementCssClass("o_sel_pf_export_tools");
        exportTools.setIconCSS("o_icon o_icon_download");
        stackPanel.addTool(exportTools, Align.left);
        exportBinderAsCpLink = LinkFactory.createToolLink("export.binder.cp", translate("export.binder.cp"), this);
        exportBinderAsCpLink.setIconLeftCSS("o_icon o_icon_download");
        exportTools.addComponent(exportBinderAsCpLink);
        printLink = LinkFactory.createToolLink("export.binder.onepage", translate("export.binder.onepage"), this);
        printLink.setIconLeftCSS("o_icon o_icon_print");
        printLink.setPopup(new LinkPopupSettings(950, 750, "binder"));
        exportTools.addComponent(printLink);
    }
    if (secCallback.canDeleteBinder(binder)) {
        deleteBinderLink = LinkFactory.createToolLink("delete.binder", translate("delete.binder"), this);
        deleteBinderLink.setIconLeftCSS("o_icon o_icon-lg o_icon_delete_item");
        stackPanel.addTool(deleteBinderLink, Align.left);
        restoreBinderLink = LinkFactory.createToolLink("restore.binder", translate("restore.binder"), this);
        restoreBinderLink.setIconLeftCSS("o_icon o_icon-lg o_icon_restore");
        stackPanel.addTool(restoreBinderLink, Align.left);
    }
    if (secCallback.canAddSection()) {
        newSectionTool = LinkFactory.createToolLink("new.section", translate("create.new.section"), this);
        newSectionTool.setIconLeftCSS("o_icon o_icon-lg o_icon_new_portfolio");
        newSectionTool.setElementCssClass("o_sel_pf_new_section");
        stackPanel.addTool(newSectionTool, Align.right);
    }
    if (secCallback.canAddPage(null)) {
        newEntryLink = LinkFactory.createToolLink("new.page", translate("create.new.page"), this);
        newEntryLink.setIconLeftCSS("o_icon o_icon-lg o_icon_new_portfolio");
        newEntryLink.setElementCssClass("o_sel_pf_new_entry");
        newEntryLink.setVisible(sectionList != null && sectionList.size() > 0);
        stackPanel.addTool(newEntryLink, Align.right);
    }
    if (secCallback.canNewAssignment()) {
        newAssignmentLink = LinkFactory.createToolLink("new.assignment", translate("create.new.assignment"), this);
        newAssignmentLink.setIconLeftCSS("o_icon o_icon-lg o_icon_new_portfolio");
        newAssignmentLink.setElementCssClass("o_sel_pf_new_assignment");
        newAssignmentLink.setVisible(sectionList != null && sectionList.size() > 0);
        stackPanel.addTool(newAssignmentLink, Align.right);
    }
}
Also used : LinkPopupSettings(org.olat.core.gui.components.link.LinkPopupSettings) Dropdown(org.olat.core.gui.components.dropdown.Dropdown)

Example 13 with LinkPopupSettings

use of org.olat.core.gui.components.link.LinkPopupSettings in project openolat by klemens.

the class MembersAvatarDisplayRunController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    Comparator<Identity> idComparator = new IdentityComparator();
    Collections.sort(owners, idComparator);
    Collections.sort(coaches, idComparator);
    Collections.sort(participants, idComparator);
    Collections.sort(waiting, idComparator);
    if (canEmail) {
        allEmailLink = uifactory.addFormLink("email", "members.email.title", null, formLayout, Link.BUTTON);
        allEmailLink.setIconLeftCSS("o_icon o_icon_mail");
    }
    IdentityEnvironment idEnv = ureq.getUserSession().getIdentityEnvironment();
    Identity ownId = idEnv.getIdentity();
    Roles roles = idEnv.getRoles();
    if (editable && (roles.isOLATAdmin() || roles.isGroupManager() || owners.contains(ownId) || coaches.contains(ownId) || (canDownload && !waiting.contains(ownId)))) {
        downloadLink = uifactory.addFormLink("download", "members.download", null, formLayout, Link.BUTTON);
        downloadLink.setIconLeftCSS("o_icon o_icon_download");
        if (formLayout instanceof FormLayoutContainer) {
            printLink = LinkFactory.createButton("print", ((FormLayoutContainer) formLayout).getFormItemComponent(), this);
            printLink.setIconLeftCSS("o_icon o_icon_print o_icon-lg");
            printLink.setPopup(new LinkPopupSettings(700, 500, "print-members"));
            ((FormLayoutContainer) formLayout).getFormItemComponent().put("print", printLink);
        }
    }
    Set<Long> duplicateCatcher = deduplicateList ? new HashSet<Long>() : null;
    ownerList = initFormMemberList("owners", owners, duplicateCatcher, formLayout, canEmail);
    coachList = initFormMemberList("coaches", coaches, duplicateCatcher, formLayout, canEmail);
    participantList = initFormMemberList("participants", participants, duplicateCatcher, formLayout, canEmail);
    waitingtList = initFormMemberList("waiting", waiting, duplicateCatcher, formLayout, canEmail);
    if (formLayout instanceof FormLayoutContainer) {
        FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
        layoutCont.contextPut("showOwners", showOwners);
        layoutCont.contextPut("hasOwners", new Boolean(!ownerList.isEmpty()));
        layoutCont.contextPut("showCoaches", showCoaches);
        layoutCont.contextPut("hasCoaches", new Boolean(!coachList.isEmpty()));
        layoutCont.contextPut("showParticipants", showParticipants);
        layoutCont.contextPut("hasParticipants", new Boolean(!participantList.isEmpty()));
        layoutCont.contextPut("showWaiting", showWaiting);
        layoutCont.contextPut("hasWaiting", new Boolean(!waitingtList.isEmpty()));
    }
}
Also used : LinkPopupSettings(org.olat.core.gui.components.link.LinkPopupSettings) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) Roles(org.olat.core.id.Roles) Identity(org.olat.core.id.Identity) IdentityEnvironment(org.olat.core.id.IdentityEnvironment)

Example 14 with LinkPopupSettings

use of org.olat.core.gui.components.link.LinkPopupSettings in project openolat by klemens.

the class CourseRuntimeController method initGeneralTools.

private void initGeneralTools(ICourse course) {
    boolean assessmentLock = isAssessmentLock();
    CourseConfig cc = course.getCourseConfig();
    if (!assessmentLock && showInfos) {
        detailsLink = LinkFactory.createToolLink("courseconfig", translate("command.courseconfig"), this, "o_icon_details");
        toolbarPanel.addTool(detailsLink);
    }
    boolean calendarIsEnabled = !assessmentLock && !isGuestOnly && calendarModule.isEnabled() && calendarModule.isEnableCourseToolCalendar() && reSecurity.canLaunch();
    if (calendarIsEnabled && getUserCourseEnvironment() != null) {
        calendarLink = LinkFactory.createToolLink("calendar", translate("command.calendar"), this, "o_icon_calendar");
        calendarLink.setPopup(new LinkPopupSettings(950, 750, "cal"));
        calendarLink.setVisible(cc.isCalendarEnabled());
        toolbarPanel.addTool(calendarLink);
    }
    if (!assessmentLock) {
        glossary = new Dropdown("glossary", "command.glossary", false, getTranslator());
        glossary.setIconCSS("o_icon o_FileResource-GLOSSARY_icon");
        glossary.setVisible(cc.hasGlossary());
        openGlossaryLink = LinkFactory.createToolLink("command.glossary.open", translate("command.glossary.open"), this);
        openGlossaryLink.setPopup(new LinkPopupSettings(950, 750, "gloss"));
        glossary.addComponent(openGlossaryLink);
        enableGlossaryLink = LinkFactory.createToolLink("command.glossary.on.off", translate("command.glossary.on.alt"), this);
        glossary.addComponent(enableGlossaryLink);
        toolbarPanel.addTool(glossary);
    }
    if (!assessmentLock && isLecturesLinkEnabled()) {
        lecturesLink = LinkFactory.createToolLink("command.lectures", translate("command.lectures"), this, "o_icon_lecture");
        toolbarPanel.addTool(lecturesLink);
    }
    // add group chat to toolbox
    boolean chatIsEnabled = !assessmentLock && !isGuestOnly && imModule.isEnabled() && imModule.isCourseEnabled() && reSecurity.canLaunch();
    if (chatIsEnabled && getUserCourseEnvironment() != null && !getUserCourseEnvironment().isCourseReadOnly()) {
        chatLink = LinkFactory.createToolLink("chat", translate("command.coursechat"), this, "o_icon_chat");
        chatLink.setVisible(imModule.isCourseEnabled() && cc.isChatEnabled());
        toolbarPanel.addTool(chatLink);
    }
    // add course search to toolbox
    boolean isSearchEnabled = !assessmentLock && searchModule.isSearchAllowed(roles);
    if (isSearchEnabled) {
        searchLink = LinkFactory.createToolLink("coursesearch", translate("command.coursesearch"), this, "o_icon_search");
        searchLink.setVisible(cc.isCourseSearchEnabled());
        toolbarPanel.addTool(searchLink);
    }
}
Also used : LinkPopupSettings(org.olat.core.gui.components.link.LinkPopupSettings) Dropdown(org.olat.core.gui.components.dropdown.Dropdown) CourseConfig(org.olat.course.config.CourseConfig)

Aggregations

LinkPopupSettings (org.olat.core.gui.components.link.LinkPopupSettings)14 Dropdown (org.olat.core.gui.components.dropdown.Dropdown)10 Link (org.olat.core.gui.components.link.Link)4 Identity (org.olat.core.id.Identity)4 CourseConfig (org.olat.course.config.CourseConfig)4 ArrayList (java.util.ArrayList)2 Mark (org.olat.core.commons.services.mark.Mark)2 MarkResourceStat (org.olat.core.commons.services.mark.MarkResourceStat)2 Component (org.olat.core.gui.components.Component)2 Spacer (org.olat.core.gui.components.dropdown.Dropdown.Spacer)2 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)2 Controller (org.olat.core.gui.control.Controller)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 DialogBoxController (org.olat.core.gui.control.generic.modal.DialogBoxController)2 StepsMainRunController (org.olat.core.gui.control.generic.wizard.StepsMainRunController)2 IdentityEnvironment (org.olat.core.id.IdentityEnvironment)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 Roles (org.olat.core.id.Roles)2 VFSContainer (org.olat.core.util.vfs.VFSContainer)2