diff --git a/config/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties b/config/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties index 48a72b88ca3d..79b41970f01c 100644 --- a/config/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties +++ b/config/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties @@ -2549,6 +2549,11 @@ # DEFAULT: false # resources.show_all_collections.helper=true +# Indicates whether users should see "Show Other Sites" twiggle in file picker +# If this is not set explicity it will look to the resources helper twiggle setting as it is very similar +# DEFAULT: resources.show_all_collections.helper +# filepicker.show_all_collections=true + # The default number of members for a collection at which the resourcse tool should refuse to expand the collection. # DEFAULT: 256 # resources.expanded_folder_size_limit=256 diff --git a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/FilePickerAction.java b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/FilePickerAction.java index 9ade2c28c768..05540e74d8cb 100755 --- a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/FilePickerAction.java +++ b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/FilePickerAction.java @@ -209,6 +209,7 @@ public class FilePickerAction extends PagedResourceHelperAction protected static final String STATE_SESSION_INITIALIZED = PREFIX + "session_initialized"; protected static final String STATE_SHOW_ALL_SITES = PREFIX + "show_all_sites"; protected static final String STATE_SHOW_OTHER_SITES = PREFIX + "show_other_sites"; + public static final String SAK_PROP_SHOW_ALL_SITES = PREFIX + "show_all_collections"; /** The sort by */ private static final String STATE_SORT_BY = PREFIX + "sort_by"; @@ -1047,8 +1048,9 @@ protected String initHelperAction(SessionState state, ToolSession toolSession) state.setAttribute(STATE_MODE, MODE_HELPER); toolSession.setAttribute(STATE_FILEPICKER_MODE, MODE_ATTACHMENT_SELECT); - // TODO: Should check sakai.properties - toolSession.setAttribute(STATE_SHOW_ALL_SITES, Boolean.TRUE.toString()); + boolean show_all_sites = ServerConfigurationService.getBoolean(SAK_PROP_SHOW_ALL_SITES, + ServerConfigurationService.getBoolean(ResourcesAction.SAK_PROP_SHOW_ALL_SITES_IN_HELPER, Boolean.TRUE)); + toolSession.setAttribute(STATE_SHOW_ALL_SITES, Boolean.toString(show_all_sites)); // state attribute ResourcesAction.STATE_ATTACH_TOOL_NAME should be set with a string to indicate name of tool String toolName = ToolManager.getCurrentPlacement().getTitle(); diff --git a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesAction.java b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesAction.java index 75de22d51e65..d93f813fb89d 100644 --- a/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesAction.java +++ b/content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesAction.java @@ -586,6 +586,10 @@ public void setParent(String parent) /** The default value for whether to show all sites in resources tool (used if global value can't be read from server config service) */ private static final boolean SHOW_ALL_SITES_IN_RESOURCES = false; /** The collection id being browsed. */ + public static final String SAK_PROP_SHOW_ALL_SITES_IN_TOOL = PREFIX + "show_all_collections.tool"; + public static final String SAK_PROP_SHOW_ALL_SITES_IN_DROPBOX = PREFIX + "show_all_collections.dropbox"; + public static final String SAK_PROP_SHOW_ALL_SITES_IN_HELPER = PREFIX + "show_all_collections.helper"; + private static final String STATE_COLLECTION_ID = PREFIX + REQUEST + "collection_id"; @@ -8491,15 +8495,15 @@ else if(uploadMax == null) boolean show_other_sites = false; if(RESOURCES_MODE_HELPER.equals(resources_mode)) { - show_other_sites = ServerConfigurationService.getBoolean("resources.show_all_collections.helper", SHOW_ALL_SITES_IN_FILE_PICKER); + show_other_sites = ServerConfigurationService.getBoolean(SAK_PROP_SHOW_ALL_SITES_IN_HELPER, SHOW_ALL_SITES_IN_FILE_PICKER); } else if(RESOURCES_MODE_DROPBOX.equals(resources_mode)) { - show_other_sites = ServerConfigurationService.getBoolean("resources.show_all_collections.dropbox", SHOW_ALL_SITES_IN_DROPBOX); + show_other_sites = ServerConfigurationService.getBoolean(SAK_PROP_SHOW_ALL_SITES_IN_DROPBOX, SHOW_ALL_SITES_IN_DROPBOX); } else { - show_other_sites = ServerConfigurationService.getBoolean("resources.show_all_collections.tool", SHOW_ALL_SITES_IN_RESOURCES); + show_other_sites = ServerConfigurationService.getBoolean(SAK_PROP_SHOW_ALL_SITES_IN_TOOL, SHOW_ALL_SITES_IN_RESOURCES); } /** set attribute for the maximum size at which the resources tool will expand a collection. */