Skip to content

Instantly share code, notes, and snippets.

@shackep
Last active October 26, 2015 19:02
Show Gist options
  • Save shackep/5100cb721dd6b4f1e6eb to your computer and use it in GitHub Desktop.
Save shackep/5100cb721dd6b4f1e6eb to your computer and use it in GitHub Desktop.
Country Library Gist
<?php
$parent_id = $library->library_parent_id;
if (!empty($parent_id)):
// show the parent first
if (!in_array($parent_id, $parent_ids)):
$parent_ids[] = $parent_id;
$parent = Portico_Libraries::find($parent_id);
?>
<tr>
<td class="col_1"><?php echo esc_html($parent->library_name); ?></td>
<td class="col_2"><?php echo (intval($parent->library_archive_founders) == 1) ? '<span class="boolean">yes</span>' : '&nbsp;'; ?></td>
</tr>
<?php
endif;
$child = true;
else:
$child = false;
endif;
?>
<?php if (!in_array($library->library_id, $parent_ids)): ?>
<tr>
<td class="col_1 <?php if ($child) echo 'col_1_children_1'; ?>"><?php echo esc_html($library->library_name); ?></td>
<td class="col_2 <?php if ($child) echo 'col_2_children_1'; ?>"><?php echo (intval($library->library_archive_founders) == 1) ? '<span class="boolean">yes</span>' : '&nbsp;'; ?></td>
</tr>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment