本文整理汇总了PHP中Table::addHead方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::addHead方法的具体用法?PHP Table::addHead怎么用?PHP Table::addHead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table::addHead方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modglossarygui
function modglossarygui($object_glos = NULL)
{
checkPerm('view', false, 'storage');
$lang =& DoceboLanguage::createInstance('glossary');
require_once _base_ . '/lib/lib.table.php';
$tableGlossary = new Table(Get::sett('visuItem'), '', $lang->def('_GLOSSARY_SUMMARY'));
$tableGlossary->initNavBar('ini', 'link');
$ini = $tableGlossary->getSelectedElement();
$back_coded = htmlentities(urlencode($object_glos->back_url));
list($title) = sql_fetch_row(sql_query("\r\n\tSELECT title\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_glossary \r\n\tWHERE idGlossary = '" . $object_glos->getId() . "'"));
$reTerm = sql_query("\r\n\tSELECT idTerm, term \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_glossaryterm \r\n\tWHERE idGlossary = '" . $object_glos->getId() . "' \r\n\tORDER BY term \r\n\tLIMIT {$ini}," . Get::sett('visuItem'));
list($num_of_term) = sql_fetch_row(sql_query("\r\n\tSELECT COUNT(*) \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_glossaryterm\r\n\tWHERE idGlossary = '" . $object_glos->getId() . "'"));
if ($title == '') {
$_SESSION['last_error'] = $lang->def('_FILEUNSPECIFIED');
Util::jump_to(Util::str_replace_once('&', '&', $object_glos->back_url) . '&create_result=0');
}
$GLOBALS['page']->add(getTitleArea($lang->def('_GLOSSARY'), 'glossary', $lang->def('_GLOSSARY')) . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&', $object_glos->back_url) . '&mod_result=0', $lang->def('_BACK')) . '<b>' . $lang->def('_GLOSSARY') . ' : ' . $title . '</b><br /><br />' . '<div class="mod_container">' . '<a href="index.php?modname=glossary&op=modglossary&idGlossary=' . $object_glos->getId() . '&back_url=' . $back_coded . '" title="' . $lang->def('_MOD_TITLE') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" /> ' . $lang->def('_MOD_TITLE') . '</a>' . '</div><br />', 'content');
$contentArray = array($lang->def('_TERM'), '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" />', '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_DEL') . '" alt="' . $lang->def('_DEL') . '" />');
$typeArray = array('', 'image', 'image');
$GLOBALS['page']->add($tableGlossary->addHead($contentArray, $typeArray));
while (list($idTerm, $term) = sql_fetch_row($reTerm)) {
$content = array($term, '<a href="index.php?modname=glossary&op=modterm&idTerm=' . $idTerm . '&back_url=' . $back_coded . '" title="' . $lang->def('_MOD') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" /></a>', '<a href="index.php?modname=glossary&op=delterm&idTerm=' . $idTerm . '&back_url=' . $back_coded . '" title="' . $lang->def('_DEL') . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" /></a>');
$tableGlossary->addBody($content);
}
$tableGlossary->addActionAdd('<a href="index.php?modname=glossary&op=addterm&idGlossary=' . $object_glos->getId() . '&back_url=' . $back_coded . '" title="' . $lang->def('_ADDTERM') . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" /> ' . $lang->def('_ADDTERM') . '</a>');
$tableGlossary->setLink('index.php?modname=glossary&op=modglossarygui' . '&idGlossary=' . $object_glos->getId() . '&back_url=' . $back_coded);
$GLOBALS['page']->add($tableGlossary->getTable() . $tableGlossary->getNavBar($ini, $num_of_term) . '</div>', 'content');
}
示例2: mod
public function mod()
{
$id_trans = Get::req('id_trans', DOTY_INT, 0);
if (isset($_POST['undo'])) {
Util::jump_to('index.php?r=alms/transaction/show');
}
if (isset($_POST['save']) || isset($_POST['not_paid'])) {
$product_to_activate = Get::req('product', DOTY_MIXED, array());
$id_user = Get::req('id_user', DOTY_MIXED, 0);
if ($this->model->saveTransaction($product_to_activate, $id_trans, $id_user)) {
$this->model->controlActivation($id_trans, isset($_POST['not_paid']));
Util::jump_to('index.php?r=alms/transaction/show&res=ok');
}
Util::jump_to('index.php?r=alms/transaction/show&res=err');
}
$transaction_info = $this->model->getTransactionInfo($id_trans);
$user_info = $this->acl_man->getUser($transaction_info['id_user'], false);
$user_info[ACL_INFO_USERID] = $this->acl_man->relativeId($user_info[ACL_INFO_USERID]);
require_once _base_ . '/lib/lib.table.php';
$tb = new Table(false, Lang::t('_DETAILS', 'transaction'), Lang::t('_DETAILS', 'transaction'));
$ts = array('', '', 'min-cell', 'image');
$th = array(Lang::t('_CODE', 'transaction'), Lang::t('_NAME', 'transaction'), Lang::t('_PRICE', 'transaction'), Lang::t('_MARK_AS_PAID', 'transaction'));
$tb->setColsStyle($ts);
$tb->addHead($th);
foreach ($transaction_info['product'] as $product_info) {
$tb->addBody(array($product_info['code'], $product_info['name'], $product_info['price'], Form::getInputCheckbox('product_' . $product_info['id_course'] . '_' . $product_info['id_date'] . '_' . $product_info['id_edition'], 'product[' . $product_info['id_course'] . '_' . $product_info['id_date'] . '_' . $product_info['id_edition'] . ']', 1, $product_info['activated'], $product_info['activated'] ? ' disabled="disabled"' : '')));
}
$this->render('mod', array('transaction_info' => $transaction_info, 'user_info' => $user_info, 'tb' => $tb, 'id_trans' => $id_trans));
}
示例3: notes
function notes()
{
checkPerm('view');
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('notes', 'lms');
$nav_bar = new NavBar('ini', Get::sett('visuItem'), 0);
$ini = $nav_bar->getSelectedElement();
$ord = importVar('ord');
$inv = importVar('inv');
switch ($ord) {
case "tit":
$ord = $order = 'title';
if ($inv != 'y') {
$a_down = '&inv=y';
} else {
$order .= ' DESC';
$a_down = '';
}
break;
default:
$ord = $order = 'data';
if ($inv == 'y') {
$a_down = '';
} else {
$order .= ' DESC';
$a_down = '&inv=y';
}
}
$reNotes = sql_query("\r\n\tSELECT idNotes, data, title \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_notes \r\n\tWHERE owner ='" . getLogUserId() . "' AND idCourse='" . $_SESSION['idCourse'] . "' \r\n\tORDER BY {$order} \r\n\tLIMIT {$ini}," . Get::sett('visuItem'));
list($num_notes) = sql_fetch_row(sql_query("SELECT COUNT(*) \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_notes \r\n\tWHERE owner ='" . getLogUserId() . "' AND idCourse='" . $_SESSION['idCourse'] . "' "));
$nav_bar->setElementTotal($num_notes);
$img_up = '<img class="valing-middle" src="' . getPathImage() . 'standard/up_arrow.png" alt="' . $lang->def('_UP') . '"/>';
$img_down = '<img class="valing-middle" src="' . getPathImage() . 'standard/down_arrow.png" alt="' . $lang->def('_DOWN') . '"/>';
$tb = new Table(Get::sett('visuItem'), $lang->def('_NOTES'), $lang->def('_NOTES'));
$contentH = array(($ord == 'data' ? $inv == 'y' ? $img_up : $img_down : '') . '<a href="index.php?modname=notes&op=notes' . $a_down . '"> ' . $lang->def('_DATE') . '</a>', ($ord == 'title' ? $inv == 'y' ? $img_up : $img_down : '') . '<a href="index.php?modname=notes&op=notes&ord=tit' . $a_down . '">' . $lang->def('_TITLE') . '</a>', '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" />', '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_DEL') . '" alt="' . $lang->def('_DEL') . '" />');
$typeH = array('min-cell', '', 'image', 'image');
$tb->setColsStyle($typeH);
$tb->addHead($contentH);
while (list($idNotes, $data, $title) = sql_fetch_row($reNotes)) {
$content = array(Format::date($data), '<a href="index.php?modname=notes&op=displaynotes&idNotes=' . $idNotes . '" title="' . $lang->def('_MORET') . '">' . $title . '</a>', '<a href="index.php?modname=notes&op=modnotes&idNotes=' . $idNotes . '">
<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" /></a>', '<a id="delnotes_' . $idNotes . '"' . ' href="index.php?modname=notes&op=delnotes&idNotes=' . $idNotes . '"' . ' title="' . $lang->def('_TITLE') . ' : ' . strip_tags(str_replace(array('"', "'"), '', $title)) . '">
<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" /></a>');
$tb->addBody($content);
}
$tb->addActionAdd('<a href="index.php?modname=notes&op=addnotes">' . '<img src="' . getPathImage() . 'standard/add.png" title="' . $lang->def('_ADD') . '" alt="' . $lang->def('_ADD') . '" /> ' . $lang->def('_ADD_NOTES') . '</a>');
$GLOBALS['page']->add(getTitleArea(array($lang->def('_NOTES')), 'notes') . '<div class="std_block">', 'content');
if (isset($_POST['result'])) {
switch ($_POST['result']) {
case "ok":
$GLOBALS['page']->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')), 'content');
case "err":
$GLOBALS['page']->add(getErrorUi($lang->def('_OPERATION_FAILURE')), 'content');
}
}
$GLOBALS['page']->add($tb->getTable() . $nav_bar->getNavBar($ini), 'content');
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=delnotes]');
$GLOBALS['page']->add('</div>', 'content');
}
示例4: fileList
function fileList(&$url)
{
checkPerm('view');
require_once _base_ . '/lib/lib.tab.php';
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
$file_man = new MyFile(getLogUserId());
$tab_man = new TabView('myfiles', '');
$lang =& DoceboLanguage::createInstance('myfiles');
$areas = $file_man->getFilesAreas();
while (list($id_page, $area_name) = each($areas)) {
$new_tab = new TabElemDefault($id_page, $lang->def($area_name), getPathImage('fw') . 'myfiles/' . $id_page . '.gif');
$tab_man->addTab($new_tab);
}
$tab_man->parseInput($_POST, $_SESSION);
$active_tab = $tab_man->getActiveTab();
if (!$active_tab) {
$active_tab = importVar('working_area', false, $file_man->getDefaultArea());
$tab_man->setActiveTab($active_tab);
}
$GLOBALS['page']->addStart(Form::openForm('tab_myfiles', $url->getUrl('op=myfiles')) . Form::getHidden('working_area', 'working_area', $active_tab) . $tab_man->printTabView_Begin('', false), 'content');
$GLOBALS['page']->addEnd($tab_man->printTabView_End() . Form::closeForm(), 'content');
$tb = new Table(0, $lang->def('_MYFILES_CAPTION'), $lang->def('_MYFILES_SUMMARY'));
$cont_h = array($lang->def('_TITLE'), $lang->def('_FILE_POLICY'), '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" />', '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_REM_FILE') . '" alt="' . $lang->def('_DEL') . '" />');
$type_h = array('', 'image nowrap', 'image', 'image');
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$re_files = $file_man->getFileList($active_tab, false, MYFILE_TITLE);
while ($file_info = $file_man->fetch_row($re_files)) {
$cont = array($file_info[MYFILE_TITLE]);
switch ($file_info[MYFILE_POLICY]) {
case MF_POLICY_FREE:
$cont[] = $lang->def('_MF_POLICY_FREE');
break;
case MF_POLICY_TEACHER:
$cont[] = $lang->def('_MF_POLICY_TEACHER');
break;
case MF_POLICY_FRIENDS:
$cont[] = $lang->def('_MF_POLICY_FRIENDS');
break;
case MF_POLICY_TEACHER_AND_FRIENDS:
$cont[] = $lang->def('_MF_POLICY_TEACHER_AND_FRIENDS');
break;
case MF_POLICY_NOONE:
$cont[] = $lang->def('_MF_POLICY_NOONE');
break;
}
$cont[] = '<a href="' . $url->getUrl('op=modfiles&working_area=' . $active_tab . '&id_file=' . $file_info[MYFILE_ID_FILE]) . '">' . '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . ' : ' . $file_info[MYFILE_TITLE] . '" alt="' . $lang->def('_MOD') . '" />' . '</a>';
$cont[] = '<a href="' . $url->getUrl('op=delfiles&id_file=' . $file_info[MYFILE_ID_FILE]) . '">' . '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_REM_FILE') . ' : ' . $file_info[MYFILE_TITLE] . '" alt="' . $lang->def('_DEL') . '" />' . '</a>';
$tb->addBody($cont);
}
$tb->addActionAdd('<p class="new_elem_link"><a href="' . $url->getUrl('op=modfiles&working_area=' . $active_tab) . '">' . $lang->def('_ADD_' . $active_tab) . '</a></p>');
$tb->addActionAdd('<p>' . '<a href="' . $url->getUrl('modname=profile&op=profile&id_user=' . getLogUserId() . '&ap=view_files&type=' . $active_tab . '&from=1') . '">' . '<img src="' . getPathImage('fw') . 'myfiles/' . $active_tab . '.gif" title="' . $lang->def($active_tab) . '" alt="' . $lang->def('_VIEW_' . $active_tab) . '" />' . '</a>' . '<a href="' . $url->getUrl('modname=profile&op=profile&id_user=' . getLogUserId() . '&ap=view_files&type=' . $active_tab . '&from=1') . '">' . $lang->def('_VIEW_' . $active_tab) . '</a></p>');
$GLOBALS['page']->add($tb->getTable(), 'content');
}
示例5: getPermissionUi
function getPermissionUi($form_name, $perm)
{
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('manmenu');
$lang_perm =& DoceboLanguage::createInstance('permission');
$tokens = $this->getAllToken();
$levels = CourseLevel::getLevels();
$tb = new Table(0, $lang->def('_VIEW_PERMISSION'), $lang->def('_EDIT_SETTINGS'));
$c_head = array($lang->def('_LEVELS'));
$t_head = array('');
foreach ($tokens as $k => $token) {
if ($token['code'] != 'view') {
if (isset($token['image'])) {
$c_head[] = '<img src="' . getPathImage() . $token['image'] . '" alt="' . $lang_perm->def($token['name']) . '"' . ' title="' . $lang_perm->def($token['name']) . '" />';
} else {
$c_head[] = $lang_perm->def($token['name']);
}
$t_head[] = 'image';
}
}
if (count($tokens) > 1) {
$c_head[] = '<img src="' . getPathImage() . 'standard/checkall.png" alt="' . $lang->def('_CHECKALL') . '" />';
$c_head[] = '<img src="' . getPathImage() . 'standard/uncheckall.png" alt="' . $lang->def('_UNCHECKALL') . '" />';
$t_head[] = 'image';
$t_head[] = 'image';
}
$tb->setColsStyle($t_head);
$tb->addHead($c_head);
while (list($lv, $levelname) = each($levels)) {
$c_body = array($levelname);
foreach ($tokens as $k => $token) {
if ($token['code'] != 'view') {
$c_body[] = '<input class="check" type="checkbox" ' . 'id="perm_' . $lv . '_' . $token['code'] . '" ' . 'name="perm[' . $lv . '][' . $token['code'] . ']" value="1"' . (isset($perm[$lv][$token['code']]) ? ' checked="checked"' : '') . ' />' . '<label class="access-only" for="perm_' . $lv . '_' . $token['code'] . '">' . $lang_perm->def($token['name']) . '</label>' . "\n";
}
}
if (count($tokens) > 1) {
$c_body[] = '<img class="handover"' . ' onclick="checkall(\'' . $form_name . '\', \'perm[' . $lv . ']\', true); return false;"' . ' src="' . getPathImage() . 'standard/checkall.png" alt="' . $lang->def('_CHECKALL') . '" />';
$c_body[] = '<img class="handover"' . ' onclick="checkall(\'' . $form_name . '\', \'perm[' . $lv . ']\', false); return false;"' . ' src="' . getPathImage() . 'standard/uncheckall.png" alt="' . $lang->def('_UNCHECKALL') . '" />';
}
$tb->addBody($c_body);
}
$c_select_all = array('');
foreach ($tokens as $k => $token) {
if ($token['code'] != 'view') {
$c_select_all[] = '<img class="handover"' . ' onclick="checkall_fromback(\'' . $form_name . '\', \'[' . $token['code'] . ']\', true); return false;"' . ' src="' . getPathImage() . 'standard/checkall.png" alt="' . $lang->def('_CHECKALL') . '" />' . '<img class="handover"' . ' onclick="checkall_fromback(\'' . $form_name . '\', \'[' . $token['code'] . ']\', false); return false;"' . ' src="' . getPathImage() . 'standard/uncheckall.png" alt="' . $lang->def('_UNCHECKALL') . '" />';
}
}
if (count($tokens) > 1) {
$c_select_all[] = '';
$c_select_all[] = '';
}
$tb->addBody($c_select_all);
return $tb->getTable();
}
示例6: reportList
function reportList()
{
checkPerm('view');
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('report', 'framework');
$_SESSION['report_tempdata'] = array();
$can_mod = checkPerm('mod', true);
$acl_man = Docebo::aclm();
$public_admin_mod = true;
$query = "SELECT t1.*, t2.userid \r\n\tFROM %lms_report_filter as t1 \r\n\t\tLEFT JOIN %adm_user as t2 ON t1.author=t2.idst\r\n\tWHERE t1.is_public = 1 OR t1.author = " . Docebo::user()->getId();
$tb = new Table();
$tb->initNavBar('ini', 'button');
$col_type = array('', 'align_center', 'align_center', 'image');
$col_content = array($lang->def('_NAME'), $lang->def('_TAB_REP_CREATOR', 'report', 'framework'), $lang->def('_CREATION_DATE'), '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS') . '" title="' . $lang->def('REPORT_SHOW_RESULTS') . '" />');
if ($public_admin_mod && $can_mod) {
$col_type[] = 'image';
$col_content[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" title="' . $lang->def('_MOD') . '"/>';
$col_type[] = 'image';
$col_content[] = '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" title="' . $lang->def('_DEL') . '"/>';
}
$tb->setColsStyle($col_type);
$tb->addHead($col_content);
$res = sql_query($query);
if ($res) {
while ($row = sql_fetch_assoc($res)) {
$id = $row['id_filter'];
$opn_link = '<a href="index.php?modname=public_report_admin&op=view_report&idrep=' . $id . '" ' . ' title="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '" />' . '</a>';
$tb_content = array($row['author'] == 0 ? $lang->def($row['filter_name']) : $row['filter_name'], $row['author'] == 0 ? '<div class="align_center">-</div>' : $acl_man->relativeId($row['userid']), Format::date($row['creation_date']), $opn_link);
if ($public_admin_mod && $can_mod) {
if ($row['author'] == Docebo::user()->getId()) {
$tb_content[] = '<a href="index.php?modname=public_report_admin&op=modify_name&modid=' . $id . '" ' . ' title="' . $lang->def('_MOD', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD', 'report', 'framework') . '" />' . '</a>';
} else {
$tb_content[] = '';
}
if ($row['author'] == Docebo::user()->getId()) {
$tb_content[] = '<a href="index.php?modname=public_report_admin&op=del_public_report&idrep=' . $id . '" ' . ' title="' . $lang->def('_DEL', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL', 'report', 'framework') . '" />' . '</a>';
} else {
$tb_content[] = '';
}
}
$tb->addBody($tb_content);
}
}
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=del_public_report]');
if ($public_admin_mod && $can_mod) {
$tb->addActionAdd('<a href="index.php?modname=public_report_admin&op=create_name">' . '<img src="' . getPathImage() . 'standard/add.png" title="' . $lang->def('_NEW') . '" /> ' . $lang->def('_NEW') . '</a>');
}
cout(getTitleArea($lang->def('_REPORT')) . '<div class="std_block">' . $tb->getTable() . '</div>', 'content');
}
示例7: listroom
function listroom()
{
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('admin_config', 'scs');
$out =& $GLOBALS['page'];
$mod_perm = checkPerm('mod', true);
$out->setWorkingZone('content');
$out->add(getTitleArea($lang->def('_ROOM_MAN'), 'admin_conf') . '<div class="std_block">');
$tb_room = new Table(0, $lang->def('_ALL_ROOMS'), $lang->def('_ALL_ROOMS_SUMMARY'));
$cont_h = array($lang->def('_ROOM_NAME'), $lang->def('_ROOM_TYPE'));
$type_h = array('', 'align_center');
if ($mod_perm) {
$cont_h[] = '<img src="' . getPathImage('fw') . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />';
$type_h[] = 'image';
$cont_h[] = '<img src="' . getPathImage('fw') . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />';
$type_h[] = 'image';
}
$tb_room->setColsStyle($type_h);
$tb_room->addHead($cont_h);
$query_rooms = "\r\n\tSELECT id_room, room_name, room_type \r\n\tFROM " . $GLOBALS['prefix_scs'] . "_rules_room ";
$re_rooms = sql_query($query_rooms);
while (list($id_room, $room_name, $room_type) = sql_fetch_row($re_rooms)) {
$cont = array($room_name);
switch ($room_type) {
case "course":
$cont[] = $lang->def('_COURSE');
break;
case "private":
$cont[] = $lang->def('_PRIVATE');
break;
case "public":
$cont[] = $lang->def('_PUBLIC');
break;
}
if ($mod_perm) {
$cont[] = '<a href="index.php?modname=room&op=modroom&id_room=' . $id_room . '"' . ' title="' . $lang->def('_MOD') . ' : ' . $room_name . '">' . '<img src="' . getPathImage('fw') . 'standard/edit.png" alt="' . $lang->def('_MOD') . ' : ' . $room_name . '" /></a>';
$cont[] = '<a href="index.php?modname=room&op=delroom&id_room=' . $id_room . '"' . ' title="' . $lang->def('_DEL') . ' : ' . $room_name . '">' . '<img src="' . getPathImage('fw') . 'standard/delete.png" alt="' . $lang->def('_DEL') . ' : ' . $room_name . '" /></a>';
}
$tb_room->addBody($cont);
}
if ($mod_perm) {
$tb_room->addActionAdd('<a href="index.php?modname=room&op=newroom">' . '<img src="' . getPathImage('fw') . 'standard/add.png" alt="' . $lang->def('_NEW_ROOM') . '" />' . ' ' . $lang->def('_NEW_ROOM') . '</a>');
}
$out->add($tb_room->getTable());
$out->add('</div>');
}
示例8: mycompetences
function mycompetences(&$url)
{
checkPerm('view');
$html = "";
$html .= getTitleArea(Lang::t('_COMPETENCES'), 'competences');
$html .= '<div class="std_block">';
$cmodel = new CompetencesAdm();
$fmodel = new FunctionalrolesAdm();
$id_user = getLogUserId();
$ucomps = $cmodel->getUserCompetences($id_user);
$rcomps = $fmodel->getUserRequiredCompetences($id_user);
$ucomps_info = $cmodel->getCompetencesInfo(array_keys($ucomps));
$language = getLanguage();
$_typologies = $cmodel->getCompetenceTypologies();
$_types = $cmodel->getCompetenceTypes();
$icon_actv = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_COMPETENCE_OBTAINED', 'competences') . '</span></span>';
$icon_req = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_MANDATORY', 'competences') . '</span></span>';
//*******************
require_once _base_ . '/lib/lib.table.php';
$table = new Table(Get::sett('visuItem'), Lang::t('_COMPETENCES'), Lang::t('_COMPETENCES'));
$style_h = array('', '', 'image', 'image', 'image', 'image', 'image');
$label_h = array(Lang::t('_NAME', 'competences'), Lang::t('_TYPOLOGY', 'competences'), Lang::t('_TYPE', 'standard'), Lang::t('_SCORE', 'competences'), Lang::t('_DATE_LAST_COMPLETE', 'subscribe'), Lang::t('_COMPETENCES_REQUIRED', 'competences'));
$table->addHead($label_h, $style_h);
foreach ($ucomps_info as $id_competence => $cinfo) {
$line = array();
$line[] = $cinfo->langs[$language]['name'];
$line[] = $_typologies[$cinfo->typology];
$line[] = $_types[$cinfo->type];
$line[] = $cinfo->type == 'score' ? '<b>' . $ucomps[$id_competence]->score_got . '</b>' : $icon_actv;
$line[] = Format::date($ucomps[$id_competence]->last_assign_date, 'datetime');
$line[] = array_key_exists($id_competence, $rcomps) ? $icon_req : '';
$table->addBody($line);
}
$html .= $table->getTable();
$html .= '</div>';
$html .= Form::openForm('beck_url', 'index.php');
$html .= Form::openButtonSpace();
$html .= Form::getButton('close', 'close', Lang::t('_CLOSE', 'standard'));
$html .= Form::closeButtonSpace();
$html .= Form::closeform();
cout($html, 'content');
}
示例9: loadMaterials
function loadMaterials($idCourse)
{
$mod_perm = checkPerm('mod', true);
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('course');
$re_file = sql_query("\r\n\tSELECT id_file, title, path \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course_file \r\n\tWHERE id_course='" . $idCourse . "'");
if (!mysql_num_rows($re_file) && !$mod_perm) {
return '';
}
$tb = new Table(0, $lang->def('_MATERIALS'), $lang->def('_MATERIALS_TABLE'));
$cont_h = array($lang->def('_TITLE'));
$type_h = array('');
if ($mod_perm) {
$cont_h[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />';
$type_h[] = 'image';
$cont_h[] = '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />';
$type_h[] = 'image';
}
//$tb->setTableStyle('');
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$html = '<div class="floating_box">';
if (mysql_num_rows($re_file)) {
while (list($idFile, $title, $file) = sql_fetch_row($re_file)) {
$cont = array('<a href="index.php?modname=course&op=downloadcourse&id=' . $idFile . '">' . '<img src="' . getPathImage('fw') . mimeDetect($file) . '" alt="mime-type" /> ' . $title . '</a>');
if ($mod_perm) {
$cont[] = '<a href="index.php?modname=course&op=modfiles&id_file=' . $idFile . '" title="' . $lang->def('_MOD') . ' : ' . $title . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . ' : ' . $title . '" /></a>';
$cont[] = '<a href="index.php?modname=course&op=remfiles&id_file=' . $idFile . '" title="' . $lang->def('_DEL') . ' : ' . $title . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . ' : ' . $title . '" /></a>';
}
$tb->addBody($cont);
}
$html .= $tb->getTable();
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=remfiles]');
}
if ($mod_perm) {
$html .= '<br/>' . '<a class="ico-wt-sprite subs_add" href="index.php?modname=course&op=addfiles">' . '<span>' . $lang->def('_ADDFILE') . '</span></a>';
}
$html .= '</div>';
return $html;
}
示例10: modlinkgui
function modlinkgui($object_link)
{
checkPerm('view', false, 'storage');
$lang =& DoceboLanguage::createInstance('link');
require_once _base_ . '/lib/lib.table.php';
$del_perm = checkPerm('view', false, 'storage');
$back_coded = htmlentities(urlencode($object_link->back_url));
$textQuery = "\r\n\tSELECT idLink, title, link_address, sequence \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_link \r\n\tWHERE idCategory = '" . $object_link->getId() . "' \r\n\tORDER BY sequence";
$result = sql_query($textQuery);
$num_link = mysql_num_rows($result);
list($title_cat) = sql_fetch_row(sql_query("\r\n\tSELECT title\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_link_cat \r\n\tWHERE idCategory = '" . $object_link->getId() . "'"));
$GLOBALS['page']->add(getTitleArea($lang->def('_SECT_LINK'), 'link') . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&', $object_link->back_url) . '&mod_result=0', $lang->def('_BACK')) . '<b>' . $lang->def('_TITLE') . ' : ' . $title_cat . '</b><br /><br />' . '<div class="mod_container">' . '<a href="index.php?modname=link&op=modlinkcat&idCategory=' . $object_link->getId() . '&back_url=' . $back_coded . '" title="' . $lang->def('_MOD_TITLE') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" /> ' . $lang->def('_MOD_TITLE') . '</a>' . '</div><br />', 'content');
$tableCat = new Table(0, '', $lang->def('_SUMMARY_LINK'));
$contentH = array($lang->def('_QUESTION'), $lang->def('_URL'), '<img src="' . getPathImage() . 'standard/down.png" alt="' . $lang->def('_DOWN') . '" title="' . $lang->def('_MOVE_DOWN') . '" />', '<img src="' . getPathImage() . 'standard/up.png" alt="' . $lang->def('_UP') . '" title="' . $lang->def('_MOVE_UP') . '" />', '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" title="' . $lang->def('_MOD') . '" />', '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" title="' . $lang->def('_DEL') . '" />');
$typeH = array('', 'image', 'image', 'image', 'image', 'image');
$tableCat->setColsStyle($typeH);
$tableCat->addHead($contentH);
$i = 1;
while (list($idLink, $title, $link_address, $seq) = sql_fetch_row($result)) {
$rowContent = array($seq . ') ' . $title, $link_address);
if ($i != $num_link) {
$rowContent[] = '<a href="index.php?modname=link&op=movedown&idLink=' . $idLink . '&back_url=' . $back_coded . '">' . '<img src="' . getPathImage() . 'standard/down.png" alt="' . $lang->def('_DOWN') . '" title="' . $lang->def('_MOVE_DOWN') . '" /></a>';
} else {
$rowContent[] = ' ';
}
if ($i != 1) {
$rowContent[] = '<a href="index.php?modname=link&op=moveup&idLink=' . $idLink . '&back_url=' . $back_coded . '">' . '<img src="' . getPathImage() . 'standard/up.png" alt="' . $lang->def('_UP') . '" title="' . $lang->def('_MOVE_UP') . '" /></a>';
} else {
$rowContent[] = ' ';
}
$rowContent[] = '<a href="index.php?modname=link&op=modlink&idLink=' . $idLink . '&back_url=' . $back_coded . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" title="' . $lang->def('_MOD') . '" /></a>';
$rowContent[] = '<a href="index.php?modname=link&op=dellink&idLink=' . $idLink . '&back_url=' . $back_coded . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" title="' . $lang->def('_DEL') . '" /></a>';
$tableCat->addBody($rowContent);
++$i;
}
$tableCat->addActionAdd('<a href="index.php?modname=link&op=newlink&idCategory=' . $object_link->getId() . '&back_url=' . $back_coded . '" title="' . $lang->def('_ADDLINKT') . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" /> ' . $lang->def('_ADDLINK') . '</a>');
$GLOBALS['page']->add($tableCat->getTable() . '<span class="text_bold text_little">[ ' . '<a href="index.php?modname=link&op=fixsequence&idCategory=' . $object_link->getId() . '&back_url=' . $back_coded . '">' . $lang->def('_FIX_SEQUENCE') . '</a>' . ' ]</span>' . '</div>', 'content');
}
示例11: mycertificate
function mycertificate(&$url)
{
checkPerm('view');
require_once _lms_ . '/lib/lib.course.php';
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('profile', 'framework');
$lang =& DoceboLanguage::createInstance('course', 'lms');
$lang =& DoceboLanguage::createInstance('certificate', 'lms');
$admin_level = Docebo::user()->getUserLevelId();
$show_preview = true;
//($admin_level == ADMIN_GROUP_ADMIN || $admin_level == ADMIN_GROUP_GODADMIN);
$title = $lang->def('_MY_CERTIFICATE', 'certificate');
$html = getTitleArea($title, 'mycertificate') . '<div class="std_block">';
//--- draw time periods dropdown ---------------------------------------------
$period_start = '';
$period_end = '';
//extract checking period
$p_model = new TimeperiodsAlms();
$year = date("Y");
$p_list = array("0" => $lang->def('_ALL'));
$p_selected = Get::req('selected_period', DOTY_INT, 0);
$p_data = $p_model->getTimePeriods('', true);
if (count($p_data) > 0) {
foreach ($p_data as $obj) {
$p_list[$obj->id_period] = Format::date($obj->start_date, 'date') . ' - ' . Format::date($obj->end_date, 'date');
if ($p_selected == $obj->id_period) {
$period_start = $obj->start_date;
$period_end = $obj->end_date;
}
}
}
if (!array_key_exists($p_selected, $p_list)) {
$p_selected = 0;
$period_start = '';
$period_end = '';
}
//date dropdown
$onchange = ' onchange="javascript:this.form.submit();"';
$html_filter_cert = '' . Form::openForm('selected_period_form_cert', $url->getUrl()) . Form::openElementSpace() . Form::getDropdown(Lang::t('_TIME_PERIODS', 'menu'), 'selected_period_cert', 'selected_period', $p_list, $p_selected, '', '', $onchange) . Form::closeElementSpace() . Form::getHidden('current_tab_cert', 'current_tab', Get::req('current_tab', DOTY_STRING, 'cert')) . Form::getHidden('is_filtering_cert', 'is_filtering_cert', 1) . Form::closeForm();
$html_filter_meta = '' . Form::openForm('selected_period_form_meta', $url->getUrl()) . Form::openElementSpace() . Form::getDropdown(Lang::t('_TIME_PERIODS', 'menu'), 'selected_period_meta', 'selected_period', $p_list, $p_selected, '', '', $onchange) . Form::closeElementSpace() . Form::getHidden('current_tab_meta', 'current_tab', Get::req('current_tab', DOTY_STRING, 'meta')) . Form::getHidden('is_filtering_meta', 'is_filtering_meta', 1) . Form::closeForm();
//----------------------------------------------------------------------------
$cert = new Certificate();
/*
* Print certificates tables, subdivided by year and course type
*/
$html_cert = '';
$tb_cert = new Table(0);
$cont_h = array($lang->def('_YEAR', 'standard'), $lang->def('_COURSE_CODE', 'course'), $lang->def('_COURSE', 'course'), $lang->def('_CERTIFICATE_NAME', 'course'), $lang->def('_DATE_END', 'course'));
//if ($show_preview) $cont_h[] = '<img src="'.getPathImage('lms').'certificate/preview.gif" alt="'.$lang->def('_PREVIEW').'" />';
//$cont_h[] = '<img src="'.getPathImage('lms').'certificate/certificate.gif" alt="'.$lang->def('_ALT_TAKE_A_COPY').'" />';
if ($show_preview) {
$cont_h[] = '<span class="ico-sprite subs_view"><span>' . $lang->def('_PREVIEW') . '"</span></span>';
}
$cont_h[] = '<span class="ico-sprite subs_pdf"><span>' . $lang->def('_ALT_TAKE_A_COPY') . '</span></span>';
$type_h = array('img-cell', '', '', 'align-center', 'align-center', 'img-cell', 'img-cell');
if ($show_preview) {
$type_h[] = 'nowarp';
}
$type_h[] = 'nowarp';
$tb_cert->setColsStyle($type_h);
$tb_cert->addHead($cont_h);
$available_cert = $cert->certificateForCourses(false, false);
$released = $cert->certificateReleased(Docebo::user()->getIdST());
$query_courses = "" . " SELECT c.idCourse, c.code, c.name, u.status AS user_status, c.course_type, c.permCloseLO " . " FROM %lms_course AS c JOIN %lms_courseuser AS u ON (c.idCourse = u.idCourse) " . " WHERE u.idUser = '" . Docebo::user()->getIdST() . "' " . ($period_start != '' ? " AND u.date_complete >= '" . $period_start . "' " : "") . ($period_end != '' ? " AND u.date_complete <= '" . $period_end . "' " : "") . " ORDER BY u.date_complete DESC, u.status DESC ";
$course_list = sql_query($query_courses);
$arr_courses = array();
$arr_courses_ids = array();
while ($obj = sql_fetch_object($course_list)) {
$arr_courses[$obj->course_type][] = array($obj->idCourse, $obj->code, $obj->name, $obj->user_status, $obj->permCloseLO);
$arr_courses_ids[] = $obj->idCourse;
}
$arr_course_types = getCourseTypes();
$table_displayed = false;
//extract certificates details and availability by courses ids
$arr_courses_ids = array_unique($arr_courses_ids);
$arr_certificates_availability = array();
$arr_certificates_details = array();
if (count($arr_courses_ids) > 0) {
$query = "SELECT id_certificate, id_course, available_for_status " . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_course" . " WHERE id_course IN (" . implode(",", $arr_courses_ids) . ")";
//." WHERE id_certificate = '".$id_cert."'"
//." AND id_course IN (".implode(",", $arr_courses_ids).")";
$res = sql_query($query);
while (list($id_certificate, $id_course, $available_for_status) = sql_fetch_row($res)) {
$arr_certificates_availability[$id_course][$id_certificate] = $available_for_status;
}
$cont = array();
$query = "SELECT idCourse, date_inscr, date_first_access, date_complete, status" . " FROM %lms_courseuser WHERE idUser = '" . Docebo::user()->getIdST() . "'" . " AND idCourse IN (" . implode(",", $arr_courses_ids) . ") " . ($period_start != '' ? " AND date_complete >= '" . $period_start . "' " : "") . ($period_end != '' ? " AND date_complete <= '" . $period_end . "' " : "");
$res = sql_query($query);
while (list($id_course, $date_inscr, $date_begin, $date_end, $status) = sql_fetch_row($res)) {
$arr_certificate_details[$id_course] = array($date_inscr, $date_begin, $date_end, $status);
}
}
//order arr_courses by key
ksort($arr_courses);
$years = array();
foreach ($arr_courses as $course_type => $course_data) {
if (in_array($course_type, array_keys($arr_course_types))) {
//$html .= '';
$tb = new Table(0);
$tb->setColsStyle($type_h);
//.........这里部分代码省略.........
示例12: 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');
}
}
示例13: Table
<?php
Get::title(array('index.php?r=alms/enrollrules/show' => Lang::t('_ENROLLRULES', 'enrollrules'), 'index.php?r=alms/enrollrules/showlog' => Lang::t('_SHOW_LOGS', 'enrollrules'), Lang::t('_DETAILS', 'enrollrules')));
?>
<div class="std_block">
<?php
$tb = new Table();
$tb->addHead(array(Lang::t('_USERNAME', 'enrollrules'), Lang::t('_LASTNAME', 'enrollrules'), Lang::t('_FIRSTNAME', 'enrollrules'), Lang::t('_CODE', 'enrollrules'), Lang::t('_COURSE_NAME', 'enrollrules')), array('min-cell', '', '', 'min-cell', ''));
while (list(, $obj) = each($data)) {
$row = array(Docebo::aclm()->relativeId($obj->userid), $obj->lastname, $obj->firstname, $obj->code, $obj->name);
$tb->addBody($row);
}
echo $tb->getTable();
?>
</div>
示例14: loadCoursepathSelector
function loadCoursepathSelector($noprint = false)
{
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
$lang =& DoceboLanguage::createInstance('coursepath', 'lms');
$output = '';
// Filter
$this->filter['coursepath_name'] = isset($_POST['coursepath_filter_name']) ? $_POST['coursepath_filter_name'] : '';
if ($this->show_filter === true) {
/*
$form = new Form();
$output .= $form->getOpenFieldset($lang->def('_COURSEPATH_FILTER'))
.Form::getTextfield($lang->def('_NAME'), 'coursepath_filter_name', 'coursepath_filter_name', '255',
( isset($_POST['coursepath_filter_name']) ? $_POST['coursepath_filter_name'] : '' ))
.$form->openButtonSpace()
.$form->getButton('coursepath_filter', 'coursepath_filter', $lang->def('_SEARCH'))
.$form->closeButtonSpace()
.$form->getCloseFieldset();*/
$output .= '<div class="quick_search_form">' . '<div>' . Form::getInputTextfield("search_t", "coursepath_filter_name", "coursepath_filter_name", Get::req('coursepath_filter_name', DOTY_MIXED, ''), '', 255, '') . Form::getButton("coursepath_filter", "coursepath_filter", Lang::t('_SEARCH', 'standard'), "search_b") . '</div>' . '</div>';
}
// End Filter
$tb = new Table(Get::sett('visuItem'), $lang->def('_COURSE_PATH_CAPTION'), $lang->def('_COURSE_PATH_SUMMARY'));
$tb->initNavBar('ini_cpath', 'button');
$ini = $tb->getSelectedElement();
$select = "\r\n\t\tSELECT id_path, path_name, path_descr ";
$query_coursepath = "\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_coursepath\r\n\t\tWHERE 1 ";
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])) {
$query = "SELECT id_path" . " FROM %lms_coursepath_user" . " WHERE idUser = '" . $id_user . "'";
$result = sql_query($query);
$admin_courses['coursepath'] = array();
while (list($id_path) = sql_fetch_row($result)) {
$admin_courses['coursepath'][$id_path] = $id_path;
}
if (!empty($admin_courses['coursepath']) && Get::sett('on_catalogue_empty', 'off') == 'on') {
$all_courses = true;
}
}
if (!$all_courses) {
if (empty($admin_courses['coursepath'])) {
$query_coursepath .= " AND 0 ";
} else {
$query_coursepath .= " AND id_path IN (" . implode(',', $admin_courses['coursepath']) . ") ";
}
}
}
if ($this->filter['coursepath_name'] != '') {
$query_coursepath .= " AND path_name LIKE '%" . $this->filter['coursepath_name'] . "%'";
}
list($tot_coursepath) = sql_fetch_row(sql_query("SELECT COUNT(*) " . $query_coursepath));
$query_coursepath .= "\r\n\t\tORDER BY path_name\r\n\t\tLIMIT " . $ini . "," . (int) Get::sett('visuItem');
$re_coursepath = sql_query($select . $query_coursepath);
$type_h = array('image', '', '', '');
$cont_h = array('<span class="access-only">' . $lang->def('_SELECT') . '</span>', $lang->def('_NAME'), $lang->def('_DESCRIPTION'));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
while (list($id_path, $name, $descr) = sql_fetch_row($re_coursepath)) {
$tb_content = array(Form::getInputCheckbox('new_coursepath_selected_' . $id_path, 'new_coursepath_selected[' . $id_path . ']', $id_path, isset($this->current_selection[$id_path]), ''), '<label for="new_coursepath_selected_' . $id_path . '">' . $name . '</label>', '<label for="new_coursepath_selected_' . $id_path . '">' . $descr . '</label>');
$tb->addBody($tb_content);
if (isset($this->current_selection[$id_path])) {
unset($this->current_selection[$id_path]);
}
}
$output .= $tb->getTable() . $tb->getNavBar($ini, $tot_coursepath) . $this->stateSelection();
if ($noprint) {
return $output;
} else {
cout($output, 'content');
}
}
示例15: getTitleArea
* - $competences_info = detail for competences;
* - $language = the lang_code to use
* - $title = dialog/page title;
* - $json = Serci
*/
echo getTitleArea($title);
?>
<div class="std_block">
<?php
echo getBackUi('index.php?r=adm/functionalroles/show', Lang::t('_BACK', 'standard'));
$html = "";
require_once _base_ . '/lib/lib.table.php';
$table = new Table();
$label_h = array(Lang::t('_NAME', 'competences'), Lang::t('_TYPE', 'standard'), Lang::t('_REQUIRED_SCORE', 'fncroles'), Lang::t('_EXPIRATION_DAYS', 'fncroles'), Lang::t('_COURSE', 'course'), Lang::t('_SCORE', 'fncroles'));
$style_h = array('', 'img-cell', 'img-cell', 'img-cell', '', 'img-cell');
$table->addHead($label_h, $style_h);
$language = getLanguage();
$cmodel = new CompetencesAdm();
$_types = $cmodel->getCompetenceTypes();
$_typologies = $cmodel->getCompetenceTypologies();
$rs_counter = 1;
foreach ($competences_info as $id_competence => $cinfo) {
$courses = isset($courses_info[$id_competence]) ? $courses_info[$id_competence] : array();
$cinfo_content_1 = $cinfo->langs[$language]['name'];
$cinfo_content_2 = $_types[$cinfo->type];
$cinfo_content_3 = $cinfo->type == 'score' ? $cinfo->role_score : '-';
$cinfo_content_4 = $cinfo->role_expiration > 0 ? $cinfo->role_expiration . ' ' . Lang::t('_DAYS', 'standard') : Lang::t('_NEVER', 'standard');
$num_courses = count($courses);
if ($num_courses > 0) {
$first = true;
foreach ($courses as $course) {