Use ternary operator where applicable
| | |
| | | $success = $plugin['result']; |
| | | } |
| | | |
| | | $errormsg = $plugin['message'] ? $plugin['message'] : 'copyerror'; |
| | | $errormsg = $plugin['message'] ?: 'copyerror'; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | // 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)) { |
| | |
| | | |
| | | // 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( |
| | |
| | | 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( |
| | |
| | | '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); |
| | | } |
| | | |
| | |
| | | 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, |
| | |
| | | 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) |
| | | ); |
| | | } |
| | | |
| | |
| | | |
| | | $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'])) { |
| | |
| | | $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), |
| | |
| | | } |
| | | } |
| | | else { |
| | | $values = $record[$fullkey] ? $record[$fullkey] : $record[$field]; |
| | | $values = $record[$fullkey] ?: $record[$field]; |
| | | $subtypes = 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 = ''; |
| | |
| | | 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') { |
| | |
| | | $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'); |
| | | } |
| | | } |
| | | } |
| | |
| | | $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') { |
| | |
| | | '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') { |
| | |
| | | $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'); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | if ($existing && $existing->count) { |
| | | $IMPORT_STATS->skipped++; |
| | | $IMPORT_STATS->skipped_names[] = $vcard->displayname ? $vcard->displayname : $email; |
| | | $IMPORT_STATS->skipped_names[] = $vcard->displayname ?: $email; |
| | | continue; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | $IMPORT_STATS->inserted++; |
| | | $IMPORT_STATS->names[] = $a_record['name'] ? $a_record['name'] : $email; |
| | | $IMPORT_STATS->names[] = $a_record['name'] ?: $email; |
| | | } |
| | | else { |
| | | $IMPORT_STATS->errors++; |
| | |
| | | if (!empty($_GET['_page'])) |
| | | $page = intval($_GET['_page']); |
| | | else |
| | | $page = !empty($_SESSION['page']) ? $_SESSION['page'] : 1; |
| | | $page = $_SESSION['page'] ?: 1; |
| | | |
| | | $_SESSION['page'] = $page; |
| | | |
| | |
| | | $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 |
| | |
| | | $success = $plugin['result']; |
| | | } |
| | | |
| | | $errormsg = $plugin['message'] ? $plugin['message'] : 'moveerror'; |
| | | $errormsg = $plugin['message'] ?: 'moveerror'; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | // 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)) { |
| | |
| | | return false; |
| | | } |
| | | |
| | | $i_size = !empty($attrib['size']) ? $attrib['size'] : 40; |
| | | $i_size = $attrib['size'] ?: 40; |
| | | |
| | | $form = array( |
| | | 'contact' => array( |
| | |
| | | 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']); |
| | |
| | | |
| | | // 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); |
| | | |
| | |
| | | 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'); |
| | | } |
| | | } |
| | |
| | | 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'); |
| | | } |
| | | } |
| | |
| | | $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(); |
| | | } |
| | |
| | | $OUTPUT->set_env('pagecount', 0); |
| | | } |
| | | else |
| | | $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'savedsearchdeleteerror', 'error'); |
| | | $OUTPUT->show_message($plugin['message'] ?: 'savedsearchdeleteerror', 'error'); |
| | | |
| | | $OUTPUT->send(); |
| | | } |
| | |
| | | { |
| | | global $RCMAIL, $CONTACT_COLTYPES; |
| | | |
| | | $i_size = !empty($attrib['size']) ? $attrib['size'] : 30; |
| | | $i_size = $attrib['size'] ?: 30; |
| | | |
| | | $form = array( |
| | | 'main' => array( |
| | |
| | | { |
| | | $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') |
| | |
| | | return false; |
| | | } |
| | | |
| | | $i_size = !empty($attrib['size']) ? $attrib['size'] : 40; |
| | | $i_size = $attrib['size'] ?: 40; |
| | | |
| | | $form = array( |
| | | 'contact' => array( |
| | |
| | | $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(); |
| | | } |
| | |
| | | // 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(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (!$done) { |
| | | $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsavingcontact', 'error'); |
| | | $OUTPUT->show_message($plugin['message'] ?: 'errorsavingcontact', 'error'); |
| | | } |
| | | |
| | | $OUTPUT->send(); |
| | |
| | | $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); |
| | |
| | | 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']); |
| | |
| | | // 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; |
| | |
| | | |
| | | // 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'; |
| | |
| | | $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; |
| | | } |
| | | |
| | |
| | | } |
| | | else { |
| | | $address = html::span(array('title' => $mailto, 'class' => "rcmContactAddress"), |
| | | rcube::Q($name ? $name : $mailto)); |
| | | rcube::Q($name ?: $mailto)); |
| | | } |
| | | |
| | | if ($addicon && $_SESSION['writeable_abook']) { |
| | |
| | | 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"); |
| | |
| | | $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 ? ' ' . html::span('email', rcube::Q($email)) : '') |
| | | )), $classname); |
| | | } |
| | |
| | | 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 |
| | |
| | | $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 ? ' ' . html::span('email', rcube::Q($email)) : '') |
| | | )), 'person'); |
| | | } |
| | |
| | | |
| | | // 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 { |
| | |
| | | } |
| | | 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, |
| | |
| | | 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']; |
| | |
| | | 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( |
| | |
| | | // 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) |
| | |
| | | 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)); |
| | |
| | | $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']); |
| | |
| | | $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']); |
| | |
| | | // 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( |
| | |
| | | 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); |
| | |
| | | |
| | | $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), |
| | | ); |
| | | } |
| | | |
| | |
| | | |
| | | $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), |
| | | ); |
| | | } |
| | | |
| | |
| | | $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); |
| | |
| | | $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); |
| | | } |
| | | } |
| | |
| | | } |
| | | 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 |
| | |
| | | } |
| | | else { |
| | | // show error message |
| | | $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false); |
| | | $OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error', null, false); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | 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; |
| | | } |
| | |
| | | } |
| | | 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; |
| | | } |
| | |
| | | $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 .= '" '; |
| | | } |
| | | |
| | |
| | | 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'); |