Example #1
0
function list_element_certificate()
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.form.php';
    require_once _base_ . '/lib/lib.table.php';
    $mod_perm = checkPerm('mod', true);
    $id_certificate = importVar('id_certificate', true);
    // create a language istance for module admin_certificate
    $lang =& DoceboLanguage::createInstance('certificate', 'lms');
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    $form = new Form();
    $page_title = array('index.php?modname=pcertificate&op=certificate' => $lang->def('_TITLE_CERTIFICATE'), $lang->def('_STRUCTURE_CERTIFICATE'));
    $out->add(getTitleArea($page_title, 'certificate') . '<div class="std_block">' . getBackUi('index.php?modname=pcertificate&amp;op=certificate', $lang->def('_BACK')));
    if (isset($_GET['result'])) {
        switch ($_GET['result']) {
            case "ok":
                $out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')));
                break;
            case "err":
                $out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
                break;
            case "err_del":
                $out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
                break;
        }
    }
    $query_structure = "\r\n\tSELECT cert_structure, orientation, bgimage\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_certificate \r\n\tWHERE id_certificate = '" . (int) $id_certificate . "'";
    list($structure, $orientation, $bgimage) = sql_fetch_row(sql_query($query_structure));
    $out->add('<div class="std_block">');
    $out->add(getInfoUi($lang->def('_CERTIFICATE_WARNING')));
    $out->add($form->openForm('structure_certificate', 'index.php?modname=pcertificate&amp;op=savecertificate', false, false, 'multipart/form-data'));
    $out->add($form->openElementSpace() . $form->getTextarea($lang->def('_STRUCTURE_CERTIFICATE'), 'structure', 'structure', $structure) . '<p><b>' . $lang->def('_ORIENTATION') . '</b></p>' . $form->getRadio($lang->def('_PORTRAIT'), 'portrait', 'orientation', 'P', $orientation == 'P') . $form->getRadio($lang->def('_LANDSCAPE'), 'landscape', 'orientation', 'L', $orientation == 'L') . $form->getExtendedFilefield($lang->def('_BACK_IMAGE'), 'bgimage', 'bgimage', $bgimage) . $form->closeElementSpace() . $form->openButtonSpace() . $form->getHidden('id_certificate', 'id_certificate', $id_certificate) . $form->getButton('save_structure', 'save_structure', $lang->def('_SAVE')) . $form->getButton('undo', 'undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm());
    $tb = new Table(0, $lang->def('_TAG_LIST_CAPTION'), $lang->def('_TAG_LIST_SUMMARY'));
    $tb->setColsStyle(array('', ''));
    $tb->addHead(array($lang->def('_TAG_CODE'), $lang->def('_TAG_DESCRIPTION')));
    //search query of certificates tag
    $query_format_tag = "\r\n\tSELECT file_name, class_name \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_certificate_tags ";
    $re_certificate_tags = sql_query($query_format_tag);
    while (list($file_name, $class_name) = sql_fetch_row($re_certificate_tags)) {
        if (file_exists($GLOBALS['where_lms'] . '/lib/certificate/' . $file_name)) {
            require_once $GLOBALS['where_lms'] . '/lib/certificate/' . $file_name;
            $instance = new $class_name(0, 0);
            $this_subs = $instance->getSubstitutionTags();
            foreach ($this_subs as $tag => $description) {
                $tb->addBody(array($tag, $description));
            }
            // end foreach
        }
        // end if
    }
    $out->add($tb->getTable());
    $out->add('</div>');
}
Example #2
0
 function _getRoot()
 {
     $lang =& DoceboLanguage::createInstance('admin_config', 'scs');
     $reSetting = sql_query("\r\n\t\tDESCRIBE " . $this->table_root . "");
     $reSettingValue = sql_query("\r\n\t\tSELECT  system_type, server_ip, server_port, server_path, \r\n\t\t\t\tmax_user_at_time, max_room_at_time, max_subroom_for_room, \r\n\t\t\t\tenable_drawboard, enable_livestream, enable_remote_desktop, enable_webcam, enable_audio \r\n\t\tFROM " . $this->table_root . "");
     $values = mysql_fetch_array($reSettingValue);
     $html = '';
     while ($res = sql_fetch_row($reSetting)) {
         $var_name = $res[0];
         $value_type = $res[1];
         $default_value = $res[4];
         switch ($value_type) {
             case "enum('p2p','server')":
                 //radio button
                 $html .= Form::getOpenCombo($lang->def('_' . strtoupper($var_name))) . Form::getRadio($lang->def('_P2P'), 'option_' . $var_name . '_p2p', 'option[' . $var_name . ']', 'p2p', $values[$var_name] == 'p2p') . Form::getRadio($lang->def('_SERVER'), 'option_' . $var_name . '_server', 'option[' . $var_name . ']', 'server', $values[$var_name] == 'server') . Form::getCloseCombo();
                 break;
             case "varchar(255)":
                 $html .= Form::getTextfield($lang->def('_' . strtoupper($var_name)), 'option_' . $var_name . '', 'option[' . $var_name . ']', 255, $values[$var_name]);
                 break;
             case "int(5) unsigned":
                 $html .= Form::getTextfield($lang->def('_' . strtoupper($var_name)), 'option_' . $var_name . '', 'option[' . $var_name . ']', 5, $values[$var_name]);
                 break;
             case "int(11) unsigned":
                 $html .= Form::getTextfield($lang->def('_' . strtoupper($var_name)), 'option_' . $var_name . '', 'option[' . $var_name . ']', 11, $values[$var_name]);
                 break;
             case "enum('yes','no')":
                 $html .= Form::getOpenCombo($lang->def('_' . strtoupper($var_name))) . Form::getRadio($lang->def('_YES'), $var_name . '_yes', 'option[' . $var_name . ']', 'yes', $values[$var_name] == 'yes') . Form::getRadio($lang->def('_NO'), $var_name . '_no', 'option[' . $var_name . ']', 'no', $values[$var_name] == 'no') . Form::getCloseCombo();
                 break;
         }
     }
     return $html;
 }
function newsletter()
{
    //access control
    //-TP// funAdminAccess('OP');
    checkPerm('view');
    require_once _base_ . '/lib/lib.form.php';
    $out =& $GLOBALS['page'];
    $out->setWorkingZone("content");
    $lang =& DoceboLanguage::createInstance('admin_newsletter', 'framework');
    YuiLib::load();
    addJs($GLOBALS['where_framework_relative'] . '/modules/newsletter/', 'newsletter.js');
    $form = new Form();
    $out->add(getTitleArea($lang->def("_NEWSLETTER"), "newsletter"));
    $p_size = intval(ini_get('post_max_size'));
    $u_size = intval(ini_get('upload_max_filesize'));
    $max_kb = $p_size < $u_size ? $p_size : $u_size;
    $max = ' (Max. ' . $max_kb . ' Mb) ';
    $out->add('<script>' . 'var _DEL=\'' . $lang->def('_DEL') . '\';' . 'var _ATTACHMENT=\'' . $lang->def('_ATTACHMENT') . '\';' . 'var _MAX=\'' . $max . '\';' . '</script>');
    $out->add("<div class=\"std_block\">\n");
    $acl_manager = Docebo::user()->getAclManager();
    $user_info = $acl_manager->getUser(Docebo::user()->getIdSt(), false);
    $myemail = $user_info[ACL_INFO_EMAIL];
    if (isset($err) && $err != "") {
        $out->add("<b><span class=\"fontRed\">{$err}</span><br />\n");
    }
    $out->add($form->openForm("newsletter_form", "index.php?modname=public_newsletter_admin&amp;op=initsend"));
    $out->add($form->openElementSpace());
    $out->add($form->getTextfield($lang->def("_SENDER"), "fromemail", "fromemail", 255, $myemail));
    $out->add($form->getTextfield($lang->def("_SUBJECT"), "sub", "sub", 255, ""));
    $out->add($form->getTextarea($lang->def("_DESCRIPTION"), "msg", "msg", ""));
    $lang_list = Docebo::langManager()->getAllLangCode();
    //array_unshift($lang_list, $lang->def("_DEFAULT"), $lang->def("_ALL"));
    $lang_list = array(_ANY_LANG_CODE => $lang->def("_ALL")) + $lang_list;
    $out->add('<div id="file">' . $form->getHidden('file_number', 'file_number', '1') . '<div id="div_file_1">' . $form->getFilefield($lang->def('_ATTACHMENT'), 'file_1', 'file_1', '', '', '<a href="#" onclick="delFile(\'1\'); return false;"><span id="rem_span">' . $lang->def('_DEL') . '</span><a>') . '</div>' . '</div>' . '<br/><a href="#" onclick="addFile(); return false;"><span id="add_span">' . $lang->def('_ADD') . '</span></a>');
    $out->add($form->getDropdown($lang->def("_LANGUAGE"), "sel_lang", "sel_lang", $lang_list));
    $out->add($form->getRadio($lang->def("_EMAIL"), "send_type_email", "send_type", "email", true));
    $out->add($form->getRadio($lang->def("_SEND_SMS"), "send_type_sms", "send_type", "sms", false));
    $out->add($form->closeElementSpace());
    $out->add($form->openButtonSpace());
    $out->add($form->getButton('send', 'send', $lang->def('_SEND')));
    $out->add($form->closeButtonSpace());
    $out->add($form->closeForm());
    $out->add("</div>\n");
}
Example #4
0
Get::title(array('index.php?r=' . $base_link_course . '/show' => Lang::t('_COURSE', 'course'), $id_course === false ? Lang::t('_NEW_COURSE', 'course') : Lang::t('_MOD', 'course') . ': ' . ($course['code'] !== '' ? '[' . $course['code'] . '] ' : '') . $course['name']));
?>
<div class="std_block">
	<?php 
echo Form::openForm('maskcourse_form', 'index.php?r=' . $base_link_course . '/' . ($id_course === false ? 'newcourse' : 'modcourse'), false, 'post', 'multipart/form-data') . Form::getHidden('id_course', 'id_course', $id_course) . Form::openElementSpace() . ($id_course === false ? Form::getLineBox(Lang::t('_CATEGORY_SELECTED', 'course'), $name_category) . Form::getHidden('idCategory', 'idCategory', $_SESSION['course_category']['filter_status']['id_category']) : Form::getDropdown(Lang::t('_CATEGORY_SELECTED', 'course'), 'idCategory', 'idCategory', $model->getCategoryForDropdown(), $course['idCategory'])) . Form::getTextfield(Lang::t('_CODE', 'course'), 'course_code', 'course_code', '50', $course['code']) . Form::getTextfield(Lang::t('_COURSE_NAME', 'course'), 'course_name', 'course_name', '255', $course['name']);
if ($course['course_type'] == 'classroom' && $has_editions_or_classrooms) {
    //this is a classroom course with editions
    echo Form::getLineBox(Lang::t('_COURSE_TYPE', 'course'), $course_type['classroom']) . Form::getHidden('course_type', 'course_type', 'classroom');
} elseif ($course['course_edition'] > 0 && $has_editions_or_classrooms) {
    //this is a classroom course with editions
    echo Form::getLineBox(Lang::t('_COURSE_TYPE', 'course'), $course_type['edition']) . Form::getHidden('course_type', 'course_type', 'edition');
} else {
    //echo Form::getDropdown(Lang::t('_COURSE_TYPE', 'course'), 'course_type', 'course_type', $course_type, $course['course_type']);
    echo Form::getDropdown(Lang::t('_COURSE_TYPE', 'course'), 'course_type', 'course_type', $course_type, $id_course === false ? 'elearning' : $course['course_type']);
}
echo Form::getDropdown(Lang::t('_STATUS', 'course'), 'course_status', 'course_status', $status, $course['status']) . Form::getCheckbox(Lang::t('_DIRECT_PLAY', 'course'), 'direct_play', 'direct_play', '1', $course['direct_play'] == 1) . Form::getTextarea(Lang::t('_DESCRIPTION', 'course'), 'course_descr', 'course_descr', $course['description']) . ($id_course !== false && $course['course_type'] != 'elearning' ? Form::getCheckbox(Lang::t('_CASCADE_MOD_ON_EDITION', 'course'), 'cascade_on_ed', 'cascade_on_ed', 1) : '') . Form::closeElementSpace() . Form::openElementSpace() . Form::openCollasableFieldset(Lang::t('_DETAILS', 'course')) . ($id_course === false ? Form::getDropdown(Lang::t('_COURSE_MENU_TO_ASSIGN', 'course'), 'selected_menu', 'selected_menu', $menu_custom, $sel_custom) : '') . Form::getDropdown(Lang::t('_COURSE_LANG_METHOD', 'course'), 'course_lang', 'course_lang', $array_lang, array_search($course['lang_code'], $array_lang)) . Form::getDropdown(Lang::t('_DIFFICULTY', 'course'), 'course_difficult', 'course_difficult', $difficult_lang, $course['difficult']) . Form::getTextfield(Lang::t('_CREDITS', 'course'), 'credits', 'credits', '50', $course['credits']) . Form::getDropdown(Lang::t('_LABELS', 'label'), 'label', 'label', $label_model->getLabelFromDropdown(true), $id_course === false ? false : $label_model->getCourseLabel($course['idCourse'])) . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_COURSE_SUBSCRIPTION', 'course')) . Form::getOpenCombo(Lang::t('_COURSE_SUBSRIBE', 'course')) . Form::getRadio(Lang::t('_COURSE_S_GODADMIN', 'course'), 'course_subs_godadmin', 'course_subs', '0', $course['subscribe_method'] == 0) . Form::getRadio(Lang::t('_COURSE_S_MODERATE', 'course'), 'course_subs_moderate', 'course_subs', '1', $course['subscribe_method'] == 1) . Form::getRadio(Lang::t('_COURSE_S_FREE', 'course'), 'course_subs_free', 'course_subs', '2', $course['subscribe_method'] == 2) . Form::getCloseCombo() . Form::getOpenCombo(Lang::t('_USER_CAN_SUBSCRIBE', 'course')) . Form::getRadio(Lang::t('_SUBSCRIPTION_CLOSED', 'course'), 'subscription_closed', 'can_subscribe', '0', $course['can_subscribe'] == 0) . Form::getRadio(Lang::t('_SUBSCRIPTION_OPEN', 'course'), 'subscription_open', 'can_subscribe', '1', $course['can_subscribe'] == 1) . Form::getRadio(Lang::t('_SUBSCRIPTION_IN_PERIOD', 'course') . ":", 'subscription_period', 'can_subscribe', '2', $course['can_subscribe'] == 2) . Form::getCloseCombo() . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_BEGIN', 'course') . ":", 'sub_start_date', 'sub_start_date', $course['sub_start_date']) . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_END', 'course') . ":", 'sub_end_date', 'sub_end_date', $course['sub_end_date']) . Form::getBreakRow() . Form::getOpenCombo(Lang::t('_USER_CAN_UNSUBSCRIBE', 'course')) . Form::getRadio(Lang::t('_COURSE_S_GODADMIN', 'course'), 'no_user_unsubscription', 'auto_unsubscribe', '0', $course['auto_unsubscribe'] == 0) . Form::getRadio(Lang::t('_COURSE_S_MODERATE', 'course'), 'moderated_user_unsubscription', 'auto_unsubscribe', '1', $course['auto_unsubscribe'] == 1) . Form::getRadio(Lang::t('_COURSE_S_FREE', 'course'), 'yes_user_unsubscription', 'auto_unsubscribe', '2', $course['auto_unsubscribe'] == 2) . Form::getCloseCombo() . Form::getDatefield(Lang::t('_UNSUBSCRIBE_DATE_LIMIT', 'course'), 'unsubscribe_date_limit', 'unsubscribe_date_limit', $unsubscribe_date_limit, FALSE, FALSE, '', '', Form::getInputCheckbox('use_unsubscribe_date_limit', 'use_unsubscribe_date_limit', 1, $use_unsubscribe_date_limit, '') . ' ') . Form::getBreakRow() . Form::getTextfield(Lang::t('_COURSE_AUTOREGISTRATION_CODE', 'course'), 'course_autoregistration_code', 'course_autoregistration_code', '255', $course['autoregistration_code']) . Form::getCheckbox(Lang::t('_RANDOM_COURSE_AUTOREGISTRATION_CODE', 'course'), 'random_course_autoregistration_code', 'random_course_autoregistration_code', 0) . Form::getBreakRow() . Form::getCheckbox(Lang::t('_COURSE_SELL', 'course'), 'course_sell', 'course_sell', '1', $course['selling'] == 1) . Form::getTextfield(Lang::t('_COURSE_PRIZE', 'course'), 'course_prize', 'course_prize', '11', $course['prize']) . Form::getTextfield(Lang::t('_COURSE_ADVANCE', 'course'), 'advance', 'advance', '11', $course['advance']) . Form::getHidden('course_em', 'course_em', '0') . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_COURSE_DISPLAY_MODE', 'course')) . Form::getOpenCombo(Lang::t('_WHERE_SHOW_COURSE', 'course')) . Form::getRadio(Lang::t('_SC_EVERYWHERE', 'course'), 'course_show_rules_every', 'course_show_rules', '0', $course['show_rules'] == 0) . Form::getRadio(Lang::t('_SC_ONLY_IN', 'course'), 'course_show_rules_only_in', 'course_show_rules', '1', $course['show_rules'] == 1) . Form::getRadio(Lang::t('_SC_ONLYINSC_USER', 'course'), 'course_show_rules_onlyinsc_user', 'course_show_rules', '2', $course['show_rules'] == 2) . Form::getCloseCombo() . Form::getOpenCombo(Lang::t('_WHAT_SHOW', 'course')) . Form::getCheckbox(Lang::t('_SHOW_PROGRESS', 'course'), 'course_progress', 'course_progress', '1', $course['show_progress'] == 1) . Form::getCheckbox(Lang::t('_SHOW_TIME', 'course'), 'course_time', 'course_time', '1', $course['show_time'] == 1) . Form::getCheckbox(Lang::t('_SHOW_ADVANCED_INFO', 'course'), 'course_advanced', 'course_advanced', '1', $course['show_extra_info'] == 1) . Form::getCloseCombo() . Form::getDropdown(Lang::t('_SHOW_WHOISONLINE', 'course'), 'show_who_online', 'show_who_online', $show_who_online, $course['show_who_online']) . Form::getOpenCombo(Lang::t('_SHOW_USER_OF_LEVEL', 'course'));
while (list($level, $level_name) = each($levels)) {
    echo Form::getCheckbox($level_name, 'course_show_level_' . $level, 'course_show_level[' . $level . ']', $level, $course['level_show_user'] & 1 << $level);
}
echo Form::getCloseCombo() . Form::getOpenCombo(Lang::t('_COURSE_STATUS_CANNOT_ENTER', 'course')) . Form::getCheckbox(Lang::t('_USER_STATUS_SUBS', 'course'), 'user_status_' . _CUS_SUBSCRIBED, 'user_status[' . _CUS_SUBSCRIBED . ']', _CUS_SUBSCRIBED, $course['userStatusOp'] & 1 << _CUS_SUBSCRIBED) . Form::getCheckbox(Lang::t('_USER_STATUS_BEGIN', 'course'), 'user_status_' . _CUS_BEGIN, 'user_status[' . _CUS_BEGIN . ']', _CUS_BEGIN, $course['userStatusOp'] & 1 << _CUS_BEGIN) . Form::getCheckbox(Lang::t('_USER_STATUS_END', 'course'), 'user_status_' . _CUS_END, 'user_status[' . _CUS_END . ']', _CUS_END, $course['userStatusOp'] & 1 << _CUS_END) . Form::getCheckbox(Lang::t('_USER_STATUS_SUSPEND', 'course'), 'user_status_' . _CUS_SUSPEND, 'user_status[' . _CUS_SUSPEND . ']', _CUS_SUSPEND, $course['userStatusOp'] & 1 << _CUS_SUSPEND) . Form::getCloseCombo() . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_COURSE_TIME_OPTION', 'course')) . Form::getDatefield(Lang::t('_DATE_BEGIN', 'course'), 'course_date_begin', 'course_date_begin', $course['date_begin']) . Form::getDatefield(Lang::t('_DATE_END', 'course'), 'course_date_end', 'course_date_end', $course['date_end']) . Form::getLineBox('<label for="hour_begin_hour">' . Lang::t('_HOUR_BEGIN', 'course') . '</label>', Form::getInputDropdown('dropdown_nw', 'hour_begin_hour', 'hour_begin[hour]', $hours, $hb_sel, '') . ' : ' . Form::getInputDropdown('dropdown_nw', 'hour_begin_quarter', 'hour_begin[quarter]', $quarter, $qe_sel, '')) . Form::getLineBox('<label for="hour_end_hour">' . Lang::t('_HOUR_END', 'course') . '</label>', Form::getInputDropdown('dropdown_nw', 'hour_end_hour', 'hour_end[hour]', $hours, $he_sel, '') . ' : ' . Form::getInputDropdown('dropdown_nw', 'hour_end_quarter', 'hour_end[quarter]', $quarter, $qe_sel, '')) . Form::getTextfield(Lang::t('_DAY_OF_VALIDITY', 'course'), 'course_day_of', 'course_day_of', '10', $course['valid_time']) . Form::getTextfield(Lang::t('_MEDIUM_TIME', 'course'), 'course_medium_time', 'course_medium_time', '10', $course['mediumTime']) . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_COURSE_SPECIAL_OPTION', 'course')) . Form::getTextfield(Lang::t('_MIN_NUM_SUBSCRIBE', 'course'), 'min_num_subscribe', 'min_num_subscribe', '11', $course['min_num_subscribe']) . Form::getTextfield(Lang::t('_MAX_NUM_SUBSCRIBE', 'course'), 'max_num_subscribe', 'max_num_subscribe', '11', $course['max_num_subscribe']) . Form::getCheckbox(Lang::t('_ALLOW_OVERBOOKING', 'course'), 'allow_overbooking', 'allow_overbooking', '1', $course['allow_overbooking'] == 1) . Form::getTextfield(Lang::t('_COURSE_QUOTA', 'course'), 'course_quota', 'course_quota', '11', $course['course_quota'] != COURSE_QUOTA_INHERIT ? $course['course_quota'] : 0) . Form::getCheckbox(Lang::t('_INHERIT_QUOTA', 'course'), 'inherit_quota', 'inherit_quota', '1', $course['course_quota'] == COURSE_QUOTA_INHERIT) . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_DOCUMENT_UPLOAD', 'course')) . Form::getTextfield(Lang::t('_SPONSOR_LINK', 'course'), 'course_sponsor_link', 'course_sponsor_link', '255', $course['linkSponsor']) . Form::getExtendedFilefield(Lang::t('_PATHSPONSOR', 'configuration'), 'course_sponsor_logo', 'course_sponsor_logo', $course["imgSponsor"]) . Form::getExtendedFilefield(Lang::t('_COURSE_LOGO', 'course'), 'course_logo', 'course_logo', $course["img_course"]) . Form::getExtendedFilefield(Lang::t('_COURSE_DEMO', 'course'), 'course_demo', 'course_demo', $course["course_demo"]) . Form::getCheckbox(Lang::t('_USE_LOGO_IN_COURSELIST', 'course'), 'use_logo_in_courselist', 'use_logo_in_courselist', 1, $course["use_logo_in_courselist"]) . Form::getCloseFieldset() . Form::closeElementSpace() . Form::openButtonSpace() . ($_REQUEST['r'] == 'alms/course/newcourse' || $_REQUEST['r'] == 'alms/course/modcourse' && $row[0] == 0 ? Form::getCheckbox(Lang::t('_AUTO_SUBSCRIPTION'), 'auto_subscription', 'auto_subscription', '1', true) : '') . Form::getButton('save', 'save', Lang::t('_SAVE')) . Form::getButton('undo', 'undo', Lang::t('_UNDO')) . Form::closeButtonSpace() . Form::closeForm();
?>
</div>
<script type="text/javascript">
var D = YAHOO.util.Dom, E = YAHOO.util.Event;
E.onDOMReady(function() {
	var c = D.get("use_unsubscribe_date_limit"), d = D.get("unsubscribe_date_limit");
	E.addListener("no_user_unsubscription", "click", function(e) {
		var checked = this.checked;
		c.disabled = checked;
		d.disabled = checked;
	});
function create_report_type()
{
    checkPerm('mod');
    require_once _base_ . '/lib/lib.form.php';
    $lang =& DoceboLanguage::createInstance('report', 'framework');
    $obj_report = openreport();
    $temp = $obj_report->get_columns_categories();
    $GLOBALS['page']->add(getTitleArea(array('index.php?modname=public_report_admin&amp;op=reportlist' => $lang->def('_REPORT'), 'index.php?modname=public_report_admin&amp;op=create_name' => $lang->def('_NEW'), 'index.php?modname=public_report_admin&amp;op=create_rows' => $lang->def('_REPORT_SEL_ROWS'), $lang->def('_REPORT_SEL_COLUMNS'))) . '<div class="std_block">', 'content');
    $GLOBALS['page']->add(Form::openForm('choose_category_form', 'index.php?modname=public_report_admin&amp;op=create_cols'), 'content');
    $i = 1;
    foreach ($temp as $key => $value) {
        $GLOBALS['page']->add(Form::getRadio($i . ') ' . $value, 'sel_columns_' . $key, 'columns_filter', $key, $i == 1), 'content');
        $i++;
    }
    $GLOBALS['page']->add(Form::openButtonSpace() . Form::getButton('', '', $lang->def('_CONFIRM'), false) . Form::closeButtonSpace() . Form::closeForm(), 'content');
}
Example #6
0
function classroomToEdition()
{
    require_once _base_ . '/lib/lib.form.php';
    //require_once(_i18n_.'/lib.lang.php');
    require_once _base_ . '/lib/lib.table.php';
    require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
    if (isset($_POST['classroom_to_edition'])) {
        list($edition_id) = each($_POST['classroom_to_edition']);
    } else {
        $edition_id = importVar('edition_id', true, 0);
    }
    $of_loc = importVar('of_loc', false, '');
    $of_name = importVar('of_name', false, '');
    $form = new Form();
    $query_course_name = "SELECT idCourse, name\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course_edition\r\n\tWHERE idCourseEdition = '" . $edition_id . "'";
    list($idCourse, $edition_name) = sql_fetch_row(sql_query($query_course_name));
    $lang =& DoceboLanguage::CreateInstance('course', 'lms');
    $tb = new Table(Get::sett('visuItem'), $lang->def('_CLASSROOMTOCOURSE_CAPTION'), $lang->def('_CLASSROOMTOCOURSE_CAPTION'));
    $tb->initNavBar('ini', 'link');
    $tb->setLink("index.php?modname=course&amp;op=classroom_to_edition&amp;edition_id={$edition_id}" . '&amp;of_loc=' . $of_loc . '&amp;of_name=' . $of_name);
    $ini = $tb->getSelectedElement();
    $checked_class = checkAvailableClass($idCourse, $edition_id);
    $classroom_order = "l.location, c.name ";
    if ($of_loc == 'loc') {
        $classroom_order = "l.location, c.name ";
    }
    if ($of_loc == 'locd') {
        $classroom_order = "l.location DESC, c.name ";
    }
    if ($of_name == 'name') {
        $classroom_order = "c.name, l.location ";
    }
    if ($of_name == 'namec') {
        $classroom_order = "c.name DESC, l.location ";
    }
    if ($of_loc == '' && $of_name == '') {
        $of_loc = 'loc';
    }
    //search query of classrooms ---------------------------------
    $query_classroom = "\r\n\tSELECT c.idClassroom, c.name, c.description, l.location\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_classroom AS c\r\n\t\tJOIN " . $GLOBALS['prefix_lms'] . "_class_location AS l\r\n\tWHERE l.location_id = c.location_id\r\n\tORDER BY " . $classroom_order . "\r\n\tLIMIT {$ini}," . Get::sett('visuItem');
    $re_classroom = sql_query($query_classroom);
    // search classrooms assigned --------------------------------
    $query_class_assigned = "\r\n\tSELECT classrooms\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course_edition\r\n\twhere idCourseEdition= " . $edition_id . "";
    list($assigned_classroom) = sql_fetch_row(sql_query($query_class_assigned));
    $query_classroom_tot = "\r\n\tSELECT COUNT(*)\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_classroom ";
    list($tot_classroom) = sql_fetch_row(sql_query($query_classroom_tot));
    // table intestation
    $type_h = array('', '', '', 'image');
    $cont_h = array('<a href="' . "index.php?modname=course&amp;op=classroom_to_edition&amp;edition_id=" . $edition_id . "&amp;of_loc=" . ($of_loc == 'loc' ? 'locd' : 'loc') . '">' . ($of_loc == 'loc' ? '<img src="' . getPathImage() . '/standard/1downarrow.png" alt="' . $lang->def('_DEF_DOWN') . '" />' : ($of_loc == 'locd' ? '<img src="' . getPathImage() . '/standard/1uparrow.png" alt="' . $lang->def('_DEF_UP') . '" />' : '<img src="' . getPathImage() . '/standard/sort.png" alt="' . $lang->def('_DEF_SORT') . '" />')) . $lang->def('_LOCATION') . '</a>', '<a href="' . "index.php?modname=course&amp;op=classroom_to_edition&amp;edition_id=" . $edition_id . "&amp;of_name=" . ($of_name == 'name' ? 'named' : 'name') . '">' . ($of_name == 'name' ? '<img src="' . getPathImage() . '/standard/1downarrow.png" alt="' . $lang->def('_DEF_DOWN') . '" />' : ($of_name == 'named' ? '<img src="' . getPathImage() . '/standard/1uparrow.png" alt="' . $lang->def('_DEF_UP') . '" />' : '<img src="' . getPathImage() . '/standard/sort.png" alt="' . $lang->def('_DEF_SORT') . '" />')) . $lang->def('_CLASSROOM', 'course') . '</a>', $lang->def('_STATUS'), $lang->def('_USETHIS'));
    $tb->setColsStyle($type_h);
    $tb->addHead($cont_h);
    $class_room_to_edition = array();
    while (list($idClassroom, $name, $descr, $location) = sql_fetch_row($re_classroom)) {
        $cont = array('<label for="class_room_to_edition_' . $idClassroom . '">' . $location . '</label>', '<label for="class_room_to_edition_' . $idClassroom . '">' . $name . '</label>');
        if (isset($checked_class[$idClassroom])) {
            $cont[] = $lang->def('_CLASSROOM_OCCUPATED_YES');
        } else {
            $cont[] = '';
        }
        $cont[] = $form->getRadio('', 'class_room_to_edition_' . $idClassroom . '', 'class_room_to_edition', $idClassroom, $assigned_classroom == $idClassroom);
        $tb->addBody($cont);
    }
    $page_title = array('index.php?modname=course&amp;op=course_list' => $lang->def('_CLASSROOM'), $edition_name);
    $GLOBALS['page']->add(getTitleArea($page_title, 'classroomtocourse', $lang->def('_CLASSROOM')) . '<div class="std_block">' . ($checked_class !== false ? getResultUi($lang->def('_CLASSROOM_OCCUPATED')) : '') . getBackUi('index.php?modname=course&amp;op=course_list', $lang->def('_BACK')) . $form->openForm('assignEditionClassroom', 'index.php?modname=course&amp;op=assignEditionClassroom', false, false, 'multipart/form-data') . $form->getHidden('edition_id', 'edition_id', $edition_id) . $form->getHidden('idCourse', 'idCourse', $idCourse) . $tb->getTable() . $tb->getNavBar($ini, $tot_classroom) . $form->openButtonSpace() . $form->getButton('assignEditionClassroom', 'assignEditionClassroom', $lang->def('_SAVE')) . $form->getButton('course_undo', 'course_undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm() . '</div>', 'content');
}
Example #7
0
function schedule_set($idrep)
{
    checkPerm('mod');
    $lang =& DoceboLanguage::createInstance('report', 'framework');
    //initialize session data for schedulation, if not updating
    if (!isset($_SESSION['schedule_tempdata'])) {
        $_SESSION['schedule_tempdata'] = array('name' => '', 'period' => 'day', 'period_info' => '', 'time' => '', 'recipients' => array());
    }
    $ref =& $_SESSION['schedule_tempdata'];
    require_once _base_ . '/lib/lib.form.php';
    $jump_url = 'index.php?modname=report&op=report_schedule&idrep=' . $idrep;
    $back_url = 'index.php?modname=report&op=schedulelist&idrep=' . $idrep;
    $body = Form::openForm('report_schedule_time', $jump_url);
    $body .= Form::getTextfield($lang->def('_SAVE_SCHED_NAME'), 'sched_name', 'sched_name', '200', $ref['name']) . Form::getHidden('next_step', 'next_step', 'sched_setrecipients');
    //create selections for crontab specification
    $month_days = array();
    for ($i = 1; $i <= 31; $i++) {
        $month_days[$i] = $i;
        //TO DO : format with 2 digits filling with 0
    }
    $year_months = array();
    for ($i = 1; $i <= 12; $i++) {
        $year_months[$i] = $i;
        //TO DO : format with 2 digits filling with 0
    }
    $lang_days =& DoceboLanguage::createInstance('calendar', 'lms');
    $week_days = array('0' => $lang_days->def('_MONDAY'), '1' => $lang_days->def('_TUESDAY'), '2' => $lang_days->def('_WEDNESDAY'), '3' => $lang_days->def('_THURSDAY'), '4' => $lang_days->def('_FRIDAY'), '5' => $lang_days->def('_SATURDAY'), '6' => $lang_days->def('_SUNDAY'));
    $body .= Form::getRadio($lang->def('_REPORT_DAILY'), 'cron_radio_1', 'cron_radio', 'day', $ref['period'] == 'day' ? true : false) . '<div class="form_line_l">' . Form::getInputRadio('cron_radio_2', 'cron_radio', 'week', $ref['period'] == 'week' ? true : false, '') . ' <label class="label_normal" for="cron_radio_2">' . $lang->def('_REPORT_WEEKLY') . '</label> ' . Form::getInputDropdown('', 'cron_weekly', 'cron_weekly', $week_days, $ref['period'] == 'week' ? $ref['period_info'] : '', '') . '</div>' . '<div class="form_line_l">' . Form::getInputRadio('cron_radio_3', 'cron_radio', 'month', $ref['period'] == 'month' ? true : false, '') . ' <label class="label_normal" for="cron_radio_3">' . $lang->def('_REPORT_MONTHLY') . '</label> ' . Form::getInputDropdown('', 'cron_monthly', 'cron_monthly', $month_days, $ref['period'] == 'month' ? $ref['period_info'] : '', '') . '</div>' . Form::getHidden('idrep', 'idrep', $idrep);
    $body .= Form::openButtonSpace() . Form::getButton('', 'schedule_confirm', $lang->def('_NEXT')) . Form::getButton('', 'schedule_undo', $lang->def('_UNDO')) . form::closeButtonSpace();
    $body .= Form::closeForm();
    //output content
    cout(getTitleArea($lang->def('_SCHEDULE')));
    cout('<div class="std_block">');
    cout($body);
    cout('</div>');
    //close std_block div
}
Example #8
0
function defpoint()
{
    checkPerm('view', false, 'storage');
    $lang =& DoceboLanguage::createInstance('test');
    require_once _base_ . '/lib/lib.form.php';
    $idTest = importVar('idTest', true, 0);
    $back_url = urldecode(importVar('back_url'));
    $url_coded = htmlentities(urlencode($back_url));
    list($title, $description, $point_type, $point_required) = sql_fetch_row(sql_query("\r\n\tSELECT title, description, point_type, point_required \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_test \r\n\tWHERE idTest = '" . $idTest . "'"));
    $GLOBALS['page']->add(getTitleArea($lang->def('_TEST_SECTION'), 'test') . '<div class="std_block">' . '<div class="title_big">' . $lang->def('_TEST_POINT_MANAGEMENT') . '</div>' . getBackUi('index.php?modname=test&amp;op=modtestgui&amp;idTest=' . $idTest . '&amp;back_url=' . $url_coded, $lang->def('_BACK')) . Form::openForm('defpoint', 'index.php?modname=test&amp;op=updatepoint') . Form::getOpenFieldset($lang->def('_MIN_SCORE')) . Form::getHidden('idTest', 'idTest', $idTest) . Form::getHidden('back_url', 'back_url', $url_coded) . Form::getTextfield($lang->def('_TEST_PMM_REQUIREDSCORE_POINT'), 'point_required', 'point_required', 30, $point_required ? $point_required : '0.0') . Form::getCloseFieldset() . Form::getOpenFieldset($lang->def('_TEST_PM_ONE')) . Form::getRadio($lang->def('_TEST_PM1_POINT'), 'point_type_point', 'point_type', 0, $point_type == 0) . Form::getRadio($lang->def('_TEST_PM1_PERC'), 'point_type_perc', 'point_type', 1, $point_type == 1) . Form::getCloseFieldset() . '<div class="align_right">' . Form::getButton('defpoint_submit', 'defpoint_submit', $lang->def('_SAVE')) . '</div>' . Form::closeForm() . Form::openForm('assignpoint', 'index.php?modname=test&amp;op=modassignpoint') . Form::getOpenFieldset($lang->def('_TEST_PM_TWO')) . Form::getHidden('idTest_assign', 'idTest', $idTest) . Form::getHidden('back_url_assign', 'back_url', $url_coded), 'content');
    $query_question = "\r\n\tSELECT q.idQuest, q.type_quest, t.type_file, t.type_class, q.title_quest, q.difficult \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_testquest AS q JOIN " . $GLOBALS['prefix_lms'] . "_quest_type AS t \r\n\tWHERE q.idTest = '" . (int) $idTest . "' AND q.type_quest = t.type_quest";
    $query_question .= " ORDER BY q.sequence";
    $re_quest = sql_query($query_question);
    $max_score = 0;
    while (list($idQuest, $type_quest, $type_file, $type_class, $title_quest, $difficult) = sql_fetch_row($re_quest)) {
        require_once dirname(__FILE__) . '/../question/' . $type_file;
        $quest_obj = eval("return new {$type_class}( {$idQuest} );");
        $max_score += $quest_obj->getMaxScore();
    }
    $GLOBALS['page']->add('<div class="form_line_l">' . '<div class="label_effect">' . $lang->def('_TEST_QUEST_MAXTESTSCORE') . '</div>' . $max_score . ' ' . $lang->def('_SCORE') . '</div>' . Form::getTextfield($lang->def('_TEST_QUEST_NEWMAXTESTSCORE'), 'new_assigned_score', 'new_assigned_score', 255, $max_score, $lang->def('_TEST_QUEST_NEWMAXTESTSCORE'), $lang->def('_SCORE')) . Form::getOpenCombo($lang->def('_TEST_PM_SUBD_BY')) . Form::getRadio($lang->def('_TEST_PM_DIFFICULT'), 'point_diffcult', 'point_assignement', 0) . Form::getRadio($lang->def('_TEST_PM_EQUALTOALL'), 'point_equaltoall', 'point_assignement', 1) . Form::getRadio($lang->def('_TEST_PM_MANUAL'), 'point_manual', 'point_assignement', 2, true) . Form::getCloseCombo() . Form::getCloseFieldset() . '<div class="align_right">' . Form::getButton('assignpoint_submit', 'assignpoint_submit', $lang->def('_TEST_PM_SETPOINT')) . '</div>' . Form::closeForm() . getBackUi('index.php?modname=test&amp;op=modtestgui&amp;idTest=' . $idTest . '&amp;back_url=' . $url_coded, $lang->def('_BACK')) . '</div>', 'content');
}
Example #9
0
 function modcourseinfo()
 {
     checkPerm('mod');
     require_once _base_ . '/lib/lib.form.php';
     $lang_c =& DoceboLanguage::createInstance('course');
     $lang =& DoceboLanguage::createInstance('course');
     $out =& $GLOBALS['page'];
     $id_course = $_SESSION['idCourse'];
     $form = new Form();
     $levels = CourseLevel::getLevels();
     $array_lang = Docebo::langManager()->getAllLangCode();
     $difficult_lang = array('veryeasy' => $lang->def('_DIFFICULT_VERYEASY'), 'easy' => $lang->def('_DIFFICULT_EASY'), 'medium' => $lang->def('_DIFFICULT_MEDIUM'), 'difficult' => $lang->def('_DIFFICULT_DIFFICULT'), 'verydifficult' => $lang->def('_DIFFICULT_VERYDIFFICULT'));
     $query_course = "\r\n\tSELECT code, name, description, lang_code, status, level_show_user, subscribe_method, \r\n\t\tlinkSponsor, mediumTime, permCloseLO, userStatusOp, difficult, \r\n\t\tshow_progress, show_time, show_extra_info, show_rules, date_begin, date_end, valid_time \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course\r\n\tWHERE idCourse = '" . $id_course . "'";
     $course = mysql_fetch_array(sql_query($query_course));
     $lang_code = array_search($course['lang_code'], $array_lang);
     $out->setWorkingZone('content');
     $out->add(getTitleArea($lang_c->def('_INFO'), 'infocourse') . '<div class="std_block">' . $form->openForm('course_modify', 'index.php?modname=course&amp;op=upcourseinfo') . $form->openElementSpace() . $form->getTextfield($lang->def('_CODE'), 'course_code', 'course_code', '50', $course['code']) . $form->getTextfield($lang->def('_COURSE_NAME'), 'course_name', 'course_name', '255', $course['name']) . $form->getDropdown($lang->def('_COURSE_LANG_METHOD'), 'course_lang', 'course_lang', $array_lang, $lang_code) . $form->getDropdown($lang->def('_DIFFICULTY'), 'course_difficult', 'course_difficult', $difficult_lang, $course['difficult']) . $form->getDropdown($lang->def('_STATUS'), 'course_status', 'course_status', array(CST_PREPARATION => Lang::t('_CST_PREPARATION', 'course'), CST_AVAILABLE => Lang::t('_CST_AVAILABLE', 'course'), CST_EFFECTIVE => Lang::t('_CST_CONFIRMED', 'course'), CST_CONCLUDED => Lang::t('_CST_CONCLUDED', 'course'), CST_CANCELLED => Lang::t('_CST_CANCELLED', 'course')), $course['status']) . $form->getTextarea($lang->def('_DESCRIPTION'), 'course_descr', 'course_descr', $course['description']) . $form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('upd_course', 'upd_course', $lang->def('_SAVE')) . $form->getButton('course_undo', 'course_undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->openElementSpace());
     //-display-mode----------------------------------------------------
     $out->add($form->getOpenFieldset($lang->def('_COURSE_DISPLAY_MODE')) . $form->getOpenCombo($lang->def('_SHOW_USER_OF_LEVEL')));
     while (list($level, $level_name) = each($levels)) {
         $out->add($form->getCheckbox($level_name, 'course_show_level_' . $level, 'course_show_level[' . $level . ']', $level, $course['level_show_user'] & 1 << $level));
     }
     $out->add($form->getCloseCombo() . $form->getOpenCombo($lang->def('_WHERE_SHOW_COURSE')) . $form->getRadio($lang->def('_SC_EVERYWHERE'), 'course_show_rules_every', 'course_show_rules', '0', $course['show_rules'] == 0) . $form->getRadio($lang->def('_SC_ONLY_IN'), 'course_show_rules_only_in', 'course_show_rules', '1', $course['show_rules'] == 1) . $form->getRadio($lang->def('_SC_ONLYINSC_USER'), 'course_show_rules_onlyinsc_user', 'course_show_rules', '2', $course['show_rules'] == 2) . $form->getCloseCombo() . $form->getOpenCombo($lang->def('_WHAT_SHOW')) . $form->getCheckbox($lang->def('_SHOW_PROGRESS'), 'course_progress', 'course_progress', '1', $course['show_progress']) . $form->getCheckbox($lang->def('_SHOW_TIME'), 'course_time', 'course_time', '1', $course['show_time']) . $form->getCheckbox($lang->def('_SHOW_ADVANCED_INFO'), 'course_advanced', 'course_advanced', '1', $course['show_extra_info']) . $form->getCloseCombo() . $form->getCloseFieldset());
     //-user-interaction--------------------------------------------------
     $out->add($form->getOpenFieldset($lang->def('_USER_INTERACTION_OPTION')) . $form->getOpenCombo($lang->def('_COURSE_END_MODE')) . $form->getRadio($lang->def('_COURSE_EM_TEACHER'), 'course_em_manual', 'course_em', '1', $course['permCloseLO']) . $form->getRadio($lang->def('_COURSE_EM_LO'), 'course_em_lo', 'course_em', '0', !$course['permCloseLO']) . $form->getCloseCombo() . $form->getOpenCombo($lang->def('_COURSE_STATUS_CANNOT_ENTER')) . $form->getCheckbox($lang->def('_USER_STATUS_SUBS'), 'user_status_0', 'user_status[0]', 0, statusNoEnter($course['userStatusOp'], _CUS_SUBSCRIBED)) . $form->getCheckbox($lang->def('_USER_STATUS_BEGIN'), 'user_status_1', 'user_status[1]', 1, statusNoEnter($course['userStatusOp'], _CUS_BEGIN)) . $form->getCheckbox($lang->def('_USER_STATUS_END'), 'user_status_2', 'user_status[2]', 2, statusNoEnter($course['userStatusOp'], _CUS_END)) . $form->getCheckbox($lang->def('_SUSPENDED'), 'user_status_3', 'user_status[3]', 3, statusNoEnter($course['userStatusOp'], _CUS_SUSPEND)) . $form->getCloseCombo() . $form->getCloseFieldset());
     //-expiration---------------------------------------------------------
     $out->add($form->getOpenFieldset($lang->def('_COURSE_TIME_OPTION')) . $form->getTextfield($lang->def('_MEDIUM_TIME'), 'course_medium_time', 'course_medium_time', '10', '0', $course['mediumTime']) . $form->getCloseFieldset());
     //sponsor-and-logo----------------------------------------------------
     /*
     $out->add(
     	$form->getTextfield($lang->def('_SPONSOR_LINK'), 'course_sponsor_link', 'course_sponsor_link', '255', 
     		$course['linkSponsor'])
     	.$form->getFilefield($lang->def('_SPONSOR_LOGO'), 'course_sponsor_logo', 'course_sponsor_logo')
     	.$form->getFilefield($lang->def('_COURSE_LOGO'), 'course_logo', 'course_logo'));
     */
     $out->add($form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('upd_course', 'upd_course', $lang->def('_SAVE')) . $form->getButton('course_undo', 'course_undo', $lang->def('_UNDO')) . $form->closeButtonSpace());
     $out->add($form->closeForm() . '</div>', 'content');
 }
Example #10
0
function report_sel_columns()
{
    checkPerm('mod');
    require_once _base_ . '/lib/lib.form.php';
    $lang =& DoceboLanguage::createInstance('report');
    $obj_report = openreport();
    $temp = $obj_report->get_columns_categories();
    cout(getTitleArea(array('index.php?modname=report&amp;op=reportlist' => $lang->def('_REPORT'), 'index.php?modname=report&amp;op=report_category' => $lang->def('_NEW'), 'index.php?modname=report&amp;op=report_rows_filter' => $lang->def('_REPORT_SEL_ROWS'), $lang->def('_REPORT_SEL_COLUMNS'))) . '<div class="std_block">' . Form::openForm('choose_category_form', 'index.php?modname=report&op=report_columns_filter&of_platform=lms'), 'content');
    $i = 1;
    foreach ($temp as $key => $value) {
        cout(Form::getRadio($i . ') ' . $value, 'sel_columns_' . $key, 'columns_filter', $key, $i == 1), 'content');
        $i++;
    }
    cout(Form::openButtonSpace() . Form::getButton('sel_rep_columns_button', false, $lang->def('_CONFIRM'), false, '', true, true) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
}
Example #11
0
echo Form::getTextfield(Lang::t('_DB_NAME'), "db_name", "db_info[db_name]", 255);
echo Form::getTextfield(Lang::t('_DB_USERNAME'), "db_user", "db_info[db_user]", 255);
echo Form::getPassword(Lang::t('_DB_PASS'), "db_pass", "db_info[db_pass]", 255);
?>
	
<h3><?php 
echo Lang::t('_UPLOAD_METHOD');
?>
</h3>


<?php 
echo Form::getRadio(Lang::t('_HTTP_UPLOAD'), "http_upload", "ul_info[upload_method]", "http", $php_conf['safe_mode']['local_value'] == '');
?>

<?php 
echo Form::getRadio(Lang::t('_FTP_UPLOAD'), "ftp_upload", "ul_info[upload_method]", "ftp", $php_conf['safe_mode']['local_value'] != '');
?>

<div id="ftp_data" style="visibility: hidden; margin-top: 1.6em;">
<?php 
echo Form::getTextfield(Lang::t('_FTP_HOST'), "ftp_host", "ul_info[ftp_host]", 255, "localhost");
echo Form::getTextfield(Lang::t('_FTP_PORT'), "ftp_port", "ul_info[ftp_port]", 255, "21");
echo Form::getTextfield(Lang::t('_FTP_USERNAME'), "ftp_user", "ul_info[ftp_user]", 255);
echo Form::getPassword(Lang::t('_FTP_PASS'), "ftp_pass", "ul_info[ftp_pass]", 255);
echo Form::getTextfield(Lang::t('_FTP_PATH'), "ftp_path", "ul_info[ftp_path]", 255, "/");
?>
</div>

<?php 
echo Form::getHidden("upload_method", "upload_method", "http");
Example #12
0
 function mancoursepath($load_id = false)
 {
     checkPerm('mod');
     require_once _base_ . '/lib/lib.form.php';
     $out =& $GLOBALS['page'];
     $lang =& DoceboLanguage::createInstance('coursepath', 'lms');
     if ($load_id === false) {
         $path_code = '';
         $path_name = '';
         $path_descr = '';
         $subscribe_method = 0;
     } else {
         $query_pathlist = "\r\n\t\tSELECT path_code, path_name, path_descr, subscribe_method\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_coursepath\r\n\t\tWHERE id_path = '" . (int) $load_id . "'\r\n\t\tORDER BY path_name";
         list($path_code, $path_name, $path_descr, $subscribe_method) = sql_fetch_row(sql_query($query_pathlist));
     }
     $title_area = array('index.php?modname=coursepath&amp;op=pathlist' => $lang->def('_COURSEPATH'));
     if ($load_id === false) {
         $title_area[] = $lang->def('_ADD');
     } else {
         $title_area[] = $path_name;
     }
     $out->add(getTitleArea($title_area, 'coursepath') . '<div class="std_block">' . Form::openForm('mancoursepath', 'index.php?modname=coursepath&amp;op=savecoursepath') . Form::openElementSpace() . ($load_id === false ? '' : Form::getHidden('id_path', 'id_path', $load_id)) . Form::getTextfield($lang->def('_CODE'), 'path_code', 'path_code', 255, $path_code) . Form::getTextfield($lang->def('_NAME'), 'path_name', 'path_name', 255, $path_name) . Form::getTextarea($lang->def('_DESCRIPTION'), 'path_descr', 'path_descr', $path_descr) . Form::getOpenCombo($lang->def('_COURSE_PATH_SUBSCRIBE')) . Form::getRadio($lang->def('_COURSE_S_GODADMIN'), 'course_subs_godadmin', 'subscribe_method', '0', $subscribe_method == 0) . Form::getRadio($lang->def('_COURSE_S_FREE'), 'course_subs_free', 'subscribe_method', '2', $subscribe_method == 2) . Form::getCloseCombo() . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
 }