You are here

function _user_relationships_message_settings_form in User Relationships 5

Same name and namespace in other branches
  1. 5.2 user_relationships.module \_user_relationships_message_settings_form()
  2. 7 user_relationships.admin.inc \_user_relationships_message_settings_form()

Helper function to build the settings form for the notification messages

1 call to _user_relationships_message_settings_form()
user_relationships_settings in ./user_relationships_forms.inc
Main settings

File

./user_relationships.module, line 245

Code

function _user_relationships_message_settings_form(&$form, $defaults = array()) {
  foreach ($defaults as $key => $value) {
    if (is_array($value)) {
      $form[$key] = array(
        '#type' => 'fieldset',
        '#title' => ucfirst(str_replace('_', ' ', $key)),
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
      );
      _user_relationships_message_settings_form($form[$key], $value);
    }
    else {
      $form["user_relationships_msg_{$key}"] = array(
        '#type' => 'textfield',
        '#title' => ucfirst(str_replace('_', ' ', $key)),
        '#default_value' => variable_get("user_relationships_msg_{$key}", $value),
      );
    }
  }
}