Use ternary operator where applicable

pull/307/merge
Aleksander Machniak 9 years ago
parent 648963afda
commit 8271597836

@ -115,7 +115,7 @@ foreach ($cids as $source => $cid) {
$success = $plugin['result'];
}
$errormsg = $plugin['message'] ? $plugin['message'] : 'copyerror';
$errormsg = $plugin['message'] ?: 'copyerror';
}
}

@ -143,7 +143,7 @@ else {
// update message count display
$OUTPUT->set_env('pagecount', ceil($result->count / $PAGE_SIZE));
$OUTPUT->command('set_rowcount', $rowcount ? $rowcount : rcmail_get_rowcount_text($result));
$OUTPUT->command('set_rowcount', $rowcount ?: rcmail_get_rowcount_text($result));
// add new rows from next page (if any)
if (!empty($records)) {

@ -104,7 +104,7 @@ function rcmail_contact_edithead($attrib)
// check if we have a valid result
$record = rcmail_get_edit_record();
$i_size = !empty($attrib['size']) ? $attrib['size'] : 20;
$i_size = $attrib['size'] ?: 20;
$form = array(
'head' => array(
@ -143,9 +143,9 @@ function rcmail_contact_editform($attrib)
if (preg_match_all('/\{([a-z0-9]+)\}([^{]*)/i', $RCMAIL->config->get('address_template', ''), $templ, PREG_SET_ORDER))
$RCMAIL->output->set_env('address_template', $templ);
$i_size = !empty($attrib['size']) ? $attrib['size'] : 40;
$t_rows = !empty($attrib['textarearows']) ? $attrib['textarearows'] : 10;
$t_cols = !empty($attrib['textareacols']) ? $attrib['textareacols'] : 40;
$i_size = $attrib['size'] ?: 40;
$t_rows = $attrib['textarearows'] ?: 10;
$t_cols = $attrib['textareacols'] ?: 40;
$form = array(
'contact' => array(
@ -270,7 +270,7 @@ function get_form_tags($attrib)
'noclose' => true) + $attrib, $hiddenfields->show());
$form_end = !strlen($attrib['form']) ? '</form>' : '';
$EDIT_FORM = !empty($attrib['form']) ? $attrib['form'] : 'form';
$EDIT_FORM = $attrib['form'] ?: 'form';
$RCMAIL->output->add_gui_object('editform', $EDIT_FORM);
}

@ -234,7 +234,7 @@ function rcmail_directory_list($attrib)
if ($source['class_name'])
$class_name .= ' ' . $source['class_name'];
$name = !empty($source['name']) ? $source['name'] : $id;
$name = $source['name'] ?: $id;
$out .= sprintf($line_templ,
rcube_utils::html_identifier($id, true),
$class_name,
@ -292,7 +292,7 @@ function rcmail_savedsearch_list($attrib)
rcube_utils::html_identifier('S'.$id, true),
join(' ', $classes),
$id,
$js_id, (!empty($source['name']) ? rcube::Q($source['name']) : rcube::Q($id))
$js_id, rcube::Q($source['name'] ?: $id)
);
}
@ -385,7 +385,7 @@ function rcmail_js_contacts_list($result, $prefix='')
$source_id = $OUTPUT->get_env('source');
$a_row_cols = array();
$classes = array($row['_type'] ? $row['_type'] : 'person');
$classes = array($row['_type'] ?: 'person');
// build contact ID with source ID
if (isset($row['sourceid'])) {
@ -485,7 +485,7 @@ function rcmail_get_rowcount_text($result=null)
$out = $RCMAIL->gettext('nocontactsfound');
else
$out = $RCMAIL->gettext(array(
'name' => $_SESSION['contactcountdisplay'] ? $_SESSION['contactcountdisplay'] : 'contactsfromto',
'name' => $_SESSION['contactcountdisplay'] ?: 'contactsfromto',
'vars' => array(
'from' => $result->first + 1,
'to' => min($result->count, $result->first + $PAGE_SIZE),
@ -660,7 +660,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
}
}
else {
$values = $record[$fullkey] ? $record[$fullkey] : $record[$field];
$values = $record[$fullkey] ?: $record[$field];
$subtypes = null;
}
}
@ -687,7 +687,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
$template = $RCMAIL->config->get($col . '_template', '{'.join('} {', array_keys($colprop['childs'])).'}');
foreach ($colprop['childs'] as $childcol => $cp) {
if (!empty($val) && is_array($val)) {
$childvalue = $val[$childcol] ? $val[$childcol] : $val[$j];
$childvalue = $val[$childcol] ?: $val[$j];
}
else {
$childvalue = '';

@ -53,9 +53,9 @@ if ($RCMAIL->action == 'group-addmembers') {
if ($result)
$OUTPUT->show_message('contactaddedtogroup');
else if ($plugin['abort'] || $CONTACTS->get_error())
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
$OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error');
else
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'nogroupassignmentschanged');
$OUTPUT->show_message($plugin['message'] ?: 'nogroupassignmentschanged');
}
}
else if ($RCMAIL->action == 'group-delmembers') {
@ -76,7 +76,7 @@ else if ($RCMAIL->action == 'group-delmembers') {
$OUTPUT->command('remove_group_contacts',array('source' => $source, 'gid' => $gid));
}
else {
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
$OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error');
}
}
}
@ -100,7 +100,7 @@ else if ($RCMAIL->action == 'group-create') {
$OUTPUT->command('insert_contact_group', array('source' => $source) + $created);
}
else if (!$created) {
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
$OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error');
}
}
else if ($RCMAIL->action == 'group-rename') {
@ -125,7 +125,7 @@ else if ($RCMAIL->action == 'group-rename') {
'source' => $source, 'id' => $gid, 'name' => rcube::Q($newname), 'newid' => $newgid));
}
else if (!$newname) {
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
$OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error');
}
}
else if ($RCMAIL->action == 'group-delete') {
@ -146,7 +146,7 @@ else if ($RCMAIL->action == 'group-delete') {
$OUTPUT->command('remove_group_item', array('source' => $source, 'id' => $gid));
}
else {
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
$OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error');
}
}

