You are here

function fblikebutton_conf in Facebook Like Button 8

Same name and namespace in other branches
  1. 7.2 fblikebutton.module \fblikebutton_conf()

Helper function to generate the configuration array used to generate the like button.

1 call to fblikebutton_conf()
fblikebutton_theme in ./fblikebutton.module
Implements hook_theme().

File

./fblikebutton.module, line 82

Code

function fblikebutton_conf() {

  // Get current URL.
  // This will be used in the blocks for content types.
  $url_generator = \Drupal::urlGenerator();
  $webpage_to_like = $url_generator
    ->generateFromRoute('<current>', array(), array(
    'absolute' => TRUE,
  ));
  $config = \Drupal::config('fblikebutton.settings');
  $conf = array(
    'layout' => $config
      ->get('layout'),
    'action' => $config
      ->get('action'),
    'color_scheme' => $config
      ->get('color_scheme'),
    'show_faces' => $config
      ->get('show_faces'),
    'font' => $config
      ->get('font'),
    'language' => $config
      ->get('language'),
    'url' => $webpage_to_like,
  );
  return $conf;
}