Moodle

Add div around the posting. Can be better handled by CSS.

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.9.2
  • Fix Version/s: 1.9.4
  • Component/s: Forum
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

The text in forum postings can't be styled good enough. Add a div (probably called "posting") around the text. This separates it from the "content" td and the commands and ratings. the last two are already wrapped in a div.

Issue Links

Activity

Hide
Urs Hunkler added a comment -

Without the div padding around the text will also add padding around the commands and ratings which should not be.

Show
Urs Hunkler added a comment - Without the div padding around the text will also add padding around the commands and ratings which should not be.
Hide
Martin Dougiamas added a comment -

Thanks Urs.

I made these changes on moodle.org ...

      • 2873,2888 ****
        // Print shortened version
        echo format_text(forum_shorten_post($post->message), $post->format, $options, $course->id);
        $numwords = count_words(strip_tags($post->message));
        ! echo '<p><a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'">';
        echo get_string('readtherest', 'forum');
        ! echo '</a> ('.get_string('numwords', '', $numwords).')...</p>';
        } else
        Unknown macro: { // Print whole message if ($highlight) { echo highlight($highlight, format_text($post->message, $post->format, $options, $course->id)); } else { echo format_text($post->message, $post->format, $options, $course->id); }
        echo $attachedimages;
        }

        — 2876,2893 ----
        // Print shortened version
        echo format_text(forum_shorten_post($post->message), $post->format, $options, $course->id);
        $numwords = count_words(strip_tags($post->message));
        ! echo '<div class="posting"><a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'">';
        echo get_string('readtherest', 'forum');
        ! echo '</a> ('.get_string('numwords', '', $numwords).')...</div>';
        } else {
        // Print whole message
        + echo '<div class="posting">';
        if ($highlight) { echo highlight($highlight, format_text($post->message, $post->format, $options, $course->id)); } }
        else { echo format_text($post->message, $post->format, $options, $course->id); }
        + echo '</div>';
        echo $attachedimages;
        }

Please let me know if that's exactly what you needed and if it is then I'll check it into 1.9 and HEAD as well.

Show
Martin Dougiamas added a comment - Thanks Urs. I made these changes on moodle.org ...
      • 2873,2888 **** // Print shortened version echo format_text(forum_shorten_post($post->message), $post->format, $options, $course->id); $numwords = count_words(strip_tags($post->message)); ! echo '<p><a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'">'; echo get_string('readtherest', 'forum'); ! echo '</a> ('.get_string('numwords', '', $numwords).')...</p>'; } else
        Unknown macro: { // Print whole message if ($highlight) { echo highlight($highlight, format_text($post->message, $post->format, $options, $course->id)); } else { echo format_text($post->message, $post->format, $options, $course->id); } echo $attachedimages; } — 2876,2893 ---- // Print shortened version echo format_text(forum_shorten_post($post->message), $post->format, $options, $course->id); $numwords = count_words(strip_tags($post->message)); ! echo '<div class="posting"><a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'">'; echo get_string('readtherest', 'forum'); ! echo '</a> ('.get_string('numwords', '', $numwords).')...</div>'; } else { // Print whole message + echo '<div class="posting">'; if ($highlight) { echo highlight($highlight, format_text($post->message, $post->format, $options, $course->id)); } }
        else { echo format_text($post->message, $post->format, $options, $course->id); } + echo '</div>'; echo $attachedimages; }
Please let me know if that's exactly what you needed and if it is then I'll check it into 1.9 and HEAD as well.
Hide
Urs Hunkler added a comment -

Works great. Thanks Martin for your fast solution.

Show
Urs Hunkler added a comment - Works great. Thanks Martin for your fast solution.
Hide
Petr Škoda (skodak) added a comment -

closing, thanks

Show
Petr Škoda (skodak) added a comment - closing, thanks
Hide
Tim Hunt added a comment -

Did this get committed to CVS? If not, should it. If yes, what no bug Id in the commit message.

Show
Tim Hunt added a comment - Did this get committed to CVS? If not, should it. If yes, what no bug Id in the commit message.
Hide
Martin Dougiamas added a comment -

I just committed it now, thanks for the reminder!

Show
Martin Dougiamas added a comment - I just committed it now, thanks for the reminder!
Hide
Tim Hunt added a comment -

Great. Reviewed code. Closing.

Show
Tim Hunt added a comment - Great. Reviewed code. Closing.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: