includelockhook
includelockhook
Function prototype:
hook (oid, entname)
Synopsis
Use with:
add_hook(hookname, func[, prepend])
remove_hook(hookname, func)
where hookname is includelockhook.
This hook will be called before an XML inclusion is locked, either explicitly (for example, by using the
oid_entity_lock function) or implicitly (for example, by typing in the expanded inclusion). It will only be called if the inclusion is a locally stored file (XML inclusion files stored in a Document Management System cannot be locked this way). It can override or cancel the locking operation (similar to using the
editbeforehook to detect when the user is about to edit an entity or inclusion in a separate window).
If this hook returns 0 the code proceeds as if the hook was not called and locks the entity.
If it returns –1 the lock operation is cancelled and the attempted locking operation fails, unless the hook locked the entity itself.
Arguments
• oid is the oid of the reference to the XML inclusion.
• entname is the name of the inclusion being locked.