You are here

function hosting_platform_form_alter in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 platform/hosting_platform.module \hosting_platform_form_alter()
  2. 7.3 platform/hosting_platform.module \hosting_platform_form_alter()

Hide the delete button on platform nodes.

File

platform/hosting_platform.module, line 369
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';
    }
  }

  // Override the 'Bulk operations' title.
  if ($form_id == 'views_bulk_operations_form_hosting_platform_list_page_platforms') {
    $form['select']['#title'] = 'Platform operations';
  }
}