* @license GNU General Public License, version 2 * @link http://addthis.com AddThis website */ class AddThisGlobalOptionsTool extends AddThisTool { protected $featureClassName = 'AddThisGlobalOptionsFeature'; public $prettyName = '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()) { if (is_feed()) { return ''; } $configs = $this->getFeatureConfigs(); $addthisWidgetUrl = $this->featureObject->getAddThisWidgetJavaScriptUrl(); if (!empty($configs['addthis_asynchronous_loading'])) { $async = ' async="async"'; } else { $async = ''; } $script = ' '; return $script; } /** * This must be public as it's used in a callback for add_shortcode * * Returns HTML to use to replace a short tag for this tool. Includes * tags to identify its from a short code. * * @return string this should be valid html */ public function getInlineCodeForShortCode() { $html = ''; $html .= ''; $html .= $this->getInlineCode(); $html .= ''; return $html; } } }