本文整理汇总了PHP中Form::getInputDropdown方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::getInputDropdown方法的具体用法?PHP Form::getInputDropdown怎么用?PHP Form::getInputDropdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form
的用法示例。
在下文中一共展示了Form::getInputDropdown方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: RegExp
if(searched) {
var regexp = new RegExp(searched, 'gi');
elLiner.innerHTML = oData.replace(regexp, '<span class="highlight">'+searched+'</span>');
} else elLiner.innerHTML = oData;
}
YAHOO.util.Event.addListener("lang_filters", "submit", function(e) {
YAHOO.util.Event.preventDefault(e);
DataTable_lang_table.refresh();
});
YAHOO.util.Event.addListener("filter_reset", "click", function(e) {
YAHOO.util.Event.preventDefault(e);
YAHOO.util.Dom.get('la_module').value = '0';
YAHOO.util.Dom.get('la_text').value = '';
DataTable_lang_table.refresh();
});
</script>
<div class="quick_search_form">
<?php
echo Form::openForm('lang_filters', 'index.php?r=adm/lang/list') . '<label for="la_module">' . Lang::t('_LANG_MODULE', 'admin_lang') . '</label> : ' . Form::getInputDropdown("search_d", "la_module", "la_module", $module_list, '', ' onchange=" DataTable_lang_table.refresh(); "') . ' ' . '<label for="la_text">' . Lang::t('_SEARCH', 'admin_lang') . '</label> : ' . Form::getInputTextfield("search_t", "la_text", "la_text", '', '', 255, '') . Form::getButton("filter_set", "filter_set", Lang::t('_SEARCH', 'admin_lang'), "search_b") . Form::getButton("filter_reset", "filter_reset", Lang::t('_RESET', 'admin_lang'), "reset_b");
echo '<br /><div class="">' . '<label for="lang_code">' . Lang::t('_LANGUAGE', 'admin_lang') . '</label>: ' . Form::getInputDropdown("search_d", "lang_code", "lang_code", $language_list, array_search($lang_code, $language_list), ' onchange=" DataTable_lang_table.refresh(); "') . ' ' . '<label for="lang_code_diff">' . Lang::t('_LANG_COMPARE', 'admin_lang') . '</label>: ' . Form::getInputDropdown("search_d", "lang_code_diff", "lang_code_diff", $language_list_diff, '', ' onchange=" DataTable_lang_table.refresh(); "') . ' ' . Form::getInputCheckbox('only_empty', 'only_empty', '1', false, '') . ' <label class="label_normal" for="waiting">' . Lang::t('_ONLY_EMPTY', 'admin_lang') . '</label>' . '</div>';
echo Form::closeForm();
?>
</div>
<?php
$this->widget('table', array('id' => 'lang_table', 'ajaxUrl' => 'ajax.adm_server.php?r=adm/lang/get&', 'rowsPerPage' => 200, 'row_per_page_select' => '[50,100,250,500,1000]', 'startIndex' => 0, 'results' => Get::sett('visuItem', 250), 'sort' => 'text_module', 'dir' => 'asc', 'generateRequest' => 'requestBuilder', 'columns' => array(array('key' => 'text_module', 'label' => Lang::t('_LANG_MODULE', 'admin_lang'), 'className' => 'min-cell', 'sortable' => true), array('key' => 'text_key', 'label' => Lang::t('_LANG_KEY', 'admin_lang'), 'className' => 'min-cell', 'sortable' => true), array('key' => 'translation_text', 'label' => Lang::t('_LANG_TRANSLATION', 'admin_lang'), 'formatter' => 'TranslationFormatter', 'editor' => 'new YAHOO.widget.TextareaCellEditor({asyncSubmitter: saveTranslation})', 'sortable' => true), array('key' => 'translation_text_diff', 'label' => Lang::t('_LANG_COMPARE', 'admin_lang'), 'editor' => 'new YAHOO.widget.TextareaCellEditor({asyncSubmitter: saveComparisonTranslation})', 'sortable' => true), array('key' => 'save_date', 'label' => Lang::t('_DATE', 'admin_lang'), 'className' => 'min-cell', 'sortable' => true), array('key' => 'delete', 'label' => '<span class="ico-sprite subs_del"><span>' . Lang::t('_DEL', 'standard') . '</span></span>', 'formatter' => 'stdDelete', 'className' => 'img-cell')), 'fields' => array('id', 'text_module', 'text_key', 'translation_text', 'translation_text_diff', 'save_date', 'delete'), 'stdSelection' => false, 'delDisplayField' => 'text_key', 'rel_actions' => array('<a id="add_translation_top" href="ajax.adm_server.php?r=adm/lang/addmask" class="ico-wt-sprite subs_add" title="' . Lang::t('_ADD', 'standard') . '"><span>' . Lang::t('_ADD', 'standard') . '</span></a>', '<a id="add_translation_bottom" href="ajax.adm_server.php?r=adm/lang/addmask" class="ico-wt-sprite subs_add" title="' . Lang::t('_ADD', 'standard') . '"><span>' . Lang::t('_ADD', 'standard') . '</span></a>')));
?>
</div>
<?php
$this->widget('dialog', array('id' => 'translation_add', 'dynamicContent' => true, 'ajaxUrl' => 'ajax.adm_server.php?r=adm/lang/translatemask', 'renderEvent' => 'function() {
new YAHOO.widget.TabView("translation_tab");
}', 'callback' => 'function() { this.destroy(); DataTable_lang_table.refresh(); }', 'callEvents' => array(array('caller' => 'add_translation_top', 'event' => 'click'), array('caller' => 'add_translation_bottom', 'event' => 'click'))));
示例2: getLineDropdown
/**
* public static function getLineDropdown( $css_line, $css_label, $label_name, $css_dropdown, $id, $name, $all_value, $selected, $other_param, $other_after, $other_before )
*
* @param string $css_line css for the line
* @param string $css_label css for the label
* @param string $label_name text contained into the label
* @param string $css_dropdown the css class for the select element
* @param string $id the id of the element
* @param string $name the name of the element
* @param string $all_value all the possible value of the select element
* @param string $selected the element selected
* @param string $other_param other element for the tag
* @param string $other_after html code added after the select element
* @param string $other_before html code added before the label element
*
* @return string with the html code for a line with the select element
*/
public static function getLineDropdown($css_line, $css_label, $label_name, $css_dropdown, $id, $name, $all_value, $selected, $other_param, $other_after, $other_before)
{
return '<div class="' . $css_line . '">' . $other_before . '<p><label class="' . $css_label . '" for="' . $id . '">' . $label_name . '</label></p>' . Form::getInputDropdown($css_dropdown, $id, $name, $all_value, $selected, $other_param) . $other_after . '</div>';
}
示例3: getTitleArea
</script>
<?php
echo getTitleArea(array(Lang::t('_CONTENT_LIBRARY', 'kb')));
?>
<div class="std_block">
<?php
echo $result_message;
?>
<div class="quick_search_form">
<div>
<div class="simple_search_box" id="kb_simple_filter_options" style="display: block;">
<?php
echo Form::openForm('quick_search', 'javascript:;');
echo Form::getInputDropdown('dropdown', 'res_type_dd', 'res_type_dd', $res_type_dd_arr, false, '') . " \n";
echo Form::getInputDropdown('dropdown', 'categorized_filter', 'categorized_filter', $categorized_filter_arr, false, '') . " \n";
echo Form::getInputTextfield("search_t", "filter_text", "filter_text", $filter_text, '', 255, '');
echo Form::getButton("filter_set", "filter_set", Lang::t('_SEARCH', 'standard'), "search_b");
echo Form::getButton("filter_reset", "filter_reset", Lang::t('_RESET', 'standard'), "reset_b");
echo Form::closeForm();
?>
</div>
</div>
</div>
<div class="panel_left_small">
<span class="title"><?php
echo Lang::t('_ALL_CATEGORIES', 'kb');
?>
</span>
<?php
/**
示例4: conference_startnewconf
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');
}
示例5: getTitleArea
<?php
echo getTitleArea(Lang::t('_COURSESTATS', 'menu_course'));
?>
<div class="std_block">
<div class="quick_search_form">
<div>
<div class="simple_search_box" id="usermanagement_simple_filter_options" style="display: block;">
<?php
echo '<label for="">' . Lang::t('_FILTER', 'standard') . '</label>' . Form::getInputDropdown('dropdown', 'filter_selection', 'filter_selection', array(0 => Lang::t('_ALL', 'standard'), 1 => Lang::t('_USER_STATUS_SUBS', 'standard'), 2 => Lang::t('_USER_STATUS_BEGIN', 'standard'), 3 => Lang::t('_USER_STATUS_END', 'standard')), (int) $filter_selection, '');
echo ' ';
//some space between status filter and text filter
echo Form::getInputTextfield("search_t", "filter_text", "filter_text", $filter_text, '', 255, '');
echo Form::getButton("filter_set", "filter_set", Lang::t('_SEARCH', 'standard'), "search_b");
echo Form::getButton("filter_reset", "filter_reset", Lang::t('_RESET', 'standard'), "reset_b");
?>
</div>
<a id="advanced_search" class="advanced_search" href="javascript:;"><?php
echo Lang::t("_ADVANCED_SEARCH", 'standard');
?>
</a>
<div id="advanced_search_options" class="advanced_search_options" style="display: <?php
echo $is_active_advanced_filter ? 'block' : 'none';
?>
">
<?php
//filter inputs
$orgchart_after = '<br />' . Form::getInputCheckbox('filter_descendants', 'filter_descendants', 1, $filter_descendants ? true : false, "") . ' <label for="filter_descendants">' . Lang::t('_ORG_CHART_INHERIT', 'organization_chart') . '</label>';
echo Form::getDropdown(Lang::t('_DIRECTORY_MEMBERTYPETREE', 'admin_directory'), 'filter_orgchart', 'filter_orgchart', $orgchart_list, (int) $filter_orgchart, $orgchart_after);
echo Form::getDropdown(Lang::t('_GROUPS', 'standard'), 'filter_groups', 'filter_groups', $groups_list, (int) $filter_groups);
示例6: modEvent
function modEvent()
{
checkPerm('view');
require_once _base_ . '/lib/lib.form.php';
$id_event = importVar('id_event', true, 0);
$lang =& DoceboLanguage::createInstance('reservation');
$out = $GLOBALS['page'];
$out->setWorkingZone('content');
$man_res = new Man_Reservation();
if (isset($_GET['confirm'])) {
$confirm = importVar('confirm', true, 0);
$id_course = importVar('id_course', true, 0);
$id_laboratory = importVar('id_laboratory', true, 0);
$id_category = importVar('id_category', true, 0);
$title = importVar('title', false, '');
$description = importVar('description', false, '');
$date = importVar('date', false, '');
$max_user = importVar('max_user', true, 0);
$deadline = importVar('deadline', false, '');
$from_time_h = importVar('from_time_h', false, '');
$from_time_m = importVar('from_time_m', false, '');
$to_time_h = importVar('to_time_h', false, '');
$to_time_m = importVar('to_time_m', false, '');
$date = Format::dateDb($date, 'date');
$deadline = Format::dateDb($deadline, 'date');
$from_time = $from_time_h . ':' . $from_time_m . ':00';
$to_time = $to_time_h . ':' . $to_time_m . ':00';
if ($date < date('Y-m-d') || $date < $deadline || $deadline < date('Y-m-d')) {
Util::jump_to('index.php?modname=reservation&op=mod_event&id_event=' . $id_event . '&error=date');
}
if ($from_time >= $to_time) {
Util::jump_to('index.php?modname=reservation&op=mod_event&id_event=' . $id_event . '&error=time');
}
if ($confirm) {
$result = $man_res->modEvent($id_event, $id_course, $id_laboratory, $id_category, $title, $description, $date, $max_user, $deadline, $from_time, $to_time);
}
if ($result) {
Util::jump_to('index.php?modname=reservation&op=reservation&active_tab=subscribed_user');
}
Util::jump_to('index.php?modname=reservation&op=mod_event&id_event=' . $id_event . '&error=laboratory');
}
$out->add(getTitleArea($lang->def('_SAVE'), '', $lang->def('_EVENT')) . '<div class="std_block">');
$error = importVar('error', false, '');
if ($error !== '') {
switch ($error) {
case 'date':
$out->add(getErrorUi($lang->def('_WRONG_DATE')));
break;
case 'time':
$out->add(getErrorUi($lang->def('_WRONG_TIME')));
break;
case 'laboratory':
$out->add(getErrorUi($lang->def('_LOCATION_BUSY')));
break;
}
}
$event = array();
$event = $man_res->getEventInfo($id_event);
$date = Format::date($event[EVENT_DATE], 'date');
$deadline = Format::date($event[EVENT_DEADLINE], 'date');
$from_time_h = $event[EVENT_FROM_TIME][0] . $event[EVENT_FROM_TIME][1];
$from_time_m = $event[EVENT_FROM_TIME][3] . $event[EVENT_FROM_TIME][4];
$to_time_h = $event[EVENT_TO_TIME][0] . $event[EVENT_TO_TIME][1];
$to_time_m = $event[EVENT_TO_TIME][3] . $event[EVENT_TO_TIME][4];
$out->add(Form::openForm('form_event', 'index.php?modname=reservation&op=mod_event&confirm=1') . Form::openElementSpace() . Form::getHidden('id_event', 'id_event', $event[EVENT_ID]) . Form::getHidden('id_course', 'id_course', $event[EVENT_ID_COURSE]) . Form::getTextfield($lang->def('_TITLE'), 'title', 'title', 255, $event[EVENT_TITLE]) . Form::getTextarea($lang->def('_DESCRIPTION'), 'description', 'description', $event[EVENT_DESCRIPTION]) . Form::getDropdown($lang->def('_LOCATION'), 'id_laboratory', 'id_laboratory', $man_res->getLaboratories(), $event[EVENT_ID_LABORATORY]) . Form::getDropdown($lang->def('_CATEGORY'), 'id_category', 'id_category', $man_res->getCategory(), $event[EVENT_ID_CATEGORY]) . Form::getDateField($lang->def('_DATE'), 'date', 'date', $date) . Form::getDateField($lang->def('_DEADLINE'), 'deadline', 'deadline', $deadline) . Form::getTextfield($lang->def('_MAX_USER'), 'max_user', 'max_user', 255, $event[EVENT_MAX_USER]) . Form::getLineBox($lang->def('_FROM_TIME'), Form::getInputDropdown('', 'from_time_h', 'from_time_h', $man_res->getHours(), $from_time_h, false) . ' : ' . Form::getInputDropdown('', 'from_time_m', 'from_time_m', $man_res->getMinutes(), $from_time_m, false)) . Form::getLineBox($lang->def('_TO_TIME'), Form::getInputDropdown('', 'to_time_h', 'to_time_h', $man_res->getHours(), $to_time_h, false) . ' : ' . Form::getInputDropdown('', 'to_time_m', 'to_time_m', $man_res->getMinutes(), $to_time_m, false)) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('mod_event', 'mod_event', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm());
$out->add('</div>', 'content');
}
示例7: getPageWithElement
//.........这里部分代码省略.........
$fields = array();
foreach ($all_fields as $key => $val) {
$fields[$val[FIELD_INFO_ID]] = $val[FIELD_INFO_TRANSLATION];
}
$html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $fields, $var_value, $i_after);
break;
case "sel_sms_gateway":
$options = array('0' => Lang::t('_SMS_GATEWAY_AUTO'), '1' => Lang::t('_SMS_GATEWAY_1'), '2' => Lang::t('_SMS_GATEWAY_2'), '3' => Lang::t('_SMS_GATEWAY_3'), '4' => Lang::t('_SMS_GATEWAY_4'));
$html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $options, $var_value, $i_after);
break;
case "menuvoice":
case "menuvoice_course_public":
case "layout_chooser":
//drop down hteditor
$layout = array('left' => Lang::t('_LAYOUT_LEFT'), 'over' => Lang::t('_LAYOUT_OVER'), 'right' => Lang::t('_LAYOUT_RIGHT'));
$html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $layout, $var_value, $i_after);
break;
case "grpsel_chooser":
$layout = array('group' => $lang->def('_GROUPS'), 'orgchart' => $lang->def('_ORGCHART'));
$html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $layout, $var_value, $i_after);
break;
case "tablist_coursecatalogue":
$lang_c =& DoceboLanguage::createInstance('catalogue', 'lms');
$tab_selected = unserialize(urldecode($var_value));
$tab_list = array('time' => $lang_c->def('_TAB_VIEW_TIME'), 'category' => $lang_c->def('_TAB_VIEW_CATEGORY'), 'all' => $lang_c->def('_ALL'));
if (Get::sett('use_coursepath') == '1') {
$tab_list['pathcourse'] = $lang_c->def('_COURSEPATH');
}
if (Get::sett('use_social_courselist') == 'on') {
$tab_list['mostscore'] = $lang_c->def('_TAB_VIEW_MOSTSCORE');
$tab_list['popular'] = $lang_c->def('_TAB_VIEW_MOSTPOPULAR');
$tab_list['recent'] = $lang_c->def('_TAB_VIEW_RECENT');
}
foreach ($tab_list as $tab_code => $name) {
$html .= Form::getCheckbox($name, 'tablist_' . $tab_code, 'tablist[' . $tab_code . ']', 1, isset($tab_selected[$tab_code]), '', $i_after);
}
break;
case "first_coursecatalogue_tab":
$lang_c =& DoceboLanguage::createInstance('catalogue', 'lms');
$tab_list = array('time' => $lang_c->def('_TAB_VIEW_TIME'), 'category' => $lang_c->def('_TAB_VIEW_CATEGORY'), 'all' => $lang_c->def('_ALL'));
if (Get::sett('use_coursepath') == '1') {
$tab_list['pathcourse'] = $lang_c->def('_COURSEPATH');
}
if (Get::sett('use_social_courselist') == 'on') {
$tab_list['mostscore'] = $lang_c->def('_TAB_VIEW_MOSTSCORE');
$tab_list['popular'] = $lang_c->def('_TAB_VIEW_MOSTPOPULAR');
$tab_list['recent'] = $lang_c->def('_TAB_VIEW_RECENT');
}
$html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $tab_list, $var_value, $i_after);
break;
case "tablist_mycourses":
//$var_value=deformat($var_value);
$arr_value = explode(',', $var_value);
//$arr_value=array();
$tab_list = array();
$tab_list[''] = $lang->def('_MYCOURSES_NOTUSED');
$tab_list['status'] = $lang->def('_STATUS');
$tab_list['name'] = $lang->def('_NAME');
$tab_list['code'] = $lang->def('_CODE');
$html .= '<div class="form_line_l"><p>' . '<label class="floating">' . $lang->def('_' . strtoupper($var_name)) . '</label></p>';
for ($i = 0; $i < 3; $i++) {
$html .= Form::getInputDropdown('dropdown', $var_name . '_' . $i, "mycourses[{$i}]", $tab_list, isset($arr_value[$i]) ? $arr_value[$i] : '', '');
}
$html .= $i_after . '</div>';
break;
case "point_field":
require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
$fl = new FieldList();
$all_fields = $fl->getAllFields();
$fields[0] = $lang->def('_NO_VALUE');
foreach ($all_fields as $key => $val) {
$fields[$val[FIELD_INFO_ID]] = $val[FIELD_INFO_TRANSLATION];
}
$html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $fields, $var_value, $i_after);
break;
case "rest_auth_sel_method":
$value_set = array($lang->def('_REST_AUTH_UCODE') => 0, $lang->def('_REST_AUTH_TOKEN') => 1);
$html .= Form::getRadioSet($lang->def('_REST_AUTH_SEL_METHOD'), $var_name, 'option[' . $var_name . ']', $value_set, $var_value, $i_after);
break;
// Common types
// Common types
case "password":
$html .= Form::getPassword($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $max_size, $var_value, $i_after);
break;
case "textarea":
$html .= Form::getSimpletextarea($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $var_value, $i_after);
break;
case "check":
$html .= Form::getCheckbox($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', 1, $var_value == 1, '', '', $i_after . ' ');
break;
case "enum":
$html .= Form::getCheckbox($lang->def('_' . strtoupper($var_name)), $var_name . '_on', 'option[' . $var_name . ']', 'on', $var_value == 'on', '', '', $i_after . ' ');
break;
default:
//string or int
$html .= Form::getTextfield($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $max_size, $var_value, false, $i_after);
}
}
return $html;
}
示例8: getEditionTableContent
public function getEditionTableContent($courses)
{
$res = array();
foreach ($courses as $id_course) {
if ($this->controlCoursesWithEdition(array($id_course))) {
$query = "SELECT code, name, course_type" . " FROM %lms_course" . " WHERE idCourse = " . (int) $id_course;
list($code, $name, $course_type) = sql_fetch_row(sql_query($query));
if ($course_type !== 'classroom') {
require_once _lms_ . '/admin/models/EditionAlms.php';
$edition_model = new EditionAlms($id_course);
$edition = $edition_model->loadEdition(false, false, 'date_begin', 'desc');
} else {
require_once _lms_ . '/admin/models/ClassroomAlms.php';
$classroom_model = new ClassroomAlms($id_course);
$edition = $classroom_model->loadCourseEdition(false, false, 'date_begin', 'desc');
}
$all_value = array();
foreach ($edition as $edition_info) {
$all_value[isset($edition_info['id_date']) ? $edition_info['id_date'] : $edition_info['id_edition']] = $edition_info['code'] . ' - ' . $edition_info['name'] . ' (' . (isset($edition_info['id_date']) ? $edition_info['date_begin'] : Format::date($edition_info['date_begin'], 'date')) . ' - ' . (isset($edition_info['id_date']) ? $edition_info['date_end'] : Format::date($edition_info['date_end'], 'date')) . ')';
}
$res[] = array($code, $name, Form::getInputDropdown('dropdown', 'edition_' . $id_course, 'edition_' . $id_course, $all_value, false, ''));
}
}
return $res;
}
示例9: implode
echo Form::getHidden('courses_list', 'courses_list', implode(",", $courses_list));
echo Form::getHidden('users_to_add', 'users_to_add', implode(",", $users_to_add));
echo Form::getHidden('users_to_del', 'users_to_del', implode(",", $users_to_del));
echo Form::getHidden('id_path', 'id_path', $id_path);
//header css
$_array_style = array('course_name' => '', 'dropdown' => 'image');
//editions table
if (!empty($editions_list)) {
$_array_header = array('course_name' => Lang::t('_COURSE', 'course'), 'dropdown' => Lang::t('_EDITIONS', 'subscribe'));
$_array_content = array();
foreach ($editions_list as $_info) {
$_array_content[] = array('course_name' => $_info['label'], 'dropdown' => Form::getInputDropdown('dropdown', 'editions_' . $_info['id_course'], 'editions[' . $_info['id_course'] . ']', $_info['list'], false, ''));
}
$this->widget('table', array('id' => 'editions_table', 'styles' => $_array_style, 'header' => $_array_header, 'data' => $_array_content, 'summary' => Lang::t('_CHOOSE_EDITIONS', 'subscribe'), 'caption' => false));
}
//classrooms table
if (!empty($classrooms_list)) {
$_array_header = array('course_name' => Lang::t('_COURSE', 'course'), 'dropdown' => Lang::t('_CLASSROOMS', 'subscribe'));
$_array_content = array();
foreach ($classrooms_list as $_info) {
$_array_content[] = array('course_name' => $_info['label'], 'dropdown' => Form::getInputDropdown('dropdown', 'classrooms_' . $_info['id_course'], 'classrooms[' . $_info['id_course'] . ']', $_info['list'], false, ''));
}
$this->widget('table', array('id' => 'classrooms_table', 'styles' => $_array_style, 'header' => $_array_header, 'data' => $_array_content, 'summary' => Lang::t('_CHOOSE_CLASSROOMS', 'subscribe'), 'caption' => false));
}
echo Form::openButtonSpace();
echo Form::getButton('subscribe', 'subscribe', Lang::t('_SUBSCRIBE', 'subscribe'));
echo Form::getButton('undo', 'undo', Lang::t('_UNDO', 'subscribe'));
echo Form::closeElementSpace();
echo Form::closeForm();
?>
</div>
示例10: AssessmentRule
$rule_man = new AssessmentRule();
$use_default = importVar('usedef', false, 1);
$id_rule = importVar('id_rule', true, 0);
if ($id_rule != 0) {
// load old data ------------------------------------
$rule = $rule_man->getRule($id_rule);
$rule_type = $rule[RULE_TYPE];
$setting = $rule_man->parseRuleSetting($rule[RULE_TYPE], $rule[RULE_SETTING]);
$score_type_one = isset($setting[0]) ? $setting[0] : '';
$score_type_two = isset($setting[1]) ? $setting[1] : '';
} else {
$rule_type = $use_default ? RULE_DEFAULT : RULE_GREATER;
$score_type_one = '';
$score_type_two = '';
}
$arr_question = array();
$arr_question[RULE_GREATER] = strip_tags(str_replace('[score]', $lang->def('_SCORE'), $lang->def('_RULE_GREATER')));
$arr_question[RULE_LESSER] = strip_tags(str_replace('[score]', $lang->def('_SCORE'), $lang->def('_RULE_LESSER')));
$arr_question[RULE_BETWEEN] = strip_tags(str_replace(array('[score_1]', '[score_2]'), array($lang->def('_SCORE'), $lang->def('_SCORE_2')), $lang->def('_RULE_BETWEEN')));
if ($use_default || $id_rule != 0) {
$arr_question[RULE_DEFAULT] = $lang->def('_RULE_DEFAULT');
}
aout(Form::getHidden('id_assessment', 'id_assessment', importVar('id_assessment', true, 0)));
aout(Form::getHidden('id_rule', 'id_rule', $id_rule));
aout('<b><label for="rule_type">' . $lang->def('_RULE_TEXT') . '</label>: </b>' . Form::getInputDropdown('dropdown_nowh', 'rule_type', 'rule_type', $arr_question, $rule_type, ' onChange="rule_type_change(\'rule_type\', \'score_type_one\', \'score_type_two\');"') . '<br />' . '<br />');
aout(Form::getTextfield($lang->def('_SCORE') . ': ', 'score_type_one', 'score_type_one', 255, $score_type_one));
aout(Form::getTextfield($lang->def('_SCORE_2') . ': ', 'score_type_two', 'score_type_two', 255, $score_type_two));
aout(Form::getBreakRow());
aout('<script type="text/javascript">' . 'rule_type_change(\'rule_type\', \'score_type_one\', \'score_type_two\');' . '</script>');
break;
}
示例11: getPageWithElement
/**
* @return string contains the displayable information for a selected group
*
* @access public
*/
function getPageWithElement($regroup)
{
require_once _base_ . '/lib/lib.form.php';
$lang =& DoceboLanguage::createInstance('configuration', 'lms');
$reSetting = sql_query("\r\n\t\tSELECT param_name, param_value, value_type, max_size \r\n\t\tFROM " . $this->table . " \r\n\t\tWHERE regroup = '" . $regroup . "' AND \r\n\t\t\thide_in_modify = '0'\r\n\t\tORDER BY sequence");
$html = '';
while (list($var_name, $var_value, $value_type, $max_size) = sql_fetch_row($reSetting)) {
switch ($value_type) {
case "point_field":
require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
$fl = new FieldList();
$all_fields = $fl->getAllFields();
$fields[0] = $lang->def('_NO_VALUE');
foreach ($all_fields as $key => $val) {
$fields[$val[FIELD_INFO_ID]] = $val[FIELD_INFO_TRANSLATION];
}
$html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $fields, $var_value);
break;
case "language":
//drop down language
$langs = Docebo::langManager()->getAllLangCode();
$html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $langs, array_search($var_value, $langs));
break;
case "template":
//drop down template
$templ = getTemplateList();
$html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $templ, array_search($var_value, $templ));
break;
case "hteditor":
//drop down hteditor
$ht_edit = getHTMLEditorList();
$html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $ht_edit, $var_value);
break;
case "layout_chooser":
//drop down hteditor
$layout = array('left' => Lang::t('_LAYOUT_LEFT'), 'over' => Lang::t('_LAYOUT_OVER'), 'right' => Lang::t('_LAYOUT_RIGHT'));
$html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $layout, $var_value);
break;
case "sel_news":
$mode = array('off' => Lang::t('_DONT_SHOW'), 'link' => Lang::t('_SHOW_AS_LINK'), 'block' => Lang::t('_SHOW_AS_BLOCK'));
$html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $mode, $var_value);
break;
case "enum":
//on off
$html .= Form::openFormLine() . Form::getInputCheckbox($var_name . '_on', 'option[' . $var_name . ']', 'on', $var_value == 'on', '') . ' ' . Form::getLabel($var_name . '_on', $lang->def('_' . strtoupper($var_name))) . Form::closeFormLine();
break;
case "menuvoice":
case "menuvoice_course_public":
case "check":
//on off
$html .= Form::getCheckbox($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', 1, $var_value == 1);
break;
case "tablist_coursecatalogue":
$lang_c =& DoceboLanguage::createInstance('catalogue', 'lms');
$tab_selected = unserialize(urldecode($var_value));
$tab_list = array('time' => $lang_c->def('_TAB_VIEW_TIME'), 'category' => $lang_c->def('_TAB_VIEW_CATEGORY'), 'all' => $lang_c->def('_ALL'));
if (Get::sett('use_coursepath') == '1') {
$tab_list['pathcourse'] = $lang_c->def('_COURSEPATH');
}
if (Get::sett('use_social_courselist') == 'on') {
$tab_list['mostscore'] = $lang_c->def('_TAB_VIEW_MOSTSCORE');
$tab_list['popular'] = $lang_c->def('_TAB_VIEW_MOSTPOPULAR');
$tab_list['recent'] = $lang_c->def('_TAB_VIEW_RECENT');
}
foreach ($tab_list as $tab_code => $name) {
$html .= Form::getCheckbox($name, 'tablist_' . $tab_code, 'tablist[' . $tab_code . ']', 1, isset($tab_selected[$tab_code]));
}
break;
case "first_coursecatalogue_tab":
$lang_c =& DoceboLanguage::createInstance('catalogue', 'lms');
$tab_list = array('time' => $lang_c->def('_TAB_VIEW_TIME'), 'category' => $lang_c->def('_TAB_VIEW_CATEGORY'), 'all' => $lang_c->def('_ALL'));
if (Get::sett('use_coursepath') == '1') {
$tab_list['pathcourse'] = $lang_c->def('_COURSEPATH');
}
if (Get::sett('use_social_courselist') == 'on') {
$tab_list['mostscore'] = $lang_c->def('_TAB_VIEW_MOSTSCORE');
$tab_list['popular'] = $lang_c->def('_TAB_VIEW_MOSTPOPULAR');
$tab_list['recent'] = $lang_c->def('_TAB_VIEW_RECENT');
}
$html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $tab_list, $var_value);
break;
case "tablist_mycourses":
//$var_value=deformat($var_value);
$arr_value = explode(',', $var_value);
//$arr_value=array();
$tab_list = array();
$tab_list[''] = $lang->def('_MYCOURSES_NOTUSED');
$tab_list['status'] = $lang->def('_STATUS');
$tab_list['name'] = $lang->def('_NAME');
$tab_list['code'] = $lang->def('_CODE');
$html .= '<div class="form_line_l"><p>' . '<label class="floating">' . $lang->def('_' . strtoupper($var_name)) . '</label></p>';
for ($i = 0; $i < 3; $i++) {
$html .= Form::getInputDropdown('dropdown', $var_name . '_' . $i, "mycourses[{$i}]", $tab_list, isset($arr_value[$i]) ? $arr_value[$i] : '', '');
}
$html .= '</div>';
//.........这里部分代码省略.........
示例12: get_report_table
function get_report_table($url = '')
{
checkPerm('view');
$can_mod = checkPerm('mod', true);
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
$acl_man =& Docebo::user()->getACLManager();
$level = Docebo::user()->getUserLevelId(Docebo::user()->getIdst());
$lang =& DoceboLanguage::createInstance('report');
$output = '';
$is_admin = $level == ADMIN_GROUP_GODADMIN || $level == ADMIN_GROUP_ADMIN ? true : false;
if ($is_admin || $can_mod) {
//if ($can_mod) {
cout('<script type="text/javascript">
var _FAILURE = "error";
var ajax_path = "' . Get::rel_path('lms') . '/ajax.adm_server.php?mn=report&plf=lms";
function public_report(o, id_rep) {
o.disabled=true; //no more operations allowed on the checkbox while ajaxing
var val_el=document.getElementById("enable_value_"+id_rep);
var value=val_el.value;
var data = "&op=public_rep&id="+id_rep+"&val="+value;
var objAjax = YAHOO.util.Connect.asyncRequest("POST", ajax_path+data, {
success:function(t) {
var temp=o.src;
if (value==1) { o.src=temp.replace("unpublish.png", "publish.png"); val_el.value=0; }
if (value==0) { o.src=temp.replace("publish.png", "unpublish.png"); val_el.value=1; }
o.disabled=false;
},
failure:function(t) {
o.disabled=false;
alert(_FAILURE); //...
} });
}
function setReportFilter() {
var el = document.createElement("INPUT");
el.type = "hidden";
el.name = "search";
el.value = "1";
var form = YAHOO.util.Dom.get("report_searchbox_form");
if (form) {
form.appendChild(el);
form.submit();
}
}
</script>', 'page_head');
}
//filter by author
YuiLib::load();
$current_user = $acl_man->getUser(Docebo::user()->getIdst(), false);
//dropdown data arrays
$authors = array(0 => '(' . $lang->def('_ALL') . ')', $current_user[ACL_INFO_IDST] => $acl_man->relativeId($current_user[ACL_INFO_USERID]));
$query = "SELECT u.idst, u.userid FROM %lms_report_filter as r JOIN %adm_user as u ON (r.author=u.idst) WHERE u.idst<>" . Docebo::user()->getIdst() . " ORDER BY u.userid";
$res = sql_query($query);
while ($row = sql_fetch_assoc($res)) {
$authors[$row['idst']] = $acl_man->relativeId($row['userid']);
}
$arr_report_types = array(0 => '(' . $lang->def('_ALL') . ')');
//initializa session variable for filters
if (!isset($_SESSION['report_admin_filter'])) {
$_SESSION['report_admin_filter'] = array('author' => 0, 'name' => '', 'type' => 0);
}
if (Get::req('search', DOTY_MIXED, false) !== false) {
$_SESSION['report_admin_filter']['author'] = Get::req('filter_author', DOTY_INT, (int) $_SESSION['report_admin_filter']['author']);
$_SESSION['report_admin_filter']['name'] = Get::req('filter_name', DOTY_STRING, $_SESSION['report_admin_filter']['name']);
$_SESSION['report_admin_filter']['type'] = Get::req('filter_type', DOTY_INT, (int) $_SESSION['report_admin_filter']['type']);
}
if (Get::req('reset', DOTY_MIXED, false) !== false) {
$_SESSION['report_admin_filter']['author'] = 0;
$_SESSION['report_admin_filter']['name'] = '';
$_SESSION['report_admin_filter']['type'] = 0;
}
$dropdown_onclick = 'onchange="javascript:setReportFilter();"';
$output .= Form::openForm('report_searchbox_form', 'index.php?modname=report&op=reportlist&of_platform=lms', false, 'POST');
$output .= Form::getHidden('op', 'op', 'reportlist');
$output .= Form::getHidden('modname', 'modname', 'report');
$output .= '<div class="quick_search_form">
<div>
<div class="simple_search_box" id="report_searchbox_simple_filter_options" style="display: block;">' . Form::getInputDropdown('dropdown', 'report_searchbox_filter_author', 'filter_author', $authors, $_SESSION['report_admin_filter']['author'], $dropdown_onclick) . " " . Form::getInputTextfield("search_t", "report_searchbox_filter_name", "filter_name", $_SESSION['report_admin_filter']['name'], '', 255, '') . Form::getButton("report_searchbox_filter_set", "search", Lang::t('_SEARCH', 'standard'), "search_b") . Form::getButton("report_searchbox_filter_reset", "reset", Lang::t('_RESET', 'standard'), "reset_b") . '</div>
</div>
</div>';
$output .= Form::closeForm();
//end filter
//compose search query
$qconds = array();
$query = "SELECT t1.*, t2.userid FROM %lms_report_filter as t1 LEFT JOIN %adm_user as t2 ON t1.author=t2.idst ";
switch ($level) {
case ADMIN_GROUP_GODADMIN:
if ($_SESSION['report_admin_filter']['author'] > 0) {
$qconds[] = " t1.author = " . $_SESSION['report_admin_filter']['author'] . " ";
}
break;
case ADMIN_GROUP_ADMIN:
case ADMIN_GROUP_PUBLICADMIN:
case ADMIN_GROUP_USER:
default:
if ($_SESSION['report_admin_filter']['author'] > 0) {
//.........这里部分代码省略.........
示例13: certificate
public function certificate()
{
if (!$this->permissions['mod']) {
$this->render('invalid', array('message' => $this->_getErrorMessage('no permission'), 'back_url' => 'index.php?r=' . $this->base_link_course . '/show'));
return;
}
if (isset($_POST['undo'])) {
Util::jump_to('index.php?r=' . $this->base_link_course . '/show');
}
require_once _lms_ . '/lib/lib.certificate.php';
$cert = new Certificate();
$id_course = Get::req('id_course', DOTY_INT, 0);
if (isset($_POST['assign'])) {
$point_required = Get::req('point_required', DOTY_INT, 0);
// , $list_of_assign_obj, $list_of_who
if (!$cert->updateCertificateCourseAssign($id_course, $_POST['certificate_assign'], $_POST['certificate_ex_assign'], $point_required)) {
Util::jump_to('index.php?r=' . $this->base_link_course . '/show&err=_up_cert_err');
}
Util::jump_to('index.php?r=' . $this->base_link_course . '/show&res=_up_cert_ok');
} else {
require_once _base_ . '/lib/lib.table.php';
$all_languages = Docebo::langManager()->getAllLanguages(true);
$languages = array();
foreach ($all_languages as $k => $v) {
$languages[$v['code']] = $v['description'];
}
$query = "SELECT code, name, course_type" . " FROM %lms_course WHERE idCourse = '" . $id_course . "'";
$course = sql_fetch_array(sql_query($query));
$tb = new Table(false, Lang::t('_TITLE_CERTIFICATE_TO_COURSE', 'course'), Lang::t('_TITLE_CERTIFICATE_TO_COURSE', 'course'));
$certificate_list = $cert->getCertificateList();
$course_cert = $cert->getCourseCertificate($id_course);
$course_ex_cert = $cert->getCourseExCertificate($id_course);
$released = $cert->numOfcertificateReleasedForCourse($id_course);
$point_required = $cert->getPointRequiredForCourse($id_course);
$possible_status = array(AVS_NOT_ASSIGNED => Lang::t('_NOT_ASSIGNED', 'course'), AVS_ASSIGN_FOR_ALL_STATUS => Lang::t('_ASSIGN_FOR_ALL_STATUS', 'course'), AVS_ASSIGN_FOR_STATUS_INCOURSE => Lang::t('_ASSIGN_FOR_STATUS_INCOURSE', 'course'), AVS_ASSIGN_FOR_STATUS_COMPLETED => Lang::t('_ASSIGN_FOR_STATUS_COMPLETED', 'course'));
$type_h = array('nowrap', 'nowrap', '', '', 'image');
$cont_h = array(Lang::t('_TITLE', 'course'), Lang::t('_CERTIFICATE_LANGUAGE', 'course'), Lang::t('_CERTIFICATE_ASSIGN_STATUS', 'course'), Lang::t('_CERTIFICATE_EX_ASSIGN_STATUS', 'course'), Lang::t('_CERTIFICATE_RELEASED', 'course'));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$view_cert = false;
if (Docebo::user()->getUserLevelId() != ADMIN_GROUP_GODADMIN) {
if (checkPerm('view', true, 'certificate', 'lms') || checkPerm('view', true, 'pcertificate', 'lms')) {
$view_cert = true;
}
} else {
$view_cert = true;
}
while (list($id_cert, $cert) = each($certificate_list)) {
$cont = array();
$cont[] = '<label for="certificate_assign_' . $id_cert . '">' . $cert[CERT_NAME] . '</label>';
$cont[] = isset($languages[$cert[CERT_LANG]]) ? $languages[$cert[CERT_LANG]] : $cert[CERT_LANG];
//lang description?
$cont[] = Form::getInputDropdown('dropdown_nowh', 'certificate_assign_' . $id_cert, 'certificate_assign[' . $id_cert . ']', $possible_status, isset($course_cert[$id_cert]) ? $course_cert[$id_cert] : 0, '');
$cont[] = Form::getInputDropdown('dropdown_nowh', 'certificate_ex_assign_' . $id_cert, 'certificate_ex_assign[' . $id_cert . ']', $possible_status, isset($course_ex_cert[$id_cert]) ? $course_ex_cert[$id_cert] : 0, '');
$cont[] = (isset($course_cert[$id_cert]) && $course_cert[$id_cert] != 0 && $view_cert ? '<a href="index.php?modname=' . (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN ? 'p' : '') . 'certificate&op=view_report_certificate&id_certificate=' . $id_cert . '&id_course=' . $id_course . '&from=course&of_platform=lms">' : '') . (isset($released[$id_cert]) ? $released[$id_cert] : '0') . (isset($course_cert[$id_cert]) && $course_cert[$id_cert] != 0 ? '</a>' : '');
$tb->addBody($cont);
}
$course_info = $this->model->getInfo($id_course);
$course_name = ($course_info['code'] !== '' ? '[' . $course_info['code'] . '] ' : '') . $course_info['name'];
$this->render('certificate', array('id_course' => $id_course, 'tb' => $tb, 'point_required' => $point_required, 'base_link_course' => $this->base_link_course, 'course_name' => $course_name));
}
}
示例14: cataloguesubscribeusersTask
//.........这里部分代码省略.........
//check if the catalogue has editions; if any, than set the editions selector
if (count($editions_list) > 0 || count($classrooms_list) > 0) {
//set title
$page_title_arr = array($back_url => Lang::t('_SUBSCRIBE', 'subscribe'), $name, Lang::t('_SUBSCRIBE', 'subscribe'));
if (count($editions_list) > 0) {
//instantiate a new table for editions selection
require_once _base_ . '/lib/lib.table.php';
$tb = new Table(0, Lang::t('_CATALOGUE_SUBSCRIBE_CHOOSE_EDITIONS', 'subscribe'), Lang::t('_CATALOGUE_SUBSCRIBE_CHOOSE_EDITIONS', 'subscribe'));
$head_style = array('align_center', '', 'align_center');
$head_label = array(Lang::t('_COURSE_CODE', 'course'), Lang::t('_COURSE_NAME', 'course'), Lang::t('_CLASSROOM_EDITION', 'course'));
$tb->addHead($head_label, $head_style);
//set table rows
foreach ($editions_list as $id_course => $editions) {
$line = array();
$cinfo = $courses_list[$id_course];
$line[] = $cinfo->code;
$line[] = $cinfo->name;
//create the dropdown with the editions for every course
$_dropdown = array();
foreach ($editions as $id_edition => $ed_info) {
$_line_content = '';
//print begin and end date
if ($ed_info->date_begin != '') {
$_line_content .= '[' . $ed_info->code . '] ' . $ed_info->name . ' ' . '(' . Format::date($ed_info->date_begin, 'date') . ' - ' . Format::date($ed_info->date_end, 'date') . ')';
}
//check if the string is valid
if ($_line_content == '') {
//...
}
//add to dropdown list and sort the list alphabetically
$_dropdown[$id_edition] = $_line_content;
asort($_dropdown);
}
$line[] = Form::getInputDropdown('dropdown', 'sel_editions_' . $id_course, 'sel_editions[' . $id_course . ']', $_dropdown, false, '');
$tb->addBody($line);
}
$tables['editions'] = $tb;
}
if (count($classrooms_list) > 0) {
//instantiate a new table for editions selection
require_once _base_ . '/lib/lib.table.php';
$tb = new Table(0, Lang::t('_COURSE_TYPE_EDITION', 'course'), Lang::t('_CLASSROOM', 'standard'));
$head_style = array('align_center', '', 'align_center');
$head_label = array(Lang::t('_COURSE_CODE', 'course'), Lang::t('_COURSE_NAME', 'course'), Lang::t('_CLASSROOM_EDITION', 'course'));
$tb->addHead($head_label, $head_style);
//set table rows
foreach ($classrooms_list as $id_course => $classrooms) {
$line = array();
$cinfo = $courses_list[$id_course];
$line[] = $cinfo->code;
$line[] = $cinfo->name;
//create the dropdown with the editions for every course
$_dropdown = array();
foreach ($classrooms as $id_date => $cl_info) {
$_line_content = '';
//print begin and end date
if ($cl_info->date_begin != '') {
$_line_content .= '[' . $cl_info->code . '] ' . $cl_info->name . ' ' . '(' . Format::date($cl_info->date_begin, 'date') . ' - ' . Format::date($cl_info->date_end, 'date') . ')';
}
//check if the string is valid
if ($_line_content == '') {
//...
}
//add to dropdown list and sort the list alphabetically
$_dropdown[$id_date] = $_line_content;
asort($_dropdown);
示例15: getDayTable
public function getDayTable($array_day, $id_date = 0)
{
require_once _base_ . '/lib/lib.table.php';
$tb = new Table(0, Lang::t('_DETAILS', 'course'), Lang::t('_DETAILS', 'course'));
$cont_h = array(Lang::t('_DAY', 'course'), Lang::t('_HOUR_BEGIN', 'course'), Lang::t('_PAUSE_BEGIN', 'course'), Lang::t('_PAUSE_END', 'course'), Lang::t('_HOUR_END', 'course'), Lang::t('_CLASSROOM', 'course'));
$type_h = array('align_center', 'align_center', 'align_center', 'align_center');
$classroom_array = $this->classroom_man->getClassroomForDropdown();
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$days = array();
if ($id_date != 0) {
$days = $this->classroom_man->getDateDayForControl($id_date);
}
for ($i = 0; $i < count($array_day); $i++) {
if (isset($days[$array_day[$i]])) {
$b_hours = $days[$array_day[$i]]['b_hours'];
$b_minutes = $days[$array_day[$i]]['b_minutes'];
$pb_hours = $days[$array_day[$i]]['pb_hours'];
$pb_minutes = $days[$array_day[$i]]['pb_minutes'];
$pe_hours = $days[$array_day[$i]]['pe_hours'];
$pe_minutes = $days[$array_day[$i]]['pe_minutes'];
$e_hours = $days[$array_day[$i]]['e_hours'];
$e_minutes = $days[$array_day[$i]]['e_minutes'];
$classroom = $days[$array_day[$i]]['classroom'];
} else {
$b_hours = false;
$b_minutes = false;
$pb_hours = false;
$pb_minutes = false;
$pe_hours = false;
$pe_minutes = false;
$e_hours = false;
$e_minutes = false;
$classroom = 0;
}
$classroom_array_checked = array();
$occupied = $this->getOccupiedClassrooms($array_day[$i]);
foreach ($classroom_array as $key => $value) {
$classroom_array_checked[$key] = (in_array($key, $occupied) && $key != 0 ? '* ' : '') . $value;
}
$tb->addBody(array(Format::date($array_day[$i], 'date'), Form::getInputDropdown('', 'b_hours_' . $i, 'b_hours_' . $i, $this->classroom_man->getHours(), $b_hours, false) . ' : ' . Form::getInputDropdown('', 'b_minutes_' . $i, 'b_minutes_' . $i, $this->classroom_man->getMinutes(), $b_minutes, false), Form::getInputDropdown('', 'pb_hours_' . $i, 'pb_hours_' . $i, $this->classroom_man->getHours(), $pb_hours, false) . ' : ' . Form::getInputDropdown('', 'pb_minutes_' . $i, 'pb_minutes_' . $i, $this->classroom_man->getMinutes(), $pb_minutes, false), Form::getInputDropdown('', 'pe_hours_' . $i, 'pe_hours_' . $i, $this->classroom_man->getHours(), $pe_hours, false) . ' : ' . Form::getInputDropdown('', 'pe_minutes_' . $i, 'pe_minutes_' . $i, $this->classroom_man->getMinutes(), $pe_minutes, false), Form::getInputDropdown('', 'e_hours_' . $i, 'e_hours_' . $i, $this->classroom_man->getHours(), $e_hours, false) . ' : ' . Form::getInputDropdown('', 'e_minutes_' . $i, 'e_minutes_' . $i, $this->classroom_man->getMinutes(), $e_minutes, false), Form::getInputDropdown('', 'classroom_' . $i, 'classroom_' . $i, $classroom_array_checked, $classroom, false)));
}
if (count($array_day) > 1) {
$tb->addBody(array(Lang::t('_SET', 'course'), Form::getInputDropdown('', 'b_hours', 'b_hours', $this->classroom_man->getHours(), '00', false) . ' : ' . Form::getInputDropdown('', 'b_minutes', 'b_minutes', $this->classroom_man->getMinutes(), '00', false), Form::getInputDropdown('', 'pb_hours', 'pb_hours', $this->classroom_man->getHours(), '00', false) . ' : ' . Form::getInputDropdown('', 'pb_minutes', 'pb_minutes', $this->classroom_man->getMinutes(), '00', false), Form::getInputDropdown('', 'pe_hours', 'pe_hours', $this->classroom_man->getHours(), '00', false) . ' : ' . Form::getInputDropdown('', 'pe_minutes', 'pe_minutes', $this->classroom_man->getMinutes(), '00', false), Form::getInputDropdown('', 'e_hours', 'e_hours', $this->classroom_man->getHours(), '00', false) . ' : ' . Form::getInputDropdown('', 'e_minutes', 'e_minutes', $this->classroom_man->getMinutes(), '00', false), Form::getInputDropdown('', 'classroom', 'classroom', $classroom_array, 0, false)));
}
$table = '<script type="text/javascript">' . 'var num_day = ' . count($array_day) . ';' . 'YAHOO.util.Event.on("b_hours", "change", changeBeginHours);' . 'YAHOO.util.Event.on("b_minutes", "change", changeBeginMinutes);' . 'YAHOO.util.Event.on("pb_hours", "change", changePBeginHours);' . 'YAHOO.util.Event.on("pb_minutes", "change", changePBeginMinutes);' . 'YAHOO.util.Event.on("pe_hours", "change", changePEndHours);' . 'YAHOO.util.Event.on("pe_minutes", "change", changePEndMinutes);' . 'YAHOO.util.Event.on("e_hours", "change", changeEndHours);' . 'YAHOO.util.Event.on("e_minutes", "change", changeEndMinutes);' . 'YAHOO.util.Event.on("classroom", "change", changeClassroom);' . '</script>' . $tb->getTable();
return $table;
}