use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class CatalogNodeManagerController method doAddResource.
private void doAddResource(UserRequest ureq) {
removeAsListenerAndDispose(entrySearchCtrl);
removeAsListenerAndDispose(cmc);
entrySearchCtrl = new RepositorySearchController(translate("choose"), ureq, getWindowControl(), true, false, new String[0], null);
listenTo(entrySearchCtrl);
// OLAT-Admin has search form
if (ureq.getUserSession().getRoles().isOLATAdmin()) {
entrySearchCtrl.displaySearchForm();
} else // an Author gets the list of his repository
{
// admin is responsible for not inserting wrong visibility entries!!
entrySearchCtrl.doSearchByOwnerLimitAccess(ureq.getIdentity());
}
// open form in dialog
cmc = new CloseableModalController(getWindowControl(), "close", entrySearchCtrl.getInitialComponent(), true, translate("tools.add.catalog.link"));
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class CatalogNodeManagerController method doMoveCategory.
private void doMoveCategory(UserRequest ureq, CatalogEntryRow row) {
removeAsListenerAndDispose(cmc);
removeAsListenerAndDispose(entryResourceMoveCtrl);
CatalogEntry moveMe = catalogManager.getCatalogEntryBy(row, catalogEntry);
if (moveMe != null) {
entryResourceMoveCtrl = new CatalogEntryMoveController(getWindowControl(), ureq, moveMe, getTranslator());
listenTo(entryResourceMoveCtrl);
cmc = new CloseableModalController(getWindowControl(), "close", entryResourceMoveCtrl.getInitialComponent(), true, translate("tools.move.catalog.entry"));
listenTo(cmc);
cmc.activate();
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class CatalogNodeManagerController method doEditCategory.
private void doEditCategory(UserRequest ureq) {
removeAsListenerAndDispose(editEntryCtrl);
removeAsListenerAndDispose(cmc);
catModificationLock = CoordinatorManager.getInstance().getCoordinator().getLocker().acquireLock(lockRes, getIdentity(), LOCK_TOKEN);
if (catModificationLock.isSuccess()) {
editEntryCtrl = new CatalogEntryEditController(ureq, getWindowControl(), catalogEntry);
editEntryCtrl.setElementCssClass("o_sel_catalog_edit_category_popup");
listenTo(editEntryCtrl);
// open form in dialog
cmc = new CloseableModalController(getWindowControl(), "close", editEntryCtrl.getInitialComponent(), true, translate("tools.edit.catalog.category"));
listenTo(cmc);
cmc.activate();
} else {
String ownerName = userManager.getUserDisplayName(catModificationLock.getOwner());
showError("catalog.locked.by", ownerName);
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class CatalogNodeManagerController method doAddCategory.
private void doAddCategory(UserRequest ureq) {
removeAsListenerAndDispose(addEntryCtrl);
removeAsListenerAndDispose(cmc);
catModificationLock = CoordinatorManager.getInstance().getCoordinator().getLocker().acquireLock(lockRes, getIdentity(), LOCK_TOKEN);
if (catModificationLock.isSuccess()) {
CatalogEntry ce = catalogManager.createCatalogEntry();
addEntryCtrl = new CatalogEntryEditController(ureq, getWindowControl(), ce, catalogEntry);
addEntryCtrl.setElementCssClass("o_sel_catalog_add_category_popup");
listenTo(addEntryCtrl);
cmc = new CloseableModalController(getWindowControl(), "close", addEntryCtrl.getInitialComponent(), true, translate("tools.add.catalog.category"));
listenTo(cmc);
cmc.activate();
} else {
String ownerName = userManager.getUserDisplayName(catModificationLock.getOwner());
showError("catalog.locked.by", ownerName);
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class RepositoryEntryRuntimeController method doDelete.
private void doDelete(UserRequest ureq) {
if (!reSecurity.isEntryAdmin()) {
throw new OLATSecurityException("Trying to delete, but not allowed: user = " + ureq.getIdentity());
}
List<RepositoryEntry> entryToDelete = Collections.singletonList(getRepositoryEntry());
confirmDeleteCtrl = new ConfirmDeleteSoftlyController(ureq, getWindowControl(), entryToDelete, false);
listenTo(confirmDeleteCtrl);
String title = translate("del.header", re.getDisplayname());
cmc = new CloseableModalController(getWindowControl(), "close", confirmDeleteCtrl.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
Aggregations