On 04/08/2009 Jonas Meurer wrote:
> the recent 'Re-designed User Preferences interface' changes to roundcube
> trunk seem to have broken the user_preferences hook. at least the plugin
> 'subscriptions_option' doesn't work anymore.
ok, seems like the format for the user_preferences hook changed: it now
uses 'blocks' instead of 'tables' to describe the preferences options.
i tried to convert the subscriptions_option plugin to the new format,
but it seems like something is broken: the plugin option is simply
ignored.
greetings,
jonas
here's the exact diff of my changes:
--- a/plugins/subscriptions_option/subscriptions_option.php
+++ b/plugins/subscriptions_option/subscriptions_option.php
@@ -30,22 +30,24 @@
$this->add_texts('localization/', false);
$dont_override = rcmail::get_instance()->config->get('dont_override',
array());
if (!in_array('use_subscriptions', $dont_override)){
- $this->add_hook('user_preferences', array($this,
'settings_table'));
+ $this->add_hook('user_preferences', array($this,
'settings_blocks'));
$this->add_hook('save_preferences', array($this, 'save_prefs'));
}
$this->add_hook('list_mailboxes', array($this, 'list_mailboxes'));
$this->add_hook('manage_folders', array($this, 'manage_folders'));
}
- function settings_table($args)
+ function settings_blocks($args)
{
if ($args['section'] == 'server') {
$use_subscriptions =
rcmail::get_instance()->config->get('use_subscriptions');
$field_id = 'rcmfd_use_subscriptions';
$checkbox = new html_checkbox(array('name' =>
'_use_subscriptions', 'id' => $field_id, 'value' => 1));
- $args['table']->add('title', html::label($field_id,
Q($this->gettext('useimapsubscriptions'))));
- $args['table']->add(null, $checkbox->show($use_subscriptions?1:0));
+ $args['blocks']['options']['use_subscriptions'] = array(
+ 'title' => html::label($field_id,
Q($this->gettext('useimapsubscriptions'))),
+ 'content' => $checkbox->show($use_subscriptions?1:0),
+ );
}
return $args;
--- 8< --- detachments --- 8< ---
The following attachments have been detached and are available for viewing.
http://detached.gigo.com/rc/Nt/Yp3YpHla/signature.asc
Only click these links if you trust the sender, as well as this message.
--- 8< --- detachments --- 8< ---
_______________________________________________
List info: http://lists.roundcube.net/dev/