'index.php', 'name' => get_lang('PlatformAdmin')); // Database Table Definitions $tbl_settings_current = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT); $message = ''; require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'; if(isset($_POST['activeExtension'])){ switch ($_POST['extension_code']){ case 'visio' : $sql = 'UPDATE '.$tbl_settings_current.' SET selected_value="true" WHERE variable="service_visio" AND subkey="active"'; $rs = Database::query($sql); if(Database::affected_rows()>0) { // select all the courses and insert the tool inside $sql = 'SELECT db_name FROM '.Database::get_main_table(TABLE_MAIN_COURSE); $rs = Database::query($sql); while($row = Database::fetch_array($rs)){ if(!empty($_POST['visio_host'])) { $tool_table = Database::get_course_table(TABLE_TOOL_LIST,$row['db_name']); $select = "SELECT id FROM $tool_table WHERE name='".TOOL_VISIO_CONFERENCE."'"; $selectres = Database::query($select); if(Database::num_rows($selectres)<1) { $sql = 'INSERT INTO '.$tool_table.' SET name="'.TOOL_VISIO_CONFERENCE.'", link="conference/index.php?type=conference", image="visio.gif", visibility="1", admin="0", address="squaregrey.gif", target="_self", category="interaction"'; Database::query($sql); } $select = "SELECT id FROM $tool_table WHERE name='".TOOL_VISIO_CLASSROOM."'"; $selectres = Database::query($select); if(Database::num_rows($selectres)<1) { $sql = 'INSERT INTO '.$tool_table.' SET name="'.TOOL_VISIO_CLASSROOM.'", link="conference/index.php?type=classroom", image="visio.gif", visibility="1", admin="0", address="squaregrey.gif", target="_self", category="authoring"'; Database::query($sql); } } } $message = get_lang('ServiceActivated'); } $sql = 'UPDATE '.$tbl_settings_current.' SET selected_value="'.Database::escape_string($_POST['visio_host']).'" WHERE variable="service_visio" AND subkey="visio_host"'; $rs = Database::query($sql); $sql = 'UPDATE '.$tbl_settings_current.' SET selected_value="'.Database::escape_string($_POST['visio_port']).'" WHERE variable="service_visio" AND subkey="visio_port"'; $rs = Database::query($sql); $sql = 'UPDATE '.$tbl_settings_current.' SET selected_value="'.Database::escape_string($_POST['visio_pass']).'" WHERE variable="service_visio" AND subkey="visio_pass"'; $rs = Database::query($sql); $sql = 'UPDATE '.$tbl_settings_current.' SET selected_value="'.($_POST['visio_use_rtmpt']=='true'?'true':'false').'" WHERE variable="service_visio" AND subkey="visio_use_rtmpt"'; $rs = Database::query($sql); if(empty($message)) { $message = get_lang('ServiceReconfigured'); } break; case 'ppt2lp' : $sql = 'UPDATE '.$tbl_settings_current.' SET selected_value="true" WHERE variable="service_ppt2lp" AND subkey="active"'; $rs = Database::query($sql); if(Database::affected_rows()>0){ $message = get_lang('ServiceActivated'); } $sql = 'UPDATE '.$tbl_settings_current.' SET selected_value="'.addslashes($_POST['host']).'" WHERE variable="service_ppt2lp" AND subkey="host"'; Database::query($sql); $sql = 'UPDATE '.$tbl_settings_current.' SET selected_value="'.addslashes($_POST['port']).'" WHERE variable="service_ppt2lp" AND subkey="port"'; Database::query($sql); $sql = 'UPDATE '.$tbl_settings_current.' SET selected_value="'.addslashes($_POST['ftp_password']).'" WHERE variable="service_ppt2lp" AND subkey="ftp_password"'; Database::query($sql); $sql = 'UPDATE '.$tbl_settings_current.' SET selected_value="'.addslashes($_POST['user']).'" WHERE variable="service_ppt2lp" AND subkey="user"'; Database::query($sql); $sql = 'UPDATE '.$tbl_settings_current.' SET selected_value="'.addslashes($_POST['path_to_lzx']).'" WHERE variable="service_ppt2lp" AND subkey="path_to_lzx"'; Database::query($sql); $sql = 'UPDATE '.$tbl_settings_current.' SET selected_value="'.addslashes($_POST['size']).'" WHERE variable="service_ppt2lp" AND subkey="size"'; Database::query($sql); break; } } $listActiveServices = array(); // get the list of active services $sql = 'SELECT variable FROM '.$tbl_settings_current.' WHERE variable LIKE "service_%" AND subkey="active" and selected_value="true"'; $rs = Database::query($sql); while($row = Database::fetch_array($rs)){ $listActiveServices[] = $row['variable']; } $javascript_service_displayed = ''; if(isset($_GET['display'])){ $javascript_service_displayed = 'document.getElementById("extension_content_'.$_GET['display'].'").style.display = "block"'; } // javascript to handle accordion behaviour $javascript_message = ''; if(!empty($message)){ $javascript_message = ' document.getElementById("message").style.display = "block"; var timer = setTimeout(hideMessage,5000); '; } $htmlHeadXtra[]= ' '; $nameTool = get_lang('ConfigureExtensions'); Display::display_header($nameTool); ?>
*/ ?>