hide the upcoming event block

hide the upcoming event block

by andriya edward -
Number of replies: 2

hii

     i want to hide the upcoming event block from student.please help

Average of ratings: -
In reply to andriya edward

Re: hide the upcoming event block

by Franco Pantoja -
Picture of Particularly helpful Moodlers
Hi Andriya


you could try this one

blocks\calendar_upcoming\block_calendar_upcoming.php

    /**
     * Return the content of this block.
     *
     * @return stdClass the content
     */
    public function get_content() {
        global $CFG, $USER; // get the global $USER
 if(is_siteadmin($USER->id)) { // we condition the function, eg. only show for admin
        require_once($CFG->dirroot.'/calendar/lib.php');
        if ($this->content !== null) {
            return $this->content;
        } ... }

That way the block won´t appear to students


Regards!!

In reply to andriya edward

Re: hide the upcoming event block

by Melanie Scott -
Picture of Particularly helpful Moodlers

Or you could just turn editing on and edit Roles for the block.  Click the roles icon (it will say it is unavailable, but that's not entirely true).  Then in administration, click permissions and you can remove any permission you don't want to have access to the block.  Remember, at the front page level and My home, the role is Authenticated user.