You are here

function fb_social_get_presets in Facebook social plugins integration 7.2

Same name and namespace in other branches
  1. 6.2 fb_social.module \fb_social_get_presets()

Get all presets or a preset by name. By default it returns only enabled presets.

Parameters

$name: the preset name

$enabled:

$reset:

8 calls to fb_social_get_presets()
fb_social_block_info in ./fb_social.module
Implements hook_block_info().
fb_social_block_view in ./fb_social.module
Implements hook_block_view().
fb_social_field_extra_fields in ./fb_social.module
Implements hook_content_extra_fields.
fb_social_get_presets_by_type in ./fb_social.module
fb_social_handler_field::options_form in plugins/views/fb_social_handler_field.inc
Implements views_handler#options_form().

... See full list

File

./fb_social.module, line 385

Code

function fb_social_get_presets($name = NULL, $enabled = TRUE, $reset = FALSE) {
  $presets = fb_social_preset_load($name, $reset);
  if (empty($presets)) {
    return FALSE;
  }
  if (is_object($presets)) {
    $presets = array(
      $presets->name => $presets,
    );
  }
  if ($enabled) {
    $presets = array_filter($presets, '_fb_social_enabled_presets_filter');
  }
  if (isset($name)) {
    return isset($presets[$name]) ? $presets[$name] : FALSE;
  }
  return $presets;
}