Commit 67de4f67 authored by Dries's avatar Dries

- Usablity improvement: check whether the comment module is enabled. If not,

  show an error message.
parent 298b403b
......@@ -319,7 +319,7 @@ function _forum_get_vid() {
*/
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. '));
$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.'));
......@@ -766,7 +766,7 @@ function _forum_new($tid) {
function forum_page($tid = 0) {
global $user;
if (module_exist('taxonomy')) {
if (module_exist('taxonomy') && module_exist('comment')) {
$forum_per_page = variable_get('forum_per_page', 25);
$sortby = variable_get('forum_order', 1);
......@@ -779,8 +779,8 @@ function forum_page($tid = 0) {
return theme('forum_display', $forums, $topics, $parents, $tid, $sortby, $forum_per_page);
}
else {
drupal_set_title(t('Warning'));
return forum_help('admin/settings/forum');
drupal_set_message(t('The forum module requires both the taxonomy module and the comment module to be enabled and configured.'), 'error');
return ' ';
}
}
......
......@@ -319,7 +319,7 @@ function _forum_get_vid() {
*/
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. '));
$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.'));
......@@ -766,7 +766,7 @@ function _forum_new($tid) {
function forum_page($tid = 0) {
global $user;
if (module_exist('taxonomy')) {
if (module_exist('taxonomy') && module_exist('comment')) {
$forum_per_page = variable_get('forum_per_page', 25);
$sortby = variable_get('forum_order', 1);
......@@ -779,8 +779,8 @@ function forum_page($tid = 0) {
return theme('forum_display', $forums, $topics, $parents, $tid, $sortby, $forum_per_page);
}
else {
drupal_set_title(t('Warning'));
return forum_help('admin/settings/forum');
drupal_set_message(t('The forum module requires both the taxonomy module and the comment module to be enabled and configured.'), 'error');
return ' ';
}
}
......
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