* @license GNU General Public License, version 2
* @link http://addthis.com AddThis website
*/
class AddThisGlobalOptionsTool extends AddThisTool
{
protected $featureClassName = 'AddThisGlobalOptionsFeature';
public $prettyName = 'AddThis Script';
public $edition = 'basic';
public $anonymousSupport = true;
public $inline = true;
public $widgetClassName = 'AddThisGlobalOptionsWidget';
public $widgetBaseId = 'addthis_global_options_widget';
public $widgetName = 'AddThis Script';
public $widgetDescription = 'If your theme is not adding the AddThis script (addthis_widget.js) onto your pages, try adding this widget.';
public $shortCode = 'addthis_script';
/**
* This must be public as it's used in the tool's widget
*
* Returns HTML for adding the script onto a page
*
* @param array $args settings for this widget (we only use
* widget_id)
* @param array $instance settings for this particular tool, if not
* being used from the tool settings (a widget instance)
*
* @return string this should be valid html
*/
public function getInlineCode($args = array(), $instance = array())
{
global $post;
if ($post->ID && is_feed()) {
return '';
}
$configs = $this->getFeatureConfigs();
$addthisWidgetUrl = $this->featureObject->getAddThisWidgetJavaScriptUrl();
if (!empty($configs['addthis_asynchronous_loading'])) {
$async = ' async="async"';
} else {
$async = '';
}
$script = '
';
return $script;
}
}
}