Skip to content
Snippets Groups Projects
Commit bd7491fc authored by Laurent M.'s avatar Laurent M.
Browse files

OO-2007: add access to link title text - fix issue where changing translator...

OO-2007: add access to link title text - fix issue where changing translator was not propagating to internal component
parent 9eaca8d5
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,8 @@ public interface FormLink extends FormItem {
* @param i18nKey
*/
public void setLinkTitle(String i18nKey);
public String getLinkTitleText();
/**
* @param true: set link to active state (only render issue); false set to not active (default)
*/
......
......@@ -35,6 +35,7 @@ import org.olat.core.gui.components.form.flexible.impl.FormItemImpl;
import org.olat.core.gui.components.link.FormLinkFactory;
import org.olat.core.gui.components.link.Link;
import org.olat.core.gui.control.Event;
import org.olat.core.gui.translator.Translator;
import org.olat.core.util.StringHelper;
import org.olat.core.util.ValidationStatus;
......@@ -190,6 +191,14 @@ public class FormLinkImpl extends FormItemImpl implements FormLink {
return cmd;
}
@Override
public void setTranslator(Translator translator) {
if(this.component != null) {
this.component.setTranslator(translator);
}
super.setTranslator(translator);
}
@Override
public void setElementCssClass(String elementCssClass) {
if(component != null) {
......@@ -284,6 +293,20 @@ public class FormLinkImpl extends FormItemImpl implements FormLink {
}
}
@Override
public String getLinkTitleText() {
String title = null;
if (component != null) {
title = component.getCustomDisplayText();
if (title == null && getTranslator() != null) {
if (StringHelper.containsNonWhitespace(component.getI18n())) {
title = getTranslator().translate(component.getI18n());
}
}
}
return title;
}
@Override
public void setActive(boolean isActive) {
if (component != null) {
......
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