mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 04:33:13 +01:00
Merge branch 'wip-mdl-30798' of git://github.com/rajeshtaneja/moodle
This commit is contained in:
commit
0af076a215
@ -86,17 +86,20 @@ class block_blog_recent extends block_base {
|
||||
|
||||
$context = $this->page->context;
|
||||
|
||||
$url = new moodle_url('/blog/index.php');
|
||||
$filter = array();
|
||||
if ($context->contextlevel == CONTEXT_MODULE) {
|
||||
$filter['module'] = $context->instanceid;
|
||||
$a = new stdClass;
|
||||
$a->type = get_string('modulename', $this->page->cm->modname);
|
||||
$strview = get_string('viewallmodentries', 'blog', $a);
|
||||
$url->param('modid', $context->instanceid);
|
||||
} else if ($context->contextlevel == CONTEXT_COURSE) {
|
||||
$filter['course'] = $context->instanceid;
|
||||
$a = new stdClass;
|
||||
$a->type = get_string('course');
|
||||
$strview = get_string('viewblogentries', 'blog', $a);
|
||||
$url->param('courseid', $context->instanceid);
|
||||
} else {
|
||||
$strview = get_string('viewsiteentries', 'blog');
|
||||
}
|
||||
@ -104,7 +107,6 @@ class block_blog_recent extends block_base {
|
||||
|
||||
$bloglisting = new blog_listing($filter);
|
||||
$entries = $bloglisting->get_entries(0, $this->config->numberofrecentblogentries, 4);
|
||||
$url = new moodle_url('/blog/index.php', $filter);
|
||||
|
||||
if (!empty($entries)) {
|
||||
$entrieslist = array();
|
||||
|
Loading…
x
Reference in New Issue
Block a user