diff options
| author | Carson Fleming <[email protected]> | 2024-12-30 19:39:39 -0800 |
|---|---|---|
| committer | Carson Fleming <[email protected]> | 2024-12-30 19:39:39 -0800 |
| commit | f830d4695a28f372af0f5e346399157452258ee9 (patch) | |
| tree | 2076827074d947cf48402b6cf4f6aed01174318c /inbox_settings.php | |
| parent | 89dbb354cad00df3e5863f0a859ae5e24ed6eb5f (diff) | |
| download | rc-inbox-settings-f830d4695a28f372af0f5e346399157452258ee9.tar.gz | |
fix up labels
Diffstat (limited to 'inbox_settings.php')
| -rw-r--r-- | inbox_settings.php | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/inbox_settings.php b/inbox_settings.php index 341ec1e..29a3586 100644 --- a/inbox_settings.php +++ b/inbox_settings.php @@ -90,17 +90,17 @@ class inbox_settings extends rcube_plugin { // info the js needs access to $this->rcmail->output->add_gui_object('keyslist', $attrib['id']); - $this->rcmail->output->include_script('keys.js'); + $this->rcmail->output->include_script('list.js'); + $this->include_script('keys.js'); - // $this->rcmail->output->add_label('inbox_settings.a', 'inbox_settings.b'); - - $data = $this->run_query('keys', [], true); + $data = self::label_assoc_2d($this->run_query('keys', [], true)); if (empty($data)) { $this->rcmail->output->command( 'display_message', $this->gettext('no_keys'), 'notice'); } - return rcmail_action::table_output($attrib, $data, ['fingerprint', 'comment'], 'id'); + return rcmail_action::table_output( + $attrib, $data, ['inbox_settings.fingerprint', 'inbox_settings.comment'], 'id'); } function render_settings_ui() { @@ -172,6 +172,18 @@ class inbox_settings extends rcube_plugin { return $page_content; } + private static function label_assoc_2d($data) { + $labeled_data = []; + foreach ($data as $row) { + $labeled_row = []; + foreach ($row as $col_name => $value) { + $labeled_row['inbox_settings.' . $col_name] = $value; + } + $labeled_data[] = $labeled_row; + } + return $labeled_data; + } + private static function get_checkbox($id, $name, $checked, $attrs = []) { return html::div(['class' => 'custom-control custom-switch'], (new html_checkbox([ |
