Update Item.php

This commit is contained in:
ullbergm 2018-06-07 17:35:01 -04:00 committed by GitHub
parent 08d7cdf95b
commit a93fb49875
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,18 +165,11 @@ class Item extends Model
public function getLinkTargetAttribute()
{
if((int)$this->type === 1) {
$target = Setting::fetch('window_target');
if((int)$this->type === 1 || $target === 'current') {
return '';
} else {
$settings = Setting::all();
foreach($settings as $key => $val) {
if($val['key'] === 'window_target') {
$target = $val['value'];
if($target === 'current') {
$target = '';
}
}
}
return ' target="' . $target . '"';
}
}