* @license GNU General Public License, version 2 * @link http://addthis.com AddThis website */ class AddThisGlobalOptionsWidget extends AddThisWidget { /** * Bootstraps the widget for WordPress. It determines its tool settings * class name, and passes that string to its parent constructor. * * @return null */ public function __construct() { $toolClassName = self::getToolClass(__CLASS__); parent::__construct($toolClassName); } /** * Prints out HTML for the options form in the WordPress admin Dashboard * * @param array $instance The widget options * * @return null */ public function form($instance) { $featureObject = $this->toolClass->getFeatureObject(); $url = $featureObject->getSettingsPageUrl(); $settingsText = esc_html__('the plugin\'s settings', AddThisFeature::$l10n_domain); $settingsLink = ''.$settingsText.''; $links = array(); $links[] = $settingsLink; if ($this->toolClass->inRegisteredMode()) { $profileId = $featureObject->globalOptionsObject->getProfileId(); $dashboardUrl = 'https://www.addthis.com/dashboard#gallery/pub/'.$profileId; $links[] = 'addthis.com'; } $editLink = ''; if (count($links) == 1) { $editLinkTemplate = 'To edit the options for your AddThis tools, please go to %1$s'; $editLinkTemplate = esc_html__($editLinkTemplate, AddThisFeature::$l10n_domain); $editLink = sprintf($editLinkTemplate, $links[0]); } elseif (count($links) > 1) { $editLinkTemplate = 'To edit the options for your AddThis tools, please go to %1$s or %2$s'; $editLinkTemplate = esc_html__($editLinkTemplate, AddThisFeature::$l10n_domain); $editLink = sprintf($editLinkTemplate, $links[0], $links[1]); } $html = '

'.$this->toolClass->widgetDescription.'

'; $html .= '

'.$editLink.'

'; $html .= '

'.$this->toolClass->eulaText('Save').'

'; echo $html; } } }