General developer forum

Remove "Miscellaneous", "Reports" and "Login activity" sections from User profile.

 
Picture of Salman Zaidi
Re: Remove "Miscellaneous", "Reports" and "Login activity" sections from User profile.
 
I know this is a bad hack but is only solution. I think Moodle does not provide the profile page block management from administration.

You can do by this way:

In user/classes/output/myprofile/renderer.php in render_tree(tree $tree) fucntion

A
dd an if condition as shown in next code block.


Original:

foreach ($categories as $category) {
                $return .= $this->render($category);
        }


Tailored:

foreach ($categories as $category) {
            if ($category->name !== 'miscellaneous' && $category->name !== 'coursedetails' && $category->name !== 'reports') {
                $return .= $this->render($category);
            }
        }


Note: If you want to hid more blocks you can find out the exact string by outputting

echo $category->name."   ";

And you can put those block name in condition above.

 
Average of ratings: -