diff --git a/basiclti/basiclti-api/src/java/org/sakaiproject/lti/api/LTIService.java b/basiclti/basiclti-api/src/java/org/sakaiproject/lti/api/LTIService.java index 6ee23337d7ff..8c8e10df6b7c 100644 --- a/basiclti/basiclti-api/src/java/org/sakaiproject/lti/api/LTIService.java +++ b/basiclti/basiclti-api/src/java/org/sakaiproject/lti/api/LTIService.java @@ -60,7 +60,7 @@ public interface LTIService extends LTISubstitutionsFilter { "pagetitle:text:label=bl_pagetitle:required=true:allowed=true:maxlength=1024", "fa_icon:text:label=bl_fa_icon:allowed=true:maxlength=1024", "frameheight:integer:label=bl_frameheight:allowed=true", - "toolorder:integer:label=bl_toolorder:maxlength=2", + "toolorder:integer:label=bl_toolorder:maxlength=2:role=admin", "newpage:checkbox:label=bl_newpage", "protect:checkbox:label=bl_protect:role=admin", "debug:checkbox:label=bl_debug", diff --git a/basiclti/basiclti-tool/src/bundle/ltitool.properties b/basiclti/basiclti-tool/src/bundle/ltitool.properties index b8d1ccba9b63..608a9e994b0b 100644 --- a/basiclti/basiclti-tool/src/bundle/ltitool.properties +++ b/basiclti/basiclti-tool/src/bundle/ltitool.properties @@ -169,7 +169,7 @@ error.need.key.secret=This tool will not function without a key and secret. error.link.placement.update=Error updating placement information in configuration item error.tool.no.encryption.key=This server does not have basiclti.encryption.key set in its sakai.properties. Until you set this value, LTI secrets will be unencrypted in the database. -need.tool.info=

Note: This tool was imported and needs a key and secret before it will function.

+need.tool.info=

Note: This tool needs a key and secret before it will function.

need.tool.secret=Tool secret need.tool.key=Tool key diff --git a/basiclti/basiclti-tool/src/bundle/ltitool_ar.properties b/basiclti/basiclti-tool/src/bundle/ltitool_ar.properties index d21e32774e4b..ddf9e42302ef 100644 --- a/basiclti/basiclti-tool/src/bundle/ltitool_ar.properties +++ b/basiclti/basiclti-tool/src/bundle/ltitool_ar.properties @@ -132,7 +132,7 @@ error.need.key.secret=This tool will not function without a key and secret. error.link.placement.update=Error updating placement information in configuration item error.tool.no.encryption.key=This server does not have basiclti.encryption.key set in its sakai.properties. Until you set this value, LTI secrets will be unencrypted in the database. -need.tool.info=

Note\: This tool was imported and needs a key and secret before it will function.

+need.tool.info=

Note\: This tool needs a key and secret before it will function.

need.tool.secret=Tool secret need.tool.key=Tool key diff --git a/basiclti/basiclti-tool/src/bundle/ltitool_eu.properties b/basiclti/basiclti-tool/src/bundle/ltitool_eu.properties index 75878b9e85ec..e6801e9642ce 100644 --- a/basiclti/basiclti-tool/src/bundle/ltitool_eu.properties +++ b/basiclti/basiclti-tool/src/bundle/ltitool_eu.properties @@ -131,7 +131,7 @@ error.need.key.secret=This tool will not function without a key and secret. error.link.placement.update=Error updating placement information in configuration item error.tool.no.encryption.key=This server does not have basiclti.encryption.key set in its sakai.properties. Until you set this value, LTI secrets will be unencrypted in the database. -need.tool.info=

Note\: This tool was imported and needs a key and secret before it will function.

+need.tool.info=

Note\: This tool needs a key and secret before it will function.

need.tool.secret=Tool secret need.tool.key=Tool key diff --git a/basiclti/basiclti-tool/src/bundle/ltitool_fr_FR.properties b/basiclti/basiclti-tool/src/bundle/ltitool_fr_FR.properties index b6d1bd0e1701..08f757bce9c8 100644 --- a/basiclti/basiclti-tool/src/bundle/ltitool_fr_FR.properties +++ b/basiclti/basiclti-tool/src/bundle/ltitool_fr_FR.properties @@ -131,7 +131,7 @@ error.need.key.secret=Cet outil ne fonctionnera pas sans une cl\u00e9 et un secr error.link.placement.update=Erreur de mise \u00e0 jour des informations de placement dans l'\u00e9l\u00e9ment de configuration error.tool.no.encryption.key=This server does not have basiclti.encryption.key set in its sakai.properties. Until you set this value, LTI secrets will be unencrypted in the database. -need.tool.info=

Note\: This tool was imported and needs a key and secret before it will function.

+need.tool.info=

Note\: This tool needs a key and secret before it will function.

need.tool.secret=Secret de l'outil need.tool.key=Cl\u00e9 de l'outil diff --git a/basiclti/basiclti-tool/src/java/org/sakaiproject/blti/tool/LTIAdminTool.java b/basiclti/basiclti-tool/src/java/org/sakaiproject/blti/tool/LTIAdminTool.java index 7aa7c01f8de1..cf3bf2d6a2e5 100644 --- a/basiclti/basiclti-tool/src/java/org/sakaiproject/blti/tool/LTIAdminTool.java +++ b/basiclti/basiclti-tool/src/java/org/sakaiproject/blti/tool/LTIAdminTool.java @@ -149,6 +149,7 @@ public class LTIAdminTool extends VelocityPortletPaneledAction { private static String FLOW_PARAMETER_EDITOR = "editor"; private static String FLOW_PARAMETER_ASSIGNMENT = "assignment"; private static String FLOW_PARAMETER_IMPORT = "import"; + private static String SECRETONLY_PARAMETER = "secretonly"; /** * Service Implementations @@ -1234,7 +1235,14 @@ public String buildContentPanelContext(VelocityPortlet portlet, Context context, public List> getAvailableTools (String ourSite, String contextString) { - List> tools = ltiService.getTools(null, null, 0, 0, ourSite); + Boolean isAdmin = ltiService.isAdmin(ourSite); + List> tools = null; + if ( isAdmin ) { + tools = ltiService.getTools(null, null, 0, 0, ourSite); + } else { + tools = ltiService.getToolsLaunch(ourSite); + } + // only list the tools available in the system List> systemTools = new ArrayList>(); for (Map tool : tools) { @@ -1370,6 +1378,9 @@ public String buildContentPutPanelContext(VelocityPortlet portlet, Context conte context.put("tool_visible", visible); } + String flow = data.getParameters().getString(FLOW_PARAMETER); + context.put("flow", flow); + return "lti_content_insert"; } @@ -2375,7 +2386,11 @@ public String buildContentConfigPanelContext(VelocityPortlet portlet, Context co if (flow == null && previousPost != null) { flow = previousPost.getProperty(FLOW_PARAMETER); } - log.debug("buildContentConfigPanelContext flow={}", flow); + String secretonly = data.getParameters().getString(SECRETONLY_PARAMETER); + if (secretonly == null && previousPost != null) { + secretonly = previousPost.getProperty(SECRETONLY_PARAMETER); + } + log.debug("buildContentConfigPanelContext flow={} secretonly={}", flow, secretonly); // TODO: Have Lessons use the normal entry point instead of coming directly here if (flow == null) { @@ -2480,7 +2495,8 @@ public String buildContentConfigPanelContext(VelocityPortlet portlet, Context co } // We will handle the tool_id field ourselves in the Velocity code - String[] contentForm = foorm.filterForm(null, ltiService.getContentModel(toolKey, getSiteId(state)), null, "^tool_id:.*|^SITE_ID:.*"); + // We handle the description separateely below + String[] contentForm = foorm.filterForm(null, ltiService.getContentModel(toolKey, getSiteId(state)), null, "^tool_id:.*|^SITE_ID:.*|^description:.*"); if (contentForm == null) { addAlert(state, rb.getString("error.tool.not.found")); return "lti_error"; @@ -2527,6 +2543,7 @@ public String buildContentConfigPanelContext(VelocityPortlet portlet, Context co String formInput = ltiService.formInput(previousData, contentForm); context.put("formInput", formInput); context.put("flow", flow); + context.put("secretonly", secretonly); return "lti_content_config"; } diff --git a/basiclti/basiclti-tool/src/webapp/vm/lti_content_config.vm b/basiclti/basiclti-tool/src/webapp/vm/lti_content_config.vm index 13237d337ab3..e84e7c05df54 100644 --- a/basiclti/basiclti-tool/src/webapp/vm/lti_content_config.vm +++ b/basiclti/basiclti-tool/src/webapp/vm/lti_content_config.vm @@ -45,6 +45,7 @@ $tlang.getString("need.tool.info") + #if ( $returnUrl ) #end @@ -64,6 +65,13 @@ $tlang.getString("content.admin.note") #if ( ! $isAdmin )