function _backup_migrate_destination_get_file_links in Backup and Migrate 5.2
Same name and namespace in other branches
- 8.2 includes/destinations.inc \_backup_migrate_destination_get_file_links()
- 8.3 includes/destinations.inc \_backup_migrate_destination_get_file_links()
- 6.3 includes/destinations.inc \_backup_migrate_destination_get_file_links()
- 6.2 includes/destinations.inc \_backup_migrate_destination_get_file_links()
- 7.3 includes/destinations.inc \_backup_migrate_destination_get_file_links()
- 7.2 includes/destinations.inc \_backup_migrate_destination_get_file_links()
Get the action links for a file on a given destination.
2 calls to _backup_migrate_destination_get_file_links()
- backup_migrate_ui_destination_display_files in includes/
destinations.inc - List the backup files in the given destination.
- backup_migrate_ui_manual_backup_form_submit in ./
backup_migrate.module - Submit the form. Save the values as defaults if desired and output the backup file.
File
- includes/
destinations.inc, line 626 - All of the destination handling code needed for Backup and Migrate.
Code
function _backup_migrate_destination_get_file_links($destination_id, $file_id) {
$out = array();
if ($destination = backup_migrate_get_destination($destination_id)) {
// Don't display the download/delete/restore ops if they are not available for this destination.
$can_read = !empty($destination['load_callback']);
$can_delete = !empty($destination['delete_callback']);
if ($can_read && user_access("access backup files")) {
$out[] = l(t("Download"), "admin/content/backup_migrate/destination/downloadfile/" . $destination_id . '/' . $file_id);
}
if ($can_read && user_access("restore from backup")) {
$out[] = l(t("Restore..."), "admin/content/backup_migrate/destination/restorefile/" . $destination_id . '/' . $file_id);
}
if ($can_read && user_access("delete backup files")) {
$out[] = l(t("Delete..."), "admin/content/backup_migrate/destination/deletefile/" . $destination_id . '/' . $file_id);
}
}
return $out;
}