function follow_networks_load in Follow 7.2
Same name and namespace in other branches
- 5 follow.module \follow_networks_load()
- 6 follow.module \follow_networks_load()
- 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 - Implements hook_preprocess_page().
- follow_url_validate in ./
follow.inc - 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.inc, line 308 - Follow module API and helper functions.
Code
function follow_networks_load($uid = 0, $reset = FALSE) {
$networks =& drupal_static(__FUNCTION__, 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];
}