Search in sources :

Example 36 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class SharedFolderHandler method createEditorController.

@Override
public Controller createEditorController(RepositoryEntry re, UserRequest ureq, WindowControl wControl, TooledStackedPanel toolbar) {
    Controller sharedFolderCtr = new SharedFolderEditorController(re, ureq, wControl);
    // use on column layout
    LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, sharedFolderCtr);
    // dispose content on layout dispose
    layoutCtr.addDisposableChildController(sharedFolderCtr);
    return layoutCtr;
}
Also used : LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) CorruptedCourseController(org.olat.repository.ui.CorruptedCourseController) MainLayoutController(org.olat.core.gui.control.generic.layout.MainLayoutController) SharedFolderDisplayController(org.olat.modules.sharedfolder.SharedFolderDisplayController) SharedFolderEditorController(org.olat.modules.sharedfolder.SharedFolderEditorController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) RepositoryEntryRuntimeController(org.olat.repository.ui.RepositoryEntryRuntimeController) Controller(org.olat.core.gui.control.Controller) SharedFolderEditorController(org.olat.modules.sharedfolder.SharedFolderEditorController)

Example 37 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class GlossaryHandler method createEditorController.

@Override
public Controller createEditorController(RepositoryEntry re, UserRequest ureq, WindowControl wControl, TooledStackedPanel toolbar) {
    VFSContainer glossaryFolder = GlossaryManager.getInstance().getGlossaryRootFolder(re.getOlatResource());
    Properties glossProps = GlossaryItemManager.getInstance().getGlossaryConfig(glossaryFolder);
    boolean editableByUser = "true".equals(glossProps.getProperty(GlossaryItemManager.EDIT_USERS));
    GlossarySecurityCallback secCallback;
    if (ureq.getUserSession().getRoles().isGuestOnly()) {
        secCallback = new GlossarySecurityCallbackImpl();
    } else {
        secCallback = new GlossarySecurityCallbackImpl(true, true, editableByUser, ureq.getIdentity().getKey());
    }
    GlossaryMainController gctr = new GlossaryMainController(wControl, ureq, glossaryFolder, re.getOlatResource(), secCallback, false);
    // use on column layout
    LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, gctr);
    // dispose content on layout dispose
    layoutCtr.addDisposableChildController(gctr);
    return layoutCtr;
}
Also used : GlossarySecurityCallback(org.olat.core.commons.modules.glossary.GlossarySecurityCallback) GlossaryMainController(org.olat.core.commons.modules.glossary.GlossaryMainController) GlossarySecurityCallbackImpl(org.olat.core.commons.modules.glossary.GlossarySecurityCallbackImpl) VFSContainer(org.olat.core.util.vfs.VFSContainer) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Properties(java.util.Properties)

Example 38 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class ScormAPIandDisplayController method configurationChanged.

@Override
public void configurationChanged() {
    if (columnLayoutCtr instanceof LayoutMain3ColsBackController) {
        LayoutMain3ColsBackController layoutCtr = (LayoutMain3ColsBackController) columnLayoutCtr;
        layoutCtr.deactivate();
    } else if (columnLayoutCtr instanceof LayoutMain3ColsController) {
        LayoutMain3ColsController layoutCtr = (LayoutMain3ColsController) columnLayoutCtr;
        layoutCtr.deactivate(null);
    }
}
Also used : LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) LayoutMain3ColsBackController(org.olat.core.commons.fullWebApp.LayoutMain3ColsBackController)

Example 39 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class RepositoyUIFactory method createRepoEntryDisabledDueToSecurityMessageController.

/**
 * Create main controller that does nothing but displaying a message that
 * this resource is disabled due to security constraints
 *
 * @param ureq
 * @param wControl
 * @return
 */
