You are here

function icomoon_get_json in Icomoon 7

Retrieve JSON data about a bundle.

@todo Move this into Icon API as a generic helper function for retrieving and parsing a bundle's "JSON configuration file".

Parameters

string $path: The bundle path.

Return value

array|FALSE The JSON array or FALSE if not found.

2 calls to icomoon_get_json()
icomoon_icon_icomoon_import_process in ./icomoon.module
Implements hook_icon_PROVIDER_import_process().
icomoon_icon_icomoon_import_validate in ./icomoon.module
Implements hook_icon_PROVIDER_import_validate().

File

./icomoon.module, line 49
icomoon.module Integrates the Icomoon service as an icon provider for Icon API.

Code

function icomoon_get_json($path) {
  if (file_exists($path . '/selection.json')) {
    $json = drupal_json_decode(file_get_contents($path . '/selection.json'));
    if (!empty($json)) {
      return $json;
    }
  }
  return FALSE;
}