Skip to content
Snippets Groups Projects
Commit c7a1310c authored by srosse's avatar srosse
Browse files

OO-1068: fix qti edtior toolbar, mimic course editor's layout

parent 13624caf
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,7 @@ import org.olat.core.gui.components.link.Link; ...@@ -48,6 +48,7 @@ import org.olat.core.gui.components.link.Link;
import org.olat.core.gui.components.link.LinkFactory; import org.olat.core.gui.components.link.LinkFactory;
import org.olat.core.gui.components.panel.Panel; import org.olat.core.gui.components.panel.Panel;
import org.olat.core.gui.components.stack.TooledStackedPanel; import org.olat.core.gui.components.stack.TooledStackedPanel;
import org.olat.core.gui.components.stack.TooledStackedPanel.Align;
import org.olat.core.gui.components.tree.MenuTree; import org.olat.core.gui.components.tree.MenuTree;
import org.olat.core.gui.components.tree.SelectionTree; import org.olat.core.gui.components.tree.SelectionTree;
import org.olat.core.gui.components.tree.TreeEvent; import org.olat.core.gui.components.tree.TreeEvent;
...@@ -148,6 +149,7 @@ public class QTIEditorMainController extends MainLayoutBasicController implement ...@@ -148,6 +149,7 @@ public class QTIEditorMainController extends MainLayoutBasicController implement
/* /*
* Toolbox Commands * Toolbox Commands
*/ */
private static final String CMD_TOOLS_CLOSE_EDITOR = "cmd.close";
private static final String CMD_TOOLS_PREVIEW = "cmd.preview"; private static final String CMD_TOOLS_PREVIEW = "cmd.preview";
private static final String CMD_TOOLS_CHANGE_MOVE = "cmd.move"; private static final String CMD_TOOLS_CHANGE_MOVE = "cmd.move";
private static final String CMD_TOOLS_CHANGE_COPY = "cmd.copy"; private static final String CMD_TOOLS_CHANGE_COPY = "cmd.copy";
...@@ -1053,20 +1055,21 @@ public class QTIEditorMainController extends MainLayoutBasicController implement ...@@ -1053,20 +1055,21 @@ public class QTIEditorMainController extends MainLayoutBasicController implement
private void populateToolC() { private void populateToolC() {
//tools //tools
Dropdown editTools = new Dropdown("editTools", "tools.tools.header", false, getTranslator()); Dropdown editTools = new Dropdown("editTools", "tools.tools.header", false, getTranslator());
stackedPanel.addTool(editTools); editTools.setIconCSS("o_icon o_icon_tools");
stackedPanel.addTool(editTools, Align.left);
previewLink = LinkFactory.createToolLink(CMD_TOOLS_PREVIEW, translate("tools.tools.preview"), this, "b_toolbox_preview");
editTools.addComponent(previewLink); editTools.addComponent(previewLink);
exportPoolLink = LinkFactory.createToolLink(CMD_TOOLS_EXPORT_QPOOL, translate("tools.export.qpool"), this, "o_mi_qpool_export"); exportPoolLink = LinkFactory.createToolLink(CMD_TOOLS_EXPORT_QPOOL, translate("tools.export.qpool"), this, "o_mi_qpool_export");
exportPoolLink.setIconLeftCSS("o_icon o_icon_download");
editTools.addComponent(exportPoolLink); editTools.addComponent(exportPoolLink);
exportDocLink = LinkFactory.createToolLink(CMD_TOOLS_EXPORT_DOCX, translate("tools.export.docx"), this, "o_mi_docx_export"); exportDocLink = LinkFactory.createToolLink(CMD_TOOLS_EXPORT_DOCX, translate("tools.export.docx"), this, "o_mi_docx_export");
exportDocLink.setIconLeftCSS("o_icon o_icon_download");
editTools.addComponent(exportDocLink); editTools.addComponent(exportDocLink);
closeLink = LinkFactory.createToolLink(CMD_TOOLS_EXPORT_DOCX, translate("tools.tools.closeeditor"), this, "b_toolbox_close");
editTools.addComponent(closeLink);
//add //add
Dropdown addItemTools = new Dropdown("editTools", "tools.add.header", false, getTranslator()); Dropdown addItemTools = new Dropdown("editTools", "tools.add.header", false, getTranslator());
stackedPanel.addTool(addItemTools); addItemTools.setIconCSS("o_icon o_icon-fw o_icon_add");
stackedPanel.addTool(addItemTools, Align.left);
addPoolLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_QPOOL, translate("tools.import.qpool"), this, "o_mi_qpool_import"); addPoolLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_QPOOL, translate("tools.import.qpool"), this, "o_mi_qpool_import");
addItemTools.addComponent(addPoolLink); addItemTools.addComponent(addPoolLink);
...@@ -1080,20 +1083,32 @@ public class QTIEditorMainController extends MainLayoutBasicController implement ...@@ -1080,20 +1083,32 @@ public class QTIEditorMainController extends MainLayoutBasicController implement
addKPrimLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_KPRIM, translate("tools.add.kprim"), this, "o_mi_qtikprim"); addKPrimLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_KPRIM, translate("tools.add.kprim"), this, "o_mi_qtikprim");
addItemTools.addComponent(addKPrimLink); addItemTools.addComponent(addKPrimLink);
} }
addFIBLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_FIB, translate("tools.add.cloze"), this, "o_mi_qtifib"); addFIBLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_FIB, translate("tools.add.cloze"), this, "o_mi_qtifib");
addItemTools.addComponent(addFIBLink); addItemTools.addComponent(addFIBLink);
addEssayLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_FREETEXT, translate("tools.add.freetext"), this, "o_mi_qtiessay"); addEssayLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_FREETEXT, translate("tools.add.freetext"), this, "o_mi_qtiessay");
addItemTools.addComponent(addEssayLink); addItemTools.addComponent(addEssayLink);
// change // delete / move / copy
//tc.addHeader(translate("tools.change.header")); Dropdown customizeTools = new Dropdown("customizeTools", "tools.change.header", false, getTranslator());
customizeTools.setIconCSS("o_icon o_icon_customize");
stackedPanel.addTool(customizeTools, Align.left);
deleteLink = LinkFactory.createToolLink(CMD_TOOLS_CHANGE_DELETE, translate("tools.change.delete"), this, "b_toolbox_delete"); deleteLink = LinkFactory.createToolLink(CMD_TOOLS_CHANGE_DELETE, translate("tools.change.delete"), this, "b_toolbox_delete");
stackedPanel.addTool(deleteLink); deleteLink.setIconLeftCSS("o_icon o_icon_delete_item");
customizeTools.addComponent(deleteLink);
moveLink = LinkFactory.createToolLink(CMD_TOOLS_CHANGE_MOVE, translate("tools.change.move"), this, "b_toolbox_move"); moveLink = LinkFactory.createToolLink(CMD_TOOLS_CHANGE_MOVE, translate("tools.change.move"), this, "b_toolbox_move");
stackedPanel.addTool(moveLink); moveLink.setIconLeftCSS("o_icon o_icon_move");
customizeTools.addComponent(moveLink);
copyLink = LinkFactory.createToolLink(CMD_TOOLS_CHANGE_COPY, translate("tools.change.copy"), this, "b_toolbox_copy"); copyLink = LinkFactory.createToolLink(CMD_TOOLS_CHANGE_COPY, translate("tools.change.copy"), this, "b_toolbox_copy");
stackedPanel.addTool(copyLink); copyLink.setIconLeftCSS("o_icon o_icon_copy");
customizeTools.addComponent(copyLink);
previewLink = LinkFactory.createToolLink(CMD_TOOLS_PREVIEW, translate("tools.tools.preview"), this, "b_toolbox_preview");
previewLink.setIconLeftCSS("o_icon o_icon-fw o_icon_preview");
stackedPanel.addTool(previewLink, Align.right);
closeLink = LinkFactory.createToolLink(CMD_TOOLS_CLOSE_EDITOR, translate("tools.tools.closeeditor"), this, "b_toolbox_close");
closeLink.setIconLeftCSS("o_icon o_icon_publish");
stackedPanel.addTool(closeLink, Align.right);
} }
/** /**
......
...@@ -371,14 +371,14 @@ title.copy=Element kopieren ...@@ -371,14 +371,14 @@ title.copy=Element kopieren
title.move=Element verschieben title.move=Element verschieben
tools.add.cloze=L\u00FCckentext tools.add.cloze=L\u00FCckentext
tools.add.freetext=Freitext tools.add.freetext=Freitext
tools.add.header=Hinzuf\u00FCgen tools.add.header=Elemente hinzuf\u00FCgen
tools.add.kprim=Kprim tools.add.kprim=Kprim
tools.add.multiplechoice=Multiple Choice tools.add.multiplechoice=Multiple Choice
tools.add.section=Sektion tools.add.section=Sektion
tools.add.singlechoice=Single Choice tools.add.singlechoice=Single Choice
tools.change.header=Elemente \u00E4ndern
tools.change.copy=Kopieren tools.change.copy=Kopieren
tools.change.delete=L\u00F6schen tools.change.delete=L\u00F6schen
tools.change.header=\u00C4ndern
tools.change.move=Verschieben tools.change.move=Verschieben
tools.matedit.back=Zur\u00FCck tools.matedit.back=Zur\u00FCck
tools.matedit.header=Editorwerkzeuge tools.matedit.header=Editorwerkzeuge
......
...@@ -77,26 +77,6 @@ public class EPUIFactory { ...@@ -77,26 +77,6 @@ public class EPUIFactory {
public static Controller createPortfolioAdminController(UserRequest ureq, WindowControl wControl) { public static Controller createPortfolioAdminController(UserRequest ureq, WindowControl wControl) {
return new PortfolioAdminController(ureq, wControl); return new PortfolioAdminController(ureq, wControl);
} }
/**
* get a controller with all user maps (without structureds map or templates)
* @param ureq
* @param wControl
* @return
*/
public static Controller createPortfolioMapsController(UserRequest ureq, WindowControl wControl) {
return new EPMapRunController(ureq, wControl, true, EPMapRunViewOption.MY_DEFAULTS_MAPS, null);
}
/**
* Get a controller with all maps I can see from other users,
* @param ureq
* @param wControl
* @return
*/
public static Controller createPortfolioMapsFromOthersController(UserRequest ureq, WindowControl wControl) {
return new EPMapRunController(ureq, wControl, false, EPMapRunViewOption.OTHERS_MAPS, null);
}
/** /**
* Get a controller with all maps I can see from other users, * Get a controller with all maps I can see from other users,
...@@ -108,16 +88,6 @@ public class EPUIFactory { ...@@ -108,16 +88,6 @@ public class EPUIFactory {
return new EPMapRunController(ureq, wControl, false, EPMapRunViewOption.OTHER_MAPS, choosenOwner); return new EPMapRunController(ureq, wControl, false, EPMapRunViewOption.OTHER_MAPS, choosenOwner);
} }
/**
* Get a controller with all user structured maps (but not templates)
* @param ureq
* @param wControl
* @return
*/
public static Controller createPortfolioStructuredMapsController(UserRequest ureq, WindowControl wControl) {
return new EPMapRunController(ureq, wControl, false, EPMapRunViewOption.MY_EXERCISES_MAPS, null);
}
public static Controller createPortfolioStructureMapController(UserRequest ureq, WindowControl wControl, PortfolioStructureMap map, public static Controller createPortfolioStructureMapController(UserRequest ureq, WindowControl wControl, PortfolioStructureMap map,
EPSecurityCallback secCallback) { EPSecurityCallback secCallback) {
return new EPMapViewController(ureq, wControl, map, false, false, secCallback); return new EPMapViewController(ureq, wControl, map, false, false, secCallback);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment