Author: hoang_to
Date: 2010-05-27 01:03:14 -0400 (Thu, 27 May 2010)
New Revision: 3207
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
Log:
GTNPORTAL-1210: Portal mode transition in UIPortalComposer should not be hardcoded
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2010-05-27
03:44:43 UTC (rev 3206)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2010-05-27
05:03:14 UTC (rev 3207)
@@ -97,16 +97,6 @@
uiTabPane.setSelectedTab(1);
}
- //TODO: this seems not to be used
- public void setPortalMode(int mode)
- {
- if (mode < 0 || mode > 4)
- {
- return;
- }
- getAncestorOfType(UIPortalApplication.class).setModeState(mode);
- }
-
public int getPortalMode()
{
return getAncestorOfType(UIPortalApplication.class).getModeState();
@@ -308,14 +298,17 @@
int portalMode = uiApp.getModeState();
if (portalMode != UIPortalApplication.NORMAL_MODE)
{
- if (portalMode % 2 != 0)
+ switch(portalMode)
{
- Util.showComponentLayoutMode(UIPortlet.class);
+ case UIPortalApplication.APP_BLOCK_EDIT_MODE:
+ case UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE:
+ Util.showComponentLayoutMode(UIPortlet.class);
+ break;
+ case UIPortalApplication.APP_VIEW_EDIT_MODE:
+ case UIPortalApplication.CONTAINER_VIEW_EDIT_MODE:
+ Util.showComponentEditInViewMode(UIPortlet.class);
+ break;
}
- else
- {
- Util.showComponentEditInViewMode(UIPortlet.class);
- }
}
JavascriptManager jsManager =
Util.getPortalRequestContext().getJavascriptManager();
jsManager.addJavascript("eXo.portal.portalMode=" + portalMode +
";");