function fontyourface_features_export in @font-your-face 7.2
Implements hook_features_export [component hook]
This is a component hook, rather then a module hook, therefore this is the callback from hook_features_api which relates to the specific component we are looking to export. When a specific instance of the component we are looking to export is selected, this will include the necessariy item, plus any dependencies into our export array.
Parameters
array $data: this is the machine name for the component in question
array &$export: array of all components to be exported
string $module_name: The name of the feature module to be generated.
Return value
array The pipe array of further processors that should be called
File
- ./
fontyourface.features.inc, line 48 - Integrates Features for @font-your-face.
Code
function fontyourface_features_export($data, &$export, $module_name = '') {
// fontyourface_default_fonts integration is provided by Features.
$export['dependencies']['features'] = 'features';
$export['dependencies']['fontyourface'] = 'fontyourface';
// Add dependencies for each font.
$fonts = fontyourface_get_fonts('enabled = 1');
foreach ($fonts as $font) {
if (in_array($font->name, $data)) {
// Make the font provider required
$export['dependencies'][$font->provider] = $font->provider;
$export['features']['fontyourface'][$font->name] = $font->name;
}
}
return $export;
}