Prevent 404 in .../contextMenu link when there's no context menu

This commit is contained in:
Kohsuke Kawaguchi committed 2012-07-23 14:10:16 -07:00
1 parent 31bda5786a
commit e094b90e4c
5 files changed
+20 -2

No files matched your search

+5
View File
@@ -58,6 +58,7 @@ import hudson.views.ViewsTabBar;
import hudson.widgets.RenderOnDemandClosure;
import jenkins.model.GlobalConfiguration;
import jenkins.model.Jenkins;
import jenkins.model.ModelObjectWithContextMenu;
import org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken;
import org.apache.commons.jelly.JellyContext;
import org.apache.commons.jelly.JellyTagException;
@@ -146,6 +147,10 @@ public class Functions {
return o instanceof ModelObject;
}
public static boolean isModelWithContextMenu(Object o) {
return o instanceof ModelObjectWithContextMenu;
}
public static String xsDate(Calendar cal) {
return Util.XS_DATETIME_FORMATTER.format(cal.getTime());
}