Proyectos de Subversion Moodle

Rev

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

Rev 1314 Rev 1315
Línea 1366... Línea 1366...
1366
            $this->render($am),
1366
            $this->render($am),
1367
            $usermenuclasses
1367
            $usermenuclasses
1368
        );
1368
        );
1369
    }
1369
    }
Línea -... Línea 1370...
-
 
1370
 
-
 
1371
 
-
 
1372
    /**
-
 
1373
     * Returns standard main content placeholder.
-
 
1374
     * Designed to be called in theme layout.php files.
-
 
1375
     *
-
 
1376
     * @return string HTML fragment.
-
 
1377
     */
-
 
1378
    public function main_content()
-
 
1379
    {
-
 
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
-
 
1382
        // remember in the theme.
-
 
1383
        // This is an unfortunate hack. DO NO EVER add anything more here.
-
 
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>';
-
 
1387
    }
1370
 
1388
 
1371
    /**
1389
    /**
1372
     * Outputs a heading
1390
     * Outputs a heading
1373
     *
1391
     *
1374
     * @param string $text The text of the heading
1392
     * @param string $text The text of the heading
Línea 2877... Línea 2895...
2877
        if (!$PAGE->course || $PAGE->course->id == SITEID) {
2895
        if (!$PAGE->course || $PAGE->course->id == SITEID) {
2878
            return '';
2896
            return '';
2879
        }
2897
        }
Línea 2880... Línea 2898...
2880
 
2898
 
2881
        // Show course index to users can access the course only.
2899
        // Show course index to users can access the course only.
2882
        if (!can_access_course($PAGE->course)) {
-
 
2883
            $templatecontext['main_content'] = '<div class="alert alert-warning">No tenés acceso al curso.</div>';
2900
        if (!can_access_course($PAGE->course, null, '', true)) {
2884
        } else {
-
 
2885
            $templatecontext['main_content'] = $OUTPUT->main_content();
2901
            return '';
Línea 2886... Línea 2902...
2886
        }
2902
        }
2887
 
2903
 
2888
        $format = course_get_format($PAGE->course);
2904
        $format = course_get_format($PAGE->course);
Línea 2892... Línea 2908...
2892
        }
2908
        }
Línea 2893... Línea 2909...
2893
 
2909
 
2894
        return '';
2910
        return '';
Línea 2895... Línea -...
2895
    }
-
 
2896
 
-
 
2897
    public function main_content()
-
 
2898
    {
-
 
2899
        // This is here because it is the only place we can inject the "main" role over the entire main content area
-
 
2900
        // without requiring all theme's to manually do it, and without creating yet another thing people need to
-
 
2901
        // remember in the theme.
-
 
2902
        // This is an unfortunate hack. DO NO EVER add anything more here.
-
 
2903
        // DO NOT add classes.
-
 
2904
        // DO NOT add an id.
-
 
2905
        return '<div class="main-content" role="main">' . $this->unique_main_content_token . '</div>';
-
 
2906
    }
2911
    }
2907
 
2912
 
2908
    /*
2913
    /*
2909
    *
2914
    *
2910
    * Method to get reference to $CFG->themedir variable
2915
    * Method to get reference to $CFG->themedir variable