You are here

function _fc_progress_block_view in Field Complete 7

Implements hook_block_view().

1 call to _fc_progress_block_view()
fc_progress_block_view in fc_progress/fc_progress.module
Implements hook_block_view().

File

fc_progress/fc_progress.blocks.inc, line 10
Field Complete Progress - Provides blocks to display a progress bar of Field completion - blocks.

Code

function _fc_progress_block_view($entity_type) {
  $entity = fc_get_page_entity($entity_type);

  // No entity available, so skip it.
  if (empty($entity)) {
    return array();
  }
  $entity_info = entity_get_info($entity_type);
  return array(
    'subject' => t('@title Progress', array(
      '@title' => $entity->{$entity_info['entity keys']['label']},
    )),
    'content' => array(
      'bar' => array(
        '#theme' => 'fc_progress_bar',
        '#entity_type' => $entity_type,
        '#entity' => $entity,
      ),
      'next' => array(
        '#theme' => 'fc_progress_next',
        '#entity_type' => $entity_type,
        '#entity' => $entity,
      ),
      '#attached' => array(
        'css' => array(
          drupal_get_path('module', 'fc_progress') . '/fc_progress.css',
        ),
      ),
    ),
  );
}