You are here

function heartbeat_form_user_profile_form_alter in Heartbeat 7

Implements hook_form_FORM_ID_alter().

File

./heartbeat.module, line 456
Module file for heartbeat activity. Basic hook implementations and helper functions will be found here.

Code

function heartbeat_form_user_profile_form_alter(&$form, &$form_state) {
  if ($form['#user_category'] == 'account') {
    $profile_templates = variable_get('heartbeat_profile_message_templates', array());
    if (count($profile_templates)) {
      $form_state['heartbeat_templates'] = array();
      foreach (heartbeat_templates_names() as $id => $description) {
        if (isset($profile_templates[$id])) {
          $form_state['heartbeat_templates'][$id] = $description;
        }
      }
      heartbeat_user_templates($form, $form_state);
    }
    return $form;
  }
}