Merge branch 'dev_MDL-33513_files_source' of git://github.com/danpoltawski/moodle

This commit is contained in:
Dan Poltawski 2012-06-14 11:12:21 +08:00
commit cd925ac79b
13 changed files with 180 additions and 32 deletions

View file

@ -1159,6 +1159,16 @@ abstract class repository {
return null;
}
/**
* Return the source information
*
* @param stdClass $url
* @return string|null
*/
public function get_file_source_info($url) {
return $url;
}
/**
* Move file from download folder to file pool using FILE API
*
@ -2216,6 +2226,25 @@ abstract class repository {
return true;
}
/**
* Build draft file's source field
*
* {@link file_restore_source_field_from_draft_file()}
* XXX: This is a hack for file manager (MDL-28666)
* For newly created draft files we have to construct
* source filed in php serialized data format.
* File manager needs to know the original file information before copying
* to draft area, so we append these information in mdl_files.source field
*
* @param string $source
* @return string serialised source field
*/
public static function build_source_field($source) {
$sourcefield = new stdClass;
$sourcefield->source = $source;
return serialize($sourcefield);
}
}
/**