2
// $Id: xmlsitemap_engines.admin.inc,v 1.1.2.9 2009/05/23 14:08:18 kiam Exp $
6
* XML sitemap engines settings UI.
10
* @addtogroup xmlsitemap
14
/*****************************************************************************
15
* Menu callbacks / form builders, submit/validate functions.
16
****************************************************************************/
19
* Form builder; return the search engine settings form.
21
function xmlsitemap_engines_settings() {
22
$form['submission'] = array(
23
'#type' => 'fieldset',
24
'#title' => t('Submission settings'),
25
'#collapsible' => TRUE,
27
$form['submission']['xmlsitemap_engines_submit'] = array(
28
'#type' => 'checkbox',
29
'#title' => t('Submit the sitemap on content updates'),
30
'#description' => t('If enabled, search engines will be notified of changes to the sitemap each time the site content is updated.'),
31
'#default_value' => variable_get('xmlsitemap_engines_submit', FALSE),
33
$form['submission']['xmlsitemap_engines_cron_submit_frequency'] = array(
35
'#title' => t('Frequency of sitemap submission'),
36
'#description' => t('The rate at which the sitemap is submitted to the search engines.'),
37
'#default_value' => variable_get('xmlsitemap_engines_cron_submit_frequency', 3600),
39
'29030400' => t('Yearly'),
40
'14515200' => t('Every 6 months'),
41
'2419200' => t('Monthly'),
42
'1296000' => t('Every 15 days'),
43
'604800' => t('Weekly'),
44
'86400' => t('Daily'),
45
'3600' => t('Hourly'),
49
$form['submission']['submission_urls'] = array(
50
'#type' => 'fieldset',
51
'#title' => t('Submission URLs'),
52
'#description' => t('Use %placeholder instead of the sitemap URL. Select the checkbox to enable the submission for a specific search engine.', array('%placeholder' => '[sitemap]')),
53
'#collapsible' => TRUE,
55
foreach (_xmlsitemap_engines_get_engines_data() as $id => $info) {
56
$form['submission']['submission_urls'][$id]['inline'] = array(
57
'#prefix' => '<div class="container-inline">',
60
$form['submission']['submission_urls'][$id]['inline']["xmlsitemap_engines_{$id}_submit"] = array(
61
'#type' => 'checkbox',
63
'#default_value' => variable_get("xmlsitemap_engines_{$id}_submit", FALSE),
65
$form['submission']['submission_urls'][$id]['inline']["xmlsitemap_engines_{$id}_url"] = array(
66
'#type' => 'textfield',
68
'#default_value' => variable_get("xmlsitemap_engines_{$id}_url", $info[1]),
70
'#field_suffix' => '<span class="description">'. $info[0] .'</span>',
73
$form['verification'] = array(
74
'#type' => 'fieldset',
75
'#title' => t('Verification settings'),
76
'#collapsible' => TRUE,
78
$form['verification']['google']['xmlsitemap_engines_google_verify'] = array(
79
'#type' => 'textfield',
80
'#title' => t('Google verification link'),
81
'#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.'),
82
'#default_value' => variable_get('xmlsitemap_engines_google_verify', ''),
84
$form['verification']['live']['xmlsitemap_engines_live_verify'] = array(
85
'#type' => 'textfield',
86
'#title' => t('Windows Live authentication file'),
87
'#description' => t('Before allowing you to view additional information, Windows Live 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.'),
88
'#default_value' => variable_get('xmlsitemap_engines_live_verify', 'LiveSearchSiteAuth.xml'),
90
$form['verification']['live']['xmlsitemap_engines_live_verify_string'] = array(
91
'#type' => 'textfield',
92
'#title' => t('Windows Live authentication tag'),
93
'#description' => t('Windows Live will give you an authentication tag.'),
94
'#default_value' => variable_get('xmlsitemap_engines_live_verify_string', ''),
96
$form['verification']['yahoo']['xmlsitemap_engines_yahoo_verify'] = array(
97
'#type' => 'textfield',
98
'#title' => t('Yahoo! verification link'),
99
'#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.'),
100
'#default_value' => variable_get('xmlsitemap_engines_yahoo_verify', ''),
102
$form['verification']['yahoo']['xmlsitemap_engines_yahoo_verify_string'] = array(
103
'#type' => 'textfield',
104
'#title' => t('Yahoo! authentication key'),
105
'#description' => t('Yahoo! will ask you to put an authentication key in the verification file.'),
106
'#default_value' => variable_get('xmlsitemap_engines_yahoo_verify_string', ''),
108
$form = system_settings_form($form);
109
$form['#submit'][] = 'xmlsitemap_engines_settings_submit';
114
* Submit the settings form.
116
function xmlsitemap_engines_settings_submit($form, &$form_state) {
117
variable_set('menu_rebuild_needed', TRUE);
121
* @} End of "addtogroup xmlsitemap".