1 icon_test.module icon_test_icon_info()

Implements hook_icon_info().

File

core/modules/simpletest/tests/icon_test/icon_test.module, line 45
Provides testing hooks for Icon API.

Code

function icon_test_icon_info() {
  $icons = array();
  $module_path = backdrop_get_path('module', 'icon_test');

  // Replace an icon in the default location.
  if (state_get('icon_test_location') === 'default') {
    $icons['gear'] = array();
  }

  // Replace an icon with the same name in a different directory.
  if (state_get('icon_test_location') === 'directory') {
    $icons['gear'] = array(
      'directory' => $module_path . '/icons/bold',
    );
  }

  // Replace an icon with a different name in the default directory.
  if (state_get('icon_test_location') === 'renamed') {
    $icons['gear'] = array(
      'name' => 'gear-thin',
    );
  }

  // Replace an icon with a different name in the default directory.
  if (state_get('icon_test_location') === 'renamed_directory') {
    $icons['gear'] = array(
      'directory' => $module_path . '/icons/bold',
      'name' => 'gear-bold',
    );
  }

  // Replace an icon outside of the module directory.
  if (state_get('icon_test_location') === 'outside_module') {
    $icons['gear'] = array(
      'directory' => 'core/misc/icons',
      'name' => 'gear-six',
    );
  }

  return $icons;
}