function loadBody() { switch ($GLOBALS['op']) { case 'showresults': $id_course = Get::req('id_course', DOTY_INT, false); $_SESSION['idCourse'] = $id_course; Util::jump_to('index.php?modname=organization&op=showresults&idcourse=' . $id_course); break; case "mycourses": case "unregistercourse": require_once $GLOBALS['where_lms'] . '/modules/' . $this->module_name . '/course.php'; require_once _base_ . '/lib/lib.urlmanager.php'; $url =& UrlManager::getInstance('course'); $url->setStdQuery('r=' . _after_login_); mycourses($url); break; case "donwloadmaterials": downloadMaterials(); break; default: require_once $GLOBALS['where_lms'] . '/modules/' . $this->module_name . '/infocourse.php'; infocourseDispatch($GLOBALS['op']); break; } }
function mycompetencesDispatch($op) { require_once _base_ . '/lib/lib.urlmanager.php'; $url =& UrlManager::getInstance('competences'); $url->setStdQuery('modname=mycompetences&op=mycompetences'); switch ($op) { case "mycompetences": default: mycompetences($url); } }
function reservation() { checkPerm('view'); require_once _base_ . '/lib/lib.tab.php'; require_once _base_ . '/lib/lib.urlmanager.php'; require_once _base_ . '/lib/lib.form.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.course.php'; $mod_perm = checkPerm('mod', true); $lang =& DoceboLanguage::createInstance('reservation'); $um =& UrlManager::getInstance("reservation"); $out = $GLOBALS['page']; $out->setWorkingZone('content'); $man_res = new Man_Reservation(); $tab_man = new TabView('reservation', ''); $tab_events = new TabElemDefault('events', $lang->def('_RESERVATION_EVENTS')); $tab_my_events = new TabElemDefault('my_events', $lang->def('_RESERVATION_MY_EVENTS')); $tab_past_event = new TabElemDefault('past_events', $lang->def('_RESERVATION_PAST_EVENTS')); if ($mod_perm) { $tab_subscribed_user = new TabElemDefault('subscribed_user', $lang->def('_RESERVATION_SUBSCRIBED_USER')); } $tab_man->addTab($tab_events); $tab_man->addTab($tab_my_events); $tab_man->addTab($tab_past_event); if ($mod_perm) { $tab_man->addTab($tab_subscribed_user); } $tab_man->parseInput($_POST, $_SESSION); $active_tab = $tab_man->getActiveTab(); if ($active_tab != 'events' && $active_tab != 'my_events' && $active_tab != 'past_events' && $active_tab != 'subscribed_user') { $active_tab = importVar('active_tab', false, 'events'); $tab_man->setActiveTab($active_tab); } $out->add(getTitleArea(Lang::t('_RESERVATION', 'reservation')) . '<div class="std_block">', 'content'); $out->add(Form::openForm('tab_reservation', 'index.php?modname=reservation&op=reservation&confirm=1&ap=mod_profile&from=2') . $tab_man->printTabView_Begin('', false), 'content'); switch ($active_tab) { case 'events': events(); break; case 'my_events': myEvents(); break; case 'past_events': pastEvents(); break; case 'subscribed_user': subscribedUser(); break; } $out->add($tab_man->printTabView_End() . Form::closeForm(), 'content'); $out->add('</div>', 'content'); }
function dispatchConference($op) { require_once _base_ . '/lib/lib.urlmanager.php'; $url =& UrlManager::getInstance(); $url->setStdQuery('modname=conference&op=list'); if (isset($_POST['undo'])) { $op = 'list'; } switch ($op) { case 'list': conference_list($url); break; case 'startnewconf': conference_startnewconf($url); break; case 'modconf': conference_modconf(); break; case 'delconf': conference_delconf(); break; case 'booking': booking(); break; case 'modbooking': modBooking(); break; case 'history': showHistory(); break; case 'log': showLog(); break; default: conference_list($url); } }
function dashAcourse($id_course, $h_number) { require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.user_profile.php'; require_once _base_ . '/lib/lib.navbar.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.preassessment.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.catalogue.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.coursepath.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.course.php'; require_once $GLOBALS["where_lms"] . "/modules/coursecatalogue/lib.coursecatalogue.php"; $lang =& DoceboLanguage::createInstance('standard', 'framework'); $lang->setGlobal(); $lang =& DoceboLanguage::createInstance('course', 'lms'); $normal_subs = 1; $man_course = new DoceboCourse($id_course); $cinfo = $man_course->getAllInfo(); $man_courseuser = new Man_CourseUser(); $usercourses =& $man_courseuser->getUserSubscriptionsInfo(getLogUserId(), false); $select_edition = " SELECT * "; $from_edition = " FROM " . $GLOBALS["prefix_lms"] . "_course_edition"; $where_edition = " WHERE idCourse = '" . $id_course . "' "; $order_edition = " ORDER BY date_begin "; $re_edition = sql_query($select_edition . $from_edition . $where_edition . $order_edition); $editions = array(); if ($re_edition) { while ($edition_elem = mysql_fetch_assoc($re_edition)) { $edition_elem['waiting'] = 0; $edition_elem['user_count'] = 0; $edition_elem['theacher_list'] = getSubscribed($edition_elem["idCourse"], false, 6, true, $edition_elem["idCourseEdition"]); $editions[$edition_elem["idCourse"]][$edition_elem["idCourseEdition"]] = $edition_elem; } } $select_ed_count = "SELECT idCourse, edition_id, sum(waiting) as waiting, COUNT(*) as user_count "; $from_ed_count = "FROM " . $GLOBALS["prefix_lms"] . "_courseuser "; $where_ed_count = "WHERE edition_id <> 0 AND idCourse = '" . $id_course . "'"; $group_ed_count = "GROUP BY edition_id "; $re_ed_count = sql_query($select_ed_count . $from_ed_count . $where_ed_count . $group_ed_count); if ($re_ed_count) { while ($ed_count_elem = mysql_fetch_assoc($re_ed_count)) { $editions[$ed_count_elem["idCourse"]][$ed_count_elem["edition_id"]]['waiting'] = $ed_count_elem['waiting']; $editions[$ed_count_elem["idCourse"]][$ed_count_elem["edition_id"]]['user_count'] = $ed_count_elem['user_count']; } } $cinfo['theacher_list'] = getSubscribed($cinfo['idCourse'], false, 6, true); $cinfo['edition_list'] = isset($editions[$cinfo['idCourse']]) ? $editions[$cinfo['idCourse']] : array(); $cinfo['edition_available'] = count($cinfo['edition_list']); $cinfo['user_score'] = isset($user_score[$cinfo['idCourse']]) ? $user_score[$cinfo['idCourse']] : NULL; require_once _base_ . '/lib/lib.urlmanager.php'; $url =& UrlManager::getInstance('catalogue'); $url->setStdQuery('r=' . _after_login_); if ($normal_subs == 0) { $cinfo['can_subscribe'] = 0; } $html = dashcourse($url, $lang, $cinfo, isset($usercourses[$cinfo['idCourse']]) ? $usercourses[$cinfo['idCourse']] : false, 0, $h_number); return $html; }
function myfilesDispatch($op) { require_once _base_ . '/lib/lib.urlmanager.php'; $url =& UrlManager::getInstance('myfiles'); $url->setStdQuery('modname=myfiles&op=myfiles'); if (isset($_POST['undo'])) { $op = 'myfiles'; } switch ($op) { case "myfiles": fileList($url); break; case "modfiles": modfiles($url); break; case "savefiles": savefiles($url); break; case "delfiles": delfiles($url); break; } }
function readmessage() { //checkPerm('view'); $out = $GLOBALS['page']; $out->setWorkingZone('content'); $um =& UrlManager::getInstance("message"); $acl_man =& Docebo::user()->getAclManager(); $from = importVar('out'); // check the viewer rights $re_viewer = $this->db->query("\r\n\t\tSELECT *\r\n\t\tFROM %adm_message_user\r\n\t\tWHERE idMessage = '" . $_GET['id_message'] . "' AND idUser = '******' "); if (!$this->db->num_rows($re_viewer)) { self::message(); return; } $re_user = $this->db->query("\r\n\t\tUPDATE %adm_message_user AS user\r\n\t\tSET user.read = '" . _MESSAGE_READED . "'\r\n\t\tWHERE user.idMessage = '" . $_GET['id_message'] . "' AND user.idUser = '******' AND user.read = '" . _MESSAGE_UNREADED . "' "); list($sender, $posted, $title, $textof, $attach, $priority) = $this->db->fetch_row($this->db->query("\r\n\t\tSELECT sender, posted, title, textof, attach, priority\r\n\t\tFROM %adm_message\r\n\t\tWHERE idMessage = '" . $_GET['id_message'] . "'")); $sender_info = $acl_man->getUser($sender, false); $author = $sender_info[ACL_INFO_LASTNAME] . $sender_info[ACL_INFO_FIRSTNAME] == '' ? $acl_man->relativeId($sender_info[ACL_INFO_USERID]) : $sender_info[ACL_INFO_LASTNAME] . ' ' . $sender_info[ACL_INFO_FIRSTNAME]; $title_url = $this->mvc_urls ? "index.php?r=message/show" . ($from == 'out' ? '&active_tab=outbox' : '') : $um->getUrl($from == 'out' ? '&active_tab=outbox' : ''); $page_title = array($title_url => Lang::t('_MESSAGES'), Lang::t('_READ') . ' : ' . $title); $download_url = $this->mvc_urls ? 'index.php?r=message/download&id_message=' . $_GET['id_message'] : $um->getUrl('op=download&id_message=' . $_GET['id_message']); $output = ""; $output .= $this->messageGetTitleArea($page_title, 'message') . '<div class="std_block">' . '<h2 class="message_title"><b>' . Lang::t('_TITLE') . ': </b>' . $title . '</h2>' . '<br/>' . '<p><b>' . Lang::t('_SENDER') . ' : </b>' . $author . '</p>' . '<p><b>' . Lang::t('_DATE') . ' : </b>' . Format::date($posted) . '</p>' . '<br/>' . '<p><b>' . Lang::t('_TEXTOF') . '</b></p>' . '<div>' . $textof . '</div>' . '<br />' . ($attach != '' ? '<div class="message_attach"><span class="text_bold">' . Lang::t('_ATTACHMENT') . ' : </span>' . '<a href="' . $download_url . '">' . '<img src="' . getPathImage('fw') . mimeDetect($attach) . '" alt="' . Lang::t('_MIME') . '" />' . preg_replace('/^\\d*_\\d*_\\d*_(.*)/is', '$1', $attach) . '</a></div>' : ''); $sender_arr[$sender_info[ACL_INFO_IDST]] = $sender_info[ACL_INFO_IDST]; if ($sender == getLogUserId()) { $reply_url = $this->mvc_urls ? "index.php?r=message/add&id_forward=" . $_GET['id_message'] . "" : $um->getUrl("op=addmessage&id_forward=" . $_GET['id_message'] . ""); $output .= '<p class="message_reply"><a href="' . $reply_url . '">' . Lang::t('_NEXT') . '</a></p>'; } else { $reply_url = $this->mvc_urls ? 'index.php?r=message/write&reply_recipients=' . urlencode(serialize($sender_arr)) : $um->getUrl('op=writemessage&reply_recipients=' . urlencode(serialize($sender_arr))); $output .= '<p class="message_reply"><a href="' . $reply_url . '">' . Lang::t('_REPLY') . '</a></p>'; } $output .= '</div>'; cout($output, 'content'); }
function mycertificateDispatch($op) { require_once $GLOBALS['where_lms'] . '/lib/lib.certificate.php'; require_once _base_ . '/lib/lib.urlmanager.php'; $url =& UrlManager::getInstance('mycertificate'); $url->setStdQuery('modname=mycertificate&op=mycertificate'); switch ($op) { case "preview_cert": preview_cert($url); break; case "release_cert": release_cert($url); break; case "mycertificate": default: mycertificate($url); } }
function showWikiSelect(&$out, &$lang) { require_once _base_ . "/lib/lib.form.php"; require_once _base_ . '/lib/lib.urlmanager.php'; require_once $GLOBALS["where_framework"] . "/lib/lib.wiki.php"; $um =& UrlManager::getInstance(); $um->setStdQuery("sn=" . Get::cur_plat() . "&op=wiki_sel"); //$um->setBaseUrl($_SERVER["script_name"]); $wiki_id = getEditorWikiId(); $cwp = new CoreWikiPublic($wiki_id); $form = new Form(); $from = importVar("from"); $item_id = (int) importVar("item_id"); $title = ""; $res = ""; //$res.=$cwp->getWikiLangFlags(); $url = getPopupBaseUrl() . "&op=wiki_sel"; addLinkPopupJS(); $res .= $form->openForm("popup_form", $url, false, false, '', "onReset=\"closePopup();\""); $res .= $form->openElementSpace(); $type = getPopupSelType(); /* $res.=$form->getTextfield($lang->def("_PAGE_TITLE"), "title", "title", 255); $res.=$form->getTextfield($lang->def("_EXTENDED_TITLE"), "ext_title", "ext_title", 255); */ $wiki_lang = $cwp->getWikiLanguage(); // TODO: change getLanguage() with the current wiki language; // try to pass arguments in a better way, like using GET.. [?] $wiki_page_db = new TreeDb_WikiDb($cwp->wikiManager->getWikiPageTable(), $cwp->wikiManager->getWikiPageInfoTable(), $wiki_id, $wiki_lang); $treeView = new TreeView_WikiView($wiki_page_db, 'wiki_tree'); $treeView->hideAction(); $treeView->parsePositionData($_POST, $_POST, $_POST); $folder_id = $treeView->getSelectedFolderId(); $folder_name = $treeView->getFolderPrintName($wiki_page_db->getFolderById($folder_id)); $res .= $treeView->autoLoad(); if ($folder_id > 0) { $other_param = 'onClick="insItem();"'; $page_id =& $folder_id; $page_info = $cwp->wikiManager->getPageInfo($wiki_id, $wiki_lang, FALSE, $page_id); $res .= $form->getHidden("title", "title", $page_info["title"]); $res .= $form->getHidden("page_code", "page_code", $page_info["page_code"]); } else { $other_param = 'disabled="disabled"'; } $res .= $form->closeElementSpace(); $res .= $form->openButtonSpace(); $res .= $form->getButton('apply', 'apply', $lang->def('_SAVE'), FALSE, $other_param); $res .= $form->getReset('undo', 'undo', $lang->def('_UNDO')); $res .= $form->closeButtonSpace(); $res .= $form->closeForm(); $out->add($res); }
function printActions(&$stack, $level) { $res = ''; /* if( $this->canInlineDelete() ) { if( $this->canInlineDeleteItem($stack, $level) ) $tree .= '<input type="submit" class="TVActionDelete" value="" name="' .$this->_getOpDeleteFolderId().$stack[$level]['folder']->id .'"' .' title="'.$this->_getDeleteLabel().'" />'; else $tree .= '<div class="TVActionEmpty"></div>'; } if( $this->canInlineRename() ) { if( $this->canInlineRenameItem($stack, $level) ) $tree .= '<input type="submit" class="TVActionRename" value="" name="' .$this->_getOpRenameFolderId().$stack[$level]['folder']->id .'"' .' title="'.$this->_getRenameLabel().'" />'; else $tree .= '<div class="TVActionEmpty"></div>'; } if( $this->canInlineMove() ) { if( $this->canInlineMoveItem($stack, $level) ) $tree .= '<input type="submit" class="TVActionMove" value="" name="' .$this->_getOpMoveFolderId().$stack[$level]['folder']->id .'"' .' title="'.$this->_getMoveLabel().'" />'; else $tree .= '<div class="TVActionEmpty"></div>'; }*/ if ($level > 0) { $um =& UrlManager::getInstance(); $page_code = $stack[$level]['folder']->otherValues[FIELD_PAGE_CODE]; $title = $this->lang->def("_ALT_GOTO_PAGE"); $img = "<img class=\"tree_action\" src=\"" . getPathImage('fw') . "wiki/goto_page.gif\" alt=\"" . $title . "\" "; $img .= "title=\"" . $title . "\" />"; $url = $um->getUrl("page=" . $page_code); $res .= "<a href=\"" . $url . "\">" . $img . "</a>\n"; } if ($this->show_action === false) { return ""; } else { return $res; } }
function lightrepoDispatch($op) { require_once _base_ . '/lib/lib.urlmanager.php'; $url =& UrlManager::getInstance('light_repo'); $url->setStdQuery('modname=light_repo&op=repolist'); if (isset($_POST['undo'])) { $op = 'repolist'; } switch ($op) { case "repolist": repoList($url); break; case "mod_repo": modRepo($url); break; case "del_repo": delRepo($url); break; case "repo_my_details": repoMyDetails($url); break; case "mod_file": modFile($url); break; case "del_file": delFile($url); break; case "repo_manager_details": repoManagerDetails($url); break; case "repo_user_details": repoUserDetails($url); break; case "download_file": downloadFile($url); break; } }
function preAssessmentDispatch($op) { Util::get_js(Get::rel_path('lms') . '/admin/modules/preassessment/ajax.preassessment.js', true, true); require_once _base_ . '/lib/lib.urlmanager.php'; $url =& UrlManager::getInstance(); $url->setStdQuery('modname=preassessment&op=assesmentlist'); if (isset($_POST['undo'])) { $op = 'assesmentlist'; } if (isset($_POST['cancelselector'])) { $op = 'assesmentlist'; } switch ($op) { case "assesmentlist": assesmentlist($url); break; case "modassessment": modassessment($url); break; case "delassessment": delassessment($url); break; // user management ---------------------------------------- // user management ---------------------------------------- case "modassessuser": modassessuser($url); break; case "modassessadmin": modassessadmin($url); break; // manage management -------------------------------------- // manage management -------------------------------------- case "manageassessment": checkPerm('mod'); $id_assessment = importVar('id_assess', true, 0); require_once $GLOBALS['where_lms'] . '/lib/lib.preassessment.php'; $assess_man = new AssessmentList(); if (!$assess_man->addAssessmentUser($id_assessment, USER_ASSES_TYPE_ADMIN, array(getLogUserId()))) { Util::jump_to($url->getUrl('result=error_assign')); } else { require_once $GLOBALS['where_lms'] . '/lib/lib.subscribe.php'; $subs_man = new CourseSubscribe_Management(); $subs_man->multipleUserSubscribe(getLogUserId(), array($id_assessment), 6); Docebo::user()->loadUserSectionST(); Docebo::user()->SaveInSession(); Util::jump_to($GLOBALS['where_lms_relative'] . '/index.php?modname=course&op=aula&idCourse=' . $id_assessment . '&from_admin=1'); } break; // rule management ---------------------------------------- // rule management ---------------------------------------- case "modrule": modrule($url); break; case "assignrule": assignrule($url); break; case "saverule": saverule($url); break; case "delrule": delrule($url); break; } }
function selectWiki() { checkPerm('edit'); $res = ""; $can_mod = checkPerm('edit', true); $cwa =& cwaSetup(); $page_content = $cwa->selectLmsWiki(); if ($page_content !== FALSE) { $out =& $GLOBALS["page"]; $out->setWorkingZone("content"); $title_label = $cwa->lang->def("_SELECT_WIKI"); $um =& UrlManager::getInstance(); $back_url = $um->getUrl(); $title[$back_url] = $cwa->lang->def("_WIKI"); $title[] = $title_label; $res .= $cwa->titleArea($title); $res .= $cwa->getHead($can_mod, TRUE, FALSE, FALSE, TRUE); $res .= $page_content; $res .= $cwa->getFooter(); $out->add($res); } }
$from_ed_count = "FROM " . $GLOBALS["prefix_lms"] . "_courseuser "; $where_ed_count = "WHERE edition_id <> 0 AND idCourse = '" . $id_course . "'"; $group_ed_count = "GROUP BY edition_id "; $re_ed_count = sql_query($select_ed_count . $from_ed_count . $where_ed_count . $group_ed_count); if ($re_ed_count) { while ($ed_count_elem = mysql_fetch_assoc($re_ed_count)) { $editions[$ed_count_elem["idCourse"]][$ed_count_elem["edition_id"]]['waiting'] = $ed_count_elem['waiting']; $editions[$ed_count_elem["idCourse"]][$ed_count_elem["edition_id"]]['user_count'] = $ed_count_elem['user_count']; } } $cinfo['theacher_list'] = getSubscribed($cinfo['idCourse'], false, 6, true); $cinfo['edition_list'] = isset($editions[$cinfo['idCourse']]) ? $editions[$cinfo['idCourse']] : array(); $cinfo['edition_available'] = count($cinfo['edition_list']); $cinfo['user_score'] = isset($user_score[$cinfo['idCourse']]) ? $user_score[$cinfo['idCourse']] : NULL; require_once _base_ . '/lib/lib.urlmanager.php'; $url =& UrlManager::getInstance('catalogue'); $url->setStdQuery('modname=coursecatalogue&op=coursecatalogue'); if ($normal_subs == 0) { $cinfo['can_subscribe'] = 0; } $html = dashcourse($url, $lang, $cinfo, isset($usercourses[$cinfo['idCourse']]) ? $usercourses[$cinfo['idCourse']] : false, 0); $value = array("content" => $html, "elem_id" => importVar('elem_id'), "id_course" => importVar('id_course', false, 0)); require_once _base_ . '/lib/lib.json.php'; $json = new Services_JSON(); $output = $json->encode($value); aout($output); break; // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------- case "course_vote": require_once $GLOBALS["where_lms"] . "/lib/lib.course.php";
/** * initialize the internal url manager instance * @param string $std_query the std_query for the address */ function initUrlManager($std_query) { require_once _base_ . '/lib/lib.urlmanager.php'; $this->_url_man =& UrlManager::getInstance(); $this->_url_man->setStdQuery($std_query); }
function externalCourselist() { require_once $GLOBALS['where_lms'] . '/modules/coursecatalogue/lib.coursecatalogue.php'; require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.user_profile.php'; require_once _base_ . '/lib/lib.navbar.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.preassessment.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.catalogue.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.coursepath.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.course.php'; require_once _base_ . '/lib/lib.urlmanager.php'; $url =& UrlManager::getInstance('login'); $url->setStdQuery('modname=login&op=courselist'); addCss('style_tab', 'lms'); login_coursecatalogueJsSetup(); $GLOBALS['page']->add('<!--[if lt IE 7.]> <script type="text/javascript" src="' . $GLOBALS['where_framework_relative'] . '/lib/lib.pngfix.js"></script> <![endif]-->', 'page_head'); $lang =& DoceboLanguage::createInstance('catalogue'); $lang_c =& DoceboLanguage::createInstance('course'); // list of tab --------------------------------------------------------------------------- $tab_list = array('time' => $lang->def('_TAB_VIEW_TIME'), 'category' => $lang->def('_TAB_VIEW_CATEGORY'), 'all' => $lang->def('_ALL')); if (Get::sett('use_coursepath') == '1') { $tab_list['pathcourse'] = $lang->def('_COURSEPATH'); } if (Get::sett('use_social_courselist') == 'on') { $tab_list['mostscore'] = $lang->def('_TAB_VIEW_MOSTSCORE'); $tab_list['popular'] = $lang->def('_TAB_VIEW_MOSTPOPULAR'); $tab_list['recent'] = $lang->def('_TAB_VIEW_RECENT'); } $tab_selected = unserialize(urldecode(Get::sett('tablist_coursecatalogue'))); foreach ($tab_list as $tab_code => $v) { if (!isset($tab_selected[$tab_code])) { unset($tab_list[$tab_code]); } } reset($tab_list); // tab selected for courses ------------------------------------------------------------- $first_coursecatalogue_tab = Get::sett('first_coursecatalogue_tab', key($tab_list)); if (!isset($tab_list[$first_coursecatalogue_tab])) { $first_coursecatalogue_tab = key($tab_list); } if (isset($_GET['tab']) || isset($_POST['tab'])) { $selected_tab = $_SESSION['cc_tab'] = Get::req('tab', DOTY_MIXED, $first_coursecatalogue_tab); } elseif (isset($_SESSION['cc_tab'])) { $selected_tab = $_SESSION['cc_tab']; } else { $selected_tab = $first_coursecatalogue_tab; } $GLOBALS['page']->add('<div id="coursecatalogue_tab_container">' . '<ul class="flat_tab">', 'content'); foreach ($tab_list as $key => $tab_name) { $GLOBALS['page']->add('<li' . ($selected_tab == $key ? ' class="now_selected"' : '') . '>' . '<a href="' . $url->getUrl('tab=' . $key) . '"><span>' . $tab_name . '</span></a></li>', 'content'); } $GLOBALS['page']->add('</ul>' . '</div>' . '<div class="std_block" id="coursecatalogue">', 'content'); switch ($selected_tab) { case "pathcourse": displayCoursePathList($url, $selected_tab); break; /* case "time" : { displayTimeCourseList($url, $selected_tab); };break;*/ /* case "time" : { displayTimeCourseList($url, $selected_tab); };break;*/ default: displayCourseList($url, $selected_tab); } $GLOBALS['page']->add('</div>', 'content'); // end of function ---------------------------------------------------------------- }
function forumDispatch($op) { require_once _base_ . '/lib/lib.urlmanager.php'; $url_man =& UrlManager::getInstance('forum'); $url_man->setStdQuery('index.php?modname=forum&op=forum'); switch ($op) { case "forum": forum(); break; //-----------------------------------------------// //-----------------------------------------------// case "addforum": addforum(); break; case "insforum": insforum(); break; //-----------------------------------------------// //-----------------------------------------------// case "modforum": modforum(); break; case "upforum": upforum(); break; case "downforum": moveforum($_GET['idForum'], 'down'); break; case "moveupforum": moveforum($_GET['idForum'], 'up'); break; case "modstatus": changestatus(); break; case "export": export(); break; //-----------------------------------------------// //-----------------------------------------------// case "delforum": delforum(); break; //-----------------------------------------------// //-----------------------------------------------// case "modforumaccess": modforumaccess(); break; //-----------------------------------------------// //-----------------------------------------------// case "thread": thread(); break; //-----------------------------------------------// //-----------------------------------------------// case "addthread": addthread(); break; case "insthread": insthread(); break; //-----------------------------------------------// //-----------------------------------------------// case "modthread": modthread(); break; case "movethread": $id_thread = importVar('id_thread', true, 0); $id_forum = importVar('id_forum', true, 0); moveThread($id_thread, $id_forum); break; case "upthread": upthread(); break; //-----------------------------------------------// //-----------------------------------------------// case "delthread": delthread(); break; //-----------------------------------------------// //-----------------------------------------------// case "message": message(); break; case "moderatemessage": moderatemessage(); break; case "modstatusthread": modstatusthread(); break; case "changeerased": changeerase(); break; //-----------------------------------------------// //-----------------------------------------------// case "addmessage": addmessage(); break; case "insmessage": insmessage(); break; //-----------------------------------------------// //-----------------------------------------------// case "modmessage": modmessage(); break; case "upmessage": upmessage(); break; //-----------------------------------------------// //-----------------------------------------------// case "delmessage": delmessage(); break; //-----------------------------------------------// //-----------------------------------------------// case "viewprofile": viewprofile(); break; //-----------------------------------------------// //-----------------------------------------------// case "editsema": editsema(); break; case "savesema": savesema(); break; //-----------------------------------------------// //-----------------------------------------------// case "download": checkPerm('view'); require_once _base_ . '/lib/lib.download.php'; //find file list($title, $attach) = sql_fetch_row(sql_query("\r\n\t\t\tSELECT title, attach\r\n\t\t\tFROM " . $GLOBALS['prefix_lms'] . "_forummessage\r\n\t\t\tWHERE idMessage='" . (int) $_GET['id'] . "'")); if (!$attach) { $GLOBALS['page']->add(getErrorUi('Sorry, such file does not exist!'), 'content'); return; } //recognize mime type $expFileName = explode('.', $attach); $totPart = count($expFileName) - 1; $path = '/appLms/' . Get::sett('pathforum'); //send file sendFile($path, $attach, $expFileName[$totPart]); break; //-----------------------------------------------// //-----------------------------------------------// case "search": forumsearch(); break; case "searchmessage": forumsearchmessage(); break; //-----------------------------------------------// } }
function myfriendsDispatch($op) { require_once _base_ . '/lib/lib.urlmanager.php'; $url =& UrlManager::getInstance('myfriends'); $url->setStdQuery('modname=myfriends&op=myfriends'); if (isset($_POST['undo']) || isset($_GET['undo'])) { $op = 'myfriends'; } switch ($op) { case "myfriends": myfriends($url); break; case "searchuser": searchUser($url); break; case "approveuser": approveuser($url); break; case "delfriend": delfriend($url); break; } }
function selectLmsWiki() { include_once _lms_ . '/lib/lib.course.php'; include_once _base_ . '/lib/lib.form.php'; include_once _lib_ . '/lib.table.php'; $um =& UrlManager::getInstance(); $back_url = $um->getUrl(); $course_id = $this->getCourseId(); if (isset($_POST["undo"])) { Util::jump_to($back_url); } else { if (isset($_POST["save"])) { $this->wikiManager->saveLmsSelectedWiki($course_id, $_POST); Util::jump_to($back_url); } else { $res = ""; $form = new Form(); $table_caption = $this->lang->def("_TABLE_SELECT_WIKI_CAP"); $table_summary = $this->lang->def("_TABLE_SELECT_WIKI_SUM"); $tab = new Table(0, $table_caption, $table_summary); $head = array($this->lang->def("_TITLE"), ""); $head_type = array("", "image"); $tab->setColsStyle($head_type); $tab->addHead($head); $course_list = Man_CourseUser::getUserCourseList(getLogUserId()); $selectable_wiki = $this->wikiManager->getCourseWikiList($course_list); $wiki_list = $this->wikiManager->getCourseWikiList($course_id); $source_platform = $this->getSourcePlatform(); $data_info = $this->wikiManager->getWikiList(FALSE, FALSE, " wiki_id IN (" . implode(',', $selectable_wiki['list']) . ") ", $source_platform); $data_arr = $data_info["data_arr"]; $db_tot = $data_info["data_tot"]; $tot = count($data_arr); for ($i = 0; $i < $tot; $i++) { $id = $data_arr[$i]["wiki_id"]; $rowcnt = array(); $rowcnt[] = $data_arr[$i]["title"]; $check_cell = ""; $checked = in_array($id, $wiki_list["list"]) ? TRUE : FALSE; $disabled = ""; if ($checked) { $field_id = "db_sel_wiki_" . $id; $field_name = "db_sel_wiki[" . $id . "]"; $check_cell .= $form->getHidden($field_id, $field_name, $id); $is_owner = $wiki_list["data"][$id]["is_owner"] == 1 ? TRUE : FALSE; if ($is_owner) { $disabled = ' disabled="disabled"'; $field_id = "owned_wiki_" . $id; $field_name = "owned_wiki[" . $id . "]"; $check_cell .= $form->getHidden($field_id, $field_name, $id); } } $chk_id = "sel_wiki_" . $id; $chk_name = "sel_wiki[" . $id . "]"; $check_cell .= $form->getCheckbox("", $chk_id, $chk_name, $id, $checked, $disabled); $rowcnt[] = $check_cell; $tab->addBody($rowcnt); } $url = $um->getUrl("op=selectwiki"); $res .= $form->openForm("main_form", $url); $res .= $tab->getTable(); $res .= $form->openButtonSpace(); $res .= $form->getButton('save', 'save', $this->lang->def("_SAVE")); $res .= $form->getButton('undo', 'undo', $this->lang->def('_UNDO')); $res .= $form->closeButtonSpace(); $res .= $form->closeForm(); return $res; } } }
<?php defined("IN_FORMA") or die('Direct access is forbidden.'); /* ======================================================================== \ | FORMA - The E-Learning Suite | | | | Copyright (c) 2013 (Forma) | | http://www.formalms.org | | License http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt | | | | from docebo 4.0.5 CE 2008-2012 (c) docebo | | License http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt | \ ======================================================================== */ if (Docebo::user()->isAnonymous()) { die("You can't access"); } require_once _base_ . '/lib/lib.urlmanager.php'; $um =& UrlManager::getInstance("message"); $um->setStdQuery("modname=message&op=message"); if (!defined('IN_LMS')) { define("IN_LMS", TRUE); } define("_PATH_MESSAGE", '/appLms/' . Get::sett('pathmessage')); define("_MESSAGE_VISU_ITEM", Get::sett('visuItem')); define("_MESSAGE_PL_URL", Get::sett('url')); require_once _adm_ . '/lib/lib.message.php';
function questbankDispatch($op) { require_once _lib_ . '/lib.urlmanager.php'; $url =& UrlManager::getInstance(); $url->setStdQuery('modname=quest_bank&op=main'); if (isset($_POST['undo'])) { $op = 'main'; } if (isset($_POST['import_quest'])) { $op = 'importquest'; } if (isset($_POST['export_quest'])) { $op = 'exportquest'; } switch ($op) { case "addquest": addquest($url); break; case "modquest": modquest($url); break; case "importquest": importquest($url); break; case "doimportquest": doimportquest($url); break; case "exportquest": exportquest($url); break; case "main": default: questbank($url); } }