You are here

function _follow_block_config_links in Follow 5

Same name and namespace in other branches
  1. 6 follow.module \_follow_block_config_links()

Outputs a list of configuration links for users with appropriate permissions

Parameters

$uid: The uid of the user account. Defaults to the site form, $uid = 0.

Return value

A string containing the links, output with theme_links().

1 call to _follow_block_config_links()
_follow_block_content in ./follow.module
Helper function to build the block content display.

File

./follow.module, line 300
Allows users to add links to their social network profiles.

Code

function _follow_block_config_links($uid) {
  $links = array();
  if ($uid == 0 && user_access('edit site follow links')) {
    $links['follow_edit'] = array(
      'title' => t('Edit'),
      'href' => 'admin/settings/follow',
      'query' => drupal_get_destination(),
    );
  }
  elseif (follow_links_user_access($uid)) {
    $links['follow_edit'] = array(
      'title' => t('Edit'),
      'href' => 'user/' . $uid . '/follow',
      'query' => drupal_get_destination(),
    );
  }
  if (user_access('administer blocks')) {
    $links['follow_configure'] = array(
      'title' => t('Configure'),
      'href' => $uid ? 'admin/build/block/configure/follow/user' : 'admin/build/block/configure/follow/site',
      'query' => drupal_get_destination(),
    );
  }
  return theme('links', $links, array(
    'class' => 'links inline',
  ));
}