Skip to content

Instantly share code, notes, and snippets.

@kehh
Last active July 18, 2017 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kehh/a4415a394f17ed02598609c8b3ed854b to your computer and use it in GitHub Desktop.
Save kehh/a4415a394f17ed02598609c8b3ed854b to your computer and use it in GitHub Desktop.
Template for producings a list of related galleries in pawtucket
<?php
// include this is ca_objects_advanced_search_objects_html.php adapted from
$vs_more_info = '';
$va_links = array();
// list of sets in which item is a member
$t_set = new ca_sets();
if (is_array($va_sets = caExtractValuesByUserLocale($t_set->getSetsForItem($t_object->tableNum(), $t_object->getPrimaryKey(), array('user_id' => $this->request->getUserID(), 'setType' => 'public_presentation', 'checkAccess' => true)))) && sizeof($va_sets)) {
foreach($va_sets as $vn_set_id => $va_set) {
$va_links[] = "<a href='".caNavUrl($this->request, 'Gallery', $vn_set_id, null)."'>".$va_set['name']."</a>";
}
$vs_more_info .= "<li>".join("</li><li>", $va_links)."</li>\n";
}
if($vs_more_info){
?>
<div>Related Galler<?php
if (count($va_links) === 1) {
print 'y';
} else {
print 'ies';
};?>
</div>
<div>
<?php print $vs_more_info;?>
</div>
<?php
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment