function _addthis_profile_id_card($credential_validation_status = false) { global $addThisConfigs; $addthis_options = $addThisConfigs->getConfigs(); $fieldId = 'addthis_profile'; $noPubIdDescription = 'To begin tracking analytics on social shares from your site, use the button below to set up an AddThis account at addthis.com and create a profile for your site. This process will require an email address.'; $noPubIdButtonText = "AddThis profile setup"; $pubIdDescription = 'To see analytics on social shares from your site, use the button below. It will take you to Analytics on addthis.com.'; $pubIdButtonText = "Your analytics on addthis.com"; $fieldName = 'addthis_settings[addthis_profile]'; $securitySnippet = ''; if ($credential_validation_status == 1) { $securitySnippet = '<span class="success_text">✔ Valid AddThis Profile ID</span>'; } // because i can't figure out how to bring these two in line... :-( if ($addthis_options['addthis_plugin_controls'] != "AddThis") { $security = ''; } else { $security = wp_nonce_field('update_pubid', 'pubid_nonce'); } if ($addThisConfigs->getProfileId()) { $description = $pubIdDescription; $buttonUrl = _addthis_analytics_url(); $buttonText = $pubIdButtonText; $alternatePath = ''; $target = 'target="_blank"'; } else { $description = $noPubIdDescription; $buttonUrl = _addthis_profile_setup_url(); $buttonText = $noPubIdButtonText; $alternatePath = '<p>Alternately, you can input your profile id manually below.</p>'; $target = ''; } $html = ' <div class="Card"> <div class="Card-hd"> <h3 class="Card-hd-title">AddThis Analytics</h3> </div> <div class="Card-bd"> <div class="addthis_description"> ' . $description . ' </div> <div class="Btn-container-card"> <a class="Btn Btn-blue" ' . $target . ' href="' . $buttonUrl . '"> ' . $buttonText . ' → </a> </div> ' . $alternatePath . ' <label for="' . $fieldId . '"> <strong>AddThis Profile ID</strong> </label> <ul class="Profile-widget"> <li> <input id="' . $fieldId . '" type="text" name="' . $fieldName . '" value="' . $addThisConfigs->getProfileId() . '" autofill="off" autocomplete="off" /> ' . $security . ' </li> <li> ' . $securitySnippet . ' </li> </ul> </div> </div> '; return $html; }
/** * Get Link to addthis site * * @return string */ private function _getAddThisLinkButton() { $noPubIdDescription = 'To configure sharing tools for your site, use the button below to set up an AddThis account at addthis.com, create a profile for your site and begin adding sharing tools. This process will require an email address.'; $noPubIdButtonText = "AddThis profile setup"; $noPubIdCardTitle = 'You\'re almost done!'; $pubIdDescription = 'To configure sharing tools for your site, use the button below. It will take you to Tools on addthis.com'; $pubIdCardTitle = 'Setup AddThis Tools'; $pubIdButtonText = "Configure AddThis Tools"; if (!$this->addThisConfigs->getProfileId()) { // if they don't have a profile yet, default to setup $tabOrder = array( 'tabs-1' => 'Setup', 'tabs-2' => 'Advanced Options', ); $sharingToolsCardTitle = $noPubIdCardTitle; $sharingToolsDescription = $noPubIdDescription; $sharingToolsButtonUrl = _addthis_profile_setup_url(); $sharingToolsButtonText = $noPubIdButtonText; $target = ''; } else { // else default to profile $tabOrder = array( 'tabs-1' => 'Sharing Tools', 'tabs-2' => 'Advanced Options', ); $sharingToolsCardTitle = $pubIdCardTitle; $sharingToolsDescription = $pubIdDescription; $sharingToolsButtonUrl = _addthis_tools_url(); $sharingToolsButtonText = $pubIdButtonText; $target = 'target="_blank"'; } $tabsHtml = ''; foreach ($tabOrder as $href => $title) { $tabsHtml .= '<li class="Tabbed-nav-item"><a href="#' . $href . '">' . $title . '</a></li>'; } $html = ' <div class="Main-content" id="tabs"> <ul class="Tabbed-nav"> ' . $tabsHtml . ' </ul> <div id="tabs-1"> <div class="Card" id="Card-side-sharing"> <div> <h3 class="Card-hd-title"> ' . $sharingToolsCardTitle . ' </h3> </div> <div class="addthis_seperator"> </div> <div class="Card-bd"> <div class="addthis_description"> Beautiful simple website tools designed to help you get likes, get shares, get follows and get discovered. </div> <p>' . $sharingToolsDescription . '</p> <a class="Btn Btn-blue" ' . $target . ' href="' . $sharingToolsButtonUrl . '">' . $sharingToolsButtonText . ' → </a> <p class="addthis_support"> If you don\'t see your tools after configuring them in the dashboard, please contact <a href="http://support.addthis.com/">AddThis Support</a> </p> </div> </div> ' . _addthis_rate_us_card() . ' </div> <div id="tabs-2"> ' . _addthis_tracking_card() . ' ' . _addthis_display_options_card() . ' ' . _addthis_additional_options_card() . ' ' . _addthis_profile_id_card() . ' ' . _addthis_mode_card() . ' </div> </div>'; return $html; }