Created
August 14, 2012 11:44
-
-
Save renatosousafilho/3348602 to your computer and use it in GitHub Desktop.
Alteração para renderizar apenas as categorias maiores na págiona inicial. Arquivo moodle/course/renderer.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Renderers a category for use with course_category_tree | |
* | |
* @param array $category | |
* @param int $depth | |
* @return string | |
*/ | |
//Aqui o parâmetro $depth passa a receber o valor 0(zero) | |
protected function course_category_tree_category(stdClass $category, $depth=0) { | |
$content = ''; | |
$hassubcategories = (isset($category->categories) && count($category->categories)>0); | |
$hascourses = (isset($category->courses) && count($category->courses)>0); | |
$classes = array('category'); | |
if ($category->parent != 0) { | |
$classes[] = 'subcategory'; | |
} | |
if (empty($category->visible)) { | |
$classes[] = 'dimmed_category'; | |
} | |
if ($hassubcategories || $hascourses) { | |
$classes[] = 'with_children'; | |
/* | |
* Aqui a condição verifica se a profundidade é maior ou igual a zero | |
*/ | |
if ($depth >= 0) { | |
$classes[] = 'collapsed'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment