| 1 |
<?php
|
| 2 |
// $Id: site_map.module,v 1.36 2007/09/26 14:13:37 frjo Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Original author: Nic Ivy
|
| 7 |
* Now maintained by by Fredrik Jonsson fredrik at combonet dot se
|
| 8 |
*/
|
| 9 |
|
| 10 |
/**
|
| 11 |
* Menu callback; presents the sitemap settings page.
|
| 12 |
*/
|
| 13 |
function site_map_admin_settings() {
|
| 14 |
|
| 15 |
$form['site_map_message'] = array(
|
| 16 |
'#type' => 'textarea',
|
| 17 |
'#title' => t('Site map message'),
|
| 18 |
'#default_value' => variable_get('site_map_message', ''),
|
| 19 |
'#cols' => 60,
|
| 20 |
'#rows' => 5,
|
| 21 |
'#description' => t('Define a message to be displayed above the site map.'),
|
| 22 |
);
|
| 23 |
|
| 24 |
$form['site_map_content'] = array(
|
| 25 |
'#type' => 'fieldset',
|
| 26 |
'#title' => t('Site map content'),
|
| 27 |
);
|
| 28 |
$form['site_map_content']['site_map_show_front'] = array(
|
| 29 |
'#type' => 'checkbox',
|
| 30 |
'#title' => t('Show front page'),
|
| 31 |
'#return_value' => 1,
|
| 32 |
'#default_value' => variable_get('site_map_show_front', 1),
|
| 33 |
'#description' => t('When enabled, this option will include the front page in the site map.'),
|
| 34 |
);
|
| 35 |
$form['site_map_content']['site_map_show_blogs'] = array(
|
| 36 |
'#type' => 'checkbox',
|
| 37 |
'#title' => t('Show active blog authors'),
|
| 38 |
'#return_value' => 1,
|
| 39 |
'#default_value' => variable_get('site_map_show_blogs', 1),
|
| 40 |
'#description' => t('When enabled, this option will show the 10 most active blog authors.'),
|
| 41 |
);
|
| 42 |
$book_options = array();
|
| 43 |
if (module_exists('book')) {
|
| 44 |
foreach (book_get_books() as $book) {
|
| 45 |
$book_options[$book['nid']] = $book['title'];
|
| 46 |
}
|
| 47 |
}
|
| 48 |
$form['site_map_content']['site_map_show_books'] = array(
|
| 49 |
'#type' => 'select',
|
| 50 |
'#title' => t('Books to include in the site map'),
|
| 51 |
'#default_value' => variable_get('site_map_show_books', array()),
|
| 52 |
'#options' => $book_options,
|
| 53 |
'#multiple' => TRUE,
|
| 54 |
'#description' => t('Ctrl-click (Windows) or Command-click (Mac) to select more than one value.'),
|
| 55 |
);
|
| 56 |
$menu_options = array();
|
| 57 |
$menu_options = menu_get_menus();
|
| 58 |
$form['site_map_content']['site_map_show_menus'] = array(
|
| 59 |
'#type' => 'select',
|
| 60 |
'#title' => t('Menus to include in the site map'),
|
| 61 |
'#default_value' => variable_get('site_map_show_menus', array()),
|
| 62 |
'#options' => $menu_options,
|
| 63 |
'#multiple' => TRUE,
|
| 64 |
'#description' => t('Ctrl-click (Windows) or Command-click (Mac) to select more than one value.'),
|
| 65 |
);
|
| 66 |
$form['site_map_content']['site_map_show_faq'] = array(
|
| 67 |
'#type' => 'checkbox',
|
| 68 |
'#title' => t('Show FAQ content'),
|
| 69 |
'#return_value' => 1,
|
| 70 |
'#default_value' => variable_get('site_map_show_faq', 1),
|
| 71 |
'#description' => t('When enabled, this option will include the content from the FAQ module in the site map.'),
|
| 72 |
);
|
| 73 |
$vocab_options = array();
|
| 74 |
if (module_exists('taxonomy')) {
|
| 75 |
foreach (taxonomy_get_vocabularies() as $vocabulary) {
|
| 76 |
$vocab_options[$vocabulary->vid] = $vocabulary->name;
|
| 77 |
}
|
| 78 |
}
|
| 79 |
$form['site_map_content']['site_map_show_vocabularies'] = array(
|
| 80 |
'#type' => 'select',
|
| 81 |
'#title' => t('Categories to include in the site map'),
|
| 82 |
'#default_value' => variable_get('site_map_show_vocabularies', array()),
|
| 83 |
'#options' => $vocab_options,
|
| 84 |
'#multiple' => TRUE,
|
| 85 |
'#description' => t('Ctrl-click (Windows) or Command-click (Mac) to select more than one value.'),
|
| 86 |
);
|
| 87 |
|
| 88 |
$form['site_map_content_options'] = array(
|
| 89 |
'#type' => 'fieldset',
|
| 90 |
'#title' => t('Categories settings'),
|
| 91 |
);
|
| 92 |
$form['site_map_content_options']['site_map_books_expanded'] = array(
|
| 93 |
'#type' => 'checkbox',
|
| 94 |
'#title' => t('Show books expanded'),
|
| 95 |
'#return_value' => 1,
|
| 96 |
'#default_value' => variable_get('site_map_books_expanded', 1),
|
| 97 |
'#description' => t('When enabled, this option will show all children pages for each book.'),
|
| 98 |
);
|
| 99 |
$form['site_map_content_options']['site_map_show_count'] = array(
|
| 100 |
'#type' => 'checkbox',
|
| 101 |
'#title' => t('Show node counts by categories'),
|
| 102 |
'#return_value' => 1,
|
| 103 |
'#default_value' => variable_get('site_map_show_count', 1),
|
| 104 |
'#description' => t('When enabled, this option will show the number of nodes in each taxonomy term.'),
|
| 105 |
);
|
| 106 |
$form['site_map_content_options']['site_map_categories_depth'] = array(
|
| 107 |
'#type' => 'textfield',
|
| 108 |
'#title' => t('Categories depth'),
|
| 109 |
'#default_value' => variable_get('site_map_categories_depth', 'all'),
|
| 110 |
'#size' => 3,
|
| 111 |
'#maxlength' => 10,
|
| 112 |
'#description' => t('Specify how many subcategories should be included on the categorie page. Enter "all" to include all subcategories,"0" to include no subcategories, or "-1" not to append the depth at all.'),
|
| 113 |
);
|
| 114 |
|
| 115 |
$form['site_map_rss_options'] = array(
|
| 116 |
'#type' => 'fieldset',
|
| 117 |
'#title' => t('RSS settings'),
|
| 118 |
);
|
| 119 |
$form['site_map_rss_options']['site_map_show_rss_links'] = array(
|
| 120 |
'#type' => 'checkbox',
|
| 121 |
'#title' => t('Include RSS links'),
|
| 122 |
'#return_value' => 1,
|
| 123 |
'#default_value' => variable_get('site_map_show_rss_links', 1),
|
| 124 |
'#description' => t('When enabled, this option will show links to the RSS feeds for each category and blog.'),
|
| 125 |
);
|
| 126 |
$form['site_map_rss_options']['site_map_rss_depth'] = array(
|
| 127 |
'#type' => 'textfield',
|
| 128 |
'#title' => t('RSS feed depth'),
|
| 129 |
'#default_value' => variable_get('site_map_rss_depth', 'all'),
|
| 130 |
'#size' => 3,
|
| 131 |
'#maxlength' => 10,
|
| 132 |
'#description' => t('Specify how many subcategories should be included in the RSS feed. Enter "all" to include all subcategories or "0" to include no subcategories.'),
|
| 133 |
);
|
| 134 |
|
| 135 |
return system_settings_form($form);
|
| 136 |
}
|