public function backup_migrate_destination::get_file_links in Backup and Migrate 7.3
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.2 includes/destinations.inc \backup_migrate_destination::get_file_links()
Get the action links for a file on a given destination.
File
- includes/
destinations.inc, line 1126
Class
- backup_migrate_destination
- A base class for creating destinations.
Code
public function get_file_links($file_id) {
$out = array();
// Don't display the download/delete/restore ops if they are not available
// for this destination.
$can_read = $this
->can_read_file($file_id);
$can_delete = $this
->can_delete_file($file_id);
$path = $this
->get_settings_path();
$destination_id = $this
->get_id();
if ($can_read && user_access("access backup files")) {
$out[] = l(t("download"), $path . '/downloadfile/' . $destination_id . '/' . $file_id);
}
if ($can_read && user_access("restore from backup")) {
$out[] = l(t("restore"), $path . '/list/restorefile/' . $destination_id . '/' . $file_id);
}
if ($can_delete && user_access("delete backup files")) {
$out[] = l(t("delete"), $path . '/list/deletefile/' . $destination_id . '/' . $file_id);
}
return $out;
}