Projet

Général

Profil

Paste
Télécharger (1,93 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / variable / includes / forum.variable.inc @ 76df55b7

1
<?php
2
/**
3
 * @file
4
 * Variable API module. Definition for Drupal core variables
5
 */
6

    
7
/**
8
 * Implements hook_variable_info().
9
 */
10
function forum_variable_info($options) {
11
  $variables['forum_hot_topic'] = array(
12
    'title' => t('Hot topic threshold'),
13
    'type' => 'select_number',
14
    'default' => 15,
15
    'options' => array(5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100, 150, 200, 250, 300, 350, 400, 500),
16
    'description' => t('The number of replies a topic must have to be considered "hot".'),
17
    'group' => 'forum_settings',
18
  );
19
  $variables['forum_per_page'] = array(
20
    'title' => t('Topics per page'),
21
    'type' => 'select_number',
22
    'default' => 25,
23
    'options' => array(10, 25, 50, 75, 100),
24
    'description' => t('Default number of forum topics displayed per page.'),
25
    'group' => 'forum_settings',
26
  );
27
  $forder = array(1 => t('Date - newest first'), 2 => t('Date - oldest first'), 3 => t('Posts - most active first'), 4 => t('Posts - least active first'));
28
  $variables['forum_order'] = array(
29
    'title' => t('Default order'),
30
    'type' => 'select',
31
    'default' => 1,
32
    'options' => $forder,
33
    'description' => t('Default display order for topics.'),
34
    'group' => 'forum_settings',
35
  ); 
36
  // Some hidden variables that we may want exposed, localized, etc..
37
  $variables['forum_nav_vocabulary'] = array(
38
    'type' => 'select',
39
    'options' => 'vocabulary_vid',
40
    'title' => t('Forum navigation vocabulary'),
41
    'default' => 0,
42
    'group' => 'forum_settings',
43
    'localize' => TRUE,
44
  );
45
  $variables['forum_containers'] = array(
46
    'type' => 'array',
47
    'title' => t('Forum containers'),
48
    'group' => 'forum_settings',    
49
  );
50
  return $variables;
51
}
52

    
53
/**
54
 * Implements hook_variable_group_info().
55
 */
56
function forum_variable_group_info() {
57
  $groups['forum_settings'] = array(
58
    'title' => t('Forum settings'),
59
    'access' => 'administer forums',
60
    'path' => 'admin/structure/menu/settings',
61
  );
62
  return $groups;
63
}
64