<?php

/*
 * Theme template for SOPAC hitlist
 *
 */
// Prep some stuff here
$locum_result['new_author_str'] = sopac_author_format($locum_result[author], $locum_result[addl_author]);
if (empty($locum_result['new_author_str'])) {
    $locum_result['new_author_str'] = "n/a";
}
if ($cover_img_url == "CACHE") {
    $locum_result['cover_img_url'] = "http://media.aadl.org/covers/" . $locum_result['bnum'] . "_200.jpg";
} else {
    $locum_result['cover_img_url'] = url('', array('absolute' => TRUE)) . drupal_get_path('module', 'sopac') . '/images/nocover' . rand(1, 4) . '_200.jpg';
}
$locum_result['holds'] = intval($locum_result['availability']['holds']);
$locum_result['total'] = count($locum_result['availability']['items']);
unset($locum_result['availability']);
?>
<record>
<?php 
echo array2xml($locum_result);
?>
</record>
Beispiel #2
0
function sopac_list_form($form_state, $list, $header)
{
    include_once 'sopac_catalog.php';
    $locum = sopac_get_locum();
    $formats = $locum->locum_config['formats'];
    $form = array('#list_id' => $list['list_id'], '#header' => $header);
    foreach ($list['items'] as $item) {
        // Cover Image
        if ($item['cover_img'] == "CACHE") {
            $item['cover_img'] = "http://media.aadl.org/covers/" . $item['bnum'] . "_50.jpg";
        } else {
            if (!$item['cover_img']) {
                $item['cover_img'] = base_path() . drupal_get_path('module', 'sopac') . '/images/nocover' . rand(1, 4) . '_50.jpg';
            }
        }
        $item['cover_img'] = '<img src="' . $item['cover_img'] . '" />';
        // Material Icon
        $material_icon = '<img src="' . drupal_get_path('module', 'sopac') . '/images/' . $item['mat_code'] . '.png"><br />' . wordwrap($formats[$item['mat_code']], 8, '<br />');
        $data = array('place' => $item['value'], 'type' => $material_icon, 'cover' => $item['cover_img'], 'title' => l($item['title'], variable_get('sopac_url_prefix', 'cat/seek') . '/record/' . $item['bnum']), 'author' => sopac_author_format($item['author'], $item['addl_author']), 'date' => $item['tag_date'], 'actions' => sbl('Remove Item', 'user/listdelete/' . $list['list_id'] . '/' . $item['bnum'], array('iconafter' => 'cross')) . '<br />' . sbl('Move to Top', 'user/listmovetop/' . $list['list_id'] . '/' . $item['value'], array('iconafter' => 'arrow_up')) . '<br />' . sbl('Request Item', variable_get('sopac_url_prefix', 'cat/seek') . '/request/' . $item['bnum'], array('iconafter' => 'book_go')));
        $form['rows'][$item['bnum']]['data'] = array('#type' => 'value', '#value' => $data);
        $form['rows'][$item['bnum']]['places'][$item['bnum']] = array('#type' => 'textfield', '#size' => 4, '#default_value' => $item['value'], '#attributes' => array('class' => 'sopac-list-place'));
    }
    $form['submit'] = array('#type' => 'submit', '#value' => t('Save Changes'));
    return $form;
}
<?php

/*
 * Theme template for SOPAC hitlist
 *
 */
// Prep some stuff here
$new_author_str = sopac_author_format($locum_result['author'], $locum_result['addl_author']);
if ($locum_result['artist']) {
    $new_author_str = $locum_result['artist'];
}
$url_prefix = variable_get('sopac_url_prefix', 'cat/seek');
global $user;
if (!module_exists('covercache') || $locum_result['zipmd5']) {
    if (strpos($locum_result['cover_img'], 'http://') !== FALSE) {
        $cover_img = $locum_result['cover_img'];
    } else {
        if ($locum_result['zipmd5']) {
            $license = isset($locum_result['licensed_from']) ? $locum_result['licensed_from'] : 'magnatune';
            $cover_img = "http://media.aadl.org/music/{$license}/" . $locum_result['_id'] . "/data/cover.jpg";
            $locum_result['mat_code'] = 'z';
        } else {
            $cover_img = base_path() . drupal_get_path('module', 'sopac') . '/images/nocover.png';
        }
    }
    $cover_img = '<img width="100" src="' . $cover_img . '">';
    $cover_img = l($cover_img, variable_get('sopac_url_prefix', 'cat/seek') . '/record/' . $locum_result['_id'], array('html' => TRUE, 'alias' => TRUE));
}
$list_display = strpos($locum_result['namespace'], 'list') !== FALSE;
if ($list_display) {
    $locum_result['_id'] = $locum_result['bnum'];
Beispiel #4
0
}
$useriplabels = ipmap_labels();
if ($item['trailers']) {
    if ($item['trailers'][0]['type'] == 'trailer') {
        $trailer_url = $item['trailers'][0]['url'];
        if ($item['trailers'][0]['image']) {
            $trailer_image = $item['trailers'][0]['image'];
        }
        if ($item['trailers'][0]['cached'] && in_array('internal', $useriplabels)) {
            $trailer_url = 'http://media.aadl.org/trailers/' . $item['bnum'] . '.mp4';
        }
    }
}
// Set up some variables.
$url_prefix = variable_get('sopac_url_prefix', 'cat/seek');
$new_author_str = sopac_author_format($item['author'], $item['addl_author']);
$dl_mat_codes = in_array($item['mat_code'], $locum->csv_parser($locum_config['format_special']['download']));
$no_avail_mat_codes = in_array($item['mat_code'], $locum->csv_parser($locum_config['format_special']['skip_avail']));
$location_label = $item['loc_code'] || $item['loc_code'] != 'none' ? $locum_config['locations'][$item['loc_code']] : '';
$note_arr = $item['notes'];
if ($item_status) {
    // Get Zoom Lends copies
    $zooms_avail = $item_status['callnums']['Zoom Lends DVD']['avail'] + $item_status['callnums']['Zoom Lends Book']['avail'];
    $avail = $item_status['avail'] - $zooms_avail;
    if ($avail > 0) {
        $reqtext = 'There ' . ($avail == 1 ? 'is' : 'are') . " currently {$avail} available";
    } else {
        $reqtext = 'There are no copies available';
    }
    if ($zooms_avail > 0) {
        //$zoom_link = l('Zoom Lends', 'catalog/browse/unusual#ZOOM', array('query' => array('lightbox' => 1), 'attributes' => array('rel' => 'lightframe')));