You are here

fc_incomplete.module in Field Complete 7

Field Incomplete - Provides a block displaying of what's currently incomplete on an entity.

File

fc_incomplete/fc_incomplete.module
View source
<?php

/**
 * @file
 * Field Incomplete - Provides a block displaying of what's currently incomplete on an entity.
 */

/**
 * Implements hook_block_info().
 */
function fc_incomplete_block_info() {
  module_load_include('registry.inc', 'fc_incomplete');
  return _fc_incomplete_block_info();
}

/**
 * Implements hook_block_view().
 */
function fc_incomplete_block_view($delta) {
  module_load_include('blocks.inc', 'fc_incomplete');
  return _fc_incomplete_block_view($delta);
}

/**
 * Implements hook_theme().
 */
function fc_incomplete_theme() {
  module_load_include('registry.inc', 'fc_incomplete');
  return _fc_incomplete_theme();
}

/**
 * Implements hook_preprocess_fc_incomplete_header().
 */
function fc_incomplete_preprocess_fc_incomplete_header(&$vars) {
  if (fc_entity_is_enabled($vars['entity_type'])) {
    $field_info = field_info_fields();
    $vars['extras'] = '';
    if (!$vars['name'] && $vars['entity']) {
      $entity_name = theme('fc_incomplete_entity_name', $vars);
      $vars['header'] = entity_label($vars['entity_type'], $vars['entity']) . ' ' . $entity_name;
      $vars['classes_array'][] = 'fc-incomplete-entity';
    }
    elseif ($vars['name']) {
      if ($vars['bundle']) {
        $instance = field_info_instance($vars['entity_type'], $vars['name'], $vars['bundle']);
        $vars['header'] = $instance['label'];
      }
      else {
        $field = $field_info[$vars['name']];
        $vars['header'] = $vars['name'];
      }
    }
    else {
      $vars['header'] = $vars['name'];
    }
    $vars['complete'] = theme('fc_incomplete_complete', $vars);
  }
}

Functions

Namesort descending Description
fc_incomplete_block_info Implements hook_block_info().
fc_incomplete_block_view Implements hook_block_view().
fc_incomplete_preprocess_fc_incomplete_header Implements hook_preprocess_fc_incomplete_header().
fc_incomplete_theme Implements hook_theme().