You are here

function homebox_user_settings_page in Homebox 7.2

Same name and namespace in other branches
  1. 6.3 homebox.admin.inc \homebox_user_settings_page()
  2. 6.2 homebox.admin.inc \homebox_user_settings_page()
  3. 7.3 homebox.admin.inc \homebox_user_settings_page()

Provide form for user profile settings

This allows an admin to specify a Homebox to reside as a profile tab

1 string reference to 'homebox_user_settings_page'
homebox_menu in ./homebox.module
Implements hook_menu().

File

./homebox.admin.inc, line 972
Homebox admin file, takes care admin interface for homebox

Code

function homebox_user_settings_page($form, &$form_state) {
  $form = array();

  // Gather all available pages
  $pages = homebox_pages();

  // Build form options
  $options = array();
  if ($pages) {
    foreach ($pages as $page) {
      $options[$page->name] = $page->settings['title'] . ' (' . $page->name . ')';
    }
  }
  $form['help'] = array(
    '#type' => 'item',
    '#value' => t('
      The permissions set in the chosen Homeboxes will be still be checked.
      Make sure that users who can view their own profiles can also view the selected Homebox.
      The tab will only be presented if the current user is viewing their own profile.'),
  );
  $form['homebox_user_tab'] = array(
    '#type' => 'select',
    '#title' => t('Add a profile tab'),
    '#default_value' => variable_get('homebox_user_tab', 0),
    '#options' => array(
      0 => '- None -',
    ) + $options,
    '#description' => t('Optionally add a Homebox as a tab to a user profile.'),
  );
  $form['#submit'][] = 'menu_rebuild';
  return system_settings_form($form);
}