MDL-50430 forum: Add number of subscribers to forum subscriber list

This commit is contained in:
Daniel Neis Araujo 2015-06-01 11:08:55 -03:00
parent 57739a72cb
commit 54cf94390b
3 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1 @@
subscribersto,mod_forum

View File

@ -462,7 +462,7 @@ $string['subscribeenrolledonly'] = 'Sorry, only enrolled users are allowed to su
$string['subscribed'] = 'Subscribed';
$string['subscribenone'] = 'Unsubscribe everyone from this forum';
$string['subscribers'] = 'Subscribers';
$string['subscribersto'] = 'Subscribers to \'{$a}\'';
$string['subscriberstowithcount'] = 'Subscribers to "{$a->name}" ({$a->count})';
$string['subscribestart'] = 'Send me notifications of new posts in this forum';
$string['subscribestop'] = 'I don\'t want to be notified of new posts in this forum';
$string['subscription'] = 'Subscription';
@ -518,3 +518,6 @@ $string['warnformorepost'] = 'Warning! There is more than one discussion in this
$string['yournewquestion'] = 'Your new question';
$string['yournewtopic'] = 'Your new discussion topic';
$string['yourreply'] = 'Your reply';
// Deprecated since Moodle 3.0.
$string['subscribersto'] = 'Subscribers to "{$a->name}"';

View File

@ -124,7 +124,10 @@ class mod_forum_renderer extends plugin_renderer_base {
} else {
$cm = $modinfo->instances['forum'][$forum->id];
$canviewemail = in_array('email', get_extra_user_fields(context_module::instance($cm->id)));
$output .= $this->output->heading(get_string("subscribersto","forum", "'".format_string($forum->name)."'"));
$strparams = new stdclass();
$strparams->name = format_string($forum->name);
$strparams->count = count($users);
$output .= $this->output->heading(get_string("subscriberstowithcount", "forum", $strparams));
$table = new html_table();
$table->cellpadding = 5;
$table->cellspacing = 5;