Permalink
Browse files

first commit

  • Loading branch information...
1 parent af90368 commit d1f1238d10d70fbb9f41fddb41529138580f139a @mjsuhonos committed May 21, 2010
Showing with 8,082 additions and 0 deletions.
  1. +35 −0 INSTALL
  2. +619 −0 LICENSE
  3. +182 −0 MARC21slimUtils.xsl
  4. +136 −0 codes.php
  5. +209 −0 functions.php
  6. +163 −0 image.php
  7. BIN img/apple-touch-icon.png
  8. BIN img/maps.gif
  9. BIN img/mytpl-alpha.png
  10. BIN img/no-image-cd.png
  11. BIN img/no-image-dvd.png
  12. BIN img/no-image-text.png
  13. +76 −0 index.php
  14. +506 −0 iso.php
  15. +608 −0 iui/ext-sandbox/masabi/iui_ext.js
  16. BIN iui/ext-sandbox/masabi/t/default/dpBack.png
  17. BIN iui/ext-sandbox/masabi/t/default/dpFwd.png
  18. +64 −0 iui/ext-sandbox/masabi/t/default/iui_ext.css
  19. BIN iui/ext-sandbox/masabi/t/default/listArrow.png
  20. BIN iui/ext-sandbox/masabi/t/default/tick.png
  21. +105 −0 iui/ext-sandbox/view/iui-views.js
  22. +47 −0 iui/ext-sandbox/view/view-test.html
  23. +50 −0 iui/ext-sandbox/view/view-test.js
  24. +399 −0 iui/iui.css
  25. +666 −0 iui/iui.js
  26. +1 −0 iui/iuix.css
  27. +1 −0 iui/iuix.js
  28. +62 −0 iui/js/iui-event-log.js
  29. +42 −0 iui/js/iui-theme-switcher.js
  30. +220 −0 iui/t/ThemeImageCatalog.html
  31. BIN iui/t/default/back-img.png
  32. BIN iui/t/default/backButton.png
  33. BIN iui/t/default/backButtonBack.png
  34. BIN iui/t/default/backButtonBrdr.png
  35. BIN iui/t/default/blueButton.png
  36. BIN iui/t/default/cancel.png
  37. +107 −0 iui/t/default/default-theme.css
  38. BIN iui/t/default/grayButton.png
  39. BIN iui/t/default/listArrow.png
  40. BIN iui/t/default/listArrowSel.png
  41. BIN iui/t/default/listGroup.png
  42. BIN iui/t/default/loading.gif
  43. BIN iui/t/default/pinstripes.png
  44. BIN iui/t/default/redButton.png
  45. BIN iui/t/default/selection.png
  46. BIN iui/t/default/thumb.png
  47. BIN iui/t/default/title-img.png
  48. BIN iui/t/default/toggle.png
  49. BIN iui/t/default/toggleOn.png
  50. BIN iui/t/default/toolButton.png
  51. BIN iui/t/default/toolbar.png
  52. BIN iui/t/default/whiteButton.png
  53. +109 −0 iui/t/defaultgrad/defaultgrad-theme.css
  54. BIN iui/t/ipdc/Logo_DevCamp.png
  55. BIN iui/t/ipdc/backButton.png
  56. BIN iui/t/ipdc/beige.png
  57. BIN iui/t/ipdc/blueButton.png
  58. +102 −0 iui/t/ipdc/ipdc-theme.css
  59. BIN iui/t/ipdc/listGroup.png
  60. BIN iui/t/ipdc/pinstripes.png
  61. BIN iui/t/ipdc/redButton.png
  62. BIN iui/t/ipdc/toggleOn.png
  63. BIN iui/t/ipdc/toolButton.png
  64. BIN iui/t/ipdc/toolbar.png
  65. +3,267 −0 marc2mods.xsl
  66. +120 −0 mytpl.css
  67. +79 −0 record.php
  68. +107 −0 search.php
