forum.variable.inc 1.9 KB

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