$categoryBrowser = new category_browser($category);
    $parentCategory = $categoryBrowser->get_current_category_settings();
    $categoryList = $categoryBrowser->get_sub_category_list();
    $courseList = $categoryBrowser->get_course_list();
}
if (trim($category) != '') {
    $backCommandLine = '<p>' . '<small>' . '<a href="' . $_SERVER['PHP_SELF'] . "?category=" . urlencode($parentCategory['code_P']) . '">' . '&lt;&lt; ' . get_lang('previous level') . '</a>' . '</small>' . '</p>' . "\n";
    $pageTitle = $parentCategory['name'];
} else {
    $backCommandLine = '';
    $pageTitle = get_lang('Platform Courses');
}
$out .= $backCommandLine;
$out .= claro_html_tool_title($pageTitle);
if (count($categoryList) - 1 >= 0) {
    $out .= claro_html_title(get_lang('Categories'), 4) . '<ul>' . "\n";
    foreach ($categoryList as $thisCategory) {
        $out .= '<li>' . "\n";
        if ($thisCategory['nbCourse'] + $thisCategory['nb_childs'] > 0) {
            $out .= '<a href="' . $_SERVER['PHP_SELF'] . '?category=' . urlencode($thisCategory['code']) . '">' . $thisCategory['name'] . '</a>';
        } else {
            $out .= $thisCategory['name'];
        }
        $out .= ' <small>(' . $thisCategory['nbCourse'] . ')</small>' . "\n" . '</li>' . "\n";
    }
    $out .= '</ul>' . "\n";
}
if (count($courseList) > 0) {
    if (count($categoryList) - 1 > 0) {
        $out .= '<hr size="1" noshade="noshade" />' . "\n";
    }
} else {
    ?>
    <h3><?php 
    echo get_lang('Root category');
    ?>
</h3>
<?php 
}
?>

<?php 
if (count($this->categoriesList) - 1 >= 0) {
    ?>
    
    <?php 
    echo claro_html_title(get_lang('Sub categories'), 4);
    ?>
    
    <ul>
    <?php 
    foreach ($this->categoriesList as $category) {
        ?>
        <li>
        
        <?php 
        if (claroCategory::countAllCourses($category['id']) + claroCategory::countAllSubCategories($category['id']) > 0) {
            ?>
           <?php 
            echo '<a href="' . $_SERVER['PHP_SELF'] . '?category=' . urlencode($category['id']) . '#categoryContent">' . $category['name'] . '</a>';
            ?>
        <?php 
Exemple #3
0
 * @author      Claro Team <*****@*****.**>
 * @since       1.10
 */
require_once dirname(__FILE__) . '/inc/claro_init_global.inc.php';
if (claro_is_user_authenticated()) {
    require_once get_path('incRepositorySys') . '/lib/form.lib.php';
    $dialogBox = new DialogBox();
    $display_form = true;
    if (isset($_REQUEST['fday']) && is_numeric($_REQUEST['fday']) && (isset($_REQUEST['fmonth']) && is_numeric($_REQUEST['fmonth'])) && (isset($_REQUEST['fyear']) && is_numeric($_REQUEST['fyear']))) {
        $_SESSION['last_action'] = $_REQUEST['fyear'] . '-' . $_REQUEST['fmonth'] . '-' . $_REQUEST['fday'] . ' 00:00:00';
        if (claro_get_current_course_id() != '') {
            claro_redirect(Url::Contextualize(get_path('clarolineRepositoryWeb') . '/course/index.php'));
        } else {
            claro_redirect(get_path('clarolineRepositoryWeb') . '/index.php');
        }
    }
    /**
     *     DISPLAY SECTION
     *
     */
    $output = '';
    $output .= claro_html_title(get_lang('Change notification date'), 2);
    $output .= $dialogBox->render();
    if ($display_form) {
        $output .= '<form method="get" action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '">' . claro_form_relay_context() . '<fieldset>' . "\n" . '<dd>' . claro_html_date_form('fday', 'fmonth', 'fyear', 0, 'long') . ' ' . '</dd>' . "\n" . '</dl>' . '</fieldset>' . '<input type="submit" class="claroButton" name="notificationDate" value="' . get_lang('Ok') . '" />' . "\n" . '</form>' . "\n";
    }
    Claroline::getDisplay()->body->appendContent($output);
    echo Claroline::getDisplay()->render();
} else {
    claro_redirect('index.php');
}