本文整理汇总了PHP中Table::setColsStyle方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::setColsStyle方法的具体用法?PHP Table::setColsStyle怎么用?PHP Table::setColsStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table::setColsStyle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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));
}
示例2: 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');
}
示例3: 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');
}
示例4: 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();
}
示例5: publicAdminManager_list
function publicAdminManager_list()
{
checkPerm('view');
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('adminrules', 'framework');
$lang =& DoceboLanguage::createInstance('public_admin_manager', 'framework');
$aclManager = new DoceboACLManager();
// get users to show --------------------------------------------------
$admin_group_idst = $aclManager->getGroupST(ADMIN_GROUP_PUBLICADMIN);
$arr_admin_idst = $aclManager->getGroupUMembers($admin_group_idst);
$arr_admin_id = array_flip($aclManager->getArrUserST($arr_admin_idst));
$pm =& PlatformManager::createInstance();
$lms_is_active = $pm->isLoaded("lms");
/*$cms_is_active = $pm->isLoaded("cms");*/
// print table --------------------------------------------------------
$table = new Table(Get::sett('visuItem'), $lang->def('_PUBLIC_ADMIN_USER'), $lang->def('_PUBLIC_ADMIN_USER'));
$table->initNavBar('ini', 'link');
$table->setLink('index.php?modname=public_admin_manager&op=view&ini=');
$ini = $table->getSelectedElement();
$GLOBALS['page']->add(getTitleArea($lang->def('_ADMIN_MANAGMENT'), 'admin_managmer', $lang->def('_ADMIN_MANAGMENT')) . '<div class="std_block">', 'content');
$contentH = array($lang->def('_USERNAME'), '<img src="' . getPathImage() . 'admin_manager/man_pref.gif" alt="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . '" ' . 'title="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . '" />', '<img src="' . getPathImage() . 'admin_manager/man_menu.gif" alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" />', '<img src="' . getPathImage() . 'directory/tree.gif" alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" />');
$typeH = array('', 'image', 'image', 'image');
if ($lms_is_active) {
$contentH[] = '<img src="' . getPathImage() . 'admin_manager/man_course.gif" alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" />';
$typeH[] = 'image';
}
$table->setColsStyle($typeH);
$table->addHead($contentH);
$maxItem = count($arr_admin_id) < $ini + Get::sett('visuItem') ? count($arr_admin_id) : $ini + Get::sett('visuItem');
for ($index = $ini; $index < $maxItem; $index++) {
$admin_userid = substr($arr_admin_id[$arr_admin_idst[$index]], 1);
$rowContent = array($admin_userid);
// Edit preferences
$rowContent[] = '<a href="index.php?modname=public_admin_manager&op=edit_preferences&adminidst=' . $arr_admin_idst[$index] . '"
title="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_pref.gif"' . ' alt="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . ' : ' . $admin_userid . '" /></a>';
// Edit menu
$rowContent[] = '<a href="index.php?modname=public_admin_manager&op=edit_menu&adminidst=' . $arr_admin_idst[$index] . '"
title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_menu.gif"' . ' alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '" /></a>';
// Edit user
$rowContent[] = '<a href="index.php?modname=public_admin_manager&op=assign_tree&adminidst=' . $arr_admin_idst[$index] . '"
title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'directory/tree.gif" ' . 'alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '" /></a>';
// Edit course
if ($lms_is_active) {
$rowContent[] = '<a href="index.php?modname=public_admin_manager&op=edit_course&adminidst=' . $arr_admin_idst[$index] . '&load=1"
title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_course.gif"' . ' alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '" /></a>';
}
$table->addBody($rowContent);
}
$GLOBALS['page']->add($table->getTable() . $table->getNavBar($ini, count($arr_admin_id)), 'content');
$GLOBALS['page']->add('</div>', 'content');
}
示例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: 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;
}
示例9: 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');
}
示例10: printPageWithElement
public function printPageWithElement($id, $idst)
{
$adm_old_perm = $this->preference->getAdminPerm($idst);
$array_image = array('add_category' => 'ico-sprite subs_view', 'mod_category' => 'ico-sprite subs_view', 'del_category' => 'ico-sprite subs_view', 'view' => 'ico-sprite subs_view', 'add' => 'ico-sprite subs_add', 'mod' => 'ico-sprite subs_mod', 'del' => 'ico-sprite subs_del', 'associate_user' => 'ico-sprite subs_users', 'approve_waiting_user' => 'ico-sprite subs_user', 'subscribe' => 'ico-sprite subs_users', 'moderate' => 'ico-sprite subs_user');
switch ($id) {
case 'framework':
require_once _base_ . '/lib/lib.table.php';
$query = "SELECT idMenu, name, collapse" . " FROM %adm_menu" . " ORDER BY sequence";
$result = sql_query($query);
while (list($id_menu, $name, $collapse) = sql_fetch_row($result)) {
$query = "SELECT module_name, default_name, class_file, class_name, mvc_path" . " FROM %adm_menu_under" . " WHERE idMenu = '" . $id_menu . "'";
$result_under = sql_query($query);
if (sql_num_rows($result_under) > 0) {
$tb = new Table(NULL);
$th = array(Lang::t($name, 'menu'));
$ts = array('');
$total_perm = array();
$module_perm = array();
while (list($module_name, $default_name, $class_file, $class_name, $mvc_path) = sql_fetch_row($result_under)) {
if ($mvc_path !== '') {
$tmp = explode('/', $mvc_path);
$mvc_name = ucwords($tmp[1]);
$perm_path = '/framework/admin/' . strtolower($mvc_name) . '/';
require_once _adm_ . '/models/' . $mvc_name . 'Adm.php';
$class_name = $mvc_name . 'Adm';
$tmp_class = new $class_name();
$perm = $tmp_class->getPerm();
if (!empty($perm)) {
foreach ($perm as $perm_name => $img) {
if (array_search($perm_name, array_keys($total_perm)) == false) {
$total_perm[$perm_name] = $img;
if ($collapse === 'true') {
$th = array(Lang::t($default_name, 'menu'));
}
}
list($perm_idst) = sql_fetch_row(sql_query("SELECT idst FROM %adm_role WHERE roleid = '" . $perm_path . $perm_name . "'"));
$module_perm[$mvc_name][$perm_name] = $perm_idst;
}
}
} else {
require_once _adm_ . '/class.module/' . $class_file;
$tmp_class = new $class_name();
$perm_path = '/framework/admin/' . strtolower($module_name) . '/';
$perm = $tmp_class->getAllToken('lang');
if (!empty($perm)) {
foreach ($perm as $perm_name => $info) {
if (array_search($perm_name, array_keys($total_perm)) == false) {
$total_perm[$perm_name] = $info['image'];
if ($collapse === 'true') {
$th = array(Lang::t($default_name, 'menu'));
}
}
list($perm_idst) = sql_fetch_row(sql_query("SELECT idst FROM %adm_role WHERE roleid = '" . $perm_path . $perm_name . "'"));
$module_perm[$class_name][$perm_name] = $perm_idst;
}
}
}
}
//End while 1
if (!empty($total_perm)) {
foreach ($total_perm as $perm => $img) {
$classname = isset($array_image[$perm]) ? $array_image[$perm] : "ico-sprite";
$th[] = '<span class="' . $classname . '" title="' . Lang::t('_' . strtoupper($perm), 'menu') . '"><span>' . Lang::t('_' . strtoupper($perm), 'menu') . '</span></span>';
$ts[] = 'image';
}
$tb->addHead($th);
$tb->setColsStyle($ts);
$result_under = sql_query($query);
while (list($module_name, $default_name, $class_file, $class_name, $mvc_path) = sql_fetch_row($result_under)) {
if ($mvc_path !== '') {
$tmp = explode('/', $mvc_path);
$mvc_name = ucwords($tmp[1]);
$content = array(Lang::t($default_name, 'menu'));
foreach ($total_perm as $perm => $img) {
if (isset($module_perm[$mvc_name][$perm])) {
$content[] = Form::getInputCheckbox('adm_perm_' . $module_perm[$mvc_name][$perm], 'adm_perm[' . $module_perm[$mvc_name][$perm] . ']', '1', isset($adm_old_perm[$module_perm[$mvc_name][$perm]]), '');
} else {
$content[] = '';
}
}
reset($total_perm);
$tb->addBody($content);
} else {
$content = array(Lang::t($default_name, 'menu'));
foreach ($total_perm as $perm => $img) {
if (isset($module_perm[$class_name][$perm])) {
$content[] = Form::getInputCheckbox('adm_perm_' . $module_perm[$class_name][$perm], 'adm_perm[' . $module_perm[$class_name][$perm] . ']', '1', isset($adm_old_perm[$module_perm[$class_name][$perm]]), '');
} else {
$content[] = '';
}
}
reset($total_perm);
$tb->addBody($content);
}
}
//End while 2
echo $tb->getTable() . '<br/><br/>';
}
}
}
//.........这里部分代码省略.........
示例11: show_personal_media
function show_personal_media(&$out, &$lang)
{
if (!canAccessPersonalMedia()) {
die("You can't access!");
}
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.mimetype.php';
require_once _base_ . '/lib/lib.multimedia.php';
$url = getPopupBaseUrl();
$tab = new Table();
$user_id = (int) Docebo::user()->getIdSt();
//if(Get::sett('hteditor') == 'tinymce') {
$GLOBALS['page']->add('' . '<script type="text/javascript" type="text/javascript" src="' . Get::rel_path('base') . '/addons/tiny_mce/tiny_mce_popup.js"></script>', 'page_head');
$GLOBALS['page']->add('<script type="text/javascript">' . 'var FileBrowserDialogue = {
init : function () {
// Here goes your code for setting your custom things onLoad.
var allLinks = document.getElementsByTagName("link");
allLinks[allLinks.length-1].parentNode.removeChild(allLinks[allLinks.length-1]);
},
mySubmit : function (url) {
var URL = url;
var win = tinyMCEPopup.getWindowArg("window");
// insert information now
win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = URL;
// for image browsers: update image dimensions
if(win.ImageDialog) {
if (win.ImageDialog.getImageData) win.ImageDialog.getImageData();
if (win.ImageDialog.showPreviewImage) win.ImageDialog.showPreviewImage(URL);
}
// close popup window
tinyMCEPopup.close();
}
}
tinyMCEPopup.onInit.add(FileBrowserDialogue.init, FileBrowserDialogue);
' . '</script>', 'page_head');
//}
$head = array($lang->def("_PREVIEW"), $lang->def("_TYPE"), $lang->def("_FILENAME"));
$head[] = "<img src=\"" . getPathImage() . "standard/download.png\" alt=\"" . $lang->def("_ATTACHMENT") . "\" title=\"" . $lang->def("_ATTACHMENT") . "\" />";
$head[] = "<img src=\"" . getPathImage() . "standard/delete.png\" alt=\"" . $lang->def("_DEL") . "\" title=\"" . $lang->def("_DEL") . "\" />";
$head_type = array('preview80', 'image', '', 'image', 'image');
$tab->setColsStyle($head_type);
$tab->addHead($head);
$path = (strlen(dirname($_SERVER['PHP_SELF'])) != 1 ? dirname($_SERVER['PHP_SELF']) : '') . '/';
$path .= $GLOBALS["where_files_relative"];
$site_url = "http://" . $_SERVER['HTTP_HOST'] . $path . '/common/users/';
$qtxt = "\r\n\tSELECT *\r\n\tFROM " . $GLOBALS["prefix_fw"] . "_user_file\r\n\tWHERE user_idst='" . $user_id . "'";
$q = sql_query($qtxt);
if ($q && mysql_num_rows($q) > 0) {
while ($row = mysql_fetch_array($q)) {
$rowcnt = array();
if (!empty($row["media_url"])) {
$rowcnt[] = " ";
} else {
$file = _USER_FPATH . rawurlencode($row["real_fname"]);
$rowcnt[] = "<div style=\"text-align: center;\">" . '<a href="#" onclick="javascript:window.open(\'' . $file . '\',\'\');return false;">' . "<img height=\"120\" src=\"" . $file . "\" alt=\"" . $row["fname"] . "\" title=\"" . $row["fname"] . "\" /></a></div>";
}
$img = "<img src=\"" . getPathImage('fw') . mimeDetect($file) . "\" alt=\"" . $row["fname"] . "\" title=\" ";
$img .= $row["fname"] . "\" />\n";
$rowcnt[] = $img;
$rowcnt[] = $row["fname"];
if (!empty($row["media_url"])) {
$type = getMediaType($row["media_url"]);
} else {
$type = getMediaType($row["fname"]);
}
$sel_url = $url . "&op=select&from=personal&type=" . $type . "&item_id=" . $row["id"];
$img = "<img src=\"" . getPathImage() . "standard/download.png\" alt=\"" . $lang->def("_ATTACHMENT") . "\" title=\"" . $lang->def("_ATTACHMENT") . "\" />\n";
$rowcnt[] = '<a href="' . $sel_url . '" ' . (Get::sett('hteditor') == 'tinymce' ? 'onclick="FileBrowserDialogue.mySubmit(\'' . $site_url . $row["real_fname"] . '\'); return false;"' : '') . '>' . $img . "</a>\n";
$img = "<img src=\"" . getPathImage('fw') . "standard/delete.png\" alt=\"" . $lang->def("_DEL") . "\" title=\"" . $lang->def("_DEL") . "\" />\n";
$rowcnt[] = "<a href=\"" . $url . "&op=delpersonal&item_id=" . $row["id"] . "\">" . $img . "</a>\n";
$tab->addBody($rowcnt);
}
}
$url = getPopupBaseUrl() . "&op=addpersonal";
$tab->addActionAdd("<a href=\"" . $url . "\">" . $lang->def("_ADD") . "</a>");
if (isset($_GET['result'])) {
switch ($_GET['result']) {
case "invalid_ext":
$GLOBALS['page']->add(getErrorUi($lang->def('_INVALID_EXTENSION')));
break;
case "upload_err":
$GLOBALS['page']->add(getErrorUi($lang->def('_ERROR_UPLOAD')));
break;
case "upload_ok":
$GLOBALS['page']->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')));
break;
}
}
$GLOBALS['page']->add($tab->getTable());
}
示例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: 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');
}
}
示例14: getInteractionsTable
function getInteractionsTable($id_user, $idtrack)
{
require_once _base_ . '/lib/lib.domxml.php';
require_once _base_ . '/lib/lib.table.php';
$tb = new Table(Get::sett('visu_course'));
$lang = DoceboLanguage::CreateInstance('organization', 'lms');
$id_org = Get::req('id_org', DOTY_INT, 0);
$h_type = array('', '', '');
$h_content = array($lang->def('_DESCRIPTION'), $lang->def('_TYPE'), $lang->def('_RESULT'));
$tb->setColsStyle($h_type);
$tb->addHead($h_content);
$qry = "SELECT xmldata FROM " . $GLOBALS['prefix_lms'] . "_scorm_tracking WHERE idscorm_tracking={$idtrack} AND idUser={$id_user}";
$res = sql_query($qry);
$row = mysql_fetch_array($res);
$doc = new DoceboDOMDocument();
$doc->loadXML($row['xmldata']);
$context = new DoceboDOMXPath($doc);
$root = $doc->documentElement;
$temp = $context->query('//interactions');
$lines = array();
for ($i = 0; $i < $temp->length; $i++) {
$arr = array();
$node =& $temp->item($i);
//interaction index
//$arr['index'] = $node->getAttribute('index');
//get description
$elem = $context->query('description/text()', $node);
$elemNode =& $elem->item(0);
if ($elemNode && isset($elemNode->textContent)) {
$arr['description'] = $elemNode->textContent;
//get type
$elem = $context->query('type/text()', $node);
$elemNode =& $elem->item(0);
$arr['type'] = $elemNode->textContent;
//get result
$elem = $context->query('result/text()', $node);
$elemNode =& $elem->item(0);
$arr['result'] = $elemNode->textContent;
//get id
$elem = $context->query('id/text()', $node);
$elemNode =& $elem->item(0);
$id = $elemNode->textContent;
if ($arr['result'] == '1') {
$arr['result'] = 'true';
} else {
$arr['result'] = 'false';
}
$lines[$id] = array($arr['description'], $arr['type'], $arr['result']);
}
}
foreach ($lines as $key => $line) {
$tb->addBody($line);
}
//title
cout(getTitleArea($lang->def('_SCORM_INTERACTIONS_TABLE')), 'content');
cout('<div class="std_block">', 'content');
//back button, back to treeview
$back = getBackUi('index.php?modname=organization&op=scorm_track&id_user=' . $id_user . '&id_org=' . $id_org, $lang->def('_BACK_TO_TRACK'));
//'index.php?modname=organization&op=history&id_user='.$id_user.'&id_org='.$org , $lang->def('_BACK_TO_TRACK') );
//back button, back to treeview
cout($back, 'content');
cout($tb->getTable(), 'content');
cout($back, 'content');
cout('</div>', 'content');
}
示例15: groups
function groups()
{
checkPerm('view');
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('groups', 'lms');
$acl_man =& Docebo::user()->getAclManager();
$mod_perm = checkPerm('mod', true);
$subs_perm = checkPerm('subscribe', true);
// Retrive groups
$acl_man->setContext('/lms/course/' . $_SESSION['idCourse'] . '/group');
$id_groups = $acl_man->getGroupsIdstFromBasePath('/lms/course/' . $_SESSION['idCourse'] . '/group', array('course'));
if (!empty($id_groups)) {
$groups = $acl_man->getGroups($id_groups);
} else {
$groups = array();
}
// compose table
$tb = new Table(0, $lang->def('_GROUP_CAPTION'), $lang->def('_GROUP_CAPTION'));
$type_h = array('', '');
$cont_h = array($lang->def('_NAME'), $lang->def('_DESCRIPTION'));
if ($subs_perm) {
$type_h[] = 'image';
$cont_h[] = '<img src="' . getPathImage() . 'standard/moduser.png" alt="' . $lang->def('_ALT_SUBSCRIBE') . '" ' . 'title="' . $lang->def('_SUBSCRIBE_USER') . '" />';
}
if ($mod_perm) {
$type_h[] = 'image';
$type_h[] = 'image';
$cont_h[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" ' . 'title="' . $lang->def('_MOD') . '" />';
$cont_h[] = '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" ' . 'title="' . $lang->def('_DEL') . '" />';
}
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
if (!empty($groups)) {
while (list(, $group) = each($groups)) {
$id_group = $group[ACL_INFO_IDST];
$group_id = $acl_man->relativeId($group[ACL_INFO_GROUPID]);
if ($group_id != 'alluser') {
$cont = array($group_id, $group[ACL_INFO_GROUPDESCRIPTION]);
if ($subs_perm) {
$cont[] = '<a href="index.php?modname=groups&op=subscribe&id_group=' . $id_group . '&load=1" ' . 'title="' . $lang->def('_ASSIGN_USERS') . ' : ' . strip_tags($group_id) . '">' . '<img src="' . getPathImage() . 'standard/moduser.png" alt="' . $lang->def('_ASSIGN_USERS') . '" /></a>';
}
if ($mod_perm) {
$cont[] = '<a href="index.php?modname=groups&op=editgroup&id_group=' . $id_group . '" ' . 'title="' . $lang->def('_MOD') . ' : ' . strip_tags($group_id) . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" /></a>';
$cont[] = '<a href="index.php?modname=groups&op=delgroup&id_group=' . $id_group . '" ' . 'title="' . $lang->def('_DEL') . ' : ' . strip_tags($group_id) . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" /></a>';
}
$tb->addBody($cont);
}
}
}
if ($mod_perm) {
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=delgroup]');
$tb->addActionAdd('<a href="index.php?modname=groups&op=editgroup">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" /> ' . $lang->def('_NEW') . '</a>');
}
// output
$GLOBALS['page']->add(getTitleArea($lang->def('_GROUPS'), 'groups') . '<div class="std_block">', 'content');
if (isset($_GET['result'])) {
switch ($_GET['result']) {
case "ok":
$GLOBALS['page']->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')), 'content');
break;
case "err":
$GLOBALS['page']->add(getErrorUi($lang->def('_OPERATION_FAILURE')), 'content');
break;
}
}
$GLOBALS['page']->add($tb->getTable() . '</div>', 'content');
}