Search in sources :

Example 76 with LayoutMain3ColsController

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

the class BusinessGroupMainRunController method getOnWaitingListMessage.

private Component getOnWaitingListMessage(UserRequest ureq, BusinessGroup group) {
    VelocityContainer vc = createVelocityContainer("waiting");
    vc.contextPut("name", group.getName());
    columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), null, vc, "grouprun");
    // cleanup on dispose
    listenTo(columnLayoutCtr);
    return columnLayoutCtr.getInitialComponent();
}
Also used : LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 77 with LayoutMain3ColsController

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

the class QTIEditorMainController method init.

private void init(UserRequest ureq) {
    main = createVelocityContainer("index");
    JSAndCSSComponent jsAndCss;
    // Add html header js
    jsAndCss = new JSAndCSSComponent("qitjsandcss", new String[] { "js/openolat/qti.js" }, null);
    main.put("qitjsandcss", jsAndCss);
    mainPanel = new Panel("p_qti_editor");
    mainPanel.setContent(main);
    if (notEditable) {
        // test not editable
        VelocityContainer notEditableVc = createVelocityContainer("notEditable");
        notEditableButton = LinkFactory.createButton("ok", notEditableVc, this);
        Panel panel = new Panel("notEditable");
        panel.setContent(notEditableVc);
        columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), null, panel, null);
        putInitialPanel(columnLayoutCtr.getInitialComponent());
        return;
    }
    stackedPanel = new TooledStackedPanel("qtiEditorStackedPanel", getTranslator(), this);
    stackedPanel.setCssClass("o_edit_mode");
    // initialize the history
    if (qtiPackage.isResumed() && qtiPackage.hasSerializedChangelog()) {
        // there were already changes made -> reload!
        history = qtiPackage.loadChangelog();
    } else {
        // start with a fresh history. Editor is resumed but no changes were made
        // so far.
        history = new HashMap<String, Memento>();
    }
    // The menu tree model represents the structure of the qti document.
    // All insert/move operations on the model are propagated to the structure
    // by the node
    menuTreeModel = new QTIEditorTreeModel(qtiPackage);
    menuTree = new MenuTree("QTIDocumentTree");
    menuTree.setTreeModel(menuTreeModel);
    menuTree.setSelectedNodeId(menuTree.getTreeModel().getRootNode().getIdent());
    // listen to the tree
    menuTree.addListener(this);
    // remember the qtidoc title when we started this editor, to correctly name
    // the history report
    startedWithTitle = menuTree.getSelectedNode().getAltText();
    // 
    main.put("tabbedPane", menuTreeModel.getQtiRootNode().createEditTabbedPane(ureq, getWindowControl(), getTranslator(), this));
    main.contextPut("qtititle", menuTreeModel.getQtiRootNode().getAltText());
    main.contextPut("isRestrictedEdit", restrictedEdit ? Boolean.TRUE : Boolean.FALSE);
    // 
    columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), menuTree, mainPanel, "qtieditor" + qtiPackage.getRepresentingResourceable());
    listenTo(columnLayoutCtr);
    stackedPanel.pushController("Editor", columnLayoutCtr);
    // qtiPackage must be loaded previousely
    populateToolC();
    // Add css background
    if (restrictedEdit) {
        addSectionLink.setEnabled(false);
        addSCLink.setEnabled(false);
        addMCLink.setEnabled(false);
        addPoolLink.setEnabled(false);
        addFIBLink.setEnabled(false);
        if (!qtiPackage.getQTIDocument().isSurvey()) {
            addKPrimLink.setEnabled(false);
        }
        addEssayLink.setEnabled(false);
        columnLayoutCtr.addCssClassToMain("o_editor_qti_correct");
    } else {
        columnLayoutCtr.addCssClassToMain("o_editor_qti");
    }
    deleteLink.setEnabled(false);
    moveLink.setEnabled(false);
    copyLink.setEnabled(false);
    putInitialPanel(stackedPanel);
    if (restrictedEdit) {
        // we would like to us a modal dialog here, but this does not work! we
        // can't push to stack because the outher workflows pushes us after the
        // controller to the stack. Thus, if we used a modal dialog here the
        // dialog would never show up.
        columnLayoutCtr.setCol3(new Panel("empty"));
        columnLayoutCtr.hideCol1(true);
        columnLayoutCtr.hideCol2(true);
        String text = translate("qti.restricted.edit.warning") + "<br/><br/>" + createReferenceesMsg(ureq);
        proceedRestricedEditDialog = DialogBoxUIFactory.createYesNoDialog(ureq, getWindowControl(), null, text);
        listenTo(proceedRestricedEditDialog);
        proceedRestricedEditDialog.activate();
    }
}
Also used : QTIEditorTreeModel(org.olat.ims.qti.editor.tree.QTIEditorTreeModel) MenuTree(org.olat.core.gui.components.tree.MenuTree) TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) Panel(org.olat.core.gui.components.panel.Panel) TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) Memento(org.olat.core.util.memento.Memento) JSAndCSSComponent(org.olat.core.gui.components.htmlheader.jscss.JSAndCSSComponent) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 78 with LayoutMain3ColsController

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

