function fe_nodequeue_features_revert in Features Extra 7
Implements hook_features_revert().
2 calls to fe_nodequeue_features_revert()
- fe_nodequeue_features_enable_feature in fe_nodequeue/
fe_nodequeue.module - Implements hook_features_enable_feature().
- fe_nodequeue_features_rebuild in fe_nodequeue/
fe_nodequeue.module - Implements hook_features_revert().
File
- fe_nodequeue/
fe_nodequeue.module, line 129 - Main functions and hook implementations of the FE Nodequeue module.
Code
function fe_nodequeue_features_revert($module) {
$defaults = features_get_default('fe_nodequeue', $module);
if (empty($defaults)) {
return;
}
// Revert.
foreach ($defaults as $object) {
if (empty($object['name'])) {
continue;
}
// Assign the existing qid if a nodequeue with the same name already exists.
$map = _fe_nodequeue_get_qid_map();
if (isset($map[$object['name']])) {
$object['qid'] = $map[$object['name']];
}
else {
$object['new'] = TRUE;
unset($object['qid']);
}
_fe_nodequeue_save_queue((array) $object);
}
return TRUE;
}