Index: user/user-tool-prefs/tool/src/java/org/sakaiproject/user/tool/UserPrefsTool.java =================================================================== --- user/user-tool-prefs/tool/src/java/org/sakaiproject/user/tool/UserPrefsTool.java (revision 18369) +++ user/user-tool-prefs/tool/src/java/org/sakaiproject/user/tool/UserPrefsTool.java (working copy) @@ -67,7 +67,8 @@ /** The string that Charon uses for preferences. */ private static final String CHARON_PREFS = "sakai:portal:sitenav"; - + + /** * Represents a name value pair in a keyed preferences set. */ @@ -96,6 +97,7 @@ /** The value. */ protected String m_value = null; + public KeyNameValue(String key, String name, String value, boolean isList) { @@ -182,6 +184,8 @@ m_value = value; } } + + } /** The PreferencesEdit being worked on. */ @@ -231,11 +235,42 @@ private String userId = ""; private String SAKAI_LOCALES = "locales"; + + protected int tabCount = 4; + + + protected String tabCountIn = "4"; // //////////////////////////////// PROPERTY GETTER AND SETTER //////////////////////////////////////////// /** * @return Returns the ResourceLoader value. Note: workaround for element, which doesn't like using the map variable */ + + + public String getTabCountIn() { + return tabCountIn; + } + + public void setTabCountIn(String tabCountIn) { + try{ + tabCount = Integer.parseInt(tabCountIn); + }catch(NumberFormatException e){ + FacesContext.getCurrentInstance().addMessage(null, + new FacesMessage(msgs.getString("tab_count_parse_error"))); + } + this.tabCountIn = Integer.toString(tabCount); + } + + + public int getTabCount() { + return tabCount; + } + + public void setTabCount(String tabCountIn) { + + this.tabCount = tabCount; + } + public String getMsgNotiAnn1() { return msgs.getString("noti_ann_1"); @@ -917,11 +952,13 @@ String value = (String) item.getValue(); oparts += value + ", "; } + + // check the format of the // add property name and value for saving m_stuff.add(new KeyNameValue(CHARON_PREFS, "exclude", eparts, true)); m_stuff.add(new KeyNameValue(CHARON_PREFS, "order", oparts, true)); // TODO tab size is set to 4 by default. i can't set null , not "" as in portal code "" will be number to display on tab - // m_stuff.add(new KeyNameValue(CHARON_PREFS, "tabs", "4", false)); + m_stuff.add(new KeyNameValue(CHARON_PREFS, "tabs", Integer.toString(tabCount), false)); // save saveEdit(); @@ -1787,4 +1824,6 @@ { m_refreshElement = element; } + + } Index: user/user-tool-prefs/tool/src/bundle/user-tool-prefs.properties =================================================================== --- user/user-tool-prefs/tool/src/bundle/user-tool-prefs.properties (revision 18369) +++ user/user-tool-prefs/tool/src/bundle/user-tool-prefs.properties (working copy) @@ -44,7 +44,10 @@ tab_move_lone=< tab_move_rall=>> tab_move_lall=<< +tab_count_inst=The number of tabs visible in addition to 'My Workspace' +tab_count_parse_error=Visible Tab Count must be an integer (value was reset) + time_inst_1=Please select your local time zone for selected Sakai tools, such as Schedule. You are currently in the time_inst_2=timezone Index: user/user-tool-prefs/tool/src/webapp/prefs/tab.jsp =================================================================== --- user/user-tool-prefs/tool/src/webapp/prefs/tab.jsp (revision 18369) +++ user/user-tool-prefs/tool/src/webapp/prefs/tab.jsp (working copy) @@ -60,7 +60,12 @@
- + + + : + + +