| 1 |
|
<?php |
| 2 |
|
// $Id: taxonomy_context.module,v 1.82.4.7 2009/10/03 03:00:02 nancyw Exp $ |
| 3 |
|
|
| 4 |
|
/** |
| 5 |
|
* @file |
| 6 |
|
* Create a block as a hierarchical menu tree for each vocabulary. |
| 7 |
|
*/ |
| 8 |
|
|
| 9 |
|
function taxonomy_context_admin_settings() { |
| 10 |
|
// We need the CSS here. |
| 11 |
|
drupal_add_css(drupal_get_path('module', 'taxonomy_context') . '/taxonomy_context.css'); |
| 12 |
|
|
| 13 |
|
$form = array(); |
| 14 |
|
$endis = array(t('Disabled'), t('Enabled')); |
| 15 |
|
|
| 16 |
|
$form['general_settings'] = array( |
| 17 |
|
'#type' => 'fieldset', |
| 18 |
|
'#title' => t('General Settings'), |
| 19 |
|
'#collapsible' => TRUE, |
| 20 |
|
); |
| 21 |
|
|
| 22 |
|
$form['general_settings']['taxonomy_context_use_style'] = array( |
| 23 |
|
'#type' => 'radios', |
| 24 |
|
'#title' => t('Use style for term and subterm display'), |
| 25 |
|
'#default_value' => variable_get('taxonomy_context_use_style', 0), |
| 26 |
|
'#options' => $endis, |
| 27 |
|
'#description' => t('Include style declaration to clean up display of taxonomy info. Disable this option if you wish to do this instead through editing theme .css files.'), |
| 28 |
|
); |
| 29 |
|
|
| 30 |
|
$form['general_settings']['taxonomy_context_show_term'] = array( |
| 31 |
|
'#type' => 'radios', |
| 32 |
|
'#title' => t('Show term info'), |
| 33 |
|
'#default_value' => variable_get('taxonomy_context_show_term', 1), |
| 34 |
|
'#options' => $endis, |
| 35 |
|
'#description' => t('Show additional information about current term (from description).'), |
| 36 |
|
); |
| 37 |
|
|
| 38 |
|
$form['general_settings']['taxonomy_context_show_subterms'] = array( |
| 39 |
|
'#type' => 'radios', |
| 40 |
|
'#title' => t('Show subterm info'), |
| 41 |
|
'#default_value' => variable_get('taxonomy_context_show_subterms', 1), |
| 42 |
|
'#options' => $endis, |
| 43 |
|
'#description' => t('Show listings of subterms (sub-categories) for current term.'), |
| 44 |
|
); |
| 45 |
|
|
| 46 |
|
$form['general_settings']['taxonomy_context_subterm_indent'] = array( |
| 47 |
|
'#type' => 'textfield', |
| 48 |
|
'#title' => t('Subterm indent character'), |
| 49 |
|
'#default_value' => variable_get('taxonomy_context_subterm_indent', '—'), |
| 50 |
|
'#size' => 32, |
| 51 |
|
'#description' => t('Subterms will be indented to show hierarchy; this is what is used to show the indentation. It will be repeated for each level of depth.'), |
| 52 |
|
); |
| 53 |
|
|
| 54 |
|
$form['general_settings']['taxonomy_context_max_depth'] = array( |
| 55 |
|
'#type' => 'textfield', |
| 56 |
|
'#title' => t('Maximum term depth for overview'), |
| 57 |
|
'#default_value' => variable_get('taxonomy_context_max_depth', 1), |
| 58 |
|
'#size' => 8, |
| 59 |
|
'#description' => t('This is how deep in the hierarchy to show terms on the overview ("menu") page. A value of 1 show only the highest level.'), |
| 60 |
|
); |
| 61 |
|
$num_titles = variable_get('taxonomy_context_show_titles', 0); |
| 62 |
|
$order = variable_get('taxonomy_context_show_order', 'n.title'); |
| 63 |
|
|
| 64 |
|
$form['general_settings']['titles'] = array( |
| 65 |
|
'#type' => 'fieldset', |
| 66 |
|
'#title' => t('Node title display'), |
| 67 |
|
'#collapsible' => TRUE, |
| 68 |
|
); |
| 69 |
|
|
| 70 |
|
$form['general_settings']['titles']['taxonomy_context_show_titles'] = array( |
| 71 |
|
'#type' => 'textfield', |
| 72 |
|
'#title' => t('Maximum titles to show for each term'), |
| 73 |
|
'#default_value' => variable_get('taxonomy_context_show_titles', 0), |
| 74 |
|
'#size' => 8, |
| 75 |
|
'#description' => t('This is how many node titles to show for each term on the overview ("menu") page. A value of 0 means don\'t show any.'), |
| 76 |
|
); |
| 77 |
|
|
| 78 |
|
$form['general_settings']['titles']['taxonomy_context_show_order'] = array( |
| 79 |
|
'#type' => 'radios', |
| 80 |
|
'#title' => t('Title order'), |
| 81 |
|
'#default_value' => variable_get('taxonomy_context_show_order', 'n.title'), |
| 82 |
|
'#options' => array( |
| 83 |
|
'n.title' => t('by title (ascending)'), |
| 84 |
|
'n.sticky DESC, n.created DESC' => t('by standard Drupal order (sticky, most recent)'), |
| 85 |
|
), |
| 86 |
|
'#description' => t('In what order do you wish to show the titles? This may also affect which titles are shown if there are more than the limit above.'), |
| 87 |
|
); |
| 88 |
|
|
| 89 |
|
$form['general_settings']['taxonomy_context_node_block'] = array( |
| 90 |
|
'#type' => 'radios', |
| 91 |
|
'#title' => t('Show nodes in block'), |
| 92 |
|
'#default_value' => variable_get('taxonomy_context_node_block', TAXONOMY_CONTEXT_NODE_BLOCK_NONE), |
| 93 |
|
'#options' => array(t('None'), t('Sticky'), t('Promoted'), t('All')), |
| 94 |
|
'#description' => t('What nodes do you wish to display in taxonomy blocks?'), |
| 95 |
|
); |
| 96 |
|
|
| 97 |
|
$form['general_settings']['taxonomy_context_block_display'] = array( |
| 98 |
|
'#type' => 'radios', |
| 99 |
|
'#title' => t('Show block items'), |
| 100 |
|
'#default_value' => variable_get('taxonomy_context_block_display', TAXONOMY_CONTEXT_BLOCK_DISPLAY_COLLAPSED), |
| 101 |
|
'#options' => array(t('Collapsed'), t('Expanded')), |
| 102 |
|
'#description' => t('Do you want items on the menu expanded or collapsed by default?'), |
| 103 |
|
); |
| 104 |
|
|
| 105 |
|
$form['general_settings']['taxonomy_context_count_nodes'] = array( |
| 106 |
|
'#type' => 'radios', |
| 107 |
|
'#title' => t('Show node count on overview page'), |
| 108 |
|
'#default_value' => variable_get('taxonomy_context_count_nodes', 0), |
| 109 |
|
'#options' => $endis, |
| 110 |
|
'#description' => t('Show the number of nodes tagged with each term. For example: term-name (nnn)'), |
| 111 |
|
); |
| 112 |
|
|
| 113 |
|
$form['general_settings']['taxonomy_context_block_count_nodes'] = array( |
| 114 |
|
'#type' => 'radios', |
| 115 |
|
'#title' => t('Show count nodes in block items'), |
| 116 |
|
'#default_value' => variable_get('taxonomy_context_block_count_nodes', TAXONOMY_CONTEXT_BLOCK_COUNT_NODES_FALSE), |
| 117 |
|
'#options' => $endis, |
| 118 |
|
'#description' => t('Show count nodes in block after items. Example: term (nnn)'), |
| 119 |
|
); |
| 120 |
|
|
| 121 |
|
return system_settings_form($form); |
| 122 |
|
} |