Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mark Jordan
digitallibsfuca_custom_navigation
Commits
a004242d
Commit
a004242d
authored
Sep 23, 2016
by
Mark Jordan
Browse files
Cleanup up some cruft; clarified function-level comments.
parent
dbbf1356
Changes
1
Hide whitespace changes
Inline
Side-by-side
digitallibsfuca_custom_navigation.module
View file @
a004242d
...
...
@@ -5,7 +5,7 @@
*/
function
digitallibsfuca_custom_navigation_menu
()
{
$items
=
array
();
// Menu item that appears on
top-level
collection object pages.
// Menu item that appears on collection object pages.
$items
[
'collection/home/%digitallibsfuca_custom_navigation_get_pid_from_url'
]
=
array
(
'title'
=>
'Visit the collection home page'
,
'page callback'
=>
'digitallibsfuca_custom_navigation_get_collection_home_page_url'
,
...
...
@@ -15,7 +15,7 @@ function digitallibsfuca_custom_navigation_menu() {
'type'
=>
MENU_NORMAL_ITEM
,
'menu_name'
=>
'sfu-custom-nav'
,
);
// Menu item that appears on islandora_collection
node
pages.
// Menu item that appears on
nodes of type
islandora_collection
(aka the "collection home
pages
")
.
$items
[
'collection/browse/%digitallibsfuca_custom_navigation_get_pid_from_node'
]
=
array
(
'title'
=>
'Browse the collection'
,
'page callback'
=>
'digitallibsfuca_custom_navigation_get_collection_browse_url'
,
...
...
@@ -29,13 +29,14 @@ function digitallibsfuca_custom_navigation_menu() {
}
/**
* Menu item access callback for visibility of menu item to collection homepage.
* Menu item access callback.
*
*
* Makes the menu item show up only if the user is on a collection object page.
* Makes the menu item show up only if the user is on a collection object.
* Menu item contains link to collection homepage.
*/
function
digitallibsfuca_custom_navigation_collection_home_link_visibility
(
$pid
)
{
global
$base_url
;
$host
=
'http://newspapers.lib.sfu.ca'
;
if
(
$object
=
islandora_object_load
(
$pid
))
{
$root_collection
=
variable_get
(
'islandora_repository_pid'
,
'islandora:root'
);
$object_collections
=
$object
->
relationships
->
get
(
FEDORA_RELS_EXT_URI
,
'isMemberOfCollection'
);
...
...
@@ -53,7 +54,8 @@ function digitallibsfuca_custom_navigation_collection_home_link_visibility($pid)
/**
* Menu item access callback.
*
* Only makes the item show up if the user is on a collection home page.
* Makes the menu item show up only if the user is on a collection home page.
* Menu item contains link to collection object.
*/
function
digitallibsfuca_custom_navigation_collection_browse_link_visibility
(
$pid
)
{
if
(
$pid
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment