Skip to content

Commit d04ddd3

Browse files
committed
Adds link to exhibits containing each item in the item browse detail
1 parent 3830418 commit d04ddd3

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

functions.php

+16
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,22 @@ function exhibit_builder_search_record_types($recordTypes)
605605
return $recordTypes;
606606
}
607607

608+
/**
609+
* Show the Exhibits that each item is included in on the Item Browse page
610+
*
611+
* @param array $args An array of parameters passed by the hook
612+
* @return void
613+
*/
614+
function exhibit_builder_item_detail($args)
615+
{
616+
$item = $args['item'];
617+
$exhibits = get_db()->getTable('Exhibit')->findAll();
618+
foreach($exhibits as $exhibit){
619+
if($exhibit->hasItem($item))
620+
echo('<p class="in-exhibit">Appears in Exhibit: <a href="'.admin_url('exhibits/edit/'.$exhibit->id).'">'.$exhibit->title.'</a></p>');
621+
}
622+
}
623+
608624
/**
609625
* Add exhibit title to item search filters.
610626
*/

plugin.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ link="http://omeka.org/codex/Plugins/ExhibitBuilder_3.0"
77
support_link="http://omeka.org/forums/forum/plugins"
88
omeka_minimum_version="2.3"
99
omeka_target_version="2.3"
10-
version="3.2.1"
10+
version="3.2.2"
1111
tags="exhibit, pages, presentation"

plugin.php

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
add_plugin_hook('admin_items_search', 'exhibit_builder_items_search');
2424
add_plugin_hook('public_items_search', 'exhibit_builder_items_search');
2525
add_plugin_hook('html_purifier_form_submission', 'exhibit_builder_purify_html');
26+
add_plugin_hook('admin_items_browse_detailed_each', 'exhibit_builder_item_detail');
2627

2728
add_filter('public_navigation_main', 'exhibit_builder_public_main_nav');
2829
add_filter('admin_navigation_main', 'exhibit_builder_admin_nav');

0 commit comments

Comments
 (0)