function file_admin_publish_action in File admin 7
Sets the published field of a file to 1 (published).
Parameters
file_entity $file_entity: A file entity object.
array $context: (optional) Array of additional information about what triggered the action. Not used for this action.
File
- ./
file_admin.module, line 411 - Enhances file administration by adding published, promote, and sticky fields.
Code
function file_admin_publish_action($file_entity, $context = array()) {
file_admin_mass_update(array(
'fid' => $file_entity->fid,
), array(
'published' => FILE_PUBLISHED,
));
if (!empty($file_entity->title)) {
$title = $file_entity->title;
}
else {
$title = $file_entity->filename;
}
watchdog('action', 'Set @type %title to published.', array(
'@type' => file_get_type($file_entity),
'%title' => $title,
));
}