Skip to content

Commit

Permalink
#52 Change to dispaly the users full name and added comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
andystiller committed Jan 15, 2015
1 parent 486246a commit f4ac8bb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sites/all/modules/custom/kendra_msg/kendra_msg.module
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ function kendra_msg_block_view($delta = '') {
return $block;
}

/*
* function to add the message form to the user page.
*/
function kendra_msg_user_createmessage($form, &$form_state) {
$form['title'] = array('#type' => 'textfield', '#title' => t('Title'));
$form['body'] = array('#type' => 'textarea', '#title' => t('Body'));
Expand All @@ -53,6 +56,9 @@ function kendra_msg_user_createmessage($form, &$form_state) {
return $form;
}

/*
* Function to send the message when the user click submit
*/
function kendra_msg_user_createmessage_submit($form, &$form_state) {
// Make sure called from the user page.
if (arg(0) != 'user') {
Expand All @@ -76,7 +82,7 @@ function kendra_msg_user_createmessage_submit($form, &$form_state) {
$options = array('mail' => $destination_email);
message_notify_send_message($message, $options);

drupal_set_message('New message to ' . $recipient_user->name);
drupal_set_message('New message to ' . $recipient_user->realname);

}

0 comments on commit f4ac8bb

Please sign in to comment.