コード例 #1
0
ファイル: GetItemMarkupTest.php プロジェクト: saden1/Neatline
 /**
  * When no record is passed, or when a record is passed that doesn't match
  * any custom templates, render the `item.php` template, which is provided
  * in the plugin core and can be overridden in the theme.
  */
 public function testDefaultItemTemplate()
 {
     $exhibit = $this->_exhibit('no-custom-theme');
     $item = $this->_item();
     $record = $this->_record($exhibit, $item);
     // No record passed.
     $markup = nl_getItemMarkup($item);
     $this->assertEquals($item->id, trim($markup));
     // No exhibit/record-specific templates.
     $markup = nl_getItemMarkup($item, $record);
     $this->assertEquals($item->id, trim($markup));
 }
コード例 #2
0
ファイル: ItemsController.php プロジェクト: saden1/Neatline
 /**
  * Get the compiled metadata for an individual Omeka item.
  * @REST
  */
 public function getAction()
 {
     // Load the Omeka item.
     $item = $this->_helper->db->findById();
     $record = null;
     // If a record is specified, load it.
     if (!is_null($this->_request->record)) {
         $rTable = $this->_helper->db->getTable('NeatlineRecord');
         $record = $rTable->find($this->_request->record);
     }
     // Output the item metadata
     echo nl_getItemMarkup($item, $record);
 }