Changeset 2387 in subversion


Ignore:
Timestamp:
Apr 13, 2009 12:27:12 PM (4 years ago)
Author:
thomasb
Message:

Create one hook 'user_preferences' for all parts of the prefs page

Location:
branches/devel-api
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-api/plugins/subscriptions_option/subscriptions_option.php

    r2329 r2387  
    3131        $dont_override = rcmail::get_instance()->config->get('dont_override', array()); 
    3232        if (!in_array('use_subscriptions', $dont_override)){ 
    33             $this->add_hook('user_preferences_server_settings', array($this, 'settings_table')); 
     33            $this->add_hook('user_preferences', array($this, 'settings_table')); 
    3434            $this->add_hook('save_preferences', array($this, 'save_prefs')); 
    3535        } 
     
    4040    function settings_table($args) 
    4141    { 
    42         $use_subscriptions = rcmail::get_instance()->config->get('use_subscriptions'); 
    43         $field_id = 'rcmfd_use_subscriptions'; 
    44         $use_subscriptions = new html_checkbox(array('name' => '_use_subscriptions', 'id' => $field_id, 'value' => 1)); 
     42        if ($args['section'] == 'server') { 
     43            $use_subscriptions = rcmail::get_instance()->config->get('use_subscriptions'); 
     44            $field_id = 'rcmfd_use_subscriptions'; 
     45            $use_subscriptions = new html_checkbox(array('name' => '_use_subscriptions', 'id' => $field_id, 'value' => 1)); 
    4546 
    46         $args['table']->add('title', html::label($field_id, Q($this->gettext('useimapsubscriptions')))); 
    47         $args['table']->add(null, $use_subscriptions->show($use_subscriptions?1:0)); 
     47            $args['table']->add('title', html::label($field_id, Q($this->gettext('useimapsubscriptions')))); 
     48            $args['table']->add(null, $use_subscriptions->show($use_subscriptions?1:0)); 
     49        } 
    4850 
    4951        return $args; 
  • branches/devel-api/program/steps/settings/func.inc

    r2326 r2387  
    160160    } 
    161161     
     162    $RCMAIL->plugins->exec_hook('user_preferences', array('section' => $part, 'table' => $table)); 
     163     
    162164    if ($table->size()) 
    163165      $out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('uisettings'))) . $table->show($attrib)); 
     
    217219    } 
    218220 
     221    $RCMAIL->plugins->exec_hook('user_preferences', array('section' => $part, 'table' => $table)); 
     222 
    219223    if ($table->size()) 
    220224      $out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('mailboxview'))) . $table->show($attrib)); 
     
    255259    } 
    256260 
     261    $RCMAIL->plugins->exec_hook('user_preferences', array('section' => $part, 'table' => $table)); 
     262 
    257263    if ($table->size()) 
    258264      $out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagesdisplaying'))) . $table->show($attrib)); 
     
    296302    } 
    297303 
     304    $RCMAIL->plugins->exec_hook('user_preferences', array('section' => $part, 'table' => $table)); 
     305 
    298306    if ($table->size()) 
    299307      $out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagescomposition'))) . $table->show($attrib)); 
     
    330338      } 
    331339 
     340      $RCMAIL->plugins->exec_hook('user_preferences', array('section' => $part, 'table' => $table)); 
     341 
    332342      $out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('specialfolders'))) . $table->show($attrib)); 
    333343    } 
     
    382392    } 
    383393 
    384     rcmail::get_instance()->plugins->exec_hook('user_preferences_server_settings', array('table'=>$table)); 
     394    $RCMAIL->plugins->exec_hook('user_preferences', array('section' => $part, 'table' => $table)); 
    385395 
    386396    if ($table->size()) 
  • branches/devel-api/skins/default/templates/settings.html

    r2278 r2387  
    1818<div id="userprefs-title"><roundcube:label name="userpreferences" /></div> 
    1919 
    20 <div style="padding:15px 0 15px 15px"> 
     20<div id="userprefscontainer" style="padding:15px 0 15px 15px"> 
    2121<div class="userprefs-block"> 
    2222  <roundcube:object name="userprefs" form="form" parts="general,mailbox,mailview" /> 
     
    2626</div> 
    2727<div style="clear:left"></div> 
     28 
     29<roundcube:container name="userprefs" id="userprefscontainer" /> 
    2830</div> 
    2931</div> 
Note: See TracChangeset for help on using the changeset viewer.