[marginalia] r545 committed - Use Moodle 2.2.3...

1 view
Skip to first unread message

margi...@googlecode.com

unread,
Jun 21, 2012, 2:01:35 AM6/21/12
to marginali...@googlegroups.com
Revision: 545
Author: geof.glass
Date: Wed Jun 20 23:00:49 2012
Log: Use Moodle 2.2.3
Bracket use of miaprofile with if statement in case current page doesn't
support annotation


http://code.google.com/p/marginalia/source/detail?r=545

Modified:
/moodle/trunk/moodle/mod/forum/discuss.php
/moodle/trunk/moodle/mod/forum/lib.php
/moodle/trunk/moodle/mod/forum/post.php

=======================================
--- /moodle/trunk/moodle/mod/forum/discuss.php Wed May 30 15:12:10 2012
+++ /moodle/trunk/moodle/mod/forum/discuss.php Wed Jun 20 23:00:49 2012
@@ -120,7 +120,9 @@
// #marginalia begin
$moodlemia = moodle_marginalia::get_instance( );
$miaprofile = $moodlemia->get_profile( $PAGE->url->out(false) );
- $miaprofile->emit_requires( $moodlemia );
+ if ($miaprofile) {
+ $miaprofile->emit_requires( $moodlemia );
+ }
// #marginalia end

add_to_log($course->id, 'forum', 'view
discussion', "discuss.php?d=$discussion->id", $discussion->id, $cm->id);
@@ -265,10 +267,12 @@
// #marginalia begin
// *not* putting JS last, even though that might speed up page load:
// more important to minimize patch footprint
- $miaprofile->emit_body( $moodlemia );
- $miaprofile->emit_margin_controls( $moodlemia );
+ if ($miaprofile) {
+ $miaprofile->emit_body( $moodlemia );
+ $miaprofile->emit_margin_controls( $moodlemia );
+ }
// #marginalia end
-
+
echo '<div class="clearfloat">&nbsp;</div>';
echo "</div>";

=======================================
--- /moodle/trunk/moodle/mod/forum/lib.php Wed May 30 15:12:10 2012
+++ /moodle/trunk/moodle/mod/forum/lib.php Wed Jun 20 23:00:49 2012
@@ -3416,14 +3416,17 @@
}
$postcontent .= html_writer::tag('div', $attachedimages,
array('class'=>'attachedimages'));
}
+
// #marginalia begin
// Write out the margin. It goes before the content, then floats
right.
global $PAGE;
$miamoodle = moodle_marginalia::get_instance( );
$miaprofile = $miamoodle->get_profile( $PAGE->url->out( false ) );
- $output .= $miaprofile->output_margin( );
+ if ($miaprofile) {
+ $output .= $miaprofile->output_margin( );
+ }
// #marginalia end
-
+
// Output the post content
$output .= html_writer::tag('div', $postcontent,
array('class'=>'posting '.$postclass));
$output .= html_writer::end_tag('div'); // Content
@@ -3451,7 +3454,9 @@
// #marginalia begin
// Ack. Moodle assumes that commands should be links. This doesn't
work
// for the quote button, because it has to call some JS to get the
quote.
- $commandhtml[] = $miaprofile->output_quote_button( );
+ if ($miaprofile) {
+ $commandhtml[] = $miaprofile->output_quote_button( );
+ }
// #marginalia end
$output .= html_writer::tag('div', implode(' | ', $commandhtml),
array('class'=>'commands'));

@@ -4435,7 +4440,7 @@

$context = get_context_instance(CONTEXT_MODULE, $cm->id);

- if ($children != 'ignore' && ($childposts =
$DB->get_records('forum_posts', array('parent'=>$post->id)))) {
+ if ($children !== 'ignore' && ($childposts =
$DB->get_records('forum_posts', array('parent'=>$post->id)))) {
if ($children) {
foreach ($childposts as $childpost) {
forum_delete_post($childpost, true, $course, $cm, $forum,
$skipcompletion);
@@ -5458,7 +5463,8 @@

$discussion->forum = $forum->id;

- forum_print_post($discussion, $discussion, $forum, $cm,
$course, $ownpost, 0, $link, false);
+ forum_print_post($discussion, $discussion, $forum, $cm,
$course, $ownpost, 0, $link, false,
+ '', null, true, $forumtracked);
break;
}
}
=======================================
--- /moodle/trunk/moodle/mod/forum/post.php Wed May 30 15:12:10 2012
+++ /moodle/trunk/moodle/mod/forum/post.php Wed Jun 20 23:00:49 2012
@@ -35,7 +35,6 @@
$name = optional_param('name', '', PARAM_CLEAN);
$confirm = optional_param('confirm', 0, PARAM_INT);
$groupid = optional_param('groupid', null, PARAM_INT);
-$messageinit = optional_param('message', '', PARAM_CLEANHTML);

$PAGE->set_url('/mod/forum/post.php', array(
'reply' => $reply,
@@ -46,7 +45,6 @@
'name' => $name,
'confirm'=>$confirm,
'groupid'=>$groupid,
- 'messageinit'=>$messageinit
));
//these page_params will be passed as hidden variables later in the form.
$page_params = array('reply'=>$reply, 'forum'=>$forum, 'edit'=>$edit);
@@ -144,7 +142,7 @@
$post->parent = 0;
$post->subject = '';
$post->userid = $USER->id;
- $post->message = $messageinit;
+ $post->message = '';
$post->messageformat = editors_get_preferred_format();
$post->messagetrust = 0;

@@ -220,7 +218,7 @@
$post->parent = $parent->id;
$post->subject = $parent->subject;
$post->userid = $USER->id;
- $post->message = $messageinit;
+ $post->message = '';

$post->groupid = ($discussion->groupid == -1) ? 0 :
$discussion->groupid;

@@ -839,7 +837,9 @@
// #marginalia begin
$moodlemia = moodle_marginalia::get_instance( );
$miaprofile = $moodlemia->get_profile( $PAGE->url->out( false ) );
-$miaprofile->emit_requires( $moodlemia );
+if ($miaprofile) {
+ $miaprofile->emit_requires( $moodlemia );
+}
// #marginalia end

echo $OUTPUT->header();
@@ -869,8 +869,10 @@
// #marginalia begin
$moodlemia = moodle_marginalia::get_instance( );
$miaprofile = $moodlemia->get_profile( $PAGE->url->out( false ) );
- $miaprofile->emit_body( );
- $miaprofile->emit_margin_controls( );
+ if ($miaprofile) {
+ $miaprofile->emit_body( );
+ $miaprofile->emit_margin_controls( );
+ }
// #marginalia end

forum_print_post($parent, $discussion, $forum, $cm, $course, false,
false, false);
Reply all
Reply to author
Forward
0 new messages