views_handler_field_replicate_ui_link.inc

  1. cis7 sites/all/modules/elmsln_contrib/replicate_ui/views/views_handler_field_replicate_ui_link.inc
  2. cle7 sites/all/modules/elmsln_contrib/replicate_ui/views/views_handler_field_replicate_ui_link.inc
  3. ecd7 sites/all/modules/elmsln_contrib/replicate_ui/views/views_handler_field_replicate_ui_link.inc
  4. elmsmedia7 sites/all/modules/elmsln_contrib/replicate_ui/views/views_handler_field_replicate_ui_link.inc
  5. harmony7 sites/all/modules/elmsln_contrib/replicate_ui/views/views_handler_field_replicate_ui_link.inc
  6. icor7 sites/all/modules/elmsln_contrib/replicate_ui/views/views_handler_field_replicate_ui_link.inc
  7. meedjum_blog7 sites/all/modules/elmsln_contrib/replicate_ui/views/views_handler_field_replicate_ui_link.inc
  8. mooc7 sites/all/modules/elmsln_contrib/replicate_ui/views/views_handler_field_replicate_ui_link.inc

Views display handler for adding a replicate link.

Classes

Namesort descending Description
views_handler_field_replicate_ui_link Field handler to present an replicate link.

File

sites/all/modules/elmsln_contrib/replicate_ui/views/views_handler_field_replicate_ui_link.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Views display handler for adding a replicate link.
  5. */
  6. /**
  7. * Field handler to present an replicate link.
  8. *
  9. * Closely modeled after:
  10. * - views/modules/node/views_handler_field_node_link_edit.inc
  11. */
  12. class views_handler_field_replicate_ui_link extends views_handler_field_node_link {
  13. /**
  14. * Renders the link if they have permission to view it
  15. */
  16. function render_link($entity, $values) {
  17. // capture the entity type in use
  18. $type = $this->entity_type;
  19. // ensure we can create this entity that is going to be replicated
  20. if (replicate_ui_access($type, $entity->{$this->base_field})) {
  21. $this->options['alter']['make_link'] = TRUE;
  22. $this->options['alter']['path'] = 'replicate/' . $type . '/' . $entity->{$this->base_field};
  23. $this->options['alter']['query'] = array('destination' => current_path());
  24. // output text as default or the option text
  25. $text = !empty($this->options['text']) ? $this->options['text'] : t('replicate');
  26. return $text;
  27. }
  28. }
  29. }
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.