~spreadubuntu/spreadubuntu/devel-drupal6

« back to all changes in this revision

Viewing changes to sites/all/modules/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.admin.inc

  • Committer: ruben
  • Date: 2009-06-08 09:38:49 UTC
  • Revision ID: ruben@captive-20090608093849-s1qtsyctv2vwp1x1
SpreadUbuntu moving to Drupal6. Based on ubuntu-drupal theme and adding our modules

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
// $Id: xmlsitemap_engines.admin.inc,v 1.1.2.9 2009/05/23 14:08:18 kiam Exp $
 
3
 
 
4
/**
 
5
 * @file
 
6
 * XML sitemap engines settings UI.
 
7
 */
 
8
 
 
9
/**
 
10
 * @addtogroup xmlsitemap
 
11
 * @{
 
12
 */
 
13
 
 
14
/*****************************************************************************
 
15
 * Menu callbacks / form builders, submit/validate functions.
 
16
 ****************************************************************************/
 
17
 
 
18
/**
 
19
 * Form builder; return the search engine settings form.
 
20
 */
 
21
function xmlsitemap_engines_settings() {
 
22
  $form['submission'] = array(
 
23
    '#type' => 'fieldset',
 
24
    '#title' => t('Submission settings'),
 
25
    '#collapsible' => TRUE,
 
26
  );
 
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),
 
32
  );
 
33
  $form['submission']['xmlsitemap_engines_cron_submit_frequency'] = array(
 
34
    '#type' => 'select',
 
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),
 
38
    '#options' => array(
 
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'),
 
46
      '-1' => t('Never'),
 
47
    ),
 
48
  );
 
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,
 
54
  );
 
55
  foreach (_xmlsitemap_engines_get_engines_data() as $id => $info) {
 
56
    $form['submission']['submission_urls'][$id]['inline'] = array(
 
57
      '#prefix' => '<div class="container-inline">',
 
58
      '#suffix' => '</div>'
 
59
    );
 
60
    $form['submission']['submission_urls'][$id]['inline']["xmlsitemap_engines_{$id}_submit"] = array(
 
61
      '#type' => 'checkbox',
 
62
      '#title' => '',
 
63
      '#default_value' => variable_get("xmlsitemap_engines_{$id}_submit", FALSE),
 
64
    );
 
65
    $form['submission']['submission_urls'][$id]['inline']["xmlsitemap_engines_{$id}_url"] = array(
 
66
      '#type' => 'textfield',
 
67
      '#title' => '',
 
68
      '#default_value' => variable_get("xmlsitemap_engines_{$id}_url", $info[1]),
 
69
      '#size' => 40,
 
70
      '#field_suffix' => '<span class="description">'. $info[0] .'</span>',
 
71
    );
 
72
  }
 
73
  $form['verification'] = array(
 
74
    '#type' => 'fieldset',
 
75
    '#title' => t('Verification settings'),
 
76
    '#collapsible' => TRUE,
 
77
  );
 
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', ''),
 
83
  );
 
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'),
 
89
  );
 
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', ''),
 
95
  );
 
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', ''),
 
101
  );
 
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', ''),
 
107
  );
 
108
  $form = system_settings_form($form);
 
109
  $form['#submit'][] = 'xmlsitemap_engines_settings_submit';
 
110
  return $form;
 
111
}
 
112
 
 
113
/**
 
114
 * Submit the settings form.
 
115
 */
 
116
function xmlsitemap_engines_settings_submit($form, &$form_state) {
 
117
  variable_set('menu_rebuild_needed', TRUE);
 
118
}
 
119
 
 
120
/**
 
121
 * @} End of "addtogroup xmlsitemap".
 
122
 */