Hi everyone,
I am currently movi,g my Moodle from 2.4 to 3.0 and I get an error code saying that this function is deprecated.
The code deprecated is in renderers.php :
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$branch = $menu->add(get_string('my', 'theme_enfa'), new moodle_url('/my'), null, 10000);
$categorytree = get_course_category_tree();
foreach ($categorytree as $category)
{
$branch = $menu->add($category->name, new moodle_url('/course/category.php', array('id' => $category->id)));
if (!empty($category->categories))
{
foreach ($category->categories as $subcategory)
{
$this->add_category_to_custommenu($branch, $subcategory);
}
}
if (!empty($category->courses))
{
foreach ($category->courses as $course)
{
$branch->add($course->shortname, new moodle_url('/course/view.php', array('id' => $course->id)), $course->shortname);
}
}
} // End foreach ($categorytree as $category)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
So I googled it and the only solution I found was : " Add $courses = get_course($categoryid) to your code"
But I'm not a PHP developper so I don't know how to use this function in my .php.
Have you a solution, a tip ?
Thank you for reading, and sorry if my English is not good.
Have a nice day !