You are here

function hosting_site_form_alter in Hostmaster (Aegir) 6

Implements of hook_form_alter().

Hide the delete button on site nodes

File

modules/hosting/site/hosting_site.form.inc, line 332
Site node form.

Code

function hosting_site_form_alter(&$form, &$form_state, $form_id) {

  // Remove delete button from site edit form, unless the site's already been deleted via the Delete task
  if ($form_id == 'site_node_form') {
    $node = $form['#node'];
    if ($node->site_status !== '-2') {
      $form['buttons']['delete']['#type'] = 'hidden';
    }
  }
}