From 6262da5ebed0dbef195af8a9aa1771ee36c51a1c Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Mon, 30 May 2016 15:54:31 +0200
Subject: [PATCH] OO-725: save the access settings of the video course element

---
 .../course/nodes/video/VideoEditController.java     | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/olat/course/nodes/video/VideoEditController.java b/src/main/java/org/olat/course/nodes/video/VideoEditController.java
index 02ef7698d5c..c6a1358fb68 100644
--- a/src/main/java/org/olat/course/nodes/video/VideoEditController.java
+++ b/src/main/java/org/olat/course/nodes/video/VideoEditController.java
@@ -92,6 +92,7 @@ public class VideoEditController  extends ActivateableTabbableDefaultController
 	private VelocityContainer videoConfigurationVc;
 
 	private ModuleConfiguration config;
+	private final VideoCourseNode videoNode;
 	private RepositoryEntry repositoryEntry;
 
 	private ReferencableEntriesSearchController searchController;
@@ -108,6 +109,8 @@ public class VideoEditController  extends ActivateableTabbableDefaultController
 	public VideoEditController(VideoCourseNode videoNode, UserRequest ureq, WindowControl wControl, ICourse course, UserCourseEnvironment euce) {
 		super(ureq, wControl);
 		this.config = videoNode.getModuleConfiguration();
+		this.videoNode = videoNode;
+		
 		main = new Panel("videomain");
 
 		videoConfigurationVc = createVelocityContainer("edit");
@@ -187,8 +190,7 @@ public class VideoEditController  extends ActivateableTabbableDefaultController
 			);
 			listenTo(cmc);
 			cmc.activate();
-		}
-		if(source == previewLink){
+		} else if(source == previewLink){
 			VideoDisplayController previewController = null;
 			switch(config.getStringValue(VideoEditController.CONFIG_KEY_DESCRIPTION_SELECT)){
 
@@ -214,6 +216,7 @@ public class VideoEditController  extends ActivateableTabbableDefaultController
 	 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
 	 *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
 	 */
+	@Override
 	public void event(UserRequest urequest, Controller source, Event event) {
 		if (source == searchController) {
 			if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRY_SELECTED) {
@@ -236,6 +239,12 @@ public class VideoEditController  extends ActivateableTabbableDefaultController
 					listenTo(videoOptions);
 				}
 			}
+		} else if (source == accessibilityCondContr) {
+			if (event == Event.CHANGED_EVENT) {
+				Condition cond = accessibilityCondContr.getCondition();
+				videoNode.setPreConditionAccess(cond);
+				fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
+			}
 		}
 
 		if (event == NodeEditController.NODECONFIG_CHANGED_EVENT){
-- 
GitLab