diff --git a/bigbluebutton-client/src/org/bigbluebutton/common/CustomMdiWindow.as b/bigbluebutton-client/src/org/bigbluebutton/common/CustomMdiWindow.as index 2454ba9a20..fc887d64fe 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/common/CustomMdiWindow.as +++ b/bigbluebutton-client/src/org/bigbluebutton/common/CustomMdiWindow.as @@ -40,10 +40,20 @@ package org.bigbluebutton.common MDIManager.CONTEXT_MENU_LABEL_CASCADE, MDIManager.CONTEXT_MENU_LABEL_SHOW_ALL ); + private static const LOCKABLE_MENU_ITEMS:Array = new Array( + MDIWindow.CONTEXT_MENU_LABEL_MINIMIZE, + MDIWindow.CONTEXT_MENU_LABEL_MAXIMIZE, + MDIWindow.CONTEXT_MENU_LABEL_RESTORE); + private var _customContextMenuItems:Array = null; + + private var _unlocked:Boolean = true; private function filterContextMenu(item:*, index:int, array:Array):Boolean { - return IGNORED_MENU_ITEMS.indexOf(item.caption) < 0; + var filter:Boolean = this._unlocked ? + IGNORED_MENU_ITEMS.indexOf(item.caption) < 0 : + IGNORED_MENU_ITEMS.indexOf(item.caption) < 0 && LOCKABLE_MENU_ITEMS.indexOf(item.caption) < 0; + return filter; } override public function updateContextMenu():void { @@ -87,5 +97,25 @@ package org.bigbluebutton.common updateContextMenu(); } + + public function get unlocked():Boolean { + return this._unlocked; + } + + public function set unlocked(value:Boolean):void { + this._unlocked + = this.draggable + = this.resizable + = this.titleBarOverlay.includeInLayout + = this.titleBarOverlay.enabled + = this.titleBarOverlay.visible + = value; + + if (!this.minimized) { + this.showControls = this._unlocked; + } + + updateContextMenu(); + } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/Conference.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/Conference.as index c8d0c2d419..47afaa85af 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/Conference.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/Conference.as @@ -266,6 +266,7 @@ package org.bigbluebutton.main.model.users { public function set amIPresenter(presenter:Boolean):void { me.presenter = presenter; + me.applyLockSettings(); } [Bindable] @@ -375,6 +376,7 @@ package org.bigbluebutton.main.model.users { public function setMyRole(role:String):void { me.role = role; + me.applyLockSettings(); } public function amIGuest():Boolean { @@ -567,6 +569,7 @@ package org.bigbluebutton.main.model.users { var myUser:BBBUser = getMyUser(); if(myUser != null) myUser.applyLockSettings(); + users.refresh(); // we need to refresh after updating the lock settings to trigger the user item renderers to redraw } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as index 44f0cb9718..6776be5c4f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as @@ -44,6 +44,7 @@ package org.bigbluebutton.modules.layout.managers import org.as3commons.logging.api.ILogger; import org.as3commons.logging.api.getClassLogger; + import org.bigbluebutton.common.CustomMdiWindow; import org.bigbluebutton.core.EventBroadcaster; import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.core.events.SwitchedLayoutEvent; @@ -51,6 +52,7 @@ package org.bigbluebutton.modules.layout.managers import org.bigbluebutton.core.model.Config; import org.bigbluebutton.main.events.ModuleLoadEvent; import org.bigbluebutton.main.model.LayoutOptions; + import org.bigbluebutton.main.model.users.BBBUser; import org.bigbluebutton.modules.layout.events.LayoutEvent; import org.bigbluebutton.modules.layout.events.LayoutLockedEvent; import org.bigbluebutton.modules.layout.events.LayoutsLoadedEvent; @@ -363,6 +365,12 @@ package org.bigbluebutton.modules.layout.managers _locked = e.locked; checkWindowsPermissions(); } + + public function lockSettingsChanged():void { + var myUser:BBBUser = UserManager.getInstance().getConference().getMyUser(); + _locked = myUser.lockedLayout; + checkWindowsPermissions(); + } public function applyRemoteLayout(e:LayoutFromRemoteEvent):void { var layout:LayoutDefinition = e.layout; @@ -390,12 +398,8 @@ package org.bigbluebutton.modules.layout.managers } private function checkSingleWindowPermissions(window:MDIWindow):void { - if (!UserManager.getInstance().getConference().amIModerator() - && !LayoutDefinition.ignoreWindow(window)) { - window.draggable - = window.resizable - = window.showControls - = !_locked; + if (!LayoutDefinition.ignoreWindow(window)) { + (window as CustomMdiWindow).unlocked = !_locked || UsersUtil.amIModerator() || UsersUtil.amIPresenter(); } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/maps/LayoutEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/maps/LayoutEventMap.mxml index 21fd7d252f..bf0117053f 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/maps/LayoutEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/maps/LayoutEventMap.mxml @@ -24,6 +24,7 @@ with BigBlueButton; if not, see . import mx.events.FlexEvent; import org.bigbluebutton.core.EventConstants; + import org.bigbluebutton.core.events.LockControlEvent; import org.bigbluebutton.main.model.users.events.ChangeMyRole; import org.bigbluebutton.main.events.MadePresenterEvent; import org.bigbluebutton.modules.layout.events.ChangeLayoutEvent; @@ -140,6 +141,10 @@ with BigBlueButton; if not, see . + + + + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/services/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/services/MessageReceiver.as index 6d107cd54e..d6ce1f80f1 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/services/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/services/MessageReceiver.as @@ -66,10 +66,10 @@ package org.bigbluebutton.modules.layout.services if(message.layout == "" || UsersUtil.amIModerator()) _dispatcher.dispatchEvent(new LayoutEvent(LayoutEvent.APPLY_DEFAULT_LAYOUT_EVENT)); else { - lockLayout(message.locked, message.setById); handleSyncLayout(message); } + handleLayoutLocked(message); _dispatcher.dispatchEvent(new ModuleLoadEvent(ModuleLoadEvent.LAYOUT_MODULE_STARTED)); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesWindow.mxml index 4ed2ad86a1..a9302d08e5 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesWindow.mxml @@ -18,12 +18,9 @@ Author: Islam El-Ashi , --> - - +