Changeset 7761
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/Base.java
r7759 r7761 1737 1737 { 1738 1738 link += " <span class=\"file-actions\">[<span title=\"This file is offline\">" + 1739 "<img src=\"" + root + "images/offline.png\" alt=\"offline\"> </span>";1739 "<img src=\"" + root + "images/offline.png\" alt=\"offline\">]</span>"; 1740 1740 } 1741 1741 } -
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/fileviewer/FileViewerUtil.java
r7760 r7761 62 62 63 63 /** 64 Rended the extensions with the current file context information. 64 Render the extensions with the current file context information 65 and write it to the JSP output. 65 66 */ 66 67 public void render() 67 68 throws IOException 69 { 70 String result = renderAsString(); 71 if (result.length() > 0) 72 { 73 jspContext.getOut().write(result); 74 } 75 } 76 77 /** 78 Render the extensions with the current file context information 79 and return it as a string. Returns an empty string if there are no 80 actions. 81 */ 82 public String renderAsString() 68 83 { 69 84 // Need to repeat this since to make sure the correct context is always used … … 75 90 fileActions.renderDefault(); 76 91 jspContext.getPageContext().popBody(); 77 String result = actions.toString();78 92 79 // Now, write the final output to the JSP80 if ( result != null && result.length() > 0)93 String result = ""; 94 if (actions.getBuffer().length() > 0) 81 95 { 82 jspContext.getOut().write("<span class=\"file-actions\">" + prefix + result + suffix + "</span>");96 result = "<span class=\"file-actions\">" + prefix + actions.toString() + suffix + "</span>"; 83 97 } 98 return result; 84 99 } 85 100 -
trunk/www/common/anytoany/list_anytoany.jsp
r7604 r7761 53 53 import="net.sf.basedb.clients.web.extensions.list.ListColumnAction" 54 54 import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" 55 import="net.sf.basedb.clients.web.extensions.fileviewer.FileViewerContext" 56 import="net.sf.basedb.clients.web.extensions.fileviewer.FileViewerUtil" 55 57 import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" 56 58 import="java.util.List" … … 84 86 ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext); 85 87 ExtensionsInvoker<ListColumnAction<AnyToAny,?>> columnsInvoker = ListColumnUtil.useExtensions(jspContext); 88 FileViewerContext fileContext = FileViewerContext.anyToAny(item); 89 FileViewerUtil fileViewer = new FileViewerUtil(jspContext, fileContext); 86 90 %> 87 91 <base:page type="include"> 88 92 <base:head scripts="/common/anytoany/list.js" /> 89 93 <base:body> 94 <ext:scripts context="<%=jspContext%>" /> 90 95 <base:section 91 96 id="anytoany" … … 179 184 180 185 String toLink = ""; 181 if (to instanceof File) 182 { 183 File toFile = (File)to; 184 toLink = Base.getLinkedFile(ID, toFile, false, true, true, root); 185 } 186 else if (to instanceof Nameable) 186 if (to instanceof Nameable) 187 187 { 188 188 Nameable nameable = (Nameable)to; … … 204 204 { 205 205 toLink = Base.getLink(ID, to.toString(), to.getType(), to.getId(), true); 206 } 207 if (to instanceof File) 208 { 209 File toFile = (File)to; 210 fileContext.setCurrentAnyToAny(toFile, ata); 211 toLink += " " + fileViewer.renderAsString(); 206 212 } 207 213 if (to instanceof Subtypable)
Note: See TracChangeset
for help on using the changeset viewer.