HistoryLogPlugin =============== History Log plugin class * Class name: HistoryLogPlugin * Namespace: * Parent class: Omeka_Plugin_AbstractPlugin Properties ---------- ### $_hooks ``` protected array $_hooks = array('install', 'uninstall', 'after_save_item', 'before_save_item', 'define_acl', 'before_delete_item', 'admin_items_show', 'initialize', 'admin_head') ``` * Visibility: **protected** ### $_filters ``` protected array $_filters = array('admin_navigation_main') ``` * Visibility: **protected** Methods ------- ### \HistoryLogPlugin::hookDefineAcl() ``` void HistoryLogPlugin::\HistoryLogPlugin::hookDefineAcl()(array $args) ``` Define the plugin's access control list. * Visibility: **public** #### Arguments * $args **array** - <p>Parameters supplied by the hook</p> ### \HistoryLogPlugin::hookInitialize() ``` void HistoryLogPlugin::\HistoryLogPlugin::hookInitialize()() ``` Load the helper class when the plugin loads * Visibility: **public** ### \HistoryLogPlugin::hookAdminHead() ``` void HistoryLogPlugin::\HistoryLogPlugin::hookAdminHead()() ``` Load the plugin javascript when admin section loads * Visibility: **public** ### \HistoryLogPlugin::filterAdminNavigationMain() ``` array HistoryLogPlugin::\HistoryLogPlugin::filterAdminNavigationMain()(array $nav) ``` Add the History Log link to the admin main navigation. * Visibility: **public** #### Arguments * $nav **array** - <p>Navigation array.</p> ### \HistoryLogPlugin::hookInstall() ``` void HistoryLogPlugin::\HistoryLogPlugin::hookInstall()() ``` When the plugin installs, create the database tables to store the logs * Visibility: **public** ### \HistoryLogPlugin::hookUninstall() ``` void HistoryLogPlugin::\HistoryLogPlugin::hookUninstall()() ``` When the plugin uninstalls, delete the database tables which store the logs * Visibility: **public** ### \HistoryLogPlugin::hookBeforeSaveItem() ``` void HistoryLogPlugin::\HistoryLogPlugin::hookBeforeSaveItem()(array $args) ``` When an item is saved, determine whether it is a new item or an item update. If it is an update, log the event. Otherwise, wait until after the save. * Visibility: **public** #### Arguments * $args **array** - <p>An array of parameters passed by the hook</p> ### \HistoryLogPlugin::hookAfterSaveItem() ``` void HistoryLogPlugin::\HistoryLogPlugin::hookAfterSaveItem()(array $args) ``` When an item is saved, determine whether it is a new item or an item update. If it is a new item, log the event. * Visibility: **public** #### Arguments * $args **array** - <p>An array of parameters passed by the hook</p> ### \HistoryLogPlugin::hookBeforeDeleteItem() ``` void HistoryLogPlugin::\HistoryLogPlugin::hookBeforeDeleteItem()(array $args) ``` When an item is deleted, log the event. * Visibility: **public** #### Arguments * $args **array** - <p>An array of parameters passed by the hook</p> ### \HistoryLogPlugin::hookAdminItemsShow() ``` void HistoryLogPlugin::\HistoryLogPlugin::hookAdminItemsShow()(array $args) ``` Show the 5 most recent events in the item's history on the item's admin page * Visibility: **public** #### Arguments * $args **array** - <p>An array of parameters passed by the hook</p> ### \HistoryLogPlugin::_logItem() ``` void HistoryLogPlugin::\HistoryLogPlugin::_logItem()(Object $item, string $type, string $value) ``` Create a new log entry * Visibility: **private** #### Arguments * $item **Object** - <p>The Omeka item to log</p> * $type **string** - <p>The type of event to log (e.g. "create", "update")</p> * $value **string** - <p>An extra piece of type specific data for the log</p> ### \HistoryLogPlugin::_findChanges() ``` array HistoryLogPlugin::\HistoryLogPlugin::_findChanges()(Object $item) ``` If an item is being updated, find out which elements are being altered * Visibility: **private** #### Arguments * $item **Object** - <p>The updated omeka item record</p> ### \HistoryLogPlugin::_getTitle() ``` string HistoryLogPlugin::\HistoryLogPlugin::_getTitle()(int $itemID) ``` Retrieves the title of an item by itemID * Visibility: **private** #### Arguments * $itemID **int** - <p>The id of the item to log</p>