Proyectos de Subversion Moodle

Rev

Rev 1312 | Rev 1314 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1312 Rev 1313
Línea 1375... Línea 1375...
1375
     *
1375
     *
1376
     * @return string HTML fragment.
1376
     * @return string HTML fragment.
1377
     */
1377
     */
1378
    public function main_content()
1378
    public function main_content()
1379
    {
1379
    {
1380
        $this->page->set_state(moodle_page::STATE_IN_BODY);
1380
        // This is here because it is the only place we can inject the "main" role over the entire main content area
-
 
1381
        // without requiring all theme's to manually do it, and without creating yet another thing people need to
1381
        ob_start();
1382
        // remember in the theme.
1382
        $this->page->get_renderer('core')->render_page_content();
1383
        // This is an unfortunate hack. DO NO EVER add anything more here.
1383
        return ob_get_clean();
1384
        // DO NOT add classes.
-
 
1385
        // DO NOT add an id.
-
 
1386
        return '<div class="main-content" role="main">' . $this->unique_main_content_token . '</div>';
1384
    }
1387
    }
Línea 1385... Línea 1388...
1385
 
1388
 
1386
    /**
1389
    /**
1387
     * Outputs a heading
1390
     * Outputs a heading
Línea 2892... Línea 2895...
2892
        if (!$PAGE->course || $PAGE->course->id == SITEID) {
2895
        if (!$PAGE->course || $PAGE->course->id == SITEID) {
2893
            return '';
2896
            return '';
2894
        }
2897
        }
Línea 2895... Línea 2898...
2895
 
2898
 
2896
        // Show course index to users can access the course only.
2899
        // Show course index to users can access the course only.
-
 
2900
        if (!can_access_course($PAGE->course)) {
2897
        if (!can_access_course($PAGE->course, null, '', true)) {
2901
            $templatecontext['main_content'] = '<div class="alert alert-warning">No tenés acceso al curso.</div>';
-
 
2902
        } else {
2898
            return '';
2903
            $templatecontext['main_content'] = $OUTPUT->main_content();
Línea 2899... Línea 2904...
2899
        }
2904
        }
2900
 
2905
 
2901
        $format = course_get_format($PAGE->course);
2906
        $format = course_get_format($PAGE->course);