Skip to content

Commit 407e581

Browse files
Merge pull request #1 from evanshunt/link-method
♻️ (model) uses link method rather than manually building link
2 parents dc3067b + 9340118 commit 407e581

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/FrontEndEditLink.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@
1111

1212
class FrontEndEditLink extends DataExtension
1313
{
14-
15-
public function EditLink(){
16-
14+
public function EditLink()
15+
{
1716
if ($member = Security::getCurrentUser()) {
18-
return DBField::create_field('HTMLFragment',"<a href='admin/pages/edit/show/".$this->owner->ID."/' style='
19-
position: fixed;
20-
z-index: 1000;
21-
bottom: 0;
22-
left: 0;
23-
background: #f90;
24-
padding: 0 3px;
25-
font-size: 12px;
26-
color: #fff;
27-
' target='_blank' rel='nofollow'>Edit</a>");
17+
return DBField::create_field(
18+
'HTMLFragment', "<a href='". $this->owner->CMSEditLink() . "/' style='
19+
position: fixed;
20+
z-index: 1000;
21+
bottom: 0;
22+
left: 0;
23+
background: #f90;
24+
padding: 0 3px;
25+
font-size: 12px;
26+
color: #fff;
27+
' target='_blank' rel='nofollow'>Edit</a>"
28+
);
2829
}
2930

3031
return NULL;
3132
}
32-
3333
}

0 commit comments

Comments
 (0)