function _photos_save_data in Album Photos 7.3
Same name and namespace in other branches
- 6.2 photos.module \_photos_save_data()
Write files.
3 calls to _photos_save_data()
- photos_swfu_upload in photos_swfu/
photos_swfu.module - Upload photos with SWFUpload.
- photos_upload_form_submit in inc/
photos.edit.inc - Submit upload form.
- _photos_unzip in ./
photos.module - Unzip.
File
- ./
photos.module, line 2253 - Implementation of photos.module.
Code
function _photos_save_data($file, $val = array()) {
$errors = array();
foreach ($val as $function => $args) {
array_unshift($args, $file);
$errors = array_merge($errors, call_user_func_array($function, $args));
}
if (!empty($errors)) {
$message = t('The selected file %name could not be uploaded.', array(
'%name' => $file->filename,
));
if (count($errors) > 1) {
$message .= '<ul><li>' . implode('</li><li>', $errors) . '</li></ul>';
}
else {
$message .= ' ' . array_pop($errors);
}
drupal_set_message($message);
return 0;
}
$file = file_save($file);
return $file->fid;
}