Commit 0cc3d63c authored by Dave Reid's avatar Dave Reid
Browse files

by Dave Reid: Removed "(formerly Live Search)" from Bing.

parent d06ee8c2
......@@ -63,8 +63,8 @@ class XMLSitemapEnginesFunctionalTest extends XMLSitemapTestHelper {
function testCustomURL() {
$edit = array('xmlsitemap_engines_custom_urls' => 'an-invalid-url');
$this->drupalPost('admin/config/search/xmlsitemap/engines', $edit, t('Save configuration'));
$this->assertText(t('Invalid custom URL an-invalid-url.'));
$this->assertNoText(t('The configuration options have been saved.'));
$this->assertText('Invalid URL an-invalid-url.');
$this->assertNoText('The configuration options have been saved.');
$url = url('ping', array('absolute' => TRUE));
$edit = array('xmlsitemap_engines_custom_urls' => $url);
......
......@@ -24,7 +24,6 @@ function xmlsitemap_engines_settings_form() {
'#default_value' => variable_get('xmlsitemap_engines_engines', array()),
'#options' => $engine_options,
);
$form['xmlsitemap_engines_minimum_lifetime'] = array(
'#type' => 'select',
'#title' => t('Do not submit more often than every'),
......@@ -36,18 +35,19 @@ function xmlsitemap_engines_settings_form() {
'#title' => t('Only submit if the sitemap has been updated since the last submission.'),
'#default_value' => variable_get('xmlsitemap_engines_submit_updated', TRUE),
);
$form['xmlsitemap_engines_custom_urls'] = array(
'#type' => 'textarea',
'#title' => t('Custom submission URLs'),
'#description' => t('Enter one custom submission URL per line. The token [sitemap] will be replaced with the URL to your sitemap. For example: %example-before would become %example-after.', array('%example-before' => 'http://example.com/ping?[sitemap]', '%example-after' => xmlsitemap_engines_prepare_url('http://example.com/ping?[sitemap]', url('sitemap.xml', array('absolute' => TRUE))))),
'#description' => t('Enter one URL per line. The token [sitemap] will be replaced with the URL to your sitemap. For example: %example-before would become %example-after.', array('%example-before' => 'http://example.com/ping?[sitemap]', '%example-after' => xmlsitemap_engines_prepare_url('http://example.com/ping?[sitemap]', url('sitemap.xml', array('absolute' => TRUE))))),
'#default_value' => variable_get('xmlsitemap_engines_custom_urls', ''),
'#rows' => 2,
'#wysiwyg' => FALSE,
'#element_validate' => array('xmlsitemap_engines_validate_custom_urls'),
);
// Ensure the xmlsitemap_engines variable gets filterd to a simple array.
$form['array_filter'] = array('#type' => 'value', '#value' => TRUE);
return system_settings_form($form);
}
......@@ -59,7 +59,7 @@ function xmlsitemap_engines_validate_custom_urls($element, &$form_state) {
foreach ($custom_urls as $custom_url) {
$url = xmlsitemap_engines_prepare_url($custom_url, '');
if (!valid_url($url, TRUE)) {
form_error($element, t('Invalid custom URL %url.', array('%url' => $custom_url)));
form_error($element, t('Invalid URL %url.', array('%url' => $custom_url)));
}
}
$form_state['values']['xmlsitemap_engines_custom_urls'] = implode("\n", $custom_urls);
......
......@@ -9,7 +9,7 @@ function xmlsitemap_engines_help($path, $arg) {
switch ($path) {
case 'admin/config/search/xmlsitemap/engines':
if (!module_exists('site_verify')) {
$output .= t('In order to verify site ownership with the search engines listed below, it is highly recommended to download and install the <a href="@site-verify">Site verification module</a>.', array('@site-verify' => 'http://drupal.org/project/site_verify'));
$output .= '<p>' . t('In order to verify site ownership with the search engines listed below, it is highly recommended to download and install the <a href="@site-verify">Site verification module</a>.', array('@site-verify' => 'http://drupal.org/project/site_verify')) . '</p>';
}
break;
}
......@@ -138,26 +138,20 @@ function xmlsitemap_engines_prepare_url($url, $sitemap) {
* @see hook_xmlsitemap_engines_info()
* @see hook_xmlsitemap_engines_info_alter()
*/
function xmlsitemap_engines_get_engine_info($engine = NULL, $reset = FALSE) {
function xmlsitemap_engines_get_engine_info($engine = NULL) {
global $language;
static $engines;
if ($reset) {
$engines = NULL;
}
$engines = &drupal_static(__FUNCTION__);
if (!isset($engines)) {
if ($cached = cache_get('xmlsitemap:engines:' . $language->language)) {
$engines = $cached->data;
}
else {
// Fetch the results of all hook_xmlsitemap_engine_info() implementations.
$engines = module_invoke_all('xmlsitemap_engine_info');
// Allow other modulse to alter the engine info.
drupal_alter('xmlsitemap_engine_info', $engines);
// Cache by language since engine names are translated.
cache_set('xmlsitemap:engines:' . $language->language, $engines);
}
// Fetch the results of all hook_xmlsitemap_engine_info() implementations.
$engines = module_invoke_all('xmlsitemap_engine_info');
// Allow other modulse to alter the engine info.
drupal_alter('xmlsitemap_engine_info', $engines);
// Cache by language since engine names are translated.
cache_set('xmlsitemap:engines:' . $language->language, $engines);
}
if (isset($engine)) {
......@@ -175,18 +169,22 @@ function xmlsitemap_engines_xmlsitemap_engine_info() {
$engines['google'] = array(
'name' => t('Google'),
'url' => 'http://www.google.com/webmasters/tools/ping?sitemap=[sitemap]',
'help path' => 'http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156184',
);
$engines['yahoo'] = array(
'name' => t('Yahoo!'),
'url' => 'http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap=[sitemap]',
'help path' => 'http://help.yahoo.com/l/us/yahoo/search/siteexplorer/manage/siteexplorer-45.html',
);
$engines['ask'] = array(
'name' => t('Ask.com'),
'url' => 'http://submissions.ask.com/ping?sitemap=[sitemap]',
'help path' => 'http://about.ask.com/en/docs/about/webmasters.shtml#22',
);
$engines['bing'] = array(
'name' => t('Bing (formerly Live Search)'),
'name' => t('Bing'),
'url' => 'http://www.bing.com/webmaster/ping.aspx?siteMap=[sitemap]',
'help path' => 'http://www.bing.com/webmaster',
);
$engines['moreover'] = array(
'name' => t('Moreover'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment