| [ Index ] |
PHP Cross Reference of Drupal 6 (yi-drupal) |
[Summary view] [Print] [Text view]
1 <?php 2 // $Id: site_map.admin.inc,v 1.1.2.7.2.7 2010/09/02 18:11:33 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 // Field to set site map page title. 16 $form['site_map_page_title'] = array( 17 '#type' => 'textfield', 18 '#title' => t('Page title'), 19 '#default_value' => variable_get('site_map_page_title', t('Site map')), 20 '#description' => t('Page title that will be used on the <a href="!link">site map page</a>.', array('!link' => url('sitemap'))), 21 ); 22 // Field to set site map message. 23 $form['site_map_message'] = array( 24 '#type' => 'textarea', 25 '#title' => t('Site map message'), 26 '#default_value' => variable_get('site_map_message', ''), 27 '#cols' => 60, 28 '#rows' => 5, 29 '#description' => t('Define a message to be displayed above the site map.'), 30 ); 31 $form['site_map_message_format'] = filter_form(variable_get('site_map_message_format', FILTER_FORMAT_DEFAULT), NULL, array('site_map_message_format')); 32 33 $form['site_map_content'] = array( 34 '#type' => 'fieldset', 35 '#title' => t('Site map content'), 36 ); 37 $form['site_map_content']['site_map_show_front'] = array( 38 '#type' => 'checkbox', 39 '#title' => t('Show front page'), 40 '#default_value' => variable_get('site_map_show_front', 1), 41 '#description' => t('When enabled, this option will include the front page in the site map.'), 42 ); 43 $form['site_map_content']['site_map_show_blogs'] = array( 44 '#type' => 'checkbox', 45 '#title' => t('Show active blog authors'), 46 '#default_value' => variable_get('site_map_show_blogs', 1), 47 '#description' => t('When enabled, this option will show the 10 most active blog authors.'), 48 ); 49 $book_options = array(); 50 if (module_exists('book')) { 51 foreach (book_get_books() as $book) { 52 $book_options[$book['nid']] = $book['title']; 53 } 54 } 55 $form['site_map_content']['site_map_show_books'] = array( 56 '#type' => 'checkboxes', 57 '#title' => t('Books to include in the site map'), 58 '#default_value' => variable_get('site_map_show_books', array()), 59 '#options' => $book_options, 60 '#multiple' => TRUE, 61 ); 62 // $form['site_map_content']['site_map_books_expanded'] = array( 63 // '#type' => 'checkbox', 64 // '#title' => t('Show books expanded'), 65 // '#default_value' => variable_get('site_map_books_expanded', 1), 66 // '#description' => t('When enabled, this option will show all children pages for each book.'), 67 // ); 68 69 $menu_options = array(); 70 $menu_options = menu_get_menus(); 71 72 $form['site_map_content']['site_map_show_menus'] = array( 73 '#type' => 'checkboxes', 74 '#title' => t('Menus to include in the site map'), 75 '#default_value' => variable_get('site_map_show_menus', array()), 76 '#options' => $menu_options, 77 '#multiple' => TRUE, 78 ); 79 $form['site_map_content']['site_map_show_faq'] = array( 80 '#type' => 'checkbox', 81 '#title' => t('Show FAQ content'), 82 '#default_value' => variable_get('site_map_show_faq', 0), 83 '#description' => t('When enabled, this option will include the content from the FAQ module in the site map.'), 84 ); 85 $vocab_options = array(); 86 if (module_exists('taxonomy')) { 87 foreach (taxonomy_get_vocabularies() as $vocabulary) { 88 $vocab_options[$vocabulary->vid] = $vocabulary->name; 89 } 90 } 91 $form['site_map_content']['site_map_show_vocabularies'] = array( 92 '#type' => 'checkboxes', 93 '#title' => t('Categories to include in the site map'), 94 '#default_value' => variable_get('site_map_show_vocabularies', array()), 95 '#options' => $vocab_options, 96 '#multiple' => TRUE, 97 ); 98 99 $form['site_map_taxonomy_options'] = array( 100 '#type' => 'fieldset', 101 '#title' => t('Categories settings'), 102 ); 103 $form['site_map_taxonomy_options']['site_map_show_count'] = array( 104 '#type' => 'checkbox', 105 '#title' => t('Show node counts by categories'), 106 '#default_value' => variable_get('site_map_show_count', 1), 107 '#description' => t('When enabled, this option will show the number of nodes in each taxonomy term.'), 108 ); 109 $form['site_map_taxonomy_options']['site_map_categories_depth'] = array( 110 '#type' => 'textfield', 111 '#title' => t('Categories depth'), 112 '#default_value' => variable_get('site_map_categories_depth', 'all'), 113 '#size' => 3, 114 '#maxlength' => 10, 115 '#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.'), 116 ); 117 $form['site_map_taxonomy_options']['site_map_term_threshold'] = array( 118 '#type' => 'textfield', 119 '#title' => t('Category count threshold'), 120 '#default_value' => variable_get('site_map_term_threshold', 0), 121 '#size' => 3, 122 '#description' => t('Only show categories whose node counts are greater than this threshold. Set to -1 to disable') 123 ); 124 $form['site_map_taxonomy_options']['site_map_forum_threshold'] = array( 125 '#type' => 'textfield', 126 '#title' => t('Forum count threshold'), 127 '#default_value' => variable_get('site_map_forum_threshold', -1), 128 '#size' => 3, 129 '#description' => t('Only show forums whose node counts are greater than this threshold. Set to -1 to disable') 130 ); 131 132 $form['site_map_rss_options'] = array( 133 '#type' => 'fieldset', 134 '#title' => t('RSS settings'), 135 ); 136 $form['site_map_rss_options']['site_map_rss_front'] = array( 137 '#type' => 'textfield', 138 '#title' => t('RSS feed for front page'), 139 '#default_value' => variable_get('site_map_rss_front', 'rss.xml'), 140 '#description' => t('The RSS feed for the front page, default is rss.xml.'), 141 ); 142 $form['site_map_rss_options']['site_map_show_rss_links'] = array( 143 '#type' => 'select', 144 '#title' => t('Include RSS links'), 145 '#default_value' => variable_get('site_map_show_rss_links', 1), 146 '#options' => array(0 => t('None'), 1 => t('Include on the right side'), 2 => t('Include on the left side')), 147 '#description' => t('When enabled, this option will show links to the RSS feeds for each category and blog.'), 148 ); 149 $form['site_map_rss_options']['site_map_rss_depth'] = array( 150 '#type' => 'textfield', 151 '#title' => t('RSS feed depth'), 152 '#default_value' => variable_get('site_map_rss_depth', 'all'), 153 '#size' => 3, 154 '#maxlength' => 10, 155 '#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.'), 156 ); 157 158 $form['site_map_css_options'] = array( 159 '#type' => 'fieldset', 160 '#title' => t('CSS settings'), 161 ); 162 $form['site_map_css_options']['site_map_css'] = array( 163 '#type' => 'checkbox', 164 '#title' => t('Do not include site map CSS file'), 165 '#default_value' => variable_get('site_map_css', 0), 166 '#description' => t('If you don\'t want to load the included CSS file you can check this box.'), 167 ); 168 169 // Make use of the Checkall module if it's installed. 170 if (module_exists('checkall')) { 171 $form['site_map_content']['site_map_show_books']['#checkall'] = TRUE; 172 $form['site_map_content']['site_map_show_menus']['#checkall'] = TRUE; 173 $form['site_map_content']['site_map_show_vocabularies']['#checkall'] = TRUE; 174 } 175 176 return system_settings_form($form); 177 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Jul 9 18:01:44 2012 | Cross-referenced by PHPXref 0.7 |