Skip to content

Commit

Permalink
Merge pull request sakaiproject#587 from mcarropellicer/SAK-29445
Browse files Browse the repository at this point in the history
SAK-29445 - Make launch text on LTI tool more user friendly
  • Loading branch information
ottenhoff committed Jun 9, 2015
2 parents 684b43e + a38ee13 commit d0062e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion basiclti/basiclti-portlet/src/bundle/basiclti.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ noiframes = Your browser does not support iframes.
noiframe.press.here = Press here to launch.
not.configured = This tool has not yet been configured.

new.page.launch = Content opened in a new window. Make sure pop up windows are allowed in your browser.
new.page.launch = (We attempted to launch {0} in a new window. To launch pop-up windows automatically in the future, configure your browser to allow {1} to open pop-up windows.)
tool.name = your tool

edit.exit = Cancel
edit.clear.prefs = Clear Stored Preferences
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ public class IMSBLTIPortlet extends GenericPortlet {

public final static String CURRENT_HTTP_REQUEST = "org.sakaiproject.util.RequestFilter.http_request";

public static final String SITE_NAME = "ui.service";

public static final String SAKAI = "Sakai";

public void init(PortletConfig config) throws PortletException {
super.init(config);

Expand Down Expand Up @@ -238,9 +242,12 @@ public void doView(RenderRequest request, RenderResponse response)
text.append(windowOpen+"\n");
text.append("</script>\n");
}
text.append(rb.getString("new.page.launch"));
text.append("<br><a href=\""+iframeUrl+"\" onclick=\""+windowOpen+"\" target=\"BasicLTI\">"+rb.getString("noiframe.press.here")+"</a>");
String siteName = ServerConfigurationService.getString(SITE_NAME, SAKAI);
title = title!=null ? title : rb.getString("tool.name", "your tool");
String newPageLaunchText = rb.getFormattedMessage("new.page.launch", new Object[]{FormattedText.escapeHtml(title, false), FormattedText.escapeHtml(siteName, false)});
text.append(newPageLaunchText);
text.append("</p>\n");
text.append("<input type=\"submit\" onclick=\""+windowOpen+"\" target=\"BasicLTI\" value=\"Launch " + title + "\"/>");
} else {
if ( "on".equals(maximize) ) {
text.append("<script type=\"text/javascript\" language=\"JavaScript\">\n");
Expand Down

0 comments on commit d0062e0

Please sign in to comment.