View
35 INSTALL
@@ -0,0 +1,35 @@
+MyTPL - Location-aware Mobile Search using PHP-YAZ and IUI
+
+System Requirements
+-------------------
+Minimum server requirements:
+
+* PHP >= 5.x with XSL and DOM extensions installed
+* IndexData's PHPYAZ extension (requires YAZ) <http://www.indexdata.com/phpyaz>
+* Apache or Microsoft IIS
+* Operating system: Any OS that supports the above software
+
+Installation
+------------
+
+1. Extract the MyTPL archive to the desired location in your web
+documents directory.
+
+2. Ensure that the covers/ and records/ directories are writeable by
+your web server.
+
+3. Edit $connect_string in search.php to point to your library's
+Z39.50 interface; eg. hostname:port/database
+
+4. To enable correct branch/item location, some modification will be
+required to codes.php (an array of lat/long locations for branches)
+and functions.php around lines 50-70. These will depend on what holdings
+information is available (if any) in the MARCXML response provided by
+the ILS' Z39.50 implementation.
+
+5. You may wish to modify image.php to provide necessary API keys for
+retrieving cover art and music descriptions.
+
+6. You'll probably want to modify img/mytpl-alpha.png for your project.
+
+7. Enjoy!
View
619 LICENSE

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <!-- 08/08/08: tmee added corrected chopPunctuation templates for 260c -->
+ <!-- 08/19/04: ntra added "marc:" prefix to datafield element -->
+ <!-- 12/14/07: ntra added url encoding template -->
+ <!-- url encoding -->
+
+ <xsl:variable name="ascii">
+ <xsl:text> !"#$%&amp;'()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~</xsl:text>
+ </xsl:variable>
+
+ <xsl:variable name="latin1">
+ <xsl:text> ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ</xsl:text>
+ </xsl:variable>
+ <!-- Characters that usually don't need to be escaped -->
+ <xsl:variable name="safe">
+ <xsl:text>!'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~</xsl:text>
+ </xsl:variable>
+
+ <xsl:variable name="hex">0123456789ABCDEF</xsl:variable>
+
+
+ <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="marc:datafield">
+ <xsl:attribute name="tag">
+ <xsl:value-of select="$tag"/>
+ </xsl:attribute>
+ <xsl:attribute name="ind1">
+ <xsl:value-of select="$ind1"/>
+ </xsl:attribute>
+ <xsl:attribute name="ind2">
+ <xsl:value-of select="$ind2"/>
+ </xsl:attribute>
+ <xsl:copy-of select="$subfields"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template name="subfieldSelect">
+ <xsl:param name="codes">abcdefghijklmnopqrstuvwxyz</xsl:param>
+ <xsl:param name="delimeter">
+ <xsl:text> </xsl:text>
+ </xsl:param>
+ <xsl:variable name="str">
+ <xsl:for-each select="marc:subfield">
+ <xsl:if test="contains($codes, @code)">
+ <xsl:value-of select="text()"/>
+ <xsl:value-of select="$delimeter"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
+ </xsl:template>
+
+ <xsl:template name="buildSpaces">
+ <xsl:param name="spaces"/>
+ <xsl:param name="char">
+ <xsl:text> </xsl:text>
+ </xsl:param>
+ <xsl:if test="$spaces&gt;0">
+ <xsl:value-of select="$char"/>
+ <xsl:call-template name="buildSpaces">
+ <xsl:with-param name="spaces" select="$spaces - 1"/>
+ <xsl:with-param name="char" select="$char"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="chopPunctuation">
+ <xsl:param name="chopString"/>
+ <xsl:param name="punctuation">
+ <xsl:text>.:,;/ </xsl:text>
+ </xsl:param>
+ <xsl:variable name="length" select="string-length($chopString)"/>
+ <xsl:choose>
+ <xsl:when test="$length=0"/>
+ <xsl:when test="contains($punctuation, substring($chopString,$length,1))">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
+ <xsl:with-param name="punctuation" select="$punctuation"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="not($chopString)"/>
+ <xsl:otherwise>
+ <xsl:value-of select="$chopString"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="chopPunctuationFront">
+ <xsl:param name="chopString"/>
+ <xsl:variable name="length" select="string-length($chopString)"/>
+ <xsl:choose>
+ <xsl:when test="$length=0"/>
+ <xsl:when test="contains('.:,;/[ ', substring($chopString,1,1))">
+ <xsl:call-template name="chopPunctuationFront">
+ <xsl:with-param name="chopString" select="substring($chopString,2,$length - 1)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="not($chopString)"/>
+ <xsl:otherwise>
+ <xsl:value-of select="$chopString"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="chopPunctuationBack">
+ <xsl:param name="chopString"/>
+ <xsl:param name="punctuation">
+ <xsl:text>.:,;/] </xsl:text>
+ </xsl:param>
+ <xsl:variable name="length" select="string-length($chopString)"/>
+ <xsl:choose>
+ <xsl:when test="$length=0"/>
+ <xsl:when test="contains($punctuation, substring($chopString,$length,1))">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
+ <xsl:with-param name="punctuation" select="$punctuation"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="not($chopString)"/>
+ <xsl:otherwise>
+ <xsl:value-of select="$chopString"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- nate added 12/14/2007 for lccn.loc.gov: url encode ampersand, etc. -->
+ <xsl:template name="url-encode">
+
+ <xsl:param name="str"/>
+
+ <xsl:if test="$str">
+ <xsl:variable name="first-char" select="substring($str,1,1)"/>
+ <xsl:choose>
+ <xsl:when test="contains($safe,$first-char)">
+ <xsl:value-of select="$first-char"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="codepoint">
+ <xsl:choose>
+ <xsl:when test="contains($ascii,$first-char)">
+ <xsl:value-of select="string-length(substring-before($ascii,$first-char)) + 32"/>
+ </xsl:when>
+ <xsl:when test="contains($latin1,$first-char)">
+ <xsl:value-of select="string-length(substring-before($latin1,$first-char)) + 160"/>
+ <!-- was 160 -->
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="no">Warning: string contains a character
+ that is out of range! Substituting "?".</xsl:message>
+ <xsl:text>63</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="hex-digit1" select="substring($hex,floor($codepoint div 16) + 1,1)"/>
+ <xsl:variable name="hex-digit2" select="substring($hex,$codepoint mod 16 + 1,1)"/>
+ <!-- <xsl:value-of select="concat('%',$hex-digit2)"/> -->
+ <xsl:value-of select="concat('%',$hex-digit1,$hex-digit2)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="string-length($str) &gt; 1">
+ <xsl:call-template name="url-encode">
+ <xsl:with-param name="str" select="substring($str,2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>
+<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
+<metaInformation>
+<scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
+</metaInformation>
+-->
Oops, something went wrong.

0 comments on commit d1f1238

Please sign in to comment.