Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Showing "deactivated" on deactivated URLs instead of delete link.

  • Loading branch information...
commit c35e0edd322bb40e034cf7efe0846cb9b3539e91 1 parent afa3715
@jjeff jjeff authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 views/shurly_handler_field_shurly_link_delete.inc
View
5 views/shurly_handler_field_shurly_link_delete.inc
@@ -12,6 +12,7 @@ class shurly_handler_field_shurly_link_delete extends views_handler_field {
function construct() {
parent::construct();
$this->additional_fields['uid'] = 'uid';
+ $this->additional_fields['active'] = 'active';
}
function option_definition() {
@@ -37,6 +38,10 @@ class shurly_handler_field_shurly_link_delete extends views_handler_field {
function render($values) {
global $user;
$uid = $values->{$this->aliases['uid']};
+ $active = $values->{$this->aliases['active']};
+ if (!$active) {
+ return t('deactivated');
+ }
// only allow the user to view the link if they can actually delete
if (user_access('Administer short URLs') || (user_access('Delete own URLs') && $uid == $user->uid)) {
$text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
Please sign in to comment.
Something went wrong with that request. Please try again.