accessibility_handler_edit_link_field.inc

  1. cis7 sites/all/modules/ulmus/accessibility/views/accessibility_handler_edit_link_field.inc
  2. cle7 sites/all/modules/ulmus/accessibility/views/accessibility_handler_edit_link_field.inc
  3. ecd7 sites/all/modules/ulmus/accessibility/views/accessibility_handler_edit_link_field.inc
  4. elmsmedia7 sites/all/modules/ulmus/accessibility/views/accessibility_handler_edit_link_field.inc
  5. harmony7 sites/all/modules/ulmus/accessibility/views/accessibility_handler_edit_link_field.inc
  6. icor7 sites/all/modules/ulmus/accessibility/views/accessibility_handler_edit_link_field.inc
  7. meedjum_blog7 sites/all/modules/ulmus/accessibility/views/accessibility_handler_edit_link_field.inc
  8. mooc7 sites/all/modules/ulmus/accessibility/views/accessibility_handler_edit_link_field.inc

Contains a Views field handler to take care of displaying edit links as fields

Classes

File

sites/all/modules/ulmus/accessibility/views/accessibility_handler_edit_link_field.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Contains a Views field handler to take care of displaying edit links
  5. * as fields
  6. */
  7. class accessibility_handler_edit_link_field extends accessibility_handler_link_field {
  8. function construct() {
  9. parent::construct();
  10. $this->additional_fields['test_id'] = 'test_id';
  11. }
  12. function render($values) {
  13. $type = $values->{$this->aliases['test_id']};
  14. //Creating a dummy accessibility to check access against
  15. $dummy_accessibility = (object) array('type' => $type);
  16. if (!accessibility_test_access('edit', $dummy_accessibility)) {
  17. return;
  18. }
  19. $text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
  20. $accessibility_id = $values->{$this->aliases['test_id']};
  21. return l($text, 'accessibility-test/' . $accessibility_id . '/edit');
  22. }
  23. }