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