mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 14:02:32 +02:00
MDL-13149 - use correct capability checks to decide which forum subscribe
links to display merged from MOODLE_19_STABLE
This commit is contained in:
parent
012912655a
commit
5d49ff351d
@ -124,7 +124,7 @@
|
||||
echo '<span class="helplink">' . get_string("forcessubscribe", 'forum') . '</span><br />';
|
||||
helpbutton("subscription", $strallowchoice, "forum");
|
||||
echo ' <span class="helplink">';
|
||||
if (has_capability('moodle/course:manageactivities', $context)) {
|
||||
if (has_capability('mod/forum:managesubscriptions', $context)) {
|
||||
echo "<a title=\"$strallowchoice\" href=\"subscribe.php?id=$forum->id&force=no\">$strallowchoice</a>";
|
||||
} else {
|
||||
echo $streveryoneisnowsubscribed;
|
||||
@ -142,14 +142,18 @@
|
||||
echo '<span class="helplink">' . get_string("allowsallsubscribe", 'forum') . '</span><br />';
|
||||
helpbutton("subscription", $strforcesubscribe, "forum");
|
||||
echo ' ';
|
||||
if (has_capability('moodle/course:manageactivities', $context)) {
|
||||
|
||||
if (has_capability('mod/forum:managesubscriptions', $context)) {
|
||||
echo "<span class=\"helplink\"><a title=\"$strforcesubscribe\" href=\"subscribe.php?id=$forum->id&force=yes\">$strforcesubscribe</a></span>";
|
||||
echo "<br />";
|
||||
echo "<span class=\"helplink\"><a href=\"subscribers.php?id=$forum->id\">$strshowsubscribers</a></span>";
|
||||
} else {
|
||||
echo '<span class="helplink">'.$streveryonecannowchoose.'</span>';
|
||||
}
|
||||
|
||||
if(has_capability('mod/forum:viewsubscribers', $context)){
|
||||
echo "<br />";
|
||||
echo "<span class=\"helplink\"><a href=\"subscribers.php?id=$forum->id\">$strshowsubscribers</a></span>";
|
||||
}
|
||||
|
||||
echo '<div class="helplink" id="subscriptionlink">', forum_get_subscribe_link($forum, $context,
|
||||
array('forcesubscribed' => '', 'cantsubscribe' => '')), '</div>';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user