summaryrefslogtreecommitdiff
path: root/inbox_settings.php
diff options
context:
space:
mode:
Diffstat (limited to 'inbox_settings.php')
-rw-r--r--inbox_settings.php22
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([