function countryicons_get_iconsets in Country Icons 6
Same name and namespace in other branches
- 6.2 countryicons.module \countryicons_get_iconsets()
- 7.2 countryicons.module \countryicons_get_iconsets()
- 7 countryicons.module \countryicons_get_iconsets()
Get all iconsets and their details. Searches for .iconsetsinfo-files within the modules iconsets directory.
Return value
array of iconsets
1 call to countryicons_get_iconsets()
- countryicons_get_iconset in ./
countryicons.module - Get an iconsets details.
File
- ./
countryicons.module, line 67 - A collection of country icons, and an API for retrieving them.
Code
function countryicons_get_iconsets() {
static $all_iconsets = NULL;
if (isset($all_iconsets)) {
return $all_iconsets;
}
$all_iconsets = array();
$iconsetpath = drupal_get_path('module', 'countryicons') . '/iconsets/';
$setinfofiles = file_scan_directory($iconsetpath, '.*iconsetinfo');
foreach ($setinfofiles as $setinfofile) {
$setinfo = drupal_parse_info_file($setinfofile->filename);
$setinfo['path'] = $iconsetpath . $setinfo['name'] . '/*.' . $setinfo['format'];
$all_iconsets[$setinfo['name']] = $setinfo;
}
return $all_iconsets;
}