function _maskSuiteManager() { require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.platform.php'; $lang =& DoceboLanguage::createInstance('configuration', 'framework'); $plat_man =& PlatformManager::createInstance(); $all_platform = $plat_man->getPlatformsInfo(); $code_list_home = array(); $html = Form::getOpenFieldset($lang->def('_LOAD_UNLOAD_PLATFORM')); reset($all_platform); while (list($code, $info) = each($all_platform)) { if ($info['hidden_in_config'] != 'true') { $code = $info['platform']; $html .= Form::getCheckbox($info['name'], 'activate_platform_' . $code, 'activate_platform[' . $code . ']', 1, $info['is_active'] == 'true', $info['mandatory'] == 'true' ? ' disabled="disabled"' : ''); if ($info['is_active'] == 'true') { $code_list_home[$code] = $info['name']; } } } unset($code_list_home['scs']); unset($code_list_home['framework']); $html .= Form::getCloseFieldset(); $html .= Form::getDropdown($lang->def('_HOME_PLATFORM'), 'platform_in_home', 'platform_in_home', $code_list_home, $plat_man->getHomePlatform()); return $html; }
function searchUser(&$url) { checkPerm('view'); require_once _base_ . '/lib/lib.form.php'; require_once $GLOBALS['where_framework'] . '/lib/lib.myfriends.php'; $lang =& DoceboLanguage::createInstance('myfriends', 'lms'); $my_fr = new MyFriends(getLogUserId()); $acl_man =& Docebo::user()->getAclManager(); $GLOBALS['page']->add(getTitleArea(array($url->getUrl() => $lang->def('_MY_FRIENDS'), $lang->def('_SEARCH_USER')), 'myfriends') . '<div class="std_block">', 'content'); if (isset($_POST['send'])) { if ($my_fr->addFriend($_POST['id_friend'], MF_WAITING, $_POST['request'])) { Util::jump_to($url->getUrl('result=ok_del')); } $GLOBALS['page']->add(getErrorUi($lang->def('_ERR_REMOVE_FRIEND'))); } elseif (isset($_GET['id_friend'])) { $GLOBALS['page']->add(Form::openForm('send_request', $url->getUrl('op=searchuser')) . Form::getHidden('id_friend', 'id_friend', $_GET['id_friend']) . Form::openElementSpace() . Form::getTextarea($lang->def('_REQUEST_MESSAGE'), 'request', 'request') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('send', 'send', $lang->def('_SEND_REQUEST')) . Form::getButton('back_search', 'back_search', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content'); return; } $GLOBALS['page']->add(Form::openForm('', $url->getUrl('op=searchuser')) . Form::getOpenFieldset($lang->def('_SEARCH_USER')) . Form::getTextfield($lang->def('_SEARCH_USERNAME'), 'username', 'username', 255, importVar('username', false, '')) . Form::openButtonSpace() . Form::getButton('search', 'search', $lang->def('_SEARCH')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::getCloseFieldset() . Form::closeForm(), 'content'); if (isset($_POST['username'])) { $finded_user = $acl_man->getUser(false, $acl_man->absoluteId($_POST['username'])); if ($finded_user === false) { $GLOBALS['page']->add($lang->def('_NO_USER_FINDED'), 'content'); } else { require_once _base_ . '/lib/lib.user_profile.php'; if (getLogUserId() != $finded_user[ACL_INFO_IDST]) { $GLOBALS['page']->add('<p class="confirm_friend">' . '<a href="' . $url->getUrl('op=searchuser&id_friend=' . $finded_user[ACL_INFO_IDST] . '') . '">' . $lang->def('_ADD_TO_MY_FIREND') . '</a>' . '</p>', 'content'); } $profile = new UserProfile($finded_user[ACL_INFO_IDST]); $profile->init('profile', 'framework', 'modname=myfriends&op=searchuser', 'ap'); $GLOBALS['page']->add($profile->getUserInfo(), 'content'); } } $GLOBALS['page']->add('</div>', 'content'); }
function conference_startnewconf($url) { checkPerm('view'); $mod_perm = checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; $lang =& DoceboLanguage::createInstance('conference', 'lms'); if (isset($_POST['create_conf'])) { $conference = new Conference_Manager(); $start_date = Format::dateDb($_POST['start_date'], 'date'); $start_date = substr($start_date, 0, 10); $start_time = (strlen($_POST['start_time']['hour']) == 1 ? '0' : '') . $_POST['start_time']['hour'] . ':' . (strlen($_POST['start_time']['minute']) == 1 ? '0' : '') . $_POST['start_time']['minute'] . ':00'; $start_timestamp = fromDatetimeToTimestamp($start_date . ' ' . $start_time); $conference_name = trim($_POST["conference_name"]) ? trim($_POST["conference_name"]) : $lang->def('_VIDEOCONFERENCE'); $meetinghours = (int) $_POST["meetinghours"]; $end_timestamp = $start_timestamp + $meetinghours * 3600; $maxparticipants = (int) $_POST["maxparticipants"]; $idCourse = $_SESSION['idCourse']; $room_type = $_POST["room_type"]; if ($conference->can_create_room_limit(getLogUserId(), $idCourse, $room_type, $start_timestamp, $end_timestamp) && $conference->can_create_user_limit(getLogUserId(), $idCourse, $start_timestamp)) { $conference->insert_room($idCourse, getLogUserId(), $conference_name, $room_type, $start_timestamp, $end_timestamp, $meetinghours, $maxparticipants, isset($_POST['bookable']) ? 1 : 0, $start_date, (int) $_POST['start_time']['hour'], (int) $_POST['start_time']['minute']); Util::jump_to('index.php?modname=conference&op=list'); } else { $title_page = array('index.php?modname=conference&op=list' => $lang->def('_VIDEOCONFERENCE'), $lang->def('_CREATE')); $GLOBALS['page']->add(getTitleArea($title_page, 'conference', $lang->def('_VIDEOCONFERENCE')) . '<div class="std_block">' . '<span><strong>' . $lang->def('_NO_MORE_ROOM') . '</strong></span>' . '</div>', 'content'); return false; } } $start_time['hour'] = date('H'); $start_time['minute'] = date('i'); $start_date = importVar('start_date', false, date("Y-m-d H:i:s")); $conf_system = array(); //$conf_system[""]=""; $default = ""; $default_maxp = 30; if (Get::sett('code_teleskill')) { $conf_system["teleskill"] = "teleskill"; } if (Get::sett('dimdim_server') and Get::sett('dimdim_user') and Get::sett('dimdim_password')) { $conf_system["dimdim"] = "dimdim"; } if (Get::sett('bbb_server') and Get::sett('bbb_user') and Get::sett('bbb_salt') and Get::sett('bbb_password_moderator') and Get::sett('bbb_password_viewer')) { $conf_system["bbb"] = "Big Blue Button"; $default = "bbb"; $default_maxp = Get::sett('bbb_max_participant'); } YuiLib::load(); //addJs($GLOBALS['where_lms_relative'].'/modules/conference/', 'ajax_conference.js'); $GLOBALS['page']->add(getTitleArea($lang->def('_VIDEOCONFERENCE'), 'conference') . '<div class="std_block">', 'content'); $GLOBALS['page']->add(Form::openForm('create_conference', $url->getUrl('op=startnewconf')) . Form::openElementSpace() . Form::getTextfield($lang->def('_VIDEOCONFERENCE'), 'conference_name', 'conference_name', 255, importVar('conference_name')) . Form::getLineBox($lang->def('_CONFERENCE_SYSTEM'), Form::getInputDropdown('', 'room_type', 'room_type', $conf_system, $default, '')) . Form::getDatefield($lang->def('_START_DATE'), 'start_date', 'start_date', Format::date($start_date, 'date')) . Form::getLineBox($lang->def('_AT_HOUR'), Form::getInputDropdown('', 'start_time_hour', 'start_time[hour]', range(0, 23), importVar('start_time_hour', false, date("H")), '') . ' : ' . Form::getInputDropdown('', 'start_time_minute', 'start_time[minute]', range(0, 59), importVar('start_time_hour', false, date("i")), '')) . Form::getLineBox($lang->def('_MEETING_HOURS'), Form::getInputDropdown('', 'meetinghours', 'meetinghours', range(0, 5), importVar('meetinghours', false, 2), '')) . Form::getTextfield($lang->def('_MAX_PARTICIPANTS'), 'maxparticipants', 'maxparticipants', 6, importVar('maxparticipants', true, $default_maxp)), 'content'); if (Get::sett('use_dimdim_api') === 'on') { $GLOBALS['page']->add('<div id="dimdim_conf" style="' . ($default === 'dimdim' ? 'display:block;' : 'display:none;') . '">' . Form::getOpenFieldset(Lang::t('_DIMDIM_FEATURES', 'conference'), 'dimdim_features') . Form::getCheckbox(Lang::t('_SHOW_WAITING_AREA', 'conference'), 'lobbyEnabled', 'lobbyEnabled', '1') . Form::getCheckbox(Lang::t('_ENABLE_PRIVATE_CHAT', 'conference'), 'privateChatEnabled', 'privateChatEnabled', '1') . Form::getCheckbox(Lang::t('_ENABLE_PUBLIC_CHAT', 'conference'), 'publicChatEnabled', 'publicChatEnabled', '1') . Form::getCheckbox(Lang::t('_ENABLE_DESKTOP_SHARING', 'conference'), 'screenShareEnabled', 'screenShareEnabled', '1') . Form::getCheckbox(Lang::t('_ASSIGN_MIC_TO_ATTENDEES', 'conference'), 'autoAssignMikeOnJoin', 'autoAssignMikeOnJoin', '1') . Form::getCheckbox(Lang::t('_ENABLE_WHITEBOARD', 'conference'), 'whiteboardEnabled', 'whiteboardEnabled', '1') . Form::getCheckbox(Lang::t('_ENABLE_DOCUMENTS_SHARING', 'conference'), 'documentSharingEnabled', 'documentSharingEnabled', '1') . Form::getCheckbox(Lang::t('_ENABLE_RECORDING', 'conference'), 'recordingEnabled', 'recordingEnabled', '1') . Form::getCheckbox(Lang::t('_ENABLE_HANDS_FREE', 'conference'), 'autoHandsFreeOnAVLoad', 'autoHandsFreeOnAVLoad', '1') . Form::getCheckbox(Lang::t('_START_MAIL', 'conference'), 'joinEmailRequired', 'joinEmailRequired', '1') . '<script type="text/javascript">' . ' var room_type = YAHOO.util.Dom.get(\'room_type\');' . ' YAHOO.util.Event.addListener(room_type, \'change\', dimdimEvent);' . ' function dimdimEvent(e)' . ' {' . ' var room_type = YAHOO.util.Dom.get(\'room_type\');' . ' var dimdim_conf = YAHOO.util.Dom.get(\'dimdim_conf\');' . ' if(room_type.value == "dimdim")' . ' dimdim_conf.style.display = "block";' . ' else' . ' dimdim_conf.style.display = "none";' . ' }' . '</script>' . Form::getCloseFieldset() . '</div>', 'content'); } $GLOBALS['page']->add(Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('create_conf', 'create_conf', $lang->def('_CREATE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content'); }
function get_LO_filter() { //addCss('style_filterbox'); $back_url = $this->back_url; $jump_url = $this->jump_url; $next_url = $this->next_url; require_once _base_ . '/lib/lib.form.php'; require_once _lms_ . '/lib/lib.course.php'; $ref =& $_SESSION['report_tempdata']['columns_filter']; YuiLib::load(); Util::get_js(Get::rel_path('lms') . '/admin/modules/report/courses_filter.js', true, true); //back to columns category selection if (isset($_POST['undo_filter'])) { //go back at the previous step Util::jump_to($back_url); } //set $_POST data in $_SESSION['report_tempdata'] $selector = new Selector_Course(); if (isset($_POST['update_tempdata'])) { $selector->parseForState($_POST); $temp = array('all_courses' => $_POST['all_courses'] == 1 ? true : false, 'selected_courses' => $selector->getSelection(), 'lo_types' => isset($_POST['lo_types']) ? $_POST['lo_types'] : array(), 'lo_milestones' => isset($_POST['lo_milestones']) ? $_POST['lo_milestones'] : array(), 'showed_columns' => isset($_POST['cols']) ? $_POST['cols'] : array(), 'custom_fields' => array(), 'order_by' => Get::req('order_by', DOTY_STRING, 'userid'), 'order_dir' => Get::req('order_dir', DOTY_STRING, 'asc'), 'show_suspended' => Get::req('show_suspended', DOTY_INT, 0) > 0); foreach ($ref['custom_fields'] as $val) { $temp['custom_fields'][] = array('id' => $val['id'], 'label' => $val['label'], 'selected' => isset($_POST['custom'][$val['id']]) ? true : false); } $_SESSION['report_tempdata']['columns_filter'] = $temp; } else { //first loading of this page -> prepare $_SESSION data structure //if (isset($_SESSION['report_update']) /* && is equal to id_report */) break; //get users' custom fields require_once _adm_ . '/lib/lib.field.php'; $fman = new FieldList(); $fields = $fman->getFlatAllFields(); $custom = array(); foreach ($fields as $key => $val) { $custom[] = array('id' => $key, 'label' => $val, 'selected' => false); } if (!isset($_SESSION['report_tempdata']['columns_filter'])) { $_SESSION['report_tempdata']['columns_filter'] = array('all_courses' => false, 'selected_courses' => $selector->getSelection(), 'lo_types' => array(), 'lo_milestones' => array(), 'showed_columns' => array(), 'custom_fields' => $custom, 'order_by' => 'userid', 'order_dir' => 'asc', 'show_suspended' => 'show_suspended'); } } //filter setting done, go to next step if (isset($_POST['import_filter']) || isset($_POST['show_filter']) || isset($_POST['pre_filter'])) { $temp_url = $next_url; if (isset($_POST['pre_filter'])) { $temp_url .= '&show=1&nosave=1'; } if (isset($_POST['show_filter'])) { $temp_url .= '&show=1'; } Util::jump_to($temp_url); } cout(Form::getHidden('update_tempdata', 'update_tempdata', 1), 'content'); $lang = $this->lang; //box for direct course selection $selection =& $ref['selected_courses']; $selector->parseForState($_POST); $selector->resetSelection($selection); $temp = count($selection); $box = new ReportBox('course_selector'); $box->title = Lang::t('_REPORT_COURSE_SELECTION', 'report'); $box->description = false; $box->body .= '<div class="fc_filter_line filter_corr">'; $box->body .= '<input id="all_courses" name="all_courses" type="radio" value="1" ' . ($ref['all_courses'] ? 'checked="checked"' : '') . ' />'; $box->body .= ' <label for="all_courses">' . $lang->def('_ALL_COURSES') . '</label>'; $box->body .= ' <input id="sel_courses" name="all_courses" type="radio" value="0" ' . ($ref['all_courses'] ? '' : 'checked="checked"') . ' />'; $box->body .= ' <label for="sel_courses">' . $lang->def('_SEL_COURSES') . '</label>'; $box->body .= '</div>'; $box->body .= '<div id="selector_container"' . ($ref['all_courses'] ? ' style="display:none"' : '') . '>'; //$box->body .= Form::openElementSpace(); $box->body .= $selector->loadCourseSelector(true); //$box->body .= Form::closeElementSpace(); $box->body .= '<br /></div>'; $box->footer = $lang->def('_CURRENT_SELECTION') . ': <span id="csel_foot">' . ($ref['all_courses'] ? Lang::t('_ALL', 'standard') : ($temp != '' ? $temp : '0')) . '</span>'; //.'</div>'; cout($box->get(), 'content'); cout('<script type="text/javascript">courses_count=' . ($temp == '' ? '0' : $temp) . ';' . 'courses_all="' . Lang::t('_ALL', 'standard') . '";' . "\n" . 'YAHOO.util.Event.addListener(window, "load", courses_selector_init);</script>', 'page_head'); $box = new ReportBox('lo_selection'); $box->title = $lang->def('_SELECT_LO_OPTIONS'); //LO columns selection $lo_trans = $this->getLOTypesTranslations(); $box->body .= Form::getOpenFieldset(Lang::t('_RU_LO_TYPES', 'report'), 'lotypes_fieldset'); $res = sql_query("SELECT * FROM %lms_lo_types"); while ($row = mysql_fetch_assoc($res)) { $trans = isset($lo_trans[$row['objectType']]) ? $lo_trans[$row['objectType']] : ""; $box->body .= Form::getCheckBox($trans, 'lo_type_' . $row['objectType'], 'lo_types[' . $row['objectType'] . ']', $row['objectType'], in_array($row['objectType'], $ref['lo_types']) ? true : false); } $box->body .= Form::getCloseFieldset(); $box->body .= Form::getOpenFieldset($lang->def('_RU_LO_MILESTONES'), 'lomilestones_fieldset'); $box->body .= Form::getCheckBox($lang->def('_NONE'), 'lo_milestone_0', 'lo_milestones[]', _MILESTONE_NONE, in_array(_MILESTONE_NONE, $ref['lo_milestones']) ? true : false); $box->body .= Form::getCheckBox($lang->def('_START'), 'lo_milestone_1', 'lo_milestones[]', _MILESTONE_START, in_array(_MILESTONE_START, $ref['lo_milestones']) ? true : false); $box->body .= Form::getCheckBox($lang->def('_END'), 'lo_milestone_2', 'lo_milestones[]', _MILESTONE_END, in_array(_MILESTONE_END, $ref['lo_milestones']) ? true : false); $box->body .= Form::getCloseFieldset(); cout($box->get(), 'content'); function is_showed($which) { if (isset($_SESSION['report_tempdata']['columns_filter'])) { return in_array($which, $_SESSION['report_tempdata']['columns_filter']['showed_columns']); } else { return false; } } //box for columns selection $arr_fieldset = array('user' => '', 'course' => '', 'lo' => ''); $box = new ReportBox('columns_selection'); $box->title = $lang->def('_SELECT_THE_DATA_COL_NEEDED'); $box->description = false; //prepare fieldsets foreach ($this->LO_columns as $val) { if ($val['select']) { $line = Form::getCheckBox($val['label'], 'col_sel_' . $val['key'], 'cols[]', $val['key'], is_showed($val['key'])); switch ($val['group']) { case 'user': $arr_fieldset['user'] .= $line; break; case 'course': $arr_fieldset['course'] .= $line; break; case 'lo': $arr_fieldset['lo'] .= $line; break; } } else { if ($val['key'] == '_CUSTOM_FIELDS_') { //custom fields if (count($ref['custom_fields']) > 0) { foreach ($ref['custom_fields'] as $key => $val) { $arr_fieldset['user'] .= Form::getCheckBox($val['label'], 'col_custom_' . $val['id'], 'custom[' . $val['id'] . ']', $val['id'], $val['selected']); } } } } } //print fieldsets foreach ($arr_fieldset as $fid => $fieldset) { $ftitle = ''; switch ($fid) { case 'user': $ftitle = Lang::t('_USER_CUSTOM_FIELDS', 'report'); break; case 'course': $ftitle = Lang::t('_COURSE_FIELDS', 'report'); break; case 'lo': $ftitle = Lang::t('_LEARNING_OBJECTS', 'standard'); break; } $box->body .= Form::getOpenFieldset($ftitle, 'fieldset_' . $fid . '_fields'); $box->body .= $fieldset; $box->body .= Form::getCloseFieldset(); } cout($box->get(), 'content'); //other options $box = new ReportBox('other_options'); $box->title = Lang::t('_OTHER_OPTION', 'course'); $box->description = false; $sort_list = array('userid' => Lang::t('_USERID', 'standard'), 'firstname' => Lang::t('_FIRSTNAME', 'standard'), 'lastname' => Lang::t('_LASTNAME', 'standard'), 'email' => Lang::t('_EMAIL', 'standard'), 'course_code' => Lang::t('_COURSE_CODE', 'standard'), 'course_name' => Lang::t('_COURSE_NAME', 'standard'), 'object_title' => Lang::t('_LEARNING_OBJECTS', 'standard'), 'object_type' => Lang::t('_RU_LO_TYPES', 'report'), 'first_attempt' => Lang::t('_LO_COL_FIRSTATT', 'report'), 'last_attempt' => Lang::t('_LO_COL_LASTATT', 'report')); $dir_list = array('asc' => Lang::t('_ORD_ASC_TITLE', 'standard'), 'desc' => Lang::t('_ORD_DESC_TITLE', 'standard')); $sort_selected = array_key_exists($ref['order_by'], $sort_list) ? $ref['order_by'] : 'userid'; $dir_selected = array_key_exists($ref['order_dir'], $dir_list) ? $ref['order_dir'] : 'asc'; $sort_dir_dropdown = Form::getInputDropdown('', 'order_dir', 'order_dir', $dir_list, $dir_selected, ''); $box->body .= Form::getDropdown(Lang::t('_ORDER_BY', 'standard'), 'order_by', 'order_by', $sort_list, $sort_selected, $sort_dir_dropdown); $box->body .= Form::getCheckbox(Lang::t('_SHOW_SUSPENDED', 'organization_chart'), 'show_suspended', 'show_suspended', 1, (bool) $ref['show_suspended']); cout($box->get(), 'content'); }
function modCourseEdition() { checkPerm('mod'); require_once $GLOBALS['where_lms'] . '/lib/lib.course.php'; require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.tab.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.manmenu.php'; $lang =& DoceboLanguage::createInstance('course', 'lms'); $form = new Form(); $out =& $GLOBALS['page']; $out->setWorkingZone('content'); $course_status = array(CST_PREPARATION => $lang->def('_CST_PREPARATION'), CST_AVAILABLE => $lang->def('_CST_AVAILABLE'), CST_EFFECTIVE => $lang->def('_CST_CONFIRMED'), CST_CONCLUDED => $lang->def('_CST_CONCLUDED'), CST_CANCELLED => $lang->def('_CST_CANCELLED')); //type of edition $edition_type = array('elearning' => $lang->def('_COURSE_TYPE_ELEARNING'), 'blended' => $lang->def('_COURSE_TYPE_BLENDED'), 'classroom' => $lang->def('_CLASSROOM')); list($id_course_edition) = each($_POST['mod_course_edition']); $query_course_edition = "\r\n\tSELECT *\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course_edition\r\n\tWHERE idCourseEdition = '" . $id_course_edition . "'"; $course_edition = mysql_fetch_assoc(sql_query($query_course_edition)); // set page title $title_area = array('index.php?modname=course&op=course_list' => $lang->def('_COURSE'), $lang->def('_MOD') . ' : ' . $course_edition['name']); $date_begin = Format::date($course_edition['date_begin'], 'date'); $date_end = Format::date($course_edition['date_end'], 'date'); $out->add(getTitleArea($title_area, 'configuration') . '<div class="std_block">' . $form->openForm('upd_course', 'index.php?modname=course&op=upd_course', false, false, 'multipart/form-data') . $form->getHidden('mod_course_edition' . $id_course_edition, 'mod_course_edition[' . $id_course_edition . ']', $id_course_edition) . $form->getHidden("course_id", "course_id", $course_edition["idCourse"]) . $form->getHidden("old_date_begin", "old_date_begin", $course_edition['date_begin']) . $form->getHidden("old_date_end", "old_date_end", $course_edition['date_end'])); $out->add($form->openElementSpace() . $form->getTextfield($lang->def('_CODE'), 'course_edition_code', 'course_edition_code', '50', $course_edition['code']) . $form->getTextfield($lang->def('_COURSE_NAME'), 'course_edition_name', 'course_edition_name', '255', $course_edition['name']) . $form->getDropdown($lang->def('_STATUS'), 'course_edition_status', 'course_edition_status', $course_status, $course_edition['status']) . $form->getDropdown($lang->def('_COURSE_TYPE'), 'edition_type', 'edition_type', $edition_type, $course_edition['edition_type']) . $form->getTextarea($lang->def('_DESCRIPTION'), 'course_edition_descr', 'course_edition_descr', $course_edition['description'])); $out->add($form->getOpenFieldset($lang->def('_COURSE_SUBSCRIPTION')) . $form->getOpenCombo($lang->def('_USER_CAN_SUBSCRIBE')) . $form->getRadio($lang->def('_SUBSCRIPTION_CLOSED'), 'subscription_closed', 'can_subscribe', '0', $course_edition['can_subscribe'] == 0) . $form->getRadio($lang->def('_SUBSCRIPTION_OPEN'), 'subscription_open', 'can_subscribe', '1', $course_edition['can_subscribe'] == 1) . $form->getRadio($lang->def('_SUBSCRIPTION_IN_PERIOD') . ":", 'subscription_period', 'can_subscribe', '2', $course_edition['can_subscribe'] == 2) . $form->getCloseCombo() . $form->getDatefield($lang->def('_SUBSCRIPTION_DATE_BEGIN') . ":", 'sub_start_date', 'sub_start_date', Format::date($course_edition['sub_start_date'], "date")) . $form->getDatefield($lang->def('_SUBSCRIPTION_DATE_END') . ":", 'sub_end_date', 'sub_end_date', Format::date($course_edition['sub_end_date'], "date")) . $form->getCloseFieldset()); $out->add($form->getOpenFieldset($lang->def('_COURSE_SPECIAL_OPTION')) . $form->getTextfield($lang->def('_COURSE_PRIZE'), 'edition_price', 'edition_price', 11, $course_edition["price"]) . $form->getTextfield($lang->def('_COURSE_ADVANCE'), 'edition_advance', 'edition_advance', 11, $course_edition['advance']) . $form->getTextfield($lang->def('_MIN_NUM_SUBSCRIBE'), 'min_num_subscribe', 'min_num_subscribe', 11, $course_edition["min_num_subscribe"]) . $form->getTextfield($lang->def('_MAX_NUM_SUBSCRIBE'), 'max_num_subscribe', 'max_num_subscribe', 11, $course_edition["max_num_subscribe"]) . $form->getCheckbox($lang->def('_ALLOW_OVERBOOKING'), 'allow_overbooking', 'allow_overbooking', 1, $course_edition["allow_overbooking"]) . $form->getCloseFieldset()); $hours = array('-1' => '- -', '0' => '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'); $quarter = array('-1' => '- -', '00' => '00', '15' => '15', '30' => '30', '45' => '45'); if ($course_edition['hour_begin'] != '-1') { $hb_sel = (int) substr($course_edition['hour_begin'], 0, 2); $qb_sel = substr($course_edition['hour_begin'], 3, 2); } else { $hb_sel = $qb_sel = '-1'; } if ($course_edition['hour_end'] != '-1') { $he_sel = (int) substr($course_edition['hour_end'], 0, 2); $qe_sel = substr($course_edition['hour_end'], 3, 2); } else { $he_sel = $qe_sel = '-1'; } $out->add($form->getOpenFieldset($lang->def('_COURSE_TIME_OPTION')) . $form->getDatefield($lang->def('_DATE_BEGIN'), 'course_edition_date_begin', 'course_edition_date_begin', $date_begin) . $form->getDatefield($lang->def('_DATE_END'), 'course_edition_date_end', 'course_edition_date_end', $date_end) . $form->getLineBox('<label for="hour_begin_hour">' . $lang->def('_HOUR_BEGIN') . '</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, $qb_sel, '')) . $form->getLineBox('<label for="hour_end_hour">' . $lang->def('_HOUR_END') . '</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->getCloseFieldset()); $out->add($form->getOpenFieldset($lang->def('_DOCUMENT_UPLOAD')) . $form->getExtendedFilefield($lang->def('_USER_MATERIAL'), 'course_edition_material', 'course_edition_material', $course_edition["img_material"]) . $form->getExtendedFilefield($lang->def('_OTHER_USER_MATERIAL'), 'course_edition_othermaterial', 'course_edition_othermaterial', $course_edition["img_othermaterial"]) . $form->getCloseFieldset() . $form->closeElementSpace()); $out->add($form->openButtonSpace() . $form->getButton('course_edition_modify', 'course_edition_modify', $lang->def('_SAVE')) . $form->getButton('course_undo', 'course_undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm() . '</div>'); }
function editGroup($groupid = FALSE) { require_once _base_ . '/lib/lib.form.php'; if ($groupid === FALSE || $groupid === '') { $groupid = importVar('groupid', FALSE, ''); $groupLabel = importVar('groupid', FALSE, $this->lang->def('_DIRECTORY_NEWGROUP')); } else { $groupLabel = $groupid; } $description = ''; $idst = ''; $type = 'free'; $show_on_platform = array(); if ($groupid != '') { $arrGroup = $this->aclManager->getGroup(FALSE, $groupid); if ($arrGroup !== FALSE) { $idst = $arrGroup[0]; $description = $arrGroup[2]; $type = $arrGroup[4]; $show_on_platform = array_flip(explode(',', $arrGroup[5])); } } $all_group_type = array('free' => $this->lang->def('_DIRECTORY_GROUPTYPE_FREE'), 'moderate' => $this->lang->def('_DIRECTORY_GROUPTYPE_MODERATE'), 'private' => $this->lang->def('_DIRECTORY_GROUPTYPE_PRIVATE'), 'invisible' => $this->lang->def('_DIRECTORY_GROUPTYPE_INVISIBLE')); $GLOBALS['page']->add(getTitleArea($this->lang->def('_GROUPS') . ': ' . $groupLabel, 'directory_group'), 'content'); $GLOBALS['page']->add('<div class="std_block">', 'content'); $GLOBALS['page']->add(Form::getFormHeader($this->lang->def('_DEL')), 'content'); $GLOBALS['page']->add(Form::openForm('directoryeditgroup', 'index.php?modname=directory&op=listgroup'), 'content'); $GLOBALS['page']->add(Form::openElementSpace(), 'content'); $GLOBALS['page']->add(Form::getOpenFieldset($this->lang->def('_DEL') . ' - ' . $groupLabel), 'content'); $GLOBALS['page']->add(Form::getTextfield($this->lang->def('_DIRECTORY_GROUPID'), "groupid", "groupid", 50, $groupid), 'content'); $GLOBALS['page']->add(Form::getSimpleTextarea($this->lang->def('_DESCRIPTION'), "description", "description", $description), 'content'); $GLOBALS['page']->add(Form::getHidden('idst', 'idst', $idst), 'content'); $GLOBALS['page']->add(Form::getDropdown($this->lang->def('_DIRECTORY_GROUPTYPE'), 'group_type', 'group_type', $all_group_type, $type), 'content'); $GLOBALS['page']->add(Form::getCloseFieldset(), 'content'); $GLOBALS['page']->add(Form::getOpenFieldset($this->lang->def('_DIRECTORY_GROUP_VISIBLE')), 'content'); $plt_man = PlatformManager::createInstance(); $plt_list = $plt_man->getPlatformList(true); $GLOBALS['page']->add(Form::getHidden('show_on_platform_framework', 'show_on_platform[framework]', 1), 'content'); while (list($code, $name) = each($plt_list)) { $GLOBALS['page']->add(Form::getCheckbox($name, 'show_on_platform_' . $code, 'show_on_platform[' . $code . ']', 1, isset($show_on_platform[$code])), 'content'); } $GLOBALS['page']->add(Form::getCloseFieldset(), 'content'); $GLOBALS['page']->add(Form::closeElementSpace(), 'content'); $GLOBALS['page']->add(Form::openButtonSpace(), 'content'); $GLOBALS['page']->add(Form::getButton("editgroupsave", "editgroupsave", $this->lang->def('_SAVE')), 'content'); $GLOBALS['page']->add(Form::getButton("editgroupcancel", "editgroupcancel", $this->lang->def('_CANCEL')), 'content'); $GLOBALS['page']->add(Form::closeButtonSpace(), 'content'); $GLOBALS['page']->add(Form::closeForm(), 'content'); $GLOBALS['page']->add('</div>', 'content'); }
function printOut() { // addScriptaculousJs(); addJs($GLOBALS['where_lms_relative'] . '/modules/public_user_admin/', 'ajax.public_user_admin.js'); require_once _base_ . '/lib/lib.user_profile.php'; $profile = new UserProfile(getLogUserId()); $profile->init('profile', 'framework', 'modname=public_user_admin&op=org_chart', 'ap'); $profile->addStyleSheet('lms'); $GLOBALS['page']->add('<script type="text/javascript">' . ' setup_directory(\'' . $GLOBALS['where_lms_relative'] . '/modules/directory/ajax.public_user_admin.php\'); ' . '</script>', 'page_head'); $out = ''; if ($this->select_all) { // This is not a beautiful position for this operation but at this point // I'm sure that all filter was applied $rs_all = $this->data->getAllRowsIdst(); if ($rs_all !== FALSE) { $this->itemSelectedMulti = array(); while (list($all_idst) = sql_fetch_row($rs_all)) { $this->itemSelectedMulti[] = $all_idst; } } $this->itemSelected = $this->itemSelectedMulti; } require_once _base_ . '/lib/lib.form.php'; $ord = importVar('ord', false, 'trans'); $flip = importVar('flip', true, 0); $filter = new Form(); $out .= $filter->getOpenFieldset($this->lang->def('_SEARCH')); $out .= $filter->getHidden('ord', 'ord', $ord); $out .= $filter->getHidden('flip', 'flip', $flip); if ($this->lms_editions_filter === true) { if (isset($GLOBALS['course_descriptor']) && $GLOBALS['course_descriptor']->hasEdition()) { // add editions filter ============================================================ $ed_list = array(); if ($this->editions == false) { $this->editions = $GLOBALS['course_descriptor']->getEditionsSimpleList(getLogUserId(), true); } $sel = isset($_POST[$this->id]['edition_filter']) ? (int) $_POST[$this->id]['edition_filter'] : $GLOBALS['course_descriptor']->getActualEditionsForUser(getLogUserId()); if (!empty($this->editions)) { $out .= $filter->getDropdown($this->lang->def('_FILTER_BY_EDITION'), $this->id . '_edition_filter', $this->id . '[edition_filter]', $this->editions, $sel); } } } // end lms editions filter if ($this->show_simple_filter === TRUE) { // show simple filter ============================================================ $out .= $filter->getTextfield($this->lang->def('_SIMPLE_FILTER'), $this->id . '_simple_fulltext_search', $this->id . '[simple_fulltext_search]', 255, isset($_POST[$this->id]['simple_fulltext_search']) ? strip_tags(html_entity_decode($_POST[$this->id]['simple_fulltext_search'])) : '', strip_tags($this->lang->def('_SIMPLE_FILTER'))); $out .= '<div class="align_right">' . $filter->getButton($this->id . '_search', $this->id . '[search]', $this->lang->def('_SEARCH'), 'button_nowh') . '</div>'; } else { // show complex filter =========================================================== $out .= '<h2 id="customize_filter">' . $this->lang->def('_CUSTOMIZE_FILTERS') . '</h2>'; // --- print check box for flat mode if ($this->show_flat_mode_flag) { $out .= $filter->getCheckbox($this->lang->def('_DIRECTORY_FILTER_FLATMODE'), $this->id . '_flat_mode', $this->id . '[flat_mode]', 'flat_mode', $this->flat_mode, "onclick=\"window.document.forms['directory_org_chart'].submit();\""); } else { $out .= $filter->getHidden($this->id . '_flat_mode', $this->id . '[flat_mode]', $this->flat_mode ? 'flat_mode' : ''); } // line for add a field filter $out .= $filter->openFormLine(); foreach ($this->add_nat_fields as $nat_id => $nat_info) { $local_arr_fields_translation[$nat_id] = $this->lang->def('_DIRECTORY_FILTER_' . $nat_id); } $filter_to_show = $this->arr_fields_translation; if (is_array($this->arr_fields_filter)) { foreach ($this->arr_fields_filter as $filter_info) { if (isset($filter_info['fieldname'])) { unset($filter_to_show[$filter_info['fieldname']]); } else { unset($filter_to_show[$filter_info[0]]); } } } if (is_array($filter_to_show) && !empty($filter_to_show)) { $out .= $filter->getInputDropdown('new_filter', $this->id . '_add_field_filter', $this->id . '[add_field_filter]', $filter_to_show, '', ''); $out .= $filter->getButton($this->id . '_add_filter', $this->id . '[add_filter]', $this->lang->def('_NEW_FILTER'), 'button_nowh'); } $out .= $filter->getButton($this->id . '_del_filter', $this->id . '[del_filter]', $this->lang->def('_RESET'), 'button_nowh'); $out .= $filter->closeFormLine(); if (is_array($this->arr_fields_filter)) { foreach ($this->arr_fields_filter as $field_id => $field_prop) { if (!isset($field_prop['fieldname'])) { // custom field $arr_field_info = $this->field_list->getBaseFieldInfo($field_prop[FIELD_INFO_TYPE]); require_once $GLOBALS['where_framework'] . '/modules/field/' . $arr_field_info[FIELD_BASEINFO_FILE]; $field_obj = new $arr_field_info[FIELD_BASEINFO_CLASS]($field_id); $del_spot = '<input type="image" class="cancel_filter" ' . ' src="' . getPathImage('framework') . 'standard/cancel.png"' . ' id="' . $this->id . '_del_filter_' . $field_id . '"' . ' name="' . $this->id . '[del_filter][' . $field_id . ']"' . ' title="' . $this->lang->def('_DEL') . '"' . ' alt="' . $this->lang->def('_DEL') . '" />'; $out .= $field_obj->play_filter($field_id, isset($field_prop['value']) ? $field_prop['value'] : false, $field_prop[FIELD_INFO_TRANSLATION], $this->id, $del_spot, '', $field_prop[FIELD_INFO_ID]); //play_filter( $id_field, $value = FALSE, $label = FALSE, $field_prefix = FALSE, $other_after = '', $other_before = '', $field_special = FALSE ) } else { // base field $arr_field_info = $this->field_list->getBaseFieldInfo($field_prop['field_type']); require_once $GLOBALS['where_framework'] . '/modules/field/' . $arr_field_info[FIELD_BASEINFO_FILE]; $field_obj = new $arr_field_info[FIELD_BASEINFO_CLASS](0); $del_spot = '<input type="image" class="cancel_filter" ' . ' src="' . getPathImage('framework') . 'standard/cancel.png"' . ' id="' . $this->id . '_del_filter_' . $field_id . '"' . ' name="' . $this->id . '[del_filter][' . $field_id . ']"' . ' title="' . $this->lang->def('_DEL') . '"' . ' alt="' . $this->lang->def('_DEL') . '" />'; $out .= $field_obj->play_filter($field_id, isset($field_prop['value']) ? $field_prop['value'] : false, $this->lang->def('_DIRECTORY_FILTER_' . $field_prop['fieldname']), $this->id, $del_spot, '', ''); } } } $out .= $filter->openButtonSpace(); $out .= $filter->getButton('search', 'search', $this->lang->def('_SEARCH')); $out .= $filter->closeButtonSpace(); } // end else for filter $out .= $filter->getCloseFieldset(); // --------------------------------------------------------------------------------------- // set order rows if (is_array($this->arr_fields_order)) { foreach ($this->arr_fields_order as $ordFieldName => $isDesc) { $this->data->setOrderCol($ordFieldName, $isDesc); } } $this->getRows($this->_getStartRow(), $this->_getRowsPage()); $totRow = $this->getTotalRows(); if ($totRow == -1) { $totRow = $this->getLoadedRows(); } $colInfo = $this->_getCols(); $colData = $colInfo; $this->rend->setCaption($this->_getTitle()); $type_h = array(); $cont_h = array(); while (list($key, $contentCell) = each($colInfo)) { if ($contentCell['toDisplay']) { $type_h[] = $contentCell['hClass']; $cont_h[] = $contentCell['hLabel']; } } reset($colInfo); $this->rend->addHead($cont_h, $type_h); while ($values = $this->fetchRecord()) { $colData = array(); foreach ($colInfo as $key => $fieldInfo) { $colData[] = $values[$colInfo[$key]['data']]; } $this->rend->addBody($colData, false, false, 'user_row_' . $values['idst']); if ($this->_expand_user == $values['idst']) { // extra user info if requested $this->rend->addBodyExpanded($this->userExtraData($this->_expand_user), 'user_more_info'); } } if ($this->insNew) { $this->rend->addActionAdd('<input type="submit" class="transparent_add_button"' . ' id="' . $this->id . '_' . $this->_getOpCreateItemId() . '" ' . ' name="' . $this->id . '[' . $this->_getOpCreateItemId() . '][0]" ' . ' value="' . $this->lang->def('_ADD') . '"' . ' title="' . $this->_getCreateLabel() . '" ' . ' alt="' . $this->_getCreateAlt() . '" />'); } $this->rend->initNavBar($this->_getIdInitRowId(), 'button'); $out .= $this->rend->getTable() . $this->rend->getNavBar($this->_getStartRow(), $totRow) . $this->printState(); // --------------------------------------------------------------------------------------- if ($this->select_all) { $arr_notPrint = array_diff($this->itemSelectedMulti, $this->printedItems); foreach ($arr_notPrint as $id_notPrint) { $out .= '<input type="checkbox" ' . ' id="' . DIRECTORY_ID . DIRECTORY_OP_SELECTITEM . '_' . $id_notPrint . '" ' . 'name="' . DIRECTORY_ID . '[' . DIRECTORY_OP_SELECTITEM . '][' . $id_notPrint . ']" ' . 'value="" checked="checked" style="display:none;" />'; } } return $out; }
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&op=modtestgui&idTest=' . $idTest . '&back_url=' . $url_coded, $lang->def('_BACK')) . Form::openForm('defpoint', 'index.php?modname=test&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&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&op=modtestgui&idTest=' . $idTest . '&back_url=' . $url_coded, $lang->def('_BACK')) . '</div>', 'content'); }
function getShowOnPlatformFieldset($show_on_platform = FALSE) { $res = ""; if ($this->canSelectPlatform()) { if ($show_on_platform === FALSE) { $show_on_platform = $this->getShowOnPlatformDefaultArr(); } $plt_man =& PlatformManager::createInstance(); $plt_list = $plt_man->getPlatformList(true); $res .= Form::getOpenFieldset(Lang::t('_SHOW_ON_PLATFORM', 'field')); $res .= Form::getHidden('show_on_platform_framework', 'show_on_platform[framework]', 1); while (list($code, $name) = each($plt_list)) { $sel = isset($show_on_platform[$code]) ? TRUE : FALSE; $res .= Form::getCheckbox($name, 'show_on_platform_' . $code, 'show_on_platform[' . $code . ']', 1, $sel); } $res .= Form::getCloseFieldset(); } else { $res .= Form::getHidden('show_on_platform_framework', 'show_on_platform[framework]', 1); foreach ($this->getShowOnPlatformDefaultArr() as $code) { $res .= Form::getHidden('show_on_platform_' . $code, 'show_on_platform[' . $code . ']', 1); } } return $res; }
function group() { checkPerm('view'); require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.navbar.php'; require_once _base_ . '/lib/lib.table.php'; $lang =& DoceboLanguage::createInstance('standard', 'lms'); $field_search = importVar('field_search'); $search = isset($_POST['search']) && $_POST['search'] != '' ? $_POST['search'] : false; if (isset($_POST['clear'])) { $search = false; } $acl_man =& Docebo::user()->getAclManager(); $acl =& Docebo::user()->getAcl(); $groups =& $acl_man->getAllGroupsId(array('free', 'moderate', 'private'), $search); $user_group_wait =& $acl_man->getPendingGroupOfUser(getLogUserId()); $hidden_group = array(); if (!isset($_POST['working'])) { $user_group = $acl->getSTGroupsST(getLogUserId()); $user_group = array_flip($user_group); } else { if (isset($_POST['group_sel'])) { $user_group = $_POST['group_sel']; $hidden_group = array_diff($user_group, $groups); } else { $user_group = array(); } } $GLOBALS['page']->add(getTitleArea($lang->def('_MYGROUP'), 'mygroup') . '<div class="std_block">' . Form::openForm('group_subscription', 'index.php?modname=mygroup&op=group') . Form::getHidden('working', 'working', 1) . Form::getOpenFieldset($lang->def('_FILTER')) . Form::getTextfield($lang->def('_SEARCH_ARG'), 'search', 'search', '255', isset($_POST['search']) && !isset($_POST['clear']) ? $_POST['search'] : '') . Form::openButtonSpace() . Form::getButton('search_button', 'search_button', $lang->def('_SEARCH')) . ($search ? Form::getButton('clear', 'clear', $lang->def('_CLEAR')) : '') . Form::closeButtonSpace() . Form::getCloseFieldset() . Form::closeForm(), 'content'); if (is_array($hidden_group)) { while (list(, $id) = each($hidden_group)) { $GLOBALS['page']->add(Form::getHidden('group_sel_' . $id, 'group_sel[' . $id . ']', $id), 'content'); } } if (!empty($groups)) { $tb = new Table(0, $lang->def('_MYGROUP_CAPTION'), $lang->def('_MYGROUP_SUMMARY')); $type_h = array('image', 'nowrap', ''); $cont_h = array('<span class="access-only">' . $lang->def('_SUBSCRIBE') . '</span>', $lang->def('_NAME'), $lang->def('_DESCRIPTION')); $tb->setColsStyle($type_h); $tb->addHead($cont_h); while (list($id, $info) = each($groups)) { echo $id; $cont = array(); if (isset($user_group[$id])) { $cont[] = Form::getInputCheckbox('group_sel_' . $id, 'group_sel[' . $id . ']', $id, isset($user_group[$id]), ''); $cont[] = $info['type_ico'] . ' ' . $info['groupid'] . '</label>'; $cont[] = $info['description']; } elseif (isset($user_group_wait[$id])) { $cont[] = '<img src="' . getPathImage() . 'standard/userwait.gif" alt="' . $lang->def('_WAITING') . '" />'; $cont[] = '<label for="group_sel_' . $id . '">' . $info['type_ico'] . ' ' . $info['groupid'] . '</label>'; $cont[] = $info['description']; } elseif ($info['type'] != 'private' && $info['type'] != 'invisible') { $cont[] = Form::getInputCheckbox('group_sel_' . $id, 'group_sel[' . $id . ']', $id, isset($user_group[$id]), ''); $cont[] = '<label for="group_sel_' . $id . '">' . $info['type_ico'] . ' ' . $info['groupid'] . '</label>'; $cont[] = $info['description']; } $tb->addBody($cont); } $GLOBALS['page']->add(Form::openForm('group_subscription_sec', 'index.php?modname=mygroup&op=savesel') . Form::getHidden('search_hidden', 'search', '255', $search) . $tb->getTable() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm(), 'content'); } $GLOBALS['page']->add('</div>', 'content'); }
function play($object_faq, $id_param) { !checkPerm('view', true, 'organization') && !checkPerm('view', true, 'storage'); require_once _base_ . '/lib/lib.form.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.param.php'; $lang =& DoceboLanguage::createInstance('faq'); $idCategory = $object_faq->getId(); $mode = importVar('mode', false, 'faq'); $back_coded = htmlentities(urlencode($object_faq->back_url)); $search = importVar('search'); if (isset($_POST['empty'])) { $search = ''; } $idReference = getLOParam($id_param, 'idReference'); $link = 'index.php?modname=faq&op=play&idCategory=' . $idCategory . '&id_param=' . $id_param . '&back_url=' . $back_coded; // NOTE: Track only if $idReference is present if ($idReference !== FALSE) { require_once $GLOBALS['where_lms'] . '/class.module/track.faq.php'; list($exist, $idTrack) = Track_Faq::getIdTrack($idReference, getLogUserId(), $idCategory, TRUE); if ($exist) { $ti = new Track_Faq($idTrack); $ti->setDate(date('Y-m-d H:i:s')); $ti->status = 'completed'; $ti->update(); } else { $ti = new Track_Faq(false); $ti->createTrack($idReference, $idTrack, getLogUserId(), date('Y-m-d H:i:s'), 'completed', 'faq'); } } list($title) = sql_fetch_row(sql_query("\r\n\tSELECT title \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_faq_cat \r\n\tWHERE idCategory = '" . (int) $idCategory . "'")); //$GLOBALS['page']->add('<div id="top" class="std_block">', 'content'); cout('<div class="yui-navset yui-navset-top tab_block"> <ul class="yui-nav"> <li class="first' . ($mode == 'faq' ? ' selected' : '') . '"> <a href="' . $link . '&mode=faq"> <em>' . Lang::t('_SWITCH_TO_FAQ', 'faq') . '</em> </a> </li> <li' . ($mode == 'help' ? ' class="selected"' : '') . '> <a href="' . $link . '&mode=help"> <em>' . Lang::t('_SWITCH_TO_HELP', 'faq') . '</em> </a> </li> </ul> <div class="yui-content">', 'content'); $GLOBALS['page']->add(getBackUi(Util::str_replace_once('&', '&', $object_faq->back_url), $lang->def('_BACK'))); $GLOBALS['page']->add('<b>' . $lang->def('_TITLE') . ' : ' . $title . '</b><br />' . '<br />', 'content'); if ($mode == 'help') { $link .= '&mode=help'; $letter = importVar('letter', true, ''); $search = urldecode(importVar('search')); // Display as help $textQuery = "\r\n\t\tSELECT keyword \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_faq \r\n\t\tWHERE idCategory = '" . importVar('idCategory', true) . "'"; if ($search != '' && !isset($_POST['empty'])) { $textQuery .= " AND ( question LIKE '%" . $search . "%' OR answer LIKE '%" . $search . "%' ) "; } $result = sql_query($textQuery); $GLOBALS['page']->add(Form::openForm('glossary_play', 'index.php?modname=faq&op=play') . Form::getOpenFieldset($lang->def('_FILTER')) . Form::getHidden('idCategory', 'idCategory', $idCategory) . Form::getHidden('id_param', 'id_param', $id_param) . Form::getHidden('back_url', 'back_url', $back_coded) . Form::getHidden('mode', 'mode', $mode) . Form::getTextfield($lang->def('_SEARCH'), 'search', 'search', 255, $search != '' && !isset($_POST['empty']) ? $search : ''), 'content'); $GLOBALS['page']->add('[ ', 'content'); //letter selection for ($i = 97; $i < 123; $i++) { if ($letter == $i) { $GLOBALS['page']->add('<span class="text_bold">(', 'content'); } $GLOBALS['page']->add('<a href="' . $link . '&letter=' . $i . '">' . chr($i) . '</a>', 'content'); if ($letter == $i) { $GLOBALS['page']->add(')</span>', 'content'); } if ($i < 122) { $GLOBALS['page']->add('-', 'content'); } } $GLOBALS['page']->add(' ] [ ', 'content'); for ($i = 48; $i < 58; $i++) { if ($letter == $i) { $GLOBALS['page']->add('<span class="text_bold">(', 'content'); } $GLOBALS['page']->add('<a href="' . $link . '&letter=' . $i . '">' . chr($i) . '</a>', 'content'); if ($letter == $i) { $GLOBALS['page']->add(')</span>', 'content'); } if ($i < 57) { $GLOBALS['page']->add('-', 'content'); } } $GLOBALS['page']->add(' ] ', 'content'); $GLOBALS['page']->add(Form::getBreakRow() . Form::openButtonSpace() . Form::getButton('do_search', 'do_search', $lang->def('_SEARCH')) . Form::getButton('empty', 'empty', $lang->def('_RESET')) . Form::closeButtonSpace() . Form::getCloseFieldset() . Form::closeForm(), 'content'); //analyze keyword $keyword_help = array(); while (list($keyword) = sql_fetch_row($result)) { $keyword_split = explode(',', $keyword); if (is_array($keyword_split)) { while (list(, $value) = each($keyword_split)) { $value = trim($value); if ($value != '') { if ($letter == 0) { if (isset($keyword_help[$value])) { ++$keyword_help[$value]; } else { $keyword_help[$value] = 1; } } elseif (substr($value, 0, 1) == chr($letter)) { if (isset($keyword_help[$value])) { ++$keyword_help[$value]; } else { $keyword_help[$value] = 1; } } } } } } ksort($keyword_help); reset($keyword_help); $GLOBALS['page']->add('<div class="yui-gf">' . '<div class="yui-u first" >' . '<div class="boxinfo_title">' . $lang->def('_TERM') . '</div>' . '<div class="boxinfo_container">' . '<ul class="link_list">', 'content'); while (list($key, $value) = each($keyword_help)) { $GLOBALS['page']->add('<li><a class="href_block" href="' . $link . '&letter=' . $letter . '&search=' . urlencode($search) . '&word=' . $key . '">' . $key . ' (' . $value . ')</a></li>', 'content'); } $GLOBALS['page']->add('</ul>' . '</div></div>' . '<div class="yui-u">', 'content'); if (isset($_GET['word'])) { $reDef = sql_query("\r\n\t\t\tSELECT title, answer \r\n\t\t\tFROM " . $GLOBALS['prefix_lms'] . "_faq \r\n\t\t\tWHERE keyword LIKE '%" . $_GET['word'] . "%' AND idCategory = '" . (int) $_GET['idCategory'] . "'\r\n\t\t\tORDER BY title"); while (list($title, $answer) = sql_fetch_row($reDef)) { $GLOBALS['page']->add('<div class="boxinfo_title">' . $title . '</div>' . '<div class="boxinfo_container">' . ($search == '' ? $answer : eregi_replace($search, '<span class="highlight">' . $search . '</span>', $answer)) . '</div><br />', 'content'); } } $GLOBALS['page']->add('</div>' . '<div class="nofloat"></div>' . '</div>', 'content'); } else { // Display as faq $textQuery = "\r\n\t\tSELECT question, answer \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_faq \r\n\t\tWHERE idCategory = '" . (int) $idCategory . "' " . (isset($_POST['search']) && !isset($_POST['empty']) ? " AND ( question LIKE '%" . $search . "%' OR answer LIKE '%" . $search . "%' ) " : '') . "ORDER BY sequence"; $result = sql_query($textQuery); $GLOBALS['page']->add(Form::openForm('glossary_play', 'index.php?modname=faq&op=play') . Form::getOpenFieldset($lang->def('_FILTER')) . Form::getHidden('idCategory', 'idCategory', $idCategory) . Form::getHidden('id_param', 'id_param', $id_param) . Form::getHidden('back_url', 'back_url', $back_coded) . Form::getTextfield($lang->def('_SEARCH'), 'search', 'search', 255, $search != '' && !isset($_POST['empty']) ? $search : '') . Form::getBreakRow() . Form::openButtonSpace() . Form::getButton('do_search', 'do_search', $lang->def('_SEARCH')) . Form::getButton('empty', 'empty', $lang->def('_RESET')) . Form::closeButtonSpace() . Form::getCloseFieldset() . Form::closeForm(), 'content'); while (list($question, $answer) = sql_fetch_row($result)) { $GLOBALS['page']->add('<div class="boxinfo_title">' . ($search == '' ? $question : eregi_replace($search, '<span class="highlight">' . $search . '</span>', $question)) . '</div>' . '<div class="boxinfo_container">' . ($search == '' ? $answer : eregi_replace($search, '<span class="highlight">' . $search . '</span>', $answer)) . '</div><br />', 'content'); } } $GLOBALS['page']->add('<div class="align_center">' . '<a href="#top">' . '<img src="' . getPathImage() . 'standard/upcheck.gif" title="' . $lang->def('_BACKTOTOP') . '" />' . $lang->def('_BACKTOTOP') . '</a>' . getBackUi(Util::str_replace_once('&', '&', $object_faq->back_url), $lang->def('_BACK')), 'content'); cout('<div class="nofloat"></div> </div><!-- yui content --> </div></div>', 'content'); }
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&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'); }
/** * return html for the login mask * * |-form_login_ext--------------------------------| * | |-form_login----------------------------| | * | | ______________ | | * | | |_login_userid_| _LOG_USENAME | | * | | ______________ | | * | | |_login_pwd____| _PASSWORD | | * | | ______________ | | * | | |_login_lang_|v| _LOG_LANG | | * | | | | * | | $advice | | * | | ______________ | | * | | |_login_button_|| | * | |---------------------------------------| | * |-----------------------------------------------| * * @param string $platform the platoform of which you want the login * @param string $advice the text of an advice to dispaly * @param string $extra wathever you want to display * @param bool $disable disable the field * @param bool $jump_url the url for the link * * @return string the html code for the login mask */ function getLoginMask($platform, $advice = false, $extra = false, $disable = false, $register_type = 'no', $jump_url = '') { require_once _base_ . '/lib/lib.form.php'; $lang = DoceboLanguage::createInstance('login', $platform); if (!isset($GLOBALS['login_tabindex'])) { $GLOBALS['login_tabindex'] = 1; } $all_languages = Docebo::langManager()->getAllLangCode(); $all_languages = array_merge(array('default' => $lang->def('_LANGUAGE')), $all_languages); if ($this->_style_to_use != false) { $GLOBALS['page']->addStart('<link href="' . $this->_style_to_use . '" rel="stylesheet" type="text/css" />' . "\n", 'page_head'); } $out = '<div class="form_login_ext">' . '<div class="form_login">'; if (!$disable) { if (isset($GLOBALS['page'])) { $GLOBALS['page']->add('<li><a href="#fieldset_login">' . $lang->def('_JUMP_TO_LOGIN') . '</a></li>', 'blind_navigation'); } $out .= Form::getOpenFieldset($lang->def('_LOGIN_LEGEND'), 'fieldset_login', 'fieldset_login') . Form::getTextfield($lang->def('_USERNAME'), 'login_userid', 'login_userid', 255, '') . Form::getPassword($lang->def('_PASSWORD'), 'login_pwd', 'login_pwd', 255); if ($this->_show_language_selection === true) { $out .= Form::getDropdown($lang->def('_LANGUAGE'), 'login_lang', 'login_lang', $all_languages, 'default'); } $out .= Form::getCloseFieldset(); $out .= '<div class="form_elem_button">' . Form::getButton('login_button', 'login_button', $lang->def('_LOGIN'), 'yui-button', ' tabindex="' . $GLOBALS['login_tabindex']++ . '"'); if ($this->_show_accessibility_button === true) { if (Get::sett('accessibility') == 'on') { $out .= '<br />' . Form::getButton('login_button_access', 'login_button_access', $lang->def('_LOGIN_ACCESSIBILITY'), 'log_button_access', ' tabindex="' . $GLOBALS['login_tabindex']++ . '"'); } } $out .= '</div>' . "\n"; } if ($advice != '') { $out .= '<p class="log_advice">' . $advice . '</p>'; } if ($extra != false) { $out .= '<p class="' . $extra['style'] . '">' . $extra['content'] . '</p>'; } $out .= '<p class="log_action">'; if ($register_type == "self" || $register_type == "moderate") { switch ($this->_register_type) { case "link": if (Get::sett('register_with_code') == 'on') { $out .= '<a href="' . $this->_register_info . '">' . $lang->def('_LOG_REGISTER_WITH_CODE') . '</a>'; } else { $out .= '<a href="' . $this->_register_info . '">' . $lang->def('_REGISTER') . '</a>'; } break; case "button": if (Get::sett('register_with_code') == 'on') { $out .= Form::getButton('register_button', $this->_register_info, $lang->def('_LOG_REGISTER_WITH_CODE'), 'button_as_link'); } else { $out .= Form::getButton('register_button', $this->_register_info, $lang->def('_REGISTER'), 'button_as_link'); } break; } } if ($this->_register_type != '' && $this->_lostpwd_type != '') { $out .= ' | '; } switch ($this->_lostpwd_type) { case "link": $out .= '<a href="' . $this->_lostpwd_info . '">' . $lang->def('_LOG_LOSTPWD', 'login') . '</a>'; break; case "button": $out .= Form::getButton('lostwd_button', $this->_lostpwd_info, $lang->def('_LOG_LOSTPWD'), 'button_as_link'); break; } $out .= '</p>'; $out .= '</div>' . '</div>'; return $out; }
function field_list() { checkPerm('view'); require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.table.php'; //require_once(_i18n_.'/lib.lang.php'); $back_coded = htmlentities(urlencode('index.php?modname=field_manager&op=field_list')); $std_lang =& DoceboLanguage::createInstance('standard', 'framework'); $lang =& DoceboLanguage::createInstance('field', 'framework'); $out =& $GLOBALS['page']; $filter = new Form(); //find available field type $re_field = sql_query("\r\n\tSELECT type_field FROM " . $GLOBALS['prefix_fw'] . "_field_type ORDER BY type_field"); $field_av = array(); $field_select = array('all_field' => $lang->def('_ALL_FIELD_TYPE')); while (list($type_field) = sql_fetch_row($re_field)) { $field_av[] = $type_field; $field_select[] = $lang->def('_' . strtoupper($type_field)); } $out->setWorkingZone('content'); $out->add(getTitleArea($lang->def('_FIELD_MANAGER'), 'field_manager')); $out->add('<div class="std_block">'); //catch possible operation result if (isset($_GET['result'])) { if ($_GET['result'] == 'success') { $out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL'))); } if ($_GET['result'] == 'fail') { $out->add(getErrorUi($lang->def('_OPERATION_FAILURE'))); } } $ord = importVar('ord', false, 'trans'); $flip = importVar('flip', true, 0); //filter------------------------------------------------------------ $filter_type_field = importVar('filter_type_field', false, 'all_field'); $filter_name_field = importVar('filter_name_field', false, $lang->def('_SEARCH')); $out->add($filter->openForm('field_filter', 'index.php?modname=field_manager&op=field_list') . $filter->getOpenFieldset($lang->def('_SEARCH')) . $filter->getHidden('ord', 'ord', $ord) . $filter->getHidden('flip', 'flip', $flip) . $filter->getDropdown($lang->def('_FIELD_TYPE'), 'filter_type_field', 'filter_type_field', $field_select, $filter_type_field) . $filter->getTextfield($lang->def('_NAME'), 'filter_name_field', 'filter_name_field', '255', $filter_name_field) . $filter->openButtonSpace() . $filter->getButton('search', 'search', $std_lang->def('_SEARCH')) . $filter->closeButtonSpace() . $filter->getCloseFieldset() . $filter->closeForm()); //display inserted field-------------------------------------------- $tb_field = new Table(Get::sett('visuItem')); $query_field_display = "\r\n\tSELECT id_common, type_field, translation\r\n\tFROM " . $GLOBALS['prefix_fw'] . "_field\r\n\tWHERE lang_code = '" . getLanguage() . "'\r\n\t\t" . (isset($_POST['filter_type_field']) && $_POST['filter_type_field'] != 'all_field' ? " AND type_field = '" . $field_av[$_POST['filter_type_field']] . "' " : "") . "\r\n\t\t" . (isset($_POST['filter_name_field']) && $_POST['filter_name_field'] != $lang->def('_SEARCH') ? " AND translation LIKE '%" . $filter_name_field . "%'" : "") . "\r\n\tORDER BY sequence"; $re_field_display = sql_query($query_field_display); $all_fields = mysql_num_rows($re_field_display); $img_up = '<img class="valing-middle" src="' . getPathImage() . 'standard/up.png" alt="' . $std_lang->def('_MOVE_UP') . '" />'; $img_down = '<img class="valing-middle" src="' . getPathImage() . 'standard/down.png" alt="' . $std_lang->def('_MOVE_DOWN') . '" />'; $content_h = array('<a href="index.php?modname=field_manager&op=field_list">' . $lang->def('_FIELD_NAME') . '</a>', '<a href="index.php?modname=field_manager&op=field_list">' . $lang->def('_FIELD_TYPE') . '</a>'); $type_h = array('', 'align_center'); $mod_perm = checkPerm('mod', true); $del_perm = checkPerm('del', true); if ($mod_perm) { $content_h[] = $img_down; $content_h[] = $img_up; $content_h[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $std_lang->def('_MOD') . '" />'; $type_h[] = 'image'; $type_h[] = 'image'; $type_h[] = 'image'; } if ($del_perm) { $content_h[] = '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $std_lang->def('_DEL') . '" />'; $type_h[] = 'image'; } $tb_field->setColsStyle($type_h); $tb_field->addHead($content_h); $lat_type = 'textfield'; $i = 1; while (list($id_common, $type_field, $translation) = sql_fetch_row($re_field_display)) { $cont = array($translation, $lang->def('_' . strtoupper($type_field))); if ($mod_perm) { if ($i != $all_fields) { $cont[] = '<a href="index.php?modname=field_manager&op=movedown&type_field=' . $type_field . '&id_common=' . $id_common . '&back=' . $back_coded . '"' . ' title="' . $lang->def('_MOVE_DOWN') . '">' . $img_down . '</a>'; } else { $cont[] = ''; } if ($i != 1) { $cont[] = '<a href="index.php?modname=field_manager&op=moveup&type_field=' . $type_field . '&id_common=' . $id_common . '&back=' . $back_coded . '"' . ' title="' . $lang->def('_MOVE_UP') . '">' . $img_up . '</a>'; } else { $cont[] = ''; } $cont[] = '<a href="index.php?modname=field&op=manage&fo=edit&type_field=' . $type_field . '&id_common=' . $id_common . '&back=' . $back_coded . '"' . ' title="' . $lang->def('_MOD') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $std_lang->def('_MOD') . '" /></a>'; } if ($del_perm) { /* $cont[] = '<a href="index.php?modname=field_manager&op=field_del&id_common='.$id_common.'"' .' title="'.$lang->def('_DEL').'">' .'<img src="'.getPathImage().'standard/delete.png" alt="'.$std_lang->def('_DEL').'" /></a>'; */ $cont[] = '<a href="index.php?modname=field&op=manage&fo=del&type_field=' . $type_field . '&id_common=' . $id_common . '&back=index.php%3Fmodname%3Dfield_manager%26op%3Dfield_list"' . ' title="' . $lang->def('_DEL') . ' : ' . $translation . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $std_lang->def('_DEL') . '" /></a>'; } $tb_field->addBody($cont); $lat_type = $type_field; $i++; } $create_form = new Form(); $select = ''; foreach ($field_av as $k => $type_field) { $select .= '<option value="' . $type_field . '"' . ($type_field == $lat_type ? ' selected="selected"' : '') . '>' . $lang->def('_' . strtoupper($type_field)) . '</option>'; } if ($del_perm) { require_once _base_ . '/lib/lib.dialog.php'; setupHrefDialogBox('a[href*=fo=del]'); } //add form---------------------------------------------------------- if (checkPerm('add', true)) { $tb_field->addActionAdd($create_form->openForm('field_add', 'index.php?modname=field&op=manage&fo=create') . $create_form->getHidden('back', 'back', $back_coded) . '<label for="type_field">' . '<img class="valing-middle" src="' . getPathImage() . 'standard/add.png" alt="' . $std_lang->def('_ADD') . '" />' . ' ' . $lang->def('_ADD_NEW_FIELD') . '</label> ' . '<select id="type_field" name="type_field">' . $select . '</select> ' . $filter->getButton('new_field', 'new_field', $std_lang->def('_CREATE'), 'button_nowh') . $filter->closeForm()); } $out->add($tb_field->getTable()); $out->add('<a href="index.php?modname=field_manager&op=fixsequence&back=' . $back_coded . '"' . ' title="' . $lang->def('_FIX_SEQUENCE') . '">' . $lang->def('_FIX_SEQUENCE') . '</a>'); $out->add('</div>'); }
function get_course_val_filter() { $back_url = $this->back_url; $jump_url = $this->jump_url; $next_url = $this->next_url; require_once _base_ . '/lib/lib.form.php'; require_once _adm_ . '/lib/lib.directory.php'; require_once _adm_ . '/class.module/class.directory.php'; require_once _lms_ . '/lib/lib.course.php'; $lang =& DoceboLanguage::createInstance('report', 'framework'); $glang =& DoceboLanguage::createInstance('admin_course_managment', 'lms'); if (!isset($_SESSION['report_tempdata']['columns_filter'])) { $_SESSION['report_tempdata']['columns_filter'] = array(); } $ref =& $_SESSION['report_tempdata']['columns_filter']; if (Get::req('is_updating', DOTY_INT, 0) > 0) { $ref['showed_cols'] = Get::req('cols', DOTY_MIXED, array()); } function is_showed($which, &$arr) { if (isset($arr['showed_cols'])) { return in_array($which, $arr['showed_cols']); } else { return false; } } if (isset($_POST['import_filter']) || isset($_POST['show_filter']) || isset($_POST['pre_filter'])) { $temp_url = $next_url; if (isset($_POST['pre_filter'])) { $temp_url .= '&show=1&nosave=1'; } if (isset($_POST['show_filter'])) { $temp_url .= '&show=1'; } Util::jump_to($temp_url); } cout($this->page_title . Form::openForm('user_report_rows_courses', $jump_url) . Form::getHidden('update_tempdata', 'update_tempdata', 1) . Form::getHidden('is_updating', 'is_updating', 1) . Form::getOpenFieldset($lang->def('_COURSE_FIELDS'), 'fieldset_course_fields') . Form::getCheckBox($lang->def('_COURSE_CODE'), 'col_sel_coursecode', 'cols[]', '_CODE_COURSE', is_showed('_CODE_COURSE', $ref)) . Form::getCheckBox($glang->def('_COURSE_NAME'), 'col_sel_coursename', 'cols[]', '_NAME_COURSE', is_showed('_NAME_COURSE', $ref)) . Form::getCheckBox($glang->def('_CATEGORY'), 'col_sel_category', 'cols[]', '_COURSE_CATEGORY', is_showed('_COURSE_CATEGORY', $ref)) . Form::getCheckBox($glang->def('_STATUS'), 'col_sel_status', 'cols[]', '_COURSESTATUS', is_showed('_COURSESTATUS', $ref)) . Form::getCheckBox($glang->def('_CREATION_DATE', 'report'), 'col_sel_publication', 'cols[]', '_PUBLICATION_DATE', is_showed('_PUBLICATION_DATE', $ref)) . Form::getCloseFieldset() . Form::getOpenFieldset($lang->def('_COURSE', 'levels'), 'fieldset_course_fields') . Form::getCheckBox($lang->def('_MAX_SCORE'), 'col_hight_vote', 'cols[]', '_HIGH_VOTE', is_showed('_HIGH_VOTE', $ref)) . Form::getCheckBox($lang->def('_MIN_SCORE'), 'col_less_vote', 'cols[]', '_LESS_VOTE', is_showed('_LESS_VOTE', $ref)) . Form::getCheckBox($lang->def('_SCORE'), 'show_medium_vote', 'cols[]', '_MEDIUM_VOTE', is_showed('_MEDIUM_VOTE', $ref)) . Form::getCloseFieldset() . Form::openButtonSpace() . Form::getBreakRow() . Form::getButton('pre_filter', 'pre_filter', $lang->def('_SHOW_NOSAVE', 'report')) . Form::getButton('ok_filter', 'import_filter', $lang->def('_SAVE_BACK')) . Form::getButton('show_filter', 'show_filter', $lang->def('_SAVE_SHOW')) . Form::getButton('undo_filter', 'undo_filter', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>'); }
function loadRenameFolder() { $tdb =& $this->tdb; $folder = $tdb->getFolderById($this->getSelectedFolderId()); $folder_idst = $tdb->getGroupST($this->getSelectedFolderId()); $acl =& Docebo::user()->getACL(); $aclManager =& $acl->getACLManager(); //$idst_field_group = $aclManager->getGroupST(ORG_CHART_FOLDER_FIELD_GROUP); require_once _base_ . '/lib/lib.form.php'; $form = new Form(); $tree .= $form->openElementSpace(); $tree .= $this->printState(); $array_lang = Docebo::langManager()->getAllLangCode(); $mand_lang = getLanguage(); $array_translations = $tdb->getFolderTranslations($this->getSelectedFolderId()); if ($this->getSelectedFolderId() == '0') { // is root $tree .= $form->getTextfield($this->lang->def('_ROOT_RENAME'), 'rename_folder_root', $this->id . '[rename_folder][root]', 255, Get::sett('title_organigram_chart'), Get::sett('title_organigram_chart') . ' ' . $this->lang->def('MOD')); } else { foreach ($array_lang as $k => $lang_code) { $tree .= $form->getTextfield(($mand_lang == $lang_code ? '<span class="mandatory">*</span>' : '') . $lang_code, 'rename_folder_' . $lang_code, $this->id . '[rename_folder][' . $lang_code . ']', 255, $array_translations[$lang_code], $lang_code . ' ' . $this->lang->def('_MOD')); } } $tree .= $form->closeElementSpace(); // -- begin -- custom fields for folder $tree .= $form->getOpenFieldset($this->lang->def('_ASSIGNED_EXTRAFIELD')); require_once $GLOBALS['where_framework'] . '/lib/lib.field.php'; $fields = new FieldList(); $fields->setGroupFieldsTable($GLOBALS['prefix_fw'] . ORGCHAR_FIELDTABLE); $fields->setFieldEntryTable($GLOBALS['prefix_fw'] . ORGCHAR_FIELDENTRYTABLE); $folder_id = $this->getSelectedFolderId(); $folder =& $this->tdb->getFolderById($folder_id); $ancestor = $this->tdb->getAllParentId($folder, $this->tdb); array_push($ancestor, $folder_id); $tree .= $fields->playFieldsForUser($folder_id, $ancestor, FALSE, FALSE); $tree .= $form->getCloseFieldset(); // -- end -- custom fields for folder $tree .= $form->openButtonSpace() . $form->getButton('save_renamefolder' . $this->id, $this->id . '[save_renamefolder]', $this->lang->def('_SAVE')) . $form->getButton($this->_getCancelId(), $this->_getCancelId(), $this->lang->def('_UNDO')) . $form->closeButtonSpace(); return $tree; }