diff options
| author | Carson Fleming <[email protected]> | 2024-11-25 22:32:44 -0800 |
|---|---|---|
| committer | Carson Fleming <[email protected]> | 2024-11-25 22:32:44 -0800 |
| commit | e23bbe642399705b9454c7cf3082249bd41b3d7e (patch) | |
| tree | 60363460c730e3b75c05be9ca9771a312ba383d1 | |
| parent | b20788336286acdfe66529e06b2fcfa513781be7 (diff) | |
| download | rc-inbox-settings-e23bbe642399705b9454c7cf3082249bd41b3d7e.tar.gz | |
add keys list item
| -rw-r--r-- | inbox_settings.php | 35 | ||||
| -rw-r--r-- | localization/en_US.inc | 1 |
2 files changed, 27 insertions, 9 deletions
diff --git a/inbox_settings.php b/inbox_settings.php index c47acf0..ce239ed 100644 --- a/inbox_settings.php +++ b/inbox_settings.php @@ -9,27 +9,36 @@ class inbox_settings extends rcube_plugin { $this->load_config(); $this->add_texts('localization/'); - $this->add_hook('preferences_sections_list', - array($this, 'scrub_encryption_preference')); - $this->add_hook('settings_actions', array($this, 'amend_settings_list')); + $this->add_hook('settings_actions', [$this, 'amend_settings_list']); + if ($this->rcmail->config->get('inbox_settings_scrub_encryption_preference', true)) + $this->add_hook( + 'preferences_sections_list', + [$this, 'scrub_encryption_preference']); - $this->register_action('plugin.inbox_settings', array($this, 'render_settings_ui')); + $this->register_action('plugin.inbox_settings', [$this, 'render_settings_ui']); + $this->register_action('plugin.inbox_keys', [$this, 'render_keys_ui']); } function scrub_encryption_preference($params) { - if ($this->rcmail->config->get('inbox_settings_scrub_encryption_preference', true)) - unset($params['list']['encryption']); + unset($params['list']['encryption']); return $params; } function amend_settings_list($params) { - $params['actions'][] = array( + $params['actions'][] = [ 'action' => 'plugin.inbox_settings', 'class' => 'inbox_settings', 'label' => 'inbox_settings', 'title' => 'inbox_settings', 'domain' => 'inbox_settings' - ); + ]; + $params['actions'][] = [ + 'action' => 'plugin.inbox_keys', + 'class' => 'enigma keys', + 'label' => 'inbox_keys', + 'title' => 'inbox_keys', + 'domain' => 'inbox_settings' + ]; return $params; } @@ -69,8 +78,16 @@ class inbox_settings extends rcube_plugin { } } + function render_keys_ui() { + $this->register_handler('plugin.body', [$this, 'render_keys_form']); + $this->rcmail->output->set_pagetitle($this->gettext('inbox_keys')); + $this->rcmail->output->send('plugin'); + } + + function render_keys_form() {} + function render_settings_ui() { - $this->register_handler('plugin.body', array($this, 'render_settings_form')); + $this->register_handler('plugin.body', [$this, 'render_settings_form']); $this->rcmail->output->set_pagetitle($this->gettext('inbox_settings')); $this->save_settings(); $this->rcmail->output->send('plugin'); diff --git a/localization/en_US.inc b/localization/en_US.inc index e13e32d..c6fac62 100644 --- a/localization/en_US.inc +++ b/localization/en_US.inc @@ -5,6 +5,7 @@ $labels['encryption'] = 'Encryption'; $labels['encrypt_inbox'] = 'Encrypt incoming mail to my inbox'; $labels['forwarding'] = 'Forwarding'; $labels['fwd_addr'] = 'Forward mail to this address'; +$labels['inbox_keys'] = 'Encryption Keys'; $labels['no_query'] = 'One or more database queries are not yet configured'; $labels['no_db'] = 'Failed to connect to the database'; $labels['sql_error'] = 'Encountered an error while performing the operation; please check your SQL syntax and database DSN'; |
