Hide Links in Activities Block?

Hide Links in Activities Block?

by Chardelle Busch -
Number of replies: 3
Picture of Core developers
Would it be possible to hide the links in the Activities Block?  In my case, I find the Activities block useful only as easy links for students to see all of their journals and all of their discussions on one page.  Also, let's say, for example, your course has one poll at the beginning of the course, having a link to that one poll in the block seems redundant.  Or if you had one certificate that is meant only to be accessed at the end of the course (but is not hidden) but you don't want to make the link to it prominent in the block.  It would be nice to be able to hide these.
Average of ratings: -
In reply to Chardelle Busch

Re: Hide Links in Activities Block?

by Chardelle Busch -
Picture of Core developers

I figured out a workaround to the hiding of links above.  To the block_activities_modules.php file I replaced the code in between these lines with:

 $this->content->footer = '';
  
  
                    $this->content->items[] = '<a href="../mod/journal/index.php?id='.$this->course->id.'">My Journals</a>';
                    $this->content->icons[] = '<img src="'.$CFG->modpixpath.'/journal/icon.gif" height="16" width="16" alt="">';
     $this->content->items[] = '<a href="../mod/forum/index.php?id='.$this->course->id.'">All Discussions</a>';
                    $this->content->icons[] = '<img src="'.$CFG->modpixpath.'/forum/icon.gif" height="16" width="16" alt="">';
              

        return $this->content;

And now I have just the journal and forum links in the activities block!!!

In reply to Chardelle Busch

Re: Hide Links in Activities Block?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Glad you solved the issue for your site, but needless to say this hack won't be mainstream any time soon. smile

Just hiding the block completely would do the job.
In reply to Chardelle Busch

Re: Hide Links in Activities Block?

by Alistair McQuade -
Thanks for this chardelle! smile I found this hack useful but I needed to update it slightly for for moodle 1.6:            

  $this->content->footer = '';

                    $this->content->items[] = '<a href="../mod/journal/index.php?id='.$this->instance->pageid.'">My Journals</a>';
                    $this->content->icons[] = '<img src="'.$CFG->modpixpath.'/journal/icon.gif" height="16" width="16" alt="">';
                    $this->content->items[] = '<a href="../mod/forum/index.php?id='.$this->instance->pageid.'">All Discussions</a>';
                    $this->content->icons[] = '<img src="'.$CFG->modpixpath.'/forum/icon.gif" height="16" width="16" alt="">';
             

        return $this->content;
       
    }

Thanks

Al