echo head(array('title' => $collectionTitle, 'bodyclass' => 'collections show'));
?>

<div id="primary">
    <h1><?php 
echo $collectionTitle;
?>
</h1>

    <?php 
echo all_element_texts('collection');
?>

    <div id="collection-items">
        <h2><?php 
echo multicollections_link_to_items_in_collection(__('Items in the %s Collection', $collectionTitle), array('collection' => metadata('collection', 'id')));
?>
</h2>
        <?php 
if (multicollections_total_items_in_collection($collection) > 0) {
    ?>
            <?php 
    foreach (loop('items') as $item) {
        ?>
            <?php 
        $itemTitle = strip_formatting(metadata('item', array('Dublin Core', 'Title')));
        ?>
            <div class="item hentry">
                <h3><?php 
        echo link_to_item($itemTitle, array('class' => 'permalink'));
        ?>
            }
            ?>
                    </td>
                    <td>
                        <?php 
            if ($time = metadata('collection', 'Added')) {
                ?>
                            <?php 
                echo format_date($time);
                ?>
                        <?php 
            }
            ?>
                    </td>
                    <td><?php 
            echo multicollections_link_to_items_in_collection();
            ?>
</td>
                </tr>
            <?php 
        }
        ?>
            </tbody>
        </table>

        <?php 
        if (is_allowed('Collections', 'add')) {
            ?>
            <a href="<?php 
            echo html_escape(url('collections/add'));
            ?>
            <p>
            <strong><?php 
        echo __('Contributors');
        ?>
:</strong>
            <?php 
        echo metadata('collection', array('Dublin Core', 'Contributor'), array('all' => true, 'delimiter' => ', '));
        ?>
            </p>
        </div>
        <?php 
    }
    ?>

        <p class="view-items-link"><?php 
    echo multicollections_link_to_items_in_collection(__('View the items in %s', metadata('collection', array('Dublin Core', 'Title'))), array('collection' => metadata('collection', 'id')));
    ?>
</p>

        <?php 
    fire_plugin_hook('public_collections_browse_each', array('view' => $this, 'collection' => $collection));
    ?>

    </div><!-- end class="collection" -->

    <?php 
}
?>

    <?php 
echo pagination_links();