You are here

function nd_form_alter in Node displays 7

Implementation of hook_form_alter().

File

./nd.module, line 106
Node displays.

Code

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

  // Add build modes on the node content form of ctools.
  if ($form_id == 'ctools_node_content_type_edit_form') {
    $form['identifier']['#type'] = 'select';
    $form['identifier']['#description'] = t('Node displays has taken over the identifier textfield and is now a select box with the available build modes. The template suggestion will now be node-panel-BUILDMODE.tpl.php.');
    $build_modes = array();
    $all_build_modes = ds_get_build_modes('nd');
    foreach ($all_build_modes as $key => $build_mode) {
      $build_modes[$key] = $build_mode['title'];
    }
    $form['identifier']['#options'] = $build_modes;
  }
}