Add a succes message on save

Added line 70

In /group/forms/group.inc I suggest to add drupal_set_message, see code below

/**
 * Form API submit callback for the group form.
 */
function group_form_submit($form, &$form_state) {
  $group = entity_ui_form_submit_build_entity($form, $form_state);
  $group->save();
  drupal_set_message($group->title . ' is saved successfully.');

  $form_state['redirect'] = "group/$group->gid";
}

Make the button labels dynamic based on the group->type

In /group/forms/group.inc I suggest to change the '#value' for the Submit and Delete action, see code below

line 40 and 47

  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save') . ' ' . str_replace('_', ' ', $group->type),
    '#weight' => 40,
  );

  if ($op == 'edit') {
    $form['actions']['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete') . ' ' . str_replace('_', ' ', $group->type),
      '#weight' => 45,
      '#limit_validation_errors' => array(),
      '#submit' => array('group_form_submit_delete'),
    );

Comments

kristiaanvandeneynde’s picture

Status: Active » Fixed

Thanks! Made some small improvements and committed in dbfce7c.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

  • Commit dbfce7c on 7.x-1.x, ctools_plugins, inheritance by kristiaanvandeneynde:
    Issue #2086193 by kristiaanvandeneynde, thim: Added Group admin form -...