diff --git a/flag.inc b/flag.inc index c850d9b..3d21d22 100644 --- a/flag.inc +++ b/flag.inc @@ -16,23 +16,28 @@ * should point to the PHP class implementing this flag. */ function flag_flag_definitions() { - return array( + $definitions = array( 'node' => array( 'title' => t('Nodes'), 'description' => t("Nodes are a Drupal site's primary content."), 'handler' => 'flag_node', ), - 'comment' => array( - 'title' => t('Comments'), - 'description' => t('Comments are responses to node content.'), - 'handler' => 'flag_comment', - ), 'user' => array( 'title' => t('Users'), 'description' => t('Users who have created accounts on your site.'), 'handler' => 'flag_user', ), ); + + if (module_exists('comment')) { + $definitions['comment'] = array( + 'title' => t('Comments'), + 'description' => t('Comments are responses to node content.'), + 'handler' => 'flag_comment', + ); + } + + return $definitions; } /**