You are here

function fb_social_get_presets in Facebook social plugins integration 6.2

Same name and namespace in other branches
  1. 7.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:

7 calls to fb_social_get_presets()
fb_social_block in ./fb_social.module
Implementation of hook_block
fb_social_content_extra_fields in ./fb_social.module
Implementation of 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().
fb_social_handler_field::render in plugins/views/fb_social_handler_field.inc
Implements views_handler_field#render().

... See full list

File

./fb_social.module, line 397

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;
}