You are here

function follow_networks_load in Follow 6

Same name and namespace in other branches
  1. 5 follow.module \follow_networks_load()
  2. 7.2 follow.inc \follow_networks_load()
  3. 7 follow.module \follow_networks_load()

Loads all follow networks

Parameters

$uid: The uid of the user. uid 0 pulls the site follow links.

$reset: Boolean. If TRUE, flushes the follow networks cache.

Return value

An array of network names, keys are machine names, values are visible titles.

4 calls to follow_networks_load()
follow_links_form in ./follow.module
The form for editing follow links.
follow_preprocess_page in ./follow.module
Implementation of hook_preprocess_page().
follow_url_validate in ./follow.module
Validates the url field to verify it's actually a url.
_follow_block_content in ./follow.module
Helper function to build the block content display.

File

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

Code

function follow_networks_load($uid = 0, $reset = FALSE) {
  static $networks = array();

  // Clear cache if $reset is TRUE;
  if ($reset) {
    $networks = array();
  }

  // Return presets if the array is populated.
  if (empty($networks[$uid])) {

    // We call hook_follow_networks_alter() to allow other modules to create
    // or alter networks.
    $networks[$uid] = follow_default_networks($uid);
    drupal_alter('follow_networks', $networks, $uid);
  }
  return $networks[$uid];
}