function filebrowser_filebrowser_metadata_set in Filebrowser 7.4
Same name and namespace in other branches
- 8 filebrowser.module \filebrowser_filebrowser_metadata_set()
- 6.2 filebrowser.module \filebrowser_filebrowser_metadata_set()
- 7.2 filebrowser.module \filebrowser_filebrowser_metadata_set()
- 7.3 filebrowser.module \filebrowser_filebrowser_metadata_set()
File
- ./
filebrowser.module, line 1342
Code
function filebrowser_filebrowser_metadata_set($file, $metadata) {
$base_path = _filebrowser_safe_dirname($file['full-path']);
$data = _filebrowser_load_description_file($base_path);
if (!isset($data['file'])) {
$data['file'] = "{$base_path}/descript.ion";
}
if ($metadata === NULL) {
// Clear metadata for the given file.
unset($data['data'][$file['display-name']]);
}
else {
$data['data'][$file['display-name']] = $metadata['description'];
}
_filebrowser_save_description_file($data, $base_path);
_filebrowser_load_description_file($base_path, $data);
}