Author: phuong_vu
Date: 2011-10-02 23:22:11 -0400 (Sun, 02 Oct 2011)
New Revision: 7591
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UITabContainer/Stylesheet.css
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITabContainer.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposerContent.gtmpl
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIColumnContainer.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UITabContainer.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponent.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
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/util/Util.java
Log:
GTNPORTAL-2113 Edit control of UITabContainer is not shown
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2011-10-03
03:22:11 UTC (rev 7591)
@@ -233,156 +233,12 @@
var uiWorkingWorkspace = document.getElementById("UIWorkingWorkspace") ;
return new UIComponent(eXo.core.DOMUtil.findFirstDescendantByClass(uiWorkingWorkspace,
"div", "UIPortal"));
};
-/**
- * Change page mode from view mode to layout mode
- * @param {Object} uicomponent component contains this view (layout)
- * @param {boolean} swapContent indicate changing content or not
- */
-UIPortal.prototype.switchViewModeToLayoutMode = function(uicomponent, swapContent) {
- var layoutBlock = uicomponent.getLayoutBlock() ;
- if(!layoutBlock || layoutBlock.style.display == 'block') return ;
- var viewBlock = uicomponent.getViewBlock() ;
- if(swapContent && viewBlock) {
- var contentNode = eXo.core.DOMUtil.findDescendantById(viewBlock, uicomponent.getId())
;
- if(contentNode != null) {
- layoutBlock.innerHTML = "";
- layoutBlock.appendChild(contentNode) ;
- }
- }
- try {
- layoutBlock.style.display = "block" ;
- viewBlock.style.display = "none" ;
- } catch (err) {}
-};
-/**
- * Change page mode from layout mode to view mode
- * @param {Object} uicomponent component contains this layout (view)
- * @param {boolean} swapContent indicate changing content or not
- */
-UIPortal.prototype.switchLayoutModeToViewMode = function(uicomponent, swapContent) {
- var viewBlock = uicomponent.getViewBlock() ;
- if(!viewBlock || viewBlock.style.display == 'block') return ;
- var layoutBlock = uicomponent.getLayoutBlock() ;
- if(swapContent && layoutBlock) {
- var contentNode = eXo.core.DOMUtil.findDescendantById(layoutBlock,
uicomponent.getId()) ;
- if(contentNode != null) {
- viewBlock.innerHTML = "";
- viewBlock.appendChild(contentNode) ;
- }
- }
- try{
- viewBlock.style.display = "block" ;
- layoutBlock.style.display = "none" ;
- } catch(err) {}
-} ;
-UIPortal.prototype.switchMode = function(elemtClicked) {
- if(elemtClicked.className == "Icon PreviewIcon") {
- elemtClicked.className = "Icon LayoutModeIcon" ;
- this.showViewMode() ;
- this.showMaskLayer() ;
-// eXo.core.Browser.onScrollCallback("", eXo.portal.UIPortal.showMaskLayer())
;
- } else {
- this.hideMaskLayer() ;
- elemtClicked.className = "Icon PreviewIcon" ;
- this.showLayoutModeForPortal() ;
- }
- /*
- * minh.js.exo
- * fix bug portal 1757;
- */
- //eXo.portal.PortalDragDrop.fixCss();
-} ;
-
-//TODO: No longer use. Prepare to remove
-//UIPortal.prototype.switchPortalMode = function(elemtClicked) {
-// if(eXo.portal.portalMode%2 == 0) {
-// this.showViewMode() ;
-// } else {
-// this.showLayoutModeForPortal() ;
-// }
-//};
-/**
- * Switch mode of page
- * @param {Object} elemtClicked clicked element
- */
-UIPortal.prototype.switchModeForPage = function(elemtClicked) {
- var layoutMode = this.showViewLayoutModeForPage();
- if(layoutMode == 1) {
- elemtClicked.className = "Icon PagePreviewIcon" ;
- this.hideMaskLayer() ;
- } else if(layoutMode == 0) {
- elemtClicked.className = "Icon PageLayoutModeIcon" ;
- this.showMaskLayer() ;
- }
-} ;
-/**
- * Show area for dnd into this UIComponent
- * @param {Object} uiComponent component contains control block
- * @param {boolean} flag display (blocking) or hide control block
- */
-UIPortal.prototype.showUIComponentControl = function(uicomponent, flag) {
- var controlBlock = uicomponent.getControlBlock() ;
- if(!controlBlock) return ;
- var clickObject = eXo.core.DOMUtil.findFirstDescendantByClass(controlBlock,
"div", "DragControlArea") ;
-// if(flag) {
-// clickObject.onmousedown = eXo.portal.PortalDragDrop.init ;
-// controlBlock.style.display = 'block' ;
-// } else {
-// controlBlock.onmousedown = null ;
-// controlBlock.style.display = 'none' ;
-// }
-};
-/**
- * Change page to layout view
- * @return layoutMode type of view mode (0, 1)
- */
-UIPortal.prototype.showViewLayoutModeForPage = function() {
- /*
- * minh.js.exo;
- */
- var layoutMode = -1;
- var container = this.getUIContainers() ;
- var portlet = this.getUIPortletsInUIPage() ;
-
- if(portlet.length > 0 && container.length >= 0) {
-
- for(var i = 0; i < container.length; i++) {
- var viewBlock = container[i].getViewBlock() ;
- if(viewBlock.style.display == 'block') {
- this.switchViewModeToLayoutMode(container[i], true) ;
- this.showUIComponentControl(container[i], this.component == 'UIContainer')
;
- if(layoutMode == -1) layoutMode = 1;
- } else if(viewBlock.style.display == 'none') {
- this.switchLayoutModeToViewMode(container[i], true) ;
- this.showUIComponentControl(container[i], false) ;
- if(layoutMode == -1) layoutMode = 0;
- }
- }
- for(var i = 0; i < portlet.length; i++) {
- var viewBlock = portlet[i].getViewBlock() ;
- if(viewBlock.style.display == 'block') {
- this.switchViewModeToLayoutMode(portlet[i], false) ;
- this.showUIComponentControl(portlet[i], this.component == 'UIPortlet') ;
- if(layoutMode == -1) layoutMode = 1;
- } else if(viewBlock.style.display == 'none') {
- this.switchLayoutModeToViewMode(portlet[i], false) ;
- this.showUIComponentControl(portlet[i], false) ;
- if(layoutMode == -1) layoutMode = 0;
- }
- }
-
- }
-
- return layoutMode;
-};
-
/**Repaired: by Vu Duy Tu 25/04/07**/
-UIPortal.prototype.showLayoutModeForPage = function(control) {
+UIPortal.prototype.showLayoutModeForPage = function() {
var uiPage = eXo.core.DOMUtil.findFirstDescendantByClass(document.body, "div",
"UIPage") ;
if(uiPage == null) return;
var viewPage = eXo.core.DOMUtil.findFirstDescendantByClass(uiPage, "div",
"VIEW-PAGE") ;
- var uiPageDesktop = document.getElementById("UIPageDesktop") ;
var uiPortalApplication = document.getElementById("UIPortalApplication");
if(uiPortalApplication.className != "Vista") {
viewPage.style.border = "solid 3px #dadada" ;
@@ -392,121 +248,40 @@
viewPage.style.paddingRight = "0px";
viewPage.style.paddingBottom = "50px";
viewPage.style.paddingLeft = "0px";
-
- if(control) this.component = control ;
- var container = this.getUIContainers() ;
- for(var i = 0; i < container.length; i++) {
- this.switchViewModeToLayoutMode(container[i], true) ;
- this.showUIComponentControl(container[i], this.component == 'UIContainer') ;
- var uiContainer = eXo.core.DOMUtil.findFirstDescendantByClass(viewPage,
"div", "UIContainer") ;
- if(uiContainer != null) {
- viewPage.style.border = "none" ;
- viewPage.style.paddingTop = "5px" ;
- viewPage.style.paddingRight = "5px";
- viewPage.style.paddingBottom = "5px";
- viewPage.style.paddingLeft = "5px";
- }
- }
-
- var portlet = this.getUIPortletsInUIPage() ;
- for(var i = 0; i < portlet.length; i++) {
- this.switchViewModeToLayoutMode(portlet[i], false) ;
- this.showUIComponentControl(portlet[i], this.component == 'UIPortlet') ;
-
- var uiPortlet = eXo.core.DOMUtil.findFirstDescendantByClass(viewPage, "div",
"UIPortlet") ;
- if(uiPortlet != null) {
- viewPage.style.border = "none" ;
- viewPage.style.paddingTop = "5px" ;
- viewPage.style.paddingRight = "5px" ;
- viewPage.style.paddingBottom = "5px" ;
- viewPage.style.paddingLeft = "5px" ;
- }
- }
+ var uiContainer = eXo.core.DOMUtil.findFirstDescendantByClass(viewPage,
"div", "UIContainer") ;
+ var uiPortlet = eXo.core.DOMUtil.findFirstDescendantByClass(viewPage,
"div", "UIPortlet") ;
+ if(uiContainer != null || uiPortlet != null) {
+ viewPage.style.border = "none" ;
+ viewPage.style.paddingTop = "5px" ;
+ viewPage.style.paddingRight = "5px";
+ viewPage.style.paddingBottom = "5px";
+ viewPage.style.paddingLeft = "5px";
+ }
};
-UIPortal.prototype.showViewMode = function() {
- var uiWorkingWS = document.getElementById("UIWorkingWorkspace");
- var isRTL = eXo.core.I18n.isRT();
- var portal = this.getUIPortal() ;
- this.switchLayoutModeToViewMode(portal, true) ;
- this.showUIComponentControl(portal, false) ;
-
- var uiPageDesktop = document.getElementById("UIPageDesktop") ;
+UIPortal.prototype.showViewMode = function() {
var pageBody = this.getUIPageBody() ;
- if(!uiPageDesktop) {
- this.switchLayoutModeToViewMode(pageBody, true) ;
- this.showUIComponentControl(pageBody, false) ;
- }
+ var container = this.getUIContainers() ;
+ var portlet = this.getUIPortlets() ;
- var container = this.getUIContainers() ;
- for(var i = 0; i < container.length; i++) {
- this.switchLayoutModeToViewMode(container[i], false) ;
- this.showUIComponentControl(container[i], eXo.portal.portalMode > 2) ;
- }
-
- var portlet = this.getUIPortlets() ;
- for(var i = 0; i < portlet.length; i++) {
- this.switchLayoutModeToViewMode(portlet[i], false) ;
- this.showUIComponentControl(portlet[i], true) ;
- var component = portlet[i].getUIComponentBlock();
- var mask = eXo.core.DOMUtil.findFirstDescendantByClass(component, "div",
"UIPortletMask");
- if(eXo.portal.portalMode && mask &&
!eXo.core.DOMUtil.hasAncestor(portlet[i].getElement(), pageBody.getElement())) {
- mask.style.display = "block";
- mask.style.height = component.offsetHeight + "px";
- mask.style.width = component.offsetWidth + "px";
- mask.style.top = -component.offsetHeight + "px";
- } else if(mask) {
- mask.style.display = "none";
- }
- }
-
- //mask for pagebody
- if(!uiPageDesktop) {
- if(container.length == 0 && portlet.length == 0) {
+ if(container.length == 0 && portlet.length == 0) {
var pageIdElemt = document.getElementById("UIPage");
var viewPage = eXo.core.DOMUtil.findAncestorByClass(pageIdElemt,
"VIEW-PAGE");
viewPage.style.paddingTop = "50px" ;
- viewPage.style.paddingRight = "0px";
- viewPage.style.paddingBottom = "50px";
- viewPage.style.paddingLeft = "0px";
+ viewPage.style.paddingRight = "0px";
+ viewPage.style.paddingBottom = "50px";
+ viewPage.style.paddingLeft = "0px";
}
var pageBodyBlock = pageBody.getUIComponentBlock();
var mask = eXo.core.DOMUtil.findFirstDescendantByClass(pageBodyBlock, "div",
"UIPageBodyMask");
if(mask) {
mask.style.top = - pageBodyBlock.offsetHeight + "px";
- mask.style.height = pageBodyBlock.offsetHeight + "px";
- mask.style.width = pageBodyBlock.offsetWidth + "px";
+ mask.style.height = pageBodyBlock.offsetHeight + "px";
+ mask.style.width = pageBodyBlock.offsetWidth + "px";
}
- }
};
-UIPortal.prototype.showLayoutModeForPortal = function(control) {
- if(control) this.component = control;
- var portal = this.getUIPortal() ;
- this.switchViewModeToLayoutMode(portal, true) ;
- this.showUIComponentControl(portal, this.component == 'UIPortal') ;
-
- var pageBody = this.getUIPageBody() ;
- this.switchViewModeToLayoutMode(pageBody, false) ;
- this.showUIComponentControl(pageBody, this.component == 'UIPageBody') ;
- var pageBodyBlock = pageBody.getUIComponentBlock();
- var mask = eXo.core.DOMUtil.findFirstDescendantByClass(pageBodyBlock, "div",
"UIPageBodyMask");
- if(mask) mask.style.display = "none";
-
- var container = this.getUIContainers() ;
- for(var i = 0; i < container.length; i++) {
- this.switchViewModeToLayoutMode(container[i], false) ;
- this.showUIComponentControl(container[i], true) ;
- }
-
- var portlet = this.getUIPortlets() ;
- for(var i = 0; i < portlet.length; i++) {
- this.switchViewModeToLayoutMode(portlet[i], false) ;
- this.showUIComponentControl(portlet[i], this.component == 'UIPortlet') ;
- }
-} ;
-
/**
* Return the closest container of the element.
* It might be one of these : UIPortlet, UIContainer, UIPageBody, UIPortal
@@ -526,47 +301,8 @@
return null ;
};
-/**
- * Display Mask layer infront of page's surface
- */
-UIPortal.prototype.showMaskLayer = function() {
- var uiPortalApplication = document.getElementById("UIPortalApplication") ;
- var object = document.createElement("div") ;
- object.className = "PreviewMode" ;
- object.style.display = "none" ;
- uiPortalApplication.appendChild(object) ;
- this.maskLayer = eXo.core.UIMaskLayer.createMask("UIPortalApplication",
object, 30, "TOP-RIGHT") ;
- this.maskLayer.title = this.previewTitle ;
- this.maskLayer.style.cursor = "pointer" ;
- this.maskLayer.onclick = function() {
- var layoutModeIcon = eXo.core.DOMUtil.findFirstDescendantByClass(uiPortalApplication,
"a", "LayoutModeIcon") ;
- var pageLayoutModeIcon =
eXo.core.DOMUtil.findFirstDescendantByClass(uiPortalApplication, "a",
"PageLayoutModeIcon") ;
-
- if(layoutModeIcon) {
- eXo.portal.UIPortal.switchMode(layoutModeIcon) ;
- }
-
- if(pageLayoutModeIcon) {
- eXo.portal.UIPortal.switchModeForPage(pageLayoutModeIcon) ;
- }
- }
- this.maskLayer.style.zIndex = parseInt(object.style.zIndex) + 1 ;
- eXo.core.Browser.addOnScrollCallback("3743892",
eXo.core.UIMaskLayer.setPosition) ;
-} ;
/**
- * Hide (remove) mask layer from page's surface
- */
-UIPortal.prototype.hideMaskLayer = function() {
- if(this.maskLayer) {
- var uiPortalApplication = document.getElementById("UIPortalApplication") ;
- eXo.core.UIMaskLayer.removeMask(this.maskLayer) ;
- this.maskLayer = null ;
- var maskObject = eXo.core.DOMUtil.findFirstDescendantByClass(uiPortalApplication,
"div", "PreviewMode") ;
- uiPortalApplication.removeChild(maskObject) ;
- }
-} ;
-/**
* Change skin of Portal
* @param url
*/
@@ -657,6 +393,22 @@
ajaxAsyncGetRequest(requestStr);
};
+UIPortal.prototype.composerTabChanged = function(tabId) {
+ var toolPanel = document.getElementById("UIPortalToolPanel");
+ if (!tabId || !toolPanel) return;
+
+ var removeCls, addCls;
+ if (tabId === "UIApplicationList") {
+ addCls = "ApplicationMode";
+ removeCls = "ContainerMode";
+ } else {
+ addCls = "ContainerMode";
+ removeCls = "ApplicationMode";
+ }
+ eXo.core.DOMUtil.removeClass(toolPanel, removeCls);
+ eXo.core.DOMUtil.addClass(toolPanel, addCls);
+}
+
/**
* Clollapse or expand an element (all its children) of tree
* @param {Object} element object to collapse or expand
Modified:
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css 2011-10-03
03:22:11 UTC (rev 7591)
@@ -205,12 +205,6 @@
filter: alpha(opacity=30);
}
-.UIPortletMask {
- opacity: 0;
- filter: alpha(opacity=0);
- background: #ffffff;
-}
-
.UIPageBodyMask {
opacity: 0;
filter: alpha(opacity=0);
Modified:
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UITabContainer/Stylesheet.css
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UITabContainer/Stylesheet.css 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UITabContainer/Stylesheet.css 2011-10-03
03:22:11 UTC (rev 7591)
@@ -45,16 +45,25 @@
.UITabContainer .UIHorizontalTabs .UITab {
height: 24px;
-}
+}
+
+.UITabContainer .UIHorizontalTabs .AddTab {
+ height: 24px;
+ width: 23px;
+ background: url("background/AddTab.gif") no-repeat left top;
+ float: left; /* orientation=lt */
+ float: right; /* orientation=rt */
+ cursor: pointer;
+}
+
+.ApplicationMode .UITabContainer .AddTab {
+ display: none;
+}
+
+.ApplicationMode .UITabContainer .EditIcon {
+ display: none;
+}
-.UITabContainer .UIHorizontalTabs .AddTab {
- height: 24px;
- width: 23px;
- background: url("background/AddTab.gif") no-repeat left top;
- float: left;
- cursor: pointer;
-}
-
.UITabContainer .SelectedTab .EditIcon {
width: 16px; height: 24px;
background:
url('/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/SelectedEditTab.gif')
no-repeat center; /* orientation=lt */
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2011-10-03
03:22:11 UTC (rev 7591)
@@ -211,9 +211,6 @@
if(uiPortalApp.isEditing()) {
if(portalMode != uiPortalApp.CONTAINER_BLOCK_EDIT_MODE && portalMode !=
uiPortalApp.APP_BLOCK_EDIT_MODE) {
%>
- <div class="UIPortletMaskParent" style="height:
0px;position:relative;">
- <div class="UIPortlet-$portletId UIPortletMask" style="position:
absolute;"><span></span></div>
- </div>
</div>
<%} %>
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITabContainer.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITabContainer.gtmpl 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITabContainer.gtmpl 2011-10-03
03:22:11 UTC (rev 7591)
@@ -1,6 +1,7 @@
<%
import org.exoplatform.web.application.JavascriptManager;
import org.exoplatform.commons.utils.ExpressionUtil;
+ import org.exoplatform.portal.webui.util.Util;
def rcontext = _ctx.getRequestContext();
ResourceBundle res = rcontext.getApplicationResourceBundle();
@@ -33,7 +34,8 @@
}
}
- String id = uicomponent.getId();
+ String id = uicomponent.getId();
+ def modeState = Util.getUIPortalApplication().getModeState();
%>
<% if(children != null && children.size() > 0) { %>
<div class="UITabContainer" id="$id">
@@ -62,7 +64,7 @@
<div class="LeftTab">
<div class="RightTab">
<%
- if(uiChild.isShowEditControl()){
+ if(modeState > 0){
String actionLink = uicomponent.event("EditContainer",
"$uiChild.id") - "javascript:";
String showCategory = "eXo.webui.UIPopupSelectCategory.show(this,
event);"
String moveLeftAction = uicomponent.event("MoveLeft", tabId);
@@ -118,7 +120,7 @@
}
%>
<% String addTabLink = uicomponent.event("AddTab");
- if (uicomponent.isShowEditControl()) {
+ if (modeState > 0) {
%>
<div class="AddTab"
onclick="$addTabLink;eXo.portal.UIPortal.changeComposerSaveButton()">
<span></span>
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposerContent.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposerContent.gtmpl 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposerContent.gtmpl 2011-10-03
03:22:11 UTC (rev 7591)
@@ -3,7 +3,8 @@
import org.exoplatform.portal.webui.portal.UIContainerList;
def rcontext = _ctx.getRequestContext();
- rcontext.getJavascriptManager().importJavascript('eXo.webui.UIHorizontalTabs');
+ def jsManager = rcontext.getJavascriptManager();
+ jsManager.importJavascript('eXo.webui.UIHorizontalTabs');
%>
<div class="UITabPane" id="$uicomponent.id">
@@ -12,6 +13,7 @@
<%
String url = uicomponent.url("SelectTab");
String selTabId = uicomponent.getSelectedTabId();
+ jsManager.addCustomizedOnLoadScript("eXo.portal.UIPortal.composerTabChanged('"
+ selTabId + "');");
UIApplicationList appList = uicomponent.getChild(UIApplicationList.class);
UIContainerList contList = uicomponent.getChild(UIContainerList.class);
@@ -21,7 +23,9 @@
<div class="LeftTab">
<div class="RightTab">
<% String appLink = "ajaxAsyncGetRequest('" +
uicomponent.url("SelectTab",appList.getId()) + "', true)"
%>
- <div class="MiddleTab"
onclick="eXo.webui.UIHorizontalTabs.changeTabForUITabPane(this,
'${appList.getId()}', '$url');$appLink;if(eXo.portal.portalMode)
eXo.portal.portalMode -= 2;">
+ <div class="MiddleTab"
onclick="eXo.webui.UIHorizontalTabs.changeTabForUITabPane(this,
'${appList.getId()}', '$url');
+ eXo.portal.UIPortal.composerTabChanged('${appList.getId()}');
+ $appLink;if(eXo.portal.portalMode) eXo.portal.portalMode -= 2;">
<%=_ctx.appRes("UITabPane.title." + appList.getId());%>
</div>
</div>
@@ -33,7 +37,9 @@
<div class="LeftTab">
<div class="RightTab">
<% String contLink = "ajaxAsyncGetRequest('" +
uicomponent.url("SelectTab",contList.getId()) + "', true)"
%>
- <div class="MiddleTab"
onclick="eXo.webui.UIHorizontalTabs.changeTabForUITabPane(this,
'${contList.getId()}', '$url');$contLink;if(eXo.portal.portalMode)
eXo.portal.portalMode += 2;">
+ <div class="MiddleTab"
onclick="eXo.webui.UIHorizontalTabs.changeTabForUITabPane(this,
'${contList.getId()}', '$url');
+ eXo.portal.UIPortal.composerTabChanged('${contList.getId()}');
+ $contLink;if(eXo.portal.portalMode) eXo.portal.portalMode +=
2;">
<%=_ctx.appRes("UITabPane.title." + contList.getId());%>
</div>
</div>
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java 2011-10-03
03:22:11 UTC (rev 7591)
@@ -403,7 +403,6 @@
UIWorkingWorkspace uiWorkingWS =
uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
pcontext.ignoreAJAXUpdateOnPortlets(true);
- Util.showComponentLayoutMode(UIPortlet.class);
}
}
@@ -425,7 +424,6 @@
uiMaskWorkspace.setWindowSize(-1, -1);
pcontext.addUIComponentToUpdateByAjax(uiMaskWorkspace);
pcontext.ignoreAJAXUpdateOnPortlets(true);
- Util.showComponentLayoutMode(UIPortlet.class);
}
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIColumnContainer.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIColumnContainer.java 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIColumnContainer.java 2011-10-03
03:22:11 UTC (rev 7591)
@@ -76,8 +76,6 @@
UIColumnContainer.insertColumn(uiSelectedColumn, false);
}
- Util.showComponentLayoutMode(uiSelectedColumn.getClass());
-
PortalRequestContext pcontext = (PortalRequestContext)
event.getRequestContext();
pcontext.addUIComponentToUpdateByAjax(uiParent);
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java 2011-10-03
03:22:11 UTC (rev 7591)
@@ -146,7 +146,6 @@
pcontext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
pcontext.ignoreAJAXUpdateOnPortlets(true);
- Util.showComponentLayoutMode(UIContainer.class);
}
}
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UITabContainer.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UITabContainer.java 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UITabContainer.java 2011-10-03
03:22:11 UTC (rev 7591)
@@ -169,7 +169,6 @@
child.setRendered(false);
newTabContainer.setRendered(true);
newTabContainer.setId(String.valueOf(newTabContainer.hashCode()));
- newTabContainer.setShowEditControl(true);
pcontext.addUIComponentToUpdateByAjax(container);
return;
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponent.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponent.java 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponent.java 2011-10-03
03:22:11 UTC (rev 7591)
@@ -47,8 +47,6 @@
private String[] accessPermissions = {UserACL.EVERYONE};
- private boolean showEditControl_ = false;
-
protected int mode_ = COMPONENT_VIEW_MODE;
final static public int COMPONENT_VIEW_MODE = 1;
@@ -134,16 +132,6 @@
title_ = s;
}
- public boolean isShowEditControl()
- {
- return showEditControl_;
- }
-
- public void setShowEditControl(boolean show)
- {
- showEditControl_ = show;
- }
-
public String getName()
{
return name_;
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2011-10-03
03:22:11 UTC (rev 7591)
@@ -135,7 +135,6 @@
}
}
}
- Util.showComponentLayoutMode(uiComponentTobeRemoved.getClass());
PortalRequestContext pcontext =
(PortalRequestContext)event.getRequestContext();
@@ -333,7 +332,6 @@
uiPortlet.setState(new PortletState(state, applicationType));
}
uiPortlet.setPortletInPortal(uiTarget instanceof UIPortal);
- uiPortlet.setShowEditControl(true);
//TODO Wait to fix issue EXOGTN-213 and then
//we should get "showInfobar" from current UI portal instead of
Storage service
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 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2011-10-03
03:22:11 UTC (rev 7591)
@@ -539,12 +539,10 @@
if (portalMode % 2 == 0)
{
uiPortalApp.setModeState(UIPortalApplication.APP_VIEW_EDIT_MODE);
- Util.showComponentEditInViewMode(UIPortlet.class);
}
else
{
uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
- Util.showComponentLayoutMode(UIPortlet.class);
}
}
else if (uiComponent instanceof UIContainerList)
@@ -553,16 +551,12 @@
if (portalMode % 2 == 0)
{
uiPortalApp.setModeState(UIPortalApplication.CONTAINER_VIEW_EDIT_MODE);
-
Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
}
else
{
uiPortalApp.setModeState(UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE);
-
Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
}
}
- event.getRequestContext().addUIComponentToUpdateByAjax(
-
Util.getUIPortalApplication().getChildById(UIPortalApplication.UI_WORKING_WS_ID));
}
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java 2011-10-02
22:49:59 UTC (rev 7590)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java 2011-10-03
03:22:11 UTC (rev 7591)
@@ -71,39 +71,6 @@
return getUIPortalApplication().findFirstComponentOfType(UIPortalToolPanel.class);
}
- private static void setShowEditControl(UIComponent uiComponent, Class clazz)
- {
- if (uiComponent == null)
- return;
- if (uiComponent instanceof UIPortalComponent)
- {
- UIPortalComponent uiContainer = (UIPortalComponent)uiComponent;
- if (clazz.isInstance(uiContainer))
- {
- uiContainer.setShowEditControl(true);
- }
- else
- {
- uiContainer.setShowEditControl(false);
- }
- }
- if (uiComponent instanceof org.exoplatform.webui.core.UIContainer)
- {
- List<UIComponent> children =
((org.exoplatform.webui.core.UIContainer)uiComponent).getChildren();
- for (UIComponent comp : children)
- setShowEditControl(comp, clazz);
- return;
- }
-
- if (uiComponent instanceof UIComponentDecorator)
- {
- UIComponentDecorator uiDecorator = (UIComponentDecorator)uiComponent;
- if (uiDecorator.getUIComponent() == null)
- return;
- setShowEditControl(uiDecorator.getUIComponent(), clazz);
- }
- }
-
/**
* View component on UIWorkspaceWorking
* $uicomp : current component on UIWorkspaceWorking
@@ -221,17 +188,11 @@
if (uiParent == null)
return;
String layoutMode = clazz.getSimpleName();
- setShowEditControl(uiParent, clazz);
PortalRequestContext context = Util.getPortalRequestContext();
- if (uiParent instanceof UIPortal)
+ if (uiParent instanceof UIPage)
{
context.getJavascriptManager().addCustomizedOnLoadScript(
- "eXo.portal.UIPortal.showLayoutModeForPortal('" + layoutMode +
"');");
- }
- else
- {
- context.getJavascriptManager().addCustomizedOnLoadScript(
"eXo.portal.UIPortal.showLayoutModeForPage('" + layoutMode +
"');");
}
}
@@ -242,25 +203,15 @@
return;
UIPortalApplication portalApp = getUIPortalApplication();
UIEditInlineWorkspace uiEditWS =
portalApp.findFirstComponentOfType(UIEditInlineWorkspace.class);
- UIContainer uiParent = null;
UIComponent uiComponent = uiEditWS.getUIComponent();
if (uiComponent instanceof UIPortal)
{
UIPortal uiPortal = (UIPortal)uiComponent;
uiPortal.setMaximizedUIComponent(null);
- uiParent = uiPortal;
}
- else
- {
- UIPortalToolPanel uiPortalToolPanel = getUIPortalToolPanel();
- UIPage uiPage = uiPortalToolPanel.findFirstComponentOfType(UIPage.class);
- uiParent = uiPage;
- }
- if (uiParent == null)
- return;
+
String layoutMode = clazz.getSimpleName();
- setShowEditControl(uiParent, clazz);
PortalRequestContext context = Util.getPortalRequestContext();
context.getJavascriptManager().addCustomizedOnLoadScript(