You are here

function hosting_server_form_alter in Hosting 7.4

Same name and namespace in other branches
  1. 7.3 server/hosting_server.module \hosting_server_form_alter()

Hide the delete button on server nodes.

File

server/hosting_server.module, line 313

Code

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

  // Remove delete button from server edit form,
  // unless the server's already been deleted via the Delete task.
  if ($form_id == 'server_node_form') {
    $node = $form['#node'];
    if (isset($node->server_status) && $node->server_status !== HOSTING_SERVER_DELETED) {
      $form['actions']['delete']['#type'] = 'hidden';
    }
  }
}