function user_relationships_settings in User Relationships 5
Same name and namespace in other branches
- 5.2 user_relationships_forms.inc \user_relationships_settings()
Main settings
2 string references to 'user_relationships_settings'
- user_relationships_menu in ./
user_relationships_hooks.inc - Menu
- user_relationship_mailer_form_alter in plugins/
user_relationship_mailer/ user_relationship_mailer.module - hook_form_alter()
File
- ./
user_relationships_forms.inc, line 11
Code
function user_relationships_settings() {
$form['general'] = array(
'#type' => 'fieldset',
'#title' => t('General'),
'#weight' => -10,
);
$form['general']['user_relationships_allow_multiple'] = array(
'#type' => 'checkbox',
'#title' => t('Allow Multiple Relationships'),
'#description' => t('Give users the option to create more than one relationship to each other.'),
'#default_value' => variable_get('user_relationships_allow_multiple', 1),
);
$form['general']['user_relationships_allow_auto_approve'] = array(
'#type' => 'checkbox',
'#title' => t("Allow users to auto approve"),
'#description' => t('This will provide an the options for users to set an "auto-approve" option to automatically approve to all requested relationships.'),
'#default_value' => variable_get('user_relationships_allow_auto_approve', 0),
);
$form['general']['user_relationships_relationships_per_page'] = array(
'#type' => 'textfield',
'#title' => t("Relationships per page"),
'#size' => 4,
'#description' => t('Number of relationships to show per page. If set to 0 all will be shown.'),
'#default_value' => variable_get('user_relationships_relationships_per_page', 16),
'#validate' => array(
'user_relationships_setting_validation' => array(
array(
'is_numeric' => array(
'msg' => t('The relationships per page setting is not an integer'),
),
),
),
),
);
$replaceables = array(
'!requester',
'!requestee',
'%relationship_name',
'%relationship_plural_name',
);
$form['messages'] = array(
'#type' => 'fieldset',
'#title' => t('Messages'),
'#weight' => 0,
'#description' => t('Notifications to users. Replaceable tokens are: @replaceables', array(
'@replaceables' => implode($replaceables, ', '),
)),
);
$default_messages = user_relationships_default_messages();
_user_relationships_message_settings_form($form['messages'], $default_messages);
$replaceables = array(
'!requester',
'!requestee',
'%relationship_name',
'%relationship_plural_name',
);
$form['messages'] = array(
'#type' => 'fieldset',
'#title' => t('Messages'),
'#weight' => 0,
'#description' => t('Notifications to users. Replaceable tokens are: @replaceables', array(
'@replaceables' => implode($replaceables, ', '),
)),
);
$default_messages = user_relationships_default_messages();
_user_relationships_message_settings_form($form['messages'], $default_messages);
return system_settings_form($form);
}