mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-18483 Added an edit icon to the forum intro to make it easier to edit
This commit is contained in:
parent
21c1422ef8
commit
157d25fb0d
@ -8,15 +8,25 @@
|
||||
|
||||
if ($forum = forum_get_course_forum($course->id, 'social')) {
|
||||
|
||||
$cm = get_coursemodule_from_instance('forum', $forum->id);
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
|
||||
/// Print forum intro above posts MDL-18483
|
||||
if (trim($forum->intro) != '') {
|
||||
$options = new stdclass;
|
||||
$options->para = false;
|
||||
echo $OUTPUT->box(format_text($forum->intro, FORMAT_MOODLE, $options), 'generalbox', 'intro');
|
||||
$introcontent = format_text($forum->intro, FORMAT_MOODLE, $options);
|
||||
|
||||
if ($PAGE->user_is_editing() && has_capability('moodle/course:update', $context)) {
|
||||
$streditsummary = get_string('editsummary');
|
||||
$introcontent .= '<div class="editinglink"><a title="'.$streditsummary.'" '.
|
||||
' href="modedit.php?update='.$cm->id.'&sesskey='.sesskey().'">'.
|
||||
'<img src="'.$OUTPUT->pix_url('t/edit') . '" '.
|
||||
' class="icon edit" alt="'.$streditsummary.'" /></a></div>';
|
||||
}
|
||||
echo $OUTPUT->box($introcontent, 'generalbox', 'intro');
|
||||
}
|
||||
|
||||
$cm = get_coursemodule_from_instance('forum', $forum->id);
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
echo '<div class="subscribelink">', forum_get_subscribe_link($forum, $context), '</div>';
|
||||
forum_print_latest_discussions($course, $forum, 10, 'plain', '', false);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user