mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +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
1 changed files with 8 additions and 4 deletions
|
@ -124,7 +124,7 @@
|
||||||
echo '<span class="helplink">' . get_string("forcessubscribe", 'forum') . '</span><br />';
|
echo '<span class="helplink">' . get_string("forcessubscribe", 'forum') . '</span><br />';
|
||||||
helpbutton("subscription", $strallowchoice, "forum");
|
helpbutton("subscription", $strallowchoice, "forum");
|
||||||
echo ' <span class="helplink">';
|
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>";
|
echo "<a title=\"$strallowchoice\" href=\"subscribe.php?id=$forum->id&force=no\">$strallowchoice</a>";
|
||||||
} else {
|
} else {
|
||||||
echo $streveryoneisnowsubscribed;
|
echo $streveryoneisnowsubscribed;
|
||||||
|
@ -142,14 +142,18 @@
|
||||||
echo '<span class="helplink">' . get_string("allowsallsubscribe", 'forum') . '</span><br />';
|
echo '<span class="helplink">' . get_string("allowsallsubscribe", 'forum') . '</span><br />';
|
||||||
helpbutton("subscription", $strforcesubscribe, "forum");
|
helpbutton("subscription", $strforcesubscribe, "forum");
|
||||||
echo ' ';
|
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 "<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 {
|
} else {
|
||||||
echo '<span class="helplink">'.$streveryonecannowchoose.'</span>';
|
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,
|
echo '<div class="helplink" id="subscriptionlink">', forum_get_subscribe_link($forum, $context,
|
||||||
array('forcesubscribed' => '', 'cantsubscribe' => '')), '</div>';
|
array('forcesubscribed' => '', 'cantsubscribe' => '')), '</div>';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue