1 user.module _user_login_links()

Helper function to transform user local tasks (tabs) to a list of links.

Used on the pages related to the login process.

Return value

array: A renderable array of items themed as an unordered list.

See also

user_login_page_wrapper()

File

core/modules/user/user.module, line 2030
Enables the user registration and login system.

Code

function _user_login_links() {
  $local_tasks = menu_local_tasks();
  $items = array();
  foreach ($local_tasks['tabs']['output'] as $local_tab_data) {
    // Do not include the active tab.
    if (!empty($local_tab_data['#active'])) {
      continue;
    }
    if (empty($local_tab_data['#link']['localized_options']['html'])) {
      $local_tab_data['#link']['title'] = check_plain($local_tab_data['#link']['title']);
    }
    $local_tab_data['#link']['localized_options']['html'] = TRUE;
    $items[] = l($local_tab_data['#link']['title'], $local_tab_data['#link']['href'], $local_tab_data['#link']['localized_options']);
  }
  $links = array(
    '#theme' => 'item_list',
    '#items' => $items,
    '#attributes' => array(
      'class' => array('login-links'),
    )
  );
  return $links;
}