-
-
Save shackep/5100cb721dd6b4f1e6eb to your computer and use it in GitHub Desktop.
Country Library Gist
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 | |
$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>' : ' '; ?></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>' : ' '; ?></td> | |
</tr> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment