Skip to content

Commit

Permalink
Add a database list creation alter hook>
Browse files Browse the repository at this point in the history
  • Loading branch information
jordandukart committed Feb 21, 2014
1 parent 4faffc7 commit c2f4157
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion includes/bookmark_db.inc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class BookmarkDatabase extends Bookmark {
global $user;
$owner = $user;
}

drupal_alter(ISLANDORA_BOOKMARK_DATABASE_LIST_CREATION_HOOK, $name, $type, $owner);
$fields = array(
'listname' => $name,
'listowner' => $owner->uid,
Expand Down
14 changes: 14 additions & 0 deletions islandora_bookmark.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,17 @@ function hook_islandora_bookmark_database_types() {
'my_type' => 'my_awesome_bookmark_class',
);
}

/**
* Allows modules to modify values on creation of database lists.
*
* @param string $name
* The name for the list.
* @param string $type
* A string indicating the type of list. Default is 'bookmark'.
* @param object $owner
* A user object from which we can grab the uid.
*/
function hook_islandora_bookmark_create_new_database_list_alter(&$name, &$type, &$owner) {

}
2 changes: 2 additions & 0 deletions islandora_bookmark.module
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Module used to track and manage user defined lists of pids.
*/

define('ISLANDORA_BOOKMARK_DATABASE_LIST_CREATION_HOOK', 'islandora_bookmark_database_list_creation');

/**
* Implements hook_menu().
*/
Expand Down

0 comments on commit c2f4157

Please sign in to comment.