Add ITEM_TYPE_CUSTOM and hooks for processing custom item types
This commit is contained in:
24
doc/hook/item_custom.bb
Normal file
24
doc/hook/item_custom.bb
Normal file
@@ -0,0 +1,24 @@
|
||||
[h2]item_custom[/h2]
|
||||
|
||||
Allow addons to create and process custom item types.
|
||||
|
||||
Addon authors will need to use iconfig meta data (with sharing on) or some other method
|
||||
to specify and determine whether the custom item is destined for their addon.
|
||||
|
||||
It is fed an array of ['item' => ${item_array}, 'allow_exec' => {true/false}]
|
||||
|
||||
By default $arr['item']['cancel'] is set to TRUE which will abort storage of the
|
||||
custom item in the item table unless the addon unsets it or sets it to false.
|
||||
|
||||
[code]
|
||||
if ($arr['item_type']==ITEM_TYPE_CUSTOM) {
|
||||
/* Custom items are not stored by default
|
||||
because they require an addon to process. */
|
||||
$d['item']['cancel']=true;
|
||||
|
||||
call_hooks('item_custom',$d);
|
||||
}
|
||||
|
||||
[/code]
|
||||
|
||||
see: include/items.php
|
18
doc/hook/item_stored.bb
Normal file
18
doc/hook/item_stored.bb
Normal file
@@ -0,0 +1,18 @@
|
||||
[h2]item_stored[/h2]
|
||||
|
||||
Allow addons to continue processing after an item has been stored in the event
|
||||
that they need access to the item_id or other data that gets assigned during
|
||||
the storage process.
|
||||
|
||||
It is fed an array of type item (including terms and iconfig data).
|
||||
|
||||
[code]
|
||||
/**
|
||||
* @hooks item_stored
|
||||
* Called after new item is stored in the database.
|
||||
* (By this time we have an item_id and other frequently needed info.)
|
||||
*/
|
||||
call_hooks('item_stored',$arr);
|
||||
[/code]
|
||||
|
||||
see: include/items.php
|
15
doc/hook/item_stored_update.bb
Normal file
15
doc/hook/item_stored_update.bb
Normal file
@@ -0,0 +1,15 @@
|
||||
[h2]item_stored_update[/h2]
|
||||
|
||||
Allow addons to continue processing after an item update has been stored
|
||||
|
||||
It is fed an array of type item (including terms and iconfig data).
|
||||
|
||||
[code]
|
||||
/**
|
||||
* @hooks item_stored_update
|
||||
* Called after updated item is stored in the database.
|
||||
*/
|
||||
call_hooks('item_stored_update',$arr);
|
||||
[/code]
|
||||
|
||||
see: include/items.php
|
Reference in New Issue
Block a user