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 | |
/** | |
* Converts any URLs in a given string to links. | |
* | |
* @param string $str The string to be searched for URLs to convert to links. | |
* @return string | |
**/ | |
function url_to_link($str) | |
{ | |
$pattern = "((https?://)+[\w\d:#@%!/;$()~_?\+-=\\\.&]*)"; |
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 | |
/** | |
* Retrieve a substring of the text by limiting the word count. | |
* Note: it strips the HTML tags from the text before getting the snippet | |
* | |
* @param string $text The text string to snip. | |
* @param integer $maxWords The number of words to return from the text. | |
* @param string $endString Optional string to use on the end of the | |
* returned snippet. Uses '….' by default. | |
* @return 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 | |
// Hook the 'filter_items_by_exhibit' into the Items SQL. | |
add_plugin_hook('item_browse_sql', 'filter_items_by_exhibit'); | |
/** | |
* Filters the 'item_browse_sql' select to return items in a given | |
* Exhibit. Checks for the existence of a parameter called 'exhibit' | |
* with a value of either an Exhibit object or Exhibit ID. | |
*/ |
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 head(array('title' => item('Dublin Core', 'Title'),'bodyid'=>'items','bodyclass' => 'show')); ?> | |
<?php $collectionName = collection('Name', get_collection_for_item()); | |
if ($collectionName == 'Media Reports and Commentary'): ?> | |
<div id="primary"> | |
<h5><?php echo item('Dublin Core', 'Title'); ?></h5> |
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
jQuery(document).ready(function($){ | |
// Hide all the element texts to start. | |
$('.element-set .element-text').hide(); | |
// When you click a h3 inside a .element, show it's sibling .element-text div. | |
// Also adds some CSS at the end to use the pointer cursor. | |
$('.element-set .element h3').click(function(){ | |
$(this).siblings('.element-text').toggle('slow'); | |
}).css({'cursor': 'pointer'}); | |
}); |
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 | |
/** | |
* Displays a simple JavaScript-powered image gallery for an Omeka item. | |
* Clicking on a thumbnail displays its larger image. Requires jQuery. | |
* | |
* @param Item|null $item Check for this specific item record (current item if null). | |
* @return string HTML | |
*/ | |
function display_image_gallery_for_item($item = null) |
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
diff --git a/application/helpers/LinkFunctions.php b/application/helpers/LinkFunctions.php | |
index 7316271..e83449c 100644 | |
--- a/application/helpers/LinkFunctions.php | |
+++ b/application/helpers/LinkFunctions.php | |
@@ -23,11 +23,11 @@ | |
* @param array $queryParams the parameters in the uri query | |
* @return string HTML | |
*/ | |
-function link_to($record, $action=null, $text='View', $props = array(), $queryParams=array()) | |
+function link_to($record, $action=null, $text='View', $props = array(), $queryParams=array(), $controller=null) |
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
#! /usr/bin/env bash | |
DOTFILES = ~/.dotfiles | |
mkdir ~/.dotfiles.old | |
for i in ~/.vim ~/.vimrc ~/.gvimrc ~/vimfiles ~/.bash_profile ~/.gitignore ~/.gitconfig; do | |
[ -e $i ] && mv $i ~/.dotfiles.old | |
done |