function menu_position_features_export_render in Menu Position 7
Implements hook_features_export_render().
File
- ./
menu_position.features.inc, line 37 - Integration with the Features module.
Code
function menu_position_features_export_render($module_name, $data) {
$items = array();
foreach ($data as $id => $machine_name) {
$query = db_select('menu_position_rules', 'm')
->fields('m', array(
'admin_title',
'enabled',
'conditions',
'menu_name',
'plid',
'mlid',
'weight',
'machine_name',
))
->condition('machine_name', $machine_name)
->execute();
$field = $query
->fetchAssoc();
$items[$machine_name] = $field;
}
$code = " \$items = " . features_var_export($items, ' ') . ";\n";
$code .= ' return $items;';
return array(
'menu_position_default_menu_positions' => $code,
);
}