signup_handler_field_signup_edit_link.inc in Signup 6
File
views/handlers/signup_handler_field_signup_edit_link.inc
View source
<?php
class signup_handler_field_signup_edit_link extends views_handler_field_node_link {
function construct() {
parent::construct();
$this->additional_fields['sid'] = array(
'table' => 'signup_log',
'field' => 'sid',
);
$this->additional_fields['uid'] = array(
'table' => 'signup_log',
'field' => 'uid',
);
}
function render($values) {
global $user;
$signup = new StdClass();
$signup->sid = $values->{$this->aliases['sid']};
$signup->nid = $values->{$this->aliases['nid']};
$signup->uid = $values->{$this->aliases['uid']};
if (!_signup_menu_signup_access($signup, 'edit')) {
return;
}
$text = !empty($this->options['text']) ? $this->options['text'] : t('Edit signup');
$url = "signup/edit/{$signup->sid}";
$link_options['query'] = drupal_get_destination();
return l($text, $url, $link_options);
}
}