本文整理汇总了PHP中Form::getInputTextfield方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::getInputTextfield方法的具体用法?PHP Form::getInputTextfield怎么用?PHP Form::getInputTextfield使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form
的用法示例。
在下文中一共展示了Form::getInputTextfield方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getWriteBox
/**
* @package DoceboSCS
* @version $Id: functions.php 113 2006-03-08 18:08:42Z ema $
*/
function getWriteBox(&$out, &$lang)
{
require_once _base_ . '/lib/lib.form.php';
$res = "";
if (isset($_POST["refreshrate"])) {
$_SESSION["refreshrate"] = (int) $_POST["refreshrate"];
}
$form = new Form();
$res .= $form->openForm('refresh_form', getPopupBaseUrl() . '&op=refresh') . '<div class="refresh_form">';
$res .= '<label for="refreshrate">' . $lang->def("_AUTOREFRESH") . '</label>' . $form->getInputTextfield('refreshtext', 'refreshrate', 'refreshrate', $_SESSION["refreshrate"], strip_tags($lang->def("_AUTOREFRESH")), 1000, '');
$res .= $lang->def("_SECONDS") . "\n";
$res .= $form->getButton('refresh', 'refresh', $lang->def("_REFRESH"), 'button_refresh');
$res .= '</div>' . $form->closeForm();
$res .= $form->openForm('msg_form', getPopupBaseUrl() . '&op=send') . '<div class="msg_form">';
$res .= '<label for="msgtxt">' . $lang->def("_MSGTXT") . '</label>' . $form->getInputTextfield('msgtext', 'msgtxt', 'msgtxt', '', strip_tags($lang->def("_MSGTXT")), 1000, '');
$res .= $form->getButton('send', 'send', $lang->def("_SEND"), 'button_send');
$res .= $form->getButton('savechat', 'savechat', $lang->def("_SAVE"), 'button_save');
$res .= '</div>' . $form->closeForm();
$res .= "<script type=\"text/javascript\">\n";
$res .= "document.forms[1].msgtxt.focus();";
$res .= "</script>\n";
$res .= '<div class="emoticons_container"><b>';
$res .= $lang->def("_EMOTICONS") . "</b>: \n";
$res .= $GLOBALS["chat_emo"]->emoticonList();
$res .= '</div>';
if ($_SESSION["refreshrate"] > 0) {
$ref_meta = "<meta http-equiv=refresh content=\"" . $_SESSION["refreshrate"] . "; url=";
$ref_meta .= getPopupBaseUrl() . "&op=refresh\" />\n";
$out->add($ref_meta, "page_head");
}
return $res;
}
示例2: _lineModAnswer
/**
* this function write a gui line for answer insertion,projected for modify
*
* @param int $i indicate the line number
* @return nothing
*
* @access private
* @author Fabio Pirovano (fabio@docebo.com)
*/
function _lineModAnswer($i)
{
$lang =& DoceboLanguage::createInstance('test');
$GLOBALS['page']->add('<tr class="line_answer">' . '<td class="image">' . '<label class="access-only" for="is_correct_' . $i . '">' . $lang->def('_TEST_CORRECT') . '</label><br /><br />', 'content');
if (isset($_POST['answer_id'][$i])) {
$GLOBALS['page']->add('<input type="hidden" id="answer_id_' . $i . '" name="answer_id[' . $i . ']" value="' . $_POST['answer_id'][$i] . '" />', 'content');
}
$GLOBALS['page']->add('' . '<label class="access-only" for="answer_' . $i . '">' . $lang->def('_TEST_TEXT_ANSWER') . '</label>' . Form::getInputTextfield('', 'answer_' . $i, 'answer[' . $i . ']', isset($_POST['answer'][$i]) ? stripslashes($_POST['answer'][$i]) : '', false, '25', '') . '</td>' . '<td class="image">' . '<label class="access-only" for="answer_' . $i . '">' . $lang->def('_TEST_TEXT_ANSWER') . '</label>' . Form::getInputTextfield('', 'tolerance_' . $i, 'tolerance[' . $i . ']', isset($_POST['tolerance'][$i]) ? stripslashes($_POST['tolerance'][$i]) : '', false, '25', '') . '</td>' . '<td class="image">' . '<label class="access-only" for="comment_' . $i . '">' . $lang->def('_COMMENTS') . '</label>' . '<textarea class="test_comment" id="comment_' . $i . '" name="comment[' . $i . ']" rows="6">' . (isset($_POST['comment'][$i]) ? stripslashes($_POST['comment'][$i]) : '') . '</textarea>' . '</td>' . '<td class="test_ifcorrect">' . '</td>' . '<td class="align_right">' . '<label class="access-only" for="score_correct_' . $i . '">' . $lang->def('_TEST_IFCORRECT') . '</label>' . '<input type="text" class="test_point" id="score_correct_' . $i . '" name="score_correct[' . $i . ']" alt="' . $lang->def('_TEST_IFCORRECT') . '" size="5" value="' . (isset($_POST['score_correct'][$i]) ? $_POST['score_correct'][$i] : '0.0') . '" />' . '</td>' . '</tr>' . "\n", 'content');
}
示例3: showWriteForm
function showWriteForm(&$out, &$lang)
{
require_once _base_ . '/lib/lib.form.php';
$form = new Form();
$res = "";
$res .= $form->openForm('msg_form', getPopupBaseUrl() . '&op=send') . '<div class="msg_form">';
$res .= '<label for="msgtxt">' . $lang->def("_MSGTXT") . '</label>' . $form->getInputTextfield('msgtext', 'msgtxt', 'msgtxt', '', strip_tags($lang->def("_MSGTXT")), 1000, '');
$res .= $form->getButton('send', 'send', $lang->def("_SEND"), 'button_send');
$res .= $form->getButton('savechat', 'savechat', $lang->def("_SAVE"), 'button_save');
$res .= '</div>' . $form->closeForm();
$res .= "<script type=\"text/javascript\">\n";
$res .= "document.forms[0].msgtxt.focus();";
$res .= "</script>\n";
$res .= $GLOBALS["chat_emo"]->emoticonList();
$out->add($res);
}
示例4: metaCertificate
/**
* @package DoceboLms
* @version $Id: meta_certificate.php,v 1
* @author Marco Valloni <marco [at] docebo [dot] com>
*/
function metaCertificate()
{
checkPerm('view');
require_once _base_ . '/lib/lib.form.php';
require_once _base_ . '/lib/lib.table.php';
$mod_perm = checkPerm('mod', true);
$lang =& DoceboLanguage::createInstance('certificate', 'lms');
$out =& $GLOBALS['page'];
$out->setWorkingZone('content');
$tb = new Table(Get::sett('visuItem'), $lang->def('_META_CERTIFICATE_CAPTION'), $lang->def('_META_CERTIFICATE_SUMMARY'));
$tb->initNavBar('ini', 'link');
$tb->setLink("index.php?modname=meta_certificate&op=meta_certificate");
$ini = $tb->getSelectedElement();
$form = new Form();
if (isset($_POST['toggle_filter'])) {
unset($_POST['filter_text']);
}
//search query of certificates
$query_certificate = "\r\n\tSELECT id_certificate, code, name, description\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_certificate" . " WHERE meta = 1";
if (isset($_POST['filter'])) {
if ($_POST['filter_text'] !== '') {
$query_certificate .= " AND ( name LIKE '%" . $_POST['filter_text'] . "%'" . " OR code LIKE '%" . $_POST['filter_text'] . "%' )";
}
}
$query_certificate .= " ORDER BY id_certificate\r\n\tLIMIT {$ini}," . Get::sett('visuItem');
$query_certificate_tot = "\r\n\tSELECT COUNT(*)\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_certificate";
$re_certificate = sql_query($query_certificate);
list($tot_certificate) = sql_fetch_row(sql_query($query_certificate_tot));
$type_h = array('', '', '', 'image', 'image');
$cont_h = array($lang->def('_CODE'), $lang->def('_NAME'), $lang->def('_DESCRIPTION'));
if ($mod_perm) {
$cont_h[] = Lang::t('_TEMPLATE', 'certificate');
}
$cont_h[] = '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('_PREVIEW') . '" />';
if ($mod_perm) {
$cont_h[] = Get::img('standard/moduser.png', Lang::t('_TITLE_ASSIGN_META_CERTIFICATE', 'certificate'));
$type_h[] = 'image';
$cont_h[] = Get::sprite('subs_print', Lang::t('_TITLE_CREATE_META_CERTIFICATE', 'certificate'));
$type_h[] = 'image';
$cont_h[] = '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . '" ' . 'alt="' . $lang->def('_MOD') . '" />';
$type_h[] = 'image';
$cont_h[] = '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_DEL') . '" ' . 'alt="' . $lang->def('_DEL') . '"" />';
$type_h[] = 'image';
}
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
while (list($id_certificate, $code, $name, $descr) = sql_fetch_row($re_certificate)) {
$title = strip_tags($name);
$cont = array($code, $name, Util::cut($descr));
if ($mod_perm) {
$cont[] = '<a href="index.php?modname=meta_certificate&op=elemmetacertificate&id_certificate=' . $id_certificate . '" ' . 'title="' . Lang::t('_TEMPLATE', 'certificate') . '">' . Lang::t('_TEMPLATE', 'certificate') . '</a>';
}
$cont[] = '<a href="index.php?modname=meta_certificate&op=preview&id_certificate=' . $id_certificate . '">' . '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('_PREVIEW') . ' : ' . $title . '" /></a>';
if ($mod_perm) {
$cont[] = '<a href="index.php?modname=meta_certificate&op=assign&id_certificate=' . $id_certificate . '" ' . 'title="' . $lang->def('_TITLE_ASSIGN_META_CERTIFICATE') . ' : ' . $name . '">' . Get::img('standard/moduser.png', Lang::t('_TITLE_ASSIGN_META_CERTIFICATE', 'certificate')) . '</a>';
/*
$cont[] = '<a href="index.php?modname=meta_certificate&op=create&id_certificate='.$id_certificate.'" '
.'title="'.$lang->def('_TITLE_CREATE_META_CERTIFICATE').' : '.$name.'">'
.Get::img('course/certificate.png', Lang::t('_TITLE_CREATE_META_CERTIFICATE', 'certificate'))
.'</a>';*/
$cont[] = Get::sprite_link('subs_print', 'index.php?modname=meta_certificate&op=create&id_certificate=' . $id_certificate, Lang::t('_TITLE_CREATE_META_CERTIFICATE', 'certificate'));
$cont[] = '<a href="index.php?modname=meta_certificate&op=modmetacertificate&id_certificate=' . $id_certificate . '" ' . 'title="' . $lang->def('_MOD') . ' : ' . $name . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . ' : ' . $title . '" /></a>';
$cont[] = '<a href="index.php?modname=meta_certificate&op=delmetacertificate&id_certificate=' . $id_certificate . '" ' . 'title="' . $lang->def('_DEL') . ' : ' . $name . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . ' : ' . $title . '" /></a>';
}
$tb->addBody($cont);
}
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=delmetacertificate]');
if ($mod_perm) {
$tb->addActionAdd('<a class="ico-wt-sprite subs_add" href="index.php?modname=meta_certificate&op=addmetacertificate" title="' . $lang->def('_NEW_CERTIFICATE') . '"><span>' . $lang->def('_NEW_CERTIFICATE') . '</span></a>');
}
$out->add(getTitleArea($lang->def('_TITLE_META_CERTIFICATE'), 'certificate') . '<div class="std_block">');
$out->add($form->openForm('certificate_filter', 'index.php?modname=meta_certificate&op=meta_certificate') . '<div class="quick_search_form">
<div>
<div class="simple_search_box">' . Form::getInputTextfield("search_t", "filter_text", "filter_text", Get::req('filter_text', DOTY_MIXED, ''), '', 255, '') . Form::getButton("filter", "filter", Lang::t('_SEARCH', 'standard'), "search_b") . Form::getButton("toggle_filter", "toggle_filter", Lang::t('_RESET', 'standard'), "reset_b") . '</div>
</div>
</div>' . $form->closeForm());
if (isset($_GET['result'])) {
switch ($_GET['result']) {
case "ok":
$out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')));
break;
case "err":
$out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
break;
case "err_del":
$out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
break;
}
}
$out->add($tb->getTable() . $tb->getNavBar($ini, $tot_certificate) . '</div>');
}
示例5: getTitleArea
<?php
echo getTitleArea(array('index.php?r=alms/communication/show' => Lang::t('_COMMUNICATIONS', 'communication'), Lang::t('_ADD', 'communication')));
?>
<div class="std_block">
<?php
echo Form::openForm('add_comm', 'index.php?r=alms/communication/insert', false, false, 'multipart/form-data') . Form::getHidden('title', 'title', 255, Get::req('title', DOTY_MIXED, $data['title'])) . Form::openElementSpace() . Form::getTextfield(Lang::t('_TITLE', 'communication'), 'title', 'title', 255, Get::req('title', DOTY_MIXED, $data['title'])) . Form::getDatefield(Lang::t('_DATE', 'communication'), 'publish_date', 'publish_date', Get::req('publish_date', DOTY_MIXED, $data['publish_date'])) . Form::getRadioSet(Lang::t('_TYPE', 'communication'), 'type_of', 'type_of', array(Lang::t('_NONE', 'communication') => 'none', Lang::t('_LONAME_item', 'storage') => 'file', Lang::t('_LONAME_scormorg', 'storage') => 'scorm'), Get::req('type_of', DOTY_STRING, $data['type_of'])) . Form::getTextarea(Lang::t('_DESCRIPTION', 'communication'), 'description', 'description', Get::req('description', DOTY_MIXED, $data['description'])) . '<div class="quick_search_form qsf_left">' . '<div class="form_line_l">' . '<label class="label_effect" for="set_course">' . Lang::t('_COURSE', 'course') . '</label> ' . Form::getInputTextfield('search_t', 'set_course', 'set_course', '', '', 255, '') . '<div id="set_course_container"></div>' . '</div>' . '</div>' . Form::getHidden('id_course', 'id_course', $data['id_course']) . Form::getHidden('id_category', 'id_category', $data['id_category']) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', Lang::t('_SAVE', 'communication')) . Form::getButton('undo', 'undo', Lang::t('_UNDO', 'communication')) . Form::closeButtonSpace() . Form::closeForm();
?>
</div>
<script type="text/javascript">
//courses autocomplete
YAHOO.util.Event.onDOMReady(function() {
var oDS = new YAHOO.util.XHRDataSource('ajax.adm_server.php?mn=course&plf=lms&op=course_autocomplete');
oDS.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;
oDS.responseSchema = {
resultsList : "courses",
fields: ["cname", "id_course", "code", "name", "code_highlight", "name_highlight", "has_editions", "editions", "has_classrooms", "classrooms"]
};
var oAC = new YAHOO.widget.AutoComplete("set_course", "set_course_container", oDS);
oAC.forceSelection = true;
oAC.useShadow = true;
oAC.resultTypeList = false;
oAC.formatResult = function(oResultData, sQuery, sResultMatch) {
return (oResultData.code_highlight != "" ? '['+oResultData.code_highlight+'] ' : '')+oResultData.name_highlight;
};
oAC.itemSelectEvent.subscribe(function(sType, oArgs) {
var D = YAHOO.util.Dom;
D.get('id_course').value = oArgs[2].id_course;
});
oAC.generateRequest = function(sQuery) { return "&results=20&query=" + sQuery; };
示例6: loadCatalogueSelector
function loadCatalogueSelector($noprint = false)
{
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
$lang =& DoceboLanguage::createInstance('catalogue', 'lms');
// Filter
$this->filter['catalogue_name'] = isset($_POST['cat_filter_name']) ? $_POST['cat_filter_name'] : '';
if ($this->show_filter === true) {
$form = new Form();
/*$GLOBALS['page']->add(
$form->getOpenFieldset($lang->def('_SEARCH'))
.Form::getTextfield($lang->def('_NAME'), 'cat_filter_name', 'cat_filter_name', '255',
( isset($_POST['cat_filter_name']) ? $_POST['cat_filter_name'] : '' ))
.$form->openButtonSpace()
.$form->getButton('catalogue_filter', 'catalogue_filter', $lang->def('_SEARCH'))
.$form->closeButtonSpace()
.$form->getCloseFieldset()
, 'content');
*/
cout('<div class="quick_search_form">' . '<div>' . Form::getInputTextfield("search_t", "cat_filter_name", "cat_filter_name", Get::req('cat_filter_name', DOTY_MIXED, ''), '', 255, '') . Form::getButton("catalogue_filter", "catalogue_filter", Lang::t('_SEARCH', 'standard'), "search_b") . '</div>' . '</div>', 'content');
}
// End Filter
$tb = new Table(Get::sett('visuItem'), $lang->def('_CATALOGUE'), $lang->def('_CATALOGUE_SUMMARY'));
$tb->initNavBar('ini_cat', 'button');
$ini = $tb->getSelectedElement();
$select = "\r\n\t\tSELECT c.idCatalogue, c.name, c.description";
$query_catalogue = "\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_catalogue AS c\r\n\t\tWHERE 1";
// Retriving data
if (Docebo::user()->getUserLevelId() != ADMIN_GROUP_GODADMIN) {
$all_courses = false;
require_once _base_ . '/lib/lib.preference.php';
$adminManager = new AdminPreference();
$admin_courses = $adminManager->getAdminCourse(Docebo::user()->getIdST());
if (isset($admin_courses['course'][0])) {
$all_courses = true;
}
if (isset($admin_courses['course'][-1])) {
require_once _lms_ . '/lib/lib.catalogue.php';
$cat_man = new Catalogue_Manager();
$admin_courses['catalogue'] = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt());
if (count($admin_courses['catalogue']) == 0 && Get::sett('on_catalogue_empty', 'off') == 'on') {
$all_courses = true;
}
}
if (!$all_courses) {
if (empty($admin_courses['catalogue'])) {
$query_catalogue .= " AND 0 ";
} else {
$query_catalogue .= " AND c.idCatalogue IN (0," . implode(',', $admin_courses['catalogue']) . ") ";
}
}
}
if ($this->filter['catalogue_name'] != '') {
$query_catalogue .= " AND c.name LIKE '%" . $this->filter['catalogue_name'] . "%'";
}
list($tot_catalogue) = sql_fetch_row(sql_query("SELECT COUNT(*) " . $query_catalogue));
$query_catalogue .= " ORDER BY c.name\r\n\t\t\t\t\t\t\tLIMIT " . $ini . "," . (int) Get::sett('visuItem');
$re_catalogue = sql_query($select . $query_catalogue);
$type_h = array('image', '', '', '');
$cont_h = array('<span class="access-only">' . $lang->def('_CATALOGUE_SELECTION') . '</span>', $lang->def('_NAME'), $lang->def('_DESCRIPTION'));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
while (list($id_catalogue, $name, $descr) = sql_fetch_row($re_catalogue)) {
$tb_content = array(Form::getInputCheckbox('new_catalogue_selected_' . $id_catalogue, 'new_catalogue_selected[' . $id_catalogue . ']', $id_catalogue, isset($this->current_selection[$id_catalogue]), ''), '<label for="new_catalogue_selected_' . $id_catalogue . '">' . $name . '</label>', '<label for="new_catalogue_selected_' . $id_catalogue . '">' . $descr . '</label>');
$tb->addBody($tb_content);
if (isset($this->current_selection[$id_catalogue])) {
unset($this->current_selection[$id_catalogue]);
}
}
$output = $tb->getTable() . $tb->getNavBar($ini, $tot_catalogue) . $this->stateSelection();
if ($noprint) {
return $output;
} else {
cout($output, 'content');
}
}
示例7: 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'))));
示例8: 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) {
//.........这里部分代码省略.........
示例9: transaction
function transaction()
{
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
require_once _base_ . '/lib/lib.dialog.php';
YuiLib::load();
$lang =& DoceboLanguage::createInstance('transaction');
$acl_man = Docebo::user()->getAclManager();
$man_transaction = new Man_Transaction();
cout(getTitleArea($lang->def('_TRANSACTION')) . '<div class="std_block">');
$tb = new Table(Get::sett('visuItem'), $lang->def('_TRANSACTION_TABLE'), $lang->def('_TRANSACTION_TABLE'));
$tb->initNavBar('ini', 'button');
$tb->setLink('index.php?modname=transaction&op=transaction');
$page = ($tb->getSelectedPage() - 1) * Get::sett('visuItem');
$status_filter = Get::req('payment_status', DOTY_INT, '-2');
$course_filter = Get::req('course_status', DOTY_INT, '-2');
$tran_filter = Get::req('tran', DOTY_MIXED, '');
$display = false;
if ($status_filter != -2) {
$display = true;
}
if ($course_filter != -2) {
$display = true;
}
$transactions = $man_transaction->getTransaction($page, $status_filter == '-2' ? false : $status_filter, $course_filter == '-2' ? false : $course_filter, $tran_filter);
$tot_transaction = $man_transaction->getTotTransaction($status_filter == '-2' ? false : $status_filter, $course_filter == '-2' ? false : $course_filter, $tran_filter);
if (count($transactions) > 0 || $display) {
$mod_img = '<img src="' . getPathImage() . '/standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" />';
$del_img = '<img src="' . getPathImage() . '/standard/delete.png" title="' . $lang->def('_DEL') . '" alt="' . $lang->def('_DEL') . '" />';
$cont_h = array($lang->def('_USER'), $lang->def('_DATE'), $lang->def('_COURSE_PRIZE'), $lang->def('_PAYMENT_METHOD'), $lang->def('_PAYMENT_STATUS'), $lang->def('COURSE_STATUS'), $mod_img, $del_img);
$type_h = array('', '', '', '', 'image', 'image', 'image', 'image');
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
foreach ($transactions as $transaction_info) {
if ($transaction_info['firstname'] !== '' && $transaction_info['lastname'] !== '') {
$user = $transaction_info['firstname'] . ' ' . $transaction_info['lastname'] . ' (' . $acl_man->relativeId($transaction_info['userid']) . ')';
} elseif ($transaction_info['firstname'] !== '') {
$user = $transaction_info['firstname'] . ' (' . $acl_man->relativeId($transaction_info['userid']) . ')';
} elseif ($transaction_info['lastname'] !== '') {
$user = $transaction_info['lastname'] . ' (' . $acl_man->relativeId($transaction_info['userid']) . ')';
} else {
$user = $acl_man->relativeId($transaction_info['userid']);
}
switch ($transaction_info['payment_status']) {
case '-1':
$payment_status = '<img src="' . getPathImage() . '/standard/dot_red.gif" alt="' . $lang->def('_CANCELLED') . '" title="' . $lang->def('_CANCELLED') . '" />';
break;
case '0':
$payment_status = '<img src="' . getPathImage() . '/standard/dot_grey.gif" alt="' . $lang->def('_WAITING_PAYMENT') . '" title="' . $lang->def('_WAITING_PAYMENT') . '" />';
break;
case '1':
$payment_status = '<img src="' . getPathImage() . '/standard/dot_yellow.gif" alt="' . $lang->def('_PARTIAL_PAID') . '" title="' . $lang->def('_PARTIAL_PAID') . '" />';
break;
case '2':
$payment_status = '<img src="' . getPathImage() . '/standard/dot_green.gif" alt="' . $lang->def('_PAID') . '" title="' . $lang->def('_PAID') . '" />';
break;
}
switch ($transaction_info['course_status']) {
case '-1':
$course_status = '<img src="' . getPathImage() . '/standard/dot_red.gif" alt="' . $lang->def('_CANCELLED') . '" title="' . $lang->def('_CANCELLED') . '" />';
break;
case '0':
$course_status = '<img src="' . getPathImage() . '/standard/dot_grey.gif" alt="' . $lang->def('_NO_COURSE_ACTIVATED') . '" title="' . $lang->def('_NO_COURSE_ACTIVATED') . '" />';
break;
case '1':
$course_status = '<img src="' . getPathImage() . '/standard/dot_yellow.gif" alt="' . $lang->def('_SOME_COURSE_ACTIVATED') . '" title="' . $lang->def('_SOME_COURSE_ACTIVATED') . '" />';
break;
case '2':
$course_status = '<img src="' . getPathImage() . '/standard/dot_green.gif" alt="' . $lang->def('_ALL_COURSE_ACTIVATED') . '" title="' . $lang->def('_ALL_COURSE_ACTIVATED') . '" />';
break;
}
$tb->addBody(array($user, Format::date($transaction_info['date']), $transaction_info['price'], $lang->def('_' . strtoupper($transaction_info['method'])), $payment_status, $course_status, '<a href="index.php?modname=transaction&op=mod&id=' . $transaction_info['id_transaction'] . '">' . $mod_img . '</a>', '<a href="index.php?modname=transaction&op=del&id=' . $transaction_info['id_transaction'] . '">' . $del_img . '</a>'));
}
$array_payment_status = array('-2' => $lang->def('_ALL_STATUS'), '-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_WAITING_PAYMENT'), '1' => $lang->def('_PARTIAL_PAID'), '2' => $lang->def('_PAID'));
$array_course_status = array('-2' => $lang->def('_ALL_STATUS'), '-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_NO_COURSE_ACTIVATED'), '1' => $lang->def('_SOME_COURSE_ACTIVATED'), '2' => $lang->def('_ALL_COURSE_ACTIVATED'));
cout(Form::openForm('transaction_filter', 'index.php?modname=transaction&op=transaction') . $tb->getNavBar($page, $tot_transaction) . '<div class="quick_search_form">' . Form::getInputTextfield('search_t', 'tran', 'tran', $tran_filter, '', 255, '') . Form::getButton("filter", "filter", $lang->def('_FILTER'), "search_b") . '<br />' . '<a class="advanced_search" href="javascript:;" onclick="( this.nextSibling.style.display != \'block\' ? this.nextSibling.style.display = \'block\' : this.nextSibling.style.display = \'none\' );">' . $lang->def("_ADVANCED_SEARCH") . '</a>' . '<div class="overlay_menu" style="display:' . ($display ? 'block' : 'none') . '">' . Form::getDropdown($lang->def('_PAYMENT_STATUS_FILTER'), 'payment_status', 'payment_status', $array_payment_status, $status_filter) . Form::getDropdown($lang->def('_COURSE_STATUS_FILTER'), 'course_status', 'course_status', $array_course_status, $course_filter) . '</div>' . '</div>' . '<script type="text/javascript">' . 'var payment_status = YAHOO.util.Dom.get(\'payment_status\');' . 'var course_status = YAHOO.util.Dom.get(\'course_status\');' . 'var form = YAHOO.util.Dom.get(\'transaction_filter\');' . 'YAHOO.util.Event.on(payment_status, \'change\', function() { this.submit() } , form, true);' . 'YAHOO.util.Event.on(course_status, \'change\', function() { this.submit() } , form, true);' . '</script>' . $tb->getTable() . $tb->getNavBar($page, $tot_transaction) . Form::closeForm());
setupHrefDialogBox('a[href*=del]');
} else {
cout(Lang::t('_NO_CONTENT', 'transaction'));
}
cout('</div>');
}
示例10: view_report_certificate
//.........这里部分代码省略.........
} else {
$back_ui = getBackUi('index.php?modname=certificate&op=report_certificate&id_certificate=' . (int) $id_certificate, $lang->def('_BACK'));
$out->add(getTitleArea(array('index.php?modname=certificate&op=certificate' => $lang->def('_TITLE_CERTIFICATE'), 'index.php?modname=certificate&op=report_certificate&id_certificate=' . (int) $id_certificate => $lang->def('_COURSES'), $lang->def('_CERTIFICATE_VIEW_CAPTION')), 'certificate'));
}
$out->add('<div class="std_block">' . $back_ui);
$numrows = sql_num_rows($res);
$downloadables = array();
if ($numrows > 0) {
$clang =& DoceboLanguage::CreateInstance('course', 'lms');
$type_h = array('image', '', '', '', '', '', '', 'image', 'image');
$cont_h = array('', $lang->def('_USERNAME'), $lang->def('_LASTNAME'), $lang->def('_FIRSTNAME'), $clang->def('_STATUS'), $lang->def('_DATE'), $lang->def('_RELASE_DATE'), Get::sprite('subs_pdf', Lang::t('_TITLE_VIEW_CERT', 'certificate')), Get::sprite('subs_del', Lang::t('_DEL', 'certificate')));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$acl_man =& $GLOBALS['current_user']->getAclManager();
$arr_status = array(_CUS_CONFIRMED => $clang->def('_USER_STATUS_CONFIRMED'), _CUS_SUBSCRIBED => $clang->def('_USER_STATUS_SUBS'), _CUS_BEGIN => $clang->def('_USER_STATUS_BEGIN'), _CUS_END => $clang->def('_USER_STATUS_END'), _CUS_SUSPEND => $clang->def('_USER_STATUS_SUSPEND'));
//foreach($report_info as $info_report)
while ($info = sql_fetch_assoc($res)) {
$cont = array();
$can_assign = (bool) ($info['on_date'] == '');
$input_id = $info['id_user'];
$sel_cell_content = '';
$label_open = '';
$label_close = '';
if ($can_assign) {
$input = '<input type="hidden" id="selection_' . $input_id . '" name="selection[' . $input_id . ']" value="' . $input_id . '"/> ';
if (in_array($input_id, $total_selection)) {
$checked = ' checked="checked"';
} else {
$checked = '';
}
$sel_cell_content .= $input . '<input type="checkbox" id="selected_' . $input_id . '" name="selected[' . $input_id . ']" value="' . $input_id . '"' . $checked . '/>';
$label_open = '<label for="selected_' . $input_id . '">';
$label_close = '</label>';
}
$userid = $acl_man->relativeId($info['userid']);
$cont[] = $sel_cell_content;
$cont[] = $label_open . ($search_filter != '' ? highlightText($userid, $search_filter) : $userid) . $label_close;
$cont[] = $label_open . ($search_filter != '' ? highlightText($info['lastname'], $search_filter) : $info['lastname']) . $label_close;
$cont[] = $label_open . ($search_filter != '' ? highlightText($info['firstname'], $search_filter) : $info['firstname']) . $label_close;
$cont[] = $arr_status[$info['status']];
$cont[] = $info['date_complete'];
$cont[] = $info['on_date'];
$url = 'index.php?modname=certificate&certificate_id=' . $id_certificate . '&course_id=' . $id_course . '&user_id=' . $info['id_user'];
$dl_url = $url . "&op=send_certificate";
if ($can_assign) {
$downloadables[] = 'dl_single_' . $input_id;
}
$cont[] = $can_assign ? '<a id="dl_single_' . $input_id . '" class="ico-wt-sprite subs_pdf" href="javascript:;" title="' . $lang->def('_GENERATE') . '"><span>' . $lang->def('_GENERATE') . '</span></a>' : '<a id="dl_single_' . $input_id . '" class="ico-wt-sprite subs_pdf" href="' . $dl_url . '" title="' . $lang->def('_DOWNLOAD') . '"><span>' . $lang->def('_DOWNLOAD') . '</span></a>';
$cont[] = $can_assign ? '' : Get::sprite_link('subs_del', $url . '&op=del_report_certificate', Lang::t('_DEL', 'certificate'));
$tb->addBody($cont);
}
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=del_report_certificate]');
//search filter ...
$release_options = array($lang->def('_ALL') => 0, $lang->def('_RELEASED') => 1, $lang->def('_TO_RELEASE') => 2);
//search and store all non-available certificates
$all_selection = array();
$query = "SELECT cu.idUser as id_user " . " FROM ( " . $tu . " JOIN " . $tcu . " ON (u.idst = cu.idUser) ) LEFT JOIN " . $tca . " " . " ON ( ca.id_course = cu.idCourse AND ca.id_user=cu.idUser ) " . " WHERE (ca.id_certificate='" . (int) $id_certificate . "' OR ca.id_certificate IS NULL) AND " . $aval_status . " " . " AND cu.idCourse='" . (int) $id_course . "' " . ($search_filter != '' ? " AND (u.userid LIKE '%" . $search_filter . "%' OR u.lastname LIKE '%" . $search_filter . "%' OR u.firstname LIKE '%" . $search_filter . "%') " : "") . " AND ca.on_date IS NULL ";
$res = sql_query($query);
while (list($id_user) = sql_fetch_row($res)) {
$all_selection[] = $id_user;
}
//---
$form = new Form();
$submit_url = "index.php?modname=certificate&op=view_report_certificate&id_certificate=" . (int) $id_certificate . "&id_course=" . (int) $id_course;
$out->add($form->openForm("certificates_emission", $submit_url) . $form->getHidden('old_selection', 'old_selection', implode(',', $total_selection)) . $form->getHidden('all_selection', 'all_selection', implode(',', $all_selection)) . $form->getHidden('active_text_filter', 'active_text_filter', $search_filter) . $form->getHidden('active_only_released', 'active_only_released', $only_released) . $form->getHidden('active_ini', 'active_ini', $ini_param) . '<div class="quick_search_form">' . '<div class="simple_search_box">' . Form::getInputTextfield("search_t", "filter", "filter", $search_filter, '', 255, '') . Form::getButton("search_button", "search_button", Lang::t('_SEARCH', 'standard'), "search_b") . Form::getButton("reset_button", "reset_button", Lang::t('_RESET', 'standard'), "reset_b") . '</div>' . '<a id="advanced_search" class="advanced_search" href="javascript:;">' . Lang::t("_ADVANCED_SEARCH", 'standard') . '</a>' . '<div id="certificate_release_as" class="advanced_search_options" style="display: ' . ($only_released != 0 ? 'block' : 'none') . '">' . Form::getRadioHoriz(Lang::t('_FILTER', 'certificate'), 'only_released', 'only_released', $release_options, $only_released) . '</div>' . '</div>' . '<script type="text/javascript">' . 'YAHOO.util.Event.addListener("advanced_search", "click", function(e){
var el = YAHOO.util.Dom.get("certificate_release_as");
if (el.style.display != \'block\') el.style.display = \'block\';
else el.style.display = \'none\';
});' . '</script>', 'content');
$delgen_url = 'index.php?modname=certificate&op=del_gen_certificate' . '&id_certificate=' . (int) $id_certificate . '&id_course=' . (int) $id_course;
$delgen_txt = Lang::t('_DELETE_ALL_GENERATED', 'certificate');
$print_button_1 = '<div>' . '<a id="print_selected_button_1" href="javascript:;">' . Get::img('course/certificate.png', Lang::t('_GENERATE_ALL_SELECTED', 'certificate')) . Lang::t('_GENERATE_ALL_SELECTED', 'certificate') . '</a>' . '</div>';
$print_button_2 = '<div><a id="print_selected_button_2" href="javascript:;">' . Get::img('course/certificate.png', Lang::t('_GENERATE_ALL_SELECTED', 'certificate')) . Lang::t('_GENERATE_ALL_SELECTED', 'certificate') . '</a>' . '</div>';
$print_button_1 .= Lang::t('_SELECT', 'directory') . ': ';
$print_button_2 .= Lang::t('_SELECT', 'directory') . ': ';
/*
$print_button_1 .= ' <a href="javascript:;" id="select_page_1">'.Lang::t('_SELECT_PAGE', 'standard').'</a>';
$print_button_2 .= ' <a href="javascript:;" id="select_page_2">'.Lang::t('_SELECT_PAGE', 'standard').'</a>';
$print_button_1 .= ' <a href="javascript:;" id="unselect_page_1">'.Lang::t('_UNSELECT_PAGE', 'standard').'</a>';
$print_button_2 .= ' <a href="javascript:;" id="unselect_page_2">'.Lang::t('_UNSELECT_PAGE', 'standard').'</a>';
*/
$print_button_1 .= ' <a href="javascript:;" id="select_all_1">' . Lang::t('_ALL_PAGES', 'directory') . '</a>';
$print_button_2 .= ' <a href="javascript:;" id="select_all_2">' . Lang::t('_ALL_PAGES', 'directory') . '</a>';
$print_button_1 .= ' <a href="javascript:;" id="unselect_all_1">' . Lang::t('_NONE', 'directory') . '</a>';
$print_button_2 .= ' <a href="javascript:;" id="unselect_all_2">' . Lang::t('_NONE', 'directory') . '</a>';
$navbar = $tb->getNavBar($ini, $totalrows);
$out->add($print_button_1 . '<br />' . $navbar . $tb->getTable() . $navbar . '<br />' . $print_button_2);
$out->add($form->closeForm());
} else {
$out->add($lang->def('_NO_CONTENT'));
}
$out->add($back_ui . '</div>');
addCss('style_menu', 'lms');
Util::get_js(Get::rel_path('base') . '/widget/dialog/dialog.js', true, true);
Util::get_js(Get::rel_path('lms') . '/admin/modules/certificate/certificate.js?rnd=' . time(), true, true);
//addJs($GLOBALS['where_lms_relative'].'/admin/modules/certificate/', 'certificate.js');
$script = 'var ajax_url="ajax.adm_server.php?plf=lms&mn=certificate"; var _STOP="' . $lang->def('_STOP') . '"; ' . 'var glob_id_certificate = ' . (int) $id_certificate . ', glob_id_course = ' . (int) $id_course . ';' . 'var single_list = [' . (count($downloadables) ? '"' . implode('","', $downloadables) . '"' : '') . ']; ' . 'var reload_url = "' . str_replace('&', '&', isset($submit_url) ? $submit_url : '') . '", ' . '_ERROR_PARSE = "' . $lang->def('_OPERATION_FAILURE') . '", _SUCCESS = "' . $lang->def('_OPERATION_SUCCESSFUL') . '", ' . '_AREYOUSURE="' . Lang::t('_AREYOUSURE', 'standard') . '";';
$out->add('<script type="text/javascript">' . $script . '</script>', 'page_head');
}
示例11: getPresenceTable
public function getPresenceTable()
{
$user = $this->classroom_man->getUserForPresence($this->id_date);
$day = $this->getDateDay($this->id_date);
$test_type = $this->getTestType();
$user_presence = $this->classroom_man->getUserPresenceForDate($this->id_date);
$tb = new Table(0, Lang::t('_ATTENDANCE', 'course'), Lang::t('_ATTENDANCE', 'course'));
$cont_h = array(Lang::t('_USERNAME', 'course'), Lang::t('_FULLNAME', 'course'));
$type_h = array('', '');
foreach ($day as $id_day => $day_info) {
$cont_h[] = Format::date($day_info['date_begin'], 'date') . '<br />' . '<a href="javascript:;" onClick="checkAllDay(' . $id_day . ')">' . Get::img('standard/checkall.png', Lang::t('_CHECK_ALL_DAY', 'presence') . '</a>') . ' ' . '<a href="javascript:;" onClick="unCheckAllDay(' . $id_day . ')">' . Get::img('standard/uncheckall.png', Lang::t('_UNCHECK_ALL_DAY', 'presence') . '</a>');
$type_h[] = 'img-cell';
}
$cont_h[] = '';
$type_h[] = 'img-cell';
if ($test_type == _DATE_TEST_TYPE_PAPER) {
$cont_h[] = Lang::t('_SCORE', 'course');
$type_h[] = 'img-cell';
}
$cont_h[] = Lang::t('_NOTES', 'course');
$type_h[] = 'img-cell';
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$array_user_id = array();
foreach ($user as $id_user => $user_info) {
reset($day);
$array_user_id[] = $id_user;
$cont = array();
$cont[] = $user_info['userid'];
$cont[] = $user_info['lastname'] . ' ' . $user_info['firstname'];
foreach ($day as $id_day => $day_info) {
if (isset($user_presence[$id_user][substr($day_info['date_begin'], 0, 10)]) && $user_presence[$id_user][substr($day_info['date_begin'], 0, 10)]['presence'] == 1) {
$presence = true;
} elseif (isset($user_presence[$id_user][substr($day_info['date_begin'], 0, 10)]) && $user_presence[$id_user][substr($day_info['date_begin'], 0, 10)]['presence'] == 0) {
$presence = false;
} else {
$presence = false;
}
$cont[] = Form::getInputCheckbox('date_' . $id_day . '_' . $id_user, 'date_' . $id_day . '_' . $id_user, 1, $presence, false);
}
$cont[] = '<a href="javascript:;" onClick="checkAllUser(' . $id_user . ')">' . Get::img('standard/checkall.png', Lang::t('_CHECK_ALL_USER', 'presence') . '</a>') . '<br />' . '<a href="javascript:;" onClick="unCheckAllUser(' . $id_user . ')">' . Get::img('standard/uncheckall.png', Lang::t('_UNCHECK_ALL_USER', 'presence') . '</a>');
if ($test_type == _DATE_TEST_TYPE_PAPER) {
if (isset($user_presence[$id_user]['0000-00-00']) && $user_presence[$id_user]['0000-00-00']['presence'] == 1) {
$passed = true;
} else {
$passed = false;
}
//$cont[] = Form::getTextfield('', 'score_'.$id_user, 'score_'.$id_user, 255, (isset($user_presence[$id_user]['0000-00-00']['score']) ? $user_presence[$id_user]['0000-00-00']['score'] : '0'));
$cont[] = Form::getInputTextfield('', 'score_' . $id_user, 'score_' . $id_user, isset($user_presence[$id_user]['0000-00-00']['score']) ? $user_presence[$id_user]['0000-00-00']['score'] : '0', Lang::t('_SCORE', 'course'), 255, '');
}
//$cont[] = Form::getSimpleTextarea('', 'note_'.$id_user, 'note_'.$id_user, (isset($user_presence[$id_user]['0000-00-00']['note']) ? $user_presence[$id_user]['0000-00-00']['note'] : ''), false, false, false, 2);
$cont[] = Form::getInputTextarea('note_' . $id_user, 'note_' . $id_user, isset($user_presence[$id_user]['0000-00-00']['note']) ? $user_presence[$id_user]['0000-00-00']['note'] : '', '', 5, 22);
$tb->addBody($cont);
}
return $tb->getTable();
}
示例12: event_special_view
/**
* Only for input. Special function.
**/
function event_special_view($op)
{
checkPerm('view_event_manager');
require_once _base_ . '/lib/lib.table.php';
//require_once(_i18n_.'/lib.lang.php');
require_once _base_ . '/lib/lib.form.php';
$lang =& DoceboLanguage::createInstance('event_manager', 'framework');
$out =& $GLOBALS['page'];
$form = new Form();
$out->setWorkingZone('content');
$out->add(getTitleArea($lang->def('_EVENT_MANAGER'), 'event_manager'));
$out->add('<div class="std_block">');
if ($op == 'special_save') {
$arr_platform = $_POST['platform'];
$arr_class = $_POST['class'];
$arr_description = $_POST['description'];
$arr_recipients = $_POST['recipients'];
$arr_show_level = $_POST['show_level'];
$idClass = 0;
foreach ($arr_platform as $key => $platform) {
if ($key == 0) {
if ($platform != '') {
$result1 = sql_query("INSERT INTO " . $GLOBALS['prefix_fw'] . "_event_class " . " (platform,class,description) VALUES " . " ('" . $platform . "','" . $arr_class[$key] . "','" . $arr_description[$key] . "') ");
if ($result1 === FALSE) {
break;
}
$idClass = mysql_insert_id();
DoceboEventManager::registerEventConsumer(array($arr_class[$key]), 'DoceboUserNotifier', $GLOBALS['where_framework'] . '/lib/lib.usernotifier.php');
$result1 = sql_query("INSERT INTO " . $GLOBALS['prefix_fw'] . "_event_manager " . " (idClass,recipients,show_level) VALUES " . " ('" . $idClass . "','" . $arr_recipients[$key] . "','" . $arr_show_level[$key] . "') ");
}
} else {
$result1 = sql_query("UPDATE " . $GLOBALS['prefix_fw'] . "_event_class " . " SET platform='" . $platform . "'," . " class='" . $arr_class[$key] . "'," . " description='" . $arr_description[$key] . "'" . " WHERE idClass = '" . (int) $key . "'");
}
if ($result1 === FALSE) {
break;
}
}
foreach ($arr_recipients as $key => $recipients) {
if ($key == 0) {
// do nothing
} else {
$result2 = sql_query("UPDATE " . $GLOBALS['prefix_fw'] . "_event_manager " . " SET recipients='" . $recipients . "'," . " show_level='" . $arr_show_level[$key] . "'" . " WHERE idEventMgr = '" . (int) $key . "'");
}
if ($result1 === FALSE) {
break;
}
}
if ($result1 && $result2) {
$out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')));
} else {
$out->add(getErrorUi($lang->def('_ERROR_IN_SAVE')));
}
}
$out->add($form->openForm('event_special_insert', 'index.php?modname=event_manager&op=special_save'));
$out->add($form->openElementSpace());
$tb_event_classes = new Table(400, $lang->def('_EVENT_SETTINGS'), $lang->def('_EVENT_SETTINGS'));
$content_h = array($lang->def('_EVENT_PLATFORM'), $lang->def('_NAME'), $lang->def('_DESCRIPTION'), $lang->def('_RECIPIENTS'), 'show_level');
$type_h = array('', '', '', 'image', 'image', 'image', 'image', 'image', '');
$tb_event_classes->setColsStyle($type_h);
$tb_event_classes->addHead($content_h);
$rs = sql_query("SELECT ec.idClass, class, platform, description, idEventMgr, recipients, show_level" . " FROM " . $GLOBALS['prefix_fw'] . "_event_class as ec" . " JOIN " . $GLOBALS['prefix_fw'] . "_event_manager as em" . " WHERE ec.idClass = em.idClass" . " ORDER BY ec.idClass");
while (list($idClass, $class, $platform, $description, $idEventMgr, $recipients, $show_level) = sql_fetch_row($rs)) {
$cont = array();
$cont[] = $form->getInputTextfield('', 'platform_' . $idClass, 'platform[' . $idClass . ']', $platform, '', 50, '');
$cont[] = $form->getInputTextfield('', 'class_' . $idClass, 'class[' . $idClass . ']', $class, '', 50, '');
$cont[] = $form->getInputTextfield('', 'description_' . $idClass, 'description[' . $idClass . ']', $description, '', 50, '');
$cont[] = $form->getInputTextfield('', 'recipients_' . $idEventMgr, 'recipients[' . $idEventMgr . ']', $recipients, '', 50, '');
$cont[] = $form->getInputTextfield('', 'show_level_' . $idEventMgr, 'show_level[' . $idEventMgr . ']', $show_level, '', 50, '');
$tb_event_classes->addBody($cont);
}
$cont = array();
$cont[] = $form->getInputTextfield('', 'platform_0', 'platform[0]', '', '', 50, '');
$cont[] = $form->getInputTextfield('', 'class_0', 'class[0]', '', '', 50, '');
$cont[] = $form->getInputTextfield('', 'description_0', 'description[0]', '', '', 50, '');
$cont[] = $form->getInputTextfield('', 'recipients_0', 'recipients[0]', '', '', 50, '');
$cont[] = $form->getInputTextfield('', 'show_level_0', 'show_level[0]', '', '', 50, '');
$tb_event_classes->addBody($cont);
$out->add($tb_event_classes->getTable());
$out->add($form->closeElementSpace());
$out->add($form->openButtonSpace());
$out->add($form->getButton('save', 'save', $lang->def('_SAVE')));
$out->add($form->closeButtonSpace());
$out->add($form->closeForm());
$out->add('</div>');
}
示例13: forumsearchmessage
//.........这里部分代码省略.........
unset($_SESSION['unreaded_forum'][$_SESSION['idCourse']][$id_forum][$id_thread]);
}
if ($ini == 0 && !isset($_GET['result'])) {
sql_query("\r\n\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_forumthread\r\n\t\tSET num_view = num_view + 1\r\n\t\tWHERE idThread = '" . $id_thread . "'");
}
$page_title = array('index.php?modname=forum&op=forum' => $lang->def('_FORUM'), 'index.php?modname=forum&op=search&ini=' . $ini_thread => $thread_title, $lang->def('_SEARCH_RESULT_FOR') . ' : ' . $search_arg);
if ($erased_t && !$mod_perm && !$moderate) {
$GLOBALS['page']->add(getTitleArea($page_title, 'forum') . '<div class="std_block">' . $lang->def('_CANNOTENTER') . '</div>', 'content');
return;
}
// Who have semantic evaluation
$re_sema = sql_query("\r\n\tSELECT DISTINCT idmsg\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forum_sema");
while (list($msg_sema) = sql_fetch_row($re_sema)) {
$forum_sema[$msg_sema] = 1;
}
// Find post
$messages = array();
$authors = array();
$authors_names = array();
$authors_info = array();
$re_message = sql_query("\r\n\tSELECT idMessage, posted, title, textof, attach, locked, author, modified_by, modified_by_on\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forummessage\r\n\tWHERE idThread = '" . $id_thread . "'\r\n\tORDER BY posted\r\n\tLIMIT {$ini}, " . Get::sett('visuItem'));
while ($record = mysql_fetch_assoc($re_message)) {
$messages[$record['idMessage']] = $record;
$authors[$record['author']] = $record['author'];
if ($record['modified_by'] != 0) {
$authors[$record['modified_by']] = $record['modified_by'];
}
}
$authors_names =& $acl_man->getUsers($authors);
$level_name = CourseLevel::getLevels();
// Retriving level and number of post of th authors
$re_num_post = sql_query("\r\n\tSELECT u.idUser, u.level, COUNT(*)\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forummessage AS m, " . $GLOBALS['prefix_lms'] . "_courseuser AS u\r\n\tWHERE u.idCourse = '" . (int) $_SESSION['idCourse'] . "' AND m.author = u.idUser AND m.author IN ( " . implode($authors, ',') . " )\r\n\tGROUP BY u.idUser, u.level");
while (list($id_u, $level_u, $num_post_a) = sql_fetch_row($re_num_post)) {
$authors_info[$id_u] = array('num_post' => $num_post_a, 'level' => $level_name[$level_u]);
}
$type_h = array('forum_sender', 'forum_text');
$cont_h = array($lang->def('_AUTHOR'), $lang->def('_TEXTOF'));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
// Compose messagges display
$path = $GLOBALS['where_files_relative'] . '/appCore/' . Get::sett('pathphoto');
while (list($id_message, $message_info) = each($messages)) {
// sender info
$m_author = $message_info['author'];
if (isset($authors_names[$m_author]) && $authors_names[$m_author][ACL_INFO_AVATAR] != '') {
$img_size = @getimagesize($path . $authors_names[$m_author][ACL_INFO_AVATAR]);
}
$sender = '<div class="forum_author">' . (isset($authors_names[$m_author]) ? $authors_names[$m_author][ACL_INFO_LASTNAME] . $authors_names[$m_author][ACL_INFO_FIRSTNAME] == '' ? $acl_man->relativeId($authors_names[$m_author][ACL_INFO_USERID]) : $authors_names[$m_author][ACL_INFO_LASTNAME] . ' ' . $authors_names[$m_author][ACL_INFO_FIRSTNAME] : $lang->def('_UNKNOWN_AUTHOR')) . '</div>' . '<div class="forum_level">' . $lang->def('_LEVEL') . ' : ' . $authors_info[$m_author]['level'] . '</div>' . (isset($authors_names[$m_author]) && $authors_names[$m_author][ACL_INFO_AVATAR] != '' ? '<img class="forum_avatar' . ($img_size[0] > 150 || $img_size[1] > 150 ? ' image_limit' : '') . '" src="' . $path . $authors_names[$m_author][ACL_INFO_AVATAR] . '" alt="' . $lang->def('_AVATAR') . '" />' : '') . '<div class="forum_numpost">' . $lang->def('_NUMPOST') . ' : ' . (isset($authors_info[$m_author]['num_post']) ? $authors_info[$m_author]['num_post'] : 0) . '</div>' . '<img src="' . getPathImage() . 'standard/identity.png" alt=">" /> ' . '<a href="index.php?modname=forum&op=viewprofile&idMessage=' . $id_message . '&ini=' . $ini_page . '&idThread=' . $id_thread . '">' . $lang->def('_VIEW_PROFILE') . '</a>';
// msg info
$msgtext = '';
$msgtext .= '<div class="forum_post_posted">' . $lang->def('_DATE') . ' : ' . Format::date($message_info['posted']) . ' ( ' . loadDistance($message_info['posted']) . ' )' . '</div>';
if ($message_info['locked']) {
$msgtext .= '<div class="forum_post_locked">' . $lang->def('_LOCKEDMESS') . '</div>';
} else {
if ($message_info['attach'] != '') {
$msgtext .= '<div class="forum_post_attach">' . '<a href="index.php?modname=forum&op=download&id=' . $id_message . '">' . $lang->def('_ATTACHMENT') . ' : ' . '<img src="' . getPathImage() . mimeDetect($message_info['attach']) . '" alt="' . $lang->def('_ATTACHMENT') . '" /></a>' . '</div>';
}
$textof = str_replace('[quote]', '<blockquote class="forum_quote">', str_replace('[/quote]', '</blockquote>', $message_info['textof']));
$msgtext .= '<div class="forum_post_title">' . $lang->def('_SUBJECT') . ' : ' . ($search_arg !== '' ? eregi_replace($search_arg, '<span class="filter_evidence">' . $search_arg . '</span>', $message_info['title']) : $message_info['title']) . '</div>';
$msgtext .= '<div class="forum_post_text">' . ($search_arg !== '' ? eregi_replace($search_arg, '<span class="filter_evidence">' . $search_arg . '</span>', $textof) : $textof) . '</div>';
if ($message_info['modified_by'] != 0) {
$modify_by = $message_info['modified_by'];
$msgtext .= '<div class="forum_post_modified_by">' . $lang->def('_MODIFY_BY') . ' : ' . (isset($authors_names[$modify_by]) ? $authors_names[$modify_by][ACL_INFO_LASTNAME] . $authors_names[$modify_by][ACL_INFO_FIRSTNAME] == '' ? $acl_man->relativeId($authors_names[$modify_by][ACL_INFO_USERID]) : $authors_names[$modify_by][ACL_INFO_LASTNAME] . ' ' . $authors_names[$modify_by][ACL_INFO_FIRSTNAME] : $lang->def('_UNKNOWN_AUTHOR')) . ' ' . $lang->def('_ON') . ' : ' . Format::date($message_info['modified_by_on']) . '</div>';
}
if (isset($authors_names[$m_author]) && $authors_names[$m_author][ACL_INFO_SIGNATURE] != '') {
$msgtext .= '<div class="forum_post_sign_separator"></div>' . '<div class="forum_post_sign">' . $authors_names[$m_author][ACL_INFO_SIGNATURE] . '</div>';
}
}
$content = array($sender, $msgtext);
$tb->addBody($content);
// some action that you can do with this message
$action = '';
if ($moderate || $mod_perm) {
if ($message_info['locked']) {
$action .= '<a href="index.php?modname=forum&op=moderatemessage&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_DEMODERATE') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/demoderate.png" alt="' . $lang->def('_DEMODERATE') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_DEMODERATE') . '</a> ';
} else {
$action .= '<a href="index.php?modname=forum&op=moderatemessage&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_MODERATE') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/moderate.png" alt="' . $lang->def('_MODERATE') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_MODERATE') . '</a> ';
}
}
if (!$locked_t && !$locked_f || $mod_perm || $moderate) {
$action .= '<a href="index.php?modname=forum&op=addmessage&idThread=' . $id_thread . '&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_REPLY') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/reply.png" alt="' . $lang->def('_REPLY') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_QUOTE') . '</a>';
}
if ($moderate || $mod_perm || $m_author == getLogUserId()) {
$action .= '<a href="index.php?modname=forum&op=modmessage&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_MOD_MESSAGE') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_MOD') . '</a>' . '<a href="index.php?modname=forum&op=delmessage&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_DEL') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_DEL') . '</a> ';
}
$tb->addBodyExpanded($action, 'forum_action');
}
if (!$locked_t && !$locked_f || $mod_perm || $moderate) {
$tb->addActionAdd('<a href="index.php?modname=forum&op=addmessage&idThread=' . $id_thread . '&ini=' . $ini_page . '" title="' . $lang->def('_REPLY') . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" /> ' . $lang->def('_REPLY') . '</a>');
}
$GLOBALS['page']->add(getTitleArea($page_title, 'forum') . '<div class="std_block">' . Form::openForm('search_forum', 'index.php?modname=forum&op=search&idThread=' . $id_thread) . '<div class="quick_search_form">' . '<label for="search_arg">' . $lang->def('_SEARCH_LABEL') . '</label> ' . Form::getInputTextfield('search_t', 'search_arg', 'search_arg', $search_arg, $lang->def('_SEARCH'), 255, '') . '<input class="search_b" type="submit" id="search_button" name="search_button" value="' . $lang->def('_SEARCH') . '" />' . '</div>' . Form::closeForm(), 'content');
if ($moderate || $mod_perm) {
$GLOBALS['page']->add('<div class="forum_action_top">' . '<a href="index.php?modname=forum&op=modstatusthread&idThread=' . $id_thread . '&ini=' . $ini_page . '">' . ($locked_t ? '<img src="' . getPathImage() . 'standard/msg_read.png" alt="' . $lang->def('_FREE') . '" /> ' . $lang->def('_FREETHREAD') : '<img src="' . getPathImage() . 'standard/locked.png" alt="' . $lang->def('_LOCKTHREAD') . '" /> ' . $lang->def('_LOCKTHREAD')) . '</a> ' . '<a href="index.php?modname=forum&op=changeerased&idThread=' . $id_thread . '&ini=' . $ini_page . '">' . ($erased_t ? '<img src="' . getPathImage() . 'standard/msg_read.png" alt="' . $lang->def('_UNERASE') . '" /> ' . $lang->def('_UNERASE') : '<img src="' . getPathImage() . 'standard/moderate.png" alt="' . $lang->def('_MODERATE') . '" /> ' . $lang->def('_MODERATE')) . '</a>' . '</div>', 'content');
}
$GLOBALS['page']->add($tb->getTable(), 'content');
if ($moderate || $mod_perm) {
$GLOBALS['page']->add('<div class="forum_action_bottom">' . '<a href="index.php?modname=forum&op=modstatusthread&idThread=' . $id_thread . '&ini=' . $ini_page . '">' . ($locked_t ? '<img src="' . getPathImage() . 'standard/msg_read.png" alt="' . $lang->def('_FREE') . '" /> ' . $lang->def('_FREETHREAD') : '<img src="' . getPathImage() . 'standard/locked.png" alt="' . $lang->def('_LOCKTHREAD') . '" /> ' . $lang->def('_LOCKTHREAD')) . '</a> ' . '<a href="index.php?modname=forum&op=changeerased&idThread=' . $id_thread . '&ini=' . $ini_page . '">' . ($erased_t ? '<img src="' . getPathImage() . 'standard/msg_read.png" alt="' . $lang->def('_UNERASE') . '" /> ' . $lang->def('_UNERASE') : '<img src="' . getPathImage() . 'standard/moderate.png" alt="' . $lang->def('_MODERATE') . '" /> ' . $lang->def('_MODERATE')) . '</a>' . '</div>', 'content');
}
$GLOBALS['page']->add($tb->getNavBar($ini, $tot_message) . '</div>', 'content');
}
示例14: loadCourseSelector
function loadCourseSelector($noprint = false, $with_assesment = false)
{
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
$lang =& DoceboLanguage::createInstance('course', 'lms');
$output = '';
$output .= $this->treeview->load();
// Filter
$this->filter['course_flat'] = isset($_POST['c_flatview']);
//$this->filter['course_code'] = ( isset($_POST['c_filter_code']) ? $_POST['c_filter_code'] : '' );
$this->filter['course_name'] = isset($_POST['c_filter_name']) ? $_POST['c_filter_name'] : '';
if ($this->show_filter === true) {
$output .= '<div class="quick_search_form">' . '<div class="common_options">' . Form::getInputCheckbox('c_flatview', 'c_flatview', '1', Get::req('c_flatview', DOTY_INT, '0') == '1' ? true : false, ' onclick="submit();" ') . ' <label class="label_normal" for="c_flatview">' . Lang::t('_DIRECTORY_FILTER_FLATMODE', 'admin_directory') . '</label>' . ' ' . '</div>' . '<div>' . Form::getInputTextfield("search_t", "c_filter_name", "c_filter_name", Get::req('c_filter_name', DOTY_ALPHANUM, ''), '', 255, '') . Form::getButton("c_filter_set", "c_filter_set", Lang::t('_SEARCH', 'standard'), "search_b") . '</div>' . '</div>';
}
// End Filter
$tb = new Table(Get::sett('visu_course'), $lang->def('_COURSE_LIST'), $lang->def('_COURSE_LIST_SUMMARY'));
$tb->initNavBar('ini', 'button');
$ini = $tb->getSelectedElement();
$category_selected = $this->treeview->getSelectedFolderId();
if ($this->filter['course_flat']) {
$id_categories = $this->treeDB->getDescendantsId($this->treeDB->getFolderById($category_selected));
$id_categories[] = $category_selected;
}
$select = "\r\n\t\tSELECT c.idCourse, c.code, c.name, c.description, c.status, c.difficult,\r\n\t\t\tc.subscribe_method, c.permCloseLo, c.show_rules, c.max_num_subscribe ";
$query_course = "\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_course AS c\r\n\t\tWHERE " . ($with_assesment ? '1' : "c.course_type <> 'assessment'") . " AND c.idCategory IN ( " . (!$this->filter['course_flat'] ? $category_selected : implode(",", $id_categories)) . " )";
if (Docebo::user()->getUserLevelId() != ADMIN_GROUP_GODADMIN) {
$all_courses = false;
require_once _base_ . '/lib/lib.preference.php';
$adminManager = new AdminPreference();
$admin_courses = $adminManager->getAdminCourse(Docebo::user()->getIdST());
$all_courses = false;
if (isset($admin_courses['course'][0])) {
$all_courses = true;
} elseif (isset($admin_courses['course'][-1])) {
require_once _lms_ . '/lib/lib.catalogue.php';
$cat_man = new Catalogue_Manager();
$user_catalogue = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt());
if (count($user_catalogue) > 0) {
$courses = array(0);
foreach ($user_catalogue as $id_cat) {
$catalogue_course =& $cat_man->getCatalogueCourse($id_cat, true);
$courses = array_merge($courses, $catalogue_course);
}
foreach ($courses as $id_course) {
if ($id_course != 0) {
$admin_courses['course'][$id_course] = $id_course;
}
}
} elseif (Get::sett('on_catalogue_empty', 'off') == 'on') {
$all_courses = true;
}
} else {
$array_courses = array();
$array_courses = array_merge($array_courses, $admin_courses['course']);
if (!empty($admin_courses['coursepath'])) {
require_once _lms_ . '/lib/lib.coursepath.php';
$path_man = new CoursePath_Manager();
$coursepath_course =& $path_man->getAllCourses($admin_courses['coursepath']);
$array_courses = array_merge($array_courses, $coursepath_course);
}
if (!empty($admin_courses['catalogue'])) {
require_once _lms_ . '/lib/lib.catalogue.php';
$cat_man = new Catalogue_Manager();
foreach ($admin_courses['catalogue'] as $id_cat) {
$catalogue_course =& $cat_man->getCatalogueCourse($id_cat, true);
$array_courses = array_merge($array_courses, $catalogue_course);
}
}
$admin_courses['course'] = array_merge($admin_courses['course'], $array_courses);
}
if (!$all_courses) {
if (empty($admin_courses['course'])) {
$query_course .= " AND 0 ";
} else {
$query_course .= " AND c.idCourse IN (" . implode(',', $admin_courses['course']) . ") ";
}
}
}
/*
if($this->filter['course_code'] != '') {
$query_course .= " AND c.code LIKE '%".$this->filter['course_code']."%'";
}*/
if ($this->filter['course_name'] != '') {
$query_course .= " AND ( c.code LIKE '%" . $this->filter['course_name'] . "%' OR c.name LIKE '%" . $this->filter['course_name'] . "%' ) ";
}
list($tot_course) = sql_fetch_row(sql_query("SELECT COUNT(*) " . $query_course));
$query_course .= " ORDER BY c.name\r\n\t\t\t\t\t\t\tLIMIT " . $ini . "," . (int) Get::sett('visuItem', 25);
$re_course = sql_query($select . $query_course);
$type_h = array('image', '', '', '');
$cont_h = array('<span class="access-only">' . $lang->def('_COURSE_SELECTION') . '</span>', $lang->def('_CODE'), $lang->def('_COURSE_NAME'), $lang->def('_STATUS'));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$status_array = 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'));
while (list($id_course, $code, $name, $desc, $status, $difficult, $auto_sub, $end_mode, $show_rules, $max_user_sub) = sql_fetch_row($re_course)) {
$tb_content = array(Form::getInputCheckbox('new_course_selected_' . $id_course, 'new_course_selected[' . $id_course . ']', $id_course, isset($this->current_selection[$id_course]), ''), '<label for="new_course_selected_' . $id_course . '">' . $code . '</label>', '<label for="new_course_selected_' . $id_course . '">' . $name . '</label>');
$tb_content[] = $status_array[$status];
$tb->addBody($tb_content);
if (isset($this->current_selection[$id_course])) {
unset($this->current_selection[$id_course]);
}
//.........这里部分代码省略.........
示例15: mod_course_competencesTask
public function mod_course_competencesTask()
{
$id_course = Get::req('id_course', DOTY_INT, 0);
if ($id_course <= 0) {
$this->render('invalid', array('message' => $this->_getErrorMessage("invalid course"), 'back_url' => 'index.php?r=' . $this->base_link_competence . '/show'));
return;
}
$back_url = 'index.php?r=' . $this->base_link_competence . '/man_course&id_course=' . (int) $id_course;
$arr_competences = $this->model->getCourseCompetences($id_course);
require_once _base_ . '/lib/lib.table.php';
$table = new Table();
$label_h = array(Lang::t('_NAME', 'standard'), Lang::t('_DESCRIPTION', 'standard'), Lang::t('_TYPOLOGY', 'competences'), Lang::t('_SCORE', 'competences'));
$style_h = array('', '', 'img-cell', 'img-cell');
$table->addHead($label_h, $style_h);
$counter = 0;
//how many score type competences
$info = $this->model->getCompetencesInfo($arr_competences);
$lang_code = getLanguage();
$std_value = 0;
foreach ($info as $id => $competence) {
if ($competence->type == 'score') {
$counter++;
$line = array();
$line[] = $competence->langs[$lang_code]['name'];
$line[] = $competence->langs[$lang_code]['description'];
$line[] = $competence->typology;
$line[] = Form::getInputTextfield('textfield', 'score_assigned_' . $id, 'score_assigned[' . $id . ']', $std_value, '', 255, '');
$table->addBody($line);
}
}
if ($counter > 0) {
$foot = array(array('colspan' => 3, 'label' => ''), Form::getInputTextfield('textfield', 'score_assigned', false, $std_value, '', 255, '') . '<br />' . Form::getButton('set_score', 'set_score', Lang::t('_SET', 'standard'), false, '', true, false) . Form::getButton('reset_score', 'reset_score', Lang::t('_RESET', 'standard'), false, '', true, false));
$table->addFoot($foot);
$title_arr = array('index.php?r=' . $this->base_link_course . '/show' => Lang::t('_COURSES', 'course'), $back_url => Lang::t('_COMPETENCES', 'competences'), Lang::t('_SCORE'));
$this->render('mod_course_assign_score', array('id_course' => $id_course, 'title_arr' => $title_arr, 'table' => $table));
} else {
//go back to main page, no score to assign
Util::jump_to($back_url);
}
}