Search in sources :

Example 96 with CloseableModalController

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();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) CopyRepositoryEntryController(org.olat.repository.ui.author.CopyRepositoryEntryController)

Example 97 with CloseableModalController

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();
}
Also used : CatalogEntryAddController(org.olat.repository.ui.catalog.CatalogEntryAddController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Example 98 with CloseableModalController

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();
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ArrayList(java.util.ArrayList) GroupRoles(org.olat.basesecurity.GroupRoles) Roles(org.olat.core.id.Roles) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 99 with CloseableModalController

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();
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ArrayList(java.util.ArrayList) GroupRoles(org.olat.basesecurity.GroupRoles) Roles(org.olat.core.id.Roles) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 100 with CloseableModalController

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);
}
Also used : SelectItemController(org.olat.modules.qpool.ui.SelectItemController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Aggregations

CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)789 RepositoryEntry (org.olat.repository.RepositoryEntry)52 ArrayList (java.util.ArrayList)48 Identity (org.olat.core.id.Identity)42 ReferencableEntriesSearchController (org.olat.repository.controllers.ReferencableEntriesSearchController)38 VFSContainer (org.olat.core.util.vfs.VFSContainer)24 Component (org.olat.core.gui.components.Component)20 ContactMessage (org.olat.core.util.mail.ContactMessage)20 ContactFormController (org.olat.modules.co.ContactFormController)20 File (java.io.File)17 List (java.util.List)16 UserSearchController (org.olat.admin.user.UserSearchController)16 TableEvent (org.olat.core.gui.components.table.TableEvent)16 TableMultiSelectEvent (org.olat.core.gui.components.table.TableMultiSelectEvent)16 ContactList (org.olat.core.util.mail.ContactList)16 MailTemplate (org.olat.core.util.mail.MailTemplate)14 OLATResourceable (org.olat.core.id.OLATResourceable)12 MailNotificationEditController (org.olat.core.util.mail.MailNotificationEditController)12 OLATSecurityException (org.olat.core.logging.OLATSecurityException)10 Roles (org.olat.core.id.Roles)8