Commit dddd0542 authored by Tino Goratsch's avatar Tino Goratsch

remove useless condition

parent 75e30c56
......@@ -365,21 +365,19 @@ class Index extends Core\Modules\AdminController
protected function fetchNewsOptions(array $settings, $readmoreValue, $commentsValue)
{
$options = [];
if ($settings['readmore'] == 1 || ($settings['comments'] == 1 && $this->modules->isActive('comments') === true)) {
if ($settings['readmore'] == 1) {
$options[] = [
'name' => 'readmore',
'checked' => $this->get('core.helpers.forms')->selectEntry('readmore', '1', $readmoreValue, 'checked'),
'lang' => $this->lang->t('news', 'activate_readmore')
];
}
if ($settings['comments'] == 1 && $this->modules->isActive('comments') === true) {
$options[] = [
'name' => 'comments',
'checked' => $this->get('core.helpers.forms')->selectEntry('comments', '1', $commentsValue, 'checked'),
'lang' => $this->lang->t('system', 'allow_comments')
];
}
if ($settings['readmore'] == 1) {
$options[] = [
'name' => 'readmore',
'checked' => $this->get('core.helpers.forms')->selectEntry('readmore', '1', $readmoreValue, 'checked'),
'lang' => $this->lang->t('news', 'activate_readmore')
];
}
if ($settings['comments'] == 1 && $this->modules->isActive('comments') === true) {
$options[] = [
'name' => 'comments',
'checked' => $this->get('core.helpers.forms')->selectEntry('comments', '1', $commentsValue, 'checked'),
'lang' => $this->lang->t('system', 'allow_comments')
];
}
return $options;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment