Commit 33213cd1 authored by Dave Reid's avatar Dave Reid

#464980 by Dave Reid: Removed the search engine verification settings in favor...

#464980 by Dave Reid: Removed the search engine verification settings in favor of site_verify.module.
parent 269bf59b
......@@ -85,12 +85,6 @@ function xmlsitemap_engines_settings() {
'#value' => variable_get('xmlsitemap_engines_google_url', 'http://www.google.com/webmasters/tools/ping?sitemap=[sitemap]'),
'#disabled' => TRUE,
);
$form['google']['xmlsitemap_engines_google_verify'] = array(
'#type' => 'textfield',
'#title' => t('Verification link'),
'#description' => t('In order to show statistics, Google will ask you to verify that you control this site by creating a file with a certain name. Enter that name here and the XML sitemap module will create a path to that file name. This will only work if you have clean URLs enabled.'),
'#default_value' => variable_get('xmlsitemap_engines_google_verify', ''),
);
// Moreover.com fields.
$form['moreover'] = array(
'#type' => 'fieldset',
......@@ -129,18 +123,6 @@ function xmlsitemap_engines_settings() {
'#value' => variable_get('xmlsitemap_engines_bing_url', 'http://www.bing.com/webmaster/ping.aspx?siteMap=[sitemap]'),
'#disabled' => TRUE,
);
$form['bing']['xmlsitemap_engines_bing_verify'] = array(
'#type' => 'textfield',
'#title' => t('Authentication file'),
'#description' => t('Before allowing you to view additional information, Bing will ask you to verify that you control this site by creating a file with a certain name. Enter that name here, and XML sitemap will create a path to that file name. This will only work if you have clean URLs enabled.'),
'#default_value' => variable_get('xmlsitemap_engines_bing_verify', ''),
);
$form['bing']['xmlsitemap_engines_bing_verify_string'] = array(
'#type' => 'textfield',
'#title' => t('Bing authentication tag'),
'#description' => t('Bing will give you an authentication tag.'),
'#default_value' => variable_get('xmlsitemap_engines_bing_verify_string', ''),
);
// Yahoo! fields.
$form['yahoo'] = array(
'#type' => 'fieldset',
......@@ -160,31 +142,9 @@ function xmlsitemap_engines_settings() {
'#value' => variable_get('xmlsitemap_engines_yahoo_url', 'http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap=[sitemap]'),
'#disabled' => TRUE,
);
$form['yahoo']['xmlsitemap_engines_yahoo_verify'] = array(
'#type' => 'textfield',
'#title' => t('Verification link'),
'#description' => t('Before allowing you to view additional information, Yahoo! will ask you to verify that you control this site by creating a file with a certain name. Enter that name here, and XML sitemap will create a path to that file name. This will only work if you have clean URLs enabled.'),
'#default_value' => variable_get('xmlsitemap_engines_yahoo_verify', ''),
);
$form['yahoo']['xmlsitemap_engines_yahoo_verify_string'] = array(
'#type' => 'textfield',
'#title' => t('Authentication key'),
'#description' => t('Yahoo! will ask you to put an authentication key in the verification file.'),
'#default_value' => variable_get('xmlsitemap_engines_yahoo_verify_string', ''),
);
$form = system_settings_form($form);
$form['#submit'][] = 'xmlsitemap_engines_settings_submit';
return $form;
}
/**
* Submit the settings form.
*/
function xmlsitemap_engines_settings_submit($form, &$form_state) {
variable_set('menu_rebuild_needed', TRUE);
return system_settings_form($form);
}
/**
* @} End of "addtogroup xmlsitemap".
*/
......@@ -135,10 +135,29 @@ function xmlsitemap_engines_update_6110() {
return $ret;
}
/**
* Deprecate verification functionality in favor of the site_verify.module.
*/
function xmlsitemap_engines_update_6111() {
$ret = array();
if (function_exists('site_verify_import_xmlsitemap')) {
site_verify_import_xmlsitemap($ret);
if ($ret) {
// Only show the success message if there were any settings migrated.
drupal_set_message('XML sitemap search engine verification settings successfully migrated to the Site Verification module.');
}
}
else {
drupal_set_message('The search engine verification settings in XML sitemap have been deprecated in favor of the <a href="http://drupal.org/project/site_verify">Site verification module</a>. Your settings will be migrated when you install and enable the Site verification module.', 'warning');
}
// Set the menu rebuild flag to remove the XML sitemap engine paths.
variable_set('menu_rebuild_needed', TRUE);
return $ret;
}
/**
* Implementation of hook_uninstall().
*/
function xmlsitemap_engines_uninstall() {
db_query("DELETE FROM {variable} WHERE name LIKE 'xmlsitemap\_engines\_'");
}
......@@ -39,7 +39,6 @@ function xmlsitemap_engines_cron() {
* Implementation of hook_menu().
*/
function xmlsitemap_engines_menu() {
$items = array();
$items['admin/settings/xmlsitemap/engines'] = array(
'title' => 'Search engines',
'description' => 'Configure the submission settings of the XML sitemap to the search engines.',
......@@ -49,36 +48,6 @@ function xmlsitemap_engines_menu() {
'type' => MENU_LOCAL_TASK,
'file' => 'xmlsitemap_engines.admin.inc',
);
if ($verify = variable_get("xmlsitemap_engines_google_verify", '')) {
$items[$verify] = array(
'title' => 'Google verification page',
'page callback' => 'xmlsitemap_engines_verify',
'page arguments' => array('google'),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'xmlsitemap_engines.pages.inc',
);
}
if ($verify = variable_get("xmlsitemap_engines_yahoo_verify", '')) {
$items[$verify] = array(
'title' => 'Yahoo! verification page',
'page callback' => 'xmlsitemap_engines_verify',
'page arguments' => array('yahoo'),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'xmlsitemap_engines.pages.inc',
);
}
if ($verify = variable_get("xmlsitemap_engines_bing_verify", '')) {
$items[$verify] = array(
'title' => 'Bing verification page',
'page callback' => 'xmlsitemap_engines_verify',
'page arguments' => array('bing'),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'xmlsitemap_engines.pages.inc',
);
}
return $items;
}
......
<?php
// $Id$
/**
* @file
* XML sitemap engines page callbacks.
*/
/**
* @addtogroup xmlsitemap
* @{
*/
/*****************************************************************************
* Menu callbacks / form builders, submit/validate functions.
****************************************************************************/
/**
* Menu callback; display the verification page.
*/
function xmlsitemap_engines_verify($engine) {
switch ($engine) {
case 'google':
print '<html>'."\n";
print ' <head>'."\n";
print ' <title>Hello, Google!</title>'."\n";
print ' </head>'."\n";
print ' <body>'."\n";
print ' <p>Hello, Google!</p>'."\n";
print ' </body>'."\n";
print '</html>'."\n";
break;
case 'yahoo':
print variable_get('xmlsitemap_engines_yahoo_verify_string', '');
break;
case 'bing':
print '<?xml version="1.0"?>'."\n";
print "<users>\n";
print ' <user>'. variable_get('xmlsitemap_engines_bing_verify_string', '') ."</user>\n";
print "</users>\n";
break;
}
drupal_page_footer();
exit;
}
/**
* @} End of "addtogroup xmlsitemap".
*/
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