You are here

function oa_comment_features_template_info in OA Comment 7.2

Implements hook_features_template_info().

File

./oa_comment.module, line 267

Code

function oa_comment_features_template_info() {
  $data =& drupal_static(__FUNCTION__);
  if (empty($data)) {
    $data = array();
    if (module_exists('oa_related')) {
      $enabled_related = oa_related_get_content_types();

      // Only process enabled content types as if disabled, comments won't show up
      // so whether they have the field won't matter and thus no dataloss.
      foreach (oa_comment_content_types_enabled() as $content_type) {

        // Only have an entry if this will exist or needs to be deleted.
        $data[] = array(
          'plugin' => 'field_instance',
          'template' => 'oa_comment_field_default_field_instances_template',
          'deleted' => variable_get('oa_related_comment_' . $content_type, in_array($content_type, $enabled_related)) ? 0 : 1,
          'entity_type' => 'comment',
          'bundle_type' => 'comment_node_' . $content_type,
          'field' => 'field_oa_related',
        );
      }
    }
  }
  return $data;
}