mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged 1.4 to HEAD
svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4734 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4751 . Ignored 4672, 4676 in accordance with Roy's checkin notices 4735 appeared to be already in HEAD git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4760 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -151,33 +151,8 @@ public class ActionLinkRenderer extends BaseRenderer
|
|||||||
}
|
}
|
||||||
linkBuf.append(href);
|
linkBuf.append(href);
|
||||||
|
|
||||||
// append arguments if specified
|
// append the href params if any are present
|
||||||
Map<String, String> actionParams = getParameterComponents(link);
|
renderHrefParams(link, linkBuf, href);
|
||||||
if (actionParams != null)
|
|
||||||
{
|
|
||||||
boolean first = (href.indexOf('?') == -1);
|
|
||||||
for (String name : actionParams.keySet())
|
|
||||||
{
|
|
||||||
String paramValue = actionParams.get(name);
|
|
||||||
if (first)
|
|
||||||
{
|
|
||||||
linkBuf.append('?');
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
linkBuf.append('&');
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
linkBuf.append(name).append("=").append(URLEncoder.encode(paramValue, "UTF-8"));
|
|
||||||
}
|
|
||||||
catch (UnsupportedEncodingException err)
|
|
||||||
{
|
|
||||||
// if this happens we have bigger problems than a missing URL parameter...!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
linkBuf.append('"');
|
linkBuf.append('"');
|
||||||
|
|
||||||
@@ -288,6 +263,42 @@ public class ActionLinkRenderer extends BaseRenderer
|
|||||||
return linkHtml;
|
return linkHtml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param link
|
||||||
|
* @param linkBuf
|
||||||
|
* @param href
|
||||||
|
*/
|
||||||
|
private void renderHrefParams(UIActionLink link, StringBuilder linkBuf, String href)
|
||||||
|
{
|
||||||
|
// append arguments if specified
|
||||||
|
Map<String, String> actionParams = getParameterComponents(link);
|
||||||
|
if (actionParams != null)
|
||||||
|
{
|
||||||
|
boolean first = (href.indexOf('?') == -1);
|
||||||
|
for (String name : actionParams.keySet())
|
||||||
|
{
|
||||||
|
String paramValue = actionParams.get(name);
|
||||||
|
if (first)
|
||||||
|
{
|
||||||
|
linkBuf.append('?');
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
linkBuf.append('&');
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
linkBuf.append(name).append("=").append(URLEncoder.encode(paramValue, "UTF-8"));
|
||||||
|
}
|
||||||
|
catch (UnsupportedEncodingException err)
|
||||||
|
{
|
||||||
|
// if this happens we have bigger problems than a missing URL parameter...!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render ActionLink as menu image and item link
|
* Render ActionLink as menu image and item link
|
||||||
*
|
*
|
||||||
@@ -339,8 +350,12 @@ public class ActionLinkRenderer extends BaseRenderer
|
|||||||
href = context.getExternalContext().getRequestContextPath() + href;
|
href = context.getExternalContext().getRequestContextPath() + href;
|
||||||
}
|
}
|
||||||
buf.append("<a href=\"")
|
buf.append("<a href=\"")
|
||||||
.append(href)
|
.append(href);
|
||||||
.append('"');
|
|
||||||
|
// append the href params if any are present
|
||||||
|
renderHrefParams(link, buf, href);
|
||||||
|
|
||||||
|
buf.append('"');
|
||||||
|
|
||||||
// output href 'target' attribute if supplied
|
// output href 'target' attribute if supplied
|
||||||
if (link.getTarget() != null)
|
if (link.getTarget() != null)
|
||||||
|
Reference in New Issue
Block a user