use of org.olat.core.gui.render.StringOutput in project openolat by klemens.
the class VelocityRenderDecorator method contextHelpJSCommand.
/**
* Create a js command to open a specific page in the manual.
*
* @param page Help page name
* @return
*/
public StringOutput contextHelpJSCommand(String page) {
StringOutput sb = new StringOutput(100);
if (helpModule.isHelpEnabled()) {
Locale locale = renderer.getTranslator().getLocale();
String url = helpModule.getHelpProvider().getURL(locale, page);
sb.append("contextHelpWindow('").append(url).append("')");
}
return sb;
}
use of org.olat.core.gui.render.StringOutput in project openolat by klemens.
the class VelocityRenderDecorator method renderForce.
/**
* renders the component.
* if the component cannot be found, there is no error, but an empty String is returned. Not recommended to use normally, but rather use @see render(String componentName)
*
* @param componentName
* @return
*/
public StringOutput renderForce(String componentName) {
Component source = renderer.findComponent(componentName);
StringOutput sb;
if (source == null) {
sb = new StringOutput(1);
} else if (target == null) {
sb = new StringOutput(10000);
renderer.render(source, sb, null);
} else {
renderer.render(source, target, null);
}
return new StringOutput(1);
}
use of org.olat.core.gui.render.StringOutput in project openolat by klemens.
the class VelocityRenderDecorator method contextHelpLink.
/**
* Create a link to a specific page in the manual. The link points to the
* corresponding page in the manual.
*
* @param page
* Help page name
*/
public StringOutput contextHelpLink(String page) {
StringOutput sb = new StringOutput(100);
if (helpModule.isHelpEnabled()) {
String url = helpModule.getHelpProvider().getURL(renderer.getTranslator().getLocale(), page);
sb.append(url);
}
return sb;
}
use of org.olat.core.gui.render.StringOutput in project openolat by klemens.
the class VelocityRenderDecorator method formURIbg.
/**
* Use it to create the action for a handmade form in a velocity template,
* e.g. '<form method="post" action="$r.formURIgb("viewswitch")">'
* @param command
* @return
*/
public StringOutput formURIbg(String command) {
StringOutput sb = new StringOutput(100);
renderer.getUrlBuilder().buildURI(sb, new String[] { VelocityContainer.COMMAND_ID }, new String[] { command }, isIframePostEnabled ? AJAXFlags.MODE_TOBGIFRAME : AJAXFlags.MODE_NORMAL);
return sb;
}
use of org.olat.core.gui.render.StringOutput in project openolat by klemens.
the class VelocityRenderDecorator method contextHelpWithWrapper.
/**
* Create a link wrapped with some markup to render a nice help button. The
* link points to the corresponding page in the manual.
*
* @param page Help page name
* @return
*/
public StringOutput contextHelpWithWrapper(String page) {
StringOutput sb = new StringOutput(192);
if (helpModule.isHelpEnabled()) {
Locale locale = renderer.getTranslator().getLocale();
String url = helpModule.getHelpProvider().getURL(locale, page);
if (url != null) {
String title = StringEscapeUtils.escapeHtml(renderer.getTranslator().translate("help.button"));
sb.append("<span class=\"o_chelp_wrapper\">").append("<a href=\"").append(url).append("\" class=\"o_chelp\" target=\"_blank\" title=\"").append(title).append("\"><i class='o_icon o_icon_help'></i> ").append(renderer.getTranslator().translate("help")).append("</a></span>");
}
}
return sb;
}
Aggregations