views_handler_field_heartbeat_buttons.inc in Heartbeat 7
File
views/views_handler_field_heartbeat_buttons.inc
View source
<?php
class views_handler_field_heartbeat_buttons extends views_handler_field {
function construct() {
parent::construct();
drupal_add_js(drupal_get_path('module', 'heartbeat') . '/js/heartbeat.js');
if (variable_get('heartbeat_include_default_style', 1)) {
drupal_add_css(drupal_get_path('module', 'heartbeat') . '/css/heartbeat.css');
}
$this->additional_fields['uaid'] = 'uaid';
}
function render($values) {
$uaid = $this
->get_value($values, 'uaid');
$heartbeatActivity = heartbeat_activity_load($uaid);
return $this
->render_buttons($heartbeatActivity);
}
function render_buttons($heartbeatActivity) {
return theme('heartbeat_buttons', array(
'heartbeat_activity' => $heartbeatActivity,
));
}
}