From 8271597836eeb9b6f50062c1ce6d685cb61e0e72 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Mon, 16 Nov 2015 03:11:47 -0500 Subject: [PATCH] Use ternary operator where applicable --- program/steps/settings/func.inc | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 3183f62..93e780b 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -500,11 +500,11 @@ $field_id = 'rcmfd_mail_pagesize'; $input = new html_inputfield(array('name' => '_mail_pagesize', 'id' => $field_id, 'size' => 5)); - $size = intval($config['mail_pagesize'] ? $config['mail_pagesize'] : $config['pagesize']); + $size = intval($config['mail_pagesize'] ?: $config['pagesize']); $blocks['main']['options']['pagesize'] = array( 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('pagesize'))), - 'content' => $input->show($size ? $size : 50), + 'content' => $input->show($size ?: 50), ); } @@ -1043,11 +1043,11 @@ $field_id = 'rcmfd_addressbook_pagesize'; $input = new html_inputfield(array('name' => '_addressbook_pagesize', 'id' => $field_id, 'size' => 5)); - $size = intval($config['addressbook_pagesize'] ? $config['addressbook_pagesize'] : $config['pagesize']); + $size = intval($config['addressbook_pagesize'] ?: $config['pagesize']); $blocks['main']['options']['pagesize'] = array( 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('pagesize'))), - 'content' => $input->show($size ? $size : 50), + 'content' => $input->show($size ?: 50), ); } @@ -1404,8 +1404,8 @@ $button = $OUTPUT->button($action); $attr = $attrib; - $cmd = $action['action'] ? $action['action'] : $action['command']; - $id = $action['id'] ? $action['id'] : $cmd; + $cmd = $action['action'] ?: $action['command']; + $id = $action['id'] ?: $cmd; if (!empty($id)) { $attr['id'] = preg_replace('/[^a-z0-9]/i', '', $attrib['idprefix'] . $id); -- Gitblit v1.9.1