Update Item.php
This commit is contained in:
parent
08d7cdf95b
commit
a93fb49875
1 changed files with 3 additions and 10 deletions
13
app/Item.php
13
app/Item.php
|
@ -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 . '"';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue