mediafront.features.inc in MediaFront 6.2
Same filename and directory in other branches
File
includes/mediafront.features.incView source
<?php
/**
* Implementation of hook_features_export_options().
*/
function mediafront_features_export_options() {
$options = array();
foreach (mediafront_preset_get_presets() as $preset) {
$options[$preset['name']] = $preset['name'];
}
return $options;
}
/**
* Implementation of hook_features_export().
*/
function mediafront_features_export($data, &$export, $module_name = '') {
foreach ($data as $preset) {
$export['features']['mediafront'][$preset] = $preset;
}
}
/**
* Implementation of hook_features_export_render().
*/
function mediafront_features_export_render($module_name, $data) {
$items = array();
foreach ($data as $key) {
$preset = mediafront_get_preset($key);
unset($preset['pid']);
$items[$key] = $preset;
}
$code = " \$items = " . features_var_export($items, ' ') . ";\n";
$code .= ' return $items;';
return array(
'mediafront_default_presets' => $code,
);
}
/**
* Implementation of hook_features_revert().
*/
function mediafront_features_revert($module) {
if ($default_presets = features_get_default('mediafront', $module)) {
foreach (array_keys($default_presets) as $default_preset) {
mediafront_preset_delete($default_preset);
}
}
}
Functions
Name | Description |
---|---|
mediafront_features_export | Implementation of hook_features_export(). |
mediafront_features_export_options | Implementation of hook_features_export_options(). |
mediafront_features_export_render | Implementation of hook_features_export_render(). |
mediafront_features_revert | Implementation of hook_features_revert(). |