gianlucagiacometti / roundcube-toolbox

Set of tools for Roundcube webmail
15 stars 10 forks source link

Update toolbox.php #31

Open cajunjoel opened 11 months ago

cajunjoel commented 11 months ago

The Enabled toggle for an alias is not being rendered correctly (I think) to allow the event to be triggered when clicking the toggle switch. The switch is not contained inside the tag, it's outside the . The toggle switch moves back and forth, but the plugin.toolbox.toggle_alias command is never fired. It looks like the html_checkbox is appended after the $enable_button, not contained within it.

I think a way to correct it is this to add the $input_active->show() to the content => of the $enable_button. Look at the diff to see all of the changes, but this line is key:

$enable_button = $this->rcube->output->button([
    'command' => 'plugin.toolbox.toggle_alias',
    'type' => 'link', 
    'class' => $button_type,
    'label' => 'toolbox.toolbox-'.$button_type,
    'content' => $input_active->show(isset($alias['active']) ? $alias['active'] : ''),
    'title' => 'toolbox.toolbox-'.$button_type
]);