Completed
Pull Request — master (#421)
by Michael
1346:13 queued 1341:51
created

FrontendLink::updateItemEditForm()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
eloc 7
nc 2
nop 1
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