00001 <?php
00007 class views_handler_field_node_link_translate extends views_handler_field_node_link {
00008 function render_link($data, $values) {
00009
00010 $node = $this->get_value($values);
00011 $node->status = 1;
00012 if (empty($node->language) || !translation_supported_type($node->type) || !node_access('view', $node) || !user_access('translate content')) {
00013 return;
00014 }
00015
00016 $this->options['alter']['make_link'] = TRUE;
00017 $this->options['alter']['path'] = "node/$node->nid/translate";
00018 $this->options['alter']['query'] = drupal_get_destination();
00019
00020 $text = !empty($this->options['text']) ? $this->options['text'] : t('translate');
00021 return $text;
00022 }
00023 }