use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class RepositoryEntryRuntimeController method doCopy.
private void doCopy(UserRequest ureq) {
removeAsListenerAndDispose(cmc);
removeAsListenerAndDispose(copyCtrl);
copyCtrl = new CopyRepositoryEntryController(ureq, getWindowControl(), re);
listenTo(copyCtrl);
String title = translate("details.copy");
cmc = new CloseableModalController(getWindowControl(), translate("close"), copyCtrl.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class CatalogSettingsController method doAddCatalog.
/**
* Internal helper to initiate the add to catalog workflow
* @param ureq
*/
private void doAddCatalog(UserRequest ureq) {
removeAsListenerAndDispose(catalogAdddController);
removeAsListenerAndDispose(cmc);
catalogAdddController = new CatalogEntryAddController(ureq, getWindowControl(), entry, true, false);
listenTo(catalogAdddController);
cmc = new CloseableModalController(getWindowControl(), "close", catalogAdddController.getInitialComponent(), true, translate("details.catadd"));
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class AuthorDeletedListController method doDeletePermanently.
private void doDeletePermanently(UserRequest ureq, List<AuthoringEntryRow> rows) {
Roles roles = ureq.getUserSession().getRoles();
List<Long> deleteableRowKeys = new ArrayList<>(rows.size());
for (AuthoringEntryRow row : rows) {
boolean managed = RepositoryEntryManagedFlag.isManaged(row.getManagedFlags(), RepositoryEntryManagedFlag.delete);
boolean canDelete = roles.isOLATAdmin() || repositoryManager.isInstitutionalRessourceManagerFor(getIdentity(), roles, row);
if (canDelete && !managed) {
deleteableRowKeys.add(row.getKey());
}
}
List<RepositoryEntry> entriesToDelete = repositoryManager.lookupRepositoryEntries(deleteableRowKeys);
if (entriesToDelete.isEmpty()) {
showWarning("bulk.update.nothing.applicable.selected");
} else {
removeAsListenerAndDispose(confirmDeletePermanentlyCtrl);
removeAsListenerAndDispose(cmc);
confirmDeletePermanentlyCtrl = new ConfirmDeletePermanentlyController(ureq, getWindowControl(), entriesToDelete, rows.size() != entriesToDelete.size());
listenTo(confirmDeletePermanentlyCtrl);
String title = translate("details.delete");
cmc = new CloseableModalController(getWindowControl(), translate("close"), confirmDeletePermanentlyCtrl.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class AuthorDeletedListController method doRestore.
private void doRestore(UserRequest ureq, List<AuthoringEntryRow> rows) {
Roles roles = ureq.getUserSession().getRoles();
List<Long> deleteableRowKeys = new ArrayList<>(rows.size());
for (AuthoringEntryRow row : rows) {
boolean managed = RepositoryEntryManagedFlag.isManaged(row.getManagedFlags(), RepositoryEntryManagedFlag.delete);
boolean canDelete = roles.isOLATAdmin() || repositoryService.hasRole(getIdentity(), row, GroupRoles.owner.name()) || repositoryManager.isInstitutionalRessourceManagerFor(getIdentity(), roles, row);
if (canDelete && !managed) {
deleteableRowKeys.add(row.getKey());
}
}
List<RepositoryEntry> entriesToRestore = repositoryManager.lookupRepositoryEntries(deleteableRowKeys);
if (entriesToRestore.isEmpty()) {
showWarning("bulk.update.nothing.applicable.selected");
} else {
removeAsListenerAndDispose(confirmRestoreCtrl);
removeAsListenerAndDispose(cmc);
confirmRestoreCtrl = new ConfirmRestoreController(ureq, getWindowControl(), entriesToRestore);
listenTo(confirmRestoreCtrl);
String title = translate("tools.restore");
cmc = new CloseableModalController(getWindowControl(), translate("close"), confirmRestoreCtrl.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class QTIEditorMainController method doSelectQItem.
private void doSelectQItem(UserRequest ureq) {
removeAsListenerAndDispose(cmc);
removeAsListenerAndDispose(selectQItemCtrl);
selectQItemCtrl = new SelectItemController(ureq, getWindowControl(), QTIConstants.QTI_12_FORMAT);
listenTo(selectQItemCtrl);
cmc = new CloseableModalController(getWindowControl(), translate("close"), selectQItemCtrl.getInitialComponent(), true, translate("title.add"));
cmc.activate();
listenTo(cmc);
}
Aggregations