function seven_form_node_form_alter

Implements hook_form_BASE_FORM_ID_alter().

Changes vertical tabs to container and adds meta information.

File

drupal/core/themes/seven/seven.theme, line 155
Functions to support theming in the Seven theme.

Code

function seven_form_node_form_alter(&$form, &$form_state) {
  $node = $form_state['controller']
    ->getEntity();
  $form['#theme'] = array(
    'node_edit_form',
  );
  $form['#attached'] = array(
    'css' => array(
      drupal_get_path('module', 'node') . '/css/node.module.css',
    ),
  );
  $form['advanced']['#type'] = 'container';
  $form['meta'] = array(
    '#type' => 'fieldset',
    '#attributes' => array(
      'class' => array(
        'entity-meta-header',
      ),
    ),
    '#type' => 'container',
    '#group' => 'advanced',
    '#weight' => -100,
    'published' => array(
      '#type' => 'item',
      '#wrapper_attributes' => array(
        'class' => array(
          'published',
        ),
      ),
      '#markup' => !empty($node->status) ? t('Published') : t('Not published'),
      '#access' => !empty($node->nid),
    ),
    'changed' => array(
      '#type' => 'item',
      '#wrapper_attributes' => array(
        'class' => array(
          'changed',
          'container-inline',
        ),
      ),
      '#title' => t('Last saved'),
      '#markup' => !$node
        ->isNew() ? format_date($node->changed, 'short') : t('Not saved yet'),
    ),
    'author' => array(
      '#type' => 'item',
      '#wrapper_attributes' => array(
        'class' => array(
          'author',
          'container-inline',
        ),
      ),
      '#title' => t('Author'),
      '#markup' => user_format_name(user_load($node->uid)),
    ),
  );
  $form['revision_information']['#type'] = 'container';
  $form['revision_information']['#group'] = 'meta';
}