Closed (fixed)
Project:
Group
Version:
7.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Sep 2013 at 23:26 UTC
Updated:
22 Apr 2014 at 13:48 UTC
Jump to comment: Most recent
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
Comment #1
kristiaanvandeneyndeThanks! Made some small improvements and committed in dbfce7c.