[Svn] r3883 - in trunk/roundcubemail/program: include steps/addressbook steps/settings

trac at roundcube.net trac at roundcube.net
Mon Aug 9 08:35:10 CEST 2010


Author: alec
Date: 2010-08-09 01:35:10 -0500 (Mon, 09 Aug 2010)
New Revision: 3883

Modified:
   trunk/roundcubemail/program/include/rcube_plugin_api.php
   trunk/roundcubemail/program/steps/addressbook/save.inc
   trunk/roundcubemail/program/steps/settings/delete_identity.inc
   trunk/roundcubemail/program/steps/settings/save_identity.inc
Log:
- Rename hooks: contact_save -> contact_update, identity_save -> identity_update, delete_identity -> identity_delete
- Print warning to the log about deprecated hook names usage


Modified: trunk/roundcubemail/program/include/rcube_plugin_api.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_plugin_api.php	2010-08-08 11:39:19 UTC (rev 3882)
+++ trunk/roundcubemail/program/include/rcube_plugin_api.php	2010-08-09 06:35:10 UTC (rev 3883)
@@ -58,7 +58,8 @@
     'address_sources'   => 'addressbooks_list',
     'get_address_book'  => 'addressbook_get',
     'create_contact'    => 'contact_create',
-    'save_contact'      => 'contact_save',
+    'save_contact'      => 'contact_update',
+    'contact_save'      => 'contact_update',
     'delete_contact'    => 'contact_delete',
     'manage_folders'    => 'folders_list',
     'list_mailboxes'    => 'mailboxes_list',
@@ -67,7 +68,9 @@
     'list_prefs_sections' => 'preferences_sections_list',
     'list_identities'   => 'identities_list',
     'create_identity'   => 'identity_create',
-    'save_identity'     => 'identity_save',
+    'delete_identity'   => 'identity_delete',
+    'save_identity'     => 'identity_update',
+    'identity_save'     => 'identity_update',
   );
 
   /**
@@ -193,11 +196,9 @@
   {
     if (is_callable($callback)) {
       if (isset($this->deprecated_hooks[$hook])) {
-        /* Uncoment after 0.4-stable release
         raise_error(array('code' => 522, 'type' => 'php',
           'file' => __FILE__, 'line' => __LINE__,
           'message' => "Deprecated hook name. ".$hook.' -> '.$this->deprecated_hooks[$hook]), true, false);
-        */
         $hook = $this->deprecated_hooks[$hook];
       }
       $this->handlers[$hook][] = $callback;

Modified: trunk/roundcubemail/program/steps/addressbook/save.inc
===================================================================
--- trunk/roundcubemail/program/steps/addressbook/save.inc	2010-08-08 11:39:19 UTC (rev 3882)
+++ trunk/roundcubemail/program/steps/addressbook/save.inc	2010-08-09 06:35:10 UTC (rev 3883)
@@ -54,7 +54,8 @@
 // update an existing contact
 if (!empty($cid))
 {
-  $plugin = $RCMAIL->plugins->exec_hook('contact_save', array('id' => $cid, 'record' => $a_record, 'source' => get_input_value('_source', RCUBE_INPUT_GPC)));
+  $plugin = $RCMAIL->plugins->exec_hook('contact_update',
+    array('id' => $cid, 'record' => $a_record, 'source' => get_input_value('_source', RCUBE_INPUT_GPC)));
   $a_record = $plugin['record'];
   
   if (!$plugin['abort'] && ($result = $CONTACTS->update($cid, $a_record)))

Modified: trunk/roundcubemail/program/steps/settings/delete_identity.inc
===================================================================
--- trunk/roundcubemail/program/steps/settings/delete_identity.inc	2010-08-08 11:39:19 UTC (rev 3882)
+++ trunk/roundcubemail/program/steps/settings/delete_identity.inc	2010-08-09 06:35:10 UTC (rev 3883)
@@ -30,7 +30,7 @@
 
 if ($iid && preg_match('/^[0-9]+(,[0-9]+)*$/', $iid))
 {
-  $plugin = $RCMAIL->plugins->exec_hook('delete_identity', array('id' => $iid));
+  $plugin = $RCMAIL->plugins->exec_hook('identity_delete', array('id' => $iid));
   
   if (!$plugin['abort'] && $USER->delete_identity($iid)) {
     $OUTPUT->show_message('deletedsuccessfully', 'confirmation', null, false);

Modified: trunk/roundcubemail/program/steps/settings/save_identity.inc
===================================================================
--- trunk/roundcubemail/program/steps/settings/save_identity.inc	2010-08-08 11:39:19 UTC (rev 3882)
+++ trunk/roundcubemail/program/steps/settings/save_identity.inc	2010-08-09 06:35:10 UTC (rev 3883)
@@ -61,7 +61,7 @@
 if ($_POST['_iid'])
 {
   $iid = get_input_value('_iid', RCUBE_INPUT_POST);
-  $plugin = $RCMAIL->plugins->exec_hook('identity_save', array('id' => $iid, 'record' => $save_data));
+  $plugin = $RCMAIL->plugins->exec_hook('identity_update', array('id' => $iid, 'record' => $save_data));
   $save_data = $plugin['record'];
 
   if (!$plugin['abort'] && ($updated = $USER->update_identity($iid, $save_data)))

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list