Skip to content

Commit

Permalink
[UI] modules.php : Modify the text to explain that Cypht supports JMA…
Browse files Browse the repository at this point in the history
…P (RFC8621) by default.
  • Loading branch information
Bienvenumoringa authored and =bienvenumoringa committed Oct 16, 2024
1 parent 8837a80 commit 540324e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/nux/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public function process()
continue;
}
}
}
}
if (! empty($server['smtp']['server'])) {
if (!$this->module_is_supported('smtp')) {
$errors[] = 'SMTP module is not enabled';
Expand Down Expand Up @@ -541,7 +541,7 @@ protected function output() {
class Hm_Output_nux_help extends Hm_Output_Module {
protected function output() {
return '<div class="nux_help mt-3 col-lg-6 col-md-12 col-sm-12"><div class="card"><div class="card-body"><div class="card_title"><h4>'.$this->trans('Help').'</h4></div>'.
$this->trans('Cypht is a webmail program. You can use it to access your E-mail accounts from any service that offers IMAP, or SMTP access - which most do.').' '.
$this->trans('Cypht is a webmail program. You can use it to access your E-mail accounts from any service that offers IMAP, or SMTP access - which most do. And Cypht also supports the newest protocol: JMAP (RFC8621).').' '.
'</div></div></div>';
}
}
Expand All @@ -563,6 +563,8 @@ protected function output() {
$res .= '<a class="mt-3 btn btn-light" href="?page=servers#quick_add_section"><i class="bi bi-person-plus me-3"></i>'.$this->trans('Add an E-mail Account').'</a>';
$res .= '</div><ul class="mt-4">';

$jmap_servers_count = count(array_filter($this->get('imap_servers', array()), function($v) { return array_key_exists('type', $v) && $v['type'] == 'jmap'; }));

foreach ($protos as $proto) {
$proto_dsp = $proto;
if ($proto == 'feeds') {
Expand Down Expand Up @@ -593,10 +595,10 @@ protected function output() {
}
else {
if ($server_data[$proto] > 1) {
$res .= sprintf($this->trans('You have %d %s sources'), $server_data[$proto], mb_strtoupper($proto_dsp));
$res .= sprintf($this->trans('You have %d %s / JMAP ' . $jmap_servers_count . ' sources'), $server_data[$proto], mb_strtoupper($proto_dsp));
}
else {
$res .= sprintf($this->trans('You have %d %s source'), $server_data[$proto], mb_strtoupper($proto_dsp));
$res .= sprintf($this->trans('You have %d %s / JMAP ' . $jmap_servers_count . ' source'), $server_data[$proto], mb_strtoupper($proto_dsp));
}
$res .= sprintf(' <a href="?page=servers#%s_section">%s</a>', $proto, $this->trans('Manage'));
}
Expand Down

0 comments on commit 540324e

Please sign in to comment.