Projet

Général

Profil

Révision 2c8c2b87

Ajouté par Assos Assos il y a presque 9 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/addthis/addthis_displays/addthis_displays.addthis.inc
32 32
  );
33 33
  $element['#attributes'] += $addthis->getAddThisAttributesMarkup($options);
34 34

  
35
  // Add the widget script.
36
  $script_manager = AddThisScriptManager::getInstance();
37
  $script_manager->attachJsToElement($element);
38

  
35 39
  $services = trim($options['#display']['settings']['share_services']);
36 40
  $services = str_replace(' ', '', $services);
37 41
  $services = explode(',', $services);
......
52 56
      '#addthis_service' => $service,
53 57
    );
54 58

  
59
    // Add individual counters.
60
    if (strpos($service, 'counter_') === 0) {
61
      $items[$service]['#attributes']['class'] = array("addthis_$service");
62
    }
63

  
55 64
    // Basic implementations of bubble counter orientation.
56 65
    // @todo Figure all the bubbles out and add them.
57
    //   Still missing: tweetme, hyves and stubleupon.
66
    //   Still missing: tweetme, hyves and stubleupon, google_plusone_badge.
58 67
    //
59
    // @todo Fix a way to use addthis_bubble_style.
60
    //   There is a conflict now with using the class addthis_button_[service].
61
    //   You can't add this bubble style now.
62 68
    $orientation = ($options['#display']['settings']['counter_orientation'] == 'horizontal' ? TRUE : FALSE);
63 69
    switch ($service) {
70
      case 'linkedin_counter':
71
          $items[$service]['#attributes'] += array(
72
            'li:counter' => ($orientation ? '' : 'top'),
73
          );
74
        break;
64 75
      case 'facebook_like':
65 76
        $items[$service]['#attributes'] += array(
66 77
          'fb:like:layout' => ($orientation ? 'button_count' : 'box_count')
67 78
        );
68 79
        break;
80
      case 'facebook_share':
81
        $items[$service]['#attributes'] += array(
82
          'fb:share:layout' => ($orientation ? 'button_count' : 'box_count')
83
        );
84
        break;
69 85
      case 'google_plusone':
70 86
        $items[$service]['#attributes'] += array(
71 87
          'g:plusone:size' => ($orientation ? 'standard' : 'tall')
......
77 93
          'tw:via' => AddThis::getInstance()->getTwitterVia(),
78 94
        );
79 95
        break;
96
      case 'bubble_style':
97
        $items[$service]['#attributes']['class'] = array(
98
          'addthis_counter', 'addthis_bubble_style'
99
        );
100
        break;
101
      case 'pill_style':
102
        $items[$service]['#attributes']['class'] = array(
103
          'addthis_counter', 'addthis_pill_style'
104
        );
105
        break;
80 106
    }
81 107
  }
82 108
  $element += $items;
......
111 137
  );
112 138
  $element['#attributes'] += $addthis->getAddThisAttributesMarkup($options);
113 139

  
140
  // Add the widget script.
141
  $script_manager = AddThisScriptManager::getInstance();
142
  $script_manager->attachJsToElement($element);
143

  
114 144
  // Create img button.
115 145
  $image = array(
116 146
    '#theme' => 'addthis_element',

Formats disponibles : Unified diff