[ofbiz-framework] branch trunk updated: Improved: Open Menu file from browser (OFBIZ-12119)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Improved: Open Menu file from browser (OFBIZ-12119)

James Yong-2
This is an automated email from the ASF dual-hosted git repository.

jamesyong pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 067db8f  Improved: Open Menu file from browser (OFBIZ-12119)
067db8f is described below

commit 067db8fe9e4ce09b1279f33aa01a3e40d03681c0
Author: James Yong <[hidden email]>
AuthorDate: Sat Jan 9 13:05:23 2021 +0800

    Improved: Open Menu file from browser (OFBIZ-12119)
   
    User can open menu definition file from the browser by clicking on the named border.
---
 .../org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java
index 99d3f9b..f3b55ee 100644
--- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java
+++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java
@@ -52,6 +52,7 @@ import org.apache.ofbiz.widget.renderer.VisualTheme;
 import freemarker.core.Environment;
 import freemarker.template.Template;
 import freemarker.template.TemplateException;
+import org.apache.ofbiz.widget.renderer.html.HtmlWidgetRenderer;
 
 public class MacroMenuRenderer implements MenuStringRenderer {
 
@@ -299,6 +300,9 @@ public class MacroMenuRenderer implements MenuStringRenderer {
         } catch (TemplateException e) {
             throw new IOException(e);
         }
+        if (HtmlWidgetRenderer.NAMED_BORDER_TYPE != ModelWidget.NamedBorderType.NONE) {
+            writer.append(HtmlWidgetRenderer.endNamedBorder("Menu", menu.getBoundaryCommentName()));
+        }
     }
 
     @Override
@@ -367,6 +371,10 @@ public class MacroMenuRenderer implements MenuStringRenderer {
 
     @Override
     public void renderMenuOpen(Appendable writer, Map<String, Object> context, ModelMenu menu) throws IOException {
+        if (HtmlWidgetRenderer.NAMED_BORDER_TYPE != ModelWidget.NamedBorderType.NONE) {
+            writer.append(HtmlWidgetRenderer.beginNamedBorder("Menu",
+                    menu.getBoundaryCommentName(), ((HttpServletRequest) context.get("request")).getContextPath()));
+        }
         Map<String, Object> parameters = new HashMap<>();
         if (ModelWidget.widgetBoundaryCommentsEnabled(context)) {
             StringBuilder sb = new StringBuilder("Begin Menu Widget ");