'checkbox', '#title' => t('Add a destination parameter to contextual / operation links so users return to this View on form submission.'), '#default_value' => $this->options['add_destination'], ); } function render($values) { if ($entity = $this->get_value($values)) { return $this->render_link($entity); } } function render_link($bean) { if (entity_access('update', 'bean', $bean)) { // Get the operations links. $links = menu_contextual_links('bean', 'block', array($bean->delta)); if (!empty($links)) { // Add the destination to the links if specified. if ($this->options['add_destination']) { foreach ($links as $id => &$link) { $link['query'] = drupal_get_destination(); } } return theme('links', array('links' => $links, 'attributes' => array('class' => array('links', 'inline', 'operations')))); } } } }