Esempio n. 1
0
/**
 * Get HTML for recent items.
 *
 * @since 2.2
 * @package Omeka\Function\View\Item
 * @uses get_random_featured_items()
 * @param int $count Maximum number of recent items to show.
 * @return string
 */
function recent_items($count = 10)
{
    $items = get_recent_items($count);
    if ($items) {
        $html = '';
        foreach ($items as $item) {
            $html .= get_view()->partial('items/single.php', array('item' => $item));
            release_object($item);
        }
    } else {
        $html = '<p>' . __('No recent items available.') . '</p>';
    }
    return $html;
}
Esempio n. 2
0
    </div>
</div>
<?php 
}
?>

<div class="homepage-recent">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <div class="content-block">
                    <h5 class="header-label">What's New</h6>

					<?php 
$homepageRecentItems = '6';
set_loop_records('items', get_recent_items($homepageRecentItems));
if (has_loop_records('items')) {
    ?>
					                        <div class="items-list slider">
					                        <?php 
    foreach (loop('items') as $item) {
        ?>
					                            <?php 
        $image = $item->Files;
        ?>
					                            <?php 
        if ($image) {
            ?>
					                            <div class="item">
												<?php 
            echo '  <a href="' . record_url($item, null, true) . '">';
 function _pimped_recent_items()
 {
     $recent_html = '<h2>' . __('Recent Items') . '</h2>';
     set_loop_records('items', get_recent_items(5));
     foreach (loop('items') as $item) {
         $recent_html .= '<div class="recent-row">';
         $recent_html .= '<p class="recent">' . metadata($item, array('Dublin Core', 'Identifier')) . ' - ' . link_to_item() . '</p>';
         $recent_html .= '<p class="recent">' . (metadata($item, 'item_type_name') ? metadata($item, 'item_type_name') : "NO ITEMTYPE!") . " in " . (metadata($item, 'collection_name') ? metadata($item, 'collection_name') : "NO COLLECTION !") . '</p>';
         if (is_allowed($item, 'edit')) {
             $recent_html .= '<p class="dash-edit">' . link_to_item(__('Edit'), array(), 'edit') . '</p>';
         }
         $recent_html .= '</div>';
     }
     return $recent_html;
 }
Esempio n. 4
0
function mh_display_recent_item($num = 1)
{
    echo $num <= 1 ? '<h2>Newest ' . mh_item_label() . '</h2>' : '<h2>Newest ' . mh_item_label('plural') . '</h2>';
    set_loop_records('items', get_recent_items($num));
    if (has_loop_records('items')) {
        foreach (loop('items') as $item) {
            echo '<article class="item-result">';
            echo '<h3>' . link_to_item(metadata($item, array('Dublin Core', 'Title'))) . '</h3>';
            echo '<div class="item-thumb">' . link_to_item(item_image('square_thumbnail')) . '</div>';
            if ($desc = metadata($item, array('Dublin Core', 'Description'), array('snippet' => 200))) {
                echo '<div class="item-description">' . $desc . '</div>';
            } else {
                echo '<div class="item-description">Text preview unavailable.</div>';
            }
            echo '</article>';
        }
    }
    echo '<p class="view-more-link">' . link_to_items_browse('View all ' . mh_item_label('plural') . '') . '</p>';
}
Esempio n. 5
0
</p>
<p>
    <?php 
$siteAdministratorEmail = '<a href="mailto:' . option('administrator_email') . '">' . __('site administrator') . '</a>';
echo __('If this does not help, try contacting the %s.', $siteAdministratorEmail);
?>
</p>

<section class="five columns alpha">
    <div class="panel">
        <h2><?php 
echo __('Recent Items');
?>
</h2>
        <?php 
set_loop_records('items', get_recent_items(5));
foreach (loop('items') as $item) {
    ?>
        <div class="recent-row">
            <p class="recent"><?php 
    echo link_to_item();
    ?>
</p>
            <?php 
    if (is_allowed($item, 'edit')) {
        ?>
            <p class="dash-edit"><?php 
        echo link_to_item(__('Edit'), array(), 'edit');
        ?>
</p>
            <?php