示例#1
0
 /**
  * Render html for the save panel buttons
  * 
  * @param string $content
  * @return string
  */
 public function render($content)
 {
     $noAttribs = $this->getOption('noAttribs');
     $record = $this->getRecord();
     $content = $this->getOption('content');
     $this->removeOption('content');
     $this->removeOption('noAttribs');
     $this->removeOption('openOnly');
     $this->removeOption('closeOnly');
     $this->removeOption('record');
     $attribs = null;
     if (!$noAttribs) {
         $attribs = $this->getOptions();
     }
     $html = "<input id='save-changes' class='submit big green button' type='submit' value='" . __('Save Changes') . "' name='submit' />";
     if ($record) {
         if ($this->hasPublicPage() && $record->exists()) {
             set_theme_base_url('public');
             $publicPageUrl = record_url($record, 'show');
             revert_theme_base_url();
             $html .= "<a href='{$publicPageUrl}' class='big blue button' target='_blank'>" . __('View Public Page') . "</a>";
         }
         if (is_allowed($record, 'delete')) {
             $recordDeleteConfirm = record_url($record, 'delete-confirm');
             $html .= "<a href='{$recordDeleteConfirm}' class='big red button delete-confirm'>" . __('Delete') . "</a>";
         }
     }
     //used by SavePanelHook to locate where to insert hook content
     $html .= "<div id='button-field-line'></div>";
     return $html;
 }
 /**
  * When the number of results exceeds the page length, the maximum number
  * of results and the pagination should be displayed.
  */
 public function testPagination()
 {
     // Set public page length to 2.
     set_option('per_page_public', 2);
     $item1 = $this->_item(true, 'Item 1');
     $item2 = $this->_item(true, 'Item 2');
     $item3 = $this->_item(true, 'Item 3');
     $item4 = $this->_item(true, 'Item 4');
     $item5 = $this->_item(true, 'Item 5');
     $item6 = $this->_item(true, 'Item 6');
     // --------------------------------------------------------------------
     // Page 1.
     $this->dispatch('solr-search');
     // Should just list items 1-2.
     $this->assertXpath('//a[@href="' . record_url($item1) . '"]');
     $this->assertXpath('//a[@href="' . record_url($item2) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item3) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item4) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item5) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item6) . '"]');
     // Should link to page 2.
     $next = public_url('solr-search?page=2');
     $this->assertXpath('//a[@href="' . $next . '"]');
     $this->resetResponse();
     $this->resetRequest();
     // --------------------------------------------------------------------
     // Page 2.
     $_GET['page'] = '2';
     $this->dispatch('solr-search');
     // Should just list items 3-4.
     $this->assertNotXpath('//a[@href="' . record_url($item1) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item2) . '"]');
     $this->assertXpath('//a[@href="' . record_url($item3) . '"]');
     $this->assertXpath('//a[@href="' . record_url($item4) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item5) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item6) . '"]');
     // Should link to page 3.
     $next = public_url('solr-search?page=3');
     $this->assertXpath('//a[@href="' . $next . '"]');
     $this->resetResponse();
     $this->resetRequest();
     // --------------------------------------------------------------------
     // Page 3.
     $_GET['page'] = '3';
     $this->dispatch('solr-search');
     // Should just list items 5-6.
     $this->assertNotXpath('//a[@href="' . record_url($item1) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item2) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item3) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item4) . '"]');
     $this->assertXpath('//a[@href="' . record_url($item5) . '"]');
     $this->assertXpath('//a[@href="' . record_url($item6) . '"]');
     // Should link back to page 2.
     $prev = public_url('solr-search?page=2');
     $this->assertXpath('//a[@href="' . $prev . '"]');
     // --------------------------------------------------------------------
 }
 /**
  * Search queries should match indexed elements.
  */
 public function testSearchIndexedElements()
 {
     $this->fieldTable->setElementIndexed('Dublin Core', 'Description');
     $item1 = insert_item(array('public' => true), array('Dublin Core' => array('Title' => array(array('text' => 'Item 1', 'html' => false)), 'Description' => array(array('text' => 'desc1', 'html' => false)))));
     $item2 = insert_item(array('public' => true), array('Dublin Core' => array('Title' => array(array('text' => 'Item 2', 'html' => false)), 'Description' => array(array('text' => 'desc2', 'html' => false)))));
     $_GET['q'] = 'desc1';
     $this->dispatch('solr-search');
     // Should match item 1, but not item 2.
     $this->_assertResultLink(record_url($item1), 'Item 1');
     $this->_assertNotResultLink(record_url($item2));
 }
