Esempio n. 1
0
$label = get_lang('MaxFileSize') . ': ' . ini_get('upload_max_filesize') . '<br/>' . get_lang('DocumentQuota') . ': ' . $course_quota;
$form->addElement('file', 'file', array(get_lang('File'), $label), 'style="width: 250px" id="user_upload"');
$form->addElement('text', 'title', get_lang('Title'), array('id' => 'title_file'));
$form->addElement('textarea', 'comment', get_lang('Comment'));
// Advanced parameters
$form->addButtonAdvancedSettings('advanced_params');
$form->addElement('html', '<div id="advanced_params_options" style="display:none">');
// Check box options
$form->addElement('checkbox', 'unzip', get_lang('Options'), get_lang('Uncompress'), 'onclick="javascript: check_unzip();" value="1"');
if (api_get_setting('search.search_enabled') == 'true') {
    //TODO: include language file
    $supported_formats = get_lang('SupportedFormatsForIndex') . ': HTML, PDF, TXT, PDF, Postscript, MS Word, RTF, MS Power Point';
    $form->addElement('checkbox', 'index_document', '', get_lang('SearchFeatureDoIndexDocument') . '<div style="font-size: 80%" >' . $supported_formats . '</div>');
    $form->addElement('html', '<br /><div class="sub-form">');
    $form->addElement('html', '<div class="label">' . get_lang('SearchFeatureDocumentLanguage') . '</div>');
    $form->addLabel(get_lang('Language'), api_get_languages_combo());
    $form->addElement('html', '</div><div class="sub-form">');
    $specific_fields = get_specific_field_list();
    foreach ($specific_fields as $specific_field) {
        $form->addElement('text', $specific_field['code'], $specific_field['name']);
    }
    $form->addElement('html', '</div>');
}
$form->addElement('radio', 'if_exists', get_lang('UplWhatIfFileExists'), get_lang('UplDoNothing'), 'nothing');
$form->addElement('radio', 'if_exists', '', get_lang('UplOverwriteLong'), 'overwrite');
$form->addElement('radio', 'if_exists', '', get_lang('UplRenameLong'), 'rename');
// Close the java script and avoid the footer up
$form->addElement('html', '</div>');
// Button upload document
$form->addButtonSend(get_lang('SendDocument'), 'submitDocument');
$form->add_real_progress_bar('DocumentUpload', 'file');
Esempio n. 2
0
</div>
EOT;
$renderer->setElementTemplate($user_file_template, 'user_file');
// set template for other elements
$user_file_template = <<<EOT
    <div class="row" style="margin-top:10px;width:100%">
\t\t<!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->{label}{element}
\t\t<!-- BEGIN error --><br /><span class="form_error">{error}</span><!-- END error -->
</div>
EOT;
$renderer->setElementTemplate($user_file_template);
$form->addElement('file', 'user_file', Display::return_icon('word_big.gif'));
if (api_get_setting('search_enabled') == 'true') {
    $form->addElement('checkbox', 'index_document', '', get_lang('SearchFeatureDoIndexDocument'));
    $form->addElement('html', '<br />');
    $form->addElement('html', get_lang('SearchFeatureDocumentLanguage') . ': &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . api_get_languages_combo());
    $form->addElement('html', '<div class="sub-form">');
    foreach ($specific_fields as $specific_field) {
        $form->addElement('text', $specific_field['code'], $specific_field['name'] . ' : ');
    }
    $form->addElement('html', '</div>');
}
/*
 * commented because SplitStepsPerChapter is not stable at all
 * $form -> addElement ('radio', 'split_steps',null, get_lang('SplitStepsPerPage'),'per_page');
 * $form -> addElement ('radio', 'split_steps',null, get_lang('SplitStepsPerChapter'),'per_chapter');
 */
$form->addElement('hidden', 'split_steps', 'per_page');
$form->addElement('submit', 'convert', get_lang('ConvertToLP'), 'class="convert_button"');
$form->addElement('hidden', 'woogie', 'true');
$form->add_real_progress_bar(md5(rand(0, 10000)), 'user_file', 1, true);
Esempio n. 3
0
$label = get_lang('MaxFileSize') . ': ' . ini_get('upload_max_filesize') . '<br/>' . get_lang('DocumentQuota') . ': ' . $course_quota;
$form->addElement('file', 'file', array(get_lang('File'), $label), 'style="width: 250px" id="user_upload"');
$form->addElement('text', 'title', get_lang('Title'), array('size' => '20', 'style' => 'width:300px', 'id' => 'title_file'));
$form->addElement('textarea', 'comment', get_lang('Comment'), 'wrap="virtual" style="width:300px;"');
// Advanced parameters
$form->addElement('label', null, Display::url(get_lang('AdvancedParameters'), '#', array('id' => 'upload_settings', 'class' => 'advanced_options')));
$form->addElement('html', '<div id="upload_settings_options" style="display:none">');
// Check box options
$form->addElement('checkbox', 'unzip', get_lang('Options'), get_lang('Uncompress'), 'onclick="javascript: check_unzip();" value="1"');
if (api_get_setting('search_enabled') == 'true') {
    //TODO: include language file
    $supported_formats = get_lang('SupportedFormatsForIndex') . ': HTML, PDF, TXT, PDF, Postscript, MS Word, RTF, MS Power Point';
    $form->addElement('checkbox', 'index_document', '', get_lang('SearchFeatureDoIndexDocument') . '<div style="font-size: 80%" >' . $supported_formats . '</div>');
    $form->addElement('html', '<br /><div class="sub-form">');
    $form->addElement('html', '<div class="label">' . get_lang('SearchFeatureDocumentLanguage') . '</div>');
    $form->addElement('html', '<div>' . api_get_languages_combo(null, false) . '</div>');
    $form->addElement('html', '</div><div class="sub-form">');
    $specific_fields = get_specific_field_list();
    foreach ($specific_fields as $specific_field) {
        $form->addElement('text', $specific_field['code'], $specific_field['name'] . ' : ');
    }
    $form->addElement('html', '</div>');
}
$form->addElement('radio', 'if_exists', get_lang('UplWhatIfFileExists'), get_lang('UplDoNothing'), 'nothing');
$form->addElement('radio', 'if_exists', '', get_lang('UplOverwriteLong'), 'overwrite');
$form->addElement('radio', 'if_exists', '', get_lang('UplRenameLong'), 'rename');
// Close the java script and avoid the footer up
$form->addElement('html', '</div>');
// Button upload document
$form->addElement('style_submit_button', 'submitDocument', get_lang('SendDocument'), 'class="upload"');
$form->add_real_progress_bar('DocumentUpload', 'file');