• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

modules/translation/views_handler_field_node_link_translate.inc

00001 <?php
00007 class views_handler_field_node_link_translate extends views_handler_field_node_link {
00008   function render_link($data, $values) {
00009     // ensure user has access to edit this node.
00010     $node = $this->get_value($values);
00011     $node->status = 1; // unpublished nodes ignore access control
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 }

Generated on Sun Feb 26 2012 12:52:51 for Views by  doxygen 1.7.1