diff options
| -rw-r--r-- | inbox_settings.php | 28 | ||||
| -rw-r--r-- | skins/elastic/templates/key_import.html | 49 |
2 files changed, 64 insertions, 13 deletions
diff --git a/inbox_settings.php b/inbox_settings.php index 55067cf..c70b38b 100644 --- a/inbox_settings.php +++ b/inbox_settings.php @@ -97,19 +97,17 @@ class inbox_settings extends rcube_plugin { $encrypt_inbox = 0; if (!empty($encryption_result) && !empty($encryption_result[0])) $encrypt_inbox = $encryption_result[0][0] ? 1 : 0; + $encryption_form = new html_table(['cols' => 2, 'class' => 'propform']); - $encryption_form->add_row(['class' => 'form-group row']); - $encryption_form->add('title col-sm-8', html::label([ - 'class' => 'col-form-label', - 'for' => 'rcmfd_encrypt_inbox' - ], rcube::Q($this->gettext('encrypt_inbox')))); + $encryption_form->add('title col-sm-8', html::label( + ['class' => 'col-form-label', 'for' => 'rcmfd_encrypt_inbox'], + rcube::Q($this->gettext('encrypt_inbox')))); $encryption_form->add('col-sm-2 offset-1', self::get_checkbox( 'rcmfd_encrypt_inbox', 'encrypt_inbox', $encrypt_inbox)); $forwarders = $this->run_query('forwarding_addresses'); $forwarding_form = new html_table(['cols' => 3, 'class' => 'propform']); foreach ($forwarders as $idx => $row) { - $forwarding_form->add_row(['class' => 'form-group row']); $forwarding_form->add('title col-sm-4', html::label( ['class' => 'col-form-label', 'for' => 'fwd_addr_' . $idx], @@ -195,13 +193,9 @@ class inbox_settings extends rcube_plugin { } function render_import_ui() { - $this->rcmail->output->add_handler('plugin.body', [$this, 'render_import_form']); $this->rcmail->output->set_pagetitle($this->gettext('key_import')); - $this->rcmail->output->send('plugin'); - } - - function render_import_form() { - return '<p>Not yet implemented.</p>'; + // TODO: save results + $this->rcmail->output->send('inbox_settings.key_import'); } function delete_selected_keys() { @@ -234,7 +228,7 @@ class inbox_settings extends rcube_plugin { . html::label(['class' => 'custom-control-label', 'for' => $id] + $attrs, '')); } - private static function get_textfield($id, $name, $value, $attrs = []) { + private static function get_textfield($id, $name, $value = '', $attrs = []) { return (new html_inputfield([ 'id' => $id, 'type' => 'text', @@ -243,6 +237,14 @@ class inbox_settings extends rcube_plugin { ] + $attrs))->show($value); } + private static function get_textarea($id, $name, $value = '', $attrs = []) { + return (new html_textarea([ + 'id' => $id, + 'rows' => 10, + 'name' => $name, + ] + $attrs))->show($value); + } + private static function get_hiddenfield($name, $value) { return (new html_inputfield(['type' => 'hidden', 'name' => $name]))->show($value); } diff --git a/skins/elastic/templates/key_import.html b/skins/elastic/templates/key_import.html new file mode 100644 index 0000000..da11b36 --- /dev/null +++ b/skins/elastic/templates/key_import.html @@ -0,0 +1,49 @@ +<roundcube:include file="includes/layout.html" /> +<roundcube:include file="includes/menu.html" /> +<roundcube:include file="includes/settings-menu.html" /> + +<h1 class="voice"><roundcube:label name="settings" /> : <roundcube:label name="inbox_settings.key_import" /></h1> + +<!-- keys list --> +<div id="layout-content" role="main"> + <h2 id="aria-label-toolbar" class="voice"><roundcube:label name="arialabeltoolbar" /></h2> + <div class="header"> + <a class="button icon back-list-button" href="#back"><span class="inner"><roundcube:label name="back" /></span></a> + <span class="header-title"></span> + </div> + <div class="formcontainer"> + <h1 class="voice"><roundcube:label name="inbox_settings.key_import" /></h1> + <roundcube:form name="importform" method="post" id="import-key" class="formcontent"> + <fieldset> + <legend><roundcube:label name="inbox_settings.key_import" /></legend> + <table class="propform"> + <tbody> + <tr class="form-group row"> + <td class="col-sm-8" colspan="2" style="width: 100%;"> + <label class="col-form-label" for="rcmfd_key_data"><roundcube:label name="inbox_settings.paste_key_data" /></label> + </td> + </tr> + <tr class="form-group row"> + <td class="col-sm-8" colspan="2" style="width: 100%;"> + <textarea id="rcmfd_key_data" rows="10" name="key_data" class="form-control"></textarea> + </td> + </tr> + <tr class="form-group row"> + <td class="col-sm-2"> + <label class="col-form-label" for="rcmfd_key_comment"><roundcube:label name="inbox_settings.comment" /></label> + </td> + <td colspan="1" class="col-sm-9 offset-1"> + <input id="rcmfd_key_comment" type="text" name="comment" size="80" value="" class="form-control"> + </td> + </tr> + </tbody> + </table> + </fieldset> + <div class="formbuttons"> + <button type="submit" name="import" class="button mainaction submit btn btn-primary"><roundcube:label name="import"></button> + </div> + </form> + </div> +</div> + +<roundcube:include file="includes/footer.html" /> |
