Exemple #1
0
        $viewOptions = new CourseTreeViewOptions(true, false, Url::buildUrl(get_module_url('CLUSR') . '/class_add.php?cmd=exEnrol', $urlParamList, null)->toUrl(), null, true);
        // var_dump($viewOptions);
    } else {
        $viewOptions = new CourseTreeViewOptions(true, false, Url::buildUrl($_SERVER['PHP_SELF'] . '?cmd=exReg', $urlParamList, null)->toUrl(), null);
    }
    $categoryBrowser->setViewOptions($viewOptions);
    $parentCategoryId = $categoryBrowser->getCurrentCategorySettings()->idParent;
    // Build the search box
    $searchBox = new CourseSearchBox($_SERVER['REQUEST_URI']);
    if ($fromAdmin == 'class') {
        $viewOptions = new CourseTreeViewOptions(true, false, Url::buildUrl(get_module_url('CLUSR') . '/class_add.php?cmd=exEnrol', $urlParamList, null)->toUrl(), null, true);
        // var_dump($viewOptions);
    } else {
        $viewOptions = new CourseTreeViewOptions(true, false, Url::buildUrl($_SERVER['PHP_SELF'] . '?cmd=exReg', $urlParamList, null)->toUrl(), null);
    }
    $searchBox->setViewOptions($viewOptions);
    $displayMode = DISPLAY_COURSE_TREE;
}
// end cmd == rqReg
/*=====================================================================
   Display Section
  =====================================================================*/
$newLink = '';
// Set the back link
if ($cmd == 'rqReg' && (!empty($categoryId) || !empty($parentCategoryId))) {
    $backUrl = $_SERVER['PHP_SELF'] . '?cmd=rqReg&categoryId=' . urlencode($parentCategoryId);
    $backLabel = get_lang('Back to parent category');
} else {
    // Build the back url regarding the script we're coming from
    if ($userSettingMode == true) {
        if ($fromAdmin == 'settings') {