class fasttoggle_views_handler_field_comment_link in Fasttoggle 6
Hierarchy
- class \fasttoggle_views_handler_field_comment_link extends \views_handler_field_comment_link
Expanded class hierarchy of fasttoggle_views_handler_field_comment_link
1 string reference to 'fasttoggle_views_handler_field_comment_link'
- fasttoggle_views_data_alter in views/
fasttoggle.views.inc - Implementation of hook_views_data_alter()
File
- views/
fasttoggle_views_handler_field_comment_link.inc, line 3
View source
class fasttoggle_views_handler_field_comment_link extends views_handler_field_comment_link {
var $fasttoggle_key = 'status';
function construct() {
parent::construct();
// We need these fields for state checking later in the render() function.
$this->additional_fields['cid'] = 'cid';
$this->additional_fields['status'] = 'status';
}
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
unset($form['text']);
}
function render($values) {
$options = fasttoggle_get_options('comment', NULL);
$key = $this->fasttoggle_key;
if (!empty($options[$key])) {
$status = $values->{$this->aliases['status']};
$cid = $values->{$this->aliases['cid']};
return fasttoggle($options['status'][$key]['label'][intval($status)], 'comment/' . $cid . '/toggle/status/' . $key, FASTTOGGLE_FORMAT_HTML, 'status_' . $key . '_' . $cid, 'fasttoggle-status-comment-status-' . $key . '-' . intval($status));
}
}
}