From f4ac8bb6d6e2834fefda104ad85d939b16c5cd86 Mon Sep 17 00:00:00 2001 From: Andy Stiller Date: Thu, 15 Jan 2015 10:54:19 +0000 Subject: [PATCH] #52 Change to dispaly the users full name and added comments. --- sites/all/modules/custom/kendra_msg/kendra_msg.module | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sites/all/modules/custom/kendra_msg/kendra_msg.module b/sites/all/modules/custom/kendra_msg/kendra_msg.module index 5f3f151b..6348171f 100755 --- a/sites/all/modules/custom/kendra_msg/kendra_msg.module +++ b/sites/all/modules/custom/kendra_msg/kendra_msg.module @@ -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')); @@ -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') { @@ -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); }