public static GenericMainController createRepoEntryDisabledDueToSecurityMessageController(UserRequest ureq, WindowControl wControl) {
    // wrap simple message into mainLayout
    GenericMainController glc = new GenericMainController(ureq, wControl) {

        @Override
        public void init(UserRequest uureq) {
            Panel empty = new Panel("empty");
            setTranslator(Util.createPackageTranslator(RepositoryModule.class, uureq.getLocale()));
            MessageController contentCtr = MessageUIFactory.createInfoMessage(uureq, getWindowControl(), translate("security.disabled.title"), translate("security.disabled.info"));
            // auto dispose later
            listenTo(contentCtr);
            Component resComp = contentCtr.getInitialComponent();
            LayoutMain3ColsController columnLayoutCtr = new LayoutMain3ColsController(uureq, getWindowControl(), empty, resComp, /*do not save no prefs*/
            null);
            // auto dispose later
            listenTo(columnLayoutCtr);
            putInitialPanel(columnLayoutCtr.getInitialComponent());
        }

        @Override
        protected Controller handleOwnMenuTreeEvent(Object uobject, UserRequest uureq) {
            // no menutree means no menu events.
            return null;
        }
    };
    glc.init(ureq);
    return glc;
}
Also used : Panel(org.olat.core.gui.components.panel.Panel) MessageController(org.olat.core.gui.control.generic.messages.MessageController) GenericMainController(org.olat.core.gui.control.generic.layout.GenericMainController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Component(org.olat.core.gui.components.Component) UserRequest(org.olat.core.gui.UserRequest) RepositoryModule(org.olat.repository.RepositoryModule)

Example 40 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class RichTextElementComponent method createFileSelectorPopupWindow.

private void createFileSelectorPopupWindow(final UserRequest ureq, final String type, final String fileName) {
    // Get allowed suffixes from configuration and requested media browser type from event
    final RichTextConfiguration config = element.getEditorConfiguration();
    final boolean allowCustomMediaFactory = config.isAllowCustomMediaFactory();
    final boolean uriValidation = config.isFilenameUriValidation();
    final String[] suffixes;
    if (type.equals(CMD_FILEBROWSER)) {
        suffixes = null;
    } else if (type.equals(CMD_IMAGEBROWSER)) {
        suffixes = config.getLinkBrowserImageSuffixes();
    } else if (type.equals(CMD_FLASHPLAYERBROWSER)) {
        suffixes = config.getLinkBrowserFlashPlayerSuffixes();
    } else {
        suffixes = config.getLinkBrowserMediaSuffixes();
    }
    // Show popup window with file browser to select file
    // Only one popup file chooser allowed at any time. ccc contains icc,
    // icc gets disposed by ccc
    // helper code which is used to create link chooser controller
    ControllerCreator linkChooserControllerCreator = new ControllerCreator() {

        @Override
        public Controller createController(UserRequest lureq, WindowControl lwControl) {
            LinkChooserController myLinkChooserController;
            VFSContainer baseContainer = config.getLinkBrowserBaseContainer();
            String uploadRelPath = config.getLinkBrowserUploadRelPath();
            String absolutePath = config.getLinkBrowserAbsolutFilePath();
            CustomLinkTreeModel linkBrowserCustomTreeModel = config.getLinkBrowserCustomLinkTreeModel();
            if (type.equals(CMD_FILEBROWSER)) {
                // when in file mode we include the internal links to the selection
                myLinkChooserController = new LinkChooserController(lureq, lwControl, baseContainer, uploadRelPath, absolutePath, suffixes, uriValidation, fileName, linkBrowserCustomTreeModel, allowCustomMediaFactory);
            } else {
                // in media or image mode, internal links make no sense here
                myLinkChooserController = new LinkChooserController(lureq, lwControl, baseContainer, uploadRelPath, absolutePath, suffixes, uriValidation, fileName, null, allowCustomMediaFactory);
            }
            return new LayoutMain3ColsController(lureq, lwControl, myLinkChooserController);
        }
    };
    PopupBrowserWindow pbw = Windows.getWindows(ureq).getWindowManager().createNewPopupBrowserWindowFor(ureq, linkChooserControllerCreator);
    pbw.open(ureq);
}
Also used : CustomLinkTreeModel(org.olat.core.commons.controllers.linkchooser.CustomLinkTreeModel) LinkChooserController(org.olat.core.commons.controllers.linkchooser.LinkChooserController) PopupBrowserWindow(org.olat.core.gui.control.generic.popup.PopupBrowserWindow) VFSContainer(org.olat.core.util.vfs.VFSContainer) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) WindowControl(org.olat.core.gui.control.WindowControl) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Aggregations

LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)80 WindowControl (org.olat.core.gui.control.WindowControl)38 Controller (org.olat.core.gui.control.Controller)36 UserRequest (org.olat.core.gui.UserRequest)34 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)28 Panel (org.olat.core.gui.components.panel.Panel)12 BasicController (org.olat.core.gui.control.controller.BasicController)12 RepositoryEntry (org.olat.repository.RepositoryEntry)12 MainLayoutController (org.olat.core.gui.control.generic.layout.MainLayoutController)10 PopupBrowserWindow (org.olat.core.gui.control.generic.popup.PopupBrowserWindow)10 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)8 OLATResourceable (org.olat.core.id.OLATResourceable)8 ContextEntry (org.olat.core.id.context.ContextEntry)8 AssertException (org.olat.core.logging.AssertException)8 ICourse (org.olat.course.ICourse)8 GlossaryMainController (org.olat.core.commons.modules.glossary.GlossaryMainController)6 Component (org.olat.core.gui.components.Component)6 TooledStackedPanel (org.olat.core.gui.components.stack.TooledStackedPanel)6 CloneController (org.olat.core.gui.control.generic.clone.CloneController)6 CertificateAndEfficiencyStatementController (org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController)6