Search in sources :

Example 1 with EPAddElementsController

use of org.olat.portfolio.ui.structel.EPAddElementsController in project OpenOLAT by OpenOLAT.

the class EPTOCController method refreshAddElements.

/**
 * refreshing the add elements link to actual structure
 * @param ureq
 * @param struct maybe null -> hiding the add-button
 */
private void refreshAddElements(UserRequest ureq, PortfolioStructure struct) {
    tocV.remove(tocV.getComponent("addElement"));
    removeAsListenerAndDispose(addElCtrl);
    if (struct != null) {
        addElCtrl = new EPAddElementsController(ureq, getWindowControl(), struct);
        if (struct instanceof EPPage) {
            if (secCallback.canAddStructure()) {
                addElCtrl.setShowLink(EPAddElementsController.ADD_STRUCTUREELEMENT);
            }
            if (secCallback.canAddArtefact()) {
                addElCtrl.setShowLink(EPAddElementsController.ADD_ARTEFACT);
            }
        } else if (struct instanceof EPAbstractMap) {
            if (secCallback.canAddPage()) {
                addElCtrl.setShowLink(EPAddElementsController.ADD_PAGE);
            }
        } else {
            // its a structure element
            if (secCallback.canAddArtefact()) {
                addElCtrl.setShowLink(EPAddElementsController.ADD_ARTEFACT);
            }
        }
        listenTo(addElCtrl);
        tocV.put("addElement", addElCtrl.getInitialComponent());
    }
}
Also used : EPPage(org.olat.portfolio.model.structel.EPPage) EPAbstractMap(org.olat.portfolio.model.structel.EPAbstractMap) EPAddElementsController(org.olat.portfolio.ui.structel.EPAddElementsController)

Example 2 with EPAddElementsController

use of org.olat.portfolio.ui.structel.EPAddElementsController in project openolat by klemens.

the class EPTOCController method refreshAddElements.

/**
 * refreshing the add elements link to actual structure
 * @param ureq
 * @param struct maybe null -> hiding the add-button
 */
private void refreshAddElements(UserRequest ureq, PortfolioStructure struct) {
    tocV.remove(tocV.getComponent("addElement"));
    removeAsListenerAndDispose(addElCtrl);
    if (struct != null) {
        addElCtrl = new EPAddElementsController(ureq, getWindowControl(), struct);
        if (struct instanceof EPPage) {
            if (secCallback.canAddStructure()) {
                addElCtrl.setShowLink(EPAddElementsController.ADD_STRUCTUREELEMENT);
            }
            if (secCallback.canAddArtefact()) {
                addElCtrl.setShowLink(EPAddElementsController.ADD_ARTEFACT);
            }
        } else if (struct instanceof EPAbstractMap) {
            if (secCallback.canAddPage()) {
                addElCtrl.setShowLink(EPAddElementsController.ADD_PAGE);
            }
        } else {
            // its a structure element
            if (secCallback.canAddArtefact()) {
                addElCtrl.setShowLink(EPAddElementsController.ADD_ARTEFACT);
            }
        }
        listenTo(addElCtrl);
        tocV.put("addElement", addElCtrl.getInitialComponent());
    }
}
Also used : EPPage(org.olat.portfolio.model.structel.EPPage) EPAbstractMap(org.olat.portfolio.model.structel.EPAbstractMap) EPAddElementsController(org.olat.portfolio.ui.structel.EPAddElementsController)

Aggregations

EPAbstractMap (org.olat.portfolio.model.structel.EPAbstractMap)2 EPPage (org.olat.portfolio.model.structel.EPPage)2 EPAddElementsController (org.olat.portfolio.ui.structel.EPAddElementsController)2