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'); }
function myfriends(&$url) { checkPerm('view'); require_once $GLOBALS['where_framework'] . '/lib/lib.myfriends.php'; require_once _base_ . '/lib/lib.table.php'; $lang =& DoceboLanguage::createInstance('myfriends', 'lms'); $acl_man =& Docebo::user()->getAclManager(); $my_fr = new MyFriends(getLogUserId()); $users_info = $my_fr->getFriendsList(false, false, false); require_once _base_ . '/lib/lib.user_profile.php'; $GLOBALS['page']->add(getTitleArea($lang->def('_MY_FRIENDS'), 'myfriends') . '<div class="std_block">' . '<p class="new_elem_link"><a href="' . $url->getUrl('op=searchuser') . '">' . $lang->def('_SEARCH_USER') . '</a></p>', 'content'); $controlled_id = array(); $controlled_id = $my_fr->controlPendentRequest(); if (count($controlled_id)) { for ($i = 0; $i < count($controlled_id); $i++) { $controlled_user = $acl_man->getUser($controlled_id[$i], false); $controlled_username = $acl_man->relativeId($controlled_user[ACL_INFO_USERID]); $GLOBALS['page']->add('<p>' . $lang->def('_THEUSER') . ' <b>' . $controlled_username . '</b> ' . $lang->def('_REQUEST') . '</p>', 'content'); } } $req_number = $my_fr->getPendentRequestCount(); if ($req_number > 0) { $GLOBALS['page']->add('<p>' . str_replace('[request_number]', $req_number, $lang->def('_PENDENDT_FRIEND')) . '<br />' . '<a href="' . $url->getUrl('op=approveuser') . '">' . $lang->def('_SHOW_ME') . '</a>' . '</p>', 'content'); } if (is_array($users_info) && !empty($users_info)) { while (list(, $ui) = each($users_info)) { $profile = new UserProfile($ui['id']); $profile->init('profile', 'framework', 'modname=myfriends&op=searchuser', 'ap'); $GLOBALS['page']->add($profile->minimalUserInfo(), 'content'); // action line $GLOBALS['page']->add('<p class="mf_action_line">' . ($ui['waiting'] == MF_WAITING ? $lang->def('_WAITING_FOR_APPROVE') . ' ' : '') . '<a href="' . $url->getUrl('op=delfriend&id_friend=' . $ui['id']) . '" ' . 'title="' . ($ui['waiting'] == MF_WAITING ? $lang->def('_DEL_WAITING_FRIEND') . ' : ' . $profile->resolveUsername() : $lang->def('_DEL') . ' : ' . $profile->resolveUsername()) . '">' . '<img src="' . getPathImage() . 'standard/remfriend.gif" alt="' . ($ui['waiting'] == MF_WAITING ? $lang->def('_DEL_WAITING_FRIEND') . ' : ' . $profile->resolveUsername() : $lang->def('_DEL') . ' : ' . $profile->resolveUsername()) . '" />' . '</a>' . '</p>', 'content'); } } $GLOBALS['page']->add('</div>', 'content'); }
public function getAddEditForm($form_url, $data) { $this->loadJs(); $res = ''; $e = false; if ($data['rule_id'] > 0) { $e = true; } $res .= Form::openForm('main_form', $form_url); $res .= Form::openElementSpace() . Form::getTextfield(Lang::t('_FROM', 'test'), 'from_score', 'from_score', 11, $e ? $data['from_score'] : '') . Form::getTextfield(Lang::t('_TO', 'test'), 'to_score', 'to_score', 11, $e ? $data['to_score'] : '') . '<br />' . '<p class="section_title">' . Lang::t('_COMPETENCES', 'test') . '</p>' . '<div id="competence_box"></div>' . '<div class="form_line_l"> <p><label for="input_add_competence" class="floating">' . Lang::t('_NAME', 'test') . '</label></p> <div class="form_autocomplete_container"> <input type="text" maxlength="255" value="" name="input_add_competence" id="input_add_competence" class="textfield"> <a href="" id="link_add_competence"><img alt="' . Lang::t('_ADD', 'test') . '" src="' . getPathImage() . 'standard/add.png" class="valing-middle"></a> <div id="box_autocomplete_competence"></div> </div> </div>' . '<br />' . '<p class="section_title">' . Lang::t('_COURSES', 'test') . '</p>' . '<div id="course_box"></div>' . '<div class="form_line_l"> <p><label for="input_add_course" class="floating">' . Lang::t('_NEW_COURSE', 'test') . '</label></p> <div class="form_autocomplete_container"> <input type="text" maxlength="255" value="" name="input_add_course" id="input_add_course" class="textfield"> <a href="" id="link_add_course"><img alt="' . Lang::t('_ADD', 'test') . '" src="' . getPathImage() . 'standard/add.png" class="valing-middle"></a> <div id="box_autocomplete_course"></div> </div> </div>' . '<br /><br />' . Form::getTextarea(Lang::t('_FEEDBACK_TEXT', 'test'), 'feedback_txt', 'feedback_txt', $e ? $data['feedback_txt'] : '') . Form::getHidden('rule_id', 'rule_id', (int) $data['rule_id']) . Form::getHidden('competences_list', 'competences_list', '') . Form::getHidden('courses_list', 'courses_list', '') . Form::getHidden('test_id', 'test_id', (int) $data['test_id']) . Form::getHidden('category_id', 'category_id', (int) $data['category_id']) . Form::getHidden('save', 'save', '1') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('btn_save', 'btn_save', Lang::t('_SAVE', 'test')) . Form::getButton('btn_cancel', 'btn_cancel', Lang::t('_UNDO', 'test')) . Form::closeButtonSpace(); $res .= Form::closeForm(); $res .= '<script type="text/javascript"> var course_ac_url="' . Get::rel_path('adm') . '/ajax.adm_server.php?mn=course&plf=lms&op=course_autocomplete&results=20' . '"; var competence_ac_url="' . Get::rel_path('adm') . '/ajax.adm_server.php?r=adm/competences/competences_autocomplete' . '"; var lang={"remove_item": "' . Lang::t('_DEL', 'test') . '"}; var course_arr=' . ($e && !empty($data['courses_list']) ? $data['courses_list'] : '{}') . '; var competence_arr=' . ($e && !empty($data['competences_list']) ? $data['competences_list'] : '{}') . '; </script>'; return $res; }
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'); }
function getLevelOneIntest($idMenu) { $lang =& DoceboLanguage::createInstance('menu', $this->platform); $query_menu = "\r\n\t\tSELECT name, image\r\n\t\tFROM " . $this->table_level_one . "\r\n\t\tWHERE idMenu = '" . (int) $idMenu . "'"; $re_menu = sql_query($query_menu); list($name, $image) = sql_fetch_row($re_menu); return array('name' => $name != '' ? $lang->def($name) : '', 'image' => getPathImage('framework') . 'area_title/' . $image); }
function showhtml() { checkPerm('view'); $lang =& DoceboLanguage::createInstance('htmlfront', 'lms'); $query = "\r\n\tSELECT textof\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_htmlfront \r\n\tWHERE id_course = '" . $_SESSION['idCourse'] . "'"; $re_htmlfront = sql_query($query); list($textof) = sql_fetch_row($re_htmlfront); $GLOBALS['page']->add(getTitleArea($lang->def('_HTMLFRONT'), 'htmlfront') . '<div class="std_block">' . (isset($_GET['saveok']) ? getResultUi($lang->def('_OPERATION_SUCCESSFUL')) : '') . '<div class="htmlfront_container">' . $textof . '</div>' . (checkPerm('mod', true) ? '<p class="table-container-below">' . '<a class="infomod" href="index.php?modname=htmlfront&op=edithtml" title="' . $lang->def('_MOD') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" /> ' . $lang->def('_MOD') . '</a></p>' : '') . '</div>', 'content'); }
function regional_settings() { checkPerm('view'); /*funAdminAccess('lang','OP'); $newPerm = funAdminAccess('addlang', 'NEW', true); $modPerm = funAdminAccess('modlang', 'MOD', true); $remPerm = funAdminAccess('dellang', 'REM', true);*/ $write_perm = true; $mod_perm = true; $rem_perm = true; require_once _base_ . "/lib/lib.table.php"; $out =& $GLOBALS['page']; $lang =& DoceboLanguage::createInstance('admin_regset', 'framework'); $regset = new RegionalSettingsManager(); $out->setWorkingZone("content"); $out->add(getTitleArea($lang->def("_REGIONAL_SETTINGS"), "regset")); $out->add("<div class=\"std_block\">\n"); $ini = importVar("ini", true, 0); $arr = $regset->getAllRegions(); $table = new Table(Get::sett('visuItem')); $out->add($table->OpenTable("")); $head = array($lang->def("_REGION_CODE"), $lang->def("_DESCRIPTION"), '<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") . '" />'); $head_type = array('', '', 'img', 'img'); $out->add($table->WriteHeader($head, $head_type)); $tot = count($arr) < $ini + Get::sett('visuItem') ? count($arr) : $ini + Get::sett('visuItem'); for ($i = $ini; $i < $tot; $i++) { $rowcnt = array(); $rowcnt[] = $arr[$i]; $rowcnt[] = $regset->getRegionInfo($arr[$i], "description"); if ($mod_perm) { $btn = "<a href=\"index.php?modname=regional_settings&op=editregion&id=" . $arr[$i] . "\">"; $btn .= "<img src=\"" . getPathImage() . "standard/edit.png\" "; $btn .= "alt=\"" . $lang->def("_MOD") . "\" title=\"" . $lang->def("_MOD") . " " . $arr[$i] . "\" />"; $btn .= "</a>\n"; $rowcnt[] = $btn; } else { $rowcnt[] = " "; } if ($rem_perm && !$regset->getRegionInfo($arr[$i], "default")) { $btn = "<a href=\"\">"; $btn .= "<img src=\"" . getPathImage() . "standard/delete.png\" "; $btn .= "alt=\"" . $lang->def("_DEL") . "\" title=\"" . $lang->def("_DEL") . " " . $arr[$i] . "\" />"; $btn .= "</a>\n"; $rowcnt[] = $btn; } else { $rowcnt[] = " "; } $out->add($table->writeRow($rowcnt)); } if ($write_perm) { $out->add($table->WriteAddRow('<a href="index.php?modname=regional_settings&op=addregion"> <img src="' . getPathImage() . 'standard/add.png" title="' . $lang->def('_ADD') . '" alt="' . $lang->def('_ADD') . '" /> ' . $lang->def('_ADD') . '</a>')); } $out->add($table->CloseTable()); $out->add($table->WriteNavBar('', 'index.php?modname=regional_settings&op=regset&ini=', $ini, count($arr))); $out->add("</div>\n"); }
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='******'&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='******'&ap=view_files&type=' . $active_tab . '&from=1') . '">' . $lang->def('_VIEW_' . $active_tab) . '</a></p>'); $GLOBALS['page']->add($tb->getTable(), 'content'); }
function loadExtraMenu() { $lang =& DoceboLanguage::createInstance('forum'); $line = '<div class="legend_line">'; echo $line . '<img src="' . getPathImage() . 'standard/add.png" /> ' . $lang->def('_REPLY') . '</div>' . $line . '<img src="' . getPathImage() . 'standard/edit.png" /> ' . $lang->def('_MOD') . '</div>' . $line . '<img src="' . getPathImage() . '/forum/free.gif" /> ' . $lang->def('_FORUMOPEN') . '</div>' . $line . '<img src="' . getPathImage() . '/forum/locked.gif" /> ' . $lang->def('_FORUMCLOSED') . '</div>'; if (checkPerm('mod', true)) { $line . '<img src="' . getPathImage() . 'forum/erase.gif" /> ' . $lang->def('_DEL') . '</div>'; $line . '<img src="' . getPathImage() . 'forum/unerase.gif" /> ' . $lang->def('_RESTOREINSERT') . '</div>'; } if (checkPerm('del', true)) { $line . '<img src="' . getPathImage() . 'standard/delete.png" /> ' . $lang->def('_DEL') . '</div>'; } }
/** * class constructor * @param string $var_name the variable name used for page * @param int $element_per_page the number of the element displayed in a single page * @param int $element_total the total number of element * @param enum $kind_of the type of navbar (link or button) */ function NavBar($var_name, $element_per_page, $element_total, $kind_of = false, $modname = false, $platform = false) { $this->var_name = $var_name; $this->element_per_page = $element_per_page; $this->element_total = $element_total; $this->link = ''; if ($kind_of == 'button') { $this->kind_of = 'button'; } else { $this->kind_of = 'link'; } $this->symbol = array('start' => array('img' => '<img src="' . getPathImage('fw') . 'standard/start.gif" alt="' . Lang::t('_START') . '" title="' . Lang::t('_START') . '" />', 'src' => getPathImage('fw') . 'standard/start.gif', 'alt' => Lang::t('_START', $modname)), 'prev' => array('img' => '<img src="' . getPathImage('fw') . 'standard/prev.gif" alt="' . Lang::t('_PREV') . '" title="' . Lang::t('_PREV') . '" />', 'src' => getPathImage('fw') . 'standard/prev.gif', 'alt' => Lang::t('_PREV', $modname)), 'next' => array('img' => '<img src="' . getPathImage('fw') . 'standard/next.gif" alt="' . Lang::t('_NEXT') . '" title="' . Lang::t('_NEXT') . '" />', 'src' => getPathImage('fw') . 'standard/next.gif', 'alt' => Lang::t('_NEXT', $modname)), 'end' => array('img' => '<img src="' . getPathImage('fw') . 'standard/end.gif" alt="' . Lang::t('_END') . '" title="' . Lang::t('_END') . '" />', 'src' => getPathImage('fw') . 'standard/end.gif', 'alt' => Lang::t('_END', $modname))); }
function play($object_link, $id_param) { //-kb-play-// if(!checkPerm('view', true, 'organization') && !checkPerm('view', true, 'storage')) die("You can't access"); $lang =& DoceboLanguage::createInstance('link'); $idCategory = $object_link->getId(); $mode = importVar('mode', false, 'link'); $back_coded = htmlentities(urlencode($object_link->back_url)); require_once $GLOBALS['where_lms'] . '/lib/lib.param.php'; $idReference = getLOParam($id_param, 'idReference'); // NOTE: Track only if $idReference is present if ($idReference !== FALSE) { require_once $GLOBALS['where_lms'] . '/class.module/track.link.php'; list($exist, $idTrack) = Track_Link::getIdTrack($idReference, getLogUserId(), $idCategory, TRUE); if ($exist) { $ti = new Track_Link($idTrack); $ti->setDate(date('Y-m-d H:i:s')); $ti->status = 'completed'; $ti->update(); } else { $ti = new Track_Link(false); $ti->createTrack($idReference, $idTrack, getLogUserId(), date('Y-m-d H:i:s'), 'completed', 'link'); } } list($title) = sql_fetch_row(sql_query("\r\n\tSELECT title \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_link_cat \r\n\tWHERE idCategory = '" . (int) $idCategory . "'")); $link = 'index.php?modname=link&op=play&idCategory=' . $idCategory . '&id_param=' . $id_param . '&back_url=' . $back_coded; /*$GLOBALS['page']->add('<div id="top" class="std_block">' .'<div class="colum_container">' */ cout('<div id="top" class="yui-navset yui-navset-top tab_block"> <ul class="yui-nav"> <li class="first' . ($mode != 'keyw' ? ' selected' : '') . '"> <a href="' . $link . '&mode=list"> <em>' . Lang::t('_SWITCH_TO_LIST', 'link') . '</em> </a> </li> <li' . ($mode == 'keyw' ? ' class="selected"' : '') . '> <a href="' . $link . '&mode=keyw"> <em>' . Lang::t('_SWITCH_TO_KEYWORD', 'link') . '</em> </a> </li> </ul> <div class="yui-content">', 'content'); cout(getBackUi(Util::str_replace_once('&', '&', $object_link->back_url), $lang->def('_BACK')), 'content'); $GLOBALS['page']->add('<b>' . $lang->def('_TITLE') . ' : ' . $title . '</b><br /><br />' . $lang->def('_LINKIUNNEWWINDOW') . '<br /><br />', 'content'); if ($mode == 'keyw') { displayAsKey($idCategory, $link . '&mode=keyw'); } else { displayAsList($idCategory); } $GLOBALS['page']->add('<div class="align_center">' . '<a href="#top"><img src="' . getPathImage() . 'standard/up.png" title="' . $lang->def('_BACKTOTOP') . '" />' . $lang->def('_BACKTOTOP') . '</a>' . getBackUi(Util::str_replace_once('&', '&', $object_link->back_url), $lang->def('_BACK')) . '</div>', 'content'); cout('</div></div>', 'content'); }
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'); }
function getLmsLangFlags() { $lang =& DoceboLanguage::createInstance('blind_navigation'); $blind_link = "<li><a href=\"#lang_box\">" . $lang->def("_LANG_SELECT") . "</a></li>"; $GLOBALS["page"]->add($blind_link, "blind_navigation"); $all_lang = Docebo::langManager()->getAllLangCode(); if (!is_array($all_lang)) { return ''; } $res = '<ul id="lang_box">'; foreach ($all_lang as $k => $lang_code) { $res .= '<a href="index.php?sop=changelang&new_lang=' . $lang_code . '" title="' . $lang_code . '">' . '<img src="' . getPathImage('fw') . 'language/' . $lang_code . '.png" alt="' . $lang_code . '" /></a>'; } $res .= '</ul>'; return $res; }
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>'); }
function &create_TabView($op) { global $_tab_op_map; $tv = new TabView('storage', 'index.php?modname=storage&op=display'); $lang =& DoceboLanguage::createInstance('storage', 'lms'); if (checkPerm('home', true, 'storage')) { $tv->addTab(new TabElemDefault('storage_home', $lang->def('_HOMEREPOROOTNAME'), getPathImage() . 'area_title/homerepo.gif')); } if (checkPerm('lesson', true, 'storage')) { $tv->addTab(new TabElemDefault('storage_course', $lang->def('_ORGROOTNAME'), getPathImage() . 'area_title/organizations.gif')); } if (checkPerm('public', true, 'storage')) { $tv->addTab(new TabElemDefault('storage_pubrepo', $lang->def('_PUBREPOROOTNAME'), getPathImage() . 'area_title/pubrepo.gif')); } $extra_data = load_state(); $tv->parseInput($_POST, $extra_data); if (isset($_tab_op_map[$op])) { $tv->setActiveTab($_tab_op_map[$op]); } return $tv; }
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'); }
function fetchRecord() { // fetch a record from record set $arrData = parent::fetchRecord(); if ($arrData === FALSE) { return FALSE; } // ------ compute title // use a special class for selected items $title = '<input type="submit" class="'; if (is_array($this->selectedIdObject) && in_array($arrData['idObject'], $this->selectedIdObject)) { $title .= 'TreeItemSelected'; $op = $this->opDeselectId; } else { $title .= 'TreeItem'; $op = $this->opSelectId; } // attach select operation to title $title .= '" value="' . $arrData['title'] . '" name="' . $op . $arrData['idObject'] . '" id="' . $arrData['idObject'] . '_select" />'; $arrData['title'] = $title; // ------ compute icon $arrData['icon'] = '<img src="' . getPathImage() . 'lobject/' . $arrData['objectType'] . '.gif" alt="' . $arrData['objectType'] . '" />'; // ------ show operation $arrData['show'] = '<div class="LVShowItem">' . '<input type="submit" class="LVShowItem" value="' . '" name="' . $this->opShowId . $arrData['idObject'] . '" id="' . $arrData['idObject'] . 'img_show" />' . '</div>'; // ------ play operation $arrData['play'] = '<div class="LVShowItem">' . '<input type="submit" class="LVShowItem" value="' . '" name="' . $this->opPlayId . $arrData['idObject'] . '" id="' . $arrData['idObject'] . 'img_play" />' . '</div>'; return $arrData; }
if ($sms_credit == 0) { $credit_left = '0'; $note = '(' . Lang::t('_SMS_CREDIT_UPDATE', 'configuration') . ')'; } else { $credit_left = number_format($sms_credit / 1000, 2, ',', '') . ' €'; $note = ''; } ?> <div class="container-smsmarket"> <p> <a href="http://www.smsmarket.it/" onclick="window.open(this.href); return false;" title="<?php echo Lang::t('_SMSMARKET_LOGO', 'configuration'); ?> "> <img src="<?php echo getPathImage(); ?> config/smsmarket.gif" alt="<?php echo Lang::t('_SMSMARKET_LOGO', 'configuration'); ?> " title="<?php echo Lang::t('_SMSMARKET_LOGO', 'configuration'); ?> " /> </a> </p> <p> <b><?php echo Lang::t('_SMS_CREDIT', 'configuration') . ': ' . $credit_left; ?> </b> <?php
function transaction() { require_once _base_ . '/lib/lib.table.php'; require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.dialog.php'; YuiLib::load(); $lang =& DoceboLanguage::createInstance('transaction'); $acl_man = Docebo::user()->getAclManager(); $man_transaction = new Man_Transaction(); cout(getTitleArea($lang->def('_TRANSACTION')) . '<div class="std_block">'); $tb = new Table(Get::sett('visuItem'), $lang->def('_TRANSACTION_TABLE'), $lang->def('_TRANSACTION_TABLE')); $tb->initNavBar('ini', 'button'); $tb->setLink('index.php?modname=transaction&op=transaction'); $page = ($tb->getSelectedPage() - 1) * Get::sett('visuItem'); $status_filter = Get::req('payment_status', DOTY_INT, '-2'); $course_filter = Get::req('course_status', DOTY_INT, '-2'); $tran_filter = Get::req('tran', DOTY_MIXED, ''); $display = false; if ($status_filter != -2) { $display = true; } if ($course_filter != -2) { $display = true; } $transactions = $man_transaction->getTransaction($page, $status_filter == '-2' ? false : $status_filter, $course_filter == '-2' ? false : $course_filter, $tran_filter); $tot_transaction = $man_transaction->getTotTransaction($status_filter == '-2' ? false : $status_filter, $course_filter == '-2' ? false : $course_filter, $tran_filter); if (count($transactions) > 0 || $display) { $mod_img = '<img src="' . getPathImage() . '/standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" />'; $del_img = '<img src="' . getPathImage() . '/standard/delete.png" title="' . $lang->def('_DEL') . '" alt="' . $lang->def('_DEL') . '" />'; $cont_h = array($lang->def('_USER'), $lang->def('_DATE'), $lang->def('_COURSE_PRIZE'), $lang->def('_PAYMENT_METHOD'), $lang->def('_PAYMENT_STATUS'), $lang->def('COURSE_STATUS'), $mod_img, $del_img); $type_h = array('', '', '', '', 'image', 'image', 'image', 'image'); $tb->setColsStyle($type_h); $tb->addHead($cont_h); foreach ($transactions as $transaction_info) { if ($transaction_info['firstname'] !== '' && $transaction_info['lastname'] !== '') { $user = $transaction_info['firstname'] . ' ' . $transaction_info['lastname'] . ' (' . $acl_man->relativeId($transaction_info['userid']) . ')'; } elseif ($transaction_info['firstname'] !== '') { $user = $transaction_info['firstname'] . ' (' . $acl_man->relativeId($transaction_info['userid']) . ')'; } elseif ($transaction_info['lastname'] !== '') { $user = $transaction_info['lastname'] . ' (' . $acl_man->relativeId($transaction_info['userid']) . ')'; } else { $user = $acl_man->relativeId($transaction_info['userid']); } switch ($transaction_info['payment_status']) { case '-1': $payment_status = '<img src="' . getPathImage() . '/standard/dot_red.gif" alt="' . $lang->def('_CANCELLED') . '" title="' . $lang->def('_CANCELLED') . '" />'; break; case '0': $payment_status = '<img src="' . getPathImage() . '/standard/dot_grey.gif" alt="' . $lang->def('_WAITING_PAYMENT') . '" title="' . $lang->def('_WAITING_PAYMENT') . '" />'; break; case '1': $payment_status = '<img src="' . getPathImage() . '/standard/dot_yellow.gif" alt="' . $lang->def('_PARTIAL_PAID') . '" title="' . $lang->def('_PARTIAL_PAID') . '" />'; break; case '2': $payment_status = '<img src="' . getPathImage() . '/standard/dot_green.gif" alt="' . $lang->def('_PAID') . '" title="' . $lang->def('_PAID') . '" />'; break; } switch ($transaction_info['course_status']) { case '-1': $course_status = '<img src="' . getPathImage() . '/standard/dot_red.gif" alt="' . $lang->def('_CANCELLED') . '" title="' . $lang->def('_CANCELLED') . '" />'; break; case '0': $course_status = '<img src="' . getPathImage() . '/standard/dot_grey.gif" alt="' . $lang->def('_NO_COURSE_ACTIVATED') . '" title="' . $lang->def('_NO_COURSE_ACTIVATED') . '" />'; break; case '1': $course_status = '<img src="' . getPathImage() . '/standard/dot_yellow.gif" alt="' . $lang->def('_SOME_COURSE_ACTIVATED') . '" title="' . $lang->def('_SOME_COURSE_ACTIVATED') . '" />'; break; case '2': $course_status = '<img src="' . getPathImage() . '/standard/dot_green.gif" alt="' . $lang->def('_ALL_COURSE_ACTIVATED') . '" title="' . $lang->def('_ALL_COURSE_ACTIVATED') . '" />'; break; } $tb->addBody(array($user, Format::date($transaction_info['date']), $transaction_info['price'], $lang->def('_' . strtoupper($transaction_info['method'])), $payment_status, $course_status, '<a href="index.php?modname=transaction&op=mod&id=' . $transaction_info['id_transaction'] . '">' . $mod_img . '</a>', '<a href="index.php?modname=transaction&op=del&id=' . $transaction_info['id_transaction'] . '">' . $del_img . '</a>')); } $array_payment_status = array('-2' => $lang->def('_ALL_STATUS'), '-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_WAITING_PAYMENT'), '1' => $lang->def('_PARTIAL_PAID'), '2' => $lang->def('_PAID')); $array_course_status = array('-2' => $lang->def('_ALL_STATUS'), '-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_NO_COURSE_ACTIVATED'), '1' => $lang->def('_SOME_COURSE_ACTIVATED'), '2' => $lang->def('_ALL_COURSE_ACTIVATED')); cout(Form::openForm('transaction_filter', 'index.php?modname=transaction&op=transaction') . $tb->getNavBar($page, $tot_transaction) . '<div class="quick_search_form">' . Form::getInputTextfield('search_t', 'tran', 'tran', $tran_filter, '', 255, '') . Form::getButton("filter", "filter", $lang->def('_FILTER'), "search_b") . '<br />' . '<a class="advanced_search" href="javascript:;" onclick="( this.nextSibling.style.display != \'block\' ? this.nextSibling.style.display = \'block\' : this.nextSibling.style.display = \'none\' );">' . $lang->def("_ADVANCED_SEARCH") . '</a>' . '<div class="overlay_menu" style="display:' . ($display ? 'block' : 'none') . '">' . Form::getDropdown($lang->def('_PAYMENT_STATUS_FILTER'), 'payment_status', 'payment_status', $array_payment_status, $status_filter) . Form::getDropdown($lang->def('_COURSE_STATUS_FILTER'), 'course_status', 'course_status', $array_course_status, $course_filter) . '</div>' . '</div>' . '<script type="text/javascript">' . 'var payment_status = YAHOO.util.Dom.get(\'payment_status\');' . 'var course_status = YAHOO.util.Dom.get(\'course_status\');' . 'var form = YAHOO.util.Dom.get(\'transaction_filter\');' . 'YAHOO.util.Event.on(payment_status, \'change\', function() { this.submit() } , form, true);' . 'YAHOO.util.Event.on(course_status, \'change\', function() { this.submit() } , form, true);' . '</script>' . $tb->getTable() . $tb->getNavBar($page, $tot_transaction) . Form::closeForm()); setupHrefDialogBox('a[href*=del]'); } else { cout(Lang::t('_NO_CONTENT', 'transaction')); } cout('</div>'); }
function _getCreateImage() { return getPathImage() . 'standard/add.png'; }
function entrylist() { checkPerm('view'); require_once _base_ . '/lib/lib.table.php'; require_once _base_ . '/lib/lib.form.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.coursepath.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.course.php'; $lang =& DoceboLanguage::createInstance('catalogue', 'lms'); $out =& $GLOBALS['page']; $id_cat = Get::req('id', DOTY_INT, 0); $cat_name = getCatalogueName($id_cat); $mod_perm = checkPerm('mod', true); $title_area = array('index.php?modname=catalogue&op=catlist' => $lang->def('_CATALOGUE'), $cat_name); $tb_entry = new Table(); $query_entry = "\r\n\tSELECT idEntry, type_of_entry\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_catalogue_entry\r\n\tWHERE idCatalogue = '" . $id_cat . "'"; $re_entry = sql_query($query_entry); $courses = array(); $coursepath = array(); while (list($id, $t_o_entry) = sql_fetch_row($re_entry)) { if ($t_o_entry == 'course') { $courses[$id] = $id; } else { $coursepath[$id] = $id; } } $coursepath_man = new CoursePath_Manager(); $coursespath_name =& $coursepath_man->getNames($coursepath); $course_name =& getCoursesInfo($courses); $cont_h = array($lang->def('_CODE'), $lang->def('_NAME'), $lang->def('_TYPE')); $type_h = array('', '', ''); if ($mod_perm) { $type_h[] = 'image'; $cont_h[] = '<img src="' . getPathImage('fw') . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />'; } $tb_entry->setColsStyle($type_h); $tb_entry->addHead($cont_h); $all_courses = true; 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; } elseif (isset($admin_courses['course'][-1])) { require_once _lms_ . '/lib/lib.catalogue.php'; $cat_man = new Catalogue_Manager(); $user_catalogue = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt()); if (count($user_catalogue) > 0) { $courses = array(0); foreach ($user_catalogue as $id_cat) { $catalogue_course =& $cat_man->getCatalogueCourse($id_cat, true); $courses = array_merge($courses, $catalogue_course); } foreach ($courses as $id_course) { if ($id_course != 0) { $admin_courses['course'][$id_course] = $id_course; } } } elseif (Get::sett('on_catalogue_empty', 'off') == 'on') { $all_courses = true; } } else { $array_courses = array(); $array_courses = array_merge($array_courses, $admin_courses['course']); if (!empty($admin_courses['coursepath'])) { require_once _lms_ . '/lib/lib.coursepath.php'; $path_man = new Catalogue_Manager(); $coursepath_course =& $path_man->getAllCourses($admin_courses['coursepath']); $array_courses = array_merge($array_courses, $coursepath_course); } if (!empty($admin_courses['catalogue'])) { require_once _lms_ . '/lib/lib.catalogue.php'; $cat_man = new Catalogue_Manager(); foreach ($admin_courses['catalogue'] as $id_cat) { $catalogue_course =& $cat_man->getCatalogueCourse($id_cat, true); $array_courses = array_merge($array_courses, $catalogue_course); } } $admin_courses['course'] = array_merge($admin_courses['course'], $array_courses); } } if (is_array($course_name)) { foreach ($course_name as $course) { $cont = array($course['code'], $course['name'], $lang->def('_COURSE')); if ($mod_perm) { if (isset($admin_courses['course'][$course['id']]) || $all_courses) { $cont[] = '<a href="index.php?modname=catalogue&op=delentry&id_cat=' . $id_cat . '&type=course&id_entry=' . $course['id'] . '" ' . 'title="' . $lang->def('_REMOVE_ENTRY') . ' : ' . strip_tags($course['name']) . '">' . '<img src="' . getPathImage('fw') . 'standard/delete.png" ' . 'alt="' . $lang->def('_DEL') . ' : ' . strip_tags($course['name']) . '" /></a>'; } else { $cont[] = ''; } } $tb_entry->addBody($cont); } } if (is_array($coursespath_name)) { while (list($id, $coursepath) = each($coursespath_name)) { $cont = array($coursepath, $lang->def('_COURSEPATH')); // #bugfix 1141 $tmp_code = $coursepath_man->getCoursepathInfo($id); $path_code = $tmp_code['path_code']; array_unshift($cont, $path_code); // end bugfix if ($mod_perm) { if (isset($admin_courses['coursepath'][$id]) || $all_courses) { $cont[] = '<a href="index.php?modname=catalogue&op=delentry&id_cat=' . $id_cat . '&type=coursepath&id_entry=' . $id . '" ' . 'title="' . $lang->def('_REMOVE_ENTRY') . ' : ' . strip_tags($coursepath) . '">' . '<img src="' . getPathImage('fw') . 'standard/delete.png" ' . 'alt="' . $lang->def('_DEL') . ' : ' . strip_tags($coursepath) . '" /></a>'; } else { $cont[] = ''; } } $tb_entry->addBody($cont); } } $select_entry = array('course' => $lang->def('_COURSE'), 'coursepath' => $lang->def('_COURSEPATH')); if ($mod_perm) { $tb_entry->addActionAdd('<a href="index.php?modname=catalogue&op=import&id_cat=' . $id_cat . '&load=1" class="ico-wt-sprite subs_import" ' . ' title="' . Lang::t('_IMPORT', 'catalogue') . '"><span>' . Lang::t('_IMPORT', 'catalogue') . '</span></a>'); } switch (Get::req('result', DOTY_ALPHANUM, '')) { case "ok": UIFeedback::info(Lang::t('_OPERATION_SUCCESSFUL', 'standard')); break; case "err": UIFeedback::error(Lang::t('_OPERATION_ERROR', 'standard')); break; } $out->add(getTitleArea($title_area, 'catalogue') . '<div class="std_block">' . getBackUi('index.php?modname=catalogue&op=catlist', $lang->def('_BACK')) . $tb_entry->getTable() . getBackUi('index.php?modname=catalogue&op=catlist', $lang->def('_BACK')) . '</div>', 'content'); if ($mod_perm) { require_once _base_ . '/lib/lib.dialog.php'; setupHrefDialogBox('a[href*=delentry]'); } }
function getPermissionUi($form_name, $perm, $module_op) { require_once _base_ . '/lib/lib.table.php'; $lang =& DoceboLanguage::createInstance('manmenu', 'framework'); $lang_perm =& DoceboLanguage::createInstance('permission', 'framework'); $tokens = $this->getAllToken($module_op); $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 (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) { $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) { $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(); }
/** * @param string $label_name * @param string $id * @param string $name * @param string $value * @param string $filename * @param string $show_current * @param string $show_del_checkbox * @param string $add_old_info * @param string $old_prefix * @param string $del_arr_name * @param string $alt_name * @param string $other_after * @param string $other_before */ public static function getExtendedFileField($label_name, $id, $name, $value = FALSE, $filename = FALSE, $show_current = TRUE, $show_del_checkbox = TRUE, $add_old_info = TRUE, $old_prefix = FALSE, $del_arr_name = FALSE, $alt_name = '', $other_after = '', $other_before = '') { $res = ""; $res .= '<div class="form_extended_file_field">'; $res .= Form::getFilefield($label_name, $id, $name, $value, $alt_name, $other_after, $other_before); if ($show_current) { if ($value !== FALSE && !empty($value)) { if ($filename === FALSE) { if (substr_count($value, "_") >= 3) { $break_apart = explode('_', $value); $break_apart[0] = $break_apart[1] = $break_apart[2] = ''; $filename = substr(implode('_', $break_apart), 3); } else { $filename = $value; } } require_once _base_ . '/lib/lib.mimetype.php'; $ext = strtolower(end(explode(".", $filename))); $img = "<img src=\"" . getPathImage('fw') . mimeDetect($filename) . "\" "; $img .= "alt=\"" . $ext . "\" title=\"" . $ext . "\" />"; if ($show_del_checkbox) { $del_arr_name = $del_arr_name !== FALSE ? $del_arr_name : "file_to_del"; $check_id = $del_arr_name . "_" . $id; $check_name = $del_arr_name . "[" . $id . "]"; $checkbox = Form::getInputCheckbox($check_id, $check_name, $value, FALSE, "") . " "; $checkbox .= Form::getLabel($check_id, Lang::t("_DELETE_FILE", "standard", "framework"), "nofloat"); $res .= Form::getLineBox($img . " " . $filename, $checkbox); } else { $res .= Form::openFormLine(); $res .= Lang::t("_CURRENT_FILE", "standard", "framework") . ": " . $img . " " . $filename; $res .= Form::closeFormLine(); } } else { $res .= Form::openFormLine(); $res .= Lang::t("_CURRENT_FILE", "standard", "framework") . ": " . Lang::t("_NONE", "standard", "framework"); $res .= Form::closeFormLine(); } } if ($add_old_info) { $old_prefix = $old_prefix !== FALSE ? $old_prefix : "old"; $res .= "\n"; $res .= Form::getHidden($old_prefix . "_" . $id, $old_prefix . "_" . $name, $value); } $res .= "</div>\n"; return $res; }
public function writeNavBar($symbol, $link, $actualRow, $totalRow, $existNext = false) { // $symbols = array( // 'start' => '', // 'prev' => '', // 'next' => '', // 'end' => '' // ); //EFFECTS: write the navbar //math for number of page if ($this->maxRowsAtTime == 0) { return; } if (!is_array($symbol)) { $symbol = array('start' => '<img src="' . getPathImage() . 'standard/start.gif" alt="' . Lang::t('_START') . '" title="' . Lang::t('_START') . '" />', 'prev' => '<img src="' . getPathImage() . 'standard/prev.gif" alt="' . Lang::t('_PREV') . '" title="' . Lang::t('_PREV') . '" />', 'next' => '<img src="' . getPathImage() . 'standard/next.gif" alt="' . Lang::t('_NEXT') . '" title="' . Lang::t('_NEXT') . '" />', 'end' => '<img src="' . getPathImage() . 'standard/end.gif" alt="' . Lang::t('_END') . '" title="' . Lang::t('_END') . '" />'); } $nav = ''; if ($totalRow) { //if i have the number of the result i can write the navbar with the page number $numberOfPage = (int) ($totalRow / $this->maxRowsAtTime + ($totalRow % $this->maxRowsAtTime ? 1 : 0)); $currentPage = (int) ($actualRow / $this->maxRowsAtTime) + 1; if ($numberOfPage <= 7) { $start = 1; $end = $numberOfPage; } else { $start = $currentPage - 3 < 1 ? 1 : $currentPage - 3; $end = $currentPage + 3 > $numberOfPage ? $numberOfPage : $currentPage + 3; } //total number of page $nav .= '<div class="nav-bar">'; $nav .= '<div class="float_right">' . Lang::t('_RE') . $totalRow . ' ' . Lang::t('_PAGES') . $numberOfPage . '</div>'; //jump to start position if ($start != '1') { $nav .= '<a href="' . $link . '0">' . $symbol['start'] . '</a> '; } //jump one backward if ($currentPage != '1') { $nav .= '<a href="' . $link . ($actualRow - $this->maxRowsAtTime) . '">' . $symbol['prev'] . '</a> '; } $nav .= '( '; if ($start != '1') { $nav .= '... '; } //print pages numbers for ($page = $start; $page <= $end; $page++) { if ($page == $currentPage) { $nav .= '<span class="current">[ ' . $page . ' ]</span> '; } else { $nav .= '<a href="' . $link . ($page - 1) * $this->maxRowsAtTime . '">' . $page . '</a> '; } } if ($page - 1 != $numberOfPage) { $nav .= '... '; } $nav .= ') '; //jump one forward if ($currentPage != $numberOfPage) { $nav .= '<a href="' . $link . ($actualRow + $this->maxRowsAtTime) . '">' . $symbol['next'] . '</a>'; } //jump to end position if ($page - 1 != $numberOfPage) { $nav .= ' <a href="' . $link . ($numberOfPage - 1) * $this->maxRowsAtTime . '">' . $symbol['end'] . '</a>'; } $nav .= '<div class="nofloat"></div></div>'; } else { //if i haven't the number of result if ($actualRow != '0' || $existNext) { $nav .= '<div class="nav-bar">'; } if ($actualRow != '0') { $nav .= '<a href="' . $link . ($actualRow - $this->maxRowsAtTime) . '">' . $symbol['prev'] . '</a> '; } if ($actualRow != '0' && $existNext) { $nav .= ' -------- '; } //jump one forward if ($existNext) { $nav .= '<a href="' . $link . ($actualRow + $this->maxRowsAtTime) . '">' . $symbol['next'] . '</a>'; } if ($actualRow != '0' || $existNext) { $nav .= '</div>'; } } return $nav; }
function LOSelector($module, $back_url) { $query = "SELECT objectType FROM " . $GLOBALS['prefix_lms'] . "_lo_types"; $rs = sql_query($query) or die('Table _lo_types not present'); $out = '<div class="std_block">'; $out .= '<div class="title">' . Lang::t('_SELECTLO', 'storage', 'lms') . '</div><br />'; $out .= getBackUi(Util::str_replace_once('&', '&', $back_url), Lang::t('_BACK')); $out .= '<form id="LOSelector" method="post" action="index.php?modname=' . $module . '&op=display&' . $this->_getOpCreateLOSel() . '=1" >' . '<input type="hidden" id="authentic_request_lo" name="authentic_request" value="' . Util::getSignature() . '" />'; $first = TRUE; while (list($objectType) = sql_fetch_row($rs)) { $out .= '<label for="' . $objectType . '"><img src="' . getPathImage() . 'lobject/' . $objectType . '.gif" alt="' . $objectType . '" ' . 'title="' . $objectType . '" /></label>'; if ($first) { $out .= '<input type="radio" name="radiolo" value="' . $objectType . '" id="' . $objectType . '" checked="true"/>'; } else { $out .= '<input type="radio" name="radiolo" value="' . $objectType . '" id="' . $objectType . '"/>'; } $out .= '<label for="' . $objectType . '">' . Lang::t('_LONAME_' . $objectType) . '</label>' . '<br />'; $first = FALSE; } $out .= $this->printState(); $out .= '<br /><input type="submit" class="button" value="' . Lang::t('_REPOCREATELO') . '" name="' . $this->_getOpCreateLOSel() . '"/>'; $out .= '</form>'; $out .= '</div>'; return $out; }
/** * The UI that list all the task * @param Module $module the caller module **/ function ioTask_UITaskList(&$module) { checkPerm('view'); require_once _base_ . '/lib/lib.table.php'; require_once _base_ . '/lib/lib.form.php'; $connMgr =& $module->get_connMgr(); $lang =& $module->get_lang(); $out =& $module->get_out(); $form = new Form(); $tb_tasks = new Table(Get::sett('visuItem'), $lang->def('_TASKS'), $lang->def('_TASKS')); $content_h = array($lang->def('_NAME'), $lang->def('_DESCRIPTION'), $lang->def('_SOURCE'), $lang->def('_DESTINATION'), $lang->def('_SCHEDULE'), $lang->def('_LAST_EXECUTION'), '<img src="' . getPathImage() . '/standard/play.png" alt="' . $lang->def('_TASK_RUN') . '" title="' . $lang->def('_TASK_RUN') . '"/>', '<img src="' . getPathImage() . '/standard/edit.png" alt="' . $lang->def('_MOD') . '" title="' . $lang->def('_MOD') . '"/>', '<img src="' . getPathImage() . '/standard/cancel.png" alt="' . $lang->def('_TASK_DEL') . '" title="' . $lang->def('_DEL') . '"/>'); $type_h = array('', '', '', '', '', '', 'image', 'image', 'image'); $tb_tasks->setColsStyle($type_h); $tb_tasks->addHead($content_h); $conn = $connMgr->get_first_task(); while ($conn) { $cont = array(); $cont[] = $conn[CONNMGR_TASK_NAME]; $cont[] = $conn[CONNMGR_TASK_DESCRIPTION]; $cont[] = $conn[CONNMGR_TASK_SOURCE]; $cont[] = $conn[CONNMGR_TASK_DESTINATION]; if ($conn[CONNMGR_TASK_SCHEDTYPE] == 'at') { $cont[] = str_replace('%time%', $conn[CONNMGR_TASK_SCHEDULE]['qt'], $lang->def('_SCHEDULE_TYPE_AT_DATA')); } else { if ($conn[CONNMGR_TASK_SCHEDULE]['um'] == 'hour') { $conn[CONNMGR_TASK_SCHEDULE]['um'] = $lang->def('_HOUR'); } elseif ($conn[CONNMGR_TASK_SCHEDULE]['um'] == 'day') { $conn[CONNMGR_TASK_SCHEDULE]['um'] = $lang->def('_DAY'); } $cont[] = str_replace(array('%interval%', '%unit%'), array_values($conn[CONNMGR_TASK_SCHEDULE]), $lang->def('_SCHEDULE_TYPE_INTERVAL_DATA')); } if ($conn[CONNMGR_TASK_LAST_EXECUTION] !== null) { //$last_execution = strtotime($conn[CONNMGR_TASK_LAST_EXECUTION]); $cont[] = $conn[CONNMGR_TASK_LAST_EXECUTION]; } else { $cont[] = ''; } $cont[] = '<input type="image" ' . 'id="run_' . $conn[CONNMGR_TASK_NAME] . '" ' . 'name="action[run_task][' . $conn[CONNMGR_TASK_NAME] . ']" ' . 'src="' . getPathImage() . '/standard/play.png"' . 'alt="' . $lang->def('_TASK_RUN') . '"' . 'title="' . $lang->def('_TASK_RUN') . ': ' . $conn[CONNMGR_TASK_NAME] . '" />'; $cont[] = '<input type="image" ' . 'id="modifiy_' . $conn[CONNMGR_TASK_NAME] . '" ' . 'name="action[edit_task][' . $conn[CONNMGR_TASK_NAME] . ']" ' . 'src="' . getPathImage() . '/standard/edit.png"' . 'alt="' . $lang->def('_MOD') . '"' . 'title="' . $lang->def('_MOD') . ': ' . $conn[CONNMGR_TASK_NAME] . '" />'; $cont[] = '<input type="image" ' . 'id="delete_' . $conn[CONNMGR_TASK_NAME] . '" ' . 'name="action[delete_task][' . $conn[CONNMGR_TASK_NAME] . ']" ' . 'src="' . getPathImage() . '/standard/cancel.png"' . 'alt="' . $lang->def('_TASK_DEL') . '"' . 'title="' . $lang->def('_TASK_DEL') . ': ' . $conn[CONNMGR_TASK_NAME] . '" />'; $tb_tasks->addBody($cont); $conn = $connMgr->get_next_task(); } $tb_tasks->addActionAdd('<label for="new_task">' . '<img class="valing-middle" src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" />' . ' ' . $lang->def('_ADD_NEW_TASK') . '</label> ' . $form->getButton('new_task', 'action[new_task]', $lang->def('_CREATE'), 'button_nowh')); $out->add($tb_tasks->getTable()); }
function adminManager_lang_course() { checkPerm('view'); require_once _base_ . '/lib/lib.form.php'; $lang =& DoceboLanguage::createInstance('adminrules', 'framework'); $adminidst = importVar('adminidst', true, 0); $user_pref = new UserPreferences($adminidst); if (isset($_POST['save'])) { $re = $user_pref->setPreference('admin_rules.user_lang_assigned', isset($_POST['admin_lang']) ? urlencode(serialize($_POST['admin_lang'])) : ''); Util::jump_to('index.php?modname=admin_manager&op=view&result=' . ($re ? 1 : 0)); } $all_languages = Docebo::langManager()->getAllLangCode(); $assigned_lang = unserialize(urldecode($user_pref->getAdminPreference('admin_rules.user_lang_assigned'))); $GLOBALS['page']->add(getTitleArea($lang->def('_ADMIN_MANAGMENT'), 'admin_managmer', $lang->def('_ADMIN_MANAGMENT')) . '<div class="std_block">' . Form::getFormHeader($lang->def('_SELECT_LANG_TO_ASSIGN')) . Form::openForm('admin_lang_editing', 'index.php?modname=admin_manager&op=edit_lang') . Form::openElementSpace() . Form::getHidden('adminidst', 'adminidst', $adminidst), 'content'); while (list(, $lang_code) = each($all_languages)) { $GLOBALS['page']->add(Form::getCheckbox('<img src="' . getPathImage('cms') . 'language/' . $lang_code . '.png" alt="' . $lang_code . '" /> ' . $lang_code, 'admin_lang_' . $lang_code, 'admin_lang[' . $lang_code . ']', '1', isset($assigned_lang[$lang_code])), 'content'); } $GLOBALS['page']->add(Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo_pref', 'undo_pref', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content'); }
function _getRenameImage() { return getPathImage('lms') . 'standard/edit.png'; }
function _getSaveImage() { return getPathImage() . 'homerepo/save.gif'; }
function userdetails() { checkPerm('view'); require_once _base_ . '/lib/lib.table.php'; $idst_user = importVar('id', true, 0); $ord = importVar('ord'); $inv = importVar('inv', true, 0); $link = 'index.php?modname=statistic&op=userdetails&id=' . $idst_user . ''; $nav_bar = new NavBar('ini', Get::sett('visuItem'), 0, 'link'); $nav_bar->setLink($link . '&ord=' . $ord . '&inv=' . $inv); if (!isset($_GET['p_ini'])) { $ini = $nav_bar->getSelectedElement(); } else { $ini = $_GET['p_ini']; } $lang =& DoceboLanguage::createInstance('statistic', 'lms'); $acl_man = Docebo::user()->getAclManager(); $user_info =& $acl_man->getUser($idst_user, false); $page_title = array('index.php?modname=statistic&op=statistic' => $lang->def('_STATISTICS'), $user_info[ACL_INFO_LASTNAME] . $user_info[ACL_INFO_FIRSTNAME] ? $user_info[ACL_INFO_LASTNAME] . ' ' . $user_info[ACL_INFO_FIRSTNAME] : $acl_man->relativeId($user_info[ACL_INFO_USERID])); // Find modulename -> name int his course require_once $GLOBALS['where_lms'] . '/lib/lib.course.php'; $course_man = new Man_Course(); $mods_names =& $course_man->getModulesName($_SESSION['idCourse']); // find total time in the course $query_time = "\r\n\tSELECT SUM((UNIX_TIMESTAMP(lastTime) - UNIX_TIMESTAMP(enterTime)))\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_tracksession \r\n\tWHERE idCourse = '" . (int) $_SESSION['idCourse'] . "' AND idUser = '******'"; list($tot_time) = sql_fetch_row(sql_query($query_time)); $query_track = "\r\n\tSELECT idEnter, enterTime, lastTime, (UNIX_TIMESTAMP(lastTime) - UNIX_TIMESTAMP(enterTime)) AS howm, \r\n\t\tnumOp, lastFunction, lastOp, session_id \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_tracksession \r\n\tWHERE idCourse = '" . (int) $_SESSION['idCourse'] . "' AND idUser = '******'\r\n\tORDER BY "; $img_down = '<img src="' . getPathImage() . 'standard/ord_asc.png" alt="' . $lang->def("_ORD_ASC_TITLE") . '" ' . 'title="' . $lang->def("_ORD_ASC_TITLE") . '" />'; $img_up = '<img src="' . getPathImage() . 'standard/ord_desc.png" alt="' . $lang->def("_ORD_DESC_ALT") . '" ' . 'title="' . $lang->def("_ORD_DESC_TITLE") . '" />'; $image_hm = $image_nop = $image_sst = ''; switch ($ord) { case "hm": $query_track .= " howm " . ($inv ? ' ' : ' DESC '); $order_for = $lang->def('_HOW_MUCH_TIME'); $image_hm = $inv ? $img_down : $img_up; break; case "nop": $query_track .= " numOp " . ($inv ? ' ' : 'DESC'); $order_for = $lang->def('_NUMBER_OF_OP'); $image_nop = $inv ? $img_down : $img_up; break; default: $query_track .= " enterTime " . ($inv ? ' DESC ' : ''); $order_for = $lang->def('_SESSION_STARTED'); $image_sst = $inv ? $img_down : $img_up; break; } $query_track .= " LIMIT " . $ini . ", " . Get::sett('visuItem'); $re_tracks = sql_query($query_track); $query_tot_track = "\r\n\tSELECT COUNT(*) \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_tracksession \r\n\tWHERE idCourse = '" . (int) $_SESSION['idCourse'] . "' AND idUser = '******'"; list($tot_elem) = sql_fetch_row(sql_query($query_tot_track)); $nav_bar->setElementTotal($tot_elem); $GLOBALS['page']->add(getTitleArea($page_title, 'statistic') . '<div class="std_block">' . getBackUi('index.php?modname=statistic&op=statistic', $lang->def('_BACK')), 'content'); $tb = new Table(0, $lang->def('_USERS_LIST_DETAILS_CAPTION'), $lang->def('_USERS_LIST_DETAILS_SUMMARY')); $type_h = array('', '', 'align_center', 'align_center', ''); $cont_h = array('<a href="' . $link . '&ord=sst&inv=' . ($ord == 'sst' && $inv ? '0' : '1') . '" title="' . $lang->def('_ORD_FOR_SST') . '">' . $image_sst . ' ' . $lang->def('_SESSION_STARTED') . '</a>', $lang->def('_LAST_ACTION_AT'), '<a href="' . $link . '&ord=hm&inv=' . ($ord == 'hm' && $inv ? '0' : '1') . '" title="' . $lang->def('_ORD_FOR_HM') . '">' . $image_hm . ' ' . $lang->def('_HOW_MUCH_TIME') . '</a>', '<a href="' . $link . '&ord=nop&inv=' . ($ord == 'nop' && $inv ? '0' : '1') . '" title="' . $lang->def('_ORD_FOR_NOP') . '">' . $image_nop . ' ' . $lang->def('_NUMBER_OF_OP') . '</a>', $lang->def('_LAST_OP')); if (Get::sett('tracking') == 'on') { $cont_h[] = '<img src="' . getPathImage() . 'standard/view.png" title="' . $lang->def('_VIEW_SESSION_DETAILS') . '" ' . 'alt="' . $lang->def('_VIEW_SESSION_DETAILS_ALT') . '" />'; $type_h[] = 'image'; } $tb->setColsStyle($type_h); $tb->addHead($cont_h); $type_h[2] = 'align_right'; $tb->setColsStyle($type_h); $total_sec = 0; $chart_data = array(); while (list($id_enter, $session_start_at, $last_action_at, $how, $num_op, $last_module, $last_op, $session_id) = sql_fetch_row($re_tracks)) { $hours = (int) ($how / 3600); $minutes = (int) ($how % 3600 / 60); $seconds = (int) ($how % 60); if ($minutes < 10) { $minutes = '0' . $minutes; } if ($seconds < 10) { $seconds = '0' . $seconds; } $readable = $hours . 'h ' . $minutes . 'm ' . $seconds . 's '; $start = Format::date($session_start_at); $cont = array($start, Format::date($last_action_at, false, true), $readable, $num_op, '<span class="text_bold">' . (isset($mods_names[$last_module]) ? $mods_names[$last_module] : $last_module) . '</span> [' . $last_op . ']'); if (Get::sett('tracking') == 'on') { $cont[] = '<a href="index.php?modname=statistic&op=sessiondetails&id=' . $idst_user . '&id_enter=' . $id_enter . '&p_ini=' . $ini . '&sid=' . $session_id . '" ' . 'title="' . $lang->def('_VIEW_SESSION_DETAILS') . ' : ' . $start . '">' . '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('_VIEW_SESSION_DETAILS_ALT') . ' : ' . $start . '" /></a>'; } $tb->addBody($cont); $chart_data[] = array('x_axis' => $start, 'y_axis' => $how); } $hours = (int) ($tot_time / 3600); $minutes = (int) ($tot_time % 3600 / 60); $seconds = (int) ($tot_time % 60); if ($minutes < 10) { $minutes = '0' . $minutes; } if ($seconds < 10) { $seconds = '0' . $seconds; } $json = new Services_JSON(); cout('<div>' . '<span class="text_bold">' . $lang->def('_USER_TOTAL_TIME') . ' : </span>' . $hours . 'h ' . $minutes . 'm ' . $seconds . 's ' . '</div>' . '<div id="statistic_chart">Unable to load Flash content. Required Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player Download Center</a>.</div> <script type="text/javascript"> var dataSource = new YAHOO.util.DataSource( ' . $json->encode(array_values($chart_data)) . ' ); dataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; dataSource.responseSchema = {fields: [ "x_axis", "y_axis" ]}; var getDataTipText = function(item, index, series) { var toolTipText = Math.floor(item.y_axis/3600) +"h "+ Math.floor((item.y_axis%3600)/60) + "m"; return toolTipText; }; var myChart = new YAHOO.widget.ColumnChart( "statistic_chart", dataSource, { xField: "x_axis", yField: "y_axis", wmode: "opaque", dataTipFunction: getDataTipText }); </script>' . $tb->getTable() . $nav_bar->getNavBar($ini) . getBackUi('index.php?modname=statistic&op=statistic', $lang->def('_BACK')) . '</div>', 'content'); }