Author: hansbak
Date: Sun May 3 07:38:25 2009 New Revision: 771035 URL: http://svn.apache.org/viewvc?rev=771035&view=rev Log: portal page generated menu changed other menus when cache was enabled, tabs for spaces and deleted empty forms file Removed: ofbiz/trunk/framework/resources/templates/Forms.xml Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java?rev=771035&r1=771034&r2=771035&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java Sun May 3 07:38:25 2009 @@ -360,26 +360,26 @@ EntityOperator.AND); portalPages = delegator.findList("PortalPage", cond, null, null, null, false); if (UtilValidate.isNotEmpty(context.get("userLogin"))) { // check if a user is logged in - String userLoginId = ((GenericValue)context.get("userLogin")).getString("userLoginId"); - // replace with private pages - for (GenericValue portalPage : portalPages) { - cond = EntityCondition.makeCondition(UtilMisc.toList( - EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId), - EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, portalPage.getString("portalPageId"))), - EntityOperator.AND); - List <GenericValue> privatePortalPages = delegator.findList("PortalPage", cond, null, null, null, false); - if (UtilValidate.isNotEmpty(privatePortalPages)) { - portalPages.remove(portalPage); - portalPages.add(privatePortalPages.get(0)); - } - } - // add any other created private pages - cond = EntityCondition.makeCondition(UtilMisc.toList( - EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId), - EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, null), - EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, parentPortalPageId)), - EntityOperator.AND); - portalPages.addAll(delegator.findList("PortalPage", cond, null, null, null, false)); + String userLoginId = ((GenericValue)context.get("userLogin")).getString("userLoginId"); + // replace with private pages + for (GenericValue portalPage : portalPages) { + cond = EntityCondition.makeCondition(UtilMisc.toList( + EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId), + EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, portalPage.getString("portalPageId"))), + EntityOperator.AND); + List <GenericValue> privatePortalPages = delegator.findList("PortalPage", cond, null, null, null, false); + if (UtilValidate.isNotEmpty(privatePortalPages)) { + portalPages.remove(portalPage); + portalPages.add(privatePortalPages.get(0)); + } + } + // add any other created private pages + cond = EntityCondition.makeCondition(UtilMisc.toList( + EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId), + EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, null), + EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, parentPortalPageId)), + EntityOperator.AND); + portalPages.addAll(delegator.findList("PortalPage", cond, null, null, null, false)); } portalPages = EntityUtil.orderBy(portalPages, UtilMisc.toList("sequenceNum")); } catch (GenericEntityException e) { @@ -387,11 +387,13 @@ } for (GenericValue portalPage : portalPages) { if (UtilValidate.isNotEmpty(portalPage.getString("portalPageName"))) { - item.setName(portalPage.getString("portalPageId")); - item.setTitle(portalPage.getString("portalPageName")); - item.link = new Link(item); - item.link.setTarget("showPortalPage?portalPageId=" + portalPage.getString("portalPageId") + "&parentPortalPageId=" + parentPortalPageId); - item.renderMenuItemString(writer, context, menuStringRenderer); + ModelMenuItem localItem = new ModelMenuItem(item.getModelMenu()); + localItem.name = portalPage.getString("portalPageId"); + localItem.setTitle(portalPage.getString("portalPageName")); + localItem.link = new Link(item); + localItem.link.setTarget("showPortalPage?portalPageId=" + portalPage.getString("portalPageId") + "&parentPortalPageId=" + parentPortalPageId); + localItem.link.setText(portalPage.getString("portalPageName")); + localItem.renderMenuItemString(writer, context, menuStringRenderer); } } } else { |
Free forum by Nabble | Edit this page |