Skip to content

Instantly share code, notes, and snippets.

View jsicot's full-sized avatar

Julien Sicot jsicot

View GitHub Profile
@jsicot
jsicot / OaiPmhRepository_square_thumbnail
Created November 16, 2012 13:04
Omeka OaiPmhRepository - Relation : add square_thumbnail for item
From 2b5c55774c7f0f1107bbbb814cd7070c4f797da7 Mon Sep 17 00:00:00 2001
From: jsicot <julien.sicot@gmail.com>
Date: Fri, 16 Nov 2012 14:01:30 +0100
Subject: [PATCH] OaiPmhRepository - Relation : add square_thumbnail for item
---
metadata/OaiDc.php | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/metadata/OaiDc.php b/metadata/OaiDc.php
<?php
//this script use the TMDb PHP API class from glamorous https://github.com/glamorous/TMDb-PHP-API
function getInitials($name){
$words=explode(" ",$name);
$inits='';
foreach($words as $word){
$inits.=strtoupper(substr($word,0,1));
$inits.=' ';
{
"translatorID": "0e2235e7b-babf-413c-9acf-f27cce5f055d",
"label": "Unimarc MarcXML",
"creator": "Etienne Cavalie",
"target": "xml",
"minVersion": "2.1.9",
"maxVersion": "",
"priority": 50,
"configOptions": {
"dataMode": "xml/dom"
@jsicot
jsicot / gist:5142764
Last active December 14, 2015 20:19
linkToWikipedia (koha)
//Dans les XSLT au niveau des 7xx ajouter :
<a>
<xsl:attribute name="href"><xsl:text></xsl:text></xsl:attribute>
<xsl:attribute name="class"><xsl:text>wikipedia</xsl:text></xsl:attribute>
<xsl:attribute name="target"><xsl:text>_blank</xsl:text></xsl:attribute>
<xsl:value-of select="marc:subfield[@code='b']"/>
<xsl:text>+</xsl:text>
<xsl:value-of select="marc:subfield[@code='a']"/>
</a>
@jsicot
jsicot / UNIMARCslim2OPACResults.xsl
Last active December 15, 2015 06:59
UNIMARCslim2OPACResults.xsl
<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
<!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
<xsl:stylesheet version="1.0" xmlns:re = 'http://exslt.org/regular-expressions' xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:items="http://www.koha-community.org/items" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc items">
<xsl:import href="UNIMARCslimUtils.xsl"/>
<xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
<xsl:key name="item-by-status" match="items:item" use="items:status"/>
<xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
<xsl:template match="/">
<xsl:apply-templates/>
@jsicot
jsicot / UNIMARCslimUtils.xsl
Created March 22, 2013 10:51
UNIMARCslimUtils.xsl
<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="datafield">
<xsl:param name="tag"/>
<xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>
<xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param>
<xsl:param name="subfields"/>
<xsl:element name="datafield">
<xsl:attribute name="tag">
<xsl:value-of select="$tag"/>
@jsicot
jsicot / UNIMARCslim2OPACDetail.xsl
Created March 22, 2013 10:51
UNIMARCslim2OPACDetail.xsl
<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:items="http://www.koha-community.org/items" xmlns:intralinks="http://www.koha.org/intralinks" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc items">
<xsl:import href="UNIMARCslimUtils.xsl"/>
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:key name="intralinks" match="intralinks:intralinks" use="intralinks:ppn"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="marc:record">
@jsicot
jsicot / bookreaderToItemShow
Created July 16, 2013 14:33
add bookreader viewer
echo get_specific_plugin_hook_output('BookReader' , 'public_items_show', array('view' => $this,'item' => $item,'page' => '0','embed_functions' => false,));
@jsicot
jsicot / gist:7008816
Last active December 25, 2015 16:49
Quick fix for summon localization
if((__locale == "en-US" && __summonLocale = 'en') || __locale == "en") {
__translations = {"Always check your references for accuracy":"Vérifiez toujours l'exactitude de vos références","Czech":"Tchèque","Kannada":null,"Clear":"Effacer","to present":"jusqu'à aujourd'hui","Sep":"Sept.","Danish":null,"only in unstable":"only in unstable","Publication":"Publication","Poem":"Poème","Newspaper Article":"Article de Presse","Type (e.g. book, journal article, etc.)":"Type (p. ex. livre, article de périodique, etc.)","Western Frisian":"Frison occidental","Standard":"Norme","Image (if any)":"Image (le cas échéant)","Journal Article":"Article de périodique","Publisher":"Éditeur","Azerbaijani":"Azerbaïdjanais","Serbian":"Serbe","inupiaq":null,"About":"À-propos","Try different keywords.":"Essayez avec d'autres mots-clés.","Kit":"Ensemble multi-supports","Personal Narrative":"Récit","Exclude Newspaper Articles":"Exclure les articles de presse","Available Online":"Accessible en ligne","Note This list of saved items may not
@jsicot
jsicot / local.js
Created October 16, 2013 15:53
Fix for summon 2.0 localization
if(__locale == "fr") {
jQuery(document).ready(function($){
$('div.languageSwitcher a.customSecondaryLink').text("Français ").append("<b class='caret'></b>");
})
__locale == "fr-FR";
__summonLocale = 'fr-FR';
__translations = {"Always check your references for accuracy":"Vérifiez toujours l'exactitude de vos références","Czech":"Tchèque","Kannada":null,"Clear":"Effacer","to present":"jusqu'à aujourd'hui","Sep":"Sept.","Danish":null,"only in unstable":"only in unstable","Publication":"Publication","Poem":"Poème","Newspaper Article":"Article de Presse","Type (e.g. book, journal article, etc.)":"Type (p. ex. livre, article de périodique, etc.)","Western Frisian":"Frison occidental","Standard":"Norme","Image (if any)":"Image (le cas échéant)","Journal Article":"Article de périodique","Publisher":"Éditeur","Azerbaijani":"Azerbaïdjanais","Serbian":"Serbe","inupiaq":null,"About":"À-propos","Try different keywords.":"Essayez avec d'autres mots-clés.","Kit":"Ensemble multi-supports","Personal Narrative":"Récit"