the class CPUIFactory method createMainLayoutController.

/**
 * Creates a main layout controller. The layout uses one or two columns
 * depending the the showMenu flag.
 * <p>
 * Use this where you have no main layout present, e.g. in a pop up in a
 * stand-alone view
 *
 * @param ureq
 * @param wControl
 * @param rootContainer The VFS root container where the CP is found on disk
 * @param showMenu true to display the menu, false to hide the menu
 * @return A main layout controller
 */
public MainLayout3ColumnsController createMainLayoutController(UserRequest ureq, WindowControl wControl, VFSContainer rootContainer, boolean showMenu, DeliveryOptions deliveryOptions) {
    CPDisplayController cpCtr = new CPDisplayController(ureq, wControl, rootContainer, showMenu, true, true, true, deliveryOptions, null, null, "", false);
    MainLayout3ColumnsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, cpCtr.getMenuComponent(), cpCtr.getInitialComponent(), rootContainer.getName());
    // cascade disposing requests
    layoutCtr.addDisposableChildController(cpCtr);
    return layoutCtr;
}
Also used : MainLayout3ColumnsController(org.olat.core.gui.control.generic.layout.MainLayout3ColumnsController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController)

Example 79 with LayoutMain3ColsController

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

the class CPUIFactory method createMainLayoutPreviewController_v2.

/**
 * Creates a main layout controller that can be activated. It provides a
 * "close preview" link that automatically deactivates this controller form
 * the GUI stack
 * <p>
 * Use this when you want the user to be able to preview a CP
 *
 * @param ureq
 * @param wControl
 * @param rootContainer The VFS root container where the CP is found on disk
 * @param showMenu true to display the menu, false to hide the menu
 * @return A main layout preview controller
 */
public LayoutMain3ColsController createMainLayoutPreviewController_v2(UserRequest ureq, WindowControl wControl, VFSContainer rootContainer, boolean showMenu, DeliveryOptions deliveryOptions) {
    CPDisplayController cpCtr = new CPDisplayController(ureq, wControl, rootContainer, showMenu, true, true, true, deliveryOptions, null, null, "", false);
    LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, cpCtr.getMenuComponent(), cpCtr.getInitialComponent(), rootContainer.getName());
    // cascade disposing requests
    layoutCtr.addDisposableChildController(cpCtr);
    layoutCtr.addCssClassToMain("o_preview");
    return layoutCtr;
}
Also used : LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController)

Example 80 with LayoutMain3ColsController

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

the class ForumUIFactory method getPopupableForumController.

/**
 * Provides a popable ForumController wrapped in a titled controller.
 * @param ureq
 * @param forum
 * @param forumCallback
 * @param title
 * @return a ChiefController
 */
public static PopupBrowserWindow getPopupableForumController(UserRequest ureq, WindowControl wControl, final Forum forum, final ForumCallback forumCallback, final TitleInfo titleInfo) {
    ControllerCreator ctrlCreator = new ControllerCreator() {

        public Controller createController(UserRequest lureq, WindowControl lwControl) {
            Controller forumWrapperController = getTitledForumController(lureq, lwControl, forum, forumCallback, titleInfo);
            // use on column layout
            LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, forumWrapperController);
            // dispose content on layout dispose
            layoutCtr.addDisposableChildController(forumWrapperController);
            return layoutCtr;
        }
    };
    // wrap the content controller into a full header layout
    ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, ctrlCreator);
    PopupBrowserWindow pbw = wControl.getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq, layoutCtrlr);
    return pbw;
}
Also used : PopupBrowserWindow(org.olat.core.gui.control.generic.popup.PopupBrowserWindow) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) WindowControl(org.olat.core.gui.control.WindowControl) TitledWrapperController(org.olat.core.gui.control.generic.title.TitledWrapperController) ForumController(org.olat.modules.fo.ui.ForumController) Controller(org.olat.core.gui.control.Controller) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) 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