@ -136,7 +136,7 @@ if (is_array($_FILES['_file'])) {
}
if ($existing && $existing->count) {
$IMPORT_STATS->skipped++;
$IMPORT_STATS->skipped_names[] = $vcard->displayname ? $vcard->displayname : $email;
$IMPORT_STATS->skipped_names[] = $vcard->displayname ?: $email;
continue;
}
}
@ -164,7 +164,7 @@ if (is_array($_FILES['_file'])) {
}
$IMPORT_STATS->inserted++;
$IMPORT_STATS->names[] = $a_record['name'] ? $a_record['name'] : $email;
$IMPORT_STATS->names[] = $a_record['name'] ?: $email;
}
else {
$IMPORT_STATS->errors++;

@ -22,7 +22,7 @@
if (!empty($_GET['_page']))
$page = intval($_GET['_page']);
else
$page = !empty($_SESSION['page']) ? $_SESSION['page'] : 1;
$page = $_SESSION['page'] ?: 1;
$_SESSION['page'] = $page;

@ -33,7 +33,7 @@ $deleted = 0;
$success = 0;
$errormsg = 'moveerror';
$maxnum = $RCMAIL->config->get('max_group_members', 0);
$page = !empty($_SESSION['page']) ? $_SESSION['page'] : 1;
$page = $_SESSION['page'] ?: 1;
foreach ($cids as $source => $source_cids) {
// Something wrong, target not specified
@ -137,7 +137,7 @@ foreach ($cids as $source => $source_cids) {
$success = $plugin['result'];
}
$errormsg = $plugin['message'] ? $plugin['message'] : 'moveerror';
$errormsg = $plugin['message'] ?: 'moveerror';
}
}
@ -197,7 +197,7 @@ else {
// update message count display
$OUTPUT->set_env('pagecount', ceil($result->count / $PAGE_SIZE));
$OUTPUT->command('set_rowcount', $rowcount ? $rowcount : rcmail_get_rowcount_text($result));
$OUTPUT->command('set_rowcount', $rowcount ?: rcmail_get_rowcount_text($result));
// add new rows from next page (if any)
if (!empty($records)) {

@ -83,7 +83,7 @@ function rcmail_contact_details($attrib)
return false;
}
$i_size = !empty($attrib['size']) ? $attrib['size'] : 40;
$i_size = $attrib['size'] ?: 40;
$form = array(
'contact' => array(

@ -124,7 +124,7 @@ if (isset($a_record['photo'])) {
else if ($tempfile = $_SESSION['contacts']['files'][$a_record['photo']]) {
$tempfile = $RCMAIL->plugins->exec_hook('attachment_get', $tempfile);
if ($tempfile['status'])
$a_record['photo'] = $tempfile['data'] ? $tempfile['data'] : @file_get_contents($tempfile['path']);
$a_record['photo'] = $tempfile['data'] ?: @file_get_contents($tempfile['path']);
}
else
unset($a_record['photo']);
@ -166,7 +166,7 @@ if (!empty($cid)) {
// define list of cols to be displayed
$a_js_cols = array();
$record = $CONTACTS->get_record($newcid ? $newcid : $cid, true);
$record = $CONTACTS->get_record($newcid ?: $cid, true);
$record['email'] = reset($CONTACTS->get_col_values('email', $record, true));
$record['name'] = rcube_addressbook::compose_list_name($record);
@ -186,7 +186,7 @@ if (!empty($cid)) {
else {
// show error message
$err = $CONTACTS->get_error();
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : ($err['message'] ? $err['message'] : 'errorsaving'), 'error', null, false);
$OUTPUT->show_message($plugin['message'] ?: ($err['message'] ?: 'errorsaving'), 'error', null, false);
$RCMAIL->overwrite_action('show');
}
}
@ -249,7 +249,7 @@ else {
else {
// show error message
$err = $CONTACTS->get_error();
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : ($err['message'] ? $err['message'] : 'errorsaving'), 'error', null, false);
$OUTPUT->show_message($plugin['message'] ?: ($err['message'] ?: 'errorsaving'), 'error', null, false);
$RCMAIL->overwrite_action('add');
}
}

@ -49,7 +49,7 @@ if ($RCMAIL->action == 'search-create') {
$OUTPUT->command('insert_saved_search', rcube::Q($name), rcube::Q($result));
}
else
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'savedsearchcreateerror', 'error');
$OUTPUT->show_message($plugin['message'] ?: 'savedsearchcreateerror', 'error');
$OUTPUT->send();
}
@ -72,7 +72,7 @@ if ($RCMAIL->action == 'search-delete') {
$OUTPUT->set_env('pagecount', 0);
}
else
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'savedsearchdeleteerror', 'error');
$OUTPUT->show_message($plugin['message'] ?: 'savedsearchdeleteerror', 'error');
$OUTPUT->send();
}
@ -253,7 +253,7 @@ function rcmail_contact_search_form($attrib)
{
global $RCMAIL, $CONTACT_COLTYPES;
$i_size = !empty($attrib['size']) ? $attrib['size'] : 30;
$i_size = $attrib['size'] ?: 30;
$form = array(
'main' => array(
@ -298,7 +298,7 @@ function rcmail_contact_search_form($attrib)
{
$ftype = $colprop['type'] == 'select' ? 'select' : 'text';
$label = isset($colprop['label']) ? $colprop['label'] : $RCMAIL->gettext($col);
$category = $colprop['category'] ? $colprop['category'] : 'other';
$category = $colprop['category'] ?: 'other';
// load jquery UI datepicker for date fields
if ($colprop['type'] == 'date')

@ -94,7 +94,7 @@ function rcmail_contact_details($attrib)
return false;
}
$i_size = !empty($attrib['size']) ? $attrib['size'] : 40;
$i_size = $attrib['size'] ?: 40;
$form = array(
'contact' => array(

@ -36,7 +36,7 @@ foreach ((array)$undo['data'] as $source => $cid) {
$restored = !$plugin['abort'] ? $CONTACTS->undelete($cid) : $plugin['result'];
if (!$restored) {
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'contactrestoreerror', 'error');
$OUTPUT->show_message($plugin['message'] ?: 'contactrestoreerror', 'error');
$OUTPUT->command('list_contacts');
$OUTPUT->send();
}

@ -63,7 +63,7 @@ if (!empty($_POST['_address']) && is_object($CONTACTS)) {
// TODO: show dialog to complete record
// if ($error['type'] == rcube_addressbook::ERROR_VALIDATE) { }
$OUTPUT->show_message($error['message'] ? $error['message'] : 'errorsavingcontact', 'error');
$OUTPUT->show_message($error['message'] ?: 'errorsavingcontact', 'error');
$OUTPUT->send();
}
@ -87,7 +87,7 @@ if (!empty($_POST['_address']) && is_object($CONTACTS)) {
}
if (!$done) {
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsavingcontact', 'error');
$OUTPUT->show_message($plugin['message'] ?: 'errorsavingcontact', 'error');
}
$OUTPUT->send();

@ -1826,8 +1826,8 @@ function get_form_tags($attrib)
$form_start .= $hiddenfields->show();
}
$form_end = ($MESSAGE_FORM && !strlen($attrib['form'])) ? '</form>' : '';
$form_name = !empty($attrib['form']) ? $attrib['form'] : 'form';
$form_end = ($MESSAGE_FORM && !strlen($attrib['form'])) ? '</form>' : '';
$form_name = $attrib['form'] ?: 'form';
if (!$MESSAGE_FORM)
$RCMAIL->output->add_gui_object('messageform', $form_name);
@ -1864,7 +1864,7 @@ function rcmail_addressbook_list($attrib = array())
rcube_utils::html_identifier($id,true),
$class_name,
$source['id'],
$js_id, (!empty($source['name']) ? $source['name'] : $id));
$js_id, ($source['name'] ?: $id));
}
$OUTPUT->add_gui_object('addressbookslist', $attrib['id']);

@ -168,7 +168,7 @@ function rcmail_init_env()
// race condition and unintentional page overwrite in session
if ($RCMAIL->action == 'list' || $RCMAIL->action == 'getunread') {
if (!($page = intval($_GET['_page']))) {
$page = $_SESSION['page'] ? $_SESSION['page'] : 1;
$page = $_SESSION['page'] ?: 1;
}
$_SESSION['page'] = $page;
@ -179,7 +179,7 @@ function rcmail_init_env()
// set default sort col/order to session
if (!isset($_SESSION['sort_col'])) {
$_SESSION['sort_col'] = $message_sort_col ? $message_sort_col : '';
$_SESSION['sort_col'] = $message_sort_col ?: '';
}
if (!isset($_SESSION['sort_order'])) {
$_SESSION['sort_order'] = strtoupper($message_sort_order) == 'ASC' ? 'ASC' : 'DESC';
@ -1634,7 +1634,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
$content = rcube::Q($name ? sprintf('%s <%s>', $name, $mailto) : $mailto);
}
else {
$content = rcube::Q($name ? $name : $mailto);
$content = rcube::Q($name ?: $mailto);
$attrs['title'] = $mailto;
}
@ -1642,7 +1642,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
}
else {
$address = html::span(array('title' => $mailto, 'class' => "rcmContactAddress"),
rcube::Q($name ? $name : $mailto));
rcube::Q($name ?: $mailto));
}
if ($addicon && $_SESSION['writeable_abook']) {

@ -232,7 +232,7 @@ else if (strlen($part_id)) {
list($ctype_primary, $ctype_secondary) = explode('/', $mimetype);
if (!$plugin['download'] && $ctype_primary == 'text') {
header("Content-Type: text/$ctype_secondary; charset=" . ($part->charset ? $part->charset : RCUBE_CHARSET));
header("Content-Type: text/$ctype_secondary; charset=" . ($part->charset ?: RCUBE_CHARSET));
}
else {
header("Content-Type: $mimetype");

@ -110,7 +110,7 @@ else if (!empty($result) && $result->count > 0) {
$keyname = $row['_type'] == 'group' ? 'contactgroup' : 'contact';
$OUTPUT->command('add_contact_row', $row_id, array(
$keyname => html::a(array('title' => $email), rcube::Q($name ? $name : $email) .
$keyname => html::a(array('title' => $email), rcube::Q($name ?: $email) .
($name && count($emails) > 1 ? '&nbsp;' . html::span('email', rcube::Q($email)) : '')
)), $classname);
}

@ -40,7 +40,7 @@ $a_flags_map = array(
if (($_uids = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST))
&& ($flag = rcube_utils::get_input_value('_flag', rcube_utils::INPUT_POST))
) {
$flag = $a_flags_map[$flag] ? $a_flags_map[$flag] : strtoupper($flag);
$flag = $a_flags_map[$flag] ?: strtoupper($flag);
if ($flag == 'DELETED' && $skip_deleted && $_POST['_from'] != 'show') {
// count messages before changing anything

@ -87,7 +87,7 @@ if (!empty($result) && $result->count > 0) {
$row_id = $row['ID'].'-'.$i;
$jsresult[$row_id] = format_email_recipient($email, $name);
$OUTPUT->command('add_contact_row', $row_id, array(
'contact' => html::a(array('title' => $email), rcube::Q($name ? $name : $email) .
'contact' => html::a(array('title' => $email), rcube::Q($name ?: $email) .
($name && count($emails) > 1 ? '&nbsp;' . html::span('email', rcube::Q($email)) : '')
)), 'person');
}

@ -234,7 +234,7 @@ $data = $RCMAIL->plugins->exec_hook('message_outgoing_headers', array('headers'
// sending aborted by plugin
if ($data['abort'] && !$savedraft) {
$OUTPUT->show_message($data['message'] ? $data['message'] : 'sendingfailed');
$OUTPUT->show_message($data['message'] ?: 'sendingfailed');
$OUTPUT->send('iframe');
}
else {
@ -455,7 +455,7 @@ if (is_array($COMPOSE['attachments'])) {
}
else {
$ctype = str_replace('image/pjpeg', 'image/jpeg', $attachment['mimetype']); // #1484914
$file = $attachment['data'] ? $attachment['data'] : $attachment['path'];
$file = $attachment['data'] ?: $attachment['path'];
$folding = (int) $RCMAIL->config->get('mime_param_folding');
$MAIL_MIME->addAttachment($file,
@ -673,7 +673,7 @@ if ($savedraft) {
array('msgid' => $message_id, 'uid' => $saved, 'folder' => $store_target));
// display success
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'messagesaved', 'confirmation');
$OUTPUT->show_message($plugin['message'] ?: 'messagesaved', 'confirmation');
// update "_draft_saveid" and the "cmp_hash" to prevent "Unsaved changes" warning
$COMPOSE['param']['draft_uid'] = $plugin['uid'];

@ -346,7 +346,7 @@ function rcmail_message_contactphoto($attrib)
global $RCMAIL, $MESSAGE;
$placeholder = $attrib['placeholder'] ? $RCMAIL->output->abs_url($attrib['placeholder'], true) : null;
$placeholder = $RCMAIL->output->asset_url($placeholder ? $placeholder : 'program/resources/blank.gif');
$placeholder = $RCMAIL->output->asset_url($placeholder ?: 'program/resources/blank.gif');
if ($MESSAGE->sender) {
$photo_img = $RCMAIL->url(array(

@ -24,13 +24,13 @@ ob_end_clean();
// similar code as in program/steps/mail/get.inc
if ($uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET)) {
$headers = $RCMAIL->storage->get_message_headers($uid);
$charset = $headers->charset ? $headers->charset : $RCMAIL->config->get('default_charset');
$charset = $headers->charset ?: $RCMAIL->config->get('default_charset');
header("Content-Type: text/plain; charset={$charset}");
if (!empty($_GET['_save'])) {
$subject = rcube_mime::decode_header($headers->subject, $headers->charset);
$filename = ($subject ? $subject : $RCMAIL->config->get('product_name', 'email')) . '.eml';
$filename = ($subject ?: $RCMAIL->config->get('product_name', 'email')) . '.eml';
$browser = $RCMAIL->output->browser;
if ($browser->ie)

@ -35,7 +35,7 @@ function rcmail_supportlink($attrib)
global $RCMAIL;
if ($url = $RCMAIL->config->get('support_url')) {
$label = $attrib['label'] ? $attrib['label'] : 'support';
$label = $attrib['label'] ?: 'support';
$attrib['href'] = $url;
return html::a($attrib, $RCMAIL->gettext($label));
@ -85,13 +85,13 @@ function rcmail_plugins_list($attrib)
$table->add_header('source', $RCMAIL->gettext('source'));
foreach ($plugin_info as $name => $data) {
$uri = $data['src_uri'] ? $data['src_uri'] : $data['uri'];
$uri = $data['src_uri'] ?: $data['uri'];
if ($uri && stripos($uri, 'http') !== 0) {
$uri = 'http://' . $uri;
}
$table->add_row();
$table->add('name', rcube::Q($data['name'] ? $data['name'] : $name));
$table->add('name', rcube::Q($data['name'] ?: $name));
$table->add('version', rcube::Q($data['version']));
$table->add('license', $data['license_uri'] ? html::a(array('target' => '_blank', href=> rcube::Q($data['license_uri'])),
rcube::Q($data['license'])) : $data['license']);

@ -306,7 +306,7 @@ function rcmail_get_form_part($form, $attrib = array())
$table = new html_table(array('cols' => 2));
foreach ($form['content'] as $col => $colprop) {
$colprop['id'] = '_'.$col;
$label = !empty($colprop['label']) ? $colprop['label'] : $RCMAIL->gettext($col);
$label = $colprop['label'] ?: $RCMAIL->gettext($col);
$table->add('title', html::label($colprop['id'], rcube::Q($label)));
$table->add(null, $colprop['value']);

@ -73,9 +73,9 @@ function rcube_identity_form($attrib)
// add some labels to client
$OUTPUT->add_label('noemailwarning', 'converting', 'editorwarning');
$i_size = !empty($attrib['size']) ? $attrib['size'] : 40;
$t_rows = !empty($attrib['textarearows']) ? $attrib['textarearows'] : 6;
$t_cols = !empty($attrib['textareacols']) ? $attrib['textareacols'] : 40;
$i_size = $attrib['size'] ?: 40;
$t_rows = $attrib['textarearows'] ?: 6;
$t_cols = $attrib['textareacols'] ?: 40;
// list of available cols
$form = array(
@ -159,11 +159,8 @@ function rcube_identity_form($attrib)
foreach ($fieldset['content'] as $col => $colprop) {
$colprop['id'] = 'rcmfd_'.$col;
$label = !empty($colprop['label']) ? $colprop['label'] :
$RCMAIL->gettext(str_replace('-', '', $col));
$value = !empty($colprop['value']) ? $colprop['value'] :
rcube_output::get_edit_field($col, $IDENTITY_RECORD[$col], $colprop, $colprop['type']);
$label = $colprop['label'] ?: $RCMAIL->gettext(str_replace('-', '', $col));
$value = $colprop['value'] ?: rcube_output::get_edit_field($col, $IDENTITY_RECORD[$col], $colprop, $colprop['type']);
$table->add('title', html::label($colprop['id'], rcube::Q($label)));
$table->add(null, $value);

@ -500,11 +500,11 @@ function rcmail_user_prefs($current = null)
$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 @@ function rcmail_user_prefs($current = null)
$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 @@ function rcmail_settings_tabs($attrib)
$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);

@ -32,7 +32,7 @@ if ($RCMAIL->action == 'delete-identity' && $OUTPUT->ajax_call) {
$OUTPUT->command('remove_identity', $iid);
}
else {
$msg = $plugin['message'] ? $plugin['message'] : ($deleted < 0 ? 'nodeletelastidentity' : 'errorsaving');
$msg = $plugin['message'] ?: ($deleted < 0 ? 'nodeletelastidentity' : 'errorsaving');
$OUTPUT->show_message($msg, 'error', null, false);
}
}

@ -132,7 +132,7 @@ if (!$error && !strlen($old_imap)) {
}
else {
// show error message
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
$OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error', null, false);
}
}
// update a mailbox
@ -195,7 +195,7 @@ else if (!$error) {
}
else {
// show error message
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
$OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error', null, false);
}
}

@ -135,7 +135,7 @@ if ($_POST['_iid']) {
}
else {
// show error message
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
$OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error', null, false);
$RCMAIL->overwrite_action('edit-identity');
return;
}
@ -177,7 +177,7 @@ else if (IDENTITIES_LEVEL < 2) {
}
else {
// show error message
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
$OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error', null, false);
$RCMAIL->overwrite_action('edit-identity');
return;
}
@ -218,7 +218,7 @@ function rcmail_attach_images($html)
$file = $RCMAIL->plugins->exec_hook('attachment_get', $file);
$data_uri .= 'src="data:' . $file['mimetype'] . ';base64,';
$data_uri .= base64_encode($file['data'] ? $file['data'] : file_get_contents($file['path']));
$data_uri .= base64_encode($file['data'] ?: file_get_contents($file['path']));
$data_uri .= '" ';
}

@ -215,7 +215,7 @@ else
if ($saved)
$OUTPUT->show_message('successfullysaved', 'confirmation');
else
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error');
$OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error');
// display the form again
$RCMAIL->overwrite_action('edit-prefs');

Loading…
Cancel
Save