This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Replace the title of all items in Exhibit Builder with a different field. | |
* | |
* Add this to a new plugin, change the field to whatever field you want, and | |
* activate the plugin. | |
*/ | |
function exhibit_item_title_switch($title, $item) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Function to filter item_citation to account for multiple creators. | |
*/ | |
function item_citation_multiple_creators($cite, $item) { | |
$cite = ''; | |
if ($creators = item('Dublin Core', 'Creator', array('all' => true), $item)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($itemImages = get_files(array('item_id' => item('id'), 'has_derivative_image' => 1))) { | |
echo display_files($itemImages, array('imageSize' => 'fullsize')); | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_plugin_hook('define_acl', 'neatlinews_define_acl'); | |
function neatlinews_define_acl($acl) | |
{ | |
$resourceList = array( | |
'Neatline_Index' => array( | |
'add', | |
'browse', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Define the ACL | |
*/ | |
public function defineAcl($acl) | |
{ | |
if (version_compare(OMEKA_VERSION, '2.0-dev', '>=')) { | |
$acl->addResource('Neatline_Exhibits'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if($itemTypeName = Zend_Controller_Front::getInstance()->getRequest()->getParam('type')) { | |
$itemTypeName = get_db()->getTable('ItemType')->findByName($itemTypeName)->name; | |
$title = 'Browse '. $itemTypeName . 's'; | |
} else { | |
$title = 'Browse Items'; | |
} | |
head(array('title'=>$title,'bodyid'=>'items','bodyclass' => 'browse')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_custom_coins_title($coinsTitle) | |
{ | |
global $post; | |
$affiliation = get_post_meta($post->ID, 'affiliation', true); | |
$issue = get_post_meta($post->ID, 'issue', true); | |
$volume = get_post_meta($post->ID, 'volume', true); | |
$pub_date = get_post_meta($post->ID, 'pub_date', true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Custom Post Type for People | |
*/ | |
function people_register_post_types() { | |
register_post_type( 'people', | |
array( | |
'labels' => array( | |
'name' => __( 'People' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function sanitize_string($string) { | |
$string = strtolower($string); | |
// Gets rid of spaces | |
$sanitized = preg_replace('/\s/', '', $string); | |
// Gets rid of non-alphanumerics | |
$sanitized = preg_replace( '/[^A-Za-z0-9_]/', '', $string ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change the link around images files in Omeka to point to the | |
* fullsize image, not the archival image. | |
* | |
* Uses the 'display_file' filter in Omeka 1.5. | |
*/ | |
function link_images_to_fullsize($html, $file, $callback, $options, $wrapperAttributes) { |