Created
March 1, 2011 16:03
-
-
Save jeremyboggs/849342 to your computer and use it in GitHub Desktop.
Returns a link to the first section in an Omeka exhibit.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returns a link to the first section in an exhibit. | |
* | |
* @param Exhibit $exhibit|null If null, it uses the current exhibit | |
* @param string $text|null If null, the link will use the title of the section. | |
* @param array $props An array of properties for the link. | |
*/ | |
function link_to_first_exhibit_section($exhibit = null, $text = null, $props = array()) { | |
if (!$exhibit) { | |
$exhibit = get_current_exhibit(); | |
} | |
$firstSection = $exhibit->Sections[0]; | |
if ($text == null) { | |
$text = !empty($text) ? $text : html_escape($firstSection->title); | |
} | |
return exhibit_builder_link_to_exhibit($exhibit, $text, $props, $firstSection); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment