/**
  * Create a test textarea field
  *
  * @covers Yoast_GA_Admin_Form:select()
  */
 public function test_textarea()
 {
     Yoast_GA_Admin_Form::create_form('phpunit');
     $title = 'Test textarea';
     $name = 'test_textarea';
     $output = null;
     $output .= '<div class="ga-form ga-form-input"><label class="ga-form ga-form-select-label ga-form-label-left" id="yoast-ga-form-label-select-phpunit-ga_general_' . $name . '">';
     $output .= $title . ':</label><textarea rows="5" cols="60" name="' . $name . '" id="yoast-ga-form-textarea-phpunit-ga_general_' . $name . '"></textarea></div>';
     $this->assertEquals(Yoast_GA_Admin_Form::textarea($title, $name), $output);
 }
コード例 #2
0
ファイル: settings.php プロジェクト: StefanBonilla/CoupSoup
?>
	</div>
	<div id="advanced" class="gatab">
		<?php 
echo '<h2>' . __('Advanced settings', 'google-analytics-for-wordpress') . '</h2>';
echo Yoast_GA_Admin_Form::select(__('Track downloads as', 'google-analytics-for-wordpress'), 'track_download_as', $yoast_ga_admin->track_download_types(), __('Not recommended, as this would skew your statistics, but it does make it possible to track downloads as goals.', 'google-analytics-for-wordpress'));
echo Yoast_GA_Admin_Form::input('text', __('Extensions of files to track as downloads', 'google-analytics-for-wordpress'), 'extensions_of_files', null, 'Please separate extensions using commas');
echo Yoast_GA_Admin_Form::select(__('Track full URL of outbound clicks or just the domain', 'google-analytics-for-wordpress'), 'track_full_url', $yoast_ga_admin->get_track_full_url());
echo Yoast_GA_Admin_Form::input('text', __('Subdomain tracking', 'google-analytics-for-wordpress'), 'subdomain_tracking', null, sprintf(__('This allows you to set the domain that\'s set by %1$s for tracking subdomains.<br/>If empty, this will not be set.', 'google-analytics-for-wordpress'), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory#_gat.GA_Tracker_._setDomainName" target="_blank"><code>_setDomainName</code></a>'));
echo Yoast_GA_Admin_Form::input('text', __('Set path for internal links to track as outbound links', 'google-analytics-for-wordpress'), 'track_internal_as_outbound', null, sprintf(__('If you want to track all internal links that begin with %1$s, enter %1$s in the box above. If you have multiple prefixes you can separate them with comma\'s: %2$s', 'google-analytics-for-wordpress'), '<code>/out/</code>', '<code>/out/,/recommends/</code>'));
echo Yoast_GA_Admin_Form::input('text', __('Label for those links', 'google-analytics-for-wordpress'), 'track_internal_as_label', null, 'The label to use for these links, this will be added to where the click came from, so if the label is "aff", the label for a click from the content of an article becomes "outbound-article-aff".');
echo Yoast_GA_Admin_Form::input('checkbox', __('Tag links in RSS feed with campaign variables', 'google-analytics-for-wordpress'), 'tag_links_in_rss', null, __('Do not use this feature if you use FeedBurner, as FeedBurner can do this automatically and better than this plugin can. Check <a href="https://support.google.com/feedburner/answer/165769?hl=en&amp;ref_topic=13075" target="_blank">this help page</a> for info on how to enable this feature in FeedBurner.', 'google-analytics-for-wordpress'));
echo Yoast_GA_Admin_Form::input('checkbox', __('Allow anchor', 'google-analytics-for-wordpress'), 'allow_anchor', null, sprintf(__('This adds a %1$s call to your tracking code, and makes RSS link tagging use a %2$s as well.', 'google-analytics-for-wordpress'), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiCampaignTracking?csw=1#_gat.GA_Tracker_._setAllowAnchor" target="_blank"><code>_setAllowAnchor</code></a>', '<code>#</code>'));
echo Yoast_GA_Admin_Form::input('checkbox', __('Add <code>_setAllowLinker</code>', 'google-analytics-for-wordpress'), 'add_allow_linker', null, sprintf(__('This adds a %1$s call to your tracking code, allowing you to use %2$s and related functions.', 'google-analytics-for-wordpress'), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory?csw=1#_gat.GA_Tracker_._setAllowLinker" target="_blank"><code>_setAllowLinker</code></a>', ' <code>_link</code>'));
if (current_user_can('unfiltered_html')) {
    echo Yoast_GA_Admin_Form::textarea(__('Custom code', 'google-analytics-for-wordpress'), 'custom_code', sprintf(__('Not for the average user: this allows you to add a line of code, to be added before the %1$s call.', 'google-analytics-for-wordpress'), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration#_gat.GA_Tracker_._trackPageview" target="_blank"><code>_trackPageview</code></a>'));
}
/**
 * Action: 'yst_ga_advanced-tab' - Allow adding to the advanced tab of the settings
 */
do_action('yst_ga_advanced-tab');
?>
	</div>
	<div id="customdimensions" class="gatab">
		<?php 
echo '<h2>' . __('Custom dimensions', 'google-analytics-for-wordpress') . '</h2>';
do_action('yst_ga_custom_dimensions_tab-content');
?>
	</div>
	<?php 
do_action('yst_ga_custom_tabs-content');
コード例 #3
0
echo Yoast_GA_Admin_Form::input('checkbox', __('Enable Demographics and Interest Reports', 'google-analytics-for-wordpress'), 'demographics', null, sprintf(__('You have to enable the Demographics in Google Analytics before you can see the tracking data. We have a doc in our %1$sknowlegde base%2$s about this feature.', 'google-analytics-for-wordpress'), '<a href="http://kb.yoast.com/article/154-enable-demographics-and-interests-report-in-google-analytics/#utm_medium=kb-link&utm_source=gawp-config&utm_campaign=wpgaplugin" target="_blank">', '</a>'));
?>
	</div>
	<div id="advanced" class="gatab">
		<?php 
echo '<h2>' . __('Advanced settings', 'google-analytics-for-wordpress') . '</h2>';
echo Yoast_GA_Admin_Form::select(__('Track downloads as', 'google-analytics-for-wordpress'), 'track_download_as', $yoast_ga_admin->track_download_types(), __('Not recommended, as this would skew your statistics, but it does make it possible to track downloads as goals.', 'google-analytics-for-wordpress'));
echo Yoast_GA_Admin_Form::input('text', __('Extensions of files to track as downloads', 'google-analytics-for-wordpress'), 'extensions_of_files', null, 'Please separate extensions using commas');
echo Yoast_GA_Admin_Form::select(__('Track full URL of outbound clicks or just the domain', 'google-analytics-for-wordpress'), 'track_full_url', $yoast_ga_admin->get_track_full_url());
echo Yoast_GA_Admin_Form::input('text', __('Subdomain tracking', 'google-analytics-for-wordpress'), 'subdomain_tracking', null, __('This allows you to set the domain that\'s set by <code>setDomainName</code> for tracking subdomains, if empty this will not be set.', 'google-analytics-for-wordpress'));
echo Yoast_GA_Admin_Form::input('text', __('Set path for internal links to track as outbound links', 'google-analytics-for-wordpress'), 'track_internal_as_outbound', null, 'If you want to track all internal links that begin with <code>/out/</code>, enter <code>/out/</code> in the box above. If you have multiple prefixes you can separate them with comma\'s: <code>/out/,/recommends/</code>');
echo Yoast_GA_Admin_Form::input('text', __('Label for those links', 'google-analytics-for-wordpress'), 'track_internal_as_label', null, 'The label to use for these links, this will be added to where the click came from, so if the label is "aff", the label for a click from the content of an article becomes "outbound-article-aff".');
echo Yoast_GA_Admin_Form::input('checkbox', __('Tag links in RSS feed with campaign variables', 'google-analytics-for-wordpress'), 'tag_links_in_rss', null, __('Do not use this feature if you use FeedBurner, as FeedBurner can do this automatically, and better than this plugin can. Check <a href="https://support.google.com/feedburner/answer/165769?hl=en&amp;ref_topic=13075" target="_blank">this help page</a> for info on how to enable this feature in FeedBurner.', 'google-analytics-for-wordpress'));
echo Yoast_GA_Admin_Form::input('checkbox', __('Allow anchor', 'google-analytics-for-wordpress'), 'allow_anchor', null, sprintf(__('This adds a <code>%1$s_setAllowAnchor%2$s</code> call to your tracking code, and makes RSS link tagging use a # as well.', 'google-analytics-for-wordpress'), '<a href="http://code.google.com/apis/analytics/docs/gaJSApiCampaignTracking.html#_gat.GA_Tracker_._setAllowAnchor" target="_blank">', '</a>'));
echo Yoast_GA_Admin_Form::input('checkbox', __('Add <code>_setAllowLinker</code>', 'google-analytics-for-wordpress'), 'add_allow_linker', null, sprintf(__('This adds a <code>%1$s_setAllowLinker%2$s</code> call to your tracking code,  allowing you to use <code>_link</code> and related functions.', 'google-analytics-for-wordpress'), '<a href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApiDomainDirectory.html#_gat.GA_Tracker_._setAllowLinker" target="_blank">', '</a>'));
echo Yoast_GA_Admin_Form::textarea('Custom code', 'custom_code', __('Not for the average user: this allows you to add a line of code, to be added before the <code>trackPageview</code> call.', 'google-analytics-for-wordpress'));
do_action('yst_ga_advanced-tab');
?>
	</div>
	<div id="customdimensions" class="gatab">
		<?php 
echo '<h2>' . __('Custom dimensions', 'google-analytics-for-wordpress') . '</h2>';
do_action('yst_ga_custom_dimensions_tab-content');
?>
	</div>
	<?php 
do_action('yst_ga_custom_tabs-content');
?>
	<div id="debugmode" class="gatab">
		<?php 
echo '<h2>' . __('Debug settings', 'google-analytics-for-wordpress') . '</h2>';