Aleksander Machniak
2015-11-16 8271597836eeb9b6f50062c1ce6d685cb61e0e72
Use ternary operator where applicable
31 files modified
157 ■■■■ changed files
program/steps/addressbook/copy.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/delete.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/edit.inc 10 ●●●● patch | view | raw | blame | history
program/steps/addressbook/func.inc 12 ●●●● patch | view | raw | blame | history
program/steps/addressbook/groups.inc 12 ●●●● patch | view | raw | blame | history
program/steps/addressbook/import.inc 4 ●●●● patch | view | raw | blame | history
program/steps/addressbook/list.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/move.inc 6 ●●●● patch | view | raw | blame | history
program/steps/addressbook/print.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/save.inc 8 ●●●● patch | view | raw | blame | history
program/steps/addressbook/search.inc 8 ●●●● patch | view | raw | blame | history
program/steps/addressbook/show.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/undo.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/addcontact.inc 4 ●●●● patch | view | raw | blame | history
program/steps/mail/compose.inc 6 ●●●● patch | view | raw | blame | history
program/steps/mail/func.inc 8 ●●●● patch | view | raw | blame | history
program/steps/mail/get.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/list_contacts.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/mark.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/search_contacts.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/sendmail.inc 6 ●●●● patch | view | raw | blame | history
program/steps/mail/show.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/viewsource.inc 4 ●●●● patch | view | raw | blame | history
program/steps/settings/about.inc 6 ●●●● patch | view | raw | blame | history
program/steps/settings/edit_folder.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/edit_identity.inc 13 ●●●●● patch | view | raw | blame | history
program/steps/settings/func.inc 12 ●●●● patch | view | raw | blame | history
program/steps/settings/identities.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/save_folder.inc 4 ●●●● patch | view | raw | blame | history
program/steps/settings/save_identity.inc 6 ●●●● patch | view | raw | blame | history
program/steps/settings/save_prefs.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/copy.inc
@@ -115,7 +115,7 @@
            $success = $plugin['result'];
        }
        $errormsg = $plugin['message'] ? $plugin['message'] : 'copyerror';
        $errormsg = $plugin['message'] ?: 'copyerror';
    }
}
program/steps/addressbook/delete.inc
@@ -143,7 +143,7 @@
// 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)) {
program/steps/addressbook/edit.inc
@@ -104,7 +104,7 @@
    // 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 @@
    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 @@
            '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);
    }
program/steps/addressbook/func.inc
@@ -234,7 +234,7 @@
        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 @@
            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 @@
        $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 @@
        $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 @@
                        }
                    }
                    else {
                        $values = $record[$fullkey] ? $record[$fullkey] : $record[$field];
                        $values   = $record[$fullkey] ?: $record[$field];
                        $subtypes = null;
                    }
                }
@@ -687,7 +687,7 @@
                        $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 = '';
program/steps/addressbook/groups.inc
@@ -53,9 +53,9 @@
        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 @@
            $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 @@
        $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 @@
            '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 @@
        $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');
    }
}
program/steps/addressbook/import.inc
@@ -136,7 +136,7 @@
                }
                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 @@
                }
                $IMPORT_STATS->inserted++;
                $IMPORT_STATS->names[] = $a_record['name'] ? $a_record['name'] : $email;
                $IMPORT_STATS->names[] = $a_record['name'] ?: $email;
            }
            else {
                $IMPORT_STATS->errors++;
program/steps/addressbook/list.inc
@@ -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;
program/steps/addressbook/move.inc
@@ -33,7 +33,7 @@
$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 @@
            $success = $plugin['result'];
        }
        $errormsg = $plugin['message'] ? $plugin['message'] : 'moveerror';
        $errormsg = $plugin['message'] ?: 'moveerror';
    }
}
@@ -197,7 +197,7 @@
    // 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)) {
program/steps/addressbook/print.inc
@@ -83,7 +83,7 @@
        return false;
    }
    $i_size = !empty($attrib['size']) ? $attrib['size'] : 40;
    $i_size = $attrib['size'] ?: 40;
    $form = array(
        'contact' => array(
program/steps/addressbook/save.inc
@@ -124,7 +124,7 @@
    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 @@
        // 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 @@
    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 {
        // 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');
    }
}
program/steps/addressbook/search.inc
@@ -49,7 +49,7 @@
        $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 @@
        $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 @@
{
    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 @@
        {
            $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')
program/steps/addressbook/show.inc
@@ -94,7 +94,7 @@
        return false;
    }
    $i_size = !empty($attrib['size']) ? $attrib['size'] : 40;
    $i_size = $attrib['size'] ?: 40;
    $form = array(
        'contact' => array(
program/steps/addressbook/undo.inc
@@ -36,7 +36,7 @@
    $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();
    }
program/steps/mail/addcontact.inc
@@ -63,7 +63,7 @@
            // 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 (!$done) {
    $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsavingcontact', 'error');
    $OUTPUT->show_message($plugin['message'] ?: 'errorsavingcontact', 'error');
}
$OUTPUT->send();
program/steps/mail/compose.inc
@@ -1826,8 +1826,8 @@
        $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 @@
            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']);
program/steps/mail/func.inc
@@ -168,7 +168,7 @@
    // 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 @@
    // 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 @@
                    $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 @@
            }
            else {
                $address = html::span(array('title' => $mailto, 'class' => "rcmContactAddress"),
                    rcube::Q($name ? $name : $mailto));
                    rcube::Q($name ?: $mailto));
            }
            if ($addicon && $_SESSION['writeable_abook']) {
program/steps/mail/get.inc
@@ -232,7 +232,7 @@
        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");
program/steps/mail/list_contacts.inc
@@ -110,7 +110,7 @@
            $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);
        }
program/steps/mail/mark.inc
@@ -40,7 +40,7 @@
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
program/steps/mail/search_contacts.inc
@@ -87,7 +87,7 @@
            $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');
        }
program/steps/mail/sendmail.inc
@@ -234,7 +234,7 @@
// 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 @@
        }
        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 @@
            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'];
program/steps/mail/show.inc
@@ -346,7 +346,7 @@
    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(
program/steps/mail/viewsource.inc
@@ -24,13 +24,13 @@
// 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)
program/steps/settings/about.inc
@@ -35,7 +35,7 @@
    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 @@
    $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']);
program/steps/settings/edit_folder.inc
@@ -306,7 +306,7 @@
        $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']);
program/steps/settings/edit_identity.inc
@@ -73,9 +73,9 @@
    // 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 @@
            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);
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);
program/steps/settings/identities.inc
@@ -32,7 +32,7 @@
            $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);
        }
    }
program/steps/settings/save_folder.inc
@@ -132,7 +132,7 @@
    }
    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 {
        // show error message
        $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
        $OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error', null, false);
    }
}
program/steps/settings/save_identity.inc
@@ -135,7 +135,7 @@
    }
    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 {
        // 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 @@
            $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 .= '" ';
        }
program/steps/settings/save_prefs.inc
@@ -215,7 +215,7 @@
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');