Completed
Pull Request — master (#421)
by Michael
1349:23 queued 1346:09
created

FrontendLink   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateItemEditForm() 0 10 2
1
<?php
2
3
class FrontendLink extends DataExtension {
4
5
	public function updateItemEditForm($form) {
6
		if ($this->owner->record->hasMethod('Link')) {
7
			$link = sprintf(
8
				'<a style="margin: 0.5em" target="deploynaut-frontend" href="%s">Preview &raquo;</a>',
9
				$this->owner->record->Link()
10
			);
11
			$actions = $form->Actions();
12
			$actions->push(LiteralField::create('FrontendLink', $link));
13
		}
14
	}
15
16
}
17
18