You are here

function hosting_site_backup_list in Hosting 7.3

Same name and namespace in other branches
  1. 5 site/hosting_site.module \hosting_site_backup_list()
  2. 6.2 site/hosting_site.backups.inc \hosting_site_backup_list()
  3. 7.4 site/hosting_site.backups.inc \hosting_site_backup_list()

Retrieve a list of backup generated for a site.

Parameters

site: The node if of the site backups are being retrieved for

Return value

An associative array of backups existing for the site, indexed by bid and sorted reverse chronologically.

2 calls to hosting_site_backup_list()
hosting_task_backup_delete_form in site/hosting_site.backups.inc
Implements hosting_task_TASK_TYPE_form().
hosting_task_restore_form in task/hosting_task.module
Customize the task confirmation form for restore.

File

site/hosting_site.backups.inc, line 75
Site backup functions.

Code

function hosting_site_backup_list($site) {
  $result = db_query("SELECT bid, description, size, timestamp FROM {hosting_site_backups} WHERE site = :site ORDER BY timestamp DESC", array(
    ':site' => $site,
  ));
  $backups = array();
  foreach ($result as $object) {

    #needs to be cleaned up. but i am NOT generating a theme func for this right now.
    $backups[$object->bid] = '<strong>' . format_date($object->timestamp) . '</strong> - ' . format_size($object->size) . ' - ' . filter_xss($object->description);
  }
  return $backups;
}