New: Callback functions / Hooks in uddeIM API

10 years 7 months ago - 10 years 7 months ago #232548 by slabbi
The uddeIM API has been improved:

You can register callback functions (hooks) for certain actions, e.g. one callback fires when the user opens his inbox or saves a message.

This feature is experimental and available in the development branch (see SVN sticky Joomlapolis.com). The FAQ.pdf already contains a description how to use the callback functions. Currently only a basic set of events are supported so please feel free to make suggestions for further events you like to see supported.

Please give feedback when you test this feature.

The trunk on Joomlacode.org is currently stable which means that you can use it on productive sites even when it is not recommended (it is not the final uddeIM 3.2 and the final version may have additional features).

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

Please Log in to join the conversation.

10 years 7 months ago - 10 years 7 months ago #232549 by slabbi
From the FAQ:

uddeIM 3.2 (API version 5+) supports callback functions. In order to use a callback function you have to register a hook first.

Registering a hook is simple; the following example registers a hook that is called whenever a user opens his inbox:
$uddeim = new uddeIMAPI();
$uddeim->registerHook(‘onInbox’, ‘myFunctionInbox’);

You have to implement a callback function that looks like this:
function myFunctionInbox($params) {
  echo "myFunctionInbox";
  var_dump($params);
}

Some hooks return parameters. Generally all parameters are passed by using an array. The array in the example above contains
[ “userid” => userid of user who opens the inbox ]

to "myFunctionInbox".

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

Please Log in to join the conversation.

10 years 5 months ago #234732 by slabbi
Nobody interested in testing this new feature?

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

Please Log in to join the conversation.

9 years 7 months ago #248255 by rorshack
Replied by rorshack on topic New: Callback functions / Hooks in uddeIM API
I'm interested! I would like to create a plug-in that does not allow users belonging to a certain group to compose messages. Is it possible to do this using a hook?

Please Log in to join the conversation.

9 years 7 months ago #248256 by slabbi
No, sorry. Currently I have only implemented a few hooks. Please refer to the dev section in the FAQ that explains all hooks.

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

Please Log in to join the conversation.

9 years 7 months ago #248262 by rorshack
Replied by rorshack on topic New: Callback functions / Hooks in uddeIM API
Can you please tell me where can I find the plug_uddeim_hooks? I couldn't find it anywhere! :dry:

Please Log in to join the conversation.

Moderators: beatnantslabbikrileon
Time to create page: 0.217 seconds

Facebook Twitter LinkedIn