use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.
the class SharedFolderHandler method createEditorController.
@Override
public Controller createEditorController(RepositoryEntry re, UserRequest ureq, WindowControl wControl, TooledStackedPanel toolbar) {
Controller sharedFolderCtr = new SharedFolderEditorController(re, ureq, wControl);
// use on column layout
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, sharedFolderCtr);
// dispose content on layout dispose
layoutCtr.addDisposableChildController(sharedFolderCtr);
return layoutCtr;
}
use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.
the class GlossaryHandler method createEditorController.
@Override
public Controller createEditorController(RepositoryEntry re, UserRequest ureq, WindowControl wControl, TooledStackedPanel toolbar) {
VFSContainer glossaryFolder = GlossaryManager.getInstance().getGlossaryRootFolder(re.getOlatResource());
Properties glossProps = GlossaryItemManager.getInstance().getGlossaryConfig(glossaryFolder);
boolean editableByUser = "true".equals(glossProps.getProperty(GlossaryItemManager.EDIT_USERS));
GlossarySecurityCallback secCallback;
if (ureq.getUserSession().getRoles().isGuestOnly()) {
secCallback = new GlossarySecurityCallbackImpl();
} else {
secCallback = new GlossarySecurityCallbackImpl(true, true, editableByUser, ureq.getIdentity().getKey());
}
GlossaryMainController gctr = new GlossaryMainController(wControl, ureq, glossaryFolder, re.getOlatResource(), secCallback, false);
// use on column layout
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, gctr);
// dispose content on layout dispose
layoutCtr.addDisposableChildController(gctr);
return layoutCtr;
}
use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.
the class ScormAPIandDisplayController method configurationChanged.
@Override
public void configurationChanged() {
if (columnLayoutCtr instanceof LayoutMain3ColsBackController) {
LayoutMain3ColsBackController layoutCtr = (LayoutMain3ColsBackController) columnLayoutCtr;
layoutCtr.deactivate();
} else if (columnLayoutCtr instanceof LayoutMain3ColsController) {
LayoutMain3ColsController layoutCtr = (LayoutMain3ColsController) columnLayoutCtr;
layoutCtr.deactivate(null);
}
}
use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.
the class RepositoyUIFactory method createRepoEntryDisabledDueToSecurityMessageController.
/**
* Create main controller that does nothing but displaying a message that
* this resource is disabled due to security constraints
*
* @param ureq
* @param wControl
* @return
*/
public static GenericMainController createRepoEntryDisabledDueToSecurityMessageController(UserRequest ureq, WindowControl wControl) {
// wrap simple message into mainLayout
GenericMainController glc = new GenericMainController(ureq, wControl) {
@Override
public void init(UserRequest uureq) {
Panel empty = new Panel("empty");
setTranslator(Util.createPackageTranslator(RepositoryModule.class, uureq.getLocale()));
MessageController contentCtr = MessageUIFactory.createInfoMessage(uureq, getWindowControl(), translate("security.disabled.title"), translate("security.disabled.info"));
// auto dispose later
listenTo(contentCtr);
Component resComp = contentCtr.getInitialComponent();
LayoutMain3ColsController columnLayoutCtr = new LayoutMain3ColsController(uureq, getWindowControl(), empty, resComp, /*do not save no prefs*/
null);
// auto dispose later
listenTo(columnLayoutCtr);
putInitialPanel(columnLayoutCtr.getInitialComponent());
}
@Override
protected Controller handleOwnMenuTreeEvent(Object uobject, UserRequest uureq) {
// no menutree means no menu events.
return null;
}
};
glc.init(ureq);
return glc;
}
use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.
the class RichTextElementComponent method createFileSelectorPopupWindow.
private void createFileSelectorPopupWindow(final UserRequest ureq, final String type, final String fileName) {
// Get allowed suffixes from configuration and requested media browser type from event
final RichTextConfiguration config = element.getEditorConfiguration();
final boolean allowCustomMediaFactory = config.isAllowCustomMediaFactory();
final boolean uriValidation = config.isFilenameUriValidation();
final String[] suffixes;
if (type.equals(CMD_FILEBROWSER)) {
suffixes = null;
} else if (type.equals(CMD_IMAGEBROWSER)) {
suffixes = config.getLinkBrowserImageSuffixes();
} else if (type.equals(CMD_FLASHPLAYERBROWSER)) {
suffixes = config.getLinkBrowserFlashPlayerSuffixes();
} else {
suffixes = config.getLinkBrowserMediaSuffixes();
}
// Show popup window with file browser to select file
// Only one popup file chooser allowed at any time. ccc contains icc,
// icc gets disposed by ccc
// helper code which is used to create link chooser controller
ControllerCreator linkChooserControllerCreator = new ControllerCreator() {
@Override
public Controller createController(UserRequest lureq, WindowControl lwControl) {
LinkChooserController myLinkChooserController;
VFSContainer baseContainer = config.getLinkBrowserBaseContainer();
String uploadRelPath = config.getLinkBrowserUploadRelPath();
String absolutePath = config.getLinkBrowserAbsolutFilePath();
CustomLinkTreeModel linkBrowserCustomTreeModel = config.getLinkBrowserCustomLinkTreeModel();
if (type.equals(CMD_FILEBROWSER)) {
// when in file mode we include the internal links to the selection
myLinkChooserController = new LinkChooserController(lureq, lwControl, baseContainer, uploadRelPath, absolutePath, suffixes, uriValidation, fileName, linkBrowserCustomTreeModel, allowCustomMediaFactory);
} else {
// in media or image mode, internal links make no sense here
myLinkChooserController = new LinkChooserController(lureq, lwControl, baseContainer, uploadRelPath, absolutePath, suffixes, uriValidation, fileName, null, allowCustomMediaFactory);
}
return new LayoutMain3ColsController(lureq, lwControl, myLinkChooserController);
}
};
PopupBrowserWindow pbw = Windows.getWindows(ureq).getWindowManager().createNewPopupBrowserWindowFor(ureq, linkChooserControllerCreator);
pbw.open(ureq);
}
Aggregations