';
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
- $summarytext = file_convert_relative_pluginfiles($thissection->summary, 'pluginfile.php', "$coursecontext->id/course_section/$thissection->id/");
+ $summarytext = rewrite_pluginfile_urls($thissection->summary, 'pluginfile.php', "$coursecontext->id/course_section/$thissection->id/");
$summaryformatoptions = new object();
$summaryformatoptions->noclean = true;
echo format_text($summarytext, FORMAT_HTML, $summaryformatoptions);
Index: index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/index.php,v
retrieving revision 1.225
diff -u -r1.225 index.php
--- index.php 3 Mar 2009 01:03:56 -0000 1.225
+++ index.php 31 Mar 2009 04:29:21 -0000
@@ -146,7 +146,7 @@
}
$context = get_context_instance(CONTEXT_COURSE, SITEID);
- $summarytext = file_convert_relative_pluginfiles($section->summary, 'pluginfile.php', "$context->id/course_section/$section->id/");
+ $summarytext = rewrite_pluginfile_urls($section->summary, 'pluginfile.php', "$context->id/course_section/$section->id/");
$summaryformatoptions = new object();
$summaryformatoptions->noclean = true;
Index: course/format/topics/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/format/topics/format.php,v
retrieving revision 1.95
diff -u -r1.95 format.php
--- course/format/topics/format.php 17 Feb 2009 16:18:06 -0000 1.95
+++ course/format/topics/format.php 31 Mar 2009 04:29:21 -0000
@@ -136,7 +136,7 @@
echo '
';
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
- $summarytext = file_convert_relative_pluginfiles($thissection->summary, 'pluginfile.php', "$coursecontext->id/course_section/$thissection->id/");
+ $summarytext = rewrite_pluginfile_urls($thissection->summary, 'pluginfile.php', "$coursecontext->id/course_section/$thissection->id/");
$summaryformatoptions = new object();
$summaryformatoptions->noclean = true;
echo format_text($summarytext, FORMAT_HTML, $summaryformatoptions);
Index: mod/forum/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/forum/lib.php,v
retrieving revision 1.777
diff -u -r1.777 lib.php
--- mod/forum/lib.php 26 Mar 2009 21:15:12 -0000 1.777
+++ mod/forum/lib.php 31 Mar 2009 04:29:26 -0000
@@ -2972,7 +2972,7 @@
$post->course = $course->id;
$post->forum = $forum->id;
- $post->message = file_convert_relative_pluginfiles($post->message, 'pluginfile.php', "$modcontext->id/forum_post/$post->id/");
+ $post->message = rewrite_pluginfile_urls($post->message, 'pluginfile.php', "$modcontext->id/forum_post/$post->id/");
// caching
if (!isset($cm->cache)) {
@@ -4136,9 +4136,9 @@
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
- $info = get_draftarea_info($post->attachments);
+ $info = get_draft_area_info($post->attachments);
$present = ($info['filecount']>0) ? '1' : '';
- file_convert_draftarea($post->attachments, $context->id, 'forum_attachment', $post->id, false);
+ save_files_from_draft_area($post->attachments, $context->id, 'forum_attachment', $post->id, false);
$DB->set_field('forum_posts', 'attachment', $present, array('id'=>$post->id));
@@ -4166,7 +4166,7 @@
return false;
}
- $message = file_convert_draftarea($post->itemid, $context->id, 'forum_post', $post->id, true, $message);
+ $message = save_files_from_draft_area($post->itemid, $context->id, 'forum_post', $post->id, true, $message);
$DB->set_field('forum_posts', 'message', $message, array('id'=>$post->id));
forum_add_attachment($post, $forum, $cm, $mform, $message);
@@ -4206,7 +4206,7 @@
$discussion->timestart = $post->timestart;
$discussion->timeend = $post->timeend;
}
- $post->message = file_convert_draftarea($post->itemid, $context->id, 'forum_post', $post->id, true, $post->message);
+ $post->message = save_files_from_draft_area($post->itemid, $context->id, 'forum_post', $post->id, true, $post->message);
$DB->set_field('forum_posts', 'message', $post->message, array('id'=>$post->id));
if (!$DB->update_record('forum_discussions', $discussion)) {
@@ -4257,7 +4257,7 @@
return 0;
}
- $text = file_convert_draftarea($discussion->itemid, $context->id, 'forum_post', $post->id, true, $post->message);
+ $text = save_files_from_draft_area($discussion->itemid, $context->id, 'forum_post', $post->id, true, $post->message);
$DB->set_field('forum_posts', 'message', $text, array('id'=>$post->id));
// Now do the main entry for the discussion, linking to this first post
Index: mod/forum/post.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/forum/post.php,v
retrieving revision 1.182
diff -u -r1.182 post.php
--- mod/forum/post.php 26 Mar 2009 02:52:59 -0000 1.182
+++ mod/forum/post.php 31 Mar 2009 04:29:27 -0000
@@ -459,7 +459,7 @@
$mform_post = new mod_forum_post_form('post.php', array('course'=>$course, 'cm'=>$cm, 'coursecontext'=>$coursecontext, 'modcontext'=>$modcontext, 'forum'=>$forum, 'post'=>$post));
- file_prepare_draftarea($draftitemid, $modcontext->id, 'forum_attachment', empty($post->id)?null:$post->id , false);
+ prepare_draft_area($draftitemid, $modcontext->id, 'forum_attachment', empty($post->id)?null:$post->id , false);
//load data into form NOW!
@@ -496,8 +496,8 @@
$subscribe = !empty($USER->autosubscribe);
}
- $draftid_editor = file_get_submitted_draftitemid('message');
- $currenttext = file_prepare_draftarea($draftid_editor, $modcontext->id, 'forum_post', empty($post->id) ? null : $post->id, true, $post->message);
+ $draftid_editor = get_submitted_draft_itemid('message');
+ $currenttext = prepare_draft_area($draftid_editor, $modcontext->id, 'forum_post', empty($post->id) ? null : $post->id, true, $post->message);
$mform_post->set_data(array( 'attachments'=>$draftitemid,
'general'=>$heading,
'subject'=>$post->subject,
Index: course/editsection.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/editsection.php,v
retrieving revision 1.34
diff -u -r1.34 editsection.php
--- course/editsection.php 17 Feb 2009 16:18:05 -0000 1.34
+++ course/editsection.php 31 Mar 2009 04:29:21 -0000
@@ -20,8 +20,8 @@
$context = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('moodle/course:update', $context);
- $draftitemid = file_get_submitted_draftitemid('summary');
- $currenttext = file_prepare_draftarea($draftitemid, $context->id, 'course_section', $section->id, true, $section->summary);
+ $draftitemid = get_submitted_draft_itemid('summary');
+ $currenttext = prepare_draft_area($draftitemid, $context->id, 'course_section', $section->id, true, $section->summary);
$mform = new editsection_form(null, $course);
$data = array('id'=>$section->id, 'summary'=>array('text'=>$currenttext, 'format'=>FORMAT_HTML, 'itemid'=>$draftitemid));
@@ -33,7 +33,7 @@
} else if ($data = $mform->get_data()) {
- $text = file_convert_draftarea($data->summary['itemid'], $context->id, 'course_section', $section->id, true, $data->summary['text']);
+ $text = save_files_from_draft_area($data->summary['itemid'], $context->id, 'course_section', $section->id, true, $data->summary['text']);
$DB->set_field("course_sections", "summary", $text, array("id"=>$section->id));
add_to_log($course->id, "course", "editsection", "editsection.php?id=$section->id", "$section->section");
redirect("view.php?id=$course->id");