function radioactivity_debug_add_energy_form_submit in Radioactivity 6
File
- plugins/
radioactivity_debug.module, line 112 - Debugging support for radioactivity
Code
function radioactivity_debug_add_energy_form_submit($form_id, $form) {
$radioactivity_info = radioactivity_get_radioactivity_info();
$form_values = $form['values'];
foreach ($radioactivity_info['targets'] as $oclass => $target_info) {
$oid = $form_values[$oclass]['id'];
if (!$oid) {
continue;
}
// no object id, don't execute actions
foreach ($form_values[$oclass]['actions'] as $source => $action_value) {
if ($action_value) {
$energy = print_r(radioactivity_get_energies_for_source($oid, $oclass, $source), TRUE);
drupal_set_message(t('Executing action %action for @oclass:@oid. This gives %energy energies to ' . 'different decay profiles.', array(
'%action' => $source,
'@oclass' => $oclass,
'@oid' => $oid,
'%energy' => $energy,
)));
radioactivity_add_energy($oid, $oclass, $source);
}
}
}
}