| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function getColumnContent($gridField, $record, $columnName) |
||
| 12 | { |
||
| 13 | if (!$record->canDelete()) { |
||
| 14 | return; |
||
| 15 | } |
||
| 16 | |||
| 17 | if (!$record instanceof ElementVirtual) { |
||
| 18 | $field = GridField_FormAction::create( |
||
| 19 | $gridField, |
||
| 20 | 'UnlinkRelation' . $record->ID, |
||
| 21 | false, |
||
| 22 | 'unlinkrelation', |
||
| 23 | ['RecordID' => $record->ID] |
||
| 24 | ) |
||
| 25 | ->addExtraClass('gridfield-button-unlink') |
||
| 26 | ->setAttribute('title', _t(__CLASS__ . '.UnlinkRelation', 'Unlink')) |
||
| 27 | ->setAttribute('data-icon', 'chain--minus'); |
||
| 28 | |||
| 29 | return $field->Field(); |
||
| 30 | } |
||
| 33 |