示例#1
0
 /**
  * Prepares link to the node revision.
  *
  * @param string $data
  *   The XSS safe string for the link text.
  * @param \Drupal\views\ResultRow $values
  *   The values retrieved from a single row of a view's query result.
  *
  * @return string
  *   Returns a string for the link text.
  */
 protected function renderLink($data, ResultRow $values)
 {
     if (!empty($this->options['link_to_node_revision']) && $data !== NULL && $data !== '') {
         $this->options['alter']['make_link'] = TRUE;
         $nid = $this->getValue($values, 'nid');
         $vid = $this->getValue($values, 'vid');
         $this->options['alter']['url'] = Url::fromRoute('node.revision_show', ['node' => $nid, 'node_revision' => $vid]);
     } else {
         return parent::renderLink($data, $values);
     }
     return $data;
 }
示例#2
0
 /**
  * Prepares link to the node revision.
  *
  * @param string $data
  *   The XSS safe string for the link text.
  * @param \Drupal\views\ResultRow $values
  *   The values retrieved from a single row of a view's query result.
  *
  * @return string
  *   Returns a string for the link text.
  */
 protected function renderLink($data, ResultRow $values)
 {
     if (!empty($this->options['link_to_node_revision']) && $data !== NULL && $data !== '') {
         $this->options['alter']['make_link'] = TRUE;
         $nid = $this->getValue($values, 'nid');
         $vid = $this->getValue($values, 'vid');
         $this->options['alter']['path'] = "node/" . $nid . '/revisions/' . $vid . '/view';
     } else {
         return parent::renderLink($data, $values);
     }
     return $data;
 }