You are here

function social_media_links_widget_render in Social Media Links Block and Field 7

1 string reference to 'social_media_links_widget_render'
social_media_link_widget.inc in plugins/content_types/social_media_link_widget.inc

File

plugins/content_types/social_media_link_widget.inc, line 72

Code

function social_media_links_widget_render($subtype, $conf, $panel_args) {
  $block = new stdClass();
  $platforms = _social_media_links_cleanup_platforms($conf['platforms']);
  $content = array(
    '#theme' => 'social_media_links_platforms',
    '#platform_values' => $platforms,
    '#icon_style' => $conf['icon_style'],
    '#appearance' => $conf['appearance'],
    '#link_attributes' => $conf['link_attributes'],
    '#attributes' => array(
      'class' => array(
        'social-media-links',
        'platforms',
      ),
    ),
  );

  // Add css to the block.
  $content['#attached']['css'][] = drupal_get_path('module', 'social_media_links') . '/social_media_links.css';
  $block->title = $conf['override_title'] ? $conf['override_title_text'] : t('Follow Us');
  $block->content = $content;
  return $block;
}