You are here

function hosting_platform_form_alter in Hostmaster (Aegir) 6

Hide the delete button on platform nodes.

File

modules/hosting/platform/hosting_platform.module, line 245
Platform node type definition.

Code

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

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