You are here

function weight_form_views_form_alter in Weight 7.2

Implements hook_form_BASE_FORM_ID_alter().

File

./weight.module, line 394

Code

function weight_form_views_form_alter(&$form, &$form_state, $form_id) {
  $view = $form_state['build_info']['args'][0];

  // Check for a weight field and an empty view.
  if (array_key_exists('weight', $view->field) && empty($view->result)) {

    // No need for buttons on an empty form.
    unset($form['actions']);
  }
}