You are here

function hosting_site_hosting_tasks in Hosting 5

Same name and namespace in other branches
  1. 6.2 site/hosting_site.module \hosting_site_hosting_tasks()
  2. 7.4 site/hosting_site.module \hosting_site_hosting_tasks()
  3. 7.3 site/hosting_site.module \hosting_site_hosting_tasks()

implementation of hook_hosting_tasks

File

site/hosting_site.module, line 25

Code

function hosting_site_hosting_tasks($node) {
  $options = array();
  if ($node->type == 'site') {
    if (hosting_task_outstanding($node->nid, 'delete') || $node->site_status == HOSTING_SITE_DELETED) {
      return $options;
    }
    if (hosting_task_outstanding($node->nid, 'enable') || $node->site_status == HOSTING_SITE_ENABLED) {
      $options['backup'] = array(
        'title' => t('Backup'),
        'description' => t('Generate a backup of this site that can be restored to at any time'),
        'weight' => 7,
      );
      $options['restore'] = array(
        'title' => t('Restore'),
        'description' => t('Restore this site to a previous backup. A new backup will be created before this is attempted.'),
        'weight' => 7,
      );
      $options['verify'] = array(
        'title' => t('Verify'),
        'description' => t('Confirm that the site has been correctly installed and regenerate all configuration files to match the hosting front end.'),
        'weight' => 9,
      );
      $options['disable'] = array(
        'title' => t('Disable'),
        'description' => t('Disabling this site will stop it from being accessible.
             It can be enabled again later.'),
        'weight' => 4,
      );
    }
    else {
      $options['enable'] = array(
        'title' => t('Enable'),
        'description' => t('Enabling this site will allow it to be accesible again.
             It may be disabled again if needed.'),
        'weight' => 4,
      );
      $options['delete'] = array(
        'title' => t('Delete'),
        'description' => t('Deleting this site will completely remove it from the hosting system,
            but will keep the last backup available. This process can not be undone.
            Are you really sure you want to delete this site?'),
        'weight' => 10,
      );
    }
  }
  return $options;
}