Skip to content

Commit

Permalink
Merge branch 'wip-MDL-29086-MOODLE_21_STABLE' of git://github.com/abg…
Browse files Browse the repository at this point in the history
…reeve/moodle into MOODLE_21_STABLE
  • Loading branch information
stronk7 committed Mar 8, 2012
2 parents 8cd16e9 + f123887 commit 4b3d540
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions mod/data/lib.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3117,13 +3117,15 @@ function data_extend_settings_navigation(settings_navigation $settings, navigati
* @return bool * @return bool
*/ */
function data_presets_save($course, $cm, $data, $path) { function data_presets_save($course, $cm, $data, $path) {
global $USER;
$fs = get_file_storage(); $fs = get_file_storage();
$filerecord = new stdClass; $filerecord = new stdClass;
$filerecord->contextid = DATA_PRESET_CONTEXT; $filerecord->contextid = DATA_PRESET_CONTEXT;
$filerecord->component = DATA_PRESET_COMPONENT; $filerecord->component = DATA_PRESET_COMPONENT;
$filerecord->filearea = DATA_PRESET_FILEAREA; $filerecord->filearea = DATA_PRESET_FILEAREA;
$filerecord->itemid = 0; $filerecord->itemid = 0;
$filerecord->filepath = '/'.$path.'/'; $filerecord->filepath = '/'.$path.'/';
$filerecord->userid = $USER->id;


$filerecord->filename = 'preset.xml'; $filerecord->filename = 'preset.xml';
$fs->create_file_from_string($filerecord, data_presets_generate_xml($course, $cm, $data)); $fs->create_file_from_string($filerecord, data_presets_generate_xml($course, $cm, $data));
Expand Down
3 changes: 1 addition & 2 deletions mod/data/preset.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@
print_error('invalidrequest'); print_error('invalidrequest');
} }


$presetpath = data_preset_path($course, $userid, $shortname); data_delete_site_preset($shortname);
fulldelete($presetpath);


$strdeleted = get_string('deleted', 'data'); $strdeleted = get_string('deleted', 'data');
echo $OUTPUT->notification("$shortname $strdeleted", 'notifysuccess'); echo $OUTPUT->notification("$shortname $strdeleted", 'notifysuccess');
Expand Down

0 comments on commit 4b3d540

Please sign in to comment.