Browse Source

[svn r10928] rename the conf folder to conference (to avoid confusions)
add the path to visioclassroom

Eric Marguin 18 years ago
parent
commit
c56d521976

+ 67 - 33
main/admin/configure_extensions.php

@@ -28,6 +28,8 @@ $language_file='admin';
 $cidReset=true;
 
 include('../inc/global.inc.php');
+
+
 $this_section=SECTION_PLATFORM_ADMIN;
 
 api_protect_admin_script();
@@ -39,9 +41,13 @@ $tbl_settings_current = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
 
 $message = '';
 
+require api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
+
+
+
 if(isset($_POST['activeExtension'])){
-	
-	switch ($_POST['extension_code']){
+
+	switch ($_POST['extension_code']){		
 		
 		case 'visio' :
 			$sql = 'UPDATE '.$tbl_settings_current.' SET
@@ -50,35 +56,48 @@ if(isset($_POST['activeExtension'])){
 					AND subkey="active"';
 			$rs = api_sql_query($sql, __FILE__, __LINE__);			
 			if(mysql_affected_rows()>0){
-				$sql = 'UPDATE '.$tbl_settings_current.' SET
-						selected_value="'.addslashes($_POST['visio_url']).'"
-						WHERE variable="service_visio"
-						AND subkey="url"';
-				$rs = api_sql_query($sql, __FILE__, __LINE__);	
+				
+				// select all the courses and insert the tool inside
+				$sql = 'SELECT db_name FROM '.Database::get_main_table(TABLE_MAIN_COURSE);
+				
+				$rs = api_sql_query($sql, __FILE__, __LINE__);
+				while($row = mysql_fetch_array($rs)){
+					
+					$sql = 'INSERT INTO '.$row['db_name'].'.'.TABLE_TOOL_LIST.' SET 
+							name="visio",
+							link="conference/",
+							image="visio.gif",
+							visibility="1",
+							admin="0",
+							address="squaregrey.gif",
+							target="_self",
+							category="authoring"';
+					
+					api_sql_query($sql, __FILE__, __LINE__);
+	
+				}
 				$message = get_lang('ServiceActivated');
+				
 			}
+			$sql = 'UPDATE '.$tbl_settings_current.' SET
+					selected_value="'.addslashes($_POST['visioconference_url']).'"
+					WHERE variable="service_visio"
+					AND subkey="visioconference_url"';
+			$rs = api_sql_query($sql, __FILE__, __LINE__);
 			
+			$sql = 'UPDATE '.$tbl_settings_current.' SET
+					selected_value="'.addslashes($_POST['visioclassroom_url']).'"
+					WHERE variable="service_visio"
+					AND subkey="visioclassroom_url"';
+			$rs = api_sql_query($sql, __FILE__, __LINE__);	
+			
+			if(empty($message))
+			{
+				$message = get_lang('ServiceReconfigured');
+			}
 			
 			
-			// select all the courses and insert the tool inside
-			$sql = 'SELECT db_name FROM '.Database::get_main_table(TABLE_MAIN_COURSE);
 			
-			$rs = api_sql_query($sql, __FILE__, __LINE__);
-			while($row = mysql_fetch_array($rs)){
-				
-				$sql = 'INSERT INTO '.$row['db_name'].'.'.TABLE_TOOL_LIST.' SET 
-						name="visio",
-						link="conf/",
-						image="visio.gif",
-						visibility="1",
-						admin="0",
-						address="squaregrey.gif",
-						target="_self",
-						category="authoring"';
-				
-				api_sql_query($sql, __FILE__, __LINE__);
-
-			}
 			
 			break;	
 			
@@ -231,19 +250,34 @@ Display::display_header($nameTool);
 						<img src="<?php echo api_get_path(WEB_IMG_PATH).'screenshot_conf.jpg' ?>" />
 					</td>
 					<td align="center" width="50%">
-						<form method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>">
 						<?php 
-						if(in_array('service_visio',$listActiveServices)){
-							echo get_lang('ExtensionActivedButNotYetOperational');
+						$form = new FormValidator('visio');						
+						$form -> addElement('text', 'visioconference_url', get_lang('VideoConferenceUrl'));
+						$form -> addElement('html','<br /><br />');
+						$form -> addElement('text', 'visioclassroom_url', get_lang('VideoClassroomUrl'));
+						$form -> addElement('hidden', 'extension_code', 'visio');
+						$defaults = array();
+						$renderer = $form -> defaultRenderer();
+						$renderer -> setElementTemplate('<div style="text-align:left">{label}</div><div style="text-align:left">{element}</div>');
+						$form -> addElement('html','<br /><br />');
+						if(in_array('service_visio',$listActiveServices))
+						{
+							$sql = 'SELECT subkey, selected_value FROM '.$tbl_settings_current.' 
+									WHERE variable = "service_visio"
+									AND (subkey = "visioconference_url" OR subkey = "visioclassroom_url")';
+							$rs = api_sql_query($sql, __FILE__, __LINE__);
+							while($row = mysql_fetch_assoc($rs))
+							{
+								$defaults[$row['subkey']] = $row['selected_value'];
+							}							
+							$form -> addElement('submit', 'activeExtension', get_lang('ReconfigureExtension'));
 						}
 						else {
-								echo get_lang('URL').' : 
-									<input type="text" size="30" name="visio_url" /><br /><br />
-									<input type="hidden" name="extension_code" value="visio" />
-									<input type="submit" name="activeExtension" value="'.get_lang('ActiveExtension').'" />';
+							$form -> addElement('submit', 'activeExtension', get_lang('ActiveExtension'));
 						}
+						$form -> setDefaults($defaults);
+						$form -> display();
 						?>
-						</form>
 					</td>
 				</tr>
 			</table>

+ 0 - 3
main/conf/index.php

@@ -1,3 +0,0 @@
-<?php
-header('Location: liveconf.php');
-?>

+ 0 - 22
main/conf/liveconf.php

@@ -1,22 +0,0 @@
-<?php
-/*
- * Created on 8 nov. 06
- *
- * To change the template for this generated file go to
- * Window - Preferences - PHPeclipse - PHP - Code Templates
- */
- include("../inc/global.inc.php");
-api_protect_course_script();
-//$nameTool = get_lang('conference');
-//Display::display_header($nameTool);
-
-
-$visio_link = api_get_setting('service_visio','url');
-
-?>
-<span align="center">
-<iframe frameborder="0" scrolling="no" width="100%" height="100%" src="<?php echo $visio_link ?>"></iframe>
-</span>
-<?php 
-//Display::display_footer();
-?>

+ 1 - 1
main/inc/lib/add_course.lib.inc.php

@@ -1406,7 +1406,7 @@ function fill_Db_course($courseDbName, $courseRepository, $language)
 	
 	
 	if(api_get_setting('service_visio','active')=='true'){
-		api_sql_query("INSERT INTO `" . $tbl_course_homepage . "` VALUES ('', '" . TOOL_VISIO . "','conf/','visio.gif','1','0','squaregrey.gif','NO','_self','authoring')");
+		api_sql_query("INSERT INTO `" . $tbl_course_homepage . "` VALUES ('', '" . TOOL_VISIO . "','conference/','visio.gif','1','0','squaregrey.gif','NO','_self','authoring')");
 	}
 	
 	// Smartblogs (Kevin Van Den Haute :: kevin@develop-it.be)

+ 9 - 8
main/install/dokeos_main.sql

@@ -190,7 +190,7 @@ INSERT INTO `course_module` VALUES
 (15,'course_setting','course_info/infocours.php','reference.gif',1,1,'courseadmin'),
 (16,'External','','external.gif',0,0,'external'),
 (17,'AddedLearnpath','','scormbuilder.gif',0,0,'external'),
-(18,'conference','online/online.php','conf.gif',0,0,'external'),
+(18,'conference','conference/index.php','conf.gif',0,0,'external'),
 (19,'learnpath','newscorm/lp_controller.php','scorm.gif',5,1,'basic'),
 (20,'blog','blog/blog.php','blog.gif',1,2,'basic'),
 (21,'blog_management','blog/blog_admin.php','blog_admin.gif',1,2,'courseadmin'),
@@ -483,13 +483,14 @@ INSERT INTO `settings_current` VALUES
 (73,'profile','phone','checkbox','User','true','ProfileChangesTitle','ProfileChangesComment',NULL,'phone'),
 (74, 'Ajax_course_tracking_refresh', NULL, 'textfield','Course','0', 'Ajax_course_tracking_refresh','Ajax_course_tracking_refresh_comment', NULL, NULL),
 (75, 'service_visio', 'active', 'radio',NULL,'false', 'visio_actived','', NULL, NULL),
-(76, 'service_visio', 'url', 'textfield',NULL,'', 'visio_url','', NULL, NULL),
-(77, 'service_ppt2lp', 'active', 'radio',NULL,'false', 'ppt2lp_actived','', NULL, NULL),
-(78, 'service_ppt2lp', 'host', 'textfield', NULL, NULL, 'Host', NULL, NULL, NULL),
-(79, 'service_ppt2lp', 'user', 'textfield', NULL, NULL, 'UserOnHost', NULL, NULL, NULL),
-(80, 'service_ppt2lp', 'ftp_password', 'textfield', NULL, NULL, 'FtpPassword', NULL, NULL, NULL),
-(81, 'service_ppt2lp', 'path_to_lzx', 'textfield', NULL, NULL, '', NULL, NULL, NULL),
-(82, 'wcag_anysurfer_public_pages', NULL, 'radio','Platform','false','PublicPagesComplyToWAITitle','PublicPagesComplyToWAIComment', NULL, NULL);
+(76, 'service_visio', 'visioconference_url', 'textfield',NULL,'', 'visio_url','', NULL, NULL),
+(77, 'service_visio', 'visioclassroom_url', 'textfield',NULL,'', 'visio_url','', NULL, NULL),
+(78, 'service_ppt2lp', 'active', 'radio',NULL,'false', 'ppt2lp_actived','', NULL, NULL),
+(79, 'service_ppt2lp', 'host', 'textfield', NULL, NULL, 'Host', NULL, NULL, NULL),
+(80, 'service_ppt2lp', 'user', 'textfield', NULL, NULL, 'UserOnHost', NULL, NULL, NULL),
+(81, 'service_ppt2lp', 'ftp_password', 'textfield', NULL, NULL, 'FtpPassword', NULL, NULL, NULL),
+(82, 'service_ppt2lp', 'path_to_lzx', 'textfield', NULL, NULL, '', NULL, NULL, NULL),
+(83, 'wcag_anysurfer_public_pages', NULL, 'radio','Platform','false','PublicPagesComplyToWAITitle','PublicPagesComplyToWAIComment', NULL, NULL);
 
 
 UNLOCK TABLES;