You are here

function homebox_user_settings_page in Homebox 6.3

Same name and namespace in other branches
  1. 6.2 homebox.admin.inc \homebox_user_settings_page()
  2. 7.3 homebox.admin.inc \homebox_user_settings_page()
  3. 7.2 homebox.admin.inc \homebox_user_settings_page()
1 string reference to 'homebox_user_settings_page'
homebox_menu in ./homebox.module
Implementation of hook_menu().

File

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

Code

function homebox_user_settings_page() {
  $form = array();

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

  // Build form options
  $options = array();
  if ($pages) {
    foreach ($pages as $page) {
      $options[$page->name] = check_plain($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);
}