function rate_embed in Rate 7
Get the widget code to embed.
Parameters
object $node:
string $machine_name:
int $mode:
File
- ./
rate.module, line 793 - Rate module
Code
function rate_embed(&$node, $machine_name, $mode = RATE_FULL) {
// Adding the form to the node view
$widgets = rate_get_active_widgets('node', $node->type, 'full');
foreach ($widgets as $widget_id => $widget) {
if ($widget->name != $machine_name) {
continue;
}
return rate_generate_widget($widget_id, 'node', $node->nid, $mode);
}
return FALSE;
}