From 7eddb2e9c10c2c8a929c343c78ba188aac09d0d9 Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 27 Jul 2001 13:36:23 +0000 Subject: [PATCH] href skin is now searched in object path of the object on which href was invoked, not in URL path of the request. --- src/helma/framework/core/HopExtension.java | 26 +++++++++------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/helma/framework/core/HopExtension.java b/src/helma/framework/core/HopExtension.java index 6e7e63a9..087ff826 100644 --- a/src/helma/framework/core/HopExtension.java +++ b/src/helma/framework/core/HopExtension.java @@ -990,23 +990,19 @@ public class HopExtension { if (hrefSkin != null) { // we need to post-process the href with a skin for this application // first, look in the object href was called on. - Prototype proto = app.getPrototype (n); + INode sn = n; Skin skin = null; - if (proto != null) { - skin = proto.getSkin (hrefSkin); - if (skin != null) - return renderSkin (skin, basicHref, (ESNode) thisObject); - } - for (int i=reval.reqPath.size()-1; i>=0; i--) { - ESNode esn = (ESNode) reval.reqPath.getProperty (i); - INode sn = esn.getNode (); - proto = app.getPrototype (sn); - if (proto != null) { + while (skin == null && sn != null) { + Prototype proto = app.getPrototype (sn); + if (proto != null) skin = proto.getSkin (hrefSkin); - if (skin != null) { - return renderSkin (skin, basicHref, esn); - } - } + if (skin == null) + sn = sn.getParent (); + } + + if (skin != null) { + ESNode esn = reval.getNodeWrapper (sn); + return renderSkin (skin, basicHref, esn); } } return new ESString (basicHref);