You are here

function icon_bundle_list in Icon API 8

Same name and namespace in other branches
  1. 7 includes/admin.inc \icon_bundle_list()

Menu callback for 'icon_bundle_list'.

File

includes/admin.inc, line 377
admin.inc Provides administrative callbacks and tasks.

Code

function icon_bundle_list($bundle) {
  $build = array();
  foreach ($bundle['icons'] as $icon => $value) {
    $build[] = array(
      '#theme' => 'icon',
      '#bundle' => $bundle['name'],
      '#icon' => $icon,
      '#attributes' => array(
        'title' => $icon,
      ),
    );
  }

  // Allow other modules and themes to alter a bundle's listing.
  $bundle_context = $bundle;
  \Drupal::moduleHandler()
    ->alter('icon_bundle_list', $build, $bundle_context);
  return $build;
}