Skip to content
Snippets Groups Projects
Commit 041d64da authored by gnaegi's avatar gnaegi
Browse files

OO-2057 fix EP module config initialization, hide v1 artefact import when disabled, i18n

parent 45e1e806
No related branches found
No related tags found
No related merge requests found
......@@ -84,6 +84,7 @@ import org.olat.modules.portfolio.ui.media.CollectCitationMediaController;
import org.olat.modules.portfolio.ui.media.CollectTextMediaController;
import org.olat.modules.portfolio.ui.model.MediaRow;
import org.olat.modules.portfolio.ui.renderer.MediaTypeCellRenderer;
import org.olat.portfolio.PortfolioModule;
import org.olat.portfolio.manager.EPArtefactManager;
import org.olat.portfolio.model.artefacts.AbstractArtefact;
import org.olat.portfolio.ui.EPArtefactPoolRunController;
......@@ -129,6 +130,8 @@ public class MediaCenterController extends FormBasicController
@Autowired
private EPArtefactManager legacyArtefactManager;
@Autowired
private PortfolioModule legacyPortfolioModule;
public MediaCenterController(UserRequest ureq, WindowControl wControl) {
super(ureq, wControl, "medias");
......@@ -163,7 +166,7 @@ public class MediaCenterController extends FormBasicController
stackPanel.addTool(addCitationLink, Align.left);
// only if there are v1 artefacts available
if (legacyArtefactManager.countArtefacts(getIdentity()) > 0) {
if (legacyPortfolioModule.isEnabled() && legacyArtefactManager.countArtefacts(getIdentity()) > 0) {
importArtefactV1Link = LinkFactory.createToolLink("import.artefactV1", translate("import.artefactV1"), this);
importArtefactV1Link.setIconLeftCSS("o_icon o_icon-lg o_icon_import");
stackPanel.addTool(importArtefactV1Link, Align.left);
......@@ -649,6 +652,10 @@ public class MediaCenterController extends FormBasicController
}
private static class NewMediasController extends BasicController {
@Autowired
private EPArtefactManager legacyArtefactManager;
@Autowired
private PortfolioModule legacyPortfolioModule;
private final Link addMediaLink, addTextLink, addCitationLink, importArtefactV1Link;
......@@ -666,8 +673,13 @@ public class MediaCenterController extends FormBasicController
addCitationLink = LinkFactory.createLink("add.citation", "add.citation", getTranslator(), mainVc, this, Link.LINK);
addCitationLink.setIconLeftCSS("o_icon o_icon_citation");
importArtefactV1Link = LinkFactory.createLink("import.artefactV1", "import.artefactV1", getTranslator(), mainVc, this, Link.LINK);
importArtefactV1Link.setIconLeftCSS("o_icon o_icon_import");
// only if there are v1 artefacts available
if (legacyPortfolioModule.isEnabled() && legacyArtefactManager.countArtefacts(getIdentity()) > 0) {
importArtefactV1Link = LinkFactory.createLink("import.artefactV1", "import.artefactV1", getTranslator(), mainVc, this, Link.LINK);
importArtefactV1Link.setIconLeftCSS("o_icon o_icon_import");
} else {
importArtefactV1Link = null;
}
putInitialPanel(mainVc);
}
......
......@@ -2,5 +2,7 @@
<li>$r.render("add.file")</li>
<li>$r.render("add.text")</li>
<li>$r.render("add.citation")</li>
#if($r.available("import.artefactV1"))
<li>$r.render("import.artefactV1")</li>
#end
</ul>
\ No newline at end of file
......@@ -57,7 +57,7 @@ binder.num.sections.pages={0} Bereich(e) mit insgesamt {1} Eintr\u00E4gen
binder.status=Status
binder.title=Portfolio Mappe {0}
categories=Kategorien
categories.hint=Geben Sie die gew\u00FCnschten Text ein und dr\u00FCcken Sie "Enter" um eine Kategorie ihrer wahl zu erstellen.
categories.hint=Geben Sie den gew\u00FCnschten Text ein und dr\u00FCcken Sie die Eingabetaste, um eine Kategorie ihrer Wahl zu erstellen.
changes.since=\u00C4nderungen seit
citation=Zitat
close=Eintrag schliessen
......
......@@ -87,6 +87,7 @@ public class PortfolioAdminController extends FormBasicController {
String[] enabledValues = new String[] { translate("enabled")};
userCanCreatePortfolioEnabled = uifactory.addCheckboxesHorizontal("portfolio.user.can.create.binder", moduleFlc, enabledKeys, enabledValues);
userCanCreatePortfolioEnabled.select(enabledKeys[0], portfolioV2Module.isLearnerCanCreateBinders());
userCanCreatePortfolioEnabled.addActionListener(FormEvent.ONCHANGE);
userCanCreatePortfolioEnabled.setVisible(portfolioV2Module.isEnabled());
......
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