'index.php', 'name' => get_lang('Administration')]; // Database Table Definitions $tbl_settings_current = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT); $message = ''; if (isset($_POST['activeExtension'])) { switch ($_POST['extension_code']) { 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($rs) > 0) { $message = get_lang('Service activated'); } $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 = []; // 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 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('Configure extensions'); Display::display_header($nameTool); ?>
'img-responsive']); ?>
addElement('text', 'host', get_lang('Host')); //$form -> addElement('html','

'); $form->addElement('text', 'port', get_lang('Port')); //$form -> addElement('html','

'); $form->addElement('text', 'user', get_lang('Login')); //$form -> addElement('html','

'); $form->addElement('text', 'ftp_password', get_lang('FTP password')); //$form -> addElement('html','

'); $form->addElement('text', 'path_to_lzx', get_lang('Path to LZX files')); //$form -> addElement('html','

'); $options = ChamiloApi::getDocumentConversionSizes(); $form->addElement('select', 'size', get_lang('Size of the slides'), $options); $form->addElement('hidden', 'extension_code', 'ppt2lp'); $defaults = []; $renderer = $form->defaultRenderer(); $renderer->setElementTemplate( '
{label}
{element}
' ); if (in_array('service_ppt2lp', $listActiveServices)) { $sql = 'SELECT subkey, selected_value FROM '.$tbl_settings_current.' WHERE variable = "service_ppt2lp" AND subkey <> "active"'; $rs = Database::query($sql); while ($row = Database::fetch_array($rs, 'ASSOC')) { $defaults[$row['subkey']] = $row['selected_value']; } $form->addButtonSave(get_lang('Reconfigure extension'), 'activeExtension'); } else { $defaults['host'] = 'localhost'; $defaults['port'] = '2002'; $defaults['size'] = '720x540'; $form->addButtonSave(get_lang('Activate service'), 'activeExtension'); } $form->setDefaults($defaults); $form->display(); echo '
'; ?>
*/ ?>