Skip to content
Snippets Groups Projects
Commit 3e681cc5 authored by Hugues Lesecq's avatar Hugues Lesecq Committed by Jeff Geerling
Browse files

Issue #1489700 by hles: Allow comment form settings only when comment module is actually enabled.

parent 166bf0c9
No related branches found
No related tags found
No related merge requests found
......@@ -117,14 +117,16 @@ function honeypot_admin_form($form, &$form_state) {
}
// Comment forms.
$form['enabled_forms']['comment_forms'] = array('#markup' => '<h5>' . t('Comment Forms') . '</h5>');
foreach ($types as $type) {
$id = 'honeypot_form_comment_node_' . $type->type . '_form';
$form['enabled_forms'][$id] = array(
'#type' => 'checkbox',
'#title' => t('@name comment form', array('@name' => $type->name)),
'#default_value' => variable_get($id, 0),
);
if (module_exists('comment')) {
$form['enabled_forms']['comment_forms'] = array('#markup' => '<h5>' . t('Comment Forms') . '</h5>');
foreach ($types as $type) {
$id = 'honeypot_form_comment_node_' . $type->type . '_form';
$form['enabled_forms'][$id] = array(
'#type' => 'checkbox',
'#title' => t('@name comment form', array('@name' => $type->name)),
'#default_value' => variable_get($id, 0),
);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment