You are here

function socialmedia_widgets_set_profile_default_elements in Social media 7

3 calls to socialmedia_widgets_set_profile_default_elements()
socialmedia_admin_profile_widgets_form in ./socialmedia.admin.inc
socialmedia_admin_profile_widgets_form_submit in ./socialmedia.admin.inc
socialmedia_widgets_set_profile_default in ./socialmedia.widgets.inc

File

./socialmedia.widgets.inc, line 1052
Functions needed to execute image elements provided by Image module.

Code

function socialmedia_widgets_set_profile_default_elements() {
  $elements = array();
  $elements['basic'] = array(
    'name' => t('Basic'),
    'elements' => array(),
  );
  $profiles = variable_get('socialmedia_platforms_site', array());
  $platforms = socialmedia_socialmedia_platform_info();

  //dsm($profiles);

  //dsm($platforms);
  $weight = 1;
  foreach ($profiles as $key => $profile) {
    if ($profile && (!isset($platforms[$key]['group']) || $platforms[$key]['group'] == 'Syndication')) {
      if (isset($platforms[$key]['group']) && $platforms[$key]['group'] == 'Syndication') {
        $name = 'socialmedia_socialmedia-' . $key . '-feed-button';
      }
      else {
        $name = 'socialmedia_socialmedia-' . $key . '-profile-button';
      }
      $elements['basic']['elements'][$name] = array(
        'name' => $name,
        'weight' => $name == 'socialmedia_socialmedia-rss-feed-button' ? $weight + 20 : $weight,
      );
      $weight++;
    }
  }

  //dsm($elements);
  return $elements;
}