diff -Naurw moodle-clean/moodle/files/index.php moodle-live/files/index.php
--- moodle-clean/moodle/files/index.php 2008-11-27 09:49:39.000000000 +0000
+++ moodle-live/files/index.php 2009-04-23 15:45:44.000000000 +0100
@@ -22,6 +22,7 @@
$save = optional_param('save', 0, PARAM_BOOL);
$text = optional_param('text', '', PARAM_RAW);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
+ $meta = optional_param('meta', 0, PARAM_INT);//to enable parent metacourse file selection
if ($choose) {
if (count(explode('.', $choose)) > 2) {
@@ -29,6 +30,9 @@
}
}
+ if(!empty($meta)){
+ $id=$meta;
+ }
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
@@ -702,6 +706,17 @@
global $id;
global $USER, $CFG;
global $choose;
+ global $COURSE;
+ global $meta;
+
+ //do metacourse magic here
+ if($parents=get_records('course_meta','child_course',$COURSE->id)){
+ foreach($parents as $parent){
+ $parent=get_record('course','id',$parent->parent_course);
+ echo ''.$parent->fullname.'';
+ }
+ }
+
$fullpath = $basedir.$wdir;
$dirlist = array();
@@ -785,7 +800,7 @@
$filesize = display_size(get_directory_size("$fullpath/$dir"));
$filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
print_cell("center", "", 'checkbox');
- print_cell("left", "
pixpath/f/folder.gif\" class=\"icon\" alt=\"$strfolder\" /> ".htmlspecialchars($dir)."", 'name');
+ print_cell("left", "
pixpath/f/folder.gif\" class=\"icon\" alt=\"$strfolder\" /> ".htmlspecialchars($dir)."", 'name');
print_cell("right", $filesize, 'size');
print_cell("right", $filedate, 'date');
print_cell("right", "$strrename", 'commands');
@@ -830,8 +845,12 @@
print_cell("right", $filedate, 'date');
if ($choose) {
+ if(empty($meta)){
$edittext = "$strchoose ";
} else {
+ $edittext = "wwwroot/file.php/$meta/$selectfile')\" href=\"#\">$strchoose ";
+ }
+ } else {
$edittext = '';
}