'. t('Adds energy via the Radioactivity module to (un)flagged content.'). '

'; break; } return $output; } /** * Implementation of hook_radioactivity_info(). */ function radioactivity_flag_radioactivity_info() { $info = array('sources' => array()); foreach (flag_get_types() as $type) { $info['sources'][$type] = array(); foreach (flag_get_flags($type) as $flag) { $info['sources'][$type][$flag->name] = array( 'title_placeholder' => t('Flag @type as @name', array( '@type' => $type, '@name' => $flag->title, )), ); $info['sources'][$type]['un '. $flag->name] = array( 'title_placeholder' => t('Unflag @type as @name', array( '@type' => $type, '@name' => $flag->title, )), ); } } return $info; } /** * Implementation of hook_flag(). */ function radioactivity_flag_flag($event, $flag, $content_id, $account) { module_load_include('inc', 'radioactivity'); if ($event == 'flag') { radioactivity_add_energy($content_id, $flag->content_type, $flag->name); } elseif ($event == 'unflag') { radioactivity_add_energy($content_id, $flag->content_type, 'un '. $flag->name); } }