function table_double_field_info($args)
{
    if ($args) {
        $taletype_search_url = url(array('module' => 'items', 'controller' => 'browse'), 'default', array("search" => "", "submit_search" => "Zoeken", "advanced[0][element_id]" => "49", "advanced[0][type]" => "is exactly", "advanced[0][terms]" => "{$args}"));
        $tale_view_url = get_element_by_value($args, "Identifier") ? record_url(get_element_by_value($args, "Identifier"), 'show') : "";
        $type_information = __("Temporarily no title information");
        ## REPLACE BY THIS:  $type_information = get_type_description($args);
        $pasted_args = str_replace(array(" ", "\r"), "", $args);
        return browse_link_in_table($value, $search_url, $additional_information);
    }
    return __("something went wrong");
}
 /**
  * Search queries should match exhibit descriptions.
  */
 public function testSearchDescriptions()
 {
     $exhibit1 = $this->_exhibit(true, 'Exhibit 1', 'e1');
     $exhibit2 = $this->_exhibit(true, 'Exhibit 2', 'e2');
     $exhibit1->description = 'desc1';
     $exhibit2->description = 'desc2';
     $exhibit1->save();
     $exhibit2->save();
     $_GET['q'] = 'desc1';
     $this->dispatch('solr-search');
     // Should match exhibit 1, but not exhibit 2.
     $this->_assertResultLink(record_url($exhibit1), 'Exhibit 1');
     $this->_assertNotResultLink(record_url($exhibit2));
 }
 /**
  * Search queries should match page descriptions.
  */
 public function testSearchDescriptions()
 {
     $page1 = $this->_simplePage(true, 'Page 1', 'p1');
     $page2 = $this->_simplePage(true, 'Page 2', 'p2');
     $page1->text = 'text1';
     $page2->text = 'text2';
     $page1->save();
     $page2->save();
     $_GET['q'] = 'text1';
     $this->dispatch('solr-search');
     // Should match page 1, but not page 2.
     $this->_assertResultLink(record_url($page1), 'Page 1');
     $this->_assertNotResultLink(record_url($page2));
 }
 /**
  * Search queries should match page entry texts.
  */
 public function testSearchEntries()
 {
     $exhibit1 = $this->_exhibit(true, 'Exhibit 1', 'e1');
     $exhibit2 = $this->_exhibit(true, 'Exhibit 2', 'e2');
     $page1 = $this->_exhibitPage($exhibit1, 'Page 1', 'p1');
     $page2 = $this->_exhibitPage($exhibit2, 'Page 2', 'p2');
     $entry1 = $this->_exhibitBlock($page1, 'text1');
     $entry2 = $this->_exhibitBlock($page1, 'text2');
     $_GET['q'] = 'text1';
     $this->dispatch('solr-search');
     // Should match page 1, but not page 2.
     $this->_assertResultLink(record_url($page1), 'Page 1');
     $this->_assertNotResultLink(record_url($page2));
 }
示例#8
0
 /**
  * Creates a test Item and returns a citation string.
  *
  * @todo This function, like Item::getCitation(), uses date() to generate a date
  * accessed for the citation. This should be changed when we
  * internationalize date outputs.
  *
  * @param string|null The Item title.
  * @param string|null The Item creator.
  * @return string The Item's citation string.
  */
 protected function _createItemCitationString($title = null, $creator = null)
 {
     $elementTexts = array('Dublin Core' => array('Title' => array(array('text' => $title, 'html' => false)), 'Creator' => array(array('text' => $creator, 'html' => false))));
     $item = new Item();
     $item->addElementTextsByArray($elementTexts);
     $item->save();
     set_current_record('item', $item, true);
     $siteTitle = option('site_title');
     $dateAccessed = format_date(time(), Zend_Date::DATE_LONG);
     $itemUrl = record_url('item', null, true);
     $citationHtml = "&#8220;{$title},&#8221; <em>{$siteTitle}</em>, accessed {$dateAccessed}, {$itemUrl}.";
     if ($creator) {
         $citationHtml = "{$creator}, {$citationHtml}";
     }
     return $citationHtml;
 }
示例#9
0
 public function recordToDcmesXml($item)
 {
     $xml = "\n" . '<rdf:Description rdf:about="' . xml_escape(record_url($item, null, true)) . '">';
     // Iterate throught the DCMES.
     foreach ($this->_dcElements as $elementName) {
         if ($text = metadata($item, array('Dublin Core', $elementName), array('all' => true, 'no_escape' => true))) {
             foreach ($text as $k => $v) {
                 if (!empty($v)) {
                     $xml .= "\n" . '<dc:' . strtolower($elementName) . '>' . xml_escape($v) . '</dc:' . strtolower($elementName) . '>';
                 }
             }
         }
     }
     $xml .= "\n" . '</rdf:Description>';
     return $xml;
 }
 public function itemToDcRdf(Item $item)
 {
     $dces = new DublinCoreExtendedPlugin();
     $xml = '<rdf:Description rdf:about="' . html_escape(record_url($item, 'show', true)) . '">';
     foreach ($dces->getElements() as $element) {
         $elementTexts = metadata($item, array('Dublin Core', $element['label']), array('all' => true));
         if ($elementTexts) {
             foreach ($elementTexts as $elementText) {
                 if (strlen($elementText) != 0) {
                     $xml .= "\n    <dcterms:{$element['name']}><![CDATA[{$elementText}]]></dcterms:{$element['name']}>";
                 }
             }
         }
     }
     $xml .= "\n</rdf:Description>";
     return $xml;
 }
 /**
  * Tests whether link_to_timeline() returns the correct link for a timeline.
  *
  * @uses link_to_timeline()
  */
 public function testLinkToTimeline()
 {
     $timeline = $this->_createTimeline();
     $this->dispatch('neatline-time/timelines/show/1');
     $matcher = array('tag' => 'a', 'content' => $timeline->title, 'attributes' => array('href' => record_url($timeline)));
     $linkDefault = link_to_timeline();
     $this->assertTag($matcher, $linkDefault);
     $linkText = 'New Text';
     $linkWithNewText = link_to_timeline($linkText);
     $matcher['content'] = $linkText;
     $this->assertTag($matcher, $linkWithNewText);
     $linkToEditWithProps = link_to_timeline(null, array('class' => 'edit'), 'edit');
     $matcher['content'] = $timeline->title;
     $matcher['attributes']['class'] = 'edit';
     $matcher['attributes']['href'] = record_url($timeline, 'edit');
     $this->assertTag($matcher, $linkToEditWithProps);
 }
示例#12
0
 /**
  * Tests to get the good record url of a record via core functions.
  */
 public function testRecordUrl()
 {
     $record = $this->getRecordByTitle('Title of Collection #1');
     $generic = get_option('clean_url_collection_generic');
     $generic = $generic ? '/' . $generic : '/';
     $url = record_url($record);
     $this->assertEquals($generic . 'Identifier_of_Collection_1', $url, sprintf('A collection has a wrong record url.'));
     $record = $this->getRecordByTitle('Title of Item #1');
     $generic = get_option('clean_url_item_generic');
     $generic = $generic ? '/' . $generic : '';
     $url = record_url($record);
     $this->assertEquals($generic . 'Identifier_of_Item_1', $url, sprintf('A collection has a wrong record url.'));
     $record = $this->getRecordByTitle('Title of File #1');
     $generic = get_option('clean_url_file_generic');
     $generic = $generic ? '/' . $generic : '';
     $url = record_url($record);
     $this->assertEquals($generic . 'Identifier_of_File_1', $url, sprintf('A collection has a wrong record url.'));
 }
 public function manifestAction()
 {
     $CONTEXT_PRESENTATION = "http://iiif.io/api/presentation/2/context.json";
     $CONTEXT_IMAGE = "http://iiif.io/api/image/2/context.json";
     $PROFILE_IMAGE = "http://iiif.io/api/image/2/level2.json";
     $BASE_URI = record_url($this->item, 'show', true);
     $MANIFEST_URI = $BASE_URI . "/manifest.json";
     $SEQUENCE_URI = $BASE_URI . "/sequence.json";
     $CANVAS_BASE_URI = $BASE_URI . "/canvas/";
     $canvases = array("canvases" => array());
     $counter = 0;
     foreach ($this->item->Files as $file) {
         $metadata = json_decode($file->metadata, TRUE);
         if (!isset($metadata) or !array_key_exists('iiif', $metadata) or $metadata['iiif'] == array()) {
             continue;
         }
         $base_image_url = $metadata['iiif']['@id'];
         $image_width = 0;
         $image_height = 0;
         $image_url = $base_image_url . "/full/full/0/native.jpg";
         if (isset($metadata)) {
             $image_width = $metadata['iiif']['width'];
             $image_height = $metadata['iiif']['height'];
         }
         $images = array("@type" => "oa:Annotation", "motivation" => "sc:painting", "resource" => array("@id" => $image_url, "@type" => "dctypes:Image", "service" => array("@context" => $CONTEXT_IMAGE, "profile" => $PROFILE_IMAGE, "@id" => $base_image_url)), "on" => $CANVAS_BASE_URI . "{$counter}.json");
         $canvas = array("@id" => $CANVAS_BASE_URI . "{$counter}.json", "@type" => "sc:Canvas", "label" => metadata($this->item, array('Dublin Core', 'Title')) . " - image {$counter}", "width" => (int) $image_width, "height" => (int) $image_height, "images" => array());
         $images["resource"]["width"] = (int) $image_width;
         $images["resource"]["height"] = (int) $image_height;
         array_push($canvas['images'], $images);
         array_push($canvases['canvases'], $canvas);
         $counter++;
     }
     $sequences = array("sequences" => array("@id" => $SEQUENCE_URI, "@type" => "sc:Sequence", "label" => metadata($this->item, array('Dublin Core', 'Title')) . " - sequence 1"));
     $sequences = $sequences['sequences'] + $canvases;
     $manifest = array("@context" => $CONTEXT_PRESENTATION, "@id" => $MANIFEST_URI, "@type" => "sc:Manifest", "label" => metadata($this->item, array('Dublin Core', 'Title')), "sequences" => array($sequences));
     $response = $this->getResponse();
     $response->setHeader('Content-Type', 'application/json', true);
     $response->setHeader('Access-Control-Allow-Origin', '*');
     $response->setBody(json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
     $response->sendResponse();
     exit;
 }
示例#14
0
 protected function itemToRSS($item)
 {
     $entry = array();
     set_current_record('item', $item, true);
     // Title is a CDATA section, so no need for extra escaping.
     $entry['title'] = strip_formatting(metadata($item, array('Dublin Core', 'Title'), array('no_escape' => true)));
     $entry['description'] = $this->buildDescription($item);
     $entry['link'] = xml_escape(record_url($item, null, true));
     $entry['lastUpdate'] = strtotime($item->added);
     //List the first file as an enclosure (only one per RSS feed)
     if (($files = $item->Files) && ($file = current($files))) {
         $entry['enclosure'] = array();
         $fileDownloadUrl = file_display_url($file);
         $enc['url'] = $fileDownloadUrl;
         $enc['type'] = $file->mime_type;
         $enc['length'] = (int) $file->size;
         $entry['enclosure'][] = $enc;
     }
     return $entry;
 }
示例#15
0
文件: OaiDc.php 项目: kyfr59/cg35
 /**
  * Appends Dublin Core metadata. 
  *
  * Appends a metadata element, an child element with the required format,
  * and further children for each of the Dublin Core fields present in the
  * item.
  */
 public function appendMetadata($item, $metadataElement)
 {
     $document = $metadataElement->ownerDocument;
     $oai_dc = $document->createElementNS(self::METADATA_NAMESPACE, 'oai_dc:dc');
     $metadataElement->appendChild($oai_dc);
     $oai_dc->setAttribute('xmlns:dc', self::DC_NAMESPACE_URI);
     $oai_dc->declareSchemaLocation(self::METADATA_NAMESPACE, self::METADATA_SCHEMA);
     /* Each of the 16 unqualified Dublin Core elements, in the order
      * specified by the oai_dc XML schema
      */
     $dcElementNames = array('title', 'creator', 'subject', 'description', 'publisher', 'contributor', 'date', 'type', 'format', 'identifier', 'source', 'language', 'relation', 'coverage', 'rights');
     /* Must create elements using createElement to make DOM allow a
      * top-level xmlns declaration instead of wasteful and non-
      * compliant per-node declarations.
      */
     foreach ($dcElementNames as $elementName) {
         $upperName = Inflector::camelize($elementName);
         $dcElements = $item->getElementTexts('Dublin Core', $upperName);
         // Prepend the item type, if any.
         if ($elementName == 'type' && get_option('oaipmh_repository_expose_item_type')) {
             if ($dcType = $item->getProperty('item_type_name')) {
                 $oai_dc->appendNewElement('dc:type', $dcType);
             }
         }
         foreach ($dcElements as $elementText) {
             $oai_dc->appendNewElement('dc:' . $elementName, $elementText->text);
         }
         // Append the browse URI to all results
         if ($elementName == 'identifier') {
             $oai_dc->appendNewElement('dc:identifier', record_url($item, 'show', true));
             // Also append an identifier for each file
             if (get_option('oaipmh_repository_expose_files')) {
                 $files = $item->getFiles();
                 foreach ($files as $file) {
                     $oai_dc->appendNewElement('dc:identifier', $file->getWebPath('original'));
                 }
             }
         }
     }
 }
示例#16
0
 /**
  * Appends Dublin Core metadata. 
  *
  * Appends a metadata element, an child element with the required format,
  * and further children for each of the Dublin Core fields present in the
  * item.
  */
 public function appendMetadata($metadataElement)
 {
     $oai_dc = $this->document->createElementNS(self::METADATA_NAMESPACE, 'oai_dc:dc');
     $metadataElement->appendChild($oai_dc);
     /* Must manually specify XML schema uri per spec, but DOM won't include
      * a redundant xmlns:xsi attribute, so we just set the attribute
      */
     $oai_dc->setAttribute('xmlns:dc', self::DC_NAMESPACE_URI);
     $oai_dc->setAttribute('xmlns:xsi', parent::XML_SCHEMA_NAMESPACE_URI);
     $oai_dc->setAttribute('xsi:schemaLocation', self::METADATA_NAMESPACE . ' ' . self::METADATA_SCHEMA);
     /* Each of the 16 unqualified Dublin Core elements, in the order
      * specified by the oai_dc XML schema
      */
     $dcElementNames = array('title', 'creator', 'subject', 'description', 'publisher', 'contributor', 'date', 'type', 'format', 'identifier', 'source', 'language', 'relation', 'coverage', 'rights');
     /* Must create elements using createElement to make DOM allow a
      * top-level xmlns declaration instead of wasteful and non-
      * compliant per-node declarations.
      */
     foreach ($dcElementNames as $elementName) {
         $upperName = Inflector::camelize($elementName);
         $dcElements = $this->item->getElementTexts('Dublin Core', $upperName);
         foreach ($dcElements as $elementText) {
             $this->appendNewElement($oai_dc, 'dc:' . $elementName, $elementText->text);
         }
         // Append the browse URI to all results
         if ($elementName == 'identifier') {
             $this->appendNewElement($oai_dc, 'dc:identifier', record_url($this->item, 'show', true));
             // Also append an identifier for each file
             if (get_option('oaipmh_repository_expose_files')) {
                 $files = $this->item->getFiles();
                 foreach ($files as $file) {
                     $this->appendNewElement($oai_dc, 'dc:identifier', $file->getWebPath('original'));
                 }
             }
         }
     }
 }
示例#17
0
function sckls_random_featured_item()
{
    $html = '';
    $items = get_records('Item', array('featured' => true, 'sort_field' => 'random'), 1);
    set_loop_records('items', $items);
    if (has_loop_records('items')) {
        foreach (loop('items') as $item) {
            $html .= '<a href="' . record_url($item, null, true) . '" class="featured">';
            $html .= '    <h6 class="header-label">Featured Item</h6>';
            $html .= '    <div class="overlay"></div>';
            $image = $item->Files;
            if ($image) {
                $html .= '<div style="background-image: url(' . file_display_url($image[0], 'fullsize') . ');" class="img"></div>';
            } else {
                $html .= '<div style="background-image: url(' . img('*****@*****.**') . ');" class="img default"></div>';
            }
            $html .= '    <span class="title">' . metadata('item', array('Dublin Core', 'Title')) . '</span>';
            $html .= '</a>';
        }
    } else {
        $html .= '<h4 class="not-featured">No featured items.</h4>';
    }
    return $html;
}
<!-- <div class="container exhibit"> -->
  <!-- <article> -->
    <!-- <div class="col-md-12"> -->
      <!-- <div class="article-content"> -->
      </div>
    </div>
  </article>
</div>

<div class="waterfall-gallery">
  <?php 
foreach ($attachments as $attachment) {
    ?>
    <?php 
    $item = $attachment->getItem();
    $itemLink = record_url($item);
    $itemImageTag = item_image('square_thumbnail', array(), 0, $item);
    $itemTitle = metadata($item, array('Dublin Core', 'Title'));
    $itemDescription = metadata($item, array('Dublin Core', 'Description'), array('snippet' => 250));
    $itemTags = tag_string($item, 'items/browse', '');
    ?>
    <div class="waterfall-exhibit-item" onclick="window.location='<?php 
    echo $itemLink;
    ?>
'">
      <?php 
    echo $itemImageTag;
    ?>
      <h1><?php 
    echo $itemTitle;
    ?>
示例#19
0
<?php

$query = array();
if (!empty($collection)) {
    $pageNav[] = array('label' => __('Home'), 'uri' => record_url($collection));
    $query['collection'] = $collection->id;
}
$pageNav[] = array('label' => __('Browse Items'), 'uri' => url('items/browse', $query));
if (empty($collection) && total_records('Tag')) {
    $pageNav[] = array('label' => __('Item Tags'), 'uri' => url('items/tags', $query));
}
$pageNav[] = array('label' => __('Advanced Search'), 'uri' => url('items/search', $query));
return nav($pageNav)->setUlClass('nav nav-pills');
示例#20
0
<?php

// Builds query string appended to requests for Bootstrap CSS.
$theme_query = http_build_query(array('brand-primary' => '#ff7300', 'headings-font-family' => "Georgia,'Times New Roman',serif"), '', '&');
// Defines style settings for the theme.
$theme_style = array('logo' => array('header' => '<img width="300" height="124" class="logo-header"' . ' src="' . img('logo/ccam.png') . '"' . ' alt="' . __('Cochrane Cunningham Archive & Museum') . '">', 'navbar' => false, 'footer' => '<img width="190" height="50" class="logo-footer"' . ' src="https://lib.bgsu.edu/assets/img/ul-white.svg"' . ' alt="' . __('BGSU University Libraries') . '">'), 'home' => array('header' => false, 'navbar' => false, 'footer' => false), 'search' => false, 'navbar' => true, 'footer' => true, 'item' => array('browse' => array('sort' => array('Dublin Core,Title' => __('Title'), 'added' => __('Date Added')), 'picture' => true, 'elements' => false, 'description' => true, 'tags' => __('Tags:')), 'show' => array('pictures' => __('Files'), 'elements' => true, 'files' => false, 'collection' => false, 'tags' => __('Tags'), 'citation' => __('Citation'))));
// Make changes to theme if displayed as part of a collection or exhibit.
if (!empty($exhibit)) {
    // Change home to exhibit homepage.
    $theme_style['home']['header'] = record_url($exhibit);
    // Change navigation to top pages of the exhibit.
    $theme_style['navbar'] = __DIR__ . '/../nav/exhibit-pages.php';
} elseif (!empty($collection)) {
    // Change home to collection homepage.
    $theme_style['home']['header'] = record_url($collection);
    // Change navbar to link to ways of viewing collection.
    $theme_style['navbar'] = __DIR__ . '/../nav/items.php';
    // Change page search to search across collection.
    $theme_style['search'] = array('collection' => $collection->id);
}
// Load Bootstrap and Bootstrap theme files with appropriate variables.
queue_css_url('https://lib.bgsu.edu/assets/theme/bootstrap.css?' . $theme_query);
queue_css_url('https://lib.bgsu.edu/assets/theme/bootstrap-theme.css?' . $theme_query);
// Load main CSS file for the theme.
queue_css_file('theme');
// Load CSS file for this style.
queue_css_file('style/ccam');
// Load Javascript files for Bootstrap and the theme.
queue_js_url('https://lib.bgsu.edu/assets/js/bootstrap.js');
queue_js_file('theme');
// Return style information.
示例#21
0
<?php 
$collectionTitle = '';
$collectionIDs = collection_order_array();
$num_of_collections = count($collectionIDs);
$div_counter = 1;
foreach ($collectionIDs as $collectionID) {
    $collection = get_record_by_id('collection', $collectionID);
    $collection_link = link_to_collection($collectionTitle, array(), 'show', $collection);
    $collection_items = get_records('Item', array('collection' => $collection['id'], 'sort_field' => 'Scripto,Weight', 'sort_dir' => 'a'), 999);
    $num_of_collection_items = count($collection_items);
    set_loop_records('items', $collection_items);
    $collection_item_list = array();
    foreach (loop('items') as $item) {
        set_current_record('item', $item);
        array_push($collection_item_list, array('thumb' => item_image('square_thumbnail', array('alt' => metadata($item, array('Dublin Core', 'Title')))), 'link' => record_url($item), 'name' => metadata($item, array('Dublin Core', 'Title'))));
    }
    echo '<h1 style="display: inline;">' . $collection_link . '</h1>';
    echo '<hr style="visibility: hidden; margin-top: 2px; margin-bottom: 4px;" />';
    echo '<ul id="collection' . $div_counter . '" class="slider">';
    for ($i = 0; $i < $num_of_collection_items; $i++) {
        echo '<li>';
        echo '<a href="' . $collection_item_list[$i]['link'] . '" rel="tooltip" title="' . $collection_item_list[$i]['name'] . '">' . $collection_item_list[$i]['thumb'] . '</a>';
        echo '</li>';
    }
    echo '</ul>';
    echo '<hr style="visibility: hidden; margin-top: 3px; margin-bottom: 3px;" />';
    $div_counter++;
}
echo "<script> " . PHP_EOL;
echo "!function( \$ ){ " . PHP_EOL;
示例#22
0
 /**
  * Return a valid citation for this item.
  *
  * Generally follows Chicago Manual of Style note format for webpages. 
  * Implementers can use the item_citation filter to return a customized 
  * citation.
  *
  * @return string
  */
 function getCitation()
 {
     $citation = '';
     $creators = metadata($this, array('Dublin Core', 'Creator'), array('all' => true));
     // Strip formatting and remove empty creator elements.
     $creators = array_filter(array_map('strip_formatting', $creators));
     if ($creators) {
         switch (count($creators)) {
             case 1:
                 $creator = $creators[0];
                 break;
             case 2:
                 /// Chicago-style item citation: two authors
                 $creator = __('%1$s and %2$s', $creators[0], $creators[1]);
                 break;
             case 3:
                 /// Chicago-style item citation: three authors
                 $creator = __('%1$s, %2$s, and %3$s', $creators[0], $creators[1], $creators[2]);
                 break;
             default:
                 /// Chicago-style item citation: more than three authors
                 $creator = __('%s et al.', $creators[0]);
         }
         $citation .= "{$creator}, ";
     }
     $title = strip_formatting(metadata($this, array('Dublin Core', 'Title')));
     if ($title) {
         $citation .= "&#8220;{$title},&#8221; ";
     }
     $siteTitle = strip_formatting(option('site_title'));
     if ($siteTitle) {
         $citation .= "<em>{$siteTitle}</em>, ";
     }
     $accessed = format_date(time(), Zend_Date::DATE_LONG);
     $url = '<span class="citation-url">' . html_escape(record_url($this, null, true)) . '</span>';
     /// Chicago-style item citation: access date and URL
     $citation .= __('accessed %1$s, %2$s.', $accessed, $url);
     return apply_filters('item_citation', $citation, array('item' => $this));
 }
 /**
  * This returns the URI for an Omeka_Record.
  *
  * @param Omeka_Record $record The record to return the URI for.
  *
  * @return string $uri The URI to access the record with.
  * @author Eric Rochester <*****@*****.**>
  **/
 public static function getUri($record)
 {
     $uri = '';
     $action = 'show';
     $rc = get_class($record);
     if ($rc === 'SimplePagesPage') {
         $uri = url($record->slug);
     } else {
         if ($rc === 'ExhibitPage') {
             $exhibit = $record->getExhibit();
             $exUri = self::getSlugUri($exhibit, $action);
             $uri = "{$exUri}/{$record->slug}";
         } else {
             if (property_exists($record, 'slug')) {
                 $uri = self::getSlugUri($record, $action);
             } else {
                 $uri = record_url($record, $action);
             }
         }
     }
     // Always index public URLs.
     $uri = preg_replace('|/admin/|', '/', $uri, 1);
     return $uri;
 }
示例#24
0
        ?>
">

            <td>
                <div id="title-search-cell">
                    <?php 
        if ($recordImage = record_image($recordType, 'square_thumbnail')) {
            ?>
                        <?php 
            echo link_to($record, 'show', $recordImage, array('class' => 'image'));
            ?>
                    <?php 
        }
        ?>
                    <a href="<?php 
        echo record_url($record, 'show');
        ?>
"><?php 
        echo $searchText['title'] ? $searchText['title'] : '[Unknown]';
        ?>
</a>
                </div>
            </td>
            <td>
                <div id="number-search-cell">
                    <?php 
        echo __($record->id);
        ?>
                </div>
            </td>
            <td>
 public function filterItemCitation($cite, $args)
 {
     $item = $args['item'];
     if (!$item) {
         return $cite;
     }
     $contribItem = $this->_db->getTable('ContributionContributedItem')->findByItem($item);
     if (!$contribItem) {
         return $cite;
     }
     $title = metadata('item', array('Dublin Core', 'Title'));
     $siteTitle = strip_formatting(option('site_title'));
     $itemId = $item->id;
     $accessDate = date('F j, Y');
     $uri = html_escape(record_url($item, 'show', true));
     if ($contribItem->anonymous) {
         $cite = __("Anonymous, ");
     } else {
         $cite = $contribItem->Contributor->name . ", ";
     }
     $cite .= "&#8220;{$title},&#8221; ";
     if ($siteTitle) {
         $cite .= "<em>{$siteTitle}</em>, ";
     }
     $cite .= "accessed {$accessDate}, ";
     $cite .= "{$uri}.";
     return $cite;
 }
                        <?php 
        echo metadata('catalog_search_search', 'catalog_name');
        ?>
                    </a>
                </span>
                <ul class="action-links group">
                    <li><a class="edit" href="<?php 
        echo html_escape(record_url('catalog_search_search', 'edit'));
        ?>
">
                        <?php 
        echo __('Edit');
        ?>
                    </a></li>
                    <li><a class="delete-confirm" href="<?php 
        echo html_escape(record_url('catalog_search_search', 'delete-confirm'));
        ?>
">
                        <?php 
        echo __('Delete');
        ?>
                    </a></li>
                </ul>
            </td>
            <td>
<?php 
        if (!metadata('catalog_search_search', 'display')) {
            echo __('Not displayed');
        } else {
            echo __('Displayed');
        }
示例#27
0
<?php

$query['collection'] = $collection->id;
$pageNav = array(array('label' => __('Home'), 'uri' => record_url($collection)), array('label' => __('Exhibits'), 'uri' => url('exhibits/browse', $query + array('tags' => 'Centennial Memories'))), array('label' => __('Items'), 'uri' => url('items/browse', $query)), array('label' => __('Search'), 'uri' => url('items/search', $query)), array('label' => __('About'), 'uri' => url('memories-about', $query)), array('label' => __('Centennial'), 'uri' => 'http://www.bgsu.edu/centennial.html'));
return nav($pageNav)->setUlClass('nav nav-pills');
示例#28
0
/**
 * Get a link to a page within Omeka.
 *
 * The controller and action can be manually specified, or if a record is passed
 * this function will hand off to record_url to automatically get a link to
 * that record (either its default action or one explicitly chosen).
 *
 * @package Omeka\Function\View\Navigation
 * @uses record_url()
 * @uses url()
 * @param Omeka_Record_AbstractRecord|string $record The name of the controller
 * to use for the link.  If a record instance is passed, then it inflects the
 * name of the controller from the record class.
 * @param string $action The action to use for the link
 * @param string $text The text to put in the link.  Default is 'View'.
 * @param array $props Attributes for the <a> tag
 * @param array $queryParams the parameters in the uri query
 * @return string HTML
 */
function link_to($record, $action = null, $text = null, $props = array(), $queryParams = array())
{
    // If we're linking directly to a record, use the URI for that record.
    if ($record instanceof Omeka_Record_AbstractRecord) {
        $url = record_url($record, $action, false, $queryParams);
        // Otherwise $record is the name of the controller to link to.
    } else {
        $urlOptions = array();
        //Use Zend Framework's built-in 'default' route
        $route = 'default';
        $urlOptions['controller'] = (string) $record;
        if ($action) {
            $urlOptions['action'] = (string) $action;
        }
        $url = url($urlOptions, $route, $queryParams, true);
    }
    if ($text === null) {
        $text = __('View');
    }
    $attr = !empty($props) ? ' ' . tag_attributes($props) : '';
    return '<a href="' . html_escape($url) . '"' . $attr . '>' . $text . '</a>';
}
示例#29
0
">
        <ul>
        <?php 
foreach ($items as $item) {
    ?>
            <li>
            
            <?php 
    echo link_to_item(item_image('square_thumbnail', array(), 0, $item), array('class' => 'image'), 'show', $item);
    ?>
                        <p>
            <?php 
    if (isset($configs['carousel']['showTitles']) && $configs['carousel']['showTitles']) {
        ?>
                <a href="<?php 
        echo record_url($item, 'show');
        ?>
">
                <?php 
        echo metadata($item, array('Dublin Core', 'Title'));
        ?>
                </a>
                </p>
            <?php 
    }
    ?>
            </li>
        <?php 
}
?>
        </ul>
示例#30
0
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) . '">';
            echo '    <div class="overlay"></div>';
            if (metadata('item', 'has thumbnail')) {
                echo '<div style="background-image: url(' . file_display_url($image[0], 'fullsize') . ');" class="img"></div>';
            } else {
                echo '<div style="background-image: url(/themes/cornishmemory/images/fallback-video.png);" class="img"></div>';
            }
            echo '    <span class="title">' . metadata('item', array('Dublin Core', 'Title')) . '</span>';
            echo '  </a>';
            ?>
					                            </div>
					                            <?php 
        }
        ?>

					                        <?php