Social\Plugin\AddThisWidget::customToolbox PHP Method

customToolbox() protected method

Buil custom toolbox
protected customToolbox ( array $options, string $addthisIdentifier ) : string
$options array Array containing all options
$addthisIdentifier string Add this identifier
return string
    protected function customToolbox($options, $addthisIdentifier)
    {
        $button = '';
        if (isset($options['type']) and $options['type'] != 'custom_string') {
            $outerClasses = 'addthis_toolbox addthis_default_style';
            if (isset($options['size']) and $options['size'] == '32') {
                $outerClasses .= ' addthis_32x32_style';
            }
            $button = '<div class="' . $outerClasses . '" ' . $addthisIdentifier . ' >';
            if (isset($options['services'])) {
                $services = explode(',', $options['services']);
                foreach ($services as $service) {
                    $service = trim($service);
                    if ($service == 'more' || $service == 'compact') {
                        if (isset($options['type']) and $options['type'] != 'fb_tw_p1_sc') {
                            $button .= '<a class="addthis_button_compact"></a>';
                        }
                    } elseif ($service == 'counter') {
                        if (isset($options['type']) and $options['type'] == 'fb_tw_p1_sc') {
                            $button .= '<a class="addthis_counter addthis_pill_style"></a>';
                        } else {
                            $button .= '<a class="addthis_counter addthis_bubble_style"></a>';
                        }
                    } elseif ($service == 'google_plusone') {
                        $button .= '<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>';
                    } else {
                        $button .= '<a class="addthis_button_' . strtolower($service) . '"></a>';
                    }
                }
            }
            $button .= '</div>';
        }
        return $button;
    }