UPDATED
After some consideration and discussion with Robin I think my first go at hook_media_mover is off the mark. Using hook_menu as the template, I think the process of defining media mover actions can be simplified:
function mm_node_media_mover() {
$items = array();
$items['set_node_status'] = array(
'description' => t('Set node status'),
'configuration' => 'mm_node_config_complete',
'callback' => 'mm_node_complete',
);
return $items;
}
$items[NAME] identifies the specific action. The individual items for each action- description, configuration, callback, harvest provide information about what to do with this action.
- description: describes the action
- configuration: callback to a function that returns a form array. Expects: $step
- callback: callback to a function that runs the actual action. Expects $step, $file
- delete callback: (optional) when a file is being deleted, this function will be called. Expects $step, $file
- update callback: (optional) update a file as it is being saved in the media mover process. Expects $step, $file
- load callback: (optional) callback to a function that can add data to a file when it is loaded. Expects $step, $file
- harvest: (optional) boolean, is this a harvesting action?
Technically, all of these items are optional, however, in a normal implementation, you will need description, configuration, and callback to integrate your function.
Post new comment