use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class CourseRuntimeController method doLecturesAdmin.
private LectureRepositoryAdminController doLecturesAdmin(UserRequest ureq) {
if (delayedClose == Delayed.lecturesAdmin || requestForClose(ureq)) {
if (reSecurity.isEntryAdmin() || hasCourseRight(CourseRights.RIGHT_COURSEEDITOR)) {
removeCustomCSS();
OLATResourceable ores = OresHelper.createOLATResourceableType("LecturesAdmin");
WindowControl swControl = addToHistory(ureq, ores, null);
LectureRepositoryAdminController ctrl = new LectureRepositoryAdminController(ureq, swControl, toolbarPanel, getRepositoryEntry());
listenTo(ctrl);
lecturesAdminCtrl = pushController(ureq, translate("command.options.lectures.admin"), ctrl);
setActiveTool(lecturesAdminLink);
currentToolCtr = lecturesAdminCtrl;
return lecturesAdminCtrl;
} else {
return null;
}
} else {
delayedClose = Delayed.lecturesAdmin;
return null;
}
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class QTIEditorMainController method doImportTable.
private void doImportTable(UserRequest ureq) {
removeAsListenerAndDispose(importTableWizard);
final ItemsPackage importPackage = new ItemsPackage();
final ImportOptions options = new ImportOptions();
options.setShuffle(!qtiPackage.getQTIDocument().isSurvey());
Step start = new QImport_1_InputStep(ureq, importPackage, options, null);
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
runContext.put("importPackage", importPackage);
return StepsMainRunController.DONE_MODIFIED;
}
};
importTableWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("tools.import.table"), "o_mi_table_import_wizard");
listenTo(importTableWizard);
getWindowControl().pushAsModalDialog(importTableWizard.getInitialComponent());
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class GoToMeetingController method doJoin.
private void doJoin(UserRequest ureq) {
boolean join = false;
GoToError error = new GoToError();
if (registrant == null) {
registrant = meetingMgr.registerTraining(meeting, getIdentity(), error);
}
if (registrant != null) {
String joinUrl = registrant.getJoinUrl();
if (joinUrl != null) {
RedirectMediaResource redirect = new RedirectMediaResource(joinUrl);
ureq.getDispatchResult().setResultingMediaResource(redirect);
join = true;
}
}
if (!join) {
final String errorMessage;
if (error.hasError()) {
if (error.getError() != null) {
errorMessage = translate(error.getError().i18nKey());
} else {
errorMessage = translate("error.code.unkown");
}
} else {
errorMessage = translate("error.code.unkown");
}
ControllerCreator creator = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, new ControllerCreator() {
@Override
public Controller createController(UserRequest lureq, WindowControl lwControl) {
// Wrap in column layout, popup window needs a layout controller
String title = "";
String text = errorMessage;
Controller ctr = MessageUIFactory.createErrorMessage(lureq, lwControl, title, text);
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, ctr);
layoutCtr.addDisposableChildController(ctr);
return layoutCtr;
}
});
openInNewBrowserWindow(ureq, creator);
}
updateButtons();
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class SharedBindersController method doSelectBinder.
private BinderController doSelectBinder(UserRequest ureq, SharedItemRow row) {
Binder binder = portfolioService.getBinderByKey(row.getBinderKey());
if (binder == null) {
showWarning("warning.portfolio.not.found");
return null;
} else {
removeAsListenerAndDispose(binderCtrl);
portfolioService.updateBinderUserInformations(binder, getIdentity());
row.setRecentLaunch(new Date());
OLATResourceable binderOres = OresHelper.createOLATResourceableInstance("Binder", binder.getKey());
WindowControl swControl = addToHistory(ureq, binderOres, null);
List<AccessRights> rights = portfolioService.getAccessRights(binder, getIdentity());
BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForCoach(binder, rights);
BinderConfiguration config = BinderConfiguration.createConfig(binder);
binderCtrl = new BinderController(ureq, swControl, stackPanel, secCallback, binder, config);
String displayName = StringHelper.escapeHtml(binder.getTitle());
stackPanel.pushController(displayName, binderCtrl);
return binderCtrl;
}
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class SharedItemsOverviewController method doOpenPages.
private SharedPagesController doOpenPages(UserRequest ureq) {
if (pagesCtrl == null) {
SearchSharePagesParameters searchParams = new SearchSharePagesParameters();
searchParams.setBookmarkOnly(false);
searchParams.addExcludedPageStatus(PageStatus.closed, PageStatus.deleted);
searchParams.addExcludedPageUserStatus(PageUserStatus.done);
List<PageStatus> filters = new ArrayList<>(5);
filters.add(PageStatus.draft);
filters.add(PageStatus.inRevision);
filters.add(PageStatus.published);
WindowControl swControl = addToHistory(ureq, OresHelper.createOLATResourceableInstance("Pages", 0l), null);
pagesCtrl = new SharedPagesController(ureq, swControl, stackPanel, searchParams, filters, PageStatus.published);
listenTo(pagesCtrl);
} else {
pagesCtrl.loadModel();
addToHistory(ureq, pagesCtrl);
}
mainVC.put("segmentCmp", pagesCtrl.getInitialComponent());
return pagesCtrl;
}
Aggregations