Changeset 3822
- Timestamp:
- Oct 12, 2007, 12:27:14 PM (16 years ago)
- Location:
- branches/2.4-stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.4-stable/src/clients/web/net/sf/basedb/clients/web/Base.java
r3749 r3822 395 395 396 396 // Current item 397 String itemId = request.getParameter("item_id");397 String itemId = Values.getStringOrNull(request.getParameter("item_id")); 398 398 cc.setId(Values.getInt(itemId, cc.getId())); 399 399 -
branches/2.4-stable/www/include/menu.jsp
r3679 r3822 106 106 for (String recent : recentlyViewed) 107 107 { 108 String[] tmp = recent.split("="); 109 Item itemType = Item.valueOf(tmp[0]); 110 int itemId = Values.getInt(tmp[1], 0); 111 if (itemId != 0) 108 try 112 109 { 113 String shortName = ""; 114 String fullName = ""; 115 if (loadNames) 110 String[] tmp = recent.split("="); 111 Item itemType = Item.valueOf(tmp[0]); 112 int itemId = Values.getInt(tmp[1], 0); 113 if (itemId != 0) 116 114 { 117 try 115 String shortName = ""; 116 String fullName = ""; 117 if (loadNames) 118 118 { 119 BasicItem item = itemType.getById(dc, itemId); 120 fullName = ((Nameable)item).getName(); 121 shortName = HTML.encodeTags(StringUtil.trimString(fullName, 35)); 119 try 120 { 121 BasicItem item = itemType.getById(dc, itemId); 122 fullName = ((Nameable)item).getName(); 123 shortName = HTML.encodeTags(StringUtil.trimString(fullName, 35)); 124 } 125 catch (Throwable t) 126 { 127 continue; 128 } 122 129 } 123 catch (Throwable t)130 else 124 131 { 125 continue; 132 fullName = itemType.toString() + "; id=" + itemId; 133 shortName = itemType + " (id=" + itemId + ")"; 126 134 } 135 numItems++; 136 %> 137 <m:menuitem 138 title="<%=numItems + ". " + shortName%>" 139 onclick="<%="Main.viewOrEditItem('" + ID + "', '" + itemType.name() + "', " + itemId + ")"%>" 140 tooltip="<%="Go to " + HTML.encodeTags(fullName) + " (" + itemType + ")"%>" 141 /> 142 <% 127 143 } 128 else129 {130 fullName = itemType.toString() + "; id=" + itemId;131 shortName = itemType + " (id=" + itemId + ")";132 }133 numItems++;134 %>135 <m:menuitem136 title="<%=numItems + ". " + shortName%>"137 onclick="<%="Main.viewOrEditItem('" + ID + "', '" + itemType.name() + "', " + itemId + ")"%>"138 tooltip="<%="Go to " + HTML.encodeTags(fullName) + " (" + itemType + ")"%>"139 />140 <%141 144 } 145 catch (Throwable t) 146 {} 142 147 } 143 148 } … … 162 167 for (String recentItem : stickyItems.split(":")) 163 168 { 164 Item itemType = Item.valueOf(recentItem); 165 ItemContext cc = sc.getCurrentContext(itemType); 166 if (cc.getId() != 0) 169 try 167 170 { 168 String shortName = "";169 String fullName = "";170 if ( loadNames)171 Item itemType = Item.valueOf(recentItem); 172 ItemContext cc = sc.getCurrentContext(itemType); 173 if (cc.getId() != 0) 171 174 { 172 try 175 String shortName = ""; 176 String fullName = ""; 177 if (loadNames) 173 178 { 174 BasicItem item = itemType.getById(dc, cc.getId()); 175 fullName = ((Nameable)item).getName(); 176 shortName = ": " + HTML.encodeTags(StringUtil.trimString(fullName, 30)); 179 try 180 { 181 BasicItem item = itemType.getById(dc, cc.getId()); 182 fullName = ((Nameable)item).getName(); 183 shortName = ": " + HTML.encodeTags(StringUtil.trimString(fullName, 30)); 184 } 185 catch (Throwable t) 186 { 187 continue; 188 } 177 189 } 178 catch (Throwable t)190 else 179 191 { 180 continue; 192 fullName = itemType.toString() + "; id=" + cc.getId(); 193 shortName = " (id=" + cc.getId() + ")"; 194 } 195 numItems++; 196 numSticky++; 197 %> 198 <m:menuitem 199 title="<%=itemType + shortName%>" 200 onclick="<%="Main.viewOrEditItem('" + ID + "', '" + itemType.name() + "', " + cc.getId() + ")"%>" 201 tooltip="<%="Go to " + HTML.encodeTags(fullName) + " (" + itemType + ")"%>" 202 /> 203 <% 204 if (itemType == Item.BIOASSAYSET) 205 { 206 // Add menu for Experiment explorer as well 207 %> 208 <m:menuitem 209 title="<%="Experiment explorer"+HTML.encodeTags(shortName)%>" 210 onclick="<%="location.href = '"+root+"views/experiments/explorer/view/index.jsp?ID=" + ID + "&bioassayset_id="+cc.getId()+"'"%>" 211 tooltip="Go to experiment explorer" 212 /> 213 <% 181 214 } 182 215 } 183 else184 {185 fullName = itemType.toString() + "; id=" + cc.getId();186 shortName = " (id=" + cc.getId() + ")";187 }188 numItems++;189 numSticky++;190 %>191 <m:menuitem192 title="<%=itemType + shortName%>"193 onclick="<%="Main.viewOrEditItem('" + ID + "', '" + itemType.name() + "', " + cc.getId() + ")"%>"194 tooltip="<%="Go to " + HTML.encodeTags(fullName) + " (" + itemType + ")"%>"195 />196 <%197 if (itemType == Item.BIOASSAYSET)198 {199 // Add menu for Experiment explorer as well200 %>201 <m:menuitem202 title="<%="Experiment explorer"+HTML.encodeTags(shortName)%>"203 onclick="<%="location.href = '"+root+"views/experiments/explorer/view/index.jsp?ID=" + ID + "&bioassayset_id="+cc.getId()+"'"%>"204 tooltip="Go to experiment explorer"205 />206 <%207 }208 216 } 217 catch (Throwable t) 218 {} 209 219 } 210 220 if (numSticky == 0)
Note: See TracChangeset
for help on using the changeset viewer.