Commit fb4b224a authored by Steven Wittens's avatar Steven Wittens
Browse files

#16951: Move forum settings to configure tab (drumm)

parent ca1330ae
...@@ -271,7 +271,9 @@ function _forum_get_vid() { ...@@ -271,7 +271,9 @@ function _forum_get_vid() {
/** /**
* Implementation of hook_settings * Implementation of hook_settings
*/ */
function forum_settings() { function forum_admin_configure() {
system_settings_save();
$output .= form_textfield(t('Forum icon path'), 'forum_icon_path', variable_get('forum_icon_path', ''), 30, 255, t('The path to the forum icons. Leave blank to disable icons. Don\'t add a trailing slash. Default icons are available in the "misc" directory. You may use images of whatever size you wish, but it is recommended to use 15x15 or 16x16. ')); $output .= form_textfield(t('Forum icon path'), 'forum_icon_path', variable_get('forum_icon_path', ''), 30, 255, t('The path to the forum icons. Leave blank to disable icons. Don\'t add a trailing slash. Default icons are available in the "misc" directory. You may use images of whatever size you wish, but it is recommended to use 15x15 or 16x16. '));
$number = drupal_map_assoc(array(5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100, 10000)); $number = drupal_map_assoc(array(5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100, 10000));
$output .= form_select(t('Hot topic threshold'), 'forum_hot_topic', variable_get('forum_hot_topic', 15), $number, t('The number of posts a topic must have to be considered hot.')); $output .= form_select(t('Hot topic threshold'), 'forum_hot_topic', variable_get('forum_hot_topic', 15), $number, t('The number of posts a topic must have to be considered hot.'));
...@@ -280,7 +282,7 @@ function forum_settings() { ...@@ -280,7 +282,7 @@ function forum_settings() {
$forder = array(1 => t('Date - newest first'), 2 => t('Date - oldest first'), 3 => t('Posts - most active first'), 4=> t('Posts - least active first')); $forder = array(1 => t('Date - newest first'), 2 => t('Date - oldest first'), 3 => t('Posts - most active first'), 4=> t('Posts - least active first'));
$output .= form_radios(t('Default order'), 'forum_order', variable_get('forum_order', '1'), $forder, t('The default display order for topics.')); $output .= form_radios(t('Default order'), 'forum_order', variable_get('forum_order', '1'), $forder, t('The default display order for topics.'));
return $output; print theme('page', system_settings_form($output));
} }
/** /**
...@@ -416,7 +418,10 @@ function forum_menu($may_cache) { ...@@ -416,7 +418,10 @@ function forum_menu($may_cache) {
$items[] = array('path' => 'admin/forum/add/forum', 'title' => t('add forum'), $items[] = array('path' => 'admin/forum/add/forum', 'title' => t('add forum'),
'access' => user_access('administer forums'), 'access' => user_access('administer forums'),
'type' => MENU_LOCAL_TASK); 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/forum/configure', 'title' => t('configure'),
'callback' => 'forum_admin_configure',
'access' => user_access('administer forums'),
'type' => MENU_LOCAL_TASK);
} }
return $items; return $items;
......
...@@ -271,7 +271,9 @@ function _forum_get_vid() { ...@@ -271,7 +271,9 @@ function _forum_get_vid() {
/** /**
* Implementation of hook_settings * Implementation of hook_settings
*/ */
function forum_settings() { function forum_admin_configure() {
system_settings_save();
$output .= form_textfield(t('Forum icon path'), 'forum_icon_path', variable_get('forum_icon_path', ''), 30, 255, t('The path to the forum icons. Leave blank to disable icons. Don\'t add a trailing slash. Default icons are available in the "misc" directory. You may use images of whatever size you wish, but it is recommended to use 15x15 or 16x16. ')); $output .= form_textfield(t('Forum icon path'), 'forum_icon_path', variable_get('forum_icon_path', ''), 30, 255, t('The path to the forum icons. Leave blank to disable icons. Don\'t add a trailing slash. Default icons are available in the "misc" directory. You may use images of whatever size you wish, but it is recommended to use 15x15 or 16x16. '));
$number = drupal_map_assoc(array(5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100, 10000)); $number = drupal_map_assoc(array(5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100, 10000));
$output .= form_select(t('Hot topic threshold'), 'forum_hot_topic', variable_get('forum_hot_topic', 15), $number, t('The number of posts a topic must have to be considered hot.')); $output .= form_select(t('Hot topic threshold'), 'forum_hot_topic', variable_get('forum_hot_topic', 15), $number, t('The number of posts a topic must have to be considered hot.'));
...@@ -280,7 +282,7 @@ function forum_settings() { ...@@ -280,7 +282,7 @@ function forum_settings() {
$forder = array(1 => t('Date - newest first'), 2 => t('Date - oldest first'), 3 => t('Posts - most active first'), 4=> t('Posts - least active first')); $forder = array(1 => t('Date - newest first'), 2 => t('Date - oldest first'), 3 => t('Posts - most active first'), 4=> t('Posts - least active first'));
$output .= form_radios(t('Default order'), 'forum_order', variable_get('forum_order', '1'), $forder, t('The default display order for topics.')); $output .= form_radios(t('Default order'), 'forum_order', variable_get('forum_order', '1'), $forder, t('The default display order for topics.'));
return $output; print theme('page', system_settings_form($output));
} }
/** /**
...@@ -416,7 +418,10 @@ function forum_menu($may_cache) { ...@@ -416,7 +418,10 @@ function forum_menu($may_cache) {
$items[] = array('path' => 'admin/forum/add/forum', 'title' => t('add forum'), $items[] = array('path' => 'admin/forum/add/forum', 'title' => t('add forum'),
'access' => user_access('administer forums'), 'access' => user_access('administer forums'),
'type' => MENU_LOCAL_TASK); 'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/forum/configure', 'title' => t('configure'),
'callback' => 'forum_admin_configure',
'access' => user_access('administer forums'),
'type' => MENU_LOCAL_TASK);
} }
return $items; return $items;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment