Refbase update_2021-01-28_15_58
This commit is contained in:
1080
includes/atomxml.inc.php
Normal file
1080
includes/atomxml.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
231
includes/cite.inc.php
Normal file
231
includes/cite.inc.php
Normal file
@@ -0,0 +1,231 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/cite.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/cite.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 25-May-06, 15:19
|
||||
// Modified: $Date: 2012-02-27 20:25:30 +0000 (Mon, 27 Feb 2012) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1337 $
|
||||
|
||||
// This file contains functions
|
||||
// that are used when outputting
|
||||
// references as citations.
|
||||
|
||||
|
||||
// Include common transliteration/translation tables and search & replace patterns
|
||||
include 'includes/transtab_refbase_rtf.inc.php'; // include refbase markup -> RTF search & replace patterns
|
||||
include 'includes/transtab_refbase_pdf.inc.php'; // include refbase markup -> PDF search & replace patterns
|
||||
include 'includes/transtab_refbase_latex.inc.php'; // include refbase markup -> LaTeX search & replace patterns
|
||||
include 'includes/transtab_refbase_markdown.inc.php'; // include refbase markup -> Markdown search & replace patterns
|
||||
include 'includes/transtab_refbase_ascii.inc.php'; // include refbase markup -> plain text search & replace patterns
|
||||
|
||||
if ($contentTypeCharset == "UTF-8") // variable '$contentTypeCharset' is defined in 'ini.inc.php'
|
||||
include_once 'includes/transtab_unicode_latex.inc.php'; // include Unicode -> LaTeX translation table
|
||||
else // we assume "ISO-8859-1" by default
|
||||
include_once 'includes/transtab_latin1_latex.inc.php'; // include Latin1 -> LaTeX translation table
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Print any section heading(s):
|
||||
function generateSectionHeading($yearsArray, $typeTitlesArray, $row, $citeOrder, $headingPrefix, $headingSuffix, $sectionMarkupPrefix, $sectionMarkupSuffix, $subSectionMarkupPrefix, $subSectionMarkupSuffix)
|
||||
{
|
||||
global $loc;
|
||||
|
||||
$sectionHeading = "";
|
||||
|
||||
if (!empty($row['year']))
|
||||
$yearHeading = $row['year'];
|
||||
else
|
||||
$yearHeading = $loc["notSpecified"];
|
||||
|
||||
// List records in blocks sorted by record type:
|
||||
if (($citeOrder == "type") OR ($citeOrder == "type-year"))
|
||||
{
|
||||
$typeTitle = generateTypeTitle($row['type'], $row['thesis']); // assign an appropriate title to this record type
|
||||
|
||||
if (!in_array($typeTitle, $typeTitlesArray)) // if this record's type title hasn't occurred already
|
||||
{
|
||||
$typeTitlesArray[$row['type']] = $typeTitle; // add this title to the array of type titles
|
||||
$sectionHeading .= $headingPrefix . $sectionMarkupPrefix . $typeTitle . $sectionMarkupSuffix . $headingSuffix; // print out a the current record type
|
||||
}
|
||||
|
||||
// List records in sub-blocks sorted by year:
|
||||
if ($citeOrder == "type-year")
|
||||
{
|
||||
if (!isset($yearsArray[$typeTitle]) OR !in_array($yearHeading, $yearsArray[$typeTitle])) // if this record's year hasn't occurred already for this record's type
|
||||
{
|
||||
$yearsArray[$typeTitle][] = $yearHeading; // add it to the record-specific array of years
|
||||
$sectionHeading .= $headingPrefix . $subSectionMarkupPrefix . $yearHeading . $subSectionMarkupSuffix . $headingSuffix; // print out a the current year
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// List records in blocks sorted by year:
|
||||
elseif ($citeOrder == "year")
|
||||
{
|
||||
if (!in_array($yearHeading, $yearsArray)) // if this record's year hasn't occurred already
|
||||
{
|
||||
$yearsArray[] = $yearHeading; // add it to the array of years
|
||||
$sectionHeading .= $headingPrefix . $sectionMarkupPrefix . $yearHeading . $sectionMarkupSuffix . $headingSuffix; // print out a the current year
|
||||
}
|
||||
}
|
||||
|
||||
return array($yearsArray, $typeTitlesArray, $sectionHeading);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Assign an appropriate title to a given record or thesis type:
|
||||
function generateTypeTitle($recordType, $thesis)
|
||||
{
|
||||
global $contentTypeCharset; // defined in 'ini.inc.php'
|
||||
|
||||
global $citeType;
|
||||
global $loc;
|
||||
|
||||
global $availableTypeTitlesArray; // these variables are made globally available from within this function
|
||||
global $availableThesisTitlesArray;
|
||||
|
||||
if (empty($thesis))
|
||||
{
|
||||
if (!isset($availableTypeTitlesArray))
|
||||
// Map record types with items of the global localization array ('$loc'):
|
||||
$availableTypeTitlesArray = array(
|
||||
"Journal Article" => "JournalArticles",
|
||||
"Abstract" => "Abstracts",
|
||||
"Book Chapter" => "BookContributions",
|
||||
"Book Whole" => "Monographs",
|
||||
"Conference Article" => "ConferenceArticles",
|
||||
"Conference Volume" => "ConferenceVolumes",
|
||||
"Journal" => "Journals",
|
||||
"Magazine Article" => "MagazineArticles",
|
||||
"Manual" => "Manuals",
|
||||
"Manuscript" => "Manuscripts",
|
||||
"Map" => "Maps",
|
||||
"Miscellaneous" => "Miscellaneous",
|
||||
"Newspaper Article" => "NewspaperArticles",
|
||||
"Patent" => "Patents",
|
||||
"Report" => "Reports",
|
||||
"Software" => "Software"
|
||||
);
|
||||
|
||||
if (isset($recordType, $availableTypeTitlesArray))
|
||||
$typeTitle = $loc[$availableTypeTitlesArray[$recordType]];
|
||||
else
|
||||
$typeTitle = $loc["OtherPublications"];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isset($availableThesisTitlesArray))
|
||||
// Map thesis types with items of the global localization array ('$loc'):
|
||||
$availableThesisTitlesArray = array(
|
||||
"Bachelor's thesis" => "Theses_Bachelor",
|
||||
"Master's thesis" => "Theses_Master",
|
||||
"Ph.D. thesis" => "Theses_PhD",
|
||||
"Diploma thesis" => "Theses_Diploma",
|
||||
"Doctoral thesis" => "Theses_Doctoral",
|
||||
"Habilitation thesis" => "Theses_Habilitation"
|
||||
);
|
||||
|
||||
if (isset($thesis, $availableThesisTitlesArray))
|
||||
$typeTitle = $loc[$availableThesisTitlesArray[$thesis]];
|
||||
else
|
||||
$typeTitle = $loc["Theses_Other"];
|
||||
}
|
||||
|
||||
if (!preg_match("/^html$/i", $citeType)) // for citation formats other than HTML:
|
||||
// apply dirty hack that reverses the HTML encoding of locales (which were HTML encoded globally in 'core.inc.php');
|
||||
// note that function 'html_entity_decode' doesn't support multibyte character sets (such as UTF-8) in PHP versions < 5
|
||||
// (see <http://www.php.net/manual/en/function.html-entity-decode.php>)
|
||||
$typeTitle = html_entity_decode($typeTitle, ENT_QUOTES, $contentTypeCharset);
|
||||
|
||||
return $typeTitle;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Format page information:
|
||||
//
|
||||
// NOTES: - this function (and refbase in general) assumes following rules for the original formatting of page information in '$origPageInfo':
|
||||
// - single-page items are given as a page range with identical start & end numbers (e.g. "127-127")
|
||||
// - multi-page items are given as a page range where the end number is greater than the start number (e.g. "127-132")
|
||||
// - for multi-page items where only the start page is known, a hyphen is appended to the start page (e.g. "127-")
|
||||
// - total number of pages are given with a "pp" suffix (e.g. "498 pp"), see TODO
|
||||
// - the given page info is left as is if it does not match any of the above rules (e.g. a single page number is ambiguous since it
|
||||
// could mean a single page or the total number of pages)
|
||||
// - the function attempts to deal with page locators that contain letters (e.g. "A1 - A3" or "4a-4c") but, ATM, locator parts (e.g. "A1")
|
||||
// must contain at least one digit character & must not contain any whitespace
|
||||
//
|
||||
// TODO: - should we only use Unicode-aware regex expressions (i.e. always use '$space', '$digit' or '$word' instead of ' ', '\d' or '\w', etc)?
|
||||
// - recognize & process total number of pages
|
||||
// - for '$shortenPageRangeEnd=true', add support for page locators that contain letters (e.g. "A1 - A3" or "4a-4c")
|
||||
function formatPageInfo($origPageInfo, $pageRangeDelim = "-", $singlePagePrefix = "", $pageRangePrefix = "", $totalPagesPrefix = "", $singlePageSuffix = "", $pageRangeSuffix = "", $totalPagesSuffix = "", $shortenPageRangeEnd = false)
|
||||
{
|
||||
global $alnum, $alpha, $cntrl, $dash, $digit, $graph, $lower, $print, $punct, $space, $upper, $word, $patternModifiers; // defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
|
||||
|
||||
// Check original page info for any recognized page locators, and process them appropriately:
|
||||
if (preg_match("/\w*\d+\w* *[$dash]+ *(?:\w*\d+\w*)?/$patternModifiers", $origPageInfo)) // the original page info contains a page range (like: "127-127", "127-132", "A1 - A3", "4a-4c", or "127-" if only start page given)
|
||||
{
|
||||
// Remove any whitespace around dashes or hyphens that indicate a page range:
|
||||
$origPageInfo = preg_replace("/(\w*\d+\w*) *([$dash]+) *(\w*\d+\w*)?(?=[^\w\d]|$)/$patternModifiers", "\\1\\2\\3", $origPageInfo);
|
||||
|
||||
// Split original page info into its functional parts:
|
||||
// NOTE: ATM, we simply split on any whitespace characters, then process all parts with page ranges
|
||||
// (this will also reduce runs of whitespace to a single space)
|
||||
$partsArray = preg_split("/ +/", $origPageInfo);
|
||||
$partsCount = count($partsArray);
|
||||
|
||||
for ($i=0; $i < $partsCount; $i++)
|
||||
{
|
||||
// Format parts with page ranges:
|
||||
// - single-page item:
|
||||
if (preg_match("/(\w*\d+\w*)[$dash]+\\1(?=[^\w\d]|$)/$patternModifiers", $partsArray[$i])) // this part contains a page range with identical start & end numbers (like: "127-127")
|
||||
$partsArray[$i] = preg_replace("/(\w*\d+\w*)[$dash]+\\1(?=[^\w\d]|$)/$patternModifiers", $singlePagePrefix . "\\1" . $singlePageSuffix, $partsArray[$i]);
|
||||
|
||||
// - multi-page item:
|
||||
elseif (preg_match("/\w*\d+\w*[$dash]+(?:\w*\d+\w*)?(?=[^\w\d]|$)/$patternModifiers", $partsArray[$i])) // this part contains a page range (like: "127-132", or "127-" if only start page given)
|
||||
{
|
||||
// In case of '$shortenPageRangeEnd=true', we abbreviate ending page numbers so that digits aren't repeated unnecessarily:
|
||||
if ($shortenPageRangeEnd AND preg_match("/\d+[$dash]+\d+/$patternModifiers", $partsArray[$i])) // ATM, only digit-only page locators (like: "127-132") are supported
|
||||
{
|
||||
// NOTE: the logic of this 'if' clause doesn't work if the original page info contains something like "173-190; 195-195" (where, for the first page range, '$endPage' would be "190;" and not "190")
|
||||
list($startPage, $endPage) = preg_split("/[$dash]+/$patternModifiers", $partsArray[$i]);
|
||||
|
||||
$countStartPage = strlen($startPage);
|
||||
$countEndPage = strlen($endPage);
|
||||
|
||||
if(($countStartPage == $countEndPage) AND ($startPage < $endPage))
|
||||
{
|
||||
for ($j=0; $j < $countStartPage; $j++)
|
||||
{
|
||||
if (preg_match("/^" . substr($startPage, $j, 1) . "/", $endPage)) // if the ending page number has a digit that's identical to the starting page number (at the same digit offset)
|
||||
$endPage = substr($endPage, 1); // remove the first digit from the remaining ending page number
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$partsArray[$i] = $pageRangePrefix . $startPage . $pageRangeDelim . $endPage . $pageRangeSuffix;
|
||||
}
|
||||
else // don't abbreviate ending page numbers:
|
||||
$partsArray[$i] = preg_replace("/(\w*\d+\w*)[$dash]+(\w*\d+\w*)?(?=[^\w\d]|$)/$patternModifiers", $pageRangePrefix . "\\1" . $pageRangeDelim . "\\2" . $pageRangeSuffix, $partsArray[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
$newPageInfo = join(" ", $partsArray); // merge again all parts
|
||||
}
|
||||
else
|
||||
$newPageInfo = $origPageInfo; // page info is ambiguous, so we don't mess with it
|
||||
|
||||
return $newPageInfo;
|
||||
}
|
||||
?>
|
||||
39
includes/classes/include.php
Normal file
39
includes/classes/include.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP XML Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP XML Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP XML Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include file for ActiveLink IORCA
|
||||
*/
|
||||
|
||||
|
||||
// define included package locations
|
||||
$GLOBALS["IORCA"]["BASE"]["PATH"] = dirname(__FILE__) . "/";
|
||||
|
||||
|
||||
function import($classPath) {
|
||||
$importFile = str_replace(".", "/", $classPath) . ".php";
|
||||
require_once($GLOBALS["IORCA"]["BASE"]["PATH"] . $importFile);
|
||||
}
|
||||
|
||||
?>
|
||||
173
includes/classes/org/active-link/net/HTTPClient.php
Normal file
173
includes/classes/org/active-link/net/HTTPClient.php
Normal file
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP NET Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP NET Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP NET Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP NET Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* requires Socket class
|
||||
*/
|
||||
import("org.active-link.net.Socket");
|
||||
|
||||
/**
|
||||
* HTTPClient class provides HTTP request functionality and ability to retrieve response
|
||||
* @class HTTPClient
|
||||
* @package org.active-link.net
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
* @extends Socket
|
||||
* @requires Socket
|
||||
* @see Socket
|
||||
*/
|
||||
|
||||
class HTTPClient extends Socket {
|
||||
|
||||
// protected properties
|
||||
var $defaultRequestMethod;
|
||||
var $defaultRequestURI;
|
||||
var $defaultRequestVersion;
|
||||
var $defaultRequestUserAgent;
|
||||
var $defaultRequestBody;
|
||||
var $requestMethod;
|
||||
var $requestURI;
|
||||
var $requestVersion;
|
||||
var $requestUserAgent;
|
||||
var $requestHeaders;
|
||||
|
||||
/**
|
||||
* HTTP client class constructor accepts host (required) and port (optional, default 80) arguments
|
||||
* @method HTTPClient
|
||||
* @param string host
|
||||
* @param optional int port
|
||||
*/
|
||||
function HTTPClient($host, $port = 80) {
|
||||
$this->Socket($host, $port);
|
||||
$this->defaultRequestMethod = "GET";
|
||||
$this->defaultRequestURI = "/";
|
||||
$this->defaultRequestVersion = "HTTP/1.0";
|
||||
$this->defaultRequestUserAgent = "ActiveLink NET Object/0.3.3";
|
||||
$this->defaultRequestBody = "";
|
||||
$this->requestMethod = $this->defaultRequestMethod;
|
||||
$this->requestURI = $this->defaultRequestURI;
|
||||
$this->requestVersion = $this->defaultRequestVersion;
|
||||
$this->requestUserAgent = $this->defaultRequestUserAgent;
|
||||
$this->requestBody = $this->defaultRequestBody;
|
||||
$this->requestHeaders = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a supplied raw header to the internal header array
|
||||
* @method addRequestHeaderRaw
|
||||
* @param string header
|
||||
* @returns none
|
||||
*/
|
||||
function addRequestHeaderRaw($header) {
|
||||
$this->requestHeaders[] = $header;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a string containing all HTTP request headers in their raw form
|
||||
* @method getRequestHeaders
|
||||
* @returns string request HTTP headers
|
||||
*/
|
||||
function getRequestHeaders() {
|
||||
$headers = $this->requestMethod . " " . $this->requestURI . " " . $this->requestVersion . "\r\n";
|
||||
$headers .= "User-Agent: " . $this->requestUserAgent . "\r\n";
|
||||
$headers .= "Host: " . $this->host . "\r\n";
|
||||
foreach($this->requestHeaders as $header) {
|
||||
$headers .= $header . "\r\n";
|
||||
}
|
||||
if($this->requestMethod == "POST") {
|
||||
$contentLength = strlen($this->requestBody);
|
||||
$headers .= "Content-length: " . $contentLength . "\r\n";
|
||||
}
|
||||
$headers .= "Connection: close\r\n\r\n";
|
||||
return $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets HTTP request body/payload, used only when request method is POST
|
||||
* @method setRequestBody
|
||||
* @param string body
|
||||
* @returns none
|
||||
*/
|
||||
function setRequestBody($body) {
|
||||
$this->requestBody = $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets HTTP request method, GET or POST
|
||||
* @method setRequestMethod
|
||||
* @param string method
|
||||
* @returns none
|
||||
*/
|
||||
function setRequestMethod($method) {
|
||||
$this->requestMethod = strtoupper($method);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets request URI, if not set here, default will be /
|
||||
* @method setRequestURI
|
||||
* @param string uri
|
||||
* @returns none
|
||||
*/
|
||||
function setRequestURI($uri) {
|
||||
$this->requestURI = $uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets HTTP request User-Agent to send to the server, default is "ActiveLink NET Object/version"
|
||||
* @method setRequestUserAgent
|
||||
* @param string userAgent
|
||||
* @returns none
|
||||
*/
|
||||
function setRequestUserAgent($userAgent) {
|
||||
$this->setRequestUserAgent = $userAgent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets HTTP protocol version to be used, default is "HTTP/1.0"
|
||||
* @method setRequestVersion
|
||||
* @param string version
|
||||
* @returns none
|
||||
*/
|
||||
function setRequestVersion($version) {
|
||||
$this->requestVersion = $version;
|
||||
}
|
||||
|
||||
/**
|
||||
* After all settings are complete, send the request to the server
|
||||
* @method sendRequest
|
||||
* @returns string server response if successful, false otherwise
|
||||
*/
|
||||
function sendRequest() {
|
||||
$response = false;
|
||||
$request = $this->getRequestHeaders();
|
||||
$request .= $this->requestBody;
|
||||
$success = $this->connect();
|
||||
if($success) {
|
||||
$response = $this->sendReceive($request);
|
||||
$this->disconnect();
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
}
|
||||
50
includes/classes/org/active-link/net/HTTPServer.php
Normal file
50
includes/classes/org/active-link/net/HTTPServer.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP NET Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP NET Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP NET Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP NET Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* requires Socket class
|
||||
*/
|
||||
import("org.active-link.net.Socket");
|
||||
|
||||
/**
|
||||
* HTTPServer class provides functionality to receive HTTP requests and serve responses
|
||||
* @class HTTPServer
|
||||
* @package org.active-link.net
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
* @extends Socket
|
||||
* @requires Socket
|
||||
* @see Socket
|
||||
*/
|
||||
|
||||
class HTTPServer extends Socket {
|
||||
|
||||
// protected properties
|
||||
var $defaultServer;
|
||||
|
||||
function HTTPServer () {
|
||||
$this->defaultServer = "ActiveLink NET Object/0.1";
|
||||
}
|
||||
|
||||
}
|
||||
162
includes/classes/org/active-link/net/Socket.php
Normal file
162
includes/classes/org/active-link/net/Socket.php
Normal file
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP NET Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP NET Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP NET Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP NET Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* Socket class provides a basic network socket functionality
|
||||
* @class Socket
|
||||
* @package org.active-link.net
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
*/
|
||||
|
||||
class Socket {
|
||||
|
||||
// protected properties
|
||||
var $host;
|
||||
var $port;
|
||||
var $connected;
|
||||
var $connectionID;
|
||||
|
||||
/**
|
||||
* Constructor, accepts host and port, initializes object
|
||||
* @method Socket
|
||||
* @param host
|
||||
* @param port
|
||||
*/
|
||||
function Socket($host, $port) {
|
||||
$this->host = $host;
|
||||
$this->port = $port;
|
||||
$this->connected = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connects to host with specified settings, accepts connection timeout (optional, default 30)
|
||||
* @method connect
|
||||
* @param optional int connectionTimeout
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function connect($connectTimeout = 30) {
|
||||
$this->connectionID = fsockopen($this->host, $this->port, $errorID, $errorDesc, $connectTimeout);
|
||||
if($this->connectionID === false) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
$this->connected = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnects if already connected
|
||||
* @method disconnect
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function disconnect() {
|
||||
$success = fclose($this->connectionID);
|
||||
if($success)
|
||||
$this->connected = false;
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Receives data through connected socket, accepts chunk size (optional, default 4096)
|
||||
* @method receive
|
||||
* @param optional int chunkSize
|
||||
* @returns string received data if successful, false otherwise
|
||||
*/
|
||||
function receive($chunkSize = 4096) {
|
||||
$receivedString = "";
|
||||
$success = false;
|
||||
if($this->connected) {
|
||||
while(!feof($this->connectionID)) {
|
||||
$receivedString .= fgets($this->connectionID, $chunkSize);
|
||||
}
|
||||
$success = true;
|
||||
}
|
||||
if($success)
|
||||
return $receivedString;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends data through connected socket
|
||||
* @method send
|
||||
* @param string sendString
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function send($sendString) {
|
||||
$success = false;
|
||||
if($this->connected)
|
||||
$success = fwrite($this->connectionID, $sendString);
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Combination of send and receive methods in one
|
||||
* @method sendReceive
|
||||
* @param sendString
|
||||
* @param optional int connectionTimeout
|
||||
* @returns string received data if successful, false otherwise
|
||||
*/
|
||||
function sendReceive($sendString, $receiveChunkSize = 4096) {
|
||||
$success = true;
|
||||
$receivedString = "";
|
||||
if($this->connected) {
|
||||
$bytesSent = $this->send($sendString);
|
||||
if($bytesSent === false)
|
||||
$success = false;
|
||||
if($success) {
|
||||
$receivedString = $this->receive($receiveChunkSize);
|
||||
if($receivedString === false)
|
||||
$success = false;
|
||||
}
|
||||
}
|
||||
if($success)
|
||||
return $receivedString;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets host to make a connection to
|
||||
* @method setHost
|
||||
* @param string host
|
||||
* @returns none
|
||||
*/
|
||||
function setHost($host) {
|
||||
$this->host = $host;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets port to use for the connection
|
||||
* @method setPort
|
||||
* @param int port
|
||||
* @returns none
|
||||
*/
|
||||
function setPort($port) {
|
||||
$this->port = $port;
|
||||
}
|
||||
|
||||
}
|
||||
153
includes/classes/org/active-link/sys/File.php
Normal file
153
includes/classes/org/active-link/sys/File.php
Normal file
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP SYS Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP SYS Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP SYS Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP SYS Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* File class provides a wrapper around filesystem file functions
|
||||
* @class File
|
||||
* @package org.active-link.sys
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
*/
|
||||
|
||||
class File {
|
||||
|
||||
// protected variables
|
||||
var $filename;
|
||||
var $fileOpenMode;
|
||||
var $fileOpenModeRead;
|
||||
var $fileOpenModeReadWrite;
|
||||
var $fileOpenModeWrite;
|
||||
var $fileOpenModeWriteRead;
|
||||
var $fileOpenModeAppend;
|
||||
var $fileOpenModeAppendRead;
|
||||
var $connected;
|
||||
var $handleID;
|
||||
|
||||
/**
|
||||
* Constructor accepts filename (optional) and open mode (optional, default "r")
|
||||
* If filename is specified, it is opened with the supplied open mode
|
||||
* @method File
|
||||
* @param optional string filename
|
||||
* @param optional string fileOpenMode
|
||||
*/
|
||||
function File($filename = "", $fileOpenMode = "r") {
|
||||
$success = true;
|
||||
$this->filename = $filename;
|
||||
$this->fileOpenMode = $fileOpenMode;
|
||||
$this->fileOpenModeRead = "r";
|
||||
$this->fileOpenModeReadWrite = "r+";
|
||||
$this->fileOpenModeWrite = "w";
|
||||
$this->fileOpenModeWriteRead = "w+";
|
||||
$this->fileOpenModeAppend = "a";
|
||||
$this->fileOpenModeAppendRead = "a+";
|
||||
$this->connected = false;
|
||||
$this->handleID = false;
|
||||
if($this->filename != "")
|
||||
$success = $this->open($this->filename, $this->fileOpenMode);
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes open file handle, resets filename, and file open mode to defaults
|
||||
* @method close
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function close() {
|
||||
$success = fclose($this->handleID);
|
||||
if($success) {
|
||||
$this->filename = "";
|
||||
$this->fileOpenMode = "r";
|
||||
$this->connected = false;
|
||||
$this->handleID = false;
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns file contents, optionally specify chunk size number of bytes to use per chunk read (default 8192)
|
||||
* @method getContents
|
||||
* @param optional int chunkSize
|
||||
* @returns string file contents if successful, false otherwise
|
||||
*/
|
||||
function getContents($chunkSize = 8192) {
|
||||
if($this->connected) {
|
||||
$fileContents = "";
|
||||
do {
|
||||
$data = fread($this->handleID, $chunkSize);
|
||||
if (strlen($data) == 0) {
|
||||
break;
|
||||
}
|
||||
$fileContents .= $data;
|
||||
} while(true);
|
||||
return $fileContents;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns file contents as an array of lines
|
||||
* @method getContentsArray
|
||||
* @returns array file contents lines
|
||||
*/
|
||||
function getContentsArray() {
|
||||
$fileContentsArray = file($this->filename);
|
||||
return $fileContentsArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a file with the supplied open mode
|
||||
* @method open
|
||||
* @param string filename
|
||||
* @param optional string fileOpenMode
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function open($filename, $mode = "r") {
|
||||
$success = false;
|
||||
if(!$this->connected) {
|
||||
$this->handleID = @fopen($filename, $mode);
|
||||
if($this->handleID !== false) {
|
||||
$this->filename = $filename;
|
||||
$this->fileOpenMode = $mode;
|
||||
$this->connected = true;
|
||||
$success = true;
|
||||
}
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes supplied string content to already open file handle
|
||||
* @method write
|
||||
* @param string strContent
|
||||
* @returns number of bytes written if successful, false otherwise
|
||||
*/
|
||||
function write($strContent) {
|
||||
$bytesWritten = fwrite($this->handleID, $strContent, strlen($strContent));
|
||||
return $bytesWritten;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
42
includes/classes/org/active-link/xml/Branch.php
Normal file
42
includes/classes/org/active-link/xml/Branch.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP XML Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP XML Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP XML Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
import("org.active-link.xml.Tree");
|
||||
|
||||
/**
|
||||
* Branch class is part of a Tree-Branch-Leaf trio
|
||||
* @class Branch
|
||||
* @package org.active-link.xml
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
* @extends Tree
|
||||
* @requires Tree
|
||||
* @see Tree, Leaf
|
||||
*/
|
||||
|
||||
class Branch extends Tree {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
70
includes/classes/org/active-link/xml/Leaf.php
Normal file
70
includes/classes/org/active-link/xml/Leaf.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP XML Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP XML Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP XML Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* Leaf class is part of a Tree-Branch-Leaf trio
|
||||
* @class Leaf
|
||||
* @package org.active-link.xml
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
* @see Tree, Branch
|
||||
*/
|
||||
|
||||
class Leaf {
|
||||
|
||||
// protected variables
|
||||
var $value;
|
||||
|
||||
/**
|
||||
* Constructor for the object
|
||||
* @method Leaf
|
||||
* @param optional mixed value
|
||||
* @returns none
|
||||
*/
|
||||
function Leaf($value = "") {
|
||||
$this->setValue($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Leaf object value
|
||||
* @method getValue
|
||||
* @returns value of the object
|
||||
*/
|
||||
function getValue() {
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Leaf object to the specified value
|
||||
* @method setValue
|
||||
* @param mixed value
|
||||
* @returns none
|
||||
*/
|
||||
function setValue($value) {
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
108
includes/classes/org/active-link/xml/RSS.php
Normal file
108
includes/classes/org/active-link/xml/RSS.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP XML Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP XML Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP XML Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
import("org.active-link.xml.XML");
|
||||
|
||||
/**
|
||||
* Simple RSS class based on XML
|
||||
* @class RSS
|
||||
* @package org.active-link.xml
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
* @requires XML
|
||||
* @see XML
|
||||
*/
|
||||
|
||||
class RSS {
|
||||
|
||||
var $xml;
|
||||
var $rootTags;
|
||||
var $itemBranches;
|
||||
|
||||
/**
|
||||
* Constructor, parses the supplied RSS string into the object
|
||||
* @method RSS
|
||||
* @param string parseString
|
||||
* @returns none
|
||||
*/
|
||||
function RSS($parseString) {
|
||||
$this->xml = new XML($parseString);
|
||||
$this->rootTags = array("rss", "rdf:RDF");
|
||||
$this->itemBranches = array();
|
||||
$this->parseItemBranches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns array of references to item branches of the RSS
|
||||
* @method getItemBranches
|
||||
* @returns array of references to objects of type XMLBranch (item branches of RSS)
|
||||
*/
|
||||
function getItemBranches() {
|
||||
return $this->itemBranches;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns HTML-formatted RSS items
|
||||
* @method getHTMLTitlesFormatted
|
||||
* @returns string HTML-formatted RSS items
|
||||
*/
|
||||
function getHTMLTitlesFormatted() {
|
||||
$itemBranchesXML = new XML("ul");
|
||||
reset($this->itemBranches);
|
||||
foreach($this->itemBranches as $newsItem) {
|
||||
$itemXML = new XMLBranch("li");
|
||||
$itemLinkXML = new XMLBranch("a");
|
||||
$itemLinkXML->setTagContent($newsItem->getTagContent("item/title"));
|
||||
$itemLinkXML->setTagAttribute("href", $newsItem->getTagContent("item/link"));
|
||||
$itemXML->addXMLBranch($itemLinkXML);
|
||||
$itemBranchesXML->addXMLBranch($itemXML);
|
||||
}
|
||||
return $itemBranchesXML->getXMLString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses RSS item branches, called from constructor
|
||||
* @method parseItemBranches
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function parseItemBranches() {
|
||||
$success = false;
|
||||
$rootTagName = $this->xml->getTagName();
|
||||
if(in_array($rootTagName, $this->rootTags)) {
|
||||
$tempBranches = array();
|
||||
if($rootTagName == "rss")
|
||||
$tempBranches = $this->xml->getBranches($rootTagName . "/channel", "item");
|
||||
elseif($rootTagName == "rdf:RDF")
|
||||
$tempBranches = $this->xml->getBranches($rootTagName, "item");
|
||||
if($tempBranches !== false) {
|
||||
$this->itemBranches = $tempBranches;
|
||||
$success = true;
|
||||
}
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
429
includes/classes/org/active-link/xml/Tag.php
Normal file
429
includes/classes/org/active-link/xml/Tag.php
Normal file
@@ -0,0 +1,429 @@
|
||||
<?php
|
||||
|
||||
/* Workaround by Richard Karnesky (refbase) for if ctype_alpha is missing */
|
||||
if(! function_exists('ctype_alpha')) {
|
||||
function ctype_alpha($string) {
|
||||
return (!preg_match('|[^\pL]|', $string));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP XML Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP XML Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP XML Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tag class provides a base for parsing, modifying, outputting and creating XML tags
|
||||
* @class Tag
|
||||
* @package org.active-link.xml
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
* @see XML
|
||||
*/
|
||||
|
||||
class Tag {
|
||||
|
||||
// protected variables
|
||||
var $tagStartOpen;
|
||||
var $tagStartClose;
|
||||
var $tagClose;
|
||||
var $tagEndOpen;
|
||||
var $tagEndClose;
|
||||
var $tagName;
|
||||
var $tagContent;
|
||||
var $tagAttributes;
|
||||
var $tagAttributeSeparator;
|
||||
var $tagAttributeSeparators;
|
||||
var $tagAttributeAssignment;
|
||||
var $tagAttributeValueQuote;
|
||||
var $FORMAT_NONE;
|
||||
var $FORMAT_INDENT;
|
||||
var $tagFormat;
|
||||
var $tagFormatIndentLevel;
|
||||
var $tagFormatEndTag;
|
||||
var $tagFormatNewLine = "\n";
|
||||
var $tagFormatIndent = "\t";
|
||||
|
||||
/**
|
||||
* Constructor creates a tag object with the specified name and tag content
|
||||
* @method Tag
|
||||
* @param optional string name
|
||||
* @param optional string content
|
||||
* @returns none
|
||||
*/
|
||||
function Tag($name = "", $content = "") {
|
||||
$this->tagStartOpen = "<";
|
||||
$this->tagStartClose = ">";
|
||||
$this->tagClose = "/>";
|
||||
$this->tagEndOpen = "</";
|
||||
$this->tagEndClose = ">";
|
||||
$this->setTagName($name);
|
||||
$this->setTagContent($content);
|
||||
$this->tagAttributes = array();
|
||||
$this->tagAttributeSeparator = " ";
|
||||
$this->tagAttributeSeparators = array(" ", "\n", "\r", "\t");
|
||||
$this->tagAttributeAssignment = "=";
|
||||
$this->tagAttributeValueQuote = '"';
|
||||
$this->FORMAT_NONE = 0;
|
||||
$this->FORMAT_INDENT = 1;
|
||||
$this->tagFormat = $this->FORMAT_NONE;
|
||||
$this->tagFormatIndentLevel = 0;
|
||||
$this->tagFormatEndTag = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find out whether attribute exists
|
||||
* @method attributeExists
|
||||
* @param string attrName
|
||||
* @returns true if attribute exists, false otherwise
|
||||
*/
|
||||
function attributeExists($attrName) {
|
||||
return array_key_exists($attrName, $this->tagAttributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get attribute value by its name
|
||||
* @method getTagAttribute
|
||||
* @param string attrName
|
||||
* @returns string attribute value
|
||||
*/
|
||||
function getTagAttribute($attrName) {
|
||||
return $this->tagAttributes[$attrName];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tag content string
|
||||
* @method getTagContent
|
||||
* @returns string tag content
|
||||
*/
|
||||
function getTagContent() {
|
||||
return $this->tagContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tag name string
|
||||
* @method getTagName
|
||||
* @returns string tag name
|
||||
*/
|
||||
function getTagName() {
|
||||
return $this->tagName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get complete tag string with its attributes and content
|
||||
* @method getTagString
|
||||
* @returns string tag string
|
||||
*/
|
||||
function getTagString() {
|
||||
$formatTagBegin = "";
|
||||
$formatTagEnd = "";
|
||||
$formatContent = "";
|
||||
if($this->tagFormat == $this->FORMAT_INDENT) {
|
||||
if($this->tagFormatIndentLevel > 0)
|
||||
$formatTagBegin = $this->tagFormatNewLine . str_repeat($this->tagFormatIndent, $this->tagFormatIndentLevel);
|
||||
if($this->tagFormatEndTag)
|
||||
$formatTagEnd = $this->tagFormatNewLine . str_repeat($this->tagFormatIndent, $this->tagFormatIndentLevel);
|
||||
}
|
||||
$tagString = $formatTagBegin . $this->getTagStringBegin() . $formatContent . $this->tagContent . $formatTagEnd . $this->getTagStringEnd();
|
||||
return $tagString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get beginning of the tag string, i.e. its name attributes up until tag contents
|
||||
* @method getTagStringBegin
|
||||
* @returns string beginning of the tag string
|
||||
*/
|
||||
function getTagStringBegin() {
|
||||
$tagString = "";
|
||||
if($this->tagName != "") {
|
||||
$tagString .= $this->tagStartOpen . $this->tagName;
|
||||
foreach($this->tagAttributes as $attrName => $attrValue) {
|
||||
$tagString .= $this->tagAttributeSeparator . $attrName . $this->tagAttributeAssignment . $this->tagAttributeValueQuote . $attrValue . $this->tagAttributeValueQuote;
|
||||
}
|
||||
if($this->tagContent == "")
|
||||
$tagString .= $this->tagAttributeSeparator . $this->tagClose;
|
||||
else
|
||||
$tagString .= $this->tagStartClose;
|
||||
}
|
||||
return $tagString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ending of the tag string, i.e. its closing tag
|
||||
* @method getTagStringEnd
|
||||
* @returns string close tag if tag is not short-handed, empty string otherwise
|
||||
*/
|
||||
function getTagStringEnd() {
|
||||
$tagString = "";
|
||||
if($this->tagName != "" && $this->tagContent != "")
|
||||
$tagString .= $this->tagEndOpen . $this->tagName . $this->tagEndClose;
|
||||
return $tagString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all tag attributes
|
||||
* @method removeAllAttributes
|
||||
* @returns none
|
||||
*/
|
||||
function removeAllAttributes() {
|
||||
$this->tagAttributes = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a tag attribute by its name
|
||||
* @method removeAttribute
|
||||
* @returns none
|
||||
*/
|
||||
function removeAttribute($attrName) {
|
||||
unset($this->tagAttributes[$attrName]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the tag object - set name, content to empty strings, and reset all attributes
|
||||
* @method resetTag
|
||||
* @returns none
|
||||
*/
|
||||
function resetTag() {
|
||||
$this->setTagName("");
|
||||
$this->setTagContent("");
|
||||
$this->removeAllAttributes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or modify an existing attribute by supplying attribute name and value
|
||||
* @method setAttribute
|
||||
* @param string attrName
|
||||
* @param string attrValue
|
||||
* @returns none
|
||||
*/
|
||||
function setAttribute($attrName, $attrValue) {
|
||||
$this->tagAttributes[$attrName] = $attrValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set contents of the tag
|
||||
* @method setTagContent
|
||||
* @param string content
|
||||
* @returns none
|
||||
*/
|
||||
function setTagContent($content) {
|
||||
$this->tagContent = $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set tag formatting option by specifying tagFormat to 0 (none), or 1 (indented)
|
||||
* @method setTagFormat
|
||||
* @param int tagFormat
|
||||
* @param optional int tagFormatIndentLevel
|
||||
* @returns none
|
||||
*/
|
||||
function setTagFormat($tagFormat, $tagFormatIndentLevel = 0) {
|
||||
$this->tagFormat = $tagFormat;
|
||||
$this->tagFormatIndentLevel = $tagFormatIndentLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether closing of the tag should be formatted or not
|
||||
* @method setTagFormatEndTag
|
||||
* @param optional boolean formatEndTag
|
||||
* @returns none
|
||||
*/
|
||||
function setTagFormatEndTag($formatEndTag = true) {
|
||||
$this->tagFormatEndTag = $formatEndTag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a string containing a tag into the tag object, this will parse the first tag found
|
||||
* @method setTagFromString
|
||||
* @param string tagString
|
||||
* @returns array array of [0]=>index of the beginning of the tag, [1]=>index where tag ended
|
||||
*/
|
||||
function setTagFromString($tagString) {
|
||||
$i = 0;
|
||||
$j = 0;
|
||||
$tagStartOpen = $tagStartClose = $tagNameStart = $tagNameEnd = $tagContentStart = $tagContentEnd = $tagEndOpen = $tagEndClose = 0;
|
||||
$tagName = $tagContent = "";
|
||||
$tagShort = false;
|
||||
$tagAttributes = array();
|
||||
$success = true;
|
||||
$tagFound = false;
|
||||
while(!$tagFound && $i < strlen($tagString)) {
|
||||
// look for start tag character
|
||||
$i = strpos($tagString, $this->tagStartOpen, $i);
|
||||
if($i === false)
|
||||
break;
|
||||
// if tag name starts from alpha character we found the tag
|
||||
if(ctype_alpha(substr($tagString, $i + 1, 1)))
|
||||
$tagFound = true;
|
||||
// else continue searching
|
||||
else
|
||||
$i ++;
|
||||
}
|
||||
// if no tag found set success to false
|
||||
if(!$tagFound)
|
||||
$success = false;
|
||||
// if so far so good continue with found tag name
|
||||
if($success) {
|
||||
$tagStartOpen = $i;
|
||||
$tagNameStart = $i + 1;
|
||||
// search where tag name would end
|
||||
// search for a space separator to account for attributes
|
||||
$separatorPos = array();
|
||||
for($counter = 0; $counter < count($this->tagAttributeSeparators); $counter ++) {
|
||||
$separatorPosTemp = strpos($tagString, $this->tagAttributeSeparators[$counter], $tagStartOpen);
|
||||
if($separatorPosTemp !== false)
|
||||
$separatorPos[] = $separatorPosTemp;
|
||||
}
|
||||
//$i = strpos($tagString, $this->tagAttributeSeparator, $tagStartOpen);
|
||||
if(count($separatorPos) > 0)
|
||||
$i = min($separatorPos);
|
||||
else
|
||||
$i = false;
|
||||
// search for tag close character
|
||||
$j = strpos($tagString, $this->tagStartClose, $tagStartOpen);
|
||||
// search for short tag (no content)
|
||||
$k = strpos($tagString, $this->tagClose, $tagStartOpen);
|
||||
// if tag close character is not found then no tag exists, set success to false
|
||||
if($j === false)
|
||||
$success = false;
|
||||
// if tag short close found before tag close, then tag is short
|
||||
if($k !== false && $k < $j)
|
||||
$tagShort = true;
|
||||
}
|
||||
// if so far so good set tag name correctly
|
||||
if($success) {
|
||||
// if space separator not found or it is found after the tag close char
|
||||
if($i === false || $i > $j) {
|
||||
if($tagShort)
|
||||
$tagNameEnd = $k;
|
||||
else
|
||||
$tagNameEnd = $j;
|
||||
$tagStartClose = $j;
|
||||
}
|
||||
// else if tag attributes exist
|
||||
else {
|
||||
$tagNameEnd = $i;
|
||||
$tagStartClose = $j;
|
||||
// parse attributes
|
||||
$tagAttributesStart = $i + strlen($this->tagAttributeSeparator);
|
||||
$attrString = trim(substr($tagString, $tagAttributesStart, $j - $tagAttributesStart));
|
||||
$attrArray = explode($this->tagAttributeValueQuote, $attrString);
|
||||
$attrCounter = 0;
|
||||
while($attrCounter < count($attrArray) - 1) {
|
||||
$attributeName = trim(str_replace($this->tagAttributeAssignment, "", $attrArray[$attrCounter]));
|
||||
$attributeValue = $attrArray[$attrCounter + 1];
|
||||
$tagAttributes[$attributeName] = $attributeValue;
|
||||
$attrCounter += 2;
|
||||
}
|
||||
}
|
||||
$tagName = rtrim(substr($tagString, $tagNameStart, $tagNameEnd - $tagNameStart));
|
||||
if(!$tagShort) {
|
||||
$tagContentStart = $tagStartClose + 1;
|
||||
// look for ending of the tag after tag content
|
||||
$j = $tagContentStart;
|
||||
$tagCloseFound = false;
|
||||
// while loop will find the k-th tag close
|
||||
// start with one since we have one tag open
|
||||
$k = 1;
|
||||
while(!$tagCloseFound && $success) {
|
||||
// find k-th tag close from j
|
||||
$n = $j - 1;
|
||||
for($skip = 0; $skip < $k; $skip ++) {
|
||||
$n ++;
|
||||
$tempPos = strpos($tagString, $this->tagEndOpen . $tagName . $this->tagEndClose, $n);
|
||||
if($tempPos !== false)
|
||||
$n = $tempPos;
|
||||
else {
|
||||
$success = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if success, find number of tag opens before the tag close
|
||||
$k = 0;
|
||||
if($success) {
|
||||
$tempString = substr($tagString, $j, $n - $j);
|
||||
$tempNewPos = 0;
|
||||
do {
|
||||
$tempPos = strpos($tempString, $this->tagStartOpen . $tagName, $tempNewPos);
|
||||
if($tempPos !== false) {
|
||||
$tempPosChar = substr($tempString, $tempPos + strlen($this->tagStartOpen . $tagName), 1);
|
||||
$tagEndArray = $this->tagAttributeSeparators;
|
||||
$tagEndArray[] = $this->tagEndClose;
|
||||
$tempPosTagEnded = array_search($tempPosChar, $tagEndArray);
|
||||
if($tempPosTagEnded !== false && $tempPosTagEnded !== NULL) {
|
||||
$tempStartClose = strpos($tempString, $this->tagStartClose, $tempPos);
|
||||
$tempStartShortClose = strpos($tempString, $this->tagClose, $tempPos);
|
||||
// if open tag found increase counter
|
||||
if($tempStartClose !== false && ($tempStartShortClose === false || $tempStartClose < $tempStartShortClose))
|
||||
$k ++;
|
||||
$tempNewPos = $tempPos + strlen($this->tagStartOpen . $tagName);
|
||||
}
|
||||
else
|
||||
$tempNewPos = $tempPos + strlen($this->tagStartOpen . $tagName);
|
||||
}
|
||||
} while($tempPos !== false);
|
||||
}
|
||||
// if no tags opened we found the tag close
|
||||
if($k == 0)
|
||||
$tagCloseFound = true;
|
||||
// else set new j
|
||||
else {
|
||||
$j = $n + strlen($this->tagEndOpen . $tagName . $this->tagEndClose);
|
||||
}
|
||||
}
|
||||
if($tagCloseFound)
|
||||
$i = $n;
|
||||
else
|
||||
$success = false;
|
||||
}
|
||||
}
|
||||
// if so far so good, then we have everything we need! set the object
|
||||
if($success) {
|
||||
if(!$tagShort) {
|
||||
$tagContentEnd = $i;
|
||||
$tagContent = trim(substr($tagString, $tagContentStart, $tagContentEnd - $tagContentStart));
|
||||
$tagEndOpen = $i;
|
||||
$tagEndClose = $tagEndOpen + strlen($this->tagEndOpen . $tagName . $this->tagEndClose);
|
||||
}
|
||||
else
|
||||
$tagEndClose = $tagStartClose + strlen($this->tagStartClose);
|
||||
$this->setTagName($tagName);
|
||||
$this->setTagContent($tagContent);
|
||||
$this->tagAttributes = $tagAttributes;
|
||||
}
|
||||
if($success)
|
||||
return array($tagStartOpen, $tagEndClose);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set tag name
|
||||
* @method setTagName
|
||||
* @param string name
|
||||
* @returns none
|
||||
*/
|
||||
function setTagName($name) {
|
||||
$this->tagName = $name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
94
includes/classes/org/active-link/xml/Tree.php
Normal file
94
includes/classes/org/active-link/xml/Tree.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP XML Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP XML Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP XML Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tree class provides a base for Tree-Branch-Leaf trio
|
||||
* @class Tree
|
||||
* @package org.active-link.xml
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
* @see Branch, Leaf
|
||||
*/
|
||||
|
||||
class Tree {
|
||||
|
||||
// protected variables
|
||||
var $nodes;
|
||||
var $id = 0;
|
||||
|
||||
/**
|
||||
* Constructor for the object
|
||||
* @method Tree
|
||||
* @returns none
|
||||
*/
|
||||
function Tree() {
|
||||
$this->nodes = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds given node to the Tree
|
||||
* @method addNode
|
||||
* @param mixed id
|
||||
* @param mixed node
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function addNode($id, $node) {
|
||||
$success = true;
|
||||
if($id == -1)
|
||||
$this->nodes[] = $node;
|
||||
else
|
||||
if(isset($this->nodes[$id]))
|
||||
$success = false;
|
||||
else
|
||||
$this->nodes[$id] = $node;
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all nodes
|
||||
* @method removeAllNodes
|
||||
* @returns none
|
||||
*/
|
||||
function removeAllNodes () {
|
||||
$this->nodes = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes specified node from the Tree
|
||||
* @method removeNode
|
||||
* @param mixed id
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function removeNode($id) {
|
||||
$success = false;
|
||||
if(isset($this->nodes[$id])) {
|
||||
unset($this->nodes[$id]);
|
||||
$success = true;
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
580
includes/classes/org/active-link/xml/XML.php
Normal file
580
includes/classes/org/active-link/xml/XML.php
Normal file
@@ -0,0 +1,580 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP XML Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP XML Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP XML Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
import("org.active-link.xml.Tag");
|
||||
import("org.active-link.xml.Tree");
|
||||
|
||||
/**
|
||||
* XML class provides a tree-like structure to read/write/modify XML
|
||||
* @class XML
|
||||
* @package org.active-link.xml
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
* @extends Tree
|
||||
* @requires Tag, Tree, XMLBranch, XMLLeaf
|
||||
* @see Tree
|
||||
*/
|
||||
|
||||
class XML extends Tree {
|
||||
|
||||
// protected variables
|
||||
var $tag;
|
||||
var $pathSeparator;
|
||||
|
||||
/**
|
||||
* If argument is an XML String it parses the string into XML object
|
||||
* If argument is a tag path, creates appropriate branches and tags
|
||||
* If argument is a simple string then sets that as a root tag name
|
||||
* @method XML
|
||||
* @param optional string argument
|
||||
* @returns none
|
||||
*/
|
||||
function XML($argument = "") {
|
||||
$success = false;
|
||||
$this->Tree();
|
||||
$this->pathSeparator = "/";
|
||||
$this->tag = new Tag();
|
||||
if(is_string($argument)) {
|
||||
// if this is an XML string to be parsed
|
||||
if(strpos($argument, $this->tag->tagEndOpen) > 0 || strpos($argument, $this->tag->tagClose) > 0)
|
||||
$this->parseFromString($argument);
|
||||
// else if this is a tag path to be created
|
||||
elseif(strpos($argument, $this->pathSeparator) > 0) {
|
||||
$tags = explode($this->pathSeparator, $argument);
|
||||
$this->tag->setTagName($tags[0]);
|
||||
$this->setTagContent("", $argument);
|
||||
}
|
||||
else
|
||||
$this->tag->setTagName($argument);
|
||||
$success = true;
|
||||
}
|
||||
else
|
||||
$success = false;
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds another XML tree as a branch to the current XML object
|
||||
* @method addXMLAsBranch
|
||||
* @param object xml
|
||||
* @param optional mixed id
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function addXMLAsBranch($xml, $id = -1) {
|
||||
$success = false;
|
||||
if(is_object($xml) && strtolower(get_class($xml)) == "xml") {
|
||||
$newBranch = new XMLBranch();
|
||||
$newBranch->nodes = $xml->nodes;
|
||||
$newBranch->tag = $xml->tag;
|
||||
$success = $this->addXMLBranch($newBranch, $id);
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds XML Branch to the current XML object
|
||||
* @method addXMLBranch
|
||||
* @param object xmlBranch
|
||||
* @param optional mixed id
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function addXMLBranch($xmlBranch, $id = -1) {
|
||||
$success = false;
|
||||
if(is_object($xmlBranch) && strtolower(get_class($xmlBranch)) == "xmlbranch") {
|
||||
$xmlBranch->setParentXML($this);
|
||||
$success = $this->addNode($id, $xmlBranch);
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds XML Leaf to the current XML object
|
||||
* @method addXMLLeaf
|
||||
* @param object xmlLeaf
|
||||
* @param optional mixed id
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function addXMLLeaf($xmlLeaf, $id = -1) {
|
||||
$success = false;
|
||||
if(is_object($xmlLeaf) && strtolower(get_class($xmlLeaf)) == "xmlleaf") {
|
||||
$xmlLeaf->setParentXML($this);
|
||||
$success = $this->addNode($id, $xmlLeaf);
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves an array of references to XMLBranches within the specified path, tag name, attribute name, and attribute value
|
||||
* @method getBranches
|
||||
* @param optional string tagPath
|
||||
* @param optional string tagName
|
||||
* @param optional string attrName
|
||||
* @param optional string attrValue
|
||||
* @returns array of references to XMLBranch objects that meet specified criteria, or false if none found
|
||||
*/
|
||||
function getBranches($tagPath = "", $tagName = "", $attrName = "", $attrValue = "") {
|
||||
$branchArray = array();
|
||||
if($tagPath == "")
|
||||
$tagPath = $this->tag->getTagName();
|
||||
$tags = explode($this->pathSeparator, $tagPath);
|
||||
if($this->tag->getTagName() == $tags[0]) {
|
||||
if(count($tags) == 1) {
|
||||
$arrKeys = array_keys($this->nodes);
|
||||
for($index = 0; $index < count($arrKeys); $index ++) {
|
||||
if(gettype($this->nodes[$arrKeys[$index]]) == "object" && strtolower(get_class($this->nodes[$arrKeys[$index]])) == "xmlbranch") {
|
||||
if(($tagName == "" || $this->nodes[$arrKeys[$index]]->tag->getTagName() == $tagName) &&
|
||||
($attrName == "" || $this->nodes[$arrKeys[$index]]->tag->attributeExists($attrName)) &&
|
||||
($attrValue == "" || $this->nodes[$arrKeys[$index]]->tag->getTagAttribute($attrName) == $attrValue)) {
|
||||
$branchArray[] = &$this->nodes[$arrKeys[$index]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$arrKeys = array_keys($this->nodes);
|
||||
for($index = 0; $index < count($arrKeys); $index ++) {
|
||||
if(gettype($this->nodes[$arrKeys[$index]]) == "object" && strtolower(get_class($this->nodes[$arrKeys[$index]])) == "xmlbranch") {
|
||||
if($this->nodes[$arrKeys[$index]]->tag->getTagName() == $tags[1]) {
|
||||
$newTagPath = implode($this->pathSeparator, array_slice($tags, 1));
|
||||
$newArray = $this->nodes[$arrKeys[$index]]->getBranches($newTagPath, $tagName, $attrName, $attrValue);
|
||||
if($newArray !== false)
|
||||
$branchArray = array_merge($branchArray, $newArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(count($branchArray) == 0)
|
||||
$branchArray = false;
|
||||
return $branchArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves an array of references to XMLLeaf(s) within the specified path
|
||||
* @method getLeafs
|
||||
* @param optional string tagPath
|
||||
* @returns array of references to XMLLeaf objects in specified tag path, false if none found
|
||||
*/
|
||||
function getLeafs($tagPath = "") {
|
||||
$leafArray = array();
|
||||
if($tagPath == "")
|
||||
$tagPath = $this->tag->getTagName();
|
||||
$tags = explode($this->pathSeparator, $tagPath);
|
||||
if($this->tag->getTagName() == $tags[0]) {
|
||||
if(count($tags) == 1) {
|
||||
$arrKeys = array_keys($this->nodes);
|
||||
for($index = 0; $index < count($arrKeys); $index ++) {
|
||||
if(gettype($this->nodes[$arrKeys[$index]]) == "object" && strtolower(get_class($this->nodes[$arrKeys[$index]])) == "xmlleaf") {
|
||||
$leafArray[] = &$this->nodes[$arrKeys[$index]];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$arrKeys = array_keys($this->nodes);
|
||||
for($index = 0; $index < count($arrKeys); $index ++) {
|
||||
if(gettype($this->nodes[$arrKeys[$index]]) == "object" && strtolower(get_class($this->nodes[$arrKeys[$index]])) == "xmlbranch") {
|
||||
if($this->nodes[$arrKeys[$index]]->tag->getTagName() == $tags[1]) {
|
||||
$newTagPath = implode($this->pathSeparator, array_slice($tags, 1));
|
||||
$newArray = $this->nodes[$arrKeys[$index]]->getLeafs($newTagPath);
|
||||
if($newArray !== false)
|
||||
$leafArray = array_merge($leafArray, $newArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(count($leafArray) == 0)
|
||||
$leafArray = false;
|
||||
return $leafArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns attribute value of the specified tag and tagpath
|
||||
* @method getTagAttribute
|
||||
* @param string attributeName
|
||||
* @param optional string tagPath
|
||||
* @returns attribute of the specified tag if successful, false otherwise
|
||||
*/
|
||||
function getTagAttribute($attributeName, $tagPath = "") {
|
||||
if($tagPath == "")
|
||||
$tagPath = $this->tag->getTagName();
|
||||
$tags = explode($this->pathSeparator, $tagPath);
|
||||
$attributeValue = false;
|
||||
if($this->tag->getTagName() == $tags[0]) {
|
||||
if(sizeof($tags) == 1) {
|
||||
if($this->tag->attributeExists($attributeName))
|
||||
$attributeValue = $this->tag->getTagAttribute($attributeName);
|
||||
}
|
||||
else {
|
||||
foreach($this->nodes as $node) {
|
||||
if(strtolower(get_class($node)) == "xmlbranch")
|
||||
if($node->tag->getTagName() == $tags[1]) {
|
||||
$newTagPath = implode($this->pathSeparator, array_slice($tags, 1));
|
||||
$attributeValue = $node->getTagAttribute($attributeName, $newTagPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $attributeValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns contents of the specified tag path
|
||||
* @method getTagContent
|
||||
* @param optional string tagPath
|
||||
* @returns content of the tag from the specified path if successful, false otherwise
|
||||
*/
|
||||
function getTagContent($tagPath = "") {
|
||||
if($tagPath == "")
|
||||
$tagPath = $this->tag->getTagName();
|
||||
$tags = explode($this->pathSeparator, $tagPath);
|
||||
$tagValue = false;
|
||||
if($this->tag->getTagName() == $tags[0]) {
|
||||
if(sizeof($tags) == 1)
|
||||
$tagValue = $this->getXMLContent();
|
||||
else {
|
||||
foreach($this->nodes as $node) {
|
||||
if(strtolower(get_class($node)) == "xmlbranch")
|
||||
if($node->tag->getTagName() == $tags[1]) {
|
||||
$newTagPath = implode($this->pathSeparator, array_slice($tags, 1));
|
||||
$tagValue = $node->getTagContent($newTagPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $tagValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the tag name of the current object
|
||||
* @method getTagName
|
||||
* @returns tag name
|
||||
*/
|
||||
function getTagName() {
|
||||
return($this->tag->getTagName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets contents from the current object
|
||||
* @method getXMLContent
|
||||
* @returns contents of the current XML tag
|
||||
*/
|
||||
function getXMLContent() {
|
||||
$xmlContent = "";
|
||||
foreach($this->nodes as $node) {
|
||||
if(gettype($node) == "object") {
|
||||
if(strtolower(get_class($node)) == "xmlbranch")
|
||||
$xmlContent .= $node->getXMLString();
|
||||
elseif(strtolower(get_class($node)) == "xmlleaf")
|
||||
$xmlContent .= $node->getValue();
|
||||
}
|
||||
}
|
||||
return $xmlContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the whole XML string of the current object
|
||||
* @method getXMLString
|
||||
* @param optional mixed indent
|
||||
* @returns complete XML string of current object
|
||||
*/
|
||||
function getXMLString($indent = false) {
|
||||
$xmlString = "";
|
||||
$containsBranches = false;
|
||||
$containsLeafs = false;
|
||||
$newIndent = false;
|
||||
if($indent === false)
|
||||
$newIndent = false;
|
||||
else {
|
||||
$newIndent = $indent + 1;
|
||||
$this->tag->setTagFormat($this->tag->FORMAT_INDENT, $indent);
|
||||
}
|
||||
foreach($this->nodes as $node) {
|
||||
if(gettype($node) == "object") {
|
||||
if(strtolower(get_class($node)) == "xmlbranch") {
|
||||
$this->tag->tagContent .= $node->getXMLString($newIndent);
|
||||
$containsBranches = true;
|
||||
}
|
||||
elseif(strtolower(get_class($node)) == "xmlleaf") {
|
||||
$this->tag->tagContent .= $node->getValue();
|
||||
$containsLeafs = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($containsBranches)
|
||||
$this->tag->setTagFormatEndTag(true);
|
||||
$xmlString = $this->tag->getTagString();
|
||||
$this->tag->setTagContent("");
|
||||
return $xmlString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find out whether the current object has any branches
|
||||
* @method hasBranch
|
||||
* @returns true if branches exist, false otherwise
|
||||
*/
|
||||
function hasBranch() {
|
||||
$hasBranch = false;
|
||||
foreach($this->nodes as $node) {
|
||||
if(strtolower(get_class($node)) == "xmlbranch") {
|
||||
$hasBranch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $hasBranch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find out whether the current object has any leaf(s)
|
||||
* @method hasLeaf
|
||||
* @returns true if leaf(s) exist, false otherwise
|
||||
*/
|
||||
function hasLeaf() {
|
||||
$hasLeaf = false;
|
||||
foreach($this->nodes as $node) {
|
||||
if(strtolower(get_class($node)) == "xmlleaf") {
|
||||
$hasLeaf = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $hasLeaf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse entire XML string into the current object; also called from constructor
|
||||
* @method parseFromString
|
||||
* @param string parseString
|
||||
* @returns none
|
||||
*/
|
||||
function parseFromString($parseString) {
|
||||
$tagResult = $this->tag->setTagFromString($parseString);
|
||||
if($tagResult !== false) {
|
||||
$this->parseNodesFromTag();
|
||||
$this->tag->setTagContent("");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the current tag content into Branches and Leaf(s); called from parseFromString
|
||||
* @method parseNodesFromTag
|
||||
* @returns none
|
||||
*/
|
||||
function parseNodesFromTag() {
|
||||
$tempTag = new Tag();
|
||||
$parseString = $this->tag->getTagContent();
|
||||
while($tagParsed = $tempTag->setTagFromString($parseString)) {
|
||||
if($tagParsed[0] != 0 && trim(substr($parseString, 0, $tagParsed[0]) != ""))
|
||||
$this->addXMLLeaf(new XMLLeaf(trim(substr($parseString, 0, $tagParsed[0]))));
|
||||
$branch = new XMLBranch();
|
||||
$tempTagCopy = new Tag();
|
||||
$tempTagCopy->setTagName($tempTag->getTagName());
|
||||
$tempTagCopy->tagAttributes = $tempTag->tagAttributes;
|
||||
$tempTagCopy->setTagContent($tempTag->getTagContent());
|
||||
$branch->setTag($tempTagCopy);
|
||||
$branch->parseNodesFromTag();
|
||||
$branch->tag->setTagContent("");
|
||||
$this->addXMLBranch($branch);
|
||||
$parseString = trim(substr($parseString, $tagParsed[1]));
|
||||
}
|
||||
if(strlen($parseString) > 0 && trim($parseString) != "")
|
||||
$this->addXMLLeaf(new XMLLeaf($parseString));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all Branches from current object
|
||||
* @method removeAllBranches
|
||||
*/
|
||||
function removeAllBranches() {
|
||||
foreach($this->nodes as $key => $value) {
|
||||
if(strtolower(get_class($value)) == "xmlbranch")
|
||||
unset($this->nodes[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all Leaf(s) from current object
|
||||
* @method removeAllLeafs
|
||||
*/
|
||||
function removeAllLeafs() {
|
||||
foreach($this->nodes as $key => $value) {
|
||||
if(strtolower(get_class($value)) == "xmlleaf")
|
||||
unset($this->nodes[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes Branches with the specified criteria
|
||||
* @method removeBranches
|
||||
* @param optional string tagPath
|
||||
* @param optional string tagName
|
||||
* @param optional string attrName
|
||||
* @param optional string attrValue
|
||||
* @returns number of branches deleted
|
||||
*/
|
||||
function removeBranches($tagPath = "", $tagName = "", $attrName = "", $attrValue = "") {
|
||||
$branchesDeleted = 0;
|
||||
$referencedBranches = array();
|
||||
$tags = explode($this->pathSeparator, $tagPath);
|
||||
if(count($tags) > 1) {
|
||||
$parentTagName = array_pop($tags);
|
||||
$parentTagPath = implode($this->pathSeparator, $tags);
|
||||
$referencedBranches = $this->getBranches($parentTagPath, $parentTagName);
|
||||
}
|
||||
else {
|
||||
$referencedBranches[] = &$this;
|
||||
}
|
||||
for($i = 0; $i < count($referencedBranches); $i ++) {
|
||||
$arrKeys = array_keys($referencedBranches[$i]->nodes);
|
||||
for($index = 0; $index < count($arrKeys); $index ++) {
|
||||
if(gettype($referencedBranches[$i]->nodes[$arrKeys[$index]]) == "object" && strtolower(get_class($referencedBranches[$i]->nodes[$arrKeys[$index]])) == "xmlbranch") {
|
||||
if(($tagName == "" || $referencedBranches[$i]->nodes[$arrKeys[$index]]->tag->getTagName() == $tagName) &&
|
||||
($attrName == "" || $referencedBranches[$i]->nodes[$arrKeys[$index]]->tag->attributeExists($attrName)) &&
|
||||
($attrValue == "" || $referencedBranches[$i]->nodes[$arrKeys[$index]]->tag->getTagAttribute($attrName) == $attrValue)) {
|
||||
$referencedBranches[$i]->removeNode($arrKeys[$index]);
|
||||
$branchesDeleted ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $branchesDeleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets tag object of a branch specified by branch ID for the current object; see getBranches and setTag
|
||||
* @method setBranchTag
|
||||
* @param mixed branchId
|
||||
* @param object tag
|
||||
* @returns true on success, false otherwise
|
||||
*/
|
||||
function setBranchTag($branchId, $tag) {
|
||||
$success = true;
|
||||
if(strtolower(get_class($this->nodes[$branchId])) == "xmlbranch" && strtolower(get_class($tag)) == "tag")
|
||||
$this->nodes[$branchId]->setTag($tag);
|
||||
else
|
||||
$success = false;
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets tag object of the current object
|
||||
* @method setTag
|
||||
* @param object tag
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function setTag($tag) {
|
||||
$success = true;
|
||||
if(strtolower(get_class($tag)) == "tag")
|
||||
$this->tag = $tag;
|
||||
else
|
||||
$success = false;
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets an attribute name and value on an existing tag found via tagpath string
|
||||
* @method setTagAttribute
|
||||
* @param string attributeName
|
||||
* @param optional string attributeValue
|
||||
* @param optional string tagPath
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function setTagAttribute($attributeName, $attributeValue = "", $tagPath = "") {
|
||||
if($tagPath == "")
|
||||
$tagPath = $this->tag->getTagName();
|
||||
$success = true;
|
||||
$tags = explode($this->pathSeparator, $tagPath);
|
||||
if($this->tag->getTagName() == $tags[0]) {
|
||||
if(sizeof($tags) == 1)
|
||||
$this->tag->setAttribute($attributeName, $attributeValue);
|
||||
else {
|
||||
$nodeTagFound = false;
|
||||
reset($this->nodes);
|
||||
$arrKeys = array_keys($this->nodes);
|
||||
for($index = 0; $index < count($arrKeys); $index ++) {
|
||||
$node =& $this->nodes[$arrKeys[$index]];
|
||||
if(strtolower(get_class($node)) == "xmlbranch")
|
||||
if($node->tag->getTagName() == $tags[1]) {
|
||||
$newTagPath = implode($this->pathSeparator, array_slice($tags, 1));
|
||||
$success = $node->setTagAttribute($attributeName, $attributeValue, $newTagPath);
|
||||
$nodeTagFound = true;
|
||||
}
|
||||
}
|
||||
if(!$nodeTagFound)
|
||||
$success = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
$success = false;
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets content of the specified tag
|
||||
* @method setTagContent
|
||||
* @param mixed content
|
||||
* @param optional string tagPath
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function setTagContent($content, $tagPath = "") {
|
||||
if($tagPath == "")
|
||||
$tagPath = $this->tag->getTagName();
|
||||
$success = true;
|
||||
$tags = explode($this->pathSeparator, $tagPath);
|
||||
if($this->tag->getTagName() == $tags[0]) {
|
||||
if(sizeof($tags) == 1) {
|
||||
//$this->nodes = array(new XMLLeaf($content));
|
||||
$this->removeAllNodes();
|
||||
$this->addXMLLeaf(new XMLLeaf($content));
|
||||
}
|
||||
else {
|
||||
$nodeTagFound = false;
|
||||
reset($this->nodes);
|
||||
$arrKeys = array_keys($this->nodes);
|
||||
for($index = 0; $index < count($arrKeys); $index ++) {
|
||||
$node =& $this->nodes[$arrKeys[$index]];
|
||||
if(strtolower(get_class($node)) == "xmlbranch")
|
||||
if($node->tag->getTagName() == $tags[1]) {
|
||||
$newTagPath = implode($this->pathSeparator, array_slice($tags, 1));
|
||||
$success = $node->setTagContent($content, $newTagPath);
|
||||
$nodeTagFound = true;
|
||||
}
|
||||
}
|
||||
if(!$nodeTagFound) {
|
||||
$branch = new XMLBranch();
|
||||
$branch->setTag(new Tag($tags[1]));
|
||||
$newTagPath = implode($this->pathSeparator, array_slice($tags, 1));
|
||||
$branch->setTagContent($content, $newTagPath);
|
||||
$this->addXMLBranch($branch);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
import("org.active-link.xml.XMLBranch");
|
||||
import("org.active-link.xml.XMLLeaf");
|
||||
|
||||
?>
|
||||
71
includes/classes/org/active-link/xml/XMLBranch.php
Normal file
71
includes/classes/org/active-link/xml/XMLBranch.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP XML Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP XML Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP XML Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* requires XML class
|
||||
*/
|
||||
import("org.active-link.xml.XML");
|
||||
|
||||
/**
|
||||
* XMLBranch class provides a tree-like structure to read/write/modify XML
|
||||
* @class XMLBranch
|
||||
* @package org.active-link.xml
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
* @extends XML
|
||||
* @requires XML
|
||||
* @see Tree
|
||||
*/
|
||||
|
||||
class XMLBranch extends XML {
|
||||
|
||||
var $parentXML;
|
||||
|
||||
/**
|
||||
* Gets parent object of the XML branch
|
||||
* @method getParentXML
|
||||
* @returns parent object of the XML branch
|
||||
*/
|
||||
function getParentXML() {
|
||||
return $this->parentXML;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets parent object of the XML branch
|
||||
* @method setParentXML
|
||||
* @param object xml
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function setParentXML(&$xml) {
|
||||
$success = false;
|
||||
if(strtolower(get_class($xml)) == "xml" || strtolower(get_class($xml)) == "xmlbranch") {
|
||||
$this->parentXML = &$xml;
|
||||
$success = true;
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
174
includes/classes/org/active-link/xml/XMLDocument.php
Normal file
174
includes/classes/org/active-link/xml/XMLDocument.php
Normal file
@@ -0,0 +1,174 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP XML Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP XML Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP XML Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* requires XML, Tag and File classes
|
||||
*/
|
||||
import("org.active-link.xml.XML");
|
||||
import("org.active-link.sys.File");
|
||||
import("org.active-link.xml.Tag");
|
||||
|
||||
/**
|
||||
* XMLDocument class provides a document class for XML
|
||||
* @class XMLDocument
|
||||
* @package org.active-link.xml
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
* @extends File
|
||||
* @requires File, XML, Tag
|
||||
* @see XML
|
||||
*/
|
||||
|
||||
class XMLDocument extends File {
|
||||
|
||||
// protected variables
|
||||
var $xml;
|
||||
var $tag;
|
||||
|
||||
/**
|
||||
* If filename is set and fileOpenMode is one of the modes that allows file to be read then file is opened and its contents parsed
|
||||
* If filename is set and fileOpenMode is something other than above the appropriate file is opened/created
|
||||
* If filename is not set then no files are opened/parsed/created and object contains default values
|
||||
* @method XMLDocument
|
||||
* @param optional string filename
|
||||
* @param optional string fileOpenMode
|
||||
*/
|
||||
function XMLDocument($filename = "", $fileOpenMode = "r") {
|
||||
$success = $this->File($filename, $fileOpenMode);
|
||||
$this->tag = new Tag();
|
||||
$this->tag->tagStartOpen = "<?";
|
||||
$this->tag->tagClose = "?>";
|
||||
if($this->connected && ($this->fileOpenMode == $this->fileOpenModeRead || $this->fileOpenMode == $this->fileOpenModeReadWrite)) {
|
||||
$fileContents = $this->getContents();
|
||||
$this->close();
|
||||
$this->parseFromString($fileContents);
|
||||
}
|
||||
else {
|
||||
$this->setDefaultXMLTag();
|
||||
$this->xml = new XML();
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the XML object containing actual XML tree; in PHP 4 make sure to use =& to get a reference instead of a copy
|
||||
* @method getXML
|
||||
* @returns object of type XML containing actual XML tree
|
||||
*/
|
||||
function getXML() {
|
||||
return $this->xml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the XML string of a complete XML document
|
||||
* @method getXMLString
|
||||
* @returns string containing contents of XML document
|
||||
*/
|
||||
function getXMLString() {
|
||||
$xmlString = $this->tag->getTagString();
|
||||
$xmlString .= "\n\n";
|
||||
$xmlString .= $this->xml->getXMLString(0);
|
||||
return $xmlString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses XML document from supplied string, also called from constructor when parsing file contents
|
||||
* @method parseFromString
|
||||
* @param string XMLDocString
|
||||
* @returns none
|
||||
*/
|
||||
function parseFromString($XMLDocString) {
|
||||
$tagPos = $this->tag->setTagFromString($XMLDocString);
|
||||
if($tagPos === false) {
|
||||
$tagPos = array(0 => 0, 1 => 0);
|
||||
$this->setDefaultXMLTag();
|
||||
}
|
||||
$xmlContents = trim(substr($XMLDocString, $tagPos[1]));
|
||||
$this->xml = new XML($xmlContents);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves document contents to a supplied filename
|
||||
* @method save
|
||||
* @param string filename
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function save($filename) {
|
||||
$success = $this->open($filename, $this->fileOpenModeWrite);
|
||||
if($success) {
|
||||
$bytesWritten = $this->write($this->getXMLString());
|
||||
if($bytesWritten <= 0)
|
||||
$success = false;
|
||||
$this->close();
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* (Re)sets XML version/encoding to default values
|
||||
* @method setDefaultXMLTag
|
||||
* @returns none
|
||||
*/
|
||||
function setDefaultXMLTag() {
|
||||
$this->tag->setTagName("xml");
|
||||
$this->tag->setAttribute("version", "1.0");
|
||||
$this->tag->setAttribute("encoding", "UTF-8");
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets encoding of the XML document
|
||||
* @method setEncoding
|
||||
* @param string encoding
|
||||
* @returns none
|
||||
*/
|
||||
function setEncoding($encoding) {
|
||||
$this->tag->setAttribute("encoding", $encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets version of the XML document
|
||||
* @method setVersion
|
||||
* @param string version
|
||||
* @returns none
|
||||
*/
|
||||
function setVersion($version) {
|
||||
$this->tag->setAttribute("version", $version);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets XML object of the XMLDocument, sets/changes/updates XML content to the supplied XML tree, uses reference no copy is created
|
||||
* @method setXML
|
||||
* @param object xml
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function setXML(&$xml) {
|
||||
$success = false;
|
||||
if(gettype($xml) == "object" && strtolower(get_class($xml)) == "xml") {
|
||||
$this->xml = &$xml;
|
||||
$success = true;
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
}
|
||||
73
includes/classes/org/active-link/xml/XMLLeaf.php
Normal file
73
includes/classes/org/active-link/xml/XMLLeaf.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP XML Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP XML Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP XML Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* requires XML class
|
||||
*/
|
||||
import("org.active-link.xml.XML");
|
||||
import("org.active-link.xml.XMLBranch");
|
||||
import("org.active-link.xml.Leaf");
|
||||
|
||||
/**
|
||||
* XMLLeaf class provides means to store text values for use in XML tree
|
||||
* @class XMLLeaf
|
||||
* @package org.active-link.xml
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
* @extends Leaf
|
||||
* @requires Leaf
|
||||
* @see XML
|
||||
*/
|
||||
|
||||
class XMLLeaf extends Leaf {
|
||||
|
||||
var $parentXML;
|
||||
|
||||
/**
|
||||
* Gets parent object of the XML leaf
|
||||
* @method getParentXML
|
||||
* @returns parent object of the XML leaf
|
||||
*/
|
||||
function getParentXML() {
|
||||
return $this->parentXML;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets parent object of the XML leaf
|
||||
* @method setParentXML
|
||||
* @param object xml
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function setParentXML(&$xml) {
|
||||
$success = false;
|
||||
if(strtolower(get_class($xml)) == "xml" || strtolower(get_class($xml)) == "xmlbranch") {
|
||||
$this->parentXML = &$xml;
|
||||
$success = true;
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
120
includes/classes/org/active-link/xml/XMLRPCClient.php
Normal file
120
includes/classes/org/active-link/xml/XMLRPCClient.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP XML Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP XML Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP XML Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* requires HTTPClient, XML and XMLDocument classes
|
||||
*/
|
||||
|
||||
import("org.active-link.net.HTTPClient");
|
||||
import("org.active-link.xml.XML");
|
||||
import("org.active-link.xml.XMLDocument");
|
||||
|
||||
/**
|
||||
* XMLRPCClient class provides XML-RPC client capabilities
|
||||
* @class XMLRPCClient
|
||||
* @package org.active-link.xml
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
* @extends HTTPClient
|
||||
* @requires HTTPClient, XML, XMLDocument
|
||||
* @see HTTPClient
|
||||
*/
|
||||
|
||||
class XMLRPCClient extends HTTPClient {
|
||||
|
||||
var $xml;
|
||||
var $xmlDoc;
|
||||
var $params;
|
||||
|
||||
/**
|
||||
* XMLRPCClient client class constructor accepts host (required) and port (optional, default 80) arguments
|
||||
* @method XMLRPCClient
|
||||
* @param string host
|
||||
* @param optional int port
|
||||
*/
|
||||
function XMLRPCClient($host, $port = 80) {
|
||||
$this->HTTPClient($host, $port);
|
||||
$this->setRequestMethod("POST");
|
||||
$this->addRequestHeaderRaw("Content-type: text/xml");
|
||||
$this->xml = new XML("methodCall");
|
||||
$this->xml->setTagContent("", "methodCall/methodName");
|
||||
$this->xml->setTagContent("", "methodCall/params");
|
||||
$this->xmlDoc = new XMLDocument();
|
||||
$this->xmlDoc->setXML($this->xml);
|
||||
$paramsBranchArray = &$this->xml->getBranches("methodCall", "params");
|
||||
$this->params = &$paramsBranchArray[0];
|
||||
// this call not necessary if we can somehow update body before HTTPClient->sendRequest
|
||||
$this->setRequestBody($this->xmlDoc->getXMLString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a parameter to a method call in XMLRPC request
|
||||
* @method addParam
|
||||
* @param string paramType
|
||||
* @param mixed paramValue
|
||||
* @returns none
|
||||
*/
|
||||
function addParam($paramType, $paramValue) {
|
||||
$newParam = new XMLBranch("param");
|
||||
$newParam->setTagContent($paramValue, "param/value/$paramType");
|
||||
$this->params->addXMLBranch($newParam);
|
||||
// this call not necessary if we can somehow update body before HTTPClient->sendRequest
|
||||
$this->setRequestBody($this->xmlDoc->getXMLString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets method name in XMLRPC request
|
||||
* @method setMethodName
|
||||
* @param string methodName
|
||||
* @returns none
|
||||
*/
|
||||
function setMethodName ($methodName) {
|
||||
$this->xml->setTagContent($methodName, "methodCall/methodName");
|
||||
// this call not necessary if we can somehow update body before HTTPClient->sendRequest
|
||||
$this->setRequestBody($this->xmlDoc->getXMLString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets XMLRPC request by supplying an XMLDocument object
|
||||
* @method setRequestXML
|
||||
* @param object XMLDocument
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
function setRequestXML(&$XMLDocument) {
|
||||
if(is_object($XMLDocument) && strtolower(get_class($XMLDocument)) == "xmldocument") {
|
||||
$this->xmlDoc = &$XMLDocument;
|
||||
$this->xml = &$this->xmlDoc->getXML();
|
||||
$this->params = &$this->xml->getBranches("methodCall", "params");
|
||||
// this call not necessary if we can somehow update body before HTTPClient->sendRequest
|
||||
$this->setRequestBody(htmlspecialchars($this->xmlDoc->getXMLString()));
|
||||
$success = true;
|
||||
}
|
||||
else
|
||||
$success = false;
|
||||
return $success;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
46
includes/classes/org/active-link/xml/XPath.php
Normal file
46
includes/classes/org/active-link/xml/XPath.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of ActiveLink PHP XML Package (www.active-link.com).
|
||||
Copyright (c) 2002-2004 by Zurab Davitiani
|
||||
|
||||
You can contact the author of this software via E-mail at
|
||||
hattrick@mailcan.com
|
||||
|
||||
ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ActiveLink PHP XML Package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with ActiveLink PHP XML Package; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* requires XML class
|
||||
*/
|
||||
|
||||
import("org.active-link.xml.XML");
|
||||
|
||||
/**
|
||||
* XPath class provides XPath interface to XML object
|
||||
* @class XPath
|
||||
* @package org.active-link.xml
|
||||
* @author Zurab Davitiani
|
||||
* @version 0.4.0
|
||||
* @see XML
|
||||
*/
|
||||
|
||||
class XPath {
|
||||
|
||||
var $xml;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
314
includes/classes/org/bibliophile/MINIMALRTF.php
Normal file
314
includes/classes/org/bibliophile/MINIMALRTF.php
Normal file
@@ -0,0 +1,314 @@
|
||||
<?php
|
||||
/*
|
||||
MINIMALRTF - A minimal set of RTF coding methods to produce Rich Text Format documents on the fly.
|
||||
v1.5
|
||||
|
||||
Released through http://bibliophile.sourceforge.net under the GPL licence.
|
||||
Do whatever you like with this -- some credit to the author(s) would be appreciated.
|
||||
|
||||
If you make improvements, please consider contacting the administrators at bibliophile.sourceforge.net so that your improvements can be added to the release package.
|
||||
|
||||
Mark Grimshaw 2006
|
||||
http://bibliophile.sourceforge.net
|
||||
*/
|
||||
|
||||
// COMMAND LINE TESTS:
|
||||
// For a quick command-line test (php -f MINIMALRTF.php) after installation, uncomment the following:
|
||||
/**************************************************
|
||||
$centred = "This is some centred text.";
|
||||
$full = "This is some full justified and italicized text.";
|
||||
$weird = "Indented UNICODE: ¿ßŽŒ‰fl™ŁÞߨ€∑≠◊∝∞∅Ωπ¿";
|
||||
$largeText = "Here's some large text (font size 20)";
|
||||
$urlText = "Here's a URL: ";
|
||||
$url = "http://bibliophile.sourceforge.net";
|
||||
$urlDisplayText = "Bibliophile's home page!";
|
||||
$emailText = "Here's an email: ";
|
||||
$email = "billgates@microsoft.com";
|
||||
$emailDisplayText = "I love SPAM";
|
||||
$colouredText = "This text is red text";
|
||||
$backToBlackText = "This text is black text again";
|
||||
$rtf = new MINIMALRTF();
|
||||
$string = $rtf->openRtf();
|
||||
$rtf->createFontBlock(0, "Arial");
|
||||
$rtf->createFontBlock(1, "Times New Roman");
|
||||
$string .= $rtf->setFontBlock();
|
||||
$string .= $rtf->justify("centre");
|
||||
$string .= $rtf->textBlock(0, 12, $centred);
|
||||
$string .= $rtf->justify("full");
|
||||
$string .= $rtf->paragraph();
|
||||
$string .= $rtf->textBlock(1, 12, $rtf->italics($full));
|
||||
$string .= $rtf->justify("full", 2, 2);
|
||||
$string .= $rtf->paragraph();
|
||||
// Depending on your character set, you may need to encode $weird as UTF-8 first using PHP's inbuilt utf8_encode() function:
|
||||
// $weird = $rtf->utf8_2_unicode(utf8_encode($weird));
|
||||
$weird = $rtf->utf8_2_unicode($weird);
|
||||
$string .= $rtf->textBlock(1, 12, $weird);
|
||||
$string .= $rtf->justify("full");
|
||||
$string .= $rtf->paragraph();
|
||||
$string .= $rtf->textBlock(1, 20, $largeText);
|
||||
$string .= $rtf->paragraph();
|
||||
$string .= $rtf->textBlock(1, 12, $urlText . $rtf->urlText($url, $urlDisplayText));
|
||||
$string .= $rtf->paragraph();
|
||||
$string .= $rtf->textBlock(1, 12, $emailText . $rtf->emailText($email, $emailDisplayText));
|
||||
$string .= $rtf->paragraph();
|
||||
$string .= $rtf->setFontColour('red');
|
||||
$string .= $rtf->textBlock(1, 12, $colouredText);
|
||||
$string .= $rtf->paragraph();
|
||||
$string .= $rtf->setFontColour(); // i.e. set it back to black
|
||||
$string .= $rtf->textBlock(1, 12, $backToBlackText);
|
||||
$string .= $rtf->closeRtf();
|
||||
|
||||
// Copy and paste the commandline output to a text editor, save with a .rtf extension and load in a word processor.
|
||||
print $string . "\n\n";
|
||||
|
||||
**************************************************/
|
||||
|
||||
class MINIMALRTF
|
||||
{
|
||||
/**
|
||||
* Constructor method called by user.
|
||||
*/
|
||||
function MINIMALRTF()
|
||||
{
|
||||
/**
|
||||
* some defaults
|
||||
*/
|
||||
$this->justify = array(
|
||||
"centre" => "qc",
|
||||
"left" => "ql",
|
||||
"right" => "qr",
|
||||
"full" => "qj",
|
||||
);
|
||||
$this->colourTable = array(
|
||||
'black' => "\\red0\\green0\\blue0;",
|
||||
'maroon' => "\\red128\\green0\\blue0;",
|
||||
'green' => "\\red0\\green128\\blue0;",
|
||||
'olive' => "\\red128\\green128\\blue0;",
|
||||
'navy' => "\\red0\\green0\\blue128;",
|
||||
'purple' => "\\red128\\green0\\blue128;",
|
||||
'teal' => "\\red0\\green128\\blue128;",
|
||||
'gray' => "\\red128\\green128\\blue128;",
|
||||
'silver' => "\\red192\\green192\\blue192;",
|
||||
'red' => "\\red255\\green0\\blue0;",
|
||||
'lime' => "\\red0\\green255\\blue0;",
|
||||
'yellow' => "\\red255\\green255\\blue0;",
|
||||
'blue' => "\\red0\\green0\\blue255;",
|
||||
'fuchsia' => "\\red255\\green0\\blue255;",
|
||||
'aqua' => "\\red0\\green255\\blue255;",
|
||||
'white' => "\\red255\\green255\\blue255;",
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Create the RTF opening tag and the colorTable
|
||||
* @return string
|
||||
*/
|
||||
function openRtf()
|
||||
{
|
||||
$text = "{\\rtf1\\ansi\\ansicpg1252\n\n";
|
||||
$text .= "{\\colortbl;";
|
||||
$index = 1;
|
||||
foreach($this->colourTable as $colour => $colourCode)
|
||||
{
|
||||
$text .= $colourCode;
|
||||
$this->colours[$colour] = "\\s1\\cf$index";
|
||||
++$index;
|
||||
}
|
||||
$text .= "}\n\n";
|
||||
unset($this->colourTable);
|
||||
return $text . "\n\n";
|
||||
}
|
||||
/**
|
||||
* Create the RTF closing tag
|
||||
* @return string
|
||||
*/
|
||||
function closeRtf()
|
||||
{
|
||||
return "\n}\n\n";
|
||||
}
|
||||
/**
|
||||
* Convert input text to bold text
|
||||
* @parameter string $input - text to be converted
|
||||
*/
|
||||
function bold($input = "")
|
||||
{
|
||||
return "{\b $input}";
|
||||
}
|
||||
/**
|
||||
* Convert input text to italics text
|
||||
* @parameter string $input - text to be converted
|
||||
*/
|
||||
function italics($input = "")
|
||||
{
|
||||
return "{\i $input}";
|
||||
}
|
||||
/**
|
||||
* Convert input text to underline text
|
||||
* @parameter string $input - text to be converted
|
||||
*/
|
||||
function underline($input = "")
|
||||
{
|
||||
return "{\ul $input}";
|
||||
}
|
||||
/**
|
||||
* Convert input text to superscript text
|
||||
* @parameter string $input - text to be converted
|
||||
*/
|
||||
function superscript($input = "")
|
||||
{
|
||||
return "{\super $input}";
|
||||
}
|
||||
/**
|
||||
* Convert input text to subscript text
|
||||
* @parameter string $input - text to be converted
|
||||
*/
|
||||
function subscript($input = "")
|
||||
{
|
||||
return "{\sub $input}";
|
||||
}
|
||||
/**
|
||||
* Set font size for each paragraph
|
||||
* @parameter integer $fontBlock - number of this fontblock
|
||||
* @parameter string $font - required font
|
||||
*/
|
||||
function createFontBlock($fontBlock = FALSE, $font = FALSE)
|
||||
{
|
||||
if(($fontBlock === FALSE) || ($font === FALSE))
|
||||
return FALSE;
|
||||
$this->fontBlocks[] = "{\\f$fontBlock\\fcharset0 $font;}\n";
|
||||
return TRUE;
|
||||
}
|
||||
/**
|
||||
* Set font blocks
|
||||
* @return string fontblock string
|
||||
*/
|
||||
function setFontBlock()
|
||||
{
|
||||
if(!isset($this->fontBlocks))
|
||||
return FALSE;
|
||||
$string = "{\\fonttbl\n";
|
||||
foreach($this->fontBlocks as $fontBlock)
|
||||
$string .= $fontBlock;
|
||||
$string .= "}\n\n";
|
||||
return $string;
|
||||
}
|
||||
/**
|
||||
* Justify and indent
|
||||
* Each TAB is equivalent to 720 units of indent
|
||||
* @parameter string $justify - either "centre", "left", "right" or "full"
|
||||
* @parameter integer $indentL - no. TABs to indent from the left
|
||||
* @parameter integer $indentR - no. TABs to indent from the right
|
||||
* @parameter integer $indentF - no. TABs to indent first line
|
||||
*/
|
||||
function justify($justify = "full", $indentL = 0, $indentR = 0, $indentF = 0)
|
||||
{
|
||||
if(!array_key_exists($justify, $this->justify))
|
||||
$justifyC = "qj";
|
||||
else
|
||||
$justifyC = $this->justify[$justify];
|
||||
$indentL *= 720;
|
||||
$indentR *= 720;
|
||||
$indentF *= 720;
|
||||
return "\\$justifyC\\li$indentL\\ri$indentR\\fi$indentF\n";
|
||||
}
|
||||
/**
|
||||
* Create empty paragraph
|
||||
* Font Size is twice what is shown in a word processor
|
||||
* @return string
|
||||
*/
|
||||
function paragraph($fontBlock = 0, $fontSize = 12)
|
||||
{
|
||||
$fontSize *= 2;
|
||||
return "{\\f$fontBlock\\fs$fontSize \\par}\n";
|
||||
}
|
||||
/**
|
||||
* Create text block
|
||||
* @parameter string $input - input string
|
||||
* @return string
|
||||
*/
|
||||
function textBlock($fontBlock = FALSE, $fontSize = FALSE, $input = FALSE)
|
||||
{
|
||||
if(($fontBlock === FALSE) || ($fontSize === FALSE) || ($input === FALSE))
|
||||
return FALSE;
|
||||
$fontSize *= 2;
|
||||
return "{\\f$fontBlock\\fs$fontSize $input\\par}\n";
|
||||
}
|
||||
/**
|
||||
* Create email link
|
||||
* @parameter string $email - email address
|
||||
* @return string
|
||||
*/
|
||||
function emailText($email, $displayText = FALSE)
|
||||
{
|
||||
if(!$displayText)
|
||||
$displayText = $email;
|
||||
return "{\\field{\\fldinst { HYPERLINK \"mailto:$email\" }}{\\fldrslt {\\cs1\\ul\\cf13 $displayText}}}";
|
||||
}
|
||||
/**
|
||||
* Create URL link
|
||||
* @parameter string $url - URL
|
||||
* @return string
|
||||
*/
|
||||
function urlText($url, $displayText = FALSE)
|
||||
{
|
||||
if(!$displayText)
|
||||
$displayText = $url;
|
||||
return "{\\field{\\fldinst { HYPERLINK \"$url\" }}{\\fldrslt {\\cs1\\ul\\cf13 $displayText}}}";
|
||||
}
|
||||
/**
|
||||
* Set font color
|
||||
* @parameter string - colour
|
||||
* @return string
|
||||
*/
|
||||
function setFontColour($colour = 'black')
|
||||
{
|
||||
if(!array_key_exists($colour, $this->colours))
|
||||
$colour = $this->colours['black'];
|
||||
else
|
||||
$colour = $this->colours[$colour];
|
||||
return "\n$colour\n";
|
||||
}
|
||||
/**
|
||||
* UTF-8 to unicode
|
||||
* returns an array of unicode character codes
|
||||
* Code adapted from opensource PHP code by Scott Reynen at:
|
||||
* http://www.randomchaos.com/document.php?source=php_and_unicode
|
||||
*
|
||||
* @parameter string $string UTF-8 encoded string
|
||||
* @return string unicode character code
|
||||
*/
|
||||
function utf8_2_unicode($string)
|
||||
{
|
||||
$unicode = array();
|
||||
$values = array();
|
||||
$lookingFor = 1;
|
||||
for($i = 0; $i < strlen($string); $i++)
|
||||
{
|
||||
$thisValue = ord($string[$i]);
|
||||
if($thisValue < 128)
|
||||
$unicode[] = $string[$i];
|
||||
else
|
||||
{
|
||||
if(count($values) == 0)
|
||||
$lookingFor = ($thisValue < 224) ? 2 : 3;
|
||||
$values[] = $thisValue;
|
||||
if(count($values) == $lookingFor)
|
||||
{
|
||||
$number = ($lookingFor == 3) ?
|
||||
(($values[0] % 16) * 4096) + (($values[1] % 64) * 64) + ($values[2] % 64) :
|
||||
(($values[0] % 32) * 64) + ($values[1] % 64);
|
||||
// $unicode[] = '\u' . $number . " ?";
|
||||
// A better unicode function?
|
||||
$decModulus = $number % 256;
|
||||
$modulus = dechex($number % 256);
|
||||
if($decModulus < 16)
|
||||
$modulus = '0' . $modulus;
|
||||
$unicode[] = '\u' . $number . "\'$modulus";
|
||||
$values = array();
|
||||
$lookingFor = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return join('', $unicode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
1555
includes/classes/org/pdf-php/class.ezpdf.php
Normal file
1555
includes/classes/org/pdf-php/class.ezpdf.php
Normal file
File diff suppressed because it is too large
Load Diff
3075
includes/classes/org/pdf-php/class.pdf.php
Normal file
3075
includes/classes/org/pdf-php/class.pdf.php
Normal file
File diff suppressed because it is too large
Load Diff
342
includes/classes/org/pdf-php/fonts/Courier-Bold.afm
Normal file
342
includes/classes/org/pdf-php/fonts/Courier-Bold.afm
Normal file
@@ -0,0 +1,342 @@
|
||||
StartFontMetrics 4.1
|
||||
Comment Copyright (c) 1989, 1990, 1991, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
|
||||
Comment Creation Date: Mon Jun 23 16:28:00 1997
|
||||
Comment UniqueID 43048
|
||||
Comment VMusage 41139 52164
|
||||
FontName Courier-Bold
|
||||
FullName Courier Bold
|
||||
FamilyName Courier
|
||||
Weight Bold
|
||||
ItalicAngle 0
|
||||
IsFixedPitch true
|
||||
CharacterSet ExtendedRoman
|
||||
FontBBox -113 -250 749 801
|
||||
UnderlinePosition -100
|
||||
UnderlineThickness 50
|
||||
Version 003.000
|
||||
Notice Copyright (c) 1989, 1990, 1991, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
|
||||
EncodingScheme AdobeStandardEncoding
|
||||
CapHeight 562
|
||||
XHeight 439
|
||||
Ascender 629
|
||||
Descender -157
|
||||
StdHW 84
|
||||
StdVW 106
|
||||
StartCharMetrics 315
|
||||
C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
|
||||
C 33 ; WX 600 ; N exclam ; B 202 -15 398 572 ;
|
||||
C 34 ; WX 600 ; N quotedbl ; B 135 277 465 562 ;
|
||||
C 35 ; WX 600 ; N numbersign ; B 56 -45 544 651 ;
|
||||
C 36 ; WX 600 ; N dollar ; B 82 -126 519 666 ;
|
||||
C 37 ; WX 600 ; N percent ; B 5 -15 595 616 ;
|
||||
C 38 ; WX 600 ; N ampersand ; B 36 -15 546 543 ;
|
||||
C 39 ; WX 600 ; N quoteright ; B 171 277 423 562 ;
|
||||
C 40 ; WX 600 ; N parenleft ; B 219 -102 461 616 ;
|
||||
C 41 ; WX 600 ; N parenright ; B 139 -102 381 616 ;
|
||||
C 42 ; WX 600 ; N asterisk ; B 91 219 509 601 ;
|
||||
C 43 ; WX 600 ; N plus ; B 71 39 529 478 ;
|
||||
C 44 ; WX 600 ; N comma ; B 123 -111 393 174 ;
|
||||
C 45 ; WX 600 ; N hyphen ; B 100 203 500 313 ;
|
||||
C 46 ; WX 600 ; N period ; B 192 -15 408 171 ;
|
||||
C 47 ; WX 600 ; N slash ; B 98 -77 502 626 ;
|
||||
C 48 ; WX 600 ; N zero ; B 87 -15 513 616 ;
|
||||
C 49 ; WX 600 ; N one ; B 81 0 539 616 ;
|
||||
C 50 ; WX 600 ; N two ; B 61 0 499 616 ;
|
||||
C 51 ; WX 600 ; N three ; B 63 -15 501 616 ;
|
||||
C 52 ; WX 600 ; N four ; B 53 0 507 616 ;
|
||||
C 53 ; WX 600 ; N five ; B 70 -15 521 601 ;
|
||||
C 54 ; WX 600 ; N six ; B 90 -15 521 616 ;
|
||||
C 55 ; WX 600 ; N seven ; B 55 0 494 601 ;
|
||||
C 56 ; WX 600 ; N eight ; B 83 -15 517 616 ;
|
||||
C 57 ; WX 600 ; N nine ; B 79 -15 510 616 ;
|
||||
C 58 ; WX 600 ; N colon ; B 191 -15 407 425 ;
|
||||
C 59 ; WX 600 ; N semicolon ; B 123 -111 408 425 ;
|
||||
C 60 ; WX 600 ; N less ; B 66 15 523 501 ;
|
||||
C 61 ; WX 600 ; N equal ; B 71 118 529 398 ;
|
||||
C 62 ; WX 600 ; N greater ; B 77 15 534 501 ;
|
||||
C 63 ; WX 600 ; N question ; B 98 -14 501 580 ;
|
||||
C 64 ; WX 600 ; N at ; B 16 -15 584 616 ;
|
||||
C 65 ; WX 600 ; N A ; B -9 0 609 562 ;
|
||||
C 66 ; WX 600 ; N B ; B 30 0 573 562 ;
|
||||
C 67 ; WX 600 ; N C ; B 22 -18 560 580 ;
|
||||
C 68 ; WX 600 ; N D ; B 30 0 594 562 ;
|
||||
C 69 ; WX 600 ; N E ; B 25 0 560 562 ;
|
||||
C 70 ; WX 600 ; N F ; B 39 0 570 562 ;
|
||||
C 71 ; WX 600 ; N G ; B 22 -18 594 580 ;
|
||||
C 72 ; WX 600 ; N H ; B 20 0 580 562 ;
|
||||
C 73 ; WX 600 ; N I ; B 77 0 523 562 ;
|
||||
C 74 ; WX 600 ; N J ; B 37 -18 601 562 ;
|
||||
C 75 ; WX 600 ; N K ; B 21 0 599 562 ;
|
||||
C 76 ; WX 600 ; N L ; B 39 0 578 562 ;
|
||||
C 77 ; WX 600 ; N M ; B -2 0 602 562 ;
|
||||
C 78 ; WX 600 ; N N ; B 8 -12 610 562 ;
|
||||
C 79 ; WX 600 ; N O ; B 22 -18 578 580 ;
|
||||
C 80 ; WX 600 ; N P ; B 48 0 559 562 ;
|
||||
C 81 ; WX 600 ; N Q ; B 32 -138 578 580 ;
|
||||
C 82 ; WX 600 ; N R ; B 24 0 599 562 ;
|
||||
C 83 ; WX 600 ; N S ; B 47 -22 553 582 ;
|
||||
C 84 ; WX 600 ; N T ; B 21 0 579 562 ;
|
||||
C 85 ; WX 600 ; N U ; B 4 -18 596 562 ;
|
||||
C 86 ; WX 600 ; N V ; B -13 0 613 562 ;
|
||||
C 87 ; WX 600 ; N W ; B -18 0 618 562 ;
|
||||
C 88 ; WX 600 ; N X ; B 12 0 588 562 ;
|
||||
C 89 ; WX 600 ; N Y ; B 12 0 589 562 ;
|
||||
C 90 ; WX 600 ; N Z ; B 62 0 539 562 ;
|
||||
C 91 ; WX 600 ; N bracketleft ; B 245 -102 475 616 ;
|
||||
C 92 ; WX 600 ; N backslash ; B 99 -77 503 626 ;
|
||||
C 93 ; WX 600 ; N bracketright ; B 125 -102 355 616 ;
|
||||
C 94 ; WX 600 ; N asciicircum ; B 108 250 492 616 ;
|
||||
C 95 ; WX 600 ; N underscore ; B 0 -125 600 -75 ;
|
||||
C 96 ; WX 600 ; N quoteleft ; B 178 277 428 562 ;
|
||||
C 97 ; WX 600 ; N a ; B 35 -15 570 454 ;
|
||||
C 98 ; WX 600 ; N b ; B 0 -15 584 626 ;
|
||||
C 99 ; WX 600 ; N c ; B 40 -15 545 459 ;
|
||||
C 100 ; WX 600 ; N d ; B 20 -15 591 626 ;
|
||||
C 101 ; WX 600 ; N e ; B 40 -15 563 454 ;
|
||||
C 102 ; WX 600 ; N f ; B 83 0 547 626 ; L i fi ; L l fl ;
|
||||
C 103 ; WX 600 ; N g ; B 30 -146 580 454 ;
|
||||
C 104 ; WX 600 ; N h ; B 5 0 592 626 ;
|
||||
C 105 ; WX 600 ; N i ; B 77 0 523 658 ;
|
||||
C 106 ; WX 600 ; N j ; B 63 -146 440 658 ;
|
||||
C 107 ; WX 600 ; N k ; B 20 0 585 626 ;
|
||||
C 108 ; WX 600 ; N l ; B 77 0 523 626 ;
|
||||
C 109 ; WX 600 ; N m ; B -22 0 626 454 ;
|
||||
C 110 ; WX 600 ; N n ; B 18 0 592 454 ;
|
||||
C 111 ; WX 600 ; N o ; B 30 -15 570 454 ;
|
||||
C 112 ; WX 600 ; N p ; B -1 -142 570 454 ;
|
||||
C 113 ; WX 600 ; N q ; B 20 -142 591 454 ;
|
||||
C 114 ; WX 600 ; N r ; B 47 0 580 454 ;
|
||||
C 115 ; WX 600 ; N s ; B 68 -17 535 459 ;
|
||||
C 116 ; WX 600 ; N t ; B 47 -15 532 562 ;
|
||||
C 117 ; WX 600 ; N u ; B -1 -15 569 439 ;
|
||||
C 118 ; WX 600 ; N v ; B -1 0 601 439 ;
|
||||
C 119 ; WX 600 ; N w ; B -18 0 618 439 ;
|
||||
C 120 ; WX 600 ; N x ; B 6 0 594 439 ;
|
||||
C 121 ; WX 600 ; N y ; B -4 -142 601 439 ;
|
||||
C 122 ; WX 600 ; N z ; B 81 0 520 439 ;
|
||||
C 123 ; WX 600 ; N braceleft ; B 160 -102 464 616 ;
|
||||
C 124 ; WX 600 ; N bar ; B 255 -250 345 750 ;
|
||||
C 125 ; WX 600 ; N braceright ; B 136 -102 440 616 ;
|
||||
C 126 ; WX 600 ; N asciitilde ; B 71 153 530 356 ;
|
||||
C 161 ; WX 600 ; N exclamdown ; B 202 -146 398 449 ;
|
||||
C 162 ; WX 600 ; N cent ; B 66 -49 518 614 ;
|
||||
C 163 ; WX 600 ; N sterling ; B 72 -28 558 611 ;
|
||||
C 164 ; WX 600 ; N fraction ; B 25 -60 576 661 ;
|
||||
C 165 ; WX 600 ; N yen ; B 10 0 590 562 ;
|
||||
C 166 ; WX 600 ; N florin ; B -30 -131 572 616 ;
|
||||
C 167 ; WX 600 ; N section ; B 83 -70 517 580 ;
|
||||
C 168 ; WX 600 ; N currency ; B 54 49 546 517 ;
|
||||
C 169 ; WX 600 ; N quotesingle ; B 227 277 373 562 ;
|
||||
C 170 ; WX 600 ; N quotedblleft ; B 71 277 535 562 ;
|
||||
C 171 ; WX 600 ; N guillemotleft ; B 8 70 553 446 ;
|
||||
C 172 ; WX 600 ; N guilsinglleft ; B 141 70 459 446 ;
|
||||
C 173 ; WX 600 ; N guilsinglright ; B 141 70 459 446 ;
|
||||
C 174 ; WX 600 ; N fi ; B 12 0 593 626 ;
|
||||
C 175 ; WX 600 ; N fl ; B 12 0 593 626 ;
|
||||
C 177 ; WX 600 ; N endash ; B 65 203 535 313 ;
|
||||
C 178 ; WX 600 ; N dagger ; B 106 -70 494 580 ;
|
||||
C 179 ; WX 600 ; N daggerdbl ; B 106 -70 494 580 ;
|
||||
C 180 ; WX 600 ; N periodcentered ; B 196 165 404 351 ;
|
||||
C 182 ; WX 600 ; N paragraph ; B 6 -70 576 580 ;
|
||||
C 183 ; WX 600 ; N bullet ; B 140 132 460 430 ;
|
||||
C 184 ; WX 600 ; N quotesinglbase ; B 175 -142 427 143 ;
|
||||
C 185 ; WX 600 ; N quotedblbase ; B 65 -142 529 143 ;
|
||||
C 186 ; WX 600 ; N quotedblright ; B 61 277 525 562 ;
|
||||
C 187 ; WX 600 ; N guillemotright ; B 47 70 592 446 ;
|
||||
C 188 ; WX 600 ; N ellipsis ; B 26 -15 574 116 ;
|
||||
C 189 ; WX 600 ; N perthousand ; B -113 -15 713 616 ;
|
||||
C 191 ; WX 600 ; N questiondown ; B 99 -146 502 449 ;
|
||||
C 193 ; WX 600 ; N grave ; B 132 508 395 661 ;
|
||||
C 194 ; WX 600 ; N acute ; B 205 508 468 661 ;
|
||||
C 195 ; WX 600 ; N circumflex ; B 103 483 497 657 ;
|
||||
C 196 ; WX 600 ; N tilde ; B 89 493 512 636 ;
|
||||
C 197 ; WX 600 ; N macron ; B 88 505 512 585 ;
|
||||
C 198 ; WX 600 ; N breve ; B 83 468 517 631 ;
|
||||
C 199 ; WX 600 ; N dotaccent ; B 230 498 370 638 ;
|
||||
C 200 ; WX 600 ; N dieresis ; B 128 498 472 638 ;
|
||||
C 202 ; WX 600 ; N ring ; B 198 481 402 678 ;
|
||||
C 203 ; WX 600 ; N cedilla ; B 205 -206 387 0 ;
|
||||
C 205 ; WX 600 ; N hungarumlaut ; B 68 488 588 661 ;
|
||||
C 206 ; WX 600 ; N ogonek ; B 169 -199 400 0 ;
|
||||
C 207 ; WX 600 ; N caron ; B 103 493 497 667 ;
|
||||
C 208 ; WX 600 ; N emdash ; B -10 203 610 313 ;
|
||||
C 225 ; WX 600 ; N AE ; B -29 0 602 562 ;
|
||||
C 227 ; WX 600 ; N ordfeminine ; B 147 196 453 580 ;
|
||||
C 232 ; WX 600 ; N Lslash ; B 39 0 578 562 ;
|
||||
C 233 ; WX 600 ; N Oslash ; B 22 -22 578 584 ;
|
||||
C 234 ; WX 600 ; N OE ; B -25 0 595 562 ;
|
||||
C 235 ; WX 600 ; N ordmasculine ; B 147 196 453 580 ;
|
||||
C 241 ; WX 600 ; N ae ; B -4 -15 601 454 ;
|
||||
C 245 ; WX 600 ; N dotlessi ; B 77 0 523 439 ;
|
||||
C 248 ; WX 600 ; N lslash ; B 77 0 523 626 ;
|
||||
C 249 ; WX 600 ; N oslash ; B 30 -24 570 463 ;
|
||||
C 250 ; WX 600 ; N oe ; B -18 -15 611 454 ;
|
||||
C 251 ; WX 600 ; N germandbls ; B 22 -15 596 626 ;
|
||||
C -1 ; WX 600 ; N Idieresis ; B 77 0 523 761 ;
|
||||
C -1 ; WX 600 ; N eacute ; B 40 -15 563 661 ;
|
||||
C -1 ; WX 600 ; N abreve ; B 35 -15 570 661 ;
|
||||
C -1 ; WX 600 ; N uhungarumlaut ; B -1 -15 628 661 ;
|
||||
C -1 ; WX 600 ; N ecaron ; B 40 -15 563 667 ;
|
||||
C -1 ; WX 600 ; N Ydieresis ; B 12 0 589 761 ;
|
||||
C -1 ; WX 600 ; N divide ; B 71 16 529 500 ;
|
||||
C -1 ; WX 600 ; N Yacute ; B 12 0 589 784 ;
|
||||
C -1 ; WX 600 ; N Acircumflex ; B -9 0 609 780 ;
|
||||
C -1 ; WX 600 ; N aacute ; B 35 -15 570 661 ;
|
||||
C -1 ; WX 600 ; N Ucircumflex ; B 4 -18 596 780 ;
|
||||
C -1 ; WX 600 ; N yacute ; B -4 -142 601 661 ;
|
||||
C -1 ; WX 600 ; N scommaaccent ; B 68 -250 535 459 ;
|
||||
C -1 ; WX 600 ; N ecircumflex ; B 40 -15 563 657 ;
|
||||
C -1 ; WX 600 ; N Uring ; B 4 -18 596 801 ;
|
||||
C -1 ; WX 600 ; N Udieresis ; B 4 -18 596 761 ;
|
||||
C -1 ; WX 600 ; N aogonek ; B 35 -199 586 454 ;
|
||||
C -1 ; WX 600 ; N Uacute ; B 4 -18 596 784 ;
|
||||
C -1 ; WX 600 ; N uogonek ; B -1 -199 585 439 ;
|
||||
C -1 ; WX 600 ; N Edieresis ; B 25 0 560 761 ;
|
||||
C -1 ; WX 600 ; N Dcroat ; B 30 0 594 562 ;
|
||||
C -1 ; WX 600 ; N commaaccent ; B 205 -250 397 -57 ;
|
||||
C -1 ; WX 600 ; N copyright ; B 0 -18 600 580 ;
|
||||
C -1 ; WX 600 ; N Emacron ; B 25 0 560 708 ;
|
||||
C -1 ; WX 600 ; N ccaron ; B 40 -15 545 667 ;
|
||||
C -1 ; WX 600 ; N aring ; B 35 -15 570 678 ;
|
||||
C -1 ; WX 600 ; N Ncommaaccent ; B 8 -250 610 562 ;
|
||||
C -1 ; WX 600 ; N lacute ; B 77 0 523 801 ;
|
||||
C -1 ; WX 600 ; N agrave ; B 35 -15 570 661 ;
|
||||
C -1 ; WX 600 ; N Tcommaaccent ; B 21 -250 579 562 ;
|
||||
C -1 ; WX 600 ; N Cacute ; B 22 -18 560 784 ;
|
||||
C -1 ; WX 600 ; N atilde ; B 35 -15 570 636 ;
|
||||
C -1 ; WX 600 ; N Edotaccent ; B 25 0 560 761 ;
|
||||
C -1 ; WX 600 ; N scaron ; B 68 -17 535 667 ;
|
||||
C -1 ; WX 600 ; N scedilla ; B 68 -206 535 459 ;
|
||||
C -1 ; WX 600 ; N iacute ; B 77 0 523 661 ;
|
||||
C -1 ; WX 600 ; N lozenge ; B 66 0 534 740 ;
|
||||
C -1 ; WX 600 ; N Rcaron ; B 24 0 599 790 ;
|
||||
C -1 ; WX 600 ; N Gcommaaccent ; B 22 -250 594 580 ;
|
||||
C -1 ; WX 600 ; N ucircumflex ; B -1 -15 569 657 ;
|
||||
C -1 ; WX 600 ; N acircumflex ; B 35 -15 570 657 ;
|
||||
C -1 ; WX 600 ; N Amacron ; B -9 0 609 708 ;
|
||||
C -1 ; WX 600 ; N rcaron ; B 47 0 580 667 ;
|
||||
C -1 ; WX 600 ; N ccedilla ; B 40 -206 545 459 ;
|
||||
C -1 ; WX 600 ; N Zdotaccent ; B 62 0 539 761 ;
|
||||
C -1 ; WX 600 ; N Thorn ; B 48 0 557 562 ;
|
||||
C -1 ; WX 600 ; N Omacron ; B 22 -18 578 708 ;
|
||||
C -1 ; WX 600 ; N Racute ; B 24 0 599 784 ;
|
||||
C -1 ; WX 600 ; N Sacute ; B 47 -22 553 784 ;
|
||||
C -1 ; WX 600 ; N dcaron ; B 20 -15 727 626 ;
|
||||
C -1 ; WX 600 ; N Umacron ; B 4 -18 596 708 ;
|
||||
C -1 ; WX 600 ; N uring ; B -1 -15 569 678 ;
|
||||
C -1 ; WX 600 ; N threesuperior ; B 138 222 433 616 ;
|
||||
C -1 ; WX 600 ; N Ograve ; B 22 -18 578 784 ;
|
||||
C -1 ; WX 600 ; N Agrave ; B -9 0 609 784 ;
|
||||
C -1 ; WX 600 ; N Abreve ; B -9 0 609 784 ;
|
||||
C -1 ; WX 600 ; N multiply ; B 81 39 520 478 ;
|
||||
C -1 ; WX 600 ; N uacute ; B -1 -15 569 661 ;
|
||||
C -1 ; WX 600 ; N Tcaron ; B 21 0 579 790 ;
|
||||
C -1 ; WX 600 ; N partialdiff ; B 63 -38 537 728 ;
|
||||
C -1 ; WX 600 ; N ydieresis ; B -4 -142 601 638 ;
|
||||
C -1 ; WX 600 ; N Nacute ; B 8 -12 610 784 ;
|
||||
C -1 ; WX 600 ; N icircumflex ; B 73 0 523 657 ;
|
||||
C -1 ; WX 600 ; N Ecircumflex ; B 25 0 560 780 ;
|
||||
C -1 ; WX 600 ; N adieresis ; B 35 -15 570 638 ;
|
||||
C -1 ; WX 600 ; N edieresis ; B 40 -15 563 638 ;
|
||||
C -1 ; WX 600 ; N cacute ; B 40 -15 545 661 ;
|
||||
C -1 ; WX 600 ; N nacute ; B 18 0 592 661 ;
|
||||
C -1 ; WX 600 ; N umacron ; B -1 -15 569 585 ;
|
||||
C -1 ; WX 600 ; N Ncaron ; B 8 -12 610 790 ;
|
||||
C -1 ; WX 600 ; N Iacute ; B 77 0 523 784 ;
|
||||
C -1 ; WX 600 ; N plusminus ; B 71 24 529 515 ;
|
||||
C -1 ; WX 600 ; N brokenbar ; B 255 -175 345 675 ;
|
||||
C -1 ; WX 600 ; N registered ; B 0 -18 600 580 ;
|
||||
C -1 ; WX 600 ; N Gbreve ; B 22 -18 594 784 ;
|
||||
C -1 ; WX 600 ; N Idotaccent ; B 77 0 523 761 ;
|
||||
C -1 ; WX 600 ; N summation ; B 15 -10 586 706 ;
|
||||
C -1 ; WX 600 ; N Egrave ; B 25 0 560 784 ;
|
||||
C -1 ; WX 600 ; N racute ; B 47 0 580 661 ;
|
||||
C -1 ; WX 600 ; N omacron ; B 30 -15 570 585 ;
|
||||
C -1 ; WX 600 ; N Zacute ; B 62 0 539 784 ;
|
||||
C -1 ; WX 600 ; N Zcaron ; B 62 0 539 790 ;
|
||||
C -1 ; WX 600 ; N greaterequal ; B 26 0 523 696 ;
|
||||
C -1 ; WX 600 ; N Eth ; B 30 0 594 562 ;
|
||||
C -1 ; WX 600 ; N Ccedilla ; B 22 -206 560 580 ;
|
||||
C -1 ; WX 600 ; N lcommaaccent ; B 77 -250 523 626 ;
|
||||
C -1 ; WX 600 ; N tcaron ; B 47 -15 532 703 ;
|
||||
C -1 ; WX 600 ; N eogonek ; B 40 -199 563 454 ;
|
||||
C -1 ; WX 600 ; N Uogonek ; B 4 -199 596 562 ;
|
||||
C -1 ; WX 600 ; N Aacute ; B -9 0 609 784 ;
|
||||
C -1 ; WX 600 ; N Adieresis ; B -9 0 609 761 ;
|
||||
C -1 ; WX 600 ; N egrave ; B 40 -15 563 661 ;
|
||||
C -1 ; WX 600 ; N zacute ; B 81 0 520 661 ;
|
||||
C -1 ; WX 600 ; N iogonek ; B 77 -199 523 658 ;
|
||||
C -1 ; WX 600 ; N Oacute ; B 22 -18 578 784 ;
|
||||
C -1 ; WX 600 ; N oacute ; B 30 -15 570 661 ;
|
||||
C -1 ; WX 600 ; N amacron ; B 35 -15 570 585 ;
|
||||
C -1 ; WX 600 ; N sacute ; B 68 -17 535 661 ;
|
||||
C -1 ; WX 600 ; N idieresis ; B 77 0 523 618 ;
|
||||
C -1 ; WX 600 ; N Ocircumflex ; B 22 -18 578 780 ;
|
||||
C -1 ; WX 600 ; N Ugrave ; B 4 -18 596 784 ;
|
||||
C -1 ; WX 600 ; N Delta ; B 6 0 594 688 ;
|
||||
C -1 ; WX 600 ; N thorn ; B -14 -142 570 626 ;
|
||||
C -1 ; WX 600 ; N twosuperior ; B 143 230 436 616 ;
|
||||
C -1 ; WX 600 ; N Odieresis ; B 22 -18 578 761 ;
|
||||
C -1 ; WX 600 ; N mu ; B -1 -142 569 439 ;
|
||||
C -1 ; WX 600 ; N igrave ; B 77 0 523 661 ;
|
||||
C -1 ; WX 600 ; N ohungarumlaut ; B 30 -15 668 661 ;
|
||||
C -1 ; WX 600 ; N Eogonek ; B 25 -199 576 562 ;
|
||||
C -1 ; WX 600 ; N dcroat ; B 20 -15 591 626 ;
|
||||
C -1 ; WX 600 ; N threequarters ; B -47 -60 648 661 ;
|
||||
C -1 ; WX 600 ; N Scedilla ; B 47 -206 553 582 ;
|
||||
C -1 ; WX 600 ; N lcaron ; B 77 0 597 626 ;
|
||||
C -1 ; WX 600 ; N Kcommaaccent ; B 21 -250 599 562 ;
|
||||
C -1 ; WX 600 ; N Lacute ; B 39 0 578 784 ;
|
||||
C -1 ; WX 600 ; N trademark ; B -9 230 749 562 ;
|
||||
C -1 ; WX 600 ; N edotaccent ; B 40 -15 563 638 ;
|
||||
C -1 ; WX 600 ; N Igrave ; B 77 0 523 784 ;
|
||||
C -1 ; WX 600 ; N Imacron ; B 77 0 523 708 ;
|
||||
C -1 ; WX 600 ; N Lcaron ; B 39 0 637 562 ;
|
||||
C -1 ; WX 600 ; N onehalf ; B -47 -60 648 661 ;
|
||||
C -1 ; WX 600 ; N lessequal ; B 26 0 523 696 ;
|
||||
C -1 ; WX 600 ; N ocircumflex ; B 30 -15 570 657 ;
|
||||
C -1 ; WX 600 ; N ntilde ; B 18 0 592 636 ;
|
||||
C -1 ; WX 600 ; N Uhungarumlaut ; B 4 -18 638 784 ;
|
||||
C -1 ; WX 600 ; N Eacute ; B 25 0 560 784 ;
|
||||
C -1 ; WX 600 ; N emacron ; B 40 -15 563 585 ;
|
||||
C -1 ; WX 600 ; N gbreve ; B 30 -146 580 661 ;
|
||||
C -1 ; WX 600 ; N onequarter ; B -56 -60 656 661 ;
|
||||
C -1 ; WX 600 ; N Scaron ; B 47 -22 553 790 ;
|
||||
C -1 ; WX 600 ; N Scommaaccent ; B 47 -250 553 582 ;
|
||||
C -1 ; WX 600 ; N Ohungarumlaut ; B 22 -18 628 784 ;
|
||||
C -1 ; WX 600 ; N degree ; B 86 243 474 616 ;
|
||||
C -1 ; WX 600 ; N ograve ; B 30 -15 570 661 ;
|
||||
C -1 ; WX 600 ; N Ccaron ; B 22 -18 560 790 ;
|
||||
C -1 ; WX 600 ; N ugrave ; B -1 -15 569 661 ;
|
||||
C -1 ; WX 600 ; N radical ; B -19 -104 473 778 ;
|
||||
C -1 ; WX 600 ; N Dcaron ; B 30 0 594 790 ;
|
||||
C -1 ; WX 600 ; N rcommaaccent ; B 47 -250 580 454 ;
|
||||
C -1 ; WX 600 ; N Ntilde ; B 8 -12 610 759 ;
|
||||
C -1 ; WX 600 ; N otilde ; B 30 -15 570 636 ;
|
||||
C -1 ; WX 600 ; N Rcommaaccent ; B 24 -250 599 562 ;
|
||||
C -1 ; WX 600 ; N Lcommaaccent ; B 39 -250 578 562 ;
|
||||
C -1 ; WX 600 ; N Atilde ; B -9 0 609 759 ;
|
||||
C -1 ; WX 600 ; N Aogonek ; B -9 -199 625 562 ;
|
||||
C -1 ; WX 600 ; N Aring ; B -9 0 609 801 ;
|
||||
C -1 ; WX 600 ; N Otilde ; B 22 -18 578 759 ;
|
||||
C -1 ; WX 600 ; N zdotaccent ; B 81 0 520 638 ;
|
||||
C -1 ; WX 600 ; N Ecaron ; B 25 0 560 790 ;
|
||||
C -1 ; WX 600 ; N Iogonek ; B 77 -199 523 562 ;
|
||||
C -1 ; WX 600 ; N kcommaaccent ; B 20 -250 585 626 ;
|
||||
C -1 ; WX 600 ; N minus ; B 71 203 529 313 ;
|
||||
C -1 ; WX 600 ; N Icircumflex ; B 77 0 523 780 ;
|
||||
C -1 ; WX 600 ; N ncaron ; B 18 0 592 667 ;
|
||||
C -1 ; WX 600 ; N tcommaaccent ; B 47 -250 532 562 ;
|
||||
C -1 ; WX 600 ; N logicalnot ; B 71 103 529 413 ;
|
||||
C -1 ; WX 600 ; N odieresis ; B 30 -15 570 638 ;
|
||||
C -1 ; WX 600 ; N udieresis ; B -1 -15 569 638 ;
|
||||
C -1 ; WX 600 ; N notequal ; B 12 -47 537 563 ;
|
||||
C -1 ; WX 600 ; N gcommaaccent ; B 30 -146 580 714 ;
|
||||
C -1 ; WX 600 ; N eth ; B 58 -27 543 626 ;
|
||||
C -1 ; WX 600 ; N zcaron ; B 81 0 520 667 ;
|
||||
C -1 ; WX 600 ; N ncommaaccent ; B 18 -250 592 454 ;
|
||||
C -1 ; WX 600 ; N onesuperior ; B 153 230 447 616 ;
|
||||
C -1 ; WX 600 ; N imacron ; B 77 0 523 585 ;
|
||||
C -1 ; WX 600 ; N Euro ; B 0 0 0 0 ;
|
||||
EndCharMetrics
|
||||
EndFontMetrics
|
||||
342
includes/classes/org/pdf-php/fonts/Courier-BoldOblique.afm
Normal file
342
includes/classes/org/pdf-php/fonts/Courier-BoldOblique.afm
Normal file
@@ -0,0 +1,342 @@
|
||||
StartFontMetrics 4.1
|
||||
Comment Copyright (c) 1989, 1990, 1991, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
|
||||
Comment Creation Date: Mon Jun 23 16:28:46 1997
|
||||
Comment UniqueID 43049
|
||||
Comment VMusage 17529 79244
|
||||
FontName Courier-BoldOblique
|
||||
FullName Courier Bold Oblique
|
||||
FamilyName Courier
|
||||
Weight Bold
|
||||
ItalicAngle -12
|
||||
IsFixedPitch true
|
||||
CharacterSet ExtendedRoman
|
||||
FontBBox -57 -250 869 801
|
||||
UnderlinePosition -100
|
||||
UnderlineThickness 50
|
||||
Version 003.000
|
||||
Notice Copyright (c) 1989, 1990, 1991, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
|
||||
EncodingScheme AdobeStandardEncoding
|
||||
CapHeight 562
|
||||
XHeight 439
|
||||
Ascender 629
|
||||
Descender -157
|
||||
StdHW 84
|
||||
StdVW 106
|
||||
StartCharMetrics 315
|
||||
C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
|
||||
C 33 ; WX 600 ; N exclam ; B 215 -15 495 572 ;
|
||||
C 34 ; WX 600 ; N quotedbl ; B 211 277 585 562 ;
|
||||
C 35 ; WX 600 ; N numbersign ; B 88 -45 641 651 ;
|
||||
C 36 ; WX 600 ; N dollar ; B 87 -126 630 666 ;
|
||||
C 37 ; WX 600 ; N percent ; B 101 -15 625 616 ;
|
||||
C 38 ; WX 600 ; N ampersand ; B 61 -15 595 543 ;
|
||||
C 39 ; WX 600 ; N quoteright ; B 229 277 543 562 ;
|
||||
C 40 ; WX 600 ; N parenleft ; B 265 -102 592 616 ;
|
||||
C 41 ; WX 600 ; N parenright ; B 117 -102 444 616 ;
|
||||
C 42 ; WX 600 ; N asterisk ; B 179 219 598 601 ;
|
||||
C 43 ; WX 600 ; N plus ; B 114 39 596 478 ;
|
||||
C 44 ; WX 600 ; N comma ; B 99 -111 430 174 ;
|
||||
C 45 ; WX 600 ; N hyphen ; B 143 203 567 313 ;
|
||||
C 46 ; WX 600 ; N period ; B 206 -15 427 171 ;
|
||||
C 47 ; WX 600 ; N slash ; B 90 -77 626 626 ;
|
||||
C 48 ; WX 600 ; N zero ; B 135 -15 593 616 ;
|
||||
C 49 ; WX 600 ; N one ; B 93 0 562 616 ;
|
||||
C 50 ; WX 600 ; N two ; B 61 0 594 616 ;
|
||||
C 51 ; WX 600 ; N three ; B 71 -15 571 616 ;
|
||||
C 52 ; WX 600 ; N four ; B 81 0 559 616 ;
|
||||
C 53 ; WX 600 ; N five ; B 77 -15 621 601 ;
|
||||
C 54 ; WX 600 ; N six ; B 135 -15 652 616 ;
|
||||
C 55 ; WX 600 ; N seven ; B 147 0 622 601 ;
|
||||
C 56 ; WX 600 ; N eight ; B 115 -15 604 616 ;
|
||||
C 57 ; WX 600 ; N nine ; B 75 -15 592 616 ;
|
||||
C 58 ; WX 600 ; N colon ; B 205 -15 480 425 ;
|
||||
C 59 ; WX 600 ; N semicolon ; B 99 -111 481 425 ;
|
||||
C 60 ; WX 600 ; N less ; B 120 15 613 501 ;
|
||||
C 61 ; WX 600 ; N equal ; B 96 118 614 398 ;
|
||||
C 62 ; WX 600 ; N greater ; B 97 15 589 501 ;
|
||||
C 63 ; WX 600 ; N question ; B 183 -14 592 580 ;
|
||||
C 64 ; WX 600 ; N at ; B 65 -15 642 616 ;
|
||||
C 65 ; WX 600 ; N A ; B -9 0 632 562 ;
|
||||
C 66 ; WX 600 ; N B ; B 30 0 630 562 ;
|
||||
C 67 ; WX 600 ; N C ; B 74 -18 675 580 ;
|
||||
C 68 ; WX 600 ; N D ; B 30 0 664 562 ;
|
||||
C 69 ; WX 600 ; N E ; B 25 0 670 562 ;
|
||||
C 70 ; WX 600 ; N F ; B 39 0 684 562 ;
|
||||
C 71 ; WX 600 ; N G ; B 74 -18 675 580 ;
|
||||
C 72 ; WX 600 ; N H ; B 20 0 700 562 ;
|
||||
C 73 ; WX 600 ; N I ; B 77 0 643 562 ;
|
||||
C 74 ; WX 600 ; N J ; B 58 -18 721 562 ;
|
||||
C 75 ; WX 600 ; N K ; B 21 0 692 562 ;
|
||||
C 76 ; WX 600 ; N L ; B 39 0 636 562 ;
|
||||
C 77 ; WX 600 ; N M ; B -2 0 722 562 ;
|
||||
C 78 ; WX 600 ; N N ; B 8 -12 730 562 ;
|
||||
C 79 ; WX 600 ; N O ; B 74 -18 645 580 ;
|
||||
C 80 ; WX 600 ; N P ; B 48 0 643 562 ;
|
||||
C 81 ; WX 600 ; N Q ; B 83 -138 636 580 ;
|
||||
C 82 ; WX 600 ; N R ; B 24 0 617 562 ;
|
||||
C 83 ; WX 600 ; N S ; B 54 -22 673 582 ;
|
||||
C 84 ; WX 600 ; N T ; B 86 0 679 562 ;
|
||||
C 85 ; WX 600 ; N U ; B 101 -18 716 562 ;
|
||||
C 86 ; WX 600 ; N V ; B 84 0 733 562 ;
|
||||
C 87 ; WX 600 ; N W ; B 79 0 738 562 ;
|
||||
C 88 ; WX 600 ; N X ; B 12 0 690 562 ;
|
||||
C 89 ; WX 600 ; N Y ; B 109 0 709 562 ;
|
||||
C 90 ; WX 600 ; N Z ; B 62 0 637 562 ;
|
||||
C 91 ; WX 600 ; N bracketleft ; B 223 -102 606 616 ;
|
||||
C 92 ; WX 600 ; N backslash ; B 222 -77 496 626 ;
|
||||
C 93 ; WX 600 ; N bracketright ; B 103 -102 486 616 ;
|
||||
C 94 ; WX 600 ; N asciicircum ; B 171 250 556 616 ;
|
||||
C 95 ; WX 600 ; N underscore ; B -27 -125 585 -75 ;
|
||||
C 96 ; WX 600 ; N quoteleft ; B 297 277 487 562 ;
|
||||
C 97 ; WX 600 ; N a ; B 61 -15 593 454 ;
|
||||
C 98 ; WX 600 ; N b ; B 13 -15 636 626 ;
|
||||
C 99 ; WX 600 ; N c ; B 81 -15 631 459 ;
|
||||
C 100 ; WX 600 ; N d ; B 60 -15 645 626 ;
|
||||
C 101 ; WX 600 ; N e ; B 81 -15 605 454 ;
|
||||
C 102 ; WX 600 ; N f ; B 83 0 677 626 ; L i fi ; L l fl ;
|
||||
C 103 ; WX 600 ; N g ; B 40 -146 674 454 ;
|
||||
C 104 ; WX 600 ; N h ; B 18 0 615 626 ;
|
||||
C 105 ; WX 600 ; N i ; B 77 0 546 658 ;
|
||||
C 106 ; WX 600 ; N j ; B 36 -146 580 658 ;
|
||||
C 107 ; WX 600 ; N k ; B 33 0 643 626 ;
|
||||
C 108 ; WX 600 ; N l ; B 77 0 546 626 ;
|
||||
C 109 ; WX 600 ; N m ; B -22 0 649 454 ;
|
||||
C 110 ; WX 600 ; N n ; B 18 0 615 454 ;
|
||||
C 111 ; WX 600 ; N o ; B 71 -15 622 454 ;
|
||||
C 112 ; WX 600 ; N p ; B -32 -142 622 454 ;
|
||||
C 113 ; WX 600 ; N q ; B 60 -142 685 454 ;
|
||||
C 114 ; WX 600 ; N r ; B 47 0 655 454 ;
|
||||
C 115 ; WX 600 ; N s ; B 66 -17 608 459 ;
|
||||
C 116 ; WX 600 ; N t ; B 118 -15 567 562 ;
|
||||
C 117 ; WX 600 ; N u ; B 70 -15 592 439 ;
|
||||
C 118 ; WX 600 ; N v ; B 70 0 695 439 ;
|
||||
C 119 ; WX 600 ; N w ; B 53 0 712 439 ;
|
||||
C 120 ; WX 600 ; N x ; B 6 0 671 439 ;
|
||||
C 121 ; WX 600 ; N y ; B -21 -142 695 439 ;
|
||||
C 122 ; WX 600 ; N z ; B 81 0 614 439 ;
|
||||
C 123 ; WX 600 ; N braceleft ; B 203 -102 595 616 ;
|
||||
C 124 ; WX 600 ; N bar ; B 201 -250 505 750 ;
|
||||
C 125 ; WX 600 ; N braceright ; B 114 -102 506 616 ;
|
||||
C 126 ; WX 600 ; N asciitilde ; B 120 153 590 356 ;
|
||||
C 161 ; WX 600 ; N exclamdown ; B 196 -146 477 449 ;
|
||||
C 162 ; WX 600 ; N cent ; B 121 -49 605 614 ;
|
||||
C 163 ; WX 600 ; N sterling ; B 106 -28 650 611 ;
|
||||
C 164 ; WX 600 ; N fraction ; B 22 -60 708 661 ;
|
||||
C 165 ; WX 600 ; N yen ; B 98 0 710 562 ;
|
||||
C 166 ; WX 600 ; N florin ; B -57 -131 702 616 ;
|
||||
C 167 ; WX 600 ; N section ; B 74 -70 620 580 ;
|
||||
C 168 ; WX 600 ; N currency ; B 77 49 644 517 ;
|
||||
C 169 ; WX 600 ; N quotesingle ; B 303 277 493 562 ;
|
||||
C 170 ; WX 600 ; N quotedblleft ; B 190 277 594 562 ;
|
||||
C 171 ; WX 600 ; N guillemotleft ; B 62 70 639 446 ;
|
||||
C 172 ; WX 600 ; N guilsinglleft ; B 195 70 545 446 ;
|
||||
C 173 ; WX 600 ; N guilsinglright ; B 165 70 514 446 ;
|
||||
C 174 ; WX 600 ; N fi ; B 12 0 644 626 ;
|
||||
C 175 ; WX 600 ; N fl ; B 12 0 644 626 ;
|
||||
C 177 ; WX 600 ; N endash ; B 108 203 602 313 ;
|
||||
C 178 ; WX 600 ; N dagger ; B 175 -70 586 580 ;
|
||||
C 179 ; WX 600 ; N daggerdbl ; B 121 -70 587 580 ;
|
||||
C 180 ; WX 600 ; N periodcentered ; B 248 165 461 351 ;
|
||||
C 182 ; WX 600 ; N paragraph ; B 61 -70 700 580 ;
|
||||
C 183 ; WX 600 ; N bullet ; B 196 132 523 430 ;
|
||||
C 184 ; WX 600 ; N quotesinglbase ; B 144 -142 458 143 ;
|
||||
C 185 ; WX 600 ; N quotedblbase ; B 34 -142 560 143 ;
|
||||
C 186 ; WX 600 ; N quotedblright ; B 119 277 645 562 ;
|
||||
C 187 ; WX 600 ; N guillemotright ; B 71 70 647 446 ;
|
||||
C 188 ; WX 600 ; N ellipsis ; B 35 -15 587 116 ;
|
||||
C 189 ; WX 600 ; N perthousand ; B -45 -15 743 616 ;
|
||||
C 191 ; WX 600 ; N questiondown ; B 100 -146 509 449 ;
|
||||
C 193 ; WX 600 ; N grave ; B 272 508 503 661 ;
|
||||
C 194 ; WX 600 ; N acute ; B 312 508 609 661 ;
|
||||
C 195 ; WX 600 ; N circumflex ; B 212 483 607 657 ;
|
||||
C 196 ; WX 600 ; N tilde ; B 199 493 643 636 ;
|
||||
C 197 ; WX 600 ; N macron ; B 195 505 637 585 ;
|
||||
C 198 ; WX 600 ; N breve ; B 217 468 652 631 ;
|
||||
C 199 ; WX 600 ; N dotaccent ; B 348 498 493 638 ;
|
||||
C 200 ; WX 600 ; N dieresis ; B 246 498 595 638 ;
|
||||
C 202 ; WX 600 ; N ring ; B 319 481 528 678 ;
|
||||
C 203 ; WX 600 ; N cedilla ; B 168 -206 368 0 ;
|
||||
C 205 ; WX 600 ; N hungarumlaut ; B 171 488 729 661 ;
|
||||
C 206 ; WX 600 ; N ogonek ; B 143 -199 367 0 ;
|
||||
C 207 ; WX 600 ; N caron ; B 238 493 633 667 ;
|
||||
C 208 ; WX 600 ; N emdash ; B 33 203 677 313 ;
|
||||
C 225 ; WX 600 ; N AE ; B -29 0 708 562 ;
|
||||
C 227 ; WX 600 ; N ordfeminine ; B 188 196 526 580 ;
|
||||
C 232 ; WX 600 ; N Lslash ; B 39 0 636 562 ;
|
||||
C 233 ; WX 600 ; N Oslash ; B 48 -22 673 584 ;
|
||||
C 234 ; WX 600 ; N OE ; B 26 0 701 562 ;
|
||||
C 235 ; WX 600 ; N ordmasculine ; B 188 196 543 580 ;
|
||||
C 241 ; WX 600 ; N ae ; B 21 -15 652 454 ;
|
||||
C 245 ; WX 600 ; N dotlessi ; B 77 0 546 439 ;
|
||||
C 248 ; WX 600 ; N lslash ; B 77 0 587 626 ;
|
||||
C 249 ; WX 600 ; N oslash ; B 54 -24 638 463 ;
|
||||
C 250 ; WX 600 ; N oe ; B 18 -15 662 454 ;
|
||||
C 251 ; WX 600 ; N germandbls ; B 22 -15 629 626 ;
|
||||
C -1 ; WX 600 ; N Idieresis ; B 77 0 643 761 ;
|
||||
C -1 ; WX 600 ; N eacute ; B 81 -15 609 661 ;
|
||||
C -1 ; WX 600 ; N abreve ; B 61 -15 658 661 ;
|
||||
C -1 ; WX 600 ; N uhungarumlaut ; B 70 -15 769 661 ;
|
||||
C -1 ; WX 600 ; N ecaron ; B 81 -15 633 667 ;
|
||||
C -1 ; WX 600 ; N Ydieresis ; B 109 0 709 761 ;
|
||||
C -1 ; WX 600 ; N divide ; B 114 16 596 500 ;
|
||||
C -1 ; WX 600 ; N Yacute ; B 109 0 709 784 ;
|
||||
C -1 ; WX 600 ; N Acircumflex ; B -9 0 632 780 ;
|
||||
C -1 ; WX 600 ; N aacute ; B 61 -15 609 661 ;
|
||||
C -1 ; WX 600 ; N Ucircumflex ; B 101 -18 716 780 ;
|
||||
C -1 ; WX 600 ; N yacute ; B -21 -142 695 661 ;
|
||||
C -1 ; WX 600 ; N scommaaccent ; B 66 -250 608 459 ;
|
||||
C -1 ; WX 600 ; N ecircumflex ; B 81 -15 607 657 ;
|
||||
C -1 ; WX 600 ; N Uring ; B 101 -18 716 801 ;
|
||||
C -1 ; WX 600 ; N Udieresis ; B 101 -18 716 761 ;
|
||||
C -1 ; WX 600 ; N aogonek ; B 61 -199 593 454 ;
|
||||
C -1 ; WX 600 ; N Uacute ; B 101 -18 716 784 ;
|
||||
C -1 ; WX 600 ; N uogonek ; B 70 -199 592 439 ;
|
||||
C -1 ; WX 600 ; N Edieresis ; B 25 0 670 761 ;
|
||||
C -1 ; WX 600 ; N Dcroat ; B 30 0 664 562 ;
|
||||
C -1 ; WX 600 ; N commaaccent ; B 151 -250 385 -57 ;
|
||||
C -1 ; WX 600 ; N copyright ; B 53 -18 667 580 ;
|
||||
C -1 ; WX 600 ; N Emacron ; B 25 0 670 708 ;
|
||||
C -1 ; WX 600 ; N ccaron ; B 81 -15 633 667 ;
|
||||
C -1 ; WX 600 ; N aring ; B 61 -15 593 678 ;
|
||||
C -1 ; WX 600 ; N Ncommaaccent ; B 8 -250 730 562 ;
|
||||
C -1 ; WX 600 ; N lacute ; B 77 0 639 801 ;
|
||||
C -1 ; WX 600 ; N agrave ; B 61 -15 593 661 ;
|
||||
C -1 ; WX 600 ; N Tcommaaccent ; B 86 -250 679 562 ;
|
||||
C -1 ; WX 600 ; N Cacute ; B 74 -18 675 784 ;
|
||||
C -1 ; WX 600 ; N atilde ; B 61 -15 643 636 ;
|
||||
C -1 ; WX 600 ; N Edotaccent ; B 25 0 670 761 ;
|
||||
C -1 ; WX 600 ; N scaron ; B 66 -17 633 667 ;
|
||||
C -1 ; WX 600 ; N scedilla ; B 66 -206 608 459 ;
|
||||
C -1 ; WX 600 ; N iacute ; B 77 0 609 661 ;
|
||||
C -1 ; WX 600 ; N lozenge ; B 145 0 614 740 ;
|
||||
C -1 ; WX 600 ; N Rcaron ; B 24 0 659 790 ;
|
||||
C -1 ; WX 600 ; N Gcommaaccent ; B 74 -250 675 580 ;
|
||||
C -1 ; WX 600 ; N ucircumflex ; B 70 -15 597 657 ;
|
||||
C -1 ; WX 600 ; N acircumflex ; B 61 -15 607 657 ;
|
||||
C -1 ; WX 600 ; N Amacron ; B -9 0 633 708 ;
|
||||
C -1 ; WX 600 ; N rcaron ; B 47 0 655 667 ;
|
||||
C -1 ; WX 600 ; N ccedilla ; B 81 -206 631 459 ;
|
||||
C -1 ; WX 600 ; N Zdotaccent ; B 62 0 637 761 ;
|
||||
C -1 ; WX 600 ; N Thorn ; B 48 0 620 562 ;
|
||||
C -1 ; WX 600 ; N Omacron ; B 74 -18 663 708 ;
|
||||
C -1 ; WX 600 ; N Racute ; B 24 0 665 784 ;
|
||||
C -1 ; WX 600 ; N Sacute ; B 54 -22 673 784 ;
|
||||
C -1 ; WX 600 ; N dcaron ; B 60 -15 861 626 ;
|
||||
C -1 ; WX 600 ; N Umacron ; B 101 -18 716 708 ;
|
||||
C -1 ; WX 600 ; N uring ; B 70 -15 592 678 ;
|
||||
C -1 ; WX 600 ; N threesuperior ; B 193 222 526 616 ;
|
||||
C -1 ; WX 600 ; N Ograve ; B 74 -18 645 784 ;
|
||||
C -1 ; WX 600 ; N Agrave ; B -9 0 632 784 ;
|
||||
C -1 ; WX 600 ; N Abreve ; B -9 0 684 784 ;
|
||||
C -1 ; WX 600 ; N multiply ; B 104 39 606 478 ;
|
||||
C -1 ; WX 600 ; N uacute ; B 70 -15 599 661 ;
|
||||
C -1 ; WX 600 ; N Tcaron ; B 86 0 679 790 ;
|
||||
C -1 ; WX 600 ; N partialdiff ; B 91 -38 627 728 ;
|
||||
C -1 ; WX 600 ; N ydieresis ; B -21 -142 695 638 ;
|
||||
C -1 ; WX 600 ; N Nacute ; B 8 -12 730 784 ;
|
||||
C -1 ; WX 600 ; N icircumflex ; B 77 0 577 657 ;
|
||||
C -1 ; WX 600 ; N Ecircumflex ; B 25 0 670 780 ;
|
||||
C -1 ; WX 600 ; N adieresis ; B 61 -15 595 638 ;
|
||||
C -1 ; WX 600 ; N edieresis ; B 81 -15 605 638 ;
|
||||
C -1 ; WX 600 ; N cacute ; B 81 -15 649 661 ;
|
||||
C -1 ; WX 600 ; N nacute ; B 18 0 639 661 ;
|
||||
C -1 ; WX 600 ; N umacron ; B 70 -15 637 585 ;
|
||||
C -1 ; WX 600 ; N Ncaron ; B 8 -12 730 790 ;
|
||||
C -1 ; WX 600 ; N Iacute ; B 77 0 643 784 ;
|
||||
C -1 ; WX 600 ; N plusminus ; B 76 24 614 515 ;
|
||||
C -1 ; WX 600 ; N brokenbar ; B 217 -175 489 675 ;
|
||||
C -1 ; WX 600 ; N registered ; B 53 -18 667 580 ;
|
||||
C -1 ; WX 600 ; N Gbreve ; B 74 -18 684 784 ;
|
||||
C -1 ; WX 600 ; N Idotaccent ; B 77 0 643 761 ;
|
||||
C -1 ; WX 600 ; N summation ; B 15 -10 672 706 ;
|
||||
C -1 ; WX 600 ; N Egrave ; B 25 0 670 784 ;
|
||||
C -1 ; WX 600 ; N racute ; B 47 0 655 661 ;
|
||||
C -1 ; WX 600 ; N omacron ; B 71 -15 637 585 ;
|
||||
C -1 ; WX 600 ; N Zacute ; B 62 0 665 784 ;
|
||||
C -1 ; WX 600 ; N Zcaron ; B 62 0 659 790 ;
|
||||
C -1 ; WX 600 ; N greaterequal ; B 26 0 627 696 ;
|
||||
C -1 ; WX 600 ; N Eth ; B 30 0 664 562 ;
|
||||
C -1 ; WX 600 ; N Ccedilla ; B 74 -206 675 580 ;
|
||||
C -1 ; WX 600 ; N lcommaaccent ; B 77 -250 546 626 ;
|
||||
C -1 ; WX 600 ; N tcaron ; B 118 -15 627 703 ;
|
||||
C -1 ; WX 600 ; N eogonek ; B 81 -199 605 454 ;
|
||||
C -1 ; WX 600 ; N Uogonek ; B 101 -199 716 562 ;
|
||||
C -1 ; WX 600 ; N Aacute ; B -9 0 655 784 ;
|
||||
C -1 ; WX 600 ; N Adieresis ; B -9 0 632 761 ;
|
||||
C -1 ; WX 600 ; N egrave ; B 81 -15 605 661 ;
|
||||
C -1 ; WX 600 ; N zacute ; B 81 0 614 661 ;
|
||||
C -1 ; WX 600 ; N iogonek ; B 77 -199 546 658 ;
|
||||
C -1 ; WX 600 ; N Oacute ; B 74 -18 645 784 ;
|
||||
C -1 ; WX 600 ; N oacute ; B 71 -15 649 661 ;
|
||||
C -1 ; WX 600 ; N amacron ; B 61 -15 637 585 ;
|
||||
C -1 ; WX 600 ; N sacute ; B 66 -17 609 661 ;
|
||||
C -1 ; WX 600 ; N idieresis ; B 77 0 561 618 ;
|
||||
C -1 ; WX 600 ; N Ocircumflex ; B 74 -18 645 780 ;
|
||||
C -1 ; WX 600 ; N Ugrave ; B 101 -18 716 784 ;
|
||||
C -1 ; WX 600 ; N Delta ; B 6 0 594 688 ;
|
||||
C -1 ; WX 600 ; N thorn ; B -32 -142 622 626 ;
|
||||
C -1 ; WX 600 ; N twosuperior ; B 191 230 542 616 ;
|
||||
C -1 ; WX 600 ; N Odieresis ; B 74 -18 645 761 ;
|
||||
C -1 ; WX 600 ; N mu ; B 49 -142 592 439 ;
|
||||
C -1 ; WX 600 ; N igrave ; B 77 0 546 661 ;
|
||||
C -1 ; WX 600 ; N ohungarumlaut ; B 71 -15 809 661 ;
|
||||
C -1 ; WX 600 ; N Eogonek ; B 25 -199 670 562 ;
|
||||
C -1 ; WX 600 ; N dcroat ; B 60 -15 712 626 ;
|
||||
C -1 ; WX 600 ; N threequarters ; B 8 -60 699 661 ;
|
||||
C -1 ; WX 600 ; N Scedilla ; B 54 -206 673 582 ;
|
||||
C -1 ; WX 600 ; N lcaron ; B 77 0 731 626 ;
|
||||
C -1 ; WX 600 ; N Kcommaaccent ; B 21 -250 692 562 ;
|
||||
C -1 ; WX 600 ; N Lacute ; B 39 0 636 784 ;
|
||||
C -1 ; WX 600 ; N trademark ; B 86 230 869 562 ;
|
||||
C -1 ; WX 600 ; N edotaccent ; B 81 -15 605 638 ;
|
||||
C -1 ; WX 600 ; N Igrave ; B 77 0 643 784 ;
|
||||
C -1 ; WX 600 ; N Imacron ; B 77 0 663 708 ;
|
||||
C -1 ; WX 600 ; N Lcaron ; B 39 0 757 562 ;
|
||||
C -1 ; WX 600 ; N onehalf ; B 22 -60 716 661 ;
|
||||
C -1 ; WX 600 ; N lessequal ; B 26 0 671 696 ;
|
||||
C -1 ; WX 600 ; N ocircumflex ; B 71 -15 622 657 ;
|
||||
C -1 ; WX 600 ; N ntilde ; B 18 0 643 636 ;
|
||||
C -1 ; WX 600 ; N Uhungarumlaut ; B 101 -18 805 784 ;
|
||||
C -1 ; WX 600 ; N Eacute ; B 25 0 670 784 ;
|
||||
C -1 ; WX 600 ; N emacron ; B 81 -15 637 585 ;
|
||||
C -1 ; WX 600 ; N gbreve ; B 40 -146 674 661 ;
|
||||
C -1 ; WX 600 ; N onequarter ; B 13 -60 707 661 ;
|
||||
C -1 ; WX 600 ; N Scaron ; B 54 -22 689 790 ;
|
||||
C -1 ; WX 600 ; N Scommaaccent ; B 54 -250 673 582 ;
|
||||
C -1 ; WX 600 ; N Ohungarumlaut ; B 74 -18 795 784 ;
|
||||
C -1 ; WX 600 ; N degree ; B 173 243 570 616 ;
|
||||
C -1 ; WX 600 ; N ograve ; B 71 -15 622 661 ;
|
||||
C -1 ; WX 600 ; N Ccaron ; B 74 -18 689 790 ;
|
||||
C -1 ; WX 600 ; N ugrave ; B 70 -15 592 661 ;
|
||||
C -1 ; WX 600 ; N radical ; B 67 -104 635 778 ;
|
||||
C -1 ; WX 600 ; N Dcaron ; B 30 0 664 790 ;
|
||||
C -1 ; WX 600 ; N rcommaaccent ; B 47 -250 655 454 ;
|
||||
C -1 ; WX 600 ; N Ntilde ; B 8 -12 730 759 ;
|
||||
C -1 ; WX 600 ; N otilde ; B 71 -15 643 636 ;
|
||||
C -1 ; WX 600 ; N Rcommaaccent ; B 24 -250 617 562 ;
|
||||
C -1 ; WX 600 ; N Lcommaaccent ; B 39 -250 636 562 ;
|
||||
C -1 ; WX 600 ; N Atilde ; B -9 0 669 759 ;
|
||||
C -1 ; WX 600 ; N Aogonek ; B -9 -199 632 562 ;
|
||||
C -1 ; WX 600 ; N Aring ; B -9 0 632 801 ;
|
||||
C -1 ; WX 600 ; N Otilde ; B 74 -18 669 759 ;
|
||||
C -1 ; WX 600 ; N zdotaccent ; B 81 0 614 638 ;
|
||||
C -1 ; WX 600 ; N Ecaron ; B 25 0 670 790 ;
|
||||
C -1 ; WX 600 ; N Iogonek ; B 77 -199 643 562 ;
|
||||
C -1 ; WX 600 ; N kcommaaccent ; B 33 -250 643 626 ;
|
||||
C -1 ; WX 600 ; N minus ; B 114 203 596 313 ;
|
||||
C -1 ; WX 600 ; N Icircumflex ; B 77 0 643 780 ;
|
||||
C -1 ; WX 600 ; N ncaron ; B 18 0 633 667 ;
|
||||
C -1 ; WX 600 ; N tcommaaccent ; B 118 -250 567 562 ;
|
||||
C -1 ; WX 600 ; N logicalnot ; B 135 103 617 413 ;
|
||||
C -1 ; WX 600 ; N odieresis ; B 71 -15 622 638 ;
|
||||
C -1 ; WX 600 ; N udieresis ; B 70 -15 595 638 ;
|
||||
C -1 ; WX 600 ; N notequal ; B 30 -47 626 563 ;
|
||||
C -1 ; WX 600 ; N gcommaaccent ; B 40 -146 674 714 ;
|
||||
C -1 ; WX 600 ; N eth ; B 93 -27 661 626 ;
|
||||
C -1 ; WX 600 ; N zcaron ; B 81 0 643 667 ;
|
||||
C -1 ; WX 600 ; N ncommaaccent ; B 18 -250 615 454 ;
|
||||
C -1 ; WX 600 ; N onesuperior ; B 212 230 514 616 ;
|
||||
C -1 ; WX 600 ; N imacron ; B 77 0 575 585 ;
|
||||
C -1 ; WX 600 ; N Euro ; B 0 0 0 0 ;
|
||||
EndCharMetrics
|
||||
EndFontMetrics
|
||||
342
includes/classes/org/pdf-php/fonts/Courier-Oblique.afm
Normal file
342
includes/classes/org/pdf-php/fonts/Courier-Oblique.afm
Normal file
@@ -0,0 +1,342 @@
|
||||
StartFontMetrics 4.1
|
||||
Comment Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
|
||||
Comment Creation Date: Thu May 1 17:37:52 1997
|
||||
Comment UniqueID 43051
|
||||
Comment VMusage 16248 75829
|
||||
FontName Courier-Oblique
|
||||
FullName Courier Oblique
|
||||
FamilyName Courier
|
||||
Weight Medium
|
||||
ItalicAngle -12
|
||||
IsFixedPitch true
|
||||
CharacterSet ExtendedRoman
|
||||
FontBBox -27 -250 849 805
|
||||
UnderlinePosition -100
|
||||
UnderlineThickness 50
|
||||
Version 003.000
|
||||
Notice Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
|
||||
EncodingScheme AdobeStandardEncoding
|
||||
CapHeight 562
|
||||
XHeight 426
|
||||
Ascender 629
|
||||
Descender -157
|
||||
StdHW 51
|
||||
StdVW 51
|
||||
StartCharMetrics 315
|
||||
C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
|
||||
C 33 ; WX 600 ; N exclam ; B 243 -15 464 572 ;
|
||||
C 34 ; WX 600 ; N quotedbl ; B 273 328 532 562 ;
|
||||
C 35 ; WX 600 ; N numbersign ; B 133 -32 596 639 ;
|
||||
C 36 ; WX 600 ; N dollar ; B 108 -126 596 662 ;
|
||||
C 37 ; WX 600 ; N percent ; B 134 -15 599 622 ;
|
||||
C 38 ; WX 600 ; N ampersand ; B 87 -15 580 543 ;
|
||||
C 39 ; WX 600 ; N quoteright ; B 283 328 495 562 ;
|
||||
C 40 ; WX 600 ; N parenleft ; B 313 -108 572 622 ;
|
||||
C 41 ; WX 600 ; N parenright ; B 137 -108 396 622 ;
|
||||
C 42 ; WX 600 ; N asterisk ; B 212 257 580 607 ;
|
||||
C 43 ; WX 600 ; N plus ; B 129 44 580 470 ;
|
||||
C 44 ; WX 600 ; N comma ; B 157 -112 370 122 ;
|
||||
C 45 ; WX 600 ; N hyphen ; B 152 231 558 285 ;
|
||||
C 46 ; WX 600 ; N period ; B 238 -15 382 109 ;
|
||||
C 47 ; WX 600 ; N slash ; B 112 -80 604 629 ;
|
||||
C 48 ; WX 600 ; N zero ; B 154 -15 575 622 ;
|
||||
C 49 ; WX 600 ; N one ; B 98 0 515 622 ;
|
||||
C 50 ; WX 600 ; N two ; B 70 0 568 622 ;
|
||||
C 51 ; WX 600 ; N three ; B 82 -15 538 622 ;
|
||||
C 52 ; WX 600 ; N four ; B 108 0 541 622 ;
|
||||
C 53 ; WX 600 ; N five ; B 99 -15 589 607 ;
|
||||
C 54 ; WX 600 ; N six ; B 155 -15 629 622 ;
|
||||
C 55 ; WX 600 ; N seven ; B 182 0 612 607 ;
|
||||
C 56 ; WX 600 ; N eight ; B 132 -15 588 622 ;
|
||||
C 57 ; WX 600 ; N nine ; B 93 -15 574 622 ;
|
||||
C 58 ; WX 600 ; N colon ; B 238 -15 441 385 ;
|
||||
C 59 ; WX 600 ; N semicolon ; B 157 -112 441 385 ;
|
||||
C 60 ; WX 600 ; N less ; B 96 42 610 472 ;
|
||||
C 61 ; WX 600 ; N equal ; B 109 138 600 376 ;
|
||||
C 62 ; WX 600 ; N greater ; B 85 42 599 472 ;
|
||||
C 63 ; WX 600 ; N question ; B 222 -15 583 572 ;
|
||||
C 64 ; WX 600 ; N at ; B 127 -15 582 622 ;
|
||||
C 65 ; WX 600 ; N A ; B 3 0 607 562 ;
|
||||
C 66 ; WX 600 ; N B ; B 43 0 616 562 ;
|
||||
C 67 ; WX 600 ; N C ; B 93 -18 655 580 ;
|
||||
C 68 ; WX 600 ; N D ; B 43 0 645 562 ;
|
||||
C 69 ; WX 600 ; N E ; B 53 0 660 562 ;
|
||||
C 70 ; WX 600 ; N F ; B 53 0 660 562 ;
|
||||
C 71 ; WX 600 ; N G ; B 83 -18 645 580 ;
|
||||
C 72 ; WX 600 ; N H ; B 32 0 687 562 ;
|
||||
C 73 ; WX 600 ; N I ; B 96 0 623 562 ;
|
||||
C 74 ; WX 600 ; N J ; B 52 -18 685 562 ;
|
||||
C 75 ; WX 600 ; N K ; B 38 0 671 562 ;
|
||||
C 76 ; WX 600 ; N L ; B 47 0 607 562 ;
|
||||
C 77 ; WX 600 ; N M ; B 4 0 715 562 ;
|
||||
C 78 ; WX 600 ; N N ; B 7 -13 712 562 ;
|
||||
C 79 ; WX 600 ; N O ; B 94 -18 625 580 ;
|
||||
C 80 ; WX 600 ; N P ; B 79 0 644 562 ;
|
||||
C 81 ; WX 600 ; N Q ; B 95 -138 625 580 ;
|
||||
C 82 ; WX 600 ; N R ; B 38 0 598 562 ;
|
||||
C 83 ; WX 600 ; N S ; B 76 -20 650 580 ;
|
||||
C 84 ; WX 600 ; N T ; B 108 0 665 562 ;
|
||||
C 85 ; WX 600 ; N U ; B 125 -18 702 562 ;
|
||||
C 86 ; WX 600 ; N V ; B 105 -13 723 562 ;
|
||||
C 87 ; WX 600 ; N W ; B 106 -13 722 562 ;
|
||||
C 88 ; WX 600 ; N X ; B 23 0 675 562 ;
|
||||
C 89 ; WX 600 ; N Y ; B 133 0 695 562 ;
|
||||
C 90 ; WX 600 ; N Z ; B 86 0 610 562 ;
|
||||
C 91 ; WX 600 ; N bracketleft ; B 246 -108 574 622 ;
|
||||
C 92 ; WX 600 ; N backslash ; B 249 -80 468 629 ;
|
||||
C 93 ; WX 600 ; N bracketright ; B 135 -108 463 622 ;
|
||||
C 94 ; WX 600 ; N asciicircum ; B 175 354 587 622 ;
|
||||
C 95 ; WX 600 ; N underscore ; B -27 -125 584 -75 ;
|
||||
C 96 ; WX 600 ; N quoteleft ; B 343 328 457 562 ;
|
||||
C 97 ; WX 600 ; N a ; B 76 -15 569 441 ;
|
||||
C 98 ; WX 600 ; N b ; B 29 -15 625 629 ;
|
||||
C 99 ; WX 600 ; N c ; B 106 -15 608 441 ;
|
||||
C 100 ; WX 600 ; N d ; B 85 -15 640 629 ;
|
||||
C 101 ; WX 600 ; N e ; B 106 -15 598 441 ;
|
||||
C 102 ; WX 600 ; N f ; B 114 0 662 629 ; L i fi ; L l fl ;
|
||||
C 103 ; WX 600 ; N g ; B 61 -157 657 441 ;
|
||||
C 104 ; WX 600 ; N h ; B 33 0 592 629 ;
|
||||
C 105 ; WX 600 ; N i ; B 95 0 515 657 ;
|
||||
C 106 ; WX 600 ; N j ; B 52 -157 550 657 ;
|
||||
C 107 ; WX 600 ; N k ; B 58 0 633 629 ;
|
||||
C 108 ; WX 600 ; N l ; B 95 0 515 629 ;
|
||||
C 109 ; WX 600 ; N m ; B -5 0 615 441 ;
|
||||
C 110 ; WX 600 ; N n ; B 26 0 585 441 ;
|
||||
C 111 ; WX 600 ; N o ; B 102 -15 588 441 ;
|
||||
C 112 ; WX 600 ; N p ; B -24 -157 605 441 ;
|
||||
C 113 ; WX 600 ; N q ; B 85 -157 682 441 ;
|
||||
C 114 ; WX 600 ; N r ; B 60 0 636 441 ;
|
||||
C 115 ; WX 600 ; N s ; B 78 -15 584 441 ;
|
||||
C 116 ; WX 600 ; N t ; B 167 -15 561 561 ;
|
||||
C 117 ; WX 600 ; N u ; B 101 -15 572 426 ;
|
||||
C 118 ; WX 600 ; N v ; B 90 -10 681 426 ;
|
||||
C 119 ; WX 600 ; N w ; B 76 -10 695 426 ;
|
||||
C 120 ; WX 600 ; N x ; B 20 0 655 426 ;
|
||||
C 121 ; WX 600 ; N y ; B -4 -157 683 426 ;
|
||||
C 122 ; WX 600 ; N z ; B 99 0 593 426 ;
|
||||
C 123 ; WX 600 ; N braceleft ; B 233 -108 569 622 ;
|
||||
C 124 ; WX 600 ; N bar ; B 222 -250 485 750 ;
|
||||
C 125 ; WX 600 ; N braceright ; B 140 -108 477 622 ;
|
||||
C 126 ; WX 600 ; N asciitilde ; B 116 197 600 320 ;
|
||||
C 161 ; WX 600 ; N exclamdown ; B 225 -157 445 430 ;
|
||||
C 162 ; WX 600 ; N cent ; B 151 -49 588 614 ;
|
||||
C 163 ; WX 600 ; N sterling ; B 124 -21 621 611 ;
|
||||
C 164 ; WX 600 ; N fraction ; B 84 -57 646 665 ;
|
||||
C 165 ; WX 600 ; N yen ; B 120 0 693 562 ;
|
||||
C 166 ; WX 600 ; N florin ; B -26 -143 671 622 ;
|
||||
C 167 ; WX 600 ; N section ; B 104 -78 590 580 ;
|
||||
C 168 ; WX 600 ; N currency ; B 94 58 628 506 ;
|
||||
C 169 ; WX 600 ; N quotesingle ; B 345 328 460 562 ;
|
||||
C 170 ; WX 600 ; N quotedblleft ; B 262 328 541 562 ;
|
||||
C 171 ; WX 600 ; N guillemotleft ; B 92 70 652 446 ;
|
||||
C 172 ; WX 600 ; N guilsinglleft ; B 204 70 540 446 ;
|
||||
C 173 ; WX 600 ; N guilsinglright ; B 170 70 506 446 ;
|
||||
C 174 ; WX 600 ; N fi ; B 3 0 619 629 ;
|
||||
C 175 ; WX 600 ; N fl ; B 3 0 619 629 ;
|
||||
C 177 ; WX 600 ; N endash ; B 124 231 586 285 ;
|
||||
C 178 ; WX 600 ; N dagger ; B 217 -78 546 580 ;
|
||||
C 179 ; WX 600 ; N daggerdbl ; B 163 -78 546 580 ;
|
||||
C 180 ; WX 600 ; N periodcentered ; B 275 189 434 327 ;
|
||||
C 182 ; WX 600 ; N paragraph ; B 100 -78 630 562 ;
|
||||
C 183 ; WX 600 ; N bullet ; B 224 130 485 383 ;
|
||||
C 184 ; WX 600 ; N quotesinglbase ; B 185 -134 397 100 ;
|
||||
C 185 ; WX 600 ; N quotedblbase ; B 115 -134 478 100 ;
|
||||
C 186 ; WX 600 ; N quotedblright ; B 213 328 576 562 ;
|
||||
C 187 ; WX 600 ; N guillemotright ; B 58 70 618 446 ;
|
||||
C 188 ; WX 600 ; N ellipsis ; B 46 -15 575 111 ;
|
||||
C 189 ; WX 600 ; N perthousand ; B 59 -15 627 622 ;
|
||||
C 191 ; WX 600 ; N questiondown ; B 105 -157 466 430 ;
|
||||
C 193 ; WX 600 ; N grave ; B 294 497 484 672 ;
|
||||
C 194 ; WX 600 ; N acute ; B 348 497 612 672 ;
|
||||
C 195 ; WX 600 ; N circumflex ; B 229 477 581 654 ;
|
||||
C 196 ; WX 600 ; N tilde ; B 212 489 629 606 ;
|
||||
C 197 ; WX 600 ; N macron ; B 232 525 600 565 ;
|
||||
C 198 ; WX 600 ; N breve ; B 279 501 576 609 ;
|
||||
C 199 ; WX 600 ; N dotaccent ; B 373 537 478 640 ;
|
||||
C 200 ; WX 600 ; N dieresis ; B 272 537 579 640 ;
|
||||
C 202 ; WX 600 ; N ring ; B 332 463 500 627 ;
|
||||
C 203 ; WX 600 ; N cedilla ; B 197 -151 344 10 ;
|
||||
C 205 ; WX 600 ; N hungarumlaut ; B 239 497 683 672 ;
|
||||
C 206 ; WX 600 ; N ogonek ; B 189 -172 377 4 ;
|
||||
C 207 ; WX 600 ; N caron ; B 262 492 614 669 ;
|
||||
C 208 ; WX 600 ; N emdash ; B 49 231 661 285 ;
|
||||
C 225 ; WX 600 ; N AE ; B 3 0 655 562 ;
|
||||
C 227 ; WX 600 ; N ordfeminine ; B 209 249 512 580 ;
|
||||
C 232 ; WX 600 ; N Lslash ; B 47 0 607 562 ;
|
||||
C 233 ; WX 600 ; N Oslash ; B 94 -80 625 629 ;
|
||||
C 234 ; WX 600 ; N OE ; B 59 0 672 562 ;
|
||||
C 235 ; WX 600 ; N ordmasculine ; B 210 249 535 580 ;
|
||||
C 241 ; WX 600 ; N ae ; B 41 -15 626 441 ;
|
||||
C 245 ; WX 600 ; N dotlessi ; B 95 0 515 426 ;
|
||||
C 248 ; WX 600 ; N lslash ; B 95 0 587 629 ;
|
||||
C 249 ; WX 600 ; N oslash ; B 102 -80 588 506 ;
|
||||
C 250 ; WX 600 ; N oe ; B 54 -15 615 441 ;
|
||||
C 251 ; WX 600 ; N germandbls ; B 48 -15 617 629 ;
|
||||
C -1 ; WX 600 ; N Idieresis ; B 96 0 623 753 ;
|
||||
C -1 ; WX 600 ; N eacute ; B 106 -15 612 672 ;
|
||||
C -1 ; WX 600 ; N abreve ; B 76 -15 576 609 ;
|
||||
C -1 ; WX 600 ; N uhungarumlaut ; B 101 -15 723 672 ;
|
||||
C -1 ; WX 600 ; N ecaron ; B 106 -15 614 669 ;
|
||||
C -1 ; WX 600 ; N Ydieresis ; B 133 0 695 753 ;
|
||||
C -1 ; WX 600 ; N divide ; B 136 48 573 467 ;
|
||||
C -1 ; WX 600 ; N Yacute ; B 133 0 695 805 ;
|
||||
C -1 ; WX 600 ; N Acircumflex ; B 3 0 607 787 ;
|
||||
C -1 ; WX 600 ; N aacute ; B 76 -15 612 672 ;
|
||||
C -1 ; WX 600 ; N Ucircumflex ; B 125 -18 702 787 ;
|
||||
C -1 ; WX 600 ; N yacute ; B -4 -157 683 672 ;
|
||||
C -1 ; WX 600 ; N scommaaccent ; B 78 -250 584 441 ;
|
||||
C -1 ; WX 600 ; N ecircumflex ; B 106 -15 598 654 ;
|
||||
C -1 ; WX 600 ; N Uring ; B 125 -18 702 760 ;
|
||||
C -1 ; WX 600 ; N Udieresis ; B 125 -18 702 753 ;
|
||||
C -1 ; WX 600 ; N aogonek ; B 76 -172 569 441 ;
|
||||
C -1 ; WX 600 ; N Uacute ; B 125 -18 702 805 ;
|
||||
C -1 ; WX 600 ; N uogonek ; B 101 -172 572 426 ;
|
||||
C -1 ; WX 600 ; N Edieresis ; B 53 0 660 753 ;
|
||||
C -1 ; WX 600 ; N Dcroat ; B 43 0 645 562 ;
|
||||
C -1 ; WX 600 ; N commaaccent ; B 145 -250 323 -58 ;
|
||||
C -1 ; WX 600 ; N copyright ; B 53 -18 667 580 ;
|
||||
C -1 ; WX 600 ; N Emacron ; B 53 0 660 698 ;
|
||||
C -1 ; WX 600 ; N ccaron ; B 106 -15 614 669 ;
|
||||
C -1 ; WX 600 ; N aring ; B 76 -15 569 627 ;
|
||||
C -1 ; WX 600 ; N Ncommaaccent ; B 7 -250 712 562 ;
|
||||
C -1 ; WX 600 ; N lacute ; B 95 0 640 805 ;
|
||||
C -1 ; WX 600 ; N agrave ; B 76 -15 569 672 ;
|
||||
C -1 ; WX 600 ; N Tcommaaccent ; B 108 -250 665 562 ;
|
||||
C -1 ; WX 600 ; N Cacute ; B 93 -18 655 805 ;
|
||||
C -1 ; WX 600 ; N atilde ; B 76 -15 629 606 ;
|
||||
C -1 ; WX 600 ; N Edotaccent ; B 53 0 660 753 ;
|
||||
C -1 ; WX 600 ; N scaron ; B 78 -15 614 669 ;
|
||||
C -1 ; WX 600 ; N scedilla ; B 78 -151 584 441 ;
|
||||
C -1 ; WX 600 ; N iacute ; B 95 0 612 672 ;
|
||||
C -1 ; WX 600 ; N lozenge ; B 94 0 519 706 ;
|
||||
C -1 ; WX 600 ; N Rcaron ; B 38 0 642 802 ;
|
||||
C -1 ; WX 600 ; N Gcommaaccent ; B 83 -250 645 580 ;
|
||||
C -1 ; WX 600 ; N ucircumflex ; B 101 -15 572 654 ;
|
||||
C -1 ; WX 600 ; N acircumflex ; B 76 -15 581 654 ;
|
||||
C -1 ; WX 600 ; N Amacron ; B 3 0 607 698 ;
|
||||
C -1 ; WX 600 ; N rcaron ; B 60 0 636 669 ;
|
||||
C -1 ; WX 600 ; N ccedilla ; B 106 -151 614 441 ;
|
||||
C -1 ; WX 600 ; N Zdotaccent ; B 86 0 610 753 ;
|
||||
C -1 ; WX 600 ; N Thorn ; B 79 0 606 562 ;
|
||||
C -1 ; WX 600 ; N Omacron ; B 94 -18 628 698 ;
|
||||
C -1 ; WX 600 ; N Racute ; B 38 0 670 805 ;
|
||||
C -1 ; WX 600 ; N Sacute ; B 76 -20 650 805 ;
|
||||
C -1 ; WX 600 ; N dcaron ; B 85 -15 849 629 ;
|
||||
C -1 ; WX 600 ; N Umacron ; B 125 -18 702 698 ;
|
||||
C -1 ; WX 600 ; N uring ; B 101 -15 572 627 ;
|
||||
C -1 ; WX 600 ; N threesuperior ; B 213 240 501 622 ;
|
||||
C -1 ; WX 600 ; N Ograve ; B 94 -18 625 805 ;
|
||||
C -1 ; WX 600 ; N Agrave ; B 3 0 607 805 ;
|
||||
C -1 ; WX 600 ; N Abreve ; B 3 0 607 732 ;
|
||||
C -1 ; WX 600 ; N multiply ; B 103 43 607 470 ;
|
||||
C -1 ; WX 600 ; N uacute ; B 101 -15 602 672 ;
|
||||
C -1 ; WX 600 ; N Tcaron ; B 108 0 665 802 ;
|
||||
C -1 ; WX 600 ; N partialdiff ; B 45 -38 546 710 ;
|
||||
C -1 ; WX 600 ; N ydieresis ; B -4 -157 683 620 ;
|
||||
C -1 ; WX 600 ; N Nacute ; B 7 -13 712 805 ;
|
||||
C -1 ; WX 600 ; N icircumflex ; B 95 0 551 654 ;
|
||||
C -1 ; WX 600 ; N Ecircumflex ; B 53 0 660 787 ;
|
||||
C -1 ; WX 600 ; N adieresis ; B 76 -15 575 620 ;
|
||||
C -1 ; WX 600 ; N edieresis ; B 106 -15 598 620 ;
|
||||
C -1 ; WX 600 ; N cacute ; B 106 -15 612 672 ;
|
||||
C -1 ; WX 600 ; N nacute ; B 26 0 602 672 ;
|
||||
C -1 ; WX 600 ; N umacron ; B 101 -15 600 565 ;
|
||||
C -1 ; WX 600 ; N Ncaron ; B 7 -13 712 802 ;
|
||||
C -1 ; WX 600 ; N Iacute ; B 96 0 640 805 ;
|
||||
C -1 ; WX 600 ; N plusminus ; B 96 44 594 558 ;
|
||||
C -1 ; WX 600 ; N brokenbar ; B 238 -175 469 675 ;
|
||||
C -1 ; WX 600 ; N registered ; B 53 -18 667 580 ;
|
||||
C -1 ; WX 600 ; N Gbreve ; B 83 -18 645 732 ;
|
||||
C -1 ; WX 600 ; N Idotaccent ; B 96 0 623 753 ;
|
||||
C -1 ; WX 600 ; N summation ; B 15 -10 670 706 ;
|
||||
C -1 ; WX 600 ; N Egrave ; B 53 0 660 805 ;
|
||||
C -1 ; WX 600 ; N racute ; B 60 0 636 672 ;
|
||||
C -1 ; WX 600 ; N omacron ; B 102 -15 600 565 ;
|
||||
C -1 ; WX 600 ; N Zacute ; B 86 0 670 805 ;
|
||||
C -1 ; WX 600 ; N Zcaron ; B 86 0 642 802 ;
|
||||
C -1 ; WX 600 ; N greaterequal ; B 98 0 594 710 ;
|
||||
C -1 ; WX 600 ; N Eth ; B 43 0 645 562 ;
|
||||
C -1 ; WX 600 ; N Ccedilla ; B 93 -151 658 580 ;
|
||||
C -1 ; WX 600 ; N lcommaaccent ; B 95 -250 515 629 ;
|
||||
C -1 ; WX 600 ; N tcaron ; B 167 -15 587 717 ;
|
||||
C -1 ; WX 600 ; N eogonek ; B 106 -172 598 441 ;
|
||||
C -1 ; WX 600 ; N Uogonek ; B 124 -172 702 562 ;
|
||||
C -1 ; WX 600 ; N Aacute ; B 3 0 660 805 ;
|
||||
C -1 ; WX 600 ; N Adieresis ; B 3 0 607 753 ;
|
||||
C -1 ; WX 600 ; N egrave ; B 106 -15 598 672 ;
|
||||
C -1 ; WX 600 ; N zacute ; B 99 0 612 672 ;
|
||||
C -1 ; WX 600 ; N iogonek ; B 95 -172 515 657 ;
|
||||
C -1 ; WX 600 ; N Oacute ; B 94 -18 640 805 ;
|
||||
C -1 ; WX 600 ; N oacute ; B 102 -15 612 672 ;
|
||||
C -1 ; WX 600 ; N amacron ; B 76 -15 600 565 ;
|
||||
C -1 ; WX 600 ; N sacute ; B 78 -15 612 672 ;
|
||||
C -1 ; WX 600 ; N idieresis ; B 95 0 545 620 ;
|
||||
C -1 ; WX 600 ; N Ocircumflex ; B 94 -18 625 787 ;
|
||||
C -1 ; WX 600 ; N Ugrave ; B 125 -18 702 805 ;
|
||||
C -1 ; WX 600 ; N Delta ; B 6 0 598 688 ;
|
||||
C -1 ; WX 600 ; N thorn ; B -24 -157 605 629 ;
|
||||
C -1 ; WX 600 ; N twosuperior ; B 230 249 535 622 ;
|
||||
C -1 ; WX 600 ; N Odieresis ; B 94 -18 625 753 ;
|
||||
C -1 ; WX 600 ; N mu ; B 72 -157 572 426 ;
|
||||
C -1 ; WX 600 ; N igrave ; B 95 0 515 672 ;
|
||||
C -1 ; WX 600 ; N ohungarumlaut ; B 102 -15 723 672 ;
|
||||
C -1 ; WX 600 ; N Eogonek ; B 53 -172 660 562 ;
|
||||
C -1 ; WX 600 ; N dcroat ; B 85 -15 704 629 ;
|
||||
C -1 ; WX 600 ; N threequarters ; B 73 -56 659 666 ;
|
||||
C -1 ; WX 600 ; N Scedilla ; B 76 -151 650 580 ;
|
||||
C -1 ; WX 600 ; N lcaron ; B 95 0 667 629 ;
|
||||
C -1 ; WX 600 ; N Kcommaaccent ; B 38 -250 671 562 ;
|
||||
C -1 ; WX 600 ; N Lacute ; B 47 0 607 805 ;
|
||||
C -1 ; WX 600 ; N trademark ; B 75 263 742 562 ;
|
||||
C -1 ; WX 600 ; N edotaccent ; B 106 -15 598 620 ;
|
||||
C -1 ; WX 600 ; N Igrave ; B 96 0 623 805 ;
|
||||
C -1 ; WX 600 ; N Imacron ; B 96 0 628 698 ;
|
||||
C -1 ; WX 600 ; N Lcaron ; B 47 0 632 562 ;
|
||||
C -1 ; WX 600 ; N onehalf ; B 65 -57 669 665 ;
|
||||
C -1 ; WX 600 ; N lessequal ; B 98 0 645 710 ;
|
||||
C -1 ; WX 600 ; N ocircumflex ; B 102 -15 588 654 ;
|
||||
C -1 ; WX 600 ; N ntilde ; B 26 0 629 606 ;
|
||||
C -1 ; WX 600 ; N Uhungarumlaut ; B 125 -18 761 805 ;
|
||||
C -1 ; WX 600 ; N Eacute ; B 53 0 670 805 ;
|
||||
C -1 ; WX 600 ; N emacron ; B 106 -15 600 565 ;
|
||||
C -1 ; WX 600 ; N gbreve ; B 61 -157 657 609 ;
|
||||
C -1 ; WX 600 ; N onequarter ; B 65 -57 674 665 ;
|
||||
C -1 ; WX 600 ; N Scaron ; B 76 -20 672 802 ;
|
||||
C -1 ; WX 600 ; N Scommaaccent ; B 76 -250 650 580 ;
|
||||
C -1 ; WX 600 ; N Ohungarumlaut ; B 94 -18 751 805 ;
|
||||
C -1 ; WX 600 ; N degree ; B 214 269 576 622 ;
|
||||
C -1 ; WX 600 ; N ograve ; B 102 -15 588 672 ;
|
||||
C -1 ; WX 600 ; N Ccaron ; B 93 -18 672 802 ;
|
||||
C -1 ; WX 600 ; N ugrave ; B 101 -15 572 672 ;
|
||||
C -1 ; WX 600 ; N radical ; B 85 -15 765 792 ;
|
||||
C -1 ; WX 600 ; N Dcaron ; B 43 0 645 802 ;
|
||||
C -1 ; WX 600 ; N rcommaaccent ; B 60 -250 636 441 ;
|
||||
C -1 ; WX 600 ; N Ntilde ; B 7 -13 712 729 ;
|
||||
C -1 ; WX 600 ; N otilde ; B 102 -15 629 606 ;
|
||||
C -1 ; WX 600 ; N Rcommaaccent ; B 38 -250 598 562 ;
|
||||
C -1 ; WX 600 ; N Lcommaaccent ; B 47 -250 607 562 ;
|
||||
C -1 ; WX 600 ; N Atilde ; B 3 0 655 729 ;
|
||||
C -1 ; WX 600 ; N Aogonek ; B 3 -172 607 562 ;
|
||||
C -1 ; WX 600 ; N Aring ; B 3 0 607 750 ;
|
||||
C -1 ; WX 600 ; N Otilde ; B 94 -18 655 729 ;
|
||||
C -1 ; WX 600 ; N zdotaccent ; B 99 0 593 620 ;
|
||||
C -1 ; WX 600 ; N Ecaron ; B 53 0 660 802 ;
|
||||
C -1 ; WX 600 ; N Iogonek ; B 96 -172 623 562 ;
|
||||
C -1 ; WX 600 ; N kcommaaccent ; B 58 -250 633 629 ;
|
||||
C -1 ; WX 600 ; N minus ; B 129 232 580 283 ;
|
||||
C -1 ; WX 600 ; N Icircumflex ; B 96 0 623 787 ;
|
||||
C -1 ; WX 600 ; N ncaron ; B 26 0 614 669 ;
|
||||
C -1 ; WX 600 ; N tcommaaccent ; B 165 -250 561 561 ;
|
||||
C -1 ; WX 600 ; N logicalnot ; B 155 108 591 369 ;
|
||||
C -1 ; WX 600 ; N odieresis ; B 102 -15 588 620 ;
|
||||
C -1 ; WX 600 ; N udieresis ; B 101 -15 575 620 ;
|
||||
C -1 ; WX 600 ; N notequal ; B 43 -16 621 529 ;
|
||||
C -1 ; WX 600 ; N gcommaaccent ; B 61 -157 657 708 ;
|
||||
C -1 ; WX 600 ; N eth ; B 102 -15 639 629 ;
|
||||
C -1 ; WX 600 ; N zcaron ; B 99 0 624 669 ;
|
||||
C -1 ; WX 600 ; N ncommaaccent ; B 26 -250 585 441 ;
|
||||
C -1 ; WX 600 ; N onesuperior ; B 231 249 491 622 ;
|
||||
C -1 ; WX 600 ; N imacron ; B 95 0 543 565 ;
|
||||
C -1 ; WX 600 ; N Euro ; B 0 0 0 0 ;
|
||||
EndCharMetrics
|
||||
EndFontMetrics
|
||||
342
includes/classes/org/pdf-php/fonts/Courier.afm
Normal file
342
includes/classes/org/pdf-php/fonts/Courier.afm
Normal file
@@ -0,0 +1,342 @@
|
||||
StartFontMetrics 4.1
|
||||
Comment Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
|
||||
Comment Creation Date: Thu May 1 17:27:09 1997
|
||||
Comment UniqueID 43050
|
||||
Comment VMusage 39754 50779
|
||||
FontName Courier
|
||||
FullName Courier
|
||||
FamilyName Courier
|
||||
Weight Medium
|
||||
ItalicAngle 0
|
||||
IsFixedPitch true
|
||||
CharacterSet ExtendedRoman
|
||||
FontBBox -23 -250 715 805
|
||||
UnderlinePosition -100
|
||||
UnderlineThickness 50
|
||||
Version 003.000
|
||||
Notice Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
|
||||
EncodingScheme AdobeStandardEncoding
|
||||
CapHeight 562
|
||||
XHeight 426
|
||||
Ascender 629
|
||||
Descender -157
|
||||
StdHW 51
|
||||
StdVW 51
|
||||
StartCharMetrics 315
|
||||
C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
|
||||
C 33 ; WX 600 ; N exclam ; B 236 -15 364 572 ;
|
||||
C 34 ; WX 600 ; N quotedbl ; B 187 328 413 562 ;
|
||||
C 35 ; WX 600 ; N numbersign ; B 93 -32 507 639 ;
|
||||
C 36 ; WX 600 ; N dollar ; B 105 -126 496 662 ;
|
||||
C 37 ; WX 600 ; N percent ; B 81 -15 518 622 ;
|
||||
C 38 ; WX 600 ; N ampersand ; B 63 -15 538 543 ;
|
||||
C 39 ; WX 600 ; N quoteright ; B 213 328 376 562 ;
|
||||
C 40 ; WX 600 ; N parenleft ; B 269 -108 440 622 ;
|
||||
C 41 ; WX 600 ; N parenright ; B 160 -108 331 622 ;
|
||||
C 42 ; WX 600 ; N asterisk ; B 116 257 484 607 ;
|
||||
C 43 ; WX 600 ; N plus ; B 80 44 520 470 ;
|
||||
C 44 ; WX 600 ; N comma ; B 181 -112 344 122 ;
|
||||
C 45 ; WX 600 ; N hyphen ; B 103 231 497 285 ;
|
||||
C 46 ; WX 600 ; N period ; B 229 -15 371 109 ;
|
||||
C 47 ; WX 600 ; N slash ; B 125 -80 475 629 ;
|
||||
C 48 ; WX 600 ; N zero ; B 106 -15 494 622 ;
|
||||
C 49 ; WX 600 ; N one ; B 96 0 505 622 ;
|
||||
C 50 ; WX 600 ; N two ; B 70 0 471 622 ;
|
||||
C 51 ; WX 600 ; N three ; B 75 -15 466 622 ;
|
||||
C 52 ; WX 600 ; N four ; B 78 0 500 622 ;
|
||||
C 53 ; WX 600 ; N five ; B 92 -15 497 607 ;
|
||||
C 54 ; WX 600 ; N six ; B 111 -15 497 622 ;
|
||||
C 55 ; WX 600 ; N seven ; B 82 0 483 607 ;
|
||||
C 56 ; WX 600 ; N eight ; B 102 -15 498 622 ;
|
||||
C 57 ; WX 600 ; N nine ; B 96 -15 489 622 ;
|
||||
C 58 ; WX 600 ; N colon ; B 229 -15 371 385 ;
|
||||
C 59 ; WX 600 ; N semicolon ; B 181 -112 371 385 ;
|
||||
C 60 ; WX 600 ; N less ; B 41 42 519 472 ;
|
||||
C 61 ; WX 600 ; N equal ; B 80 138 520 376 ;
|
||||
C 62 ; WX 600 ; N greater ; B 66 42 544 472 ;
|
||||
C 63 ; WX 600 ; N question ; B 129 -15 492 572 ;
|
||||
C 64 ; WX 600 ; N at ; B 77 -15 533 622 ;
|
||||
C 65 ; WX 600 ; N A ; B 3 0 597 562 ;
|
||||
C 66 ; WX 600 ; N B ; B 43 0 559 562 ;
|
||||
C 67 ; WX 600 ; N C ; B 41 -18 540 580 ;
|
||||
C 68 ; WX 600 ; N D ; B 43 0 574 562 ;
|
||||
C 69 ; WX 600 ; N E ; B 53 0 550 562 ;
|
||||
C 70 ; WX 600 ; N F ; B 53 0 545 562 ;
|
||||
C 71 ; WX 600 ; N G ; B 31 -18 575 580 ;
|
||||
C 72 ; WX 600 ; N H ; B 32 0 568 562 ;
|
||||
C 73 ; WX 600 ; N I ; B 96 0 504 562 ;
|
||||
C 74 ; WX 600 ; N J ; B 34 -18 566 562 ;
|
||||
C 75 ; WX 600 ; N K ; B 38 0 582 562 ;
|
||||
C 76 ; WX 600 ; N L ; B 47 0 554 562 ;
|
||||
C 77 ; WX 600 ; N M ; B 4 0 596 562 ;
|
||||
C 78 ; WX 600 ; N N ; B 7 -13 593 562 ;
|
||||
C 79 ; WX 600 ; N O ; B 43 -18 557 580 ;
|
||||
C 80 ; WX 600 ; N P ; B 79 0 558 562 ;
|
||||
C 81 ; WX 600 ; N Q ; B 43 -138 557 580 ;
|
||||
C 82 ; WX 600 ; N R ; B 38 0 588 562 ;
|
||||
C 83 ; WX 600 ; N S ; B 72 -20 529 580 ;
|
||||
C 84 ; WX 600 ; N T ; B 38 0 563 562 ;
|
||||
C 85 ; WX 600 ; N U ; B 17 -18 583 562 ;
|
||||
C 86 ; WX 600 ; N V ; B -4 -13 604 562 ;
|
||||
C 87 ; WX 600 ; N W ; B -3 -13 603 562 ;
|
||||
C 88 ; WX 600 ; N X ; B 23 0 577 562 ;
|
||||
C 89 ; WX 600 ; N Y ; B 24 0 576 562 ;
|
||||
C 90 ; WX 600 ; N Z ; B 86 0 514 562 ;
|
||||
C 91 ; WX 600 ; N bracketleft ; B 269 -108 442 622 ;
|
||||
C 92 ; WX 600 ; N backslash ; B 118 -80 482 629 ;
|
||||
C 93 ; WX 600 ; N bracketright ; B 158 -108 331 622 ;
|
||||
C 94 ; WX 600 ; N asciicircum ; B 94 354 506 622 ;
|
||||
C 95 ; WX 600 ; N underscore ; B 0 -125 600 -75 ;
|
||||
C 96 ; WX 600 ; N quoteleft ; B 224 328 387 562 ;
|
||||
C 97 ; WX 600 ; N a ; B 53 -15 559 441 ;
|
||||
C 98 ; WX 600 ; N b ; B 14 -15 575 629 ;
|
||||
C 99 ; WX 600 ; N c ; B 66 -15 529 441 ;
|
||||
C 100 ; WX 600 ; N d ; B 45 -15 591 629 ;
|
||||
C 101 ; WX 600 ; N e ; B 66 -15 548 441 ;
|
||||
C 102 ; WX 600 ; N f ; B 114 0 531 629 ; L i fi ; L l fl ;
|
||||
C 103 ; WX 600 ; N g ; B 45 -157 566 441 ;
|
||||
C 104 ; WX 600 ; N h ; B 18 0 582 629 ;
|
||||
C 105 ; WX 600 ; N i ; B 95 0 505 657 ;
|
||||
C 106 ; WX 600 ; N j ; B 82 -157 410 657 ;
|
||||
C 107 ; WX 600 ; N k ; B 43 0 580 629 ;
|
||||
C 108 ; WX 600 ; N l ; B 95 0 505 629 ;
|
||||
C 109 ; WX 600 ; N m ; B -5 0 605 441 ;
|
||||
C 110 ; WX 600 ; N n ; B 26 0 575 441 ;
|
||||
C 111 ; WX 600 ; N o ; B 62 -15 538 441 ;
|
||||
C 112 ; WX 600 ; N p ; B 9 -157 555 441 ;
|
||||
C 113 ; WX 600 ; N q ; B 45 -157 591 441 ;
|
||||
C 114 ; WX 600 ; N r ; B 60 0 559 441 ;
|
||||
C 115 ; WX 600 ; N s ; B 80 -15 513 441 ;
|
||||
C 116 ; WX 600 ; N t ; B 87 -15 530 561 ;
|
||||
C 117 ; WX 600 ; N u ; B 21 -15 562 426 ;
|
||||
C 118 ; WX 600 ; N v ; B 10 -10 590 426 ;
|
||||
C 119 ; WX 600 ; N w ; B -4 -10 604 426 ;
|
||||
C 120 ; WX 600 ; N x ; B 20 0 580 426 ;
|
||||
C 121 ; WX 600 ; N y ; B 7 -157 592 426 ;
|
||||
C 122 ; WX 600 ; N z ; B 99 0 502 426 ;
|
||||
C 123 ; WX 600 ; N braceleft ; B 182 -108 437 622 ;
|
||||
C 124 ; WX 600 ; N bar ; B 275 -250 326 750 ;
|
||||
C 125 ; WX 600 ; N braceright ; B 163 -108 418 622 ;
|
||||
C 126 ; WX 600 ; N asciitilde ; B 63 197 540 320 ;
|
||||
C 161 ; WX 600 ; N exclamdown ; B 236 -157 364 430 ;
|
||||
C 162 ; WX 600 ; N cent ; B 96 -49 500 614 ;
|
||||
C 163 ; WX 600 ; N sterling ; B 84 -21 521 611 ;
|
||||
C 164 ; WX 600 ; N fraction ; B 92 -57 509 665 ;
|
||||
C 165 ; WX 600 ; N yen ; B 26 0 574 562 ;
|
||||
C 166 ; WX 600 ; N florin ; B 4 -143 539 622 ;
|
||||
C 167 ; WX 600 ; N section ; B 113 -78 488 580 ;
|
||||
C 168 ; WX 600 ; N currency ; B 73 58 527 506 ;
|
||||
C 169 ; WX 600 ; N quotesingle ; B 259 328 341 562 ;
|
||||
C 170 ; WX 600 ; N quotedblleft ; B 143 328 471 562 ;
|
||||
C 171 ; WX 600 ; N guillemotleft ; B 37 70 563 446 ;
|
||||
C 172 ; WX 600 ; N guilsinglleft ; B 149 70 451 446 ;
|
||||
C 173 ; WX 600 ; N guilsinglright ; B 149 70 451 446 ;
|
||||
C 174 ; WX 600 ; N fi ; B 3 0 597 629 ;
|
||||
C 175 ; WX 600 ; N fl ; B 3 0 597 629 ;
|
||||
C 177 ; WX 600 ; N endash ; B 75 231 525 285 ;
|
||||
C 178 ; WX 600 ; N dagger ; B 141 -78 459 580 ;
|
||||
C 179 ; WX 600 ; N daggerdbl ; B 141 -78 459 580 ;
|
||||
C 180 ; WX 600 ; N periodcentered ; B 222 189 378 327 ;
|
||||
C 182 ; WX 600 ; N paragraph ; B 50 -78 511 562 ;
|
||||
C 183 ; WX 600 ; N bullet ; B 172 130 428 383 ;
|
||||
C 184 ; WX 600 ; N quotesinglbase ; B 213 -134 376 100 ;
|
||||
C 185 ; WX 600 ; N quotedblbase ; B 143 -134 457 100 ;
|
||||
C 186 ; WX 600 ; N quotedblright ; B 143 328 457 562 ;
|
||||
C 187 ; WX 600 ; N guillemotright ; B 37 70 563 446 ;
|
||||
C 188 ; WX 600 ; N ellipsis ; B 37 -15 563 111 ;
|
||||
C 189 ; WX 600 ; N perthousand ; B 3 -15 600 622 ;
|
||||
C 191 ; WX 600 ; N questiondown ; B 108 -157 471 430 ;
|
||||
C 193 ; WX 600 ; N grave ; B 151 497 378 672 ;
|
||||
C 194 ; WX 600 ; N acute ; B 242 497 469 672 ;
|
||||
C 195 ; WX 600 ; N circumflex ; B 124 477 476 654 ;
|
||||
C 196 ; WX 600 ; N tilde ; B 105 489 503 606 ;
|
||||
C 197 ; WX 600 ; N macron ; B 120 525 480 565 ;
|
||||
C 198 ; WX 600 ; N breve ; B 153 501 447 609 ;
|
||||
C 199 ; WX 600 ; N dotaccent ; B 249 537 352 640 ;
|
||||
C 200 ; WX 600 ; N dieresis ; B 148 537 453 640 ;
|
||||
C 202 ; WX 600 ; N ring ; B 218 463 382 627 ;
|
||||
C 203 ; WX 600 ; N cedilla ; B 224 -151 362 10 ;
|
||||
C 205 ; WX 600 ; N hungarumlaut ; B 133 497 540 672 ;
|
||||
C 206 ; WX 600 ; N ogonek ; B 211 -172 407 4 ;
|
||||
C 207 ; WX 600 ; N caron ; B 124 492 476 669 ;
|
||||
C 208 ; WX 600 ; N emdash ; B 0 231 600 285 ;
|
||||
C 225 ; WX 600 ; N AE ; B 3 0 550 562 ;
|
||||
C 227 ; WX 600 ; N ordfeminine ; B 156 249 442 580 ;
|
||||
C 232 ; WX 600 ; N Lslash ; B 47 0 554 562 ;
|
||||
C 233 ; WX 600 ; N Oslash ; B 43 -80 557 629 ;
|
||||
C 234 ; WX 600 ; N OE ; B 7 0 567 562 ;
|
||||
C 235 ; WX 600 ; N ordmasculine ; B 157 249 443 580 ;
|
||||
C 241 ; WX 600 ; N ae ; B 19 -15 570 441 ;
|
||||
C 245 ; WX 600 ; N dotlessi ; B 95 0 505 426 ;
|
||||
C 248 ; WX 600 ; N lslash ; B 95 0 505 629 ;
|
||||
C 249 ; WX 600 ; N oslash ; B 62 -80 538 506 ;
|
||||
C 250 ; WX 600 ; N oe ; B 19 -15 559 441 ;
|
||||
C 251 ; WX 600 ; N germandbls ; B 48 -15 588 629 ;
|
||||
C -1 ; WX 600 ; N Idieresis ; B 96 0 504 753 ;
|
||||
C -1 ; WX 600 ; N eacute ; B 66 -15 548 672 ;
|
||||
C -1 ; WX 600 ; N abreve ; B 53 -15 559 609 ;
|
||||
C -1 ; WX 600 ; N uhungarumlaut ; B 21 -15 580 672 ;
|
||||
C -1 ; WX 600 ; N ecaron ; B 66 -15 548 669 ;
|
||||
C -1 ; WX 600 ; N Ydieresis ; B 24 0 576 753 ;
|
||||
C -1 ; WX 600 ; N divide ; B 87 48 513 467 ;
|
||||
C -1 ; WX 600 ; N Yacute ; B 24 0 576 805 ;
|
||||
C -1 ; WX 600 ; N Acircumflex ; B 3 0 597 787 ;
|
||||
C -1 ; WX 600 ; N aacute ; B 53 -15 559 672 ;
|
||||
C -1 ; WX 600 ; N Ucircumflex ; B 17 -18 583 787 ;
|
||||
C -1 ; WX 600 ; N yacute ; B 7 -157 592 672 ;
|
||||
C -1 ; WX 600 ; N scommaaccent ; B 80 -250 513 441 ;
|
||||
C -1 ; WX 600 ; N ecircumflex ; B 66 -15 548 654 ;
|
||||
C -1 ; WX 600 ; N Uring ; B 17 -18 583 760 ;
|
||||
C -1 ; WX 600 ; N Udieresis ; B 17 -18 583 753 ;
|
||||
C -1 ; WX 600 ; N aogonek ; B 53 -172 587 441 ;
|
||||
C -1 ; WX 600 ; N Uacute ; B 17 -18 583 805 ;
|
||||
C -1 ; WX 600 ; N uogonek ; B 21 -172 590 426 ;
|
||||
C -1 ; WX 600 ; N Edieresis ; B 53 0 550 753 ;
|
||||
C -1 ; WX 600 ; N Dcroat ; B 30 0 574 562 ;
|
||||
C -1 ; WX 600 ; N commaaccent ; B 198 -250 335 -58 ;
|
||||
C -1 ; WX 600 ; N copyright ; B 0 -18 600 580 ;
|
||||
C -1 ; WX 600 ; N Emacron ; B 53 0 550 698 ;
|
||||
C -1 ; WX 600 ; N ccaron ; B 66 -15 529 669 ;
|
||||
C -1 ; WX 600 ; N aring ; B 53 -15 559 627 ;
|
||||
C -1 ; WX 600 ; N Ncommaaccent ; B 7 -250 593 562 ;
|
||||
C -1 ; WX 600 ; N lacute ; B 95 0 505 805 ;
|
||||
C -1 ; WX 600 ; N agrave ; B 53 -15 559 672 ;
|
||||
C -1 ; WX 600 ; N Tcommaaccent ; B 38 -250 563 562 ;
|
||||
C -1 ; WX 600 ; N Cacute ; B 41 -18 540 805 ;
|
||||
C -1 ; WX 600 ; N atilde ; B 53 -15 559 606 ;
|
||||
C -1 ; WX 600 ; N Edotaccent ; B 53 0 550 753 ;
|
||||
C -1 ; WX 600 ; N scaron ; B 80 -15 513 669 ;
|
||||
C -1 ; WX 600 ; N scedilla ; B 80 -151 513 441 ;
|
||||
C -1 ; WX 600 ; N iacute ; B 95 0 505 672 ;
|
||||
C -1 ; WX 600 ; N lozenge ; B 18 0 443 706 ;
|
||||
C -1 ; WX 600 ; N Rcaron ; B 38 0 588 802 ;
|
||||
C -1 ; WX 600 ; N Gcommaaccent ; B 31 -250 575 580 ;
|
||||
C -1 ; WX 600 ; N ucircumflex ; B 21 -15 562 654 ;
|
||||
C -1 ; WX 600 ; N acircumflex ; B 53 -15 559 654 ;
|
||||
C -1 ; WX 600 ; N Amacron ; B 3 0 597 698 ;
|
||||
C -1 ; WX 600 ; N rcaron ; B 60 0 559 669 ;
|
||||
C -1 ; WX 600 ; N ccedilla ; B 66 -151 529 441 ;
|
||||
C -1 ; WX 600 ; N Zdotaccent ; B 86 0 514 753 ;
|
||||
C -1 ; WX 600 ; N Thorn ; B 79 0 538 562 ;
|
||||
C -1 ; WX 600 ; N Omacron ; B 43 -18 557 698 ;
|
||||
C -1 ; WX 600 ; N Racute ; B 38 0 588 805 ;
|
||||
C -1 ; WX 600 ; N Sacute ; B 72 -20 529 805 ;
|
||||
C -1 ; WX 600 ; N dcaron ; B 45 -15 715 629 ;
|
||||
C -1 ; WX 600 ; N Umacron ; B 17 -18 583 698 ;
|
||||
C -1 ; WX 600 ; N uring ; B 21 -15 562 627 ;
|
||||
C -1 ; WX 600 ; N threesuperior ; B 155 240 406 622 ;
|
||||
C -1 ; WX 600 ; N Ograve ; B 43 -18 557 805 ;
|
||||
C -1 ; WX 600 ; N Agrave ; B 3 0 597 805 ;
|
||||
C -1 ; WX 600 ; N Abreve ; B 3 0 597 732 ;
|
||||
C -1 ; WX 600 ; N multiply ; B 87 43 515 470 ;
|
||||
C -1 ; WX 600 ; N uacute ; B 21 -15 562 672 ;
|
||||
C -1 ; WX 600 ; N Tcaron ; B 38 0 563 802 ;
|
||||
C -1 ; WX 600 ; N partialdiff ; B 17 -38 459 710 ;
|
||||
C -1 ; WX 600 ; N ydieresis ; B 7 -157 592 620 ;
|
||||
C -1 ; WX 600 ; N Nacute ; B 7 -13 593 805 ;
|
||||
C -1 ; WX 600 ; N icircumflex ; B 94 0 505 654 ;
|
||||
C -1 ; WX 600 ; N Ecircumflex ; B 53 0 550 787 ;
|
||||
C -1 ; WX 600 ; N adieresis ; B 53 -15 559 620 ;
|
||||
C -1 ; WX 600 ; N edieresis ; B 66 -15 548 620 ;
|
||||
C -1 ; WX 600 ; N cacute ; B 66 -15 529 672 ;
|
||||
C -1 ; WX 600 ; N nacute ; B 26 0 575 672 ;
|
||||
C -1 ; WX 600 ; N umacron ; B 21 -15 562 565 ;
|
||||
C -1 ; WX 600 ; N Ncaron ; B 7 -13 593 802 ;
|
||||
C -1 ; WX 600 ; N Iacute ; B 96 0 504 805 ;
|
||||
C -1 ; WX 600 ; N plusminus ; B 87 44 513 558 ;
|
||||
C -1 ; WX 600 ; N brokenbar ; B 275 -175 326 675 ;
|
||||
C -1 ; WX 600 ; N registered ; B 0 -18 600 580 ;
|
||||
C -1 ; WX 600 ; N Gbreve ; B 31 -18 575 732 ;
|
||||
C -1 ; WX 600 ; N Idotaccent ; B 96 0 504 753 ;
|
||||
C -1 ; WX 600 ; N summation ; B 15 -10 585 706 ;
|
||||
C -1 ; WX 600 ; N Egrave ; B 53 0 550 805 ;
|
||||
C -1 ; WX 600 ; N racute ; B 60 0 559 672 ;
|
||||
C -1 ; WX 600 ; N omacron ; B 62 -15 538 565 ;
|
||||
C -1 ; WX 600 ; N Zacute ; B 86 0 514 805 ;
|
||||
C -1 ; WX 600 ; N Zcaron ; B 86 0 514 802 ;
|
||||
C -1 ; WX 600 ; N greaterequal ; B 98 0 502 710 ;
|
||||
C -1 ; WX 600 ; N Eth ; B 30 0 574 562 ;
|
||||
C -1 ; WX 600 ; N Ccedilla ; B 41 -151 540 580 ;
|
||||
C -1 ; WX 600 ; N lcommaaccent ; B 95 -250 505 629 ;
|
||||
C -1 ; WX 600 ; N tcaron ; B 87 -15 530 717 ;
|
||||
C -1 ; WX 600 ; N eogonek ; B 66 -172 548 441 ;
|
||||
C -1 ; WX 600 ; N Uogonek ; B 17 -172 583 562 ;
|
||||
C -1 ; WX 600 ; N Aacute ; B 3 0 597 805 ;
|
||||
C -1 ; WX 600 ; N Adieresis ; B 3 0 597 753 ;
|
||||
C -1 ; WX 600 ; N egrave ; B 66 -15 548 672 ;
|
||||
C -1 ; WX 600 ; N zacute ; B 99 0 502 672 ;
|
||||
C -1 ; WX 600 ; N iogonek ; B 95 -172 505 657 ;
|
||||
C -1 ; WX 600 ; N Oacute ; B 43 -18 557 805 ;
|
||||
C -1 ; WX 600 ; N oacute ; B 62 -15 538 672 ;
|
||||
C -1 ; WX 600 ; N amacron ; B 53 -15 559 565 ;
|
||||
C -1 ; WX 600 ; N sacute ; B 80 -15 513 672 ;
|
||||
C -1 ; WX 600 ; N idieresis ; B 95 0 505 620 ;
|
||||
C -1 ; WX 600 ; N Ocircumflex ; B 43 -18 557 787 ;
|
||||
C -1 ; WX 600 ; N Ugrave ; B 17 -18 583 805 ;
|
||||
C -1 ; WX 600 ; N Delta ; B 6 0 598 688 ;
|
||||
C -1 ; WX 600 ; N thorn ; B -6 -157 555 629 ;
|
||||
C -1 ; WX 600 ; N twosuperior ; B 177 249 424 622 ;
|
||||
C -1 ; WX 600 ; N Odieresis ; B 43 -18 557 753 ;
|
||||
C -1 ; WX 600 ; N mu ; B 21 -157 562 426 ;
|
||||
C -1 ; WX 600 ; N igrave ; B 95 0 505 672 ;
|
||||
C -1 ; WX 600 ; N ohungarumlaut ; B 62 -15 580 672 ;
|
||||
C -1 ; WX 600 ; N Eogonek ; B 53 -172 561 562 ;
|
||||
C -1 ; WX 600 ; N dcroat ; B 45 -15 591 629 ;
|
||||
C -1 ; WX 600 ; N threequarters ; B 8 -56 593 666 ;
|
||||
C -1 ; WX 600 ; N Scedilla ; B 72 -151 529 580 ;
|
||||
C -1 ; WX 600 ; N lcaron ; B 95 0 533 629 ;
|
||||
C -1 ; WX 600 ; N Kcommaaccent ; B 38 -250 582 562 ;
|
||||
C -1 ; WX 600 ; N Lacute ; B 47 0 554 805 ;
|
||||
C -1 ; WX 600 ; N trademark ; B -23 263 623 562 ;
|
||||
C -1 ; WX 600 ; N edotaccent ; B 66 -15 548 620 ;
|
||||
C -1 ; WX 600 ; N Igrave ; B 96 0 504 805 ;
|
||||
C -1 ; WX 600 ; N Imacron ; B 96 0 504 698 ;
|
||||
C -1 ; WX 600 ; N Lcaron ; B 47 0 554 562 ;
|
||||
C -1 ; WX 600 ; N onehalf ; B 0 -57 611 665 ;
|
||||
C -1 ; WX 600 ; N lessequal ; B 98 0 502 710 ;
|
||||
C -1 ; WX 600 ; N ocircumflex ; B 62 -15 538 654 ;
|
||||
C -1 ; WX 600 ; N ntilde ; B 26 0 575 606 ;
|
||||
C -1 ; WX 600 ; N Uhungarumlaut ; B 17 -18 590 805 ;
|
||||
C -1 ; WX 600 ; N Eacute ; B 53 0 550 805 ;
|
||||
C -1 ; WX 600 ; N emacron ; B 66 -15 548 565 ;
|
||||
C -1 ; WX 600 ; N gbreve ; B 45 -157 566 609 ;
|
||||
C -1 ; WX 600 ; N onequarter ; B 0 -57 600 665 ;
|
||||
C -1 ; WX 600 ; N Scaron ; B 72 -20 529 802 ;
|
||||
C -1 ; WX 600 ; N Scommaaccent ; B 72 -250 529 580 ;
|
||||
C -1 ; WX 600 ; N Ohungarumlaut ; B 43 -18 580 805 ;
|
||||
C -1 ; WX 600 ; N degree ; B 123 269 477 622 ;
|
||||
C -1 ; WX 600 ; N ograve ; B 62 -15 538 672 ;
|
||||
C -1 ; WX 600 ; N Ccaron ; B 41 -18 540 802 ;
|
||||
C -1 ; WX 600 ; N ugrave ; B 21 -15 562 672 ;
|
||||
C -1 ; WX 600 ; N radical ; B 3 -15 597 792 ;
|
||||
C -1 ; WX 600 ; N Dcaron ; B 43 0 574 802 ;
|
||||
C -1 ; WX 600 ; N rcommaaccent ; B 60 -250 559 441 ;
|
||||
C -1 ; WX 600 ; N Ntilde ; B 7 -13 593 729 ;
|
||||
C -1 ; WX 600 ; N otilde ; B 62 -15 538 606 ;
|
||||
C -1 ; WX 600 ; N Rcommaaccent ; B 38 -250 588 562 ;
|
||||
C -1 ; WX 600 ; N Lcommaaccent ; B 47 -250 554 562 ;
|
||||
C -1 ; WX 600 ; N Atilde ; B 3 0 597 729 ;
|
||||
C -1 ; WX 600 ; N Aogonek ; B 3 -172 608 562 ;
|
||||
C -1 ; WX 600 ; N Aring ; B 3 0 597 750 ;
|
||||
C -1 ; WX 600 ; N Otilde ; B 43 -18 557 729 ;
|
||||
C -1 ; WX 600 ; N zdotaccent ; B 99 0 502 620 ;
|
||||
C -1 ; WX 600 ; N Ecaron ; B 53 0 550 802 ;
|
||||
C -1 ; WX 600 ; N Iogonek ; B 96 -172 504 562 ;
|
||||
C -1 ; WX 600 ; N kcommaaccent ; B 43 -250 580 629 ;
|
||||
C -1 ; WX 600 ; N minus ; B 80 232 520 283 ;
|
||||
C -1 ; WX 600 ; N Icircumflex ; B 96 0 504 787 ;
|
||||
C -1 ; WX 600 ; N ncaron ; B 26 0 575 669 ;
|
||||
C -1 ; WX 600 ; N tcommaaccent ; B 87 -250 530 561 ;
|
||||
C -1 ; WX 600 ; N logicalnot ; B 87 108 513 369 ;
|
||||
C -1 ; WX 600 ; N odieresis ; B 62 -15 538 620 ;
|
||||
C -1 ; WX 600 ; N udieresis ; B 21 -15 562 620 ;
|
||||
C -1 ; WX 600 ; N notequal ; B 15 -16 540 529 ;
|
||||
C -1 ; WX 600 ; N gcommaaccent ; B 45 -157 566 708 ;
|
||||
C -1 ; WX 600 ; N eth ; B 62 -15 538 629 ;
|
||||
C -1 ; WX 600 ; N zcaron ; B 99 0 502 669 ;
|
||||
C -1 ; WX 600 ; N ncommaaccent ; B 26 -250 575 441 ;
|
||||
C -1 ; WX 600 ; N onesuperior ; B 172 249 428 622 ;
|
||||
C -1 ; WX 600 ; N imacron ; B 95 0 505 565 ;
|
||||
C -1 ; WX 600 ; N Euro ; B 0 0 0 0 ;
|
||||
EndCharMetrics
|
||||
EndFontMetrics
|
||||
2827
includes/classes/org/pdf-php/fonts/Helvetica-Bold.afm
Normal file
2827
includes/classes/org/pdf-php/fonts/Helvetica-Bold.afm
Normal file
File diff suppressed because it is too large
Load Diff
2827
includes/classes/org/pdf-php/fonts/Helvetica-BoldOblique.afm
Normal file
2827
includes/classes/org/pdf-php/fonts/Helvetica-BoldOblique.afm
Normal file
File diff suppressed because it is too large
Load Diff
3051
includes/classes/org/pdf-php/fonts/Helvetica-Oblique.afm
Normal file
3051
includes/classes/org/pdf-php/fonts/Helvetica-Oblique.afm
Normal file
File diff suppressed because it is too large
Load Diff
3051
includes/classes/org/pdf-php/fonts/Helvetica.afm
Normal file
3051
includes/classes/org/pdf-php/fonts/Helvetica.afm
Normal file
File diff suppressed because it is too large
Load Diff
213
includes/classes/org/pdf-php/fonts/Symbol.afm
Normal file
213
includes/classes/org/pdf-php/fonts/Symbol.afm
Normal file
@@ -0,0 +1,213 @@
|
||||
StartFontMetrics 4.1
|
||||
Comment Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All rights reserved.
|
||||
Comment Creation Date: Thu May 1 15:12:25 1997
|
||||
Comment UniqueID 43064
|
||||
Comment VMusage 30820 39997
|
||||
FontName Symbol
|
||||
FullName Symbol
|
||||
FamilyName Symbol
|
||||
Weight Medium
|
||||
ItalicAngle 0
|
||||
IsFixedPitch false
|
||||
CharacterSet Special
|
||||
FontBBox -180 -293 1090 1010
|
||||
UnderlinePosition -100
|
||||
UnderlineThickness 50
|
||||
Version 001.008
|
||||
Notice Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All rights reserved.
|
||||
EncodingScheme FontSpecific
|
||||
StdHW 92
|
||||
StdVW 85
|
||||
StartCharMetrics 190
|
||||
C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
|
||||
C 33 ; WX 333 ; N exclam ; B 128 -17 240 672 ;
|
||||
C 34 ; WX 713 ; N universal ; B 31 0 681 705 ;
|
||||
C 35 ; WX 500 ; N numbersign ; B 20 -16 481 673 ;
|
||||
C 36 ; WX 549 ; N existential ; B 25 0 478 707 ;
|
||||
C 37 ; WX 833 ; N percent ; B 63 -36 771 655 ;
|
||||
C 38 ; WX 778 ; N ampersand ; B 41 -18 750 661 ;
|
||||
C 39 ; WX 439 ; N suchthat ; B 48 -17 414 500 ;
|
||||
C 40 ; WX 333 ; N parenleft ; B 53 -191 300 673 ;
|
||||
C 41 ; WX 333 ; N parenright ; B 30 -191 277 673 ;
|
||||
C 42 ; WX 500 ; N asteriskmath ; B 65 134 427 551 ;
|
||||
C 43 ; WX 549 ; N plus ; B 10 0 539 533 ;
|
||||
C 44 ; WX 250 ; N comma ; B 56 -152 194 104 ;
|
||||
C 45 ; WX 549 ; N minus ; B 11 233 535 288 ;
|
||||
C 46 ; WX 250 ; N period ; B 69 -17 181 95 ;
|
||||
C 47 ; WX 278 ; N slash ; B 0 -18 254 646 ;
|
||||
C 48 ; WX 500 ; N zero ; B 24 -14 476 685 ;
|
||||
C 49 ; WX 500 ; N one ; B 117 0 390 673 ;
|
||||
C 50 ; WX 500 ; N two ; B 25 0 475 685 ;
|
||||
C 51 ; WX 500 ; N three ; B 43 -14 435 685 ;
|
||||
C 52 ; WX 500 ; N four ; B 15 0 469 685 ;
|
||||
C 53 ; WX 500 ; N five ; B 32 -14 445 690 ;
|
||||
C 54 ; WX 500 ; N six ; B 34 -14 468 685 ;
|
||||
C 55 ; WX 500 ; N seven ; B 24 -16 448 673 ;
|
||||
C 56 ; WX 500 ; N eight ; B 56 -14 445 685 ;
|
||||
C 57 ; WX 500 ; N nine ; B 30 -18 459 685 ;
|
||||
C 58 ; WX 278 ; N colon ; B 81 -17 193 460 ;
|
||||
C 59 ; WX 278 ; N semicolon ; B 83 -152 221 460 ;
|
||||
C 60 ; WX 549 ; N less ; B 26 0 523 522 ;
|
||||
C 61 ; WX 549 ; N equal ; B 11 141 537 390 ;
|
||||
C 62 ; WX 549 ; N greater ; B 26 0 523 522 ;
|
||||
C 63 ; WX 444 ; N question ; B 70 -17 412 686 ;
|
||||
C 64 ; WX 549 ; N congruent ; B 11 0 537 475 ;
|
||||
C 65 ; WX 722 ; N Alpha ; B 4 0 684 673 ;
|
||||
C 66 ; WX 667 ; N Beta ; B 29 0 592 673 ;
|
||||
C 67 ; WX 722 ; N Chi ; B -9 0 704 673 ;
|
||||
C 68 ; WX 612 ; N Delta ; B 6 0 608 688 ;
|
||||
C 69 ; WX 611 ; N Epsilon ; B 32 0 617 673 ;
|
||||
C 70 ; WX 763 ; N Phi ; B 26 0 741 673 ;
|
||||
C 71 ; WX 603 ; N Gamma ; B 24 0 609 673 ;
|
||||
C 72 ; WX 722 ; N Eta ; B 39 0 729 673 ;
|
||||
C 73 ; WX 333 ; N Iota ; B 32 0 316 673 ;
|
||||
C 74 ; WX 631 ; N theta1 ; B 18 -18 623 689 ;
|
||||
C 75 ; WX 722 ; N Kappa ; B 35 0 722 673 ;
|
||||
C 76 ; WX 686 ; N Lambda ; B 6 0 680 688 ;
|
||||
C 77 ; WX 889 ; N Mu ; B 28 0 887 673 ;
|
||||
C 78 ; WX 722 ; N Nu ; B 29 -8 720 673 ;
|
||||
C 79 ; WX 722 ; N Omicron ; B 41 -17 715 685 ;
|
||||
C 80 ; WX 768 ; N Pi ; B 25 0 745 673 ;
|
||||
C 81 ; WX 741 ; N Theta ; B 41 -17 715 685 ;
|
||||
C 82 ; WX 556 ; N Rho ; B 28 0 563 673 ;
|
||||
C 83 ; WX 592 ; N Sigma ; B 5 0 589 673 ;
|
||||
C 84 ; WX 611 ; N Tau ; B 33 0 607 673 ;
|
||||
C 85 ; WX 690 ; N Upsilon ; B -8 0 694 673 ;
|
||||
C 86 ; WX 439 ; N sigma1 ; B 40 -233 436 500 ;
|
||||
C 87 ; WX 768 ; N Omega ; B 34 0 736 688 ;
|
||||
C 88 ; WX 645 ; N Xi ; B 40 0 599 673 ;
|
||||
C 89 ; WX 795 ; N Psi ; B 15 0 781 684 ;
|
||||
C 90 ; WX 611 ; N Zeta ; B 44 0 636 673 ;
|
||||
C 91 ; WX 333 ; N bracketleft ; B 86 -155 299 674 ;
|
||||
C 92 ; WX 863 ; N therefore ; B 163 0 701 487 ;
|
||||
C 93 ; WX 333 ; N bracketright ; B 33 -155 246 674 ;
|
||||
C 94 ; WX 658 ; N perpendicular ; B 15 0 652 674 ;
|
||||
C 95 ; WX 500 ; N underscore ; B -2 -125 502 -75 ;
|
||||
C 96 ; WX 500 ; N radicalex ; B 480 881 1090 917 ;
|
||||
C 97 ; WX 631 ; N alpha ; B 41 -18 622 500 ;
|
||||
C 98 ; WX 549 ; N beta ; B 61 -223 515 741 ;
|
||||
C 99 ; WX 549 ; N chi ; B 12 -231 522 499 ;
|
||||
C 100 ; WX 494 ; N delta ; B 40 -19 481 740 ;
|
||||
C 101 ; WX 439 ; N epsilon ; B 22 -19 427 502 ;
|
||||
C 102 ; WX 521 ; N phi ; B 28 -224 492 673 ;
|
||||
C 103 ; WX 411 ; N gamma ; B 5 -225 484 499 ;
|
||||
C 104 ; WX 603 ; N eta ; B 0 -202 527 514 ;
|
||||
C 105 ; WX 329 ; N iota ; B 0 -17 301 503 ;
|
||||
C 106 ; WX 603 ; N phi1 ; B 36 -224 587 499 ;
|
||||
C 107 ; WX 549 ; N kappa ; B 33 0 558 501 ;
|
||||
C 108 ; WX 549 ; N lambda ; B 24 -17 548 739 ;
|
||||
C 109 ; WX 576 ; N mu ; B 33 -223 567 500 ;
|
||||
C 110 ; WX 521 ; N nu ; B -9 -16 475 507 ;
|
||||
C 111 ; WX 549 ; N omicron ; B 35 -19 501 499 ;
|
||||
C 112 ; WX 549 ; N pi ; B 10 -19 530 487 ;
|
||||
C 113 ; WX 521 ; N theta ; B 43 -17 485 690 ;
|
||||
C 114 ; WX 549 ; N rho ; B 50 -230 490 499 ;
|
||||
C 115 ; WX 603 ; N sigma ; B 30 -21 588 500 ;
|
||||
C 116 ; WX 439 ; N tau ; B 10 -19 418 500 ;
|
||||
C 117 ; WX 576 ; N upsilon ; B 7 -18 535 507 ;
|
||||
C 118 ; WX 713 ; N omega1 ; B 12 -18 671 583 ;
|
||||
C 119 ; WX 686 ; N omega ; B 42 -17 684 500 ;
|
||||
C 120 ; WX 493 ; N xi ; B 27 -224 469 766 ;
|
||||
C 121 ; WX 686 ; N psi ; B 12 -228 701 500 ;
|
||||
C 122 ; WX 494 ; N zeta ; B 60 -225 467 756 ;
|
||||
C 123 ; WX 480 ; N braceleft ; B 58 -183 397 673 ;
|
||||
C 124 ; WX 200 ; N bar ; B 65 -293 135 707 ;
|
||||
C 125 ; WX 480 ; N braceright ; B 79 -183 418 673 ;
|
||||
C 126 ; WX 549 ; N similar ; B 17 203 529 307 ;
|
||||
C 160 ; WX 750 ; N Euro ; B 20 -12 714 685 ;
|
||||
C 161 ; WX 620 ; N Upsilon1 ; B -2 0 610 685 ;
|
||||
C 162 ; WX 247 ; N minute ; B 27 459 228 735 ;
|
||||
C 163 ; WX 549 ; N lessequal ; B 29 0 526 639 ;
|
||||
C 164 ; WX 167 ; N fraction ; B -180 -12 340 677 ;
|
||||
C 165 ; WX 713 ; N infinity ; B 26 124 688 404 ;
|
||||
C 166 ; WX 500 ; N florin ; B 2 -193 494 686 ;
|
||||
C 167 ; WX 753 ; N club ; B 86 -26 660 533 ;
|
||||
C 168 ; WX 753 ; N diamond ; B 142 -36 600 550 ;
|
||||
C 169 ; WX 753 ; N heart ; B 117 -33 631 532 ;
|
||||
C 170 ; WX 753 ; N spade ; B 113 -36 629 548 ;
|
||||
C 171 ; WX 1042 ; N arrowboth ; B 24 -15 1024 511 ;
|
||||
C 172 ; WX 987 ; N arrowleft ; B 32 -15 942 511 ;
|
||||
C 173 ; WX 603 ; N arrowup ; B 45 0 571 910 ;
|
||||
C 174 ; WX 987 ; N arrowright ; B 49 -15 959 511 ;
|
||||
C 175 ; WX 603 ; N arrowdown ; B 45 -22 571 888 ;
|
||||
C 176 ; WX 400 ; N degree ; B 50 385 350 685 ;
|
||||
C 177 ; WX 549 ; N plusminus ; B 10 0 539 645 ;
|
||||
C 178 ; WX 411 ; N second ; B 20 459 413 737 ;
|
||||
C 179 ; WX 549 ; N greaterequal ; B 29 0 526 639 ;
|
||||
C 180 ; WX 549 ; N multiply ; B 17 8 533 524 ;
|
||||
C 181 ; WX 713 ; N proportional ; B 27 123 639 404 ;
|
||||
C 182 ; WX 494 ; N partialdiff ; B 26 -20 462 746 ;
|
||||
C 183 ; WX 460 ; N bullet ; B 50 113 410 473 ;
|
||||
C 184 ; WX 549 ; N divide ; B 10 71 536 456 ;
|
||||
C 185 ; WX 549 ; N notequal ; B 15 -25 540 549 ;
|
||||
C 186 ; WX 549 ; N equivalence ; B 14 82 538 443 ;
|
||||
C 187 ; WX 549 ; N approxequal ; B 14 135 527 394 ;
|
||||
C 188 ; WX 1000 ; N ellipsis ; B 111 -17 889 95 ;
|
||||
C 189 ; WX 603 ; N arrowvertex ; B 280 -120 336 1010 ;
|
||||
C 190 ; WX 1000 ; N arrowhorizex ; B -60 220 1050 276 ;
|
||||
C 191 ; WX 658 ; N carriagereturn ; B 15 -16 602 629 ;
|
||||
C 192 ; WX 823 ; N aleph ; B 175 -18 661 658 ;
|
||||
C 193 ; WX 686 ; N Ifraktur ; B 10 -53 578 740 ;
|
||||
C 194 ; WX 795 ; N Rfraktur ; B 26 -15 759 734 ;
|
||||
C 195 ; WX 987 ; N weierstrass ; B 159 -211 870 573 ;
|
||||
C 196 ; WX 768 ; N circlemultiply ; B 43 -17 733 673 ;
|
||||
C 197 ; WX 768 ; N circleplus ; B 43 -15 733 675 ;
|
||||
C 198 ; WX 823 ; N emptyset ; B 39 -24 781 719 ;
|
||||
C 199 ; WX 768 ; N intersection ; B 40 0 732 509 ;
|
||||
C 200 ; WX 768 ; N union ; B 40 -17 732 492 ;
|
||||
C 201 ; WX 713 ; N propersuperset ; B 20 0 673 470 ;
|
||||
C 202 ; WX 713 ; N reflexsuperset ; B 20 -125 673 470 ;
|
||||
C 203 ; WX 713 ; N notsubset ; B 36 -70 690 540 ;
|
||||
C 204 ; WX 713 ; N propersubset ; B 37 0 690 470 ;
|
||||
C 205 ; WX 713 ; N reflexsubset ; B 37 -125 690 470 ;
|
||||
C 206 ; WX 713 ; N element ; B 45 0 505 468 ;
|
||||
C 207 ; WX 713 ; N notelement ; B 45 -58 505 555 ;
|
||||
C 208 ; WX 768 ; N angle ; B 26 0 738 673 ;
|
||||
C 209 ; WX 713 ; N gradient ; B 36 -19 681 718 ;
|
||||
C 210 ; WX 790 ; N registerserif ; B 50 -17 740 673 ;
|
||||
C 211 ; WX 790 ; N copyrightserif ; B 51 -15 741 675 ;
|
||||
C 212 ; WX 890 ; N trademarkserif ; B 18 293 855 673 ;
|
||||
C 213 ; WX 823 ; N product ; B 25 -101 803 751 ;
|
||||
C 214 ; WX 549 ; N radical ; B 10 -38 515 917 ;
|
||||
C 215 ; WX 250 ; N dotmath ; B 69 210 169 310 ;
|
||||
C 216 ; WX 713 ; N logicalnot ; B 15 0 680 288 ;
|
||||
C 217 ; WX 603 ; N logicaland ; B 23 0 583 454 ;
|
||||
C 218 ; WX 603 ; N logicalor ; B 30 0 578 477 ;
|
||||
C 219 ; WX 1042 ; N arrowdblboth ; B 27 -20 1023 510 ;
|
||||
C 220 ; WX 987 ; N arrowdblleft ; B 30 -15 939 513 ;
|
||||
C 221 ; WX 603 ; N arrowdblup ; B 39 2 567 911 ;
|
||||
C 222 ; WX 987 ; N arrowdblright ; B 45 -20 954 508 ;
|
||||
C 223 ; WX 603 ; N arrowdbldown ; B 44 -19 572 890 ;
|
||||
C 224 ; WX 494 ; N lozenge ; B 18 0 466 745 ;
|
||||
C 225 ; WX 329 ; N angleleft ; B 25 -198 306 746 ;
|
||||
C 226 ; WX 790 ; N registersans ; B 50 -20 740 670 ;
|
||||
C 227 ; WX 790 ; N copyrightsans ; B 49 -15 739 675 ;
|
||||
C 228 ; WX 786 ; N trademarksans ; B 5 293 725 673 ;
|
||||
C 229 ; WX 713 ; N summation ; B 14 -108 695 752 ;
|
||||
C 230 ; WX 384 ; N parenlefttp ; B 24 -293 436 926 ;
|
||||
C 231 ; WX 384 ; N parenleftex ; B 24 -85 108 925 ;
|
||||
C 232 ; WX 384 ; N parenleftbt ; B 24 -293 436 926 ;
|
||||
C 233 ; WX 384 ; N bracketlefttp ; B 0 -80 349 926 ;
|
||||
C 234 ; WX 384 ; N bracketleftex ; B 0 -79 77 925 ;
|
||||
C 235 ; WX 384 ; N bracketleftbt ; B 0 -80 349 926 ;
|
||||
C 236 ; WX 494 ; N bracelefttp ; B 209 -85 445 925 ;
|
||||
C 237 ; WX 494 ; N braceleftmid ; B 20 -85 284 935 ;
|
||||
C 238 ; WX 494 ; N braceleftbt ; B 209 -75 445 935 ;
|
||||
C 239 ; WX 494 ; N braceex ; B 209 -85 284 935 ;
|
||||
C 241 ; WX 329 ; N angleright ; B 21 -198 302 746 ;
|
||||
C 242 ; WX 274 ; N integral ; B 2 -107 291 916 ;
|
||||
C 243 ; WX 686 ; N integraltp ; B 308 -88 675 920 ;
|
||||
C 244 ; WX 686 ; N integralex ; B 308 -88 378 975 ;
|
||||
C 245 ; WX 686 ; N integralbt ; B 11 -87 378 921 ;
|
||||
C 246 ; WX 384 ; N parenrighttp ; B 54 -293 466 926 ;
|
||||
C 247 ; WX 384 ; N parenrightex ; B 382 -85 466 925 ;
|
||||
C 248 ; WX 384 ; N parenrightbt ; B 54 -293 466 926 ;
|
||||
C 249 ; WX 384 ; N bracketrighttp ; B 22 -80 371 926 ;
|
||||
C 250 ; WX 384 ; N bracketrightex ; B 294 -79 371 925 ;
|
||||
C 251 ; WX 384 ; N bracketrightbt ; B 22 -80 371 926 ;
|
||||
C 252 ; WX 494 ; N bracerighttp ; B 48 -85 284 925 ;
|
||||
C 253 ; WX 494 ; N bracerightmid ; B 209 -85 473 935 ;
|
||||
C 254 ; WX 494 ; N bracerightbt ; B 48 -75 284 935 ;
|
||||
C -1 ; WX 790 ; N apple ; B 56 -3 733 808 ;
|
||||
EndCharMetrics
|
||||
EndFontMetrics
|
||||
2588
includes/classes/org/pdf-php/fonts/Times-Bold.afm
Normal file
2588
includes/classes/org/pdf-php/fonts/Times-Bold.afm
Normal file
File diff suppressed because it is too large
Load Diff
2384
includes/classes/org/pdf-php/fonts/Times-BoldItalic.afm
Normal file
2384
includes/classes/org/pdf-php/fonts/Times-BoldItalic.afm
Normal file
File diff suppressed because it is too large
Load Diff
2667
includes/classes/org/pdf-php/fonts/Times-Italic.afm
Normal file
2667
includes/classes/org/pdf-php/fonts/Times-Italic.afm
Normal file
File diff suppressed because it is too large
Load Diff
2419
includes/classes/org/pdf-php/fonts/Times-Roman.afm
Normal file
2419
includes/classes/org/pdf-php/fonts/Times-Roman.afm
Normal file
File diff suppressed because it is too large
Load Diff
225
includes/classes/org/pdf-php/fonts/ZapfDingbats.afm
Normal file
225
includes/classes/org/pdf-php/fonts/ZapfDingbats.afm
Normal file
@@ -0,0 +1,225 @@
|
||||
StartFontMetrics 4.1
|
||||
Comment Copyright (c) 1985, 1987, 1988, 1989, 1997 Adobe Systems Incorporated. All Rights Reserved.
|
||||
Comment Creation Date: Thu May 1 15:14:13 1997
|
||||
Comment UniqueID 43082
|
||||
Comment VMusage 45775 55535
|
||||
FontName ZapfDingbats
|
||||
FullName ITC Zapf Dingbats
|
||||
FamilyName ZapfDingbats
|
||||
Weight Medium
|
||||
ItalicAngle 0
|
||||
IsFixedPitch false
|
||||
CharacterSet Special
|
||||
FontBBox -1 -143 981 820
|
||||
UnderlinePosition -100
|
||||
UnderlineThickness 50
|
||||
Version 002.000
|
||||
Notice Copyright (c) 1985, 1987, 1988, 1989, 1997 Adobe Systems Incorporated. All Rights Reserved.ITC Zapf Dingbats is a registered trademark of International Typeface Corporation.
|
||||
EncodingScheme FontSpecific
|
||||
StdHW 28
|
||||
StdVW 90
|
||||
StartCharMetrics 202
|
||||
C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
|
||||
C 33 ; WX 974 ; N a1 ; B 35 72 939 621 ;
|
||||
C 34 ; WX 961 ; N a2 ; B 35 81 927 611 ;
|
||||
C 35 ; WX 974 ; N a202 ; B 35 72 939 621 ;
|
||||
C 36 ; WX 980 ; N a3 ; B 35 0 945 692 ;
|
||||
C 37 ; WX 719 ; N a4 ; B 34 139 685 566 ;
|
||||
C 38 ; WX 789 ; N a5 ; B 35 -14 755 705 ;
|
||||
C 39 ; WX 790 ; N a119 ; B 35 -14 755 705 ;
|
||||
C 40 ; WX 791 ; N a118 ; B 35 -13 761 705 ;
|
||||
C 41 ; WX 690 ; N a117 ; B 34 138 655 553 ;
|
||||
C 42 ; WX 960 ; N a11 ; B 35 123 925 568 ;
|
||||
C 43 ; WX 939 ; N a12 ; B 35 134 904 559 ;
|
||||
C 44 ; WX 549 ; N a13 ; B 29 -11 516 705 ;
|
||||
C 45 ; WX 855 ; N a14 ; B 34 59 820 632 ;
|
||||
C 46 ; WX 911 ; N a15 ; B 35 50 876 642 ;
|
||||
C 47 ; WX 933 ; N a16 ; B 35 139 899 550 ;
|
||||
C 48 ; WX 911 ; N a105 ; B 35 50 876 642 ;
|
||||
C 49 ; WX 945 ; N a17 ; B 35 139 909 553 ;
|
||||
C 50 ; WX 974 ; N a18 ; B 35 104 938 587 ;
|
||||
C 51 ; WX 755 ; N a19 ; B 34 -13 721 705 ;
|
||||
C 52 ; WX 846 ; N a20 ; B 36 -14 811 705 ;
|
||||
C 53 ; WX 762 ; N a21 ; B 35 0 727 692 ;
|
||||
C 54 ; WX 761 ; N a22 ; B 35 0 727 692 ;
|
||||
C 55 ; WX 571 ; N a23 ; B -1 -68 571 661 ;
|
||||
C 56 ; WX 677 ; N a24 ; B 36 -13 642 705 ;
|
||||
C 57 ; WX 763 ; N a25 ; B 35 0 728 692 ;
|
||||
C 58 ; WX 760 ; N a26 ; B 35 0 726 692 ;
|
||||
C 59 ; WX 759 ; N a27 ; B 35 0 725 692 ;
|
||||
C 60 ; WX 754 ; N a28 ; B 35 0 720 692 ;
|
||||
C 61 ; WX 494 ; N a6 ; B 35 0 460 692 ;
|
||||
C 62 ; WX 552 ; N a7 ; B 35 0 517 692 ;
|
||||
C 63 ; WX 537 ; N a8 ; B 35 0 503 692 ;
|
||||
C 64 ; WX 577 ; N a9 ; B 35 96 542 596 ;
|
||||
C 65 ; WX 692 ; N a10 ; B 35 -14 657 705 ;
|
||||
C 66 ; WX 786 ; N a29 ; B 35 -14 751 705 ;
|
||||
C 67 ; WX 788 ; N a30 ; B 35 -14 752 705 ;
|
||||
C 68 ; WX 788 ; N a31 ; B 35 -14 753 705 ;
|
||||
C 69 ; WX 790 ; N a32 ; B 35 -14 756 705 ;
|
||||
C 70 ; WX 793 ; N a33 ; B 35 -13 759 705 ;
|
||||
C 71 ; WX 794 ; N a34 ; B 35 -13 759 705 ;
|
||||
C 72 ; WX 816 ; N a35 ; B 35 -14 782 705 ;
|
||||
C 73 ; WX 823 ; N a36 ; B 35 -14 787 705 ;
|
||||
C 74 ; WX 789 ; N a37 ; B 35 -14 754 705 ;
|
||||
C 75 ; WX 841 ; N a38 ; B 35 -14 807 705 ;
|
||||
C 76 ; WX 823 ; N a39 ; B 35 -14 789 705 ;
|
||||
C 77 ; WX 833 ; N a40 ; B 35 -14 798 705 ;
|
||||
C 78 ; WX 816 ; N a41 ; B 35 -13 782 705 ;
|
||||
C 79 ; WX 831 ; N a42 ; B 35 -14 796 705 ;
|
||||
C 80 ; WX 923 ; N a43 ; B 35 -14 888 705 ;
|
||||
C 81 ; WX 744 ; N a44 ; B 35 0 710 692 ;
|
||||
C 82 ; WX 723 ; N a45 ; B 35 0 688 692 ;
|
||||
C 83 ; WX 749 ; N a46 ; B 35 0 714 692 ;
|
||||
C 84 ; WX 790 ; N a47 ; B 34 -14 756 705 ;
|
||||
C 85 ; WX 792 ; N a48 ; B 35 -14 758 705 ;
|
||||
C 86 ; WX 695 ; N a49 ; B 35 -14 661 706 ;
|
||||
C 87 ; WX 776 ; N a50 ; B 35 -6 741 699 ;
|
||||
C 88 ; WX 768 ; N a51 ; B 35 -7 734 699 ;
|
||||
C 89 ; WX 792 ; N a52 ; B 35 -14 757 705 ;
|
||||
C 90 ; WX 759 ; N a53 ; B 35 0 725 692 ;
|
||||
C 91 ; WX 707 ; N a54 ; B 35 -13 672 704 ;
|
||||
C 92 ; WX 708 ; N a55 ; B 35 -14 672 705 ;
|
||||
C 93 ; WX 682 ; N a56 ; B 35 -14 647 705 ;
|
||||
C 94 ; WX 701 ; N a57 ; B 35 -14 666 705 ;
|
||||
C 95 ; WX 826 ; N a58 ; B 35 -14 791 705 ;
|
||||
C 96 ; WX 815 ; N a59 ; B 35 -14 780 705 ;
|
||||
C 97 ; WX 789 ; N a60 ; B 35 -14 754 705 ;
|
||||
C 98 ; WX 789 ; N a61 ; B 35 -14 754 705 ;
|
||||
C 99 ; WX 707 ; N a62 ; B 34 -14 673 705 ;
|
||||
C 100 ; WX 687 ; N a63 ; B 36 0 651 692 ;
|
||||
C 101 ; WX 696 ; N a64 ; B 35 0 661 691 ;
|
||||
C 102 ; WX 689 ; N a65 ; B 35 0 655 692 ;
|
||||
C 103 ; WX 786 ; N a66 ; B 34 -14 751 705 ;
|
||||
C 104 ; WX 787 ; N a67 ; B 35 -14 752 705 ;
|
||||
C 105 ; WX 713 ; N a68 ; B 35 -14 678 705 ;
|
||||
C 106 ; WX 791 ; N a69 ; B 35 -14 756 705 ;
|
||||
C 107 ; WX 785 ; N a70 ; B 36 -14 751 705 ;
|
||||
C 108 ; WX 791 ; N a71 ; B 35 -14 757 705 ;
|
||||
C 109 ; WX 873 ; N a72 ; B 35 -14 838 705 ;
|
||||
C 110 ; WX 761 ; N a73 ; B 35 0 726 692 ;
|
||||
C 111 ; WX 762 ; N a74 ; B 35 0 727 692 ;
|
||||
C 112 ; WX 762 ; N a203 ; B 35 0 727 692 ;
|
||||
C 113 ; WX 759 ; N a75 ; B 35 0 725 692 ;
|
||||
C 114 ; WX 759 ; N a204 ; B 35 0 725 692 ;
|
||||
C 115 ; WX 892 ; N a76 ; B 35 0 858 705 ;
|
||||
C 116 ; WX 892 ; N a77 ; B 35 -14 858 692 ;
|
||||
C 117 ; WX 788 ; N a78 ; B 35 -14 754 705 ;
|
||||
C 118 ; WX 784 ; N a79 ; B 35 -14 749 705 ;
|
||||
C 119 ; WX 438 ; N a81 ; B 35 -14 403 705 ;
|
||||
C 120 ; WX 138 ; N a82 ; B 35 0 104 692 ;
|
||||
C 121 ; WX 277 ; N a83 ; B 35 0 242 692 ;
|
||||
C 122 ; WX 415 ; N a84 ; B 35 0 380 692 ;
|
||||
C 123 ; WX 392 ; N a97 ; B 35 263 357 705 ;
|
||||
C 124 ; WX 392 ; N a98 ; B 34 263 357 705 ;
|
||||
C 125 ; WX 668 ; N a99 ; B 35 263 633 705 ;
|
||||
C 126 ; WX 668 ; N a100 ; B 36 263 634 705 ;
|
||||
C 128 ; WX 390 ; N a89 ; B 35 -14 356 705 ;
|
||||
C 129 ; WX 390 ; N a90 ; B 35 -14 355 705 ;
|
||||
C 130 ; WX 317 ; N a93 ; B 35 0 283 692 ;
|
||||
C 131 ; WX 317 ; N a94 ; B 35 0 283 692 ;
|
||||
C 132 ; WX 276 ; N a91 ; B 35 0 242 692 ;
|
||||
C 133 ; WX 276 ; N a92 ; B 35 0 242 692 ;
|
||||
C 134 ; WX 509 ; N a205 ; B 35 0 475 692 ;
|
||||
C 135 ; WX 509 ; N a85 ; B 35 0 475 692 ;
|
||||
C 136 ; WX 410 ; N a206 ; B 35 0 375 692 ;
|
||||
C 137 ; WX 410 ; N a86 ; B 35 0 375 692 ;
|
||||
C 138 ; WX 234 ; N a87 ; B 35 -14 199 705 ;
|
||||
C 139 ; WX 234 ; N a88 ; B 35 -14 199 705 ;
|
||||
C 140 ; WX 334 ; N a95 ; B 35 0 299 692 ;
|
||||
C 141 ; WX 334 ; N a96 ; B 35 0 299 692 ;
|
||||
C 161 ; WX 732 ; N a101 ; B 35 -143 697 806 ;
|
||||
C 162 ; WX 544 ; N a102 ; B 56 -14 488 706 ;
|
||||
C 163 ; WX 544 ; N a103 ; B 34 -14 508 705 ;
|
||||
C 164 ; WX 910 ; N a104 ; B 35 40 875 651 ;
|
||||
C 165 ; WX 667 ; N a106 ; B 35 -14 633 705 ;
|
||||
C 166 ; WX 760 ; N a107 ; B 35 -14 726 705 ;
|
||||
C 167 ; WX 760 ; N a108 ; B 0 121 758 569 ;
|
||||
C 168 ; WX 776 ; N a112 ; B 35 0 741 705 ;
|
||||
C 169 ; WX 595 ; N a111 ; B 34 -14 560 705 ;
|
||||
C 170 ; WX 694 ; N a110 ; B 35 -14 659 705 ;
|
||||
C 171 ; WX 626 ; N a109 ; B 34 0 591 705 ;
|
||||
C 172 ; WX 788 ; N a120 ; B 35 -14 754 705 ;
|
||||
C 173 ; WX 788 ; N a121 ; B 35 -14 754 705 ;
|
||||
C 174 ; WX 788 ; N a122 ; B 35 -14 754 705 ;
|
||||
C 175 ; WX 788 ; N a123 ; B 35 -14 754 705 ;
|
||||
C 176 ; WX 788 ; N a124 ; B 35 -14 754 705 ;
|
||||
C 177 ; WX 788 ; N a125 ; B 35 -14 754 705 ;
|
||||
C 178 ; WX 788 ; N a126 ; B 35 -14 754 705 ;
|
||||
C 179 ; WX 788 ; N a127 ; B 35 -14 754 705 ;
|
||||
C 180 ; WX 788 ; N a128 ; B 35 -14 754 705 ;
|
||||
C 181 ; WX 788 ; N a129 ; B 35 -14 754 705 ;
|
||||
C 182 ; WX 788 ; N a130 ; B 35 -14 754 705 ;
|
||||
C 183 ; WX 788 ; N a131 ; B 35 -14 754 705 ;
|
||||
C 184 ; WX 788 ; N a132 ; B 35 -14 754 705 ;
|
||||
C 185 ; WX 788 ; N a133 ; B 35 -14 754 705 ;
|
||||
C 186 ; WX 788 ; N a134 ; B 35 -14 754 705 ;
|
||||
C 187 ; WX 788 ; N a135 ; B 35 -14 754 705 ;
|
||||
C 188 ; WX 788 ; N a136 ; B 35 -14 754 705 ;
|
||||
C 189 ; WX 788 ; N a137 ; B 35 -14 754 705 ;
|
||||
C 190 ; WX 788 ; N a138 ; B 35 -14 754 705 ;
|
||||
C 191 ; WX 788 ; N a139 ; B 35 -14 754 705 ;
|
||||
C 192 ; WX 788 ; N a140 ; B 35 -14 754 705 ;
|
||||
C 193 ; WX 788 ; N a141 ; B 35 -14 754 705 ;
|
||||
C 194 ; WX 788 ; N a142 ; B 35 -14 754 705 ;
|
||||
C 195 ; WX 788 ; N a143 ; B 35 -14 754 705 ;
|
||||
C 196 ; WX 788 ; N a144 ; B 35 -14 754 705 ;
|
||||
C 197 ; WX 788 ; N a145 ; B 35 -14 754 705 ;
|
||||
C 198 ; WX 788 ; N a146 ; B 35 -14 754 705 ;
|
||||
C 199 ; WX 788 ; N a147 ; B 35 -14 754 705 ;
|
||||
C 200 ; WX 788 ; N a148 ; B 35 -14 754 705 ;
|
||||
C 201 ; WX 788 ; N a149 ; B 35 -14 754 705 ;
|
||||
C 202 ; WX 788 ; N a150 ; B 35 -14 754 705 ;
|
||||
C 203 ; WX 788 ; N a151 ; B 35 -14 754 705 ;
|
||||
C 204 ; WX 788 ; N a152 ; B 35 -14 754 705 ;
|
||||
C 205 ; WX 788 ; N a153 ; B 35 -14 754 705 ;
|
||||
C 206 ; WX 788 ; N a154 ; B 35 -14 754 705 ;
|
||||
C 207 ; WX 788 ; N a155 ; B 35 -14 754 705 ;
|
||||
C 208 ; WX 788 ; N a156 ; B 35 -14 754 705 ;
|
||||
C 209 ; WX 788 ; N a157 ; B 35 -14 754 705 ;
|
||||
C 210 ; WX 788 ; N a158 ; B 35 -14 754 705 ;
|
||||
C 211 ; WX 788 ; N a159 ; B 35 -14 754 705 ;
|
||||
C 212 ; WX 894 ; N a160 ; B 35 58 860 634 ;
|
||||
C 213 ; WX 838 ; N a161 ; B 35 152 803 540 ;
|
||||
C 214 ; WX 1016 ; N a163 ; B 34 152 981 540 ;
|
||||
C 215 ; WX 458 ; N a164 ; B 35 -127 422 820 ;
|
||||
C 216 ; WX 748 ; N a196 ; B 35 94 698 597 ;
|
||||
C 217 ; WX 924 ; N a165 ; B 35 140 890 552 ;
|
||||
C 218 ; WX 748 ; N a192 ; B 35 94 698 597 ;
|
||||
C 219 ; WX 918 ; N a166 ; B 35 166 884 526 ;
|
||||
C 220 ; WX 927 ; N a167 ; B 35 32 892 660 ;
|
||||
C 221 ; WX 928 ; N a168 ; B 35 129 891 562 ;
|
||||
C 222 ; WX 928 ; N a169 ; B 35 128 893 563 ;
|
||||
C 223 ; WX 834 ; N a170 ; B 35 155 799 537 ;
|
||||
C 224 ; WX 873 ; N a171 ; B 35 93 838 599 ;
|
||||
C 225 ; WX 828 ; N a172 ; B 35 104 791 588 ;
|
||||
C 226 ; WX 924 ; N a173 ; B 35 98 889 594 ;
|
||||
C 227 ; WX 924 ; N a162 ; B 35 98 889 594 ;
|
||||
C 228 ; WX 917 ; N a174 ; B 35 0 882 692 ;
|
||||
C 229 ; WX 930 ; N a175 ; B 35 84 896 608 ;
|
||||
C 230 ; WX 931 ; N a176 ; B 35 84 896 608 ;
|
||||
C 231 ; WX 463 ; N a177 ; B 35 -99 429 791 ;
|
||||
C 232 ; WX 883 ; N a178 ; B 35 71 848 623 ;
|
||||
C 233 ; WX 836 ; N a179 ; B 35 44 802 648 ;
|
||||
C 234 ; WX 836 ; N a193 ; B 35 44 802 648 ;
|
||||
C 235 ; WX 867 ; N a180 ; B 35 101 832 591 ;
|
||||
C 236 ; WX 867 ; N a199 ; B 35 101 832 591 ;
|
||||
C 237 ; WX 696 ; N a181 ; B 35 44 661 648 ;
|
||||
C 238 ; WX 696 ; N a200 ; B 35 44 661 648 ;
|
||||
C 239 ; WX 874 ; N a182 ; B 35 77 840 619 ;
|
||||
C 241 ; WX 874 ; N a201 ; B 35 73 840 615 ;
|
||||
C 242 ; WX 760 ; N a183 ; B 35 0 725 692 ;
|
||||
C 243 ; WX 946 ; N a184 ; B 35 160 911 533 ;
|
||||
C 244 ; WX 771 ; N a197 ; B 34 37 736 655 ;
|
||||
C 245 ; WX 865 ; N a185 ; B 35 207 830 481 ;
|
||||
C 246 ; WX 771 ; N a194 ; B 34 37 736 655 ;
|
||||
C 247 ; WX 888 ; N a198 ; B 34 -19 853 712 ;
|
||||
C 248 ; WX 967 ; N a186 ; B 35 124 932 568 ;
|
||||
C 249 ; WX 888 ; N a195 ; B 34 -19 853 712 ;
|
||||
C 250 ; WX 831 ; N a187 ; B 35 113 796 579 ;
|
||||
C 251 ; WX 873 ; N a188 ; B 36 118 838 578 ;
|
||||
C 252 ; WX 927 ; N a189 ; B 35 150 891 542 ;
|
||||
C 253 ; WX 970 ; N a190 ; B 35 76 931 616 ;
|
||||
C 254 ; WX 918 ; N a191 ; B 34 99 884 593 ;
|
||||
EndCharMetrics
|
||||
EndFontMetrics
|
||||
1
includes/classes/org/pdf-php/fonts/php_Courier-Bold.afm
Normal file
1
includes/classes/org/pdf-php/fonts/php_Courier-Bold.afm
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
includes/classes/org/pdf-php/fonts/php_Courier.afm
Normal file
1
includes/classes/org/pdf-php/fonts/php_Courier.afm
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
includes/classes/org/pdf-php/fonts/php_Helvetica.afm
Normal file
1
includes/classes/org/pdf-php/fonts/php_Helvetica.afm
Normal file
File diff suppressed because one or more lines are too long
1
includes/classes/org/pdf-php/fonts/php_Symbol.afm
Normal file
1
includes/classes/org/pdf-php/fonts/php_Symbol.afm
Normal file
File diff suppressed because one or more lines are too long
1
includes/classes/org/pdf-php/fonts/php_Times-Bold.afm
Normal file
1
includes/classes/org/pdf-php/fonts/php_Times-Bold.afm
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
includes/classes/org/pdf-php/fonts/php_Times-Italic.afm
Normal file
1
includes/classes/org/pdf-php/fonts/php_Times-Italic.afm
Normal file
File diff suppressed because one or more lines are too long
1
includes/classes/org/pdf-php/fonts/php_Times-Roman.afm
Normal file
1
includes/classes/org/pdf-php/fonts/php_Times-Roman.afm
Normal file
File diff suppressed because one or more lines are too long
1
includes/classes/org/pdf-php/fonts/php_ZapfDingbats.afm
Normal file
1
includes/classes/org/pdf-php/fonts/php_ZapfDingbats.afm
Normal file
File diff suppressed because one or more lines are too long
1
includes/classes/org/pdf-php/fonts/php_a0100131.afm
Normal file
1
includes/classes/org/pdf-php/fonts/php_a0100131.afm
Normal file
File diff suppressed because one or more lines are too long
1
includes/classes/org/pdf-php/fonts/php_a010013l.afm
Normal file
1
includes/classes/org/pdf-php/fonts/php_a010013l.afm
Normal file
File diff suppressed because one or more lines are too long
26
includes/classes/org/simplepie/LICENSE.txt
Normal file
26
includes/classes/org/simplepie/LICENSE.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
Copyright (c) 2004-2007, Ryan Parman and Geoffrey Sneddon.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are
|
||||
permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
of conditions and the following disclaimer in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
|
||||
* Neither the name of the SimplePie Team nor the names of its contributors may be used
|
||||
to endorse or promote products derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
|
||||
AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
117
includes/classes/org/simplepie/README.markdown
Executable file
117
includes/classes/org/simplepie/README.markdown
Executable file
@@ -0,0 +1,117 @@
|
||||
SimplePie
|
||||
=========
|
||||
|
||||
SimplePie is a very fast and easy-to-use class, written in PHP, that puts the
|
||||
'simple' back into 'really simple syndication'. Flexible enough to suit
|
||||
beginners and veterans alike, SimplePie is focused on [speed, ease of use,
|
||||
compatibility and standards compliance][what_is].
|
||||
|
||||
[what_is]: http://simplepie.org/wiki/faq/what_is_simplepie
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
* PHP 5.2.0 or newer
|
||||
* libxml2 (certain 2.7.x releases are too buggy for words, and will crash)
|
||||
* Either the iconv or mbstring extension
|
||||
* cURL or fsockopen()
|
||||
* PCRE support
|
||||
|
||||
If you're looking for PHP 4.x support, pull the "one-dot-two" branch, as that's
|
||||
the last version to support PHP 4.x.
|
||||
|
||||
|
||||
What comes in the package?
|
||||
--------------------------
|
||||
1. `library/` - SimplePie classes for use with the autoloader
|
||||
2. `autoloader.php` - The SimplePie Autoloader if you want to use the separate
|
||||
file version.
|
||||
3. `README.markdown` - This document.
|
||||
4. `LICENSE.txt` - A copy of the BSD license.
|
||||
5. `compatibility_test/` - The SimplePie compatibility test that checks your
|
||||
server for required settings.
|
||||
6. `demo/` - A basic feed reader demo that shows off some of SimplePie's more
|
||||
noticeable features.
|
||||
7. `idn/` - A third-party library that SimplePie can optionally use to
|
||||
understand Internationalized Domain Names (IDNs).
|
||||
8. `build/` - Scripts related to generating pieces of SimplePie
|
||||
9. `test/` - SimplePie's unit test suite.
|
||||
|
||||
### Where's `simplepie.inc`?
|
||||
For SimplePie 1.3, we've split the classes into separate files to make it easier
|
||||
to maintain and use.
|
||||
|
||||
If you'd like a single monolithic file, you can run `php build/compile.php` to
|
||||
generate `SimplePie.compiled.php`, or grab a copy from
|
||||
[dev.simplepie.org][dev_compiled] (this is kept up-to-date with the latest
|
||||
code from Git).
|
||||
|
||||
[dev_compiled]: http://dev.simplepie.org/SimplePie.compiled.php
|
||||
|
||||
|
||||
To start the demo
|
||||
-----------------
|
||||
1. Upload this package to your webserver.
|
||||
2. Make sure that the cache folder inside of the demo folder is server-writable.
|
||||
3. Navigate your browser to the demo folder.
|
||||
|
||||
|
||||
Need support?
|
||||
-------------
|
||||
For further setup and install documentation, function references, etc., visit
|
||||
[the wiki][wiki]. If you're using the latest version off GitHub, you can also
|
||||
check out the [API documentation][].
|
||||
|
||||
If you can't find an answer to your question in the documentation, head on over
|
||||
to one of our [support channels][]. For bug reports and feature requests, visit
|
||||
the [issue tracker][].
|
||||
|
||||
[API documentation]: http://dev.simplepie.org/api/
|
||||
[wiki]: http://simplepie.org/wiki/
|
||||
[support channels]: http://simplepie.org/support/
|
||||
[issue tracker]: http://github.com/simplepie/simplepie/issues
|
||||
|
||||
|
||||
Project status
|
||||
--------------
|
||||
SimplePie is currently maintained by Ryan McCue.
|
||||
|
||||
As an open source project, SimplePie is maintained on a somewhat sporadic basis.
|
||||
This means that feature requests may not be fulfilled straight away, as time has
|
||||
to be prioritized.
|
||||
|
||||
If you'd like to contribute to SimplePie, the best way to get started is to fork
|
||||
the project on GitHub and send pull requests for patches. When doing so, please
|
||||
be aware of our [coding standards][].
|
||||
|
||||
[coding standards]: http://simplepie.org/wiki/misc/coding_standards
|
||||
|
||||
|
||||
Authors and contributors
|
||||
------------------------
|
||||
### Current
|
||||
* [Ryan McCue][] (Maintainer, support)
|
||||
|
||||
### Alumni
|
||||
* [Ryan Parman][] (Creator, developer, evangelism, support)
|
||||
* [Geoffrey Sneddon][] (Lead developer)
|
||||
* [Michael Shipley][] (Submitter of patches, support)
|
||||
* [Steve Minutillo][] (Submitter of patches)
|
||||
|
||||
[Ryan McCue]: http://ryanmccue.info
|
||||
[Ryan Parman]: http://ryanparman.com
|
||||
[Geoffrey Sneddon]: http://gsnedders.com
|
||||
[Michael Shipley]: http://michaelpshipley.com
|
||||
[Steve Minutillo]: http://minutillo.com/steve/
|
||||
|
||||
|
||||
### Contributors
|
||||
For a complete list of contributors:
|
||||
|
||||
1. Pull down the latest SimplePie code
|
||||
2. In the `simplepie` directory, run `git shortlog -ns`
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
[New BSD license](http://www.opensource.org/licenses/BSD-3-Clause)
|
||||
17768
includes/classes/org/simplepie/SimplePie.compiled.php
Normal file
17768
includes/classes/org/simplepie/SimplePie.compiled.php
Normal file
File diff suppressed because it is too large
Load Diff
221
includes/execute.inc.php
Normal file
221
includes/execute.inc.php
Normal file
@@ -0,0 +1,221 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/execute.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/execute.inc.php $
|
||||
// Author(s): Richard Karnesky <mailto:karnesky@gmail.com> and
|
||||
// Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 16-Dec-05, 18:00
|
||||
// Modified: $Date: 2012-11-12 22:43:32 +0000 (Mon, 12 Nov 2012) $
|
||||
// $Author: karnesky $
|
||||
// $Revision: 1366 $
|
||||
|
||||
// This file contains functions that deal with execution of shell commands and provides
|
||||
// fixes for 'exec()' on certain win32 systems (based on rivera at spamjoy dot unr dot edu's
|
||||
// 'wind_exec()' function <http://php.net/function.exec>).
|
||||
|
||||
// Note: Since the 'exec()' function is used, some things may not work if
|
||||
//'safe_mode' is set to 'On' in your 'php.ini' file. If you need or want to
|
||||
// keep 'safe_mode=ON' then you'll need to put the programs within the
|
||||
// directory that's specified in 'safe_mode_exec_dir'.
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Import records using the bibutils program given in '$program'
|
||||
function importBibutils($sourceText, $program)
|
||||
{
|
||||
global $contentTypeCharset; // defined in 'ini.inc.php'
|
||||
|
||||
// Get the absolute path for the bibutils package:
|
||||
// (function 'getExternalUtilityPath()' is defined in 'include.inc.php')
|
||||
$bibutilsPath = getExternalUtilityPath("bibutils");
|
||||
|
||||
// Write the source data to a temporary file:
|
||||
$tempFile = writeToTempFile($sourceText);
|
||||
|
||||
// Set input and output encoding:
|
||||
if ($contentTypeCharset != "UTF-8")
|
||||
{
|
||||
$inputEncodingArg = " -i iso8859_1";
|
||||
$outputEncodingArg = " -o iso8859_1";
|
||||
}
|
||||
else
|
||||
{
|
||||
$inputEncodingArg = " -i utf8";
|
||||
$outputEncodingArg = " -o utf8";
|
||||
}
|
||||
|
||||
// Pass this temp file to the bibutils utility for conversion:
|
||||
$outputFile = convertBibutils($bibutilsPath, $tempFile, $program, $inputEncodingArg, $outputEncodingArg);
|
||||
unlink($tempFile);
|
||||
|
||||
// Read the resulting output file and return the converted data:
|
||||
$resultString = readFromFile($outputFile);
|
||||
unlink($outputFile);
|
||||
|
||||
return $resultString;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Export records using the bibutils program given in '$program'
|
||||
function exportBibutils($result, $program)
|
||||
{
|
||||
global $contentTypeCharset; // these variables are defined in 'ini.inc.php'
|
||||
global $convertExportDataToUTF8;
|
||||
|
||||
// Get the absolute path for the bibutils package:
|
||||
// (function 'getExternalUtilityPath()' is defined in 'include.inc.php')
|
||||
$bibutilsPath = getExternalUtilityPath("bibutils");
|
||||
|
||||
// Generate and serve a MODS XML file of ALL records:
|
||||
// (function 'modsCollection()' is defined in 'modsxml.inc.php')
|
||||
$recordCollection = modsCollection($result);
|
||||
|
||||
// Write the MODS XML data to a temporary file:
|
||||
$tempFile = writeToTempFile($recordCollection);
|
||||
|
||||
// Set input and output encoding:
|
||||
if (($convertExportDataToUTF8 == "no") AND ($contentTypeCharset != "UTF-8"))
|
||||
{
|
||||
$inputEncodingArg = " -i iso8859_1";
|
||||
$outputEncodingArg = " -o iso8859_1";
|
||||
}
|
||||
else
|
||||
{
|
||||
$inputEncodingArg = " -i utf8";
|
||||
$outputEncodingArg = " -o utf8";
|
||||
}
|
||||
|
||||
// Pass this temp file to the bibutils utility for conversion:
|
||||
$outputFile = convertBibutils($bibutilsPath, $tempFile, $program, $inputEncodingArg, $outputEncodingArg);
|
||||
unlink($tempFile);
|
||||
|
||||
// Read the resulting output file and return the converted data:
|
||||
$resultString = readFromFile($outputFile);
|
||||
unlink($outputFile);
|
||||
|
||||
return $resultString;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Convert file contents using the bibutils program given in '$program'
|
||||
function convertBibutils($bibutilsPath, $tempFile, $program, $inputEncodingArg, $outputEncodingArg)
|
||||
{
|
||||
global $sessionTempDir; // defined in 'ini.inc.php'
|
||||
|
||||
$outputFile = tempnam($sessionTempDir, "refbase-");
|
||||
$cmd = $bibutilsPath . $program . $inputEncodingArg . $outputEncodingArg . " " . $tempFile;
|
||||
execute($cmd, $outputFile);
|
||||
|
||||
return $outputFile;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Execute shell command
|
||||
function execute($cmd, $outputFile)
|
||||
{
|
||||
if (getenv("OS") == "Windows_NT")
|
||||
executeWin32($cmd . " > " . $outputFile);
|
||||
else
|
||||
{
|
||||
exec($cmd, $output);
|
||||
arrayToFile($output, $outputFile);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Execute shell command on win32 systems
|
||||
function executeWin32($cmd)
|
||||
{
|
||||
$cmdline = "cmd /C ". $cmd;
|
||||
|
||||
// Make a new instance of the COM object
|
||||
$WshShell = new COM("WScript.Shell");
|
||||
|
||||
// Make the command window but dont show it
|
||||
$oExec = $WshShell->Run($cmdline, 0, true);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Write data to a temporary file
|
||||
function writeToTempFile($sourceText)
|
||||
{
|
||||
global $sessionTempDir; // defined in 'ini.inc.php'
|
||||
|
||||
$tempFile = tempnam($sessionTempDir, "refbase-");
|
||||
$tempFileHandle = fopen($tempFile, "w"); // open temp file with write permission
|
||||
fwrite($tempFileHandle, $sourceText); // save data to temp file
|
||||
fclose($tempFileHandle); // close temp file
|
||||
|
||||
return $tempFile;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Get file contents
|
||||
function readFromFile($file)
|
||||
{
|
||||
// Enable PHP to detect Mac (CR) EOL conventions:
|
||||
// (see <http://www.php.net/manual/en/ref.filesystem.php#ini.auto-detect-line-endings>)
|
||||
ini_set('auto_detect_line_endings', true);
|
||||
|
||||
$fileContents = file_get_contents($file);
|
||||
|
||||
// Remove UTF-8 BOM if present
|
||||
$bom = "\xef\xbb\xbf";
|
||||
if (0 == strncmp($fileContents, $bom, 3)) {
|
||||
$fileContents = substr($fileContents, 3);
|
||||
}
|
||||
|
||||
|
||||
return $fileContents;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Write an array (as from $return argument in exec) to a file
|
||||
function arrayToFile($array, $outputFile)
|
||||
{
|
||||
return (stringToFile(implode("\n", $array), $outputFile));
|
||||
}
|
||||
|
||||
function stringToFile($string, $outputFile)
|
||||
{
|
||||
$rc = false;
|
||||
do
|
||||
{
|
||||
if (!($f = fopen($outputFile, "wa+")))
|
||||
{
|
||||
$rc = 1;
|
||||
break;
|
||||
}
|
||||
if (!fwrite($f, $string))
|
||||
{
|
||||
$rc = 2;
|
||||
break;
|
||||
}
|
||||
$rc = true;
|
||||
}
|
||||
while (0);
|
||||
|
||||
if ($f)
|
||||
fclose($f);
|
||||
|
||||
return ($rc);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
?>
|
||||
63
includes/export.inc.php
Normal file
63
includes/export.inc.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/export.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/export.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 09-May-06, 15:34
|
||||
// Modified: $Date: 2007-02-17 01:10:14 +0000 (Sat, 17 Feb 2007) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 894 $
|
||||
|
||||
// This file contains functions
|
||||
// that are used when exporting
|
||||
// records from the database.
|
||||
|
||||
|
||||
include 'includes/transtab_refbase_bibtex.inc.php'; // include refbase markup -> BibTeX search & replace patterns
|
||||
|
||||
if (($convertExportDataToUTF8 == "no") AND ($contentTypeCharset != "UTF-8")) // variables '$convertExportDataToUTF8' & '$contentTypeCharset' are defined in 'ini.inc.php'
|
||||
include_once 'includes/transtab_latin1_bibtex.inc.php'; // include Latin1 -> LaTeX/BibTeX translation table
|
||||
else
|
||||
include_once 'includes/transtab_unicode_bibtex.inc.php'; // include Unicode -> LaTeX/BibTeX translation table
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// This function takes a BibTeX file (as generated by bibutils) and
|
||||
// converts any contained refbase markup into proper LaTeX/BibTeX markup:
|
||||
function standardizeBibtexOutput($bibtexSourceText)
|
||||
{
|
||||
global $contentTypeCharset; // these variables are defined in 'ini.inc.php'
|
||||
global $convertExportDataToUTF8;
|
||||
|
||||
// The array '$transtab_refbase_bibtex' contains search & replace patterns for conversion from refbase markup to LaTeX/BibTeX markup & entities.
|
||||
// Converts refbase fontshape markup (italic, bold) into LaTeX commands of the 'textcomp' package, super- and subscript as well as greek
|
||||
// letters get converted into the respective commands in math mode. You may need to adopt the LaTeX markup to suit your individual needs.
|
||||
global $transtab_refbase_bibtex; // defined in 'transtab_refbase_bibtex.inc.php'
|
||||
|
||||
// The arrays '$transtab_latin1_bibtex' and '$transtab_unicode_bibtex' provide translation tables for best-effort conversion of higher ASCII
|
||||
// characters from ISO-8859-1 (or Unicode, respectively) to LaTeX/BibTeX entities.
|
||||
global $transtab_latin1_bibtex; // defined in 'transtab_latin1_bibtex.inc.php'
|
||||
global $transtab_unicode_bibtex; // defined in 'transtab_unicode_bibtex.inc.php'
|
||||
|
||||
// Perform search & replace actions on the given BibTeX text:
|
||||
$bibtexSourceText = searchReplaceText($transtab_refbase_bibtex, $bibtexSourceText, true); // function 'searchReplaceText()' is defined in 'include.inc.php'
|
||||
|
||||
// Attempt to convert higher ASCII chars that were NOT converted by bibutils to their corresponding LaTeX/BibTeX entities:
|
||||
if (($convertExportDataToUTF8 == "no") AND ($contentTypeCharset != "UTF-8"))
|
||||
$bibtexSourceText = searchReplaceText($transtab_latin1_bibtex, $bibtexSourceText, false);
|
||||
else
|
||||
$bibtexSourceText = searchReplaceText($transtab_unicode_bibtex, $bibtexSourceText, false);
|
||||
|
||||
return $bibtexSourceText;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
?>
|
||||
133
includes/footer.inc.php
Normal file
133
includes/footer.inc.php
Normal file
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/footer.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/footer.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 28-Jul-02, 11:30
|
||||
// Modified: $Date: 2012-02-28 23:26:30 +0000 (Tue, 28 Feb 2012) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1344 $
|
||||
|
||||
// This is the footer include file.
|
||||
// It contains functions that build the footer
|
||||
// which gets displayed on every page.
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Inserts the closing HTML </body> and </html> tags:
|
||||
function displayHTMLfoot()
|
||||
{
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Displays the visible footer:
|
||||
function showPageFooter($HeaderString)
|
||||
{
|
||||
global $officialDatabaseName; // usage example: <a href="index.php">[? echo encodeHTML($officialDatabaseName); ?]</a>
|
||||
global $adminLoginEmail;
|
||||
global $hostInstitutionAbbrevName; // usage example: <a href="[? echo $hostInstitutionURL; ?]">[? echo encodeHTML($hostInstitutionAbbrevName); ?] Home</a>
|
||||
global $hostInstitutionName; // (note: in the examples above, square brackets must be replaced by their respective angle brackets)
|
||||
global $hostInstitutionURL;
|
||||
global $helpResourcesURL;
|
||||
global $librarySearchPattern;
|
||||
|
||||
global $loginWelcomeMsg; // these variables are globally defined in function 'showLogin()' in 'include.inc.php'
|
||||
global $loginStatus;
|
||||
global $loginLinks;
|
||||
|
||||
global $loginEmail;
|
||||
|
||||
global $loc; // '$loc' is made globally available in 'core.php'
|
||||
?>
|
||||
|
||||
<hr class="pagefooter" align="center" width="95%">
|
||||
<table class="pagefooter" align="center" border="0" cellpadding="0" cellspacing="10" width="95%" summary="This table holds the footer">
|
||||
<tr>
|
||||
<td class="small" width="105"><a href="index.php"<?php echo addAccessKey("attribute", "home"); ?> title="<?php echo $loc["LinkTitle_Home"] . addAccessKey("title", "home"); ?>"><?php echo $loc["Home"]; ?></a></td>
|
||||
<td class="small" align="center"><?php
|
||||
|
||||
// -------------------------------------------------------
|
||||
// ... include a link to 'opensearch.php':
|
||||
?>
|
||||
|
||||
<a href="opensearch.php"<?php echo addAccessKey("attribute", "cql_search"); ?> title="<?php echo $loc["LinkTitle_CQLSearch"] . addAccessKey("title", "cql_search"); ?>"><?php echo $loc["CQLSearch"]; ?></a><?php
|
||||
|
||||
// -------------------------------------------------------
|
||||
if (isset($_SESSION['user_permissions']) AND preg_match("/allow_sql_search/", $_SESSION['user_permissions'])) // if the 'user_permissions' session variable contains 'allow_sql_search'...
|
||||
{
|
||||
// ... include a link to 'sql_search.php':
|
||||
?>
|
||||
|
||||
|
|
||||
<a href="sql_search.php"<?php echo addAccessKey("attribute", "sql_search"); ?> title="<?php echo $loc["LinkTitle_SQLSearch"] . addAccessKey("title", "sql_search"); ?>"><?php echo $loc["SQLSearch"]; ?></a><?php
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
if (!empty($librarySearchPattern))
|
||||
{
|
||||
// ... include a link to 'library_search.php':
|
||||
?>
|
||||
|
||||
|
|
||||
<a href="library_search.php"<?php echo addAccessKey("attribute", "lib_search"); ?> title="<?php echo $loc["LinkTitle_LibrarySearch_Prefix"] . encodeHTML($hostInstitutionName) . $loc["LinkTitle_LibrarySearch_Suffix"] . addAccessKey("title", "lib_search"); ?>"><?php echo $loc["LibrarySearch"]; ?></a><?php
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
if (isset($_SESSION['user_permissions']) AND preg_match("/allow_details_view/", $_SESSION['user_permissions'])) // if the 'user_permissions' session variable contains 'allow_details_view'...
|
||||
{
|
||||
// ... include a link to 'show.php':
|
||||
?>
|
||||
|
||||
|
|
||||
<a href="show.php"<?php echo addAccessKey("attribute", "show_rec"); ?> title="<?php echo $loc["LinkTitle_ShowRecord"] . addAccessKey("title", "show_rec"); ?>"><?php echo $loc["ShowRecord"]; ?></a><?php
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
if (isset($_SESSION['user_permissions']) AND preg_match("/allow_cite/", $_SESSION['user_permissions'])) // if the 'user_permissions' session variable contains 'allow_cite'...
|
||||
{
|
||||
// ... include a link to 'extract.php':
|
||||
?>
|
||||
|
||||
|
|
||||
<a href="extract.php"<?php echo addAccessKey("attribute", "extract"); ?> title="<?php echo $loc["LinkTitle_ExtractCitations"] . addAccessKey("title", "extract"); ?>"><?php echo $loc["ExtractCitations"]; ?></a><?php
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
if (isset($_SESSION['loginEmail']) && ($loginEmail == $adminLoginEmail)) // if the admin is logged in ('$adminLoginEmail' is specified in 'ini.inc.php')...
|
||||
{
|
||||
// ... include a link to 'duplicate_manager.php':
|
||||
?>
|
||||
|
||||
|
|
||||
<a href="duplicate_manager.php" title="<?php echo $loc["LinkTitle_ManageDuplicates"]; ?>"><?php echo $loc["ManageDuplicates"]; ?></a><?php
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
?>
|
||||
|
||||
</td>
|
||||
<td class="small" align="right" width="105"><?php
|
||||
|
||||
if (!empty($helpResourcesURL))
|
||||
{
|
||||
?><a href="<?php echo $helpResourcesURL; ?>" title="<?php echo $loc["LinkTitle_Help"]; ?>"><?php echo $loc["Help"]; ?></a><?php
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
</table><?php
|
||||
}
|
||||
?>
|
||||
212
includes/header.inc.php
Normal file
212
includes/header.inc.php
Normal file
@@ -0,0 +1,212 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/header.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/header.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 28-Jul-02, 11:21
|
||||
// Modified: $Date: 2015-01-08 01:10:31 +0000 (Thu, 08 Jan 2015) $
|
||||
// $Author: karnesky $
|
||||
// $Revision: 1404 $
|
||||
|
||||
// This is the header include file.
|
||||
// It contains functions that provide the HTML header
|
||||
// as well as the visible header that gets displayed on every page.
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Inserts the HTML <head>...</head> block as well as the initial <body> tag:
|
||||
//
|
||||
// TODO: include OpenSearch elements in HTML header
|
||||
// (see examples at <http://www.opensearch.org/Specifications/OpenSearch/1.1#Response_metadata_in_HTML.2FXHTML>)
|
||||
function displayHTMLhead($pageTitle, $metaRobots, $metaDescription, $additionalMeta, $includeJavaScript, $includeJavaScriptFile, $viewType, $rssURLArray)
|
||||
{
|
||||
global $officialDatabaseName; // these variables are defined in 'ini.inc.php'
|
||||
global $contentTypeCharset;
|
||||
global $defaultStyleSheet;
|
||||
global $printStyleSheet;
|
||||
global $mobileStyleSheet;
|
||||
global $useVisualEffects;
|
||||
global $databaseBaseURL;
|
||||
global $databaseKeywords;
|
||||
global $defaultFeedFormat;
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<title><?php echo $pageTitle; ?></title>
|
||||
<meta name="date" content="<?php echo date('d-M-y'); ?>">
|
||||
<meta name="robots" content="<?php echo $metaRobots; ?>">
|
||||
<meta name="description" lang="en" content="<?php echo $metaDescription; ?>">
|
||||
<meta name="keywords" lang="en" content="<?php echo $databaseKeywords; ?>"><?php
|
||||
|
||||
if (!empty($additionalMeta))
|
||||
echo $additionalMeta;
|
||||
?>
|
||||
|
||||
<meta http-equiv="content-language" content="<?php echo getUserLanguage(); ?>">
|
||||
<meta http-equiv="content-type" content="text/html; charset=<?php echo $contentTypeCharset; ?>">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css"><?php
|
||||
|
||||
if (preg_match("/^Print$/i", $viewType))
|
||||
{
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo $printStyleSheet; ?>" type="text/css" title="CSS Definition"><?php
|
||||
}
|
||||
elseif (preg_match("/^Mobile$/i", $viewType))
|
||||
{
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo $mobileStyleSheet; ?>" type="text/css" title="CSS Definition"><?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo $defaultStyleSheet; ?>" type="text/css" title="CSS Definition"><?php
|
||||
}
|
||||
|
||||
if (!empty($rssURLArray) AND isset($_SESSION['user_permissions']) AND preg_match("/allow_rss_feeds/", $_SESSION['user_permissions'])) // if some RSS URLs were specified AND the 'user_permissions' session variable contains 'allow_rss_feeds'...
|
||||
{
|
||||
foreach ($rssURLArray as $rssURL)
|
||||
{
|
||||
if ($defaultFeedFormat == "Atom XML")
|
||||
$feedContentType = "application/atom+xml";
|
||||
else // RSS XML
|
||||
$feedContentType = "application/rss+xml";
|
||||
|
||||
// ...include a link tag pointing to a dynamic RSS feed for the current query:
|
||||
?>
|
||||
|
||||
<link rel="alternate" type="<?php echo $feedContentType; ?>" href="<?php echo $databaseBaseURL . $rssURL['href']; ?>" title="<?php echo $rssURL['title']; ?>"><?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<link rel="unapi-server" type="application/xml" title="unAPI" href="<?php echo $databaseBaseURL; ?>unapi.php">
|
||||
<link rel="search" type="application/opensearchdescription+xml" title="<?php echo encodeHTML($officialDatabaseName); ?>" href="<?php echo $databaseBaseURL; ?>opensearch.php?operation=explain"><?php
|
||||
|
||||
if ($includeJavaScript OR (isset($_SESSION['userAutoCompletions']) AND ($_SESSION['userAutoCompletions'] == "yes")) OR ($useVisualEffects == "yes"))
|
||||
{
|
||||
// ...include common refbase JavaScript functions:
|
||||
?>
|
||||
|
||||
<script language="JavaScript" type="text/javascript" src="javascript/common.js"></script><?php
|
||||
}
|
||||
|
||||
if ((isset($_SESSION['userAutoCompletions']) AND ($_SESSION['userAutoCompletions'] == "yes")) OR ($useVisualEffects == "yes"))
|
||||
{
|
||||
// ...include the Prototype & script.aculo.us JavaScript frameworks:
|
||||
?>
|
||||
|
||||
<script language="JavaScript" type="text/javascript" src="javascript/prototype.js"></script>
|
||||
<script language="JavaScript" type="text/javascript" src="javascript/scriptaculous.js?load=effects,controls"></script><?php
|
||||
}
|
||||
|
||||
if (!empty($includeJavaScriptFile))
|
||||
{
|
||||
// ...include additional JavaScript functions:
|
||||
?>
|
||||
|
||||
<script language="JavaScript" type="text/javascript" src="<?php echo $includeJavaScriptFile; ?>"></script><?php
|
||||
}
|
||||
?>
|
||||
|
||||
</head>
|
||||
<body><?php
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Displays the visible header:
|
||||
function showPageHeader($HeaderString)
|
||||
{
|
||||
global $officialDatabaseName; // these variables are defined in 'ini.inc.php'
|
||||
global $hostInstitutionAbbrevName;
|
||||
global $hostInstitutionName;
|
||||
global $hostInstitutionURL;
|
||||
global $helpResourcesURL;
|
||||
global $logoImageURL;
|
||||
global $logoImageWidth;
|
||||
global $logoImageHeight;
|
||||
|
||||
global $loginWelcomeMsg; // these variables are globally defined in function 'showLogin()' in 'include.inc.php'
|
||||
global $loginStatus;
|
||||
global $loginLinks;
|
||||
|
||||
global $displayType;
|
||||
global $query;
|
||||
global $queryURL;
|
||||
global $showQuery;
|
||||
global $showLinks;
|
||||
global $showRows;
|
||||
|
||||
global $citeStyle;
|
||||
global $citeOrder;
|
||||
|
||||
global $loc; // '$loc' is made globally available in 'core.php'
|
||||
?>
|
||||
|
||||
<table class="pageheader" align="center" border="0" cellpadding="0" cellspacing="10" width="95%" summary="This holds the title logo and info">
|
||||
<tr>
|
||||
<td valign="bottom" rowspan="2" align="left" width="<?php echo $logoImageWidth + 26; ?>"><a href="<?php echo $hostInstitutionURL; ?>"><img src="<?php echo $logoImageURL; ?>" border="0" alt="<?php echo encodeHTML($hostInstitutionAbbrevName); ?> Home" title="<?php echo encodeHTML($hostInstitutionName); ?>" width="<?php echo $logoImageWidth; ?>" height="<?php echo $logoImageHeight; ?>"></a></td>
|
||||
<td>
|
||||
<h2><?php echo encodeHTML($officialDatabaseName); ?></h2>
|
||||
<span class="smallup">
|
||||
<a href="index.php"<?php echo addAccessKey("attribute", "home"); ?> title="<?php echo $loc["LinkTitle_Home"] . addAccessKey("title", "home"); ?>"><?php echo $loc["Home"]; ?></a> |
|
||||
<a href="show.php?records=all"<?php echo addAccessKey("attribute", "show_all"); ?> title="<?php echo $loc["LinkTitle_ShowAll"] . addAccessKey("title", "show_all"); ?>"><?php echo $loc["ShowAll"]; ?></a> |
|
||||
<a href="simple_search.php"<?php echo addAccessKey("attribute", "search"); ?> title="<?php echo $loc["LinkTitle_SimpleSearch"] . addAccessKey("title", "search"); ?>"><?php echo $loc["SimpleSearch"]; ?></a> |
|
||||
<a href="advanced_search.php"<?php echo addAccessKey("attribute", "adv_search"); ?> title="<?php echo $loc["LinkTitle_AdvancedSearch"] . addAccessKey("title", "adv_search"); ?>"><?php echo $loc["AdvancedSearch"]; ?></a><?php
|
||||
|
||||
// -------------------------------------------------------
|
||||
if (isset($_SESSION['user_permissions']) AND preg_match("/allow_add/", $_SESSION['user_permissions'])) // if the 'user_permissions' session variable contains 'allow_add'...
|
||||
{
|
||||
// ... include a link to 'record.php?recordAction=add...':
|
||||
?>
|
||||
|
||||
| <a href="record.php?recordAction=add"<?php echo addAccessKey("attribute", "add"); ?> title="<?php echo $loc["LinkTitle_AddRecord"] . addAccessKey("title", "add"); ?>"><?php echo $loc["AddRecord"]; ?></a><?php
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
if (isset($_SESSION['user_permissions']) AND preg_match("/allow_import|allow_batch_import/", $_SESSION['user_permissions'])) // if the 'user_permissions' session variable contains either 'allow_import' or 'allow_batch_import'...
|
||||
{
|
||||
// ... include a link to 'import.php':
|
||||
?>
|
||||
|
||||
| <a href="import.php"<?php echo addAccessKey("attribute", "import"); ?> title="<?php echo $loc["LinkTitle_Import"] . addAccessKey("title", "import"); ?>"><?php echo $loc["Import"]; ?></a><?php
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
?>
|
||||
|
||||
</span>
|
||||
</td>
|
||||
<td class="small" valign="bottom" rowspan="2" align="right">
|
||||
<div id="loginInfo">
|
||||
<div id="loginStatus"><?php echo $loginStatus; ?></div>
|
||||
<div id="loginName"><?php echo $loginWelcomeMsg; ?></div>
|
||||
<div id="loginLinks"><?php echo $loginLinks; ?></div>
|
||||
</div>
|
||||
<div id="queryrefs">
|
||||
<?php echo buildQuickSearchElements($query, $queryURL, $showQuery, $showLinks, $showRows, $citeStyle, $citeOrder, $displayType); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo encodeHTML($HeaderString); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr class="pageheader" align="center" width="95%"><?php
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
?>
|
||||
3938
includes/import.inc.php
Normal file
3938
includes/import.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
6577
includes/include.inc.php
Normal file
6577
includes/include.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
191
includes/install.inc.php
Normal file
191
includes/install.inc.php
Normal file
@@ -0,0 +1,191 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/install.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/install.inc.php $
|
||||
// Author(s): Richard Karnesky <mailto:karnesky@gmail.com> and
|
||||
// Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 16-Aug-06, 18:00
|
||||
// Modified: $Date: 2017-04-13 02:00:18 +0000 (Thu, 13 Apr 2017) $
|
||||
// $Author: karnesky $
|
||||
// $Revision: 1416 $
|
||||
|
||||
// This file contains functions
|
||||
// that are used when installing
|
||||
// or updating a refbase database.
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// This function attempts to find a file (or program) on disk. It searches directories
|
||||
// given in '$fileLocations' for existing file/program names given in '$fileNames'.
|
||||
// Note that, currently, this function won't look into subdirectories.
|
||||
//
|
||||
// Authors: Richard Karnesky <mailto:karnesky@gmail.com> and
|
||||
// Matthias Steffens <mailto:refbase@extracts.de>
|
||||
function locateFile($fileLocations, $fileNames, $returnParentDirOnly)
|
||||
{
|
||||
$filePath = "";
|
||||
|
||||
foreach ($fileLocations as $location)
|
||||
{
|
||||
foreach ($fileNames as $name)
|
||||
{
|
||||
if (file_exists("$location/$name"))
|
||||
{
|
||||
if ($returnParentDirOnly)
|
||||
$filePath = realpath($location) . "/";
|
||||
else
|
||||
$filePath = realpath("$location/$name");
|
||||
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $filePath;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Connect to the MySQL database with admin permissions:
|
||||
// TODO: I18n
|
||||
function connectToMySQLDatabaseAsAdmin($adminUserName, $adminPassword)
|
||||
{
|
||||
global $hostName; // these variables are specified in 'db.inc.php'
|
||||
global $databaseName;
|
||||
|
||||
global $connection;
|
||||
|
||||
// Establish a *new* connection that has admin permissions
|
||||
// (1) OPEN the database connection:
|
||||
if (!($connection = @ mysqli_connect($hostName, $adminUserName, $adminPassword, $databaseName)))
|
||||
if (mysqli_errno($connection) != 0) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-(
|
||||
showErrorMsg("The following error occurred while trying to connect to the host:", "");
|
||||
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Check for the presence of a value in a table,
|
||||
// and if it doesn't exist, add the given row to that same table:
|
||||
//
|
||||
// Authors: Richard Karnesky <mailto:karnesky@gmail.com> and
|
||||
// Matthias Steffens <mailto:refbase@extracts.de>
|
||||
function insertIfNotExists($keysArray, $table, $values, $userID = "")
|
||||
{
|
||||
global $connection;
|
||||
|
||||
$selectClauseArray = array();
|
||||
$whereClauseArray = array();
|
||||
|
||||
foreach ($keysArray as $keyColumn => $keyValue)
|
||||
{
|
||||
$selectClauseArray[] = $keyColumn;
|
||||
$whereClauseArray[] = $keyColumn . " = " . quote_smart($keyValue);
|
||||
}
|
||||
|
||||
$query = "SELECT " . implode(", ", $selectClauseArray)
|
||||
. " FROM " . $table
|
||||
. " WHERE " . implode(" AND ", $whereClauseArray);
|
||||
|
||||
if ($userID != "") // note that 'if (!empty($userID))' doesn't work here since '$userID = 0' would incorrectly be treated as 'empty'
|
||||
$query .= " AND user_id = " . $userID;
|
||||
|
||||
$result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php'
|
||||
|
||||
$rowsFound = @ mysqli_num_rows($result);
|
||||
if ($rowsFound == 0)
|
||||
{
|
||||
$query = "INSERT INTO " . $table . " VALUES " . $values;
|
||||
$result = queryMySQLDatabase($query);
|
||||
|
||||
return "true";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Check for the presence of a column in a table,
|
||||
// and if it doesn't exist, add the given column to that same table:
|
||||
//
|
||||
// Author: Richard Karnesky <mailto:karnesky@gmail.com>
|
||||
function addColumnIfNotExists($column, $table, $properties)
|
||||
{
|
||||
global $connection;
|
||||
|
||||
$present = false;
|
||||
|
||||
$queryFields = "SHOW FIELDS FROM " . $table;
|
||||
$result = queryMySQLDatabase($queryFields); // function 'queryMySQLDatabase()' is defined in 'include.inc.php'
|
||||
|
||||
while ($row = @ mysqli_fetch_array($result)) // for all fields found, check if any of their names matches the field name that we want to add
|
||||
if ($row["Field"] == $column)
|
||||
$present = true;
|
||||
|
||||
if (!$present)
|
||||
{
|
||||
$query = "ALTER TABLE " . $table . " ADD COLUMN " . $column . " " . $properties;
|
||||
$result = queryMySQLDatabase($query);
|
||||
|
||||
return "true";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Check for the presence of a table in the currently selected database,
|
||||
// and if it doesn't exist, add the given table to that same database:
|
||||
// This is similar to "CREATE TABLE IF NOT EXISTS ..." but allows us
|
||||
// to return appropriate feedback
|
||||
function addTableIfNotExists($table, $properties)
|
||||
{
|
||||
global $connection;
|
||||
|
||||
$present = false;
|
||||
|
||||
$queryFields = "SHOW TABLES";
|
||||
$result = queryMySQLDatabase($queryFields); // function 'queryMySQLDatabase()' is defined in 'include.inc.php'
|
||||
|
||||
while ($row = @ mysqli_fetch_array($result)) // for all tables found, check if any of their names matches the table name that we want to add
|
||||
if ($row[0] == $table)
|
||||
$present = true;
|
||||
|
||||
if (!$present)
|
||||
{
|
||||
$query = "CREATE TABLE " . $table . " " . $properties;
|
||||
$result = queryMySQLDatabase($query);
|
||||
|
||||
return "true";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Show error in red:
|
||||
function fieldError($fieldName, $errors)
|
||||
{
|
||||
if (isset($errors[$fieldName]))
|
||||
echo returnMsg($errors[$fieldName], "warning", "strong", "", "\n\t\t\t", "\n\t\t\t<br>"); // function 'returnMsg()' is defined in 'include.inc.php'
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
?>
|
||||
27
includes/locales.inc.php
Normal file
27
includes/locales.inc.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/locales.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/locales.inc.php $
|
||||
// Author(s): Jochen Wendebaum <mailto:wendebaum@users.sourceforge.net>
|
||||
//
|
||||
// Created: 12-Oct-04, 12:00
|
||||
// Modified: $Date: 2008-09-29 21:51:06 +0000 (Mon, 29 Sep 2008) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1252 $
|
||||
|
||||
// This is the locales include file.
|
||||
// It will read the locales depending on the personal settings of the currently
|
||||
// logged in user or the default language, if no personal information can be found.
|
||||
|
||||
|
||||
$locale = getUserLanguage(); // function 'getUserLanguage()' is defined in 'include.inc.php'
|
||||
|
||||
include 'locales/core.php'; // include the locales
|
||||
?>
|
||||
987
includes/modsxml.inc.php
Normal file
987
includes/modsxml.inc.php
Normal file
@@ -0,0 +1,987 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/modsxml.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/modsxml.inc.php $
|
||||
// Author(s): Richard Karnesky <mailto:karnesky@gmail.com>
|
||||
//
|
||||
// Created: 02-Oct-04, 12:00
|
||||
// Modified: $Date: 2017-04-13 02:00:18 +0000 (Thu, 13 Apr 2017) $
|
||||
// $Author: karnesky $
|
||||
// $Revision: 1416 $
|
||||
|
||||
// This include file contains functions that'll export records to MODS XML.
|
||||
// Requires ActiveLink PHP XML Package, which is available under the GPL from:
|
||||
// <http://www.active-link.com/software/>
|
||||
|
||||
|
||||
// Incorporate some include files:
|
||||
include_once 'includes/transtab_refbase_unicode.inc.php'; // include refbase markup -> Unicode search & replace patterns
|
||||
|
||||
// Import the ActiveLink Packages
|
||||
require_once("classes/include.php");
|
||||
import("org.active-link.xml.XML");
|
||||
import("org.active-link.xml.XMLDocument");
|
||||
|
||||
|
||||
// For more on MODS, see:
|
||||
// <http://www.loc.gov/standards/mods/>
|
||||
// <http://www.scripps.edu/~cdputnam/software/bibutils/>
|
||||
|
||||
// TODO:
|
||||
// Stuff in '// NOTE' comments
|
||||
// There's a lot of overlap in the portions that depend on types. I plan
|
||||
// on refactoring this, so that they can make calls to the same function.
|
||||
|
||||
// I don't know what to do with some fields
|
||||
// See <http://www.loc.gov/standards/mods/v3/mods-3-0-outline.html>
|
||||
// - Require clever parsing
|
||||
// - address (?name->affiliation?)
|
||||
// - medium (?typeOfResource?)
|
||||
// - Don't know how refbase users use these
|
||||
// - area (could be either topic or geographic, so we do nothing)
|
||||
// - expedition
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Generates relatedItem branch for series
|
||||
function serialBranch($series_editor, $series_title, $abbrev_series_title,
|
||||
$series_volume, $series_issue) {
|
||||
// defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
|
||||
global $alnum, $alpha, $cntrl, $dash, $digit, $graph, $lower, $print, $punct,
|
||||
$space, $upper, $word, $patternModifiers;
|
||||
|
||||
$series = new XMLBranch("relatedItem");
|
||||
$series->setTagAttribute("type", "series");
|
||||
|
||||
// title
|
||||
if (!empty($series_title))
|
||||
$series->setTagContent(encodeXMLField('series_title', $series_title), "relatedItem/titleInfo/title");
|
||||
|
||||
// abbrev. title
|
||||
if (!empty($abbrev_series_title)) {
|
||||
$titleabbrev = NEW XMLBranch("titleInfo");
|
||||
$titleabbrev->setTagAttribute("type", "abbreviated");
|
||||
$titleabbrev->setTagContent(encodeXMLField('abbrev_series_title', $abbrev_series_title), "titleInfo/title");
|
||||
$series->addXMLBranch($titleabbrev);
|
||||
}
|
||||
|
||||
// editor
|
||||
if (!empty($series_editor)) {
|
||||
if (preg_match("/ *\(eds?\)$/", $series_editor))
|
||||
$series_editor = preg_replace("/[ \r\n]*\(eds?\)/i", "", $series_editor);
|
||||
$nameArray = separateNames("series_editor", "/\s*;\s*/", "/\s*,\s*/",
|
||||
"/(?<=^|[$word])[^-$word]+|(?<=^|[$upper])(?=$|[$upper])/$patternModifiers",
|
||||
$series_editor, "personal", "editor");
|
||||
foreach ($nameArray as $singleName)
|
||||
$series->addXMLBranch($singleName);
|
||||
}
|
||||
|
||||
// volume, issue
|
||||
if ((!empty($series_volume)) || (!empty($series_issue))) {
|
||||
$part = new XMLBranch("part");
|
||||
if (!empty($series_volume)) {
|
||||
$detailvolume = new XMLBranch("detail");
|
||||
$detailvolume->setTagContent(encodeXMLField('series_volume', $series_volume), "detail/number");
|
||||
$detailvolume->setTagAttribute("type", "volume");
|
||||
$part->addXMLBranch($detailvolume);
|
||||
}
|
||||
if (!empty($series_issue)) {
|
||||
$detailnumber = new XMLBranch("detail");
|
||||
$detailnumber->setTagContent(encodeXMLField('series_issue', $series_issue), "detail/number");
|
||||
$detailnumber->setTagAttribute("type", "issue");
|
||||
$part->addXMLBranch($detailnumber);
|
||||
}
|
||||
$series->addXMLBranch($part);
|
||||
}
|
||||
|
||||
return $series;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Separates people's names and then those names into their functional parts:
|
||||
// {{Family1,{Given1-1,Given1-2}},{Family2,{Given2}}})
|
||||
// Adds these to an array of XMLBranches.
|
||||
function separateNames($rowFieldName, $betweenNamesDelim, $nameGivenDelim,
|
||||
$betweenGivensDelim, $names, $type, $role) {
|
||||
// defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
|
||||
global $alnum, $alpha, $cntrl, $dash, $digit, $graph, $lower, $print, $punct,
|
||||
$space, $upper, $word, $patternModifiers;
|
||||
|
||||
$nameArray = array();
|
||||
$nameArray = preg_split($betweenNamesDelim, $names); // get a list of all authors
|
||||
foreach ($nameArray as $singleName){
|
||||
$nameBranch = new XMLBranch("name");
|
||||
$nameBranch->setTagAttribute("type", $type);
|
||||
|
||||
if (preg_match($nameGivenDelim, $singleName))
|
||||
list($singleNameFamily, $singleNameGivens) = preg_split($nameGivenDelim,
|
||||
$singleName);
|
||||
else {
|
||||
$singleNameFamily = $singleName;
|
||||
$singleNameGivens = "";
|
||||
}
|
||||
|
||||
$nameFamilyBranch = new XMLBranch("namePart");
|
||||
$nameFamilyBranch->setTagAttribute("type", "family");
|
||||
$nameFamilyBranch->setTagContent(encodeXMLField($rowFieldName, $singleNameFamily));
|
||||
$nameBranch->addXMLBranch($nameFamilyBranch);
|
||||
|
||||
if (!empty($singleNameGivens)) {
|
||||
// before splitting given names into their parts, we remove any non-word chars
|
||||
// between initials/forenames that are connected with a hyphen (which ensures
|
||||
// that they are kept together and that the hyphen is maintained):
|
||||
$singleNameGivens = preg_replace("/(?<=[$word])[^-$word]*([$dash])[^-$word]*(?=[$upper])/$patternModifiers",
|
||||
"\\1", $singleNameGivens);
|
||||
$singleNameGivenArray = preg_split($betweenGivensDelim, $singleNameGivens,
|
||||
-1, PREG_SPLIT_NO_EMPTY);
|
||||
foreach ($singleNameGivenArray as $singleNameGiven) {
|
||||
$nameGivenBranch = new XMLBranch("namePart");
|
||||
$nameGivenBranch->setTagAttribute("type", "given");
|
||||
$nameGivenBranch->setTagContent(encodeXMLField($rowFieldName, $singleNameGiven));
|
||||
$nameBranch->addXMLBranch($nameGivenBranch);
|
||||
}
|
||||
}
|
||||
|
||||
$nameBranch->setTagContent(encodeXMLField('name_role', $role), "name/role/roleTerm");
|
||||
$nameBranch->setTagAttribute("authority", "marcrelator",
|
||||
"name/role/roleTerm");
|
||||
$nameBranch->setTagAttribute("type", "text", "name/role/roleTerm");
|
||||
|
||||
array_push($nameArray, $nameBranch);
|
||||
}
|
||||
return $nameArray;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
function modsCollection($result) {
|
||||
|
||||
global $contentTypeCharset; // these variables are defined in 'ini.inc.php'
|
||||
global $convertExportDataToUTF8;
|
||||
|
||||
global $citeKeysArray; // '$citeKeysArray' is made globally available from
|
||||
// within this function
|
||||
|
||||
// The array '$transtab_refbase_unicode' contains search & replace patterns
|
||||
// for conversion from refbase markup to Unicode entities.
|
||||
global $transtab_refbase_unicode; // defined in 'transtab_refbase_unicode.inc.php'
|
||||
|
||||
global $fieldSpecificSearchReplaceActionsArray;
|
||||
|
||||
// Individual records are objects and collections of records are strings
|
||||
|
||||
$exportArray = array(); // array for individually exported records
|
||||
$citeKeysArray = array(); // array of cite keys (used to ensure uniqueness of
|
||||
// cite keys among all exported records)
|
||||
|
||||
// Defines field-specific search & replace 'actions' that will be applied to all
|
||||
// those refbase fields that are listed in the corresponding 'fields' element:
|
||||
// (If you don't want to perform any search and replace actions, specify an empty
|
||||
// array, like: '$fieldSpecificSearchReplaceActionsArray = array();'.
|
||||
// Note that the search patterns MUST include the leading & trailing slashes --
|
||||
// which is done to allow for mode modifiers such as 'imsxU'.)
|
||||
$fieldSpecificSearchReplaceActionsArray = array();
|
||||
|
||||
if ($convertExportDataToUTF8 == "yes")
|
||||
$fieldSpecificSearchReplaceActionsArray[] = array(
|
||||
'fields' => array("title", "publication", "abbrev_journal", "address", "keywords", "abstract", "orig_title", "series_title", "abbrev_series_title", "notes"),
|
||||
'actions' => $transtab_refbase_unicode
|
||||
);
|
||||
|
||||
// Generate the export for each record and push them onto an array:
|
||||
while ($row = @ mysqli_fetch_array($result)) {
|
||||
// Export the current record as MODS XML
|
||||
$record = modsRecord($row);
|
||||
|
||||
if (!empty($record)) // unless the record buffer is empty...
|
||||
array_push($exportArray, $record); // ...add it to an array of exports
|
||||
}
|
||||
|
||||
$modsCollectionDoc = new XMLDocument();
|
||||
|
||||
if (($convertExportDataToUTF8 == "yes") AND ($contentTypeCharset != "UTF-8"))
|
||||
$modsCollectionDoc->setEncoding("UTF-8");
|
||||
else
|
||||
$modsCollectionDoc->setEncoding($contentTypeCharset);
|
||||
|
||||
$modsCollection = new XML("modsCollection");
|
||||
$modsCollection->setTagAttribute("xmlns", "http://www.loc.gov/mods/v3");
|
||||
foreach ($exportArray as $mods)
|
||||
$modsCollection->addXMLasBranch($mods);
|
||||
|
||||
$modsCollectionDoc->setXML($modsCollection);
|
||||
$modsCollectionString = $modsCollectionDoc->getXMLString();
|
||||
|
||||
return $modsCollectionString;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Returns an XML object (mods) of a single record
|
||||
function modsRecord($row) {
|
||||
|
||||
global $databaseBaseURL; // these variables are defined in 'ini.inc.php'
|
||||
global $contentTypeCharset;
|
||||
global $fileVisibility;
|
||||
global $fileVisibilityException;
|
||||
global $filesBaseURL;
|
||||
global $convertExportDataToUTF8;
|
||||
|
||||
// defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
|
||||
global $alnum, $alpha, $cntrl, $dash, $digit, $graph, $lower, $print, $punct,
|
||||
$space, $upper, $word, $patternModifiers;
|
||||
|
||||
$exportPrivate = True; // This will be a global variable or will be used
|
||||
// when modsRow is called and will determine if we
|
||||
// export user-specific data
|
||||
|
||||
$exportRecordURL = True; // Specifies whether an attribution string containing
|
||||
// the URL to the refbase database record (and the last
|
||||
// modification date) shall be written to the notes branch.
|
||||
// Note that this string is required by the "-A|--append"
|
||||
// feature of the 'refbase' command line client
|
||||
|
||||
// convert this record's modified date/time info to UNIX time stamp format:
|
||||
// => "date('D, j M Y H:i:s O')", e.g. "Sat, 15 Jul 2006 22:24:16 +0200"
|
||||
// function 'generateRFC2822TimeStamp()' is defined in 'include.inc.php'
|
||||
$currentDateTimeStamp = generateRFC2822TimeStamp($row['modified_date'], $row['modified_time']);
|
||||
|
||||
// --- BEGIN TYPE * ---
|
||||
// |
|
||||
// | These apply to everything
|
||||
|
||||
// this is a stupid hack that maps the names of the '$row' array keys to those used
|
||||
// by the '$formVars' array (which is required by function 'generateCiteKey()')
|
||||
// (eventually, the '$formVars' array should use the MySQL field names as names for its array keys)
|
||||
$formVars = buildFormVarsArray($row); // function 'buildFormVarsArray()' is defined in 'include.inc.php'
|
||||
|
||||
// generate or extract the cite key for this record
|
||||
// (note that charset conversion can only be done *after* the cite key has been generated,
|
||||
// otherwise cite key generation will produce garbled text!)
|
||||
$citeKey = generateCiteKey($formVars); // function 'generateCiteKey()' is defined in 'include.inc.php'
|
||||
|
||||
// Create an XML object for a single record.
|
||||
$record = new XML("mods");
|
||||
$record->setTagAttribute("version", "3.2");
|
||||
if (!empty($citeKey))
|
||||
$record->setTagAttribute("ID", $citeKey);
|
||||
|
||||
// titleInfo
|
||||
// Regular Title
|
||||
if (!empty($row['title']))
|
||||
$record->setTagContent(encodeXMLField('title', $row['title']), "mods/titleInfo/title");
|
||||
|
||||
// Translated Title
|
||||
// NOTE: This field is excluded by the default cite SELECT method
|
||||
if (!empty($row['orig_title'])) {
|
||||
$orig_title = new XMLBranch("titleInfo");
|
||||
$orig_title->setTagAttribute("type", "translated");
|
||||
$orig_title->setTagContent(encodeXMLField('orig_title', $row['orig_title']), "titleInfo/title");
|
||||
$record->addXMLBranch($orig_title);
|
||||
}
|
||||
|
||||
// name
|
||||
// author
|
||||
if (!empty($row['author'])) {
|
||||
if (preg_match("/ *\(eds?\)$/", $row['author'])) {
|
||||
$author = preg_replace("/[ \r\n]*\(eds?\)/i", "", $row['author']);
|
||||
$nameArray = separateNames("author", "/\s*;\s*/", "/\s*,\s*/",
|
||||
"/(?<=^|[$word])[^-$word]+|(?<=^|[$upper])(?=$|[$upper])/$patternModifiers",
|
||||
$author, "personal", "editor");
|
||||
}
|
||||
else if ($row['type'] == "Map") {
|
||||
$nameArray = separateNames("author", "/\s*;\s*/", "/\s*,\s*/",
|
||||
"/(?<=^|[$word])[^-$word]+|(?<=^|[$upper])(?=$|[$upper])/$patternModifiers",
|
||||
$row['author'], "personal", "cartographer");
|
||||
}
|
||||
else {
|
||||
$nameArray = separateNames("author", "/\s*;\s*/", "/\s*,\s*/",
|
||||
"/(?<=^|[$word])[^-$word]+|(?<=^|[$upper])(?=$|[$upper])/$patternModifiers",
|
||||
$row['author'], "personal", "author");
|
||||
}
|
||||
foreach ($nameArray as $singleName) {
|
||||
$record->addXMLBranch($singleName);
|
||||
}
|
||||
}
|
||||
|
||||
// originInfo
|
||||
if ((!empty($row['year'])) || (!empty($row['publisher'])) ||
|
||||
(!empty($row['place']))) {
|
||||
$origin = new XMLBranch("originInfo");
|
||||
|
||||
// dateIssued
|
||||
if (!empty($row['year']))
|
||||
$origin->setTagContent(encodeXMLField('year', $row['year']), "originInfo/dateIssued");
|
||||
|
||||
// Book Chapters and Journal Articles only have a dateIssued
|
||||
// (editions, places, and publishers are associated with the host)
|
||||
if (!preg_match("/^(Book Chapter|Journal Article)$/", $row['type'])) {
|
||||
// publisher
|
||||
if (!empty($row['publisher']))
|
||||
$origin->setTagContent(encodeXMLField('publisher', $row['publisher']), "originInfo/publisher");
|
||||
// place
|
||||
if (!empty($row['place'])) {
|
||||
$origin->setTagContent(encodeXMLField('place', $row['place']), "originInfo/place/placeTerm");
|
||||
$origin->setTagAttribute("type", "text",
|
||||
"originInfo/place/placeTerm");
|
||||
}
|
||||
// edition
|
||||
if (!empty($row['edition']))
|
||||
$origin->setTagContent(encodeXMLField('edition', $row['edition']), "originInfo/edition");
|
||||
}
|
||||
|
||||
if ($origin->hasBranch())
|
||||
$record->addXMLBranch($origin);
|
||||
}
|
||||
|
||||
// language
|
||||
if (!empty($row['language']))
|
||||
$record->setTagContent(encodeXMLField('language', $row['language']), "mods/language");
|
||||
|
||||
// abstract
|
||||
// NOTE: This field is excluded by the default cite SELECT method
|
||||
if (!empty($row['abstract'])) {
|
||||
$abstract = new XMLBranch("abstract");
|
||||
$abstract->setTagContent(encodeXMLField('abstract', $row['abstract']));
|
||||
if (!empty($row['summary_language'])) {
|
||||
$abstract->setTagAttribute("lang", encodeXMLField('summary_language', $row['summary_language']));
|
||||
}
|
||||
$record->addXMLBranch($abstract);
|
||||
}
|
||||
|
||||
// subject
|
||||
// keywords
|
||||
if (!empty($row['keywords'])) {
|
||||
$subjectArray = array();
|
||||
$subjectArray = preg_split("/\s*;\s*/", $row['keywords']); // "unrelated" keywords
|
||||
foreach ($subjectArray as $singleSubject) {
|
||||
$subjectBranch = new XMLBranch("subject");
|
||||
|
||||
$topicArray = array();
|
||||
$topicArray = preg_split("/\s*,\s*/", $singleSubject); // "related" keywords
|
||||
foreach ($topicArray as $singleTopic) {
|
||||
$topicBranch = new XMLBranch("topic");
|
||||
$topicBranch->setTagContent(encodeXMLField('keywords', $singleTopic));
|
||||
|
||||
$subjectBranch->addXMLBranch($topicBranch);
|
||||
}
|
||||
$record->addXMLBranch($subjectBranch);
|
||||
}
|
||||
}
|
||||
// user_keys
|
||||
// NOTE: a copy of the above. Needs to be a separate function later.
|
||||
if ((!empty($row['user_keys'])) && $exportPrivate) {
|
||||
$subjectArray = array();
|
||||
$subjectArray = preg_split("/\s*;\s*/", $row['user_keys']); // "unrelated" user_keys
|
||||
foreach ($subjectArray as $singleSubject) {
|
||||
$subjectBranch = new XMLBranch("subject");
|
||||
|
||||
$topicArray = array();
|
||||
$topicArray = preg_split("/\s*,\s*/", $singleSubject); // "related" user_keys
|
||||
foreach ($topicArray as $singleTopic) {
|
||||
$topicBranch = new XMLBranch("topic");
|
||||
$topicBranch->setTagContent(encodeXMLField('user_keys', $singleTopic));
|
||||
|
||||
$subjectBranch->addXMLBranch($topicBranch);
|
||||
}
|
||||
$record->addXMLBranch($subjectBranch);
|
||||
}
|
||||
}
|
||||
// user_groups
|
||||
// NOTE: a copy of the above. Needs to be a separate function later.
|
||||
if ((!empty($row['user_groups'])) && $exportPrivate) {
|
||||
$subjectArray = array();
|
||||
$subjectArray = preg_split("/\s*;\s*/", $row['user_groups']); // "unrelated" user_groups
|
||||
foreach ($subjectArray as $singleSubject) {
|
||||
$subjectBranch = new XMLBranch("subject");
|
||||
|
||||
$topicArray = array();
|
||||
$topicArray = preg_split("/\s*,\s*/", $singleSubject); // "related" user_groups
|
||||
foreach ($topicArray as $singleTopic) {
|
||||
$topicBranch = new XMLBranch("topic");
|
||||
$topicBranch->setTagContent(encodeXMLField('user_groups', $singleTopic));
|
||||
|
||||
$subjectBranch->addXMLBranch($topicBranch);
|
||||
}
|
||||
$record->addXMLBranch($subjectBranch);
|
||||
}
|
||||
}
|
||||
|
||||
// notes
|
||||
if (!empty($row['notes']))
|
||||
$record->setTagContent(encodeXMLField('notes', $row['notes']), "mods/note");
|
||||
// user_notes
|
||||
if ((!empty($row['user_notes'])) && $exportPrivate) // replaces any generic notes
|
||||
$record->setTagContent(encodeXMLField('user_notes', $row['user_notes']), "mods/note");
|
||||
// refbase attribution string
|
||||
if ($exportRecordURL) {
|
||||
$attributionBranch = new XMLBranch("note");
|
||||
$attributionBranch->setTagContent("exported from refbase ("
|
||||
. $databaseBaseURL . "show.php?record=" . $row['serial']
|
||||
. "), last updated on " . $currentDateTimeStamp);
|
||||
$record->addXMLBranch($attributionBranch);
|
||||
}
|
||||
|
||||
// typeOfResource
|
||||
// maps are 'cartographic', software is 'software, multimedia',
|
||||
// and everything else is 'text'
|
||||
$type = new XMLBranch("typeOfResource");
|
||||
if ($row['type'] == "Map") {
|
||||
$type->setTagContent("cartographic");
|
||||
}
|
||||
else if ($row['type'] == "Software") {
|
||||
$type->setTagContent("software, multimedia");
|
||||
}
|
||||
else {
|
||||
$type->setTagContent("text");
|
||||
}
|
||||
if ($row['type'] == "Manuscript") {
|
||||
$type->setTagAttribute("manuscript", "yes");
|
||||
}
|
||||
$record->addXMLBranch($type);
|
||||
|
||||
// location
|
||||
// Physical Location
|
||||
// NOTE: This field is excluded by the default cite SELECT method
|
||||
// This should also be parsed later
|
||||
if (!empty($row['location'])) {
|
||||
$location = new XMLBranch("location");
|
||||
$locationArray = array();
|
||||
$locationArray = preg_split("/\s*;\s*/", $row['location']);
|
||||
foreach ($locationArray as $singleLocation) {
|
||||
$locationBranch = new XMLBranch("physicalLocation");
|
||||
$locationBranch->setTagContent(encodeXMLField('location', $singleLocation));
|
||||
$location->addXMLBranch($locationBranch);
|
||||
}
|
||||
$record->addXMLBranch($location);
|
||||
}
|
||||
// URL (also an identifier, see below)
|
||||
// NOTE: This field is excluded by the default cite SELECT method
|
||||
if (!empty($row['url'])) {
|
||||
$location = new XMLBranch("location");
|
||||
$location->setTagContent(encodeXMLField('url', $row['url']), "location/url");
|
||||
$record->addXMLBranch($location);
|
||||
}
|
||||
// Include a link to any corresponding FILE if one of the following conditions is met:
|
||||
// - the variable '$fileVisibility' (defined in 'ini.inc.php') is set to 'everyone'
|
||||
// - the variable '$fileVisibility' is set to 'login' AND the user is logged in
|
||||
// - the variable '$fileVisibility' is set to 'user-specific' AND the 'user_permissions' session variable contains 'allow_download'
|
||||
// - the array variable '$fileVisibilityException' (defined in 'ini.inc.php') contains a pattern (in array element 1) that matches the contents of the field given (in array element 0)
|
||||
if ($fileVisibility == "everyone" OR ($fileVisibility == "login" AND isset($_SESSION['loginEmail'])) OR ($fileVisibility == "user-specific" AND (isset($_SESSION['user_permissions']) AND preg_match("/allow_download/", $_SESSION['user_permissions']))) OR (!empty($fileVisibilityException) AND preg_match($fileVisibilityException[1], $row[$fileVisibilityException[0]])))
|
||||
{
|
||||
// file
|
||||
// Note that when converting MODS to Endnote or RIS, Bibutils will include the above
|
||||
// URL (if given), otherwise it'll take the URL from the 'file' field. I.e. for
|
||||
// Endnote or RIS, the URL to the PDF is only included if no regular URL is available.
|
||||
if (!empty($row['file'])) {
|
||||
$location = new XMLBranch("location");
|
||||
|
||||
if (preg_match('#^(https?|ftp|file)://#i', $row['file'])) { // if the 'file' field contains a full URL (starting with "http://", "https://", "ftp://", or "file://")
|
||||
$URLprefix = ""; // we don't alter the URL given in the 'file' field
|
||||
}
|
||||
else { // if the 'file' field contains only a partial path (like 'polarbiol/10240001.pdf') or just a file name (like '10240001.pdf')
|
||||
// use the base URL of the standard files directory as prefix:
|
||||
if (preg_match('#^/#', $filesBaseURL)) // absolute path -> file dir is located outside of refbase root dir
|
||||
$URLprefix = 'http://' . $_SERVER['HTTP_HOST'] . $filesBaseURL;
|
||||
else // relative path -> file dir is located within refbase root dir
|
||||
$URLprefix = $databaseBaseURL . $filesBaseURL;
|
||||
}
|
||||
|
||||
$location->setTagContent(encodeXMLField('file', $URLprefix . $row['file']), "location/url");
|
||||
$location->setTagAttribute("displayLabel", "Electronic full text", "location/url");
|
||||
// the 'access' attribute requires MODS v3.2 or greater:
|
||||
$location->setTagAttribute("access", "raw object", "location/url");
|
||||
$record->addXMLBranch($location);
|
||||
}
|
||||
}
|
||||
|
||||
// identifier
|
||||
// url
|
||||
if (!empty($row['url'])) {
|
||||
$identifier = new XMLBranch("identifier");
|
||||
$identifier->setTagContent(encodeXMLField('url', $row['url']));
|
||||
$identifier->setTagAttribute("type", "uri");
|
||||
$record->addXMLBranch($identifier);
|
||||
}
|
||||
// doi
|
||||
if (!empty($row['doi'])) {
|
||||
$identifier = new XMLBranch("identifier");
|
||||
$identifier->setTagContent(encodeXMLField('doi', $row['doi']));
|
||||
$identifier->setTagAttribute("type", "doi");
|
||||
$record->addXMLBranch($identifier);
|
||||
}
|
||||
// pubmed
|
||||
// NOTE: Until refbase stores PubMed & arXiv IDs in a better way,
|
||||
// we extract them from the 'notes' field
|
||||
if (preg_match("/PMID *: *\d+/i", $row['notes'])) {
|
||||
$identifier = new XMLBranch("identifier");
|
||||
$identifier->setTagContent(preg_replace("/.*?PMID *: *(\d+).*/i", "\\1", $row['notes']));
|
||||
$identifier->setTagAttribute("type", "pubmed");
|
||||
$record->addXMLBranch($identifier);
|
||||
}
|
||||
// arxiv
|
||||
// NOTE: see note for pubmed
|
||||
if (preg_match("/arXiv *: *[^ ;]+/i", $row['notes'])) {
|
||||
$identifier = new XMLBranch("identifier");
|
||||
$identifier->setTagContent(preg_replace("/.*?arXiv *: *([^ ;]+).*/i", "\\1", $row['notes']));
|
||||
$identifier->setTagAttribute("type", "arxiv");
|
||||
$record->addXMLBranch($identifier);
|
||||
}
|
||||
// cite_key
|
||||
if (!empty($citeKey)) {
|
||||
$identifier = new XMLBranch("identifier");
|
||||
$identifier->setTagContent(encodeXMLField('cite_key', $citeKey));
|
||||
$identifier->setTagAttribute("type", "citekey");
|
||||
$record->addXMLBranch($identifier);
|
||||
}
|
||||
// local--CALL NUMBER
|
||||
// NOTE: This should really be parsed!
|
||||
if (!empty($row['call_number'])) {
|
||||
$identifierArray = array();
|
||||
$identifierArray = preg_split("/\s*;\s*/", $row['call_number']);
|
||||
foreach ($identifierArray as $singleIdentifier) {
|
||||
if (!preg_match("/@\s*$/", $singleIdentifier)) {
|
||||
$identifierBranch = new XMLBranch("identifier");
|
||||
$identifierBranch->setTagContent(encodeXMLField('call_number', $singleIdentifier));
|
||||
$identifierBranch->setTagAttribute("type", "local");
|
||||
$record->addXMLBranch($identifierBranch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- END TYPE * ---
|
||||
|
||||
// -----------------------------------------
|
||||
|
||||
// --- BEGIN TYPE != ABSTRACT || BOOK CHAPTER || CONFERENCE ARTICLE || JOURNAL ARTICLE || MAGAZINE ARTICLE || NEWSPAPER ARTICLE ---
|
||||
// |
|
||||
// | BOOK WHOLE, CONFERENCE VOLUME, JOURNAL, MANUAL, MANUSCRIPT, MAP, MISCELLANEOUS, PATENT,
|
||||
// | REPORT, and SOFTWARE have some info as a branch off the root, whereas ABSTRACT, BOOK CHAPTER,
|
||||
// | CONFERENCE ARTICLE, JOURNAL ARTICLE, MAGAZINE ARTICLE and NEWSPAPER ARTICLE place it in the relatedItem branch.
|
||||
|
||||
if (!preg_match("/^(Abstract|Book Chapter|Conference Article|Journal Article|Magazine Article|Newspaper Article)$/", $row['type'])) {
|
||||
// name
|
||||
// editor
|
||||
if (!empty($row['editor'])) {
|
||||
$editor=$row['editor'];
|
||||
$author=$row['author'];
|
||||
if (preg_match("/ *\(eds?\)$/", $editor))
|
||||
$editor = preg_replace("/[ \r\n]*\(eds?\)/i", "", $editor);
|
||||
if (preg_match("/ *\(eds?\)$/", $author))
|
||||
$author = preg_replace("/[ \r\n]*\(eds?\)/i", "", $author);
|
||||
if ($editor != $author) {
|
||||
$nameArray = separateNames("editor", "/\s*;\s*/", "/\s*,\s*/",
|
||||
"/(?<=^|[$word])[^-$word]+|(?<=^|[$upper])(?=$|[$upper])/$patternModifiers",
|
||||
$editor, "personal", "editor");
|
||||
foreach ($nameArray as $singleName)
|
||||
$record->addXMLBranch($singleName);
|
||||
}
|
||||
}
|
||||
// corporate
|
||||
// (we treat a 'corporate_author' similar to how Bibutils converts the BibTeX
|
||||
// 'organization' field to MODS XML, i.e., we add a separate name element with
|
||||
// a 'type="corporate"' attribute and an 'author' role (or a 'degree grantor'
|
||||
// role in case of theses))
|
||||
if (!empty($row['corporate_author'])) {
|
||||
$nameBranch = new XMLBranch("name");
|
||||
$nameBranch->setTagAttribute("type", "corporate");
|
||||
$nameBranch->setTagContent(encodeXMLField('corporate_author', $row['corporate_author']), "name/namePart");
|
||||
if (empty($row['thesis']))
|
||||
$nameBranch->setTagContent("author", "name/role/roleTerm");
|
||||
else // thesis
|
||||
$nameBranch->setTagContent("degree grantor", "name/role/roleTerm");
|
||||
$nameBranch->setTagAttribute("authority", "marcrelator", "name/role/roleTerm");
|
||||
$nameBranch->setTagAttribute("type", "text", "name/role/roleTerm");
|
||||
$record->addXMLBranch($nameBranch);
|
||||
}
|
||||
// conference
|
||||
if (!empty($row['conference'])) {
|
||||
$nameBranch = new XMLBranch("name");
|
||||
$nameBranch->setTagAttribute("type", "conference");
|
||||
$nameBranch->setTagContent(encodeXMLField('conference', $row['conference']), "name/namePart");
|
||||
$record->addXMLBranch($nameBranch);
|
||||
}
|
||||
|
||||
// genre
|
||||
// type
|
||||
// NOTE: Is there a better MARC genre[1] for 'manuscript?'
|
||||
// [1]<http://www.loc.gov/marc/sourcecode/genre/genrelist.html>
|
||||
$genremarc = new XMLBranch("genre");
|
||||
$genre = new XMLBranch("genre");
|
||||
// NOTE: According to the MARC "Source Codes for Genre"[1]
|
||||
// the MARC authority should be 'marcgt', not 'marc'.
|
||||
// [1]<http://www.loc.gov/marc/sourcecode/genre/genresource.html>
|
||||
$genremarc->setTagAttribute("authority", "marcgt");
|
||||
|
||||
if (empty($row['thesis'])) { // theses will get their own genre (see below)
|
||||
if ($row['type'] == "Book Whole") {
|
||||
$record->setTagContent("monographic",
|
||||
"mods/originInfo/issuance");
|
||||
$genremarc->setTagContent("book");
|
||||
}
|
||||
else if ($row['type'] == "Conference Volume") {
|
||||
$genremarc->setTagContent("conference publication");
|
||||
}
|
||||
else if ($row['type'] == "Journal") {
|
||||
$genremarc->setTagContent("periodical");
|
||||
$genre->setTagContent("academic journal");
|
||||
}
|
||||
else if ($row['type'] == "Manual") { // should we set '<issuance>monographic' here (and for the ones below)?
|
||||
$genremarc->setTagContent("instruction");
|
||||
$genre->setTagContent("manual");
|
||||
}
|
||||
else if ($row['type'] == "Manuscript") {
|
||||
$genremarc->setTagContent("loose-leaf");
|
||||
$genre->setTagContent("manuscript");
|
||||
}
|
||||
else if ($row['type'] == "Map") {
|
||||
$genremarc->setTagContent("map");
|
||||
}
|
||||
else if ($row['type'] == "Miscellaneous") {
|
||||
$genre->setTagContent("miscellaneous");
|
||||
}
|
||||
else if ($row['type'] == "Patent") {
|
||||
$genremarc->setTagContent("patent");
|
||||
}
|
||||
else if ($row['type'] == "Report") {
|
||||
$genremarc->setTagContent("technical report");
|
||||
$genre->setTagContent("report");
|
||||
}
|
||||
else if ($row['type'] == "Software") {
|
||||
// $genremarc->setTagContent("programmed text"); // would this be correct?
|
||||
$genre->setTagContent("software");
|
||||
}
|
||||
else if (!empty($row['type'])) { // catch-all: don't use a MARC genre
|
||||
$genre->setTagContent(encodeXMLField('type', $row['type']));
|
||||
}
|
||||
if ($genremarc->hasLeaf())
|
||||
$record->addXMLBranch($genremarc);
|
||||
if ($genre->hasLeaf())
|
||||
$record->addXMLBranch($genre);
|
||||
}
|
||||
// thesis
|
||||
else { // if (!empty($row['thesis']))
|
||||
$record->setTagContent("monographic",
|
||||
"mods/originInfo/issuance");
|
||||
$thesismarc = new XMLBranch("genre");
|
||||
$thesis = new XMLBranch("genre");
|
||||
|
||||
$thesismarc->setTagContent("thesis");
|
||||
$thesismarc->setTagAttribute("authority", "marcgt");
|
||||
|
||||
// tweak thesis names so that Bibutils will recognize them:
|
||||
if ($row['thesis'] == "Master's thesis")
|
||||
$row['thesis'] = "Masters thesis";
|
||||
|
||||
$thesis->setTagContent(encodeXMLField('thesis', $row['thesis']));
|
||||
|
||||
$record->addXMLBranch($thesismarc);
|
||||
$record->addXMLBranch($thesis);
|
||||
}
|
||||
|
||||
// physicalDescription
|
||||
// pages
|
||||
if (!empty($row['pages'])) {
|
||||
$description = new XMLBranch("physicalDescription");
|
||||
$pages = new XMLBranch("extent");
|
||||
$pages->setTagAttribute("unit", "pages");
|
||||
if (preg_match("/[0-9] *- *[0-9]/", $row['pages'])) { // if a page range
|
||||
// split the page range into start and end pages
|
||||
list($pagestart, $pageend) = preg_split('/\s*[-]\s*/', $row['pages']);
|
||||
if ($pagestart < $pageend) { // extents MUST span multiple pages
|
||||
$pages->setTagContent(encodeXMLField('pages', $pagestart), "extent/start");
|
||||
$pages->setTagContent(encodeXMLField('pages', $pageend), "extent/end");
|
||||
}
|
||||
else {
|
||||
$pages->setTagContent(encodeXMLField('pages', $row['pages']));
|
||||
}
|
||||
}
|
||||
else if (preg_match("/^\d\d*\s*pp?.?$/", $row['pages'])) {
|
||||
list($pagetotal) = preg_split('/\s*pp?/', $row['pages']);
|
||||
$pages->setTagContent(encodeXMLField('pages', $pagetotal), "extent/total");
|
||||
}
|
||||
else {
|
||||
$pages->setTagContent(encodeXMLField('pages', $row['pages']));
|
||||
}
|
||||
$description->addXMLBranch($pages);
|
||||
$record->addXMLBranch($description);
|
||||
}
|
||||
|
||||
// identifier
|
||||
// isbn
|
||||
if (!empty($row['isbn'])) {
|
||||
$identifier = new XMLBranch("identifier");
|
||||
$identifier->setTagContent(encodeXMLField('isbn', $row['isbn']));
|
||||
$identifier->setTagAttribute("type", "isbn");
|
||||
$record->addXMLBranch($identifier);
|
||||
}
|
||||
// issn
|
||||
if (!empty($row['issn'])) {
|
||||
$identifier = new XMLBranch("identifier");
|
||||
$identifier->setTagContent(encodeXMLField('issn', $row['issn']));
|
||||
$identifier->setTagAttribute("type", "issn");
|
||||
$record->addXMLBranch($identifier);
|
||||
}
|
||||
|
||||
// series
|
||||
if ((!empty($row['series_editor'])) || (!empty($row['series_title'])) ||
|
||||
(!empty($row['abbrev_series_title'])) ||
|
||||
(!empty($row['series_volume'])) || (!empty($row['series_issue']))) {
|
||||
$record->addXMLBranch(serialBranch($row['series_editor'],
|
||||
$row['series_title'],
|
||||
$row['abbrev_series_title'],
|
||||
$row['series_volume'],
|
||||
$row['series_issue']));
|
||||
}
|
||||
}
|
||||
|
||||
// --- END TYPE != ABSTRACT || BOOK CHAPTER || CONFERENCE ARTICLE || JOURNAL ARTICLE || MAGAZINE ARTICLE || NEWSPAPER ARTICLE ---
|
||||
|
||||
// -----------------------------------------
|
||||
|
||||
// --- BEGIN TYPE == ABSTRACT || BOOK CHAPTER || CONFERENCE ARTICLE || JOURNAL ARTICLE || MAGAZINE ARTICLE || NEWSPAPER ARTICLE ---
|
||||
// |
|
||||
// | NOTE: These are currently the only types that have publication,
|
||||
// | abbrev_journal, volume, and issue added.
|
||||
// | A lot of info goes into the relatedItem branch.
|
||||
|
||||
else { // if (preg_match("/^(Abstract|Book Chapter|Conference Article|Journal Article|Magazine Article|Newspaper Article)$/", $row['type']))
|
||||
// relatedItem
|
||||
$related = new XMLBranch("relatedItem");
|
||||
$related->setTagAttribute("type", "host");
|
||||
|
||||
// title (Publication)
|
||||
if (!empty($row['publication']))
|
||||
$related->setTagContent(encodeXMLField('publication', $row['publication']),
|
||||
"relatedItem/titleInfo/title");
|
||||
|
||||
// title (Abbreviated Journal)
|
||||
if (!empty($row['abbrev_journal'])) {
|
||||
$titleabbrev = NEW XMLBranch("titleInfo");
|
||||
$titleabbrev->setTagAttribute("type", "abbreviated");
|
||||
$titleabbrev->setTagContent(encodeXMLField('abbrev_journal', $row['abbrev_journal']), "titleInfo/title");
|
||||
$related->addXMLBranch($titleabbrev);
|
||||
}
|
||||
|
||||
// name
|
||||
// editor
|
||||
if (!empty($row['editor'])) {
|
||||
$editor=$row['editor'];
|
||||
if (preg_match("/ *\(eds?\)$/", $editor))
|
||||
$editor = preg_replace("/[ \r\n]*\(eds?\)/i", "", $editor);
|
||||
$nameArray = separateNames("editor", "/\s*;\s*/", "/\s*,\s*/",
|
||||
"/(?<=^|[$word])[^-$word]+|(?<=^|[$upper])(?=$|[$upper])/$patternModifiers",
|
||||
$editor, "personal", "editor");
|
||||
foreach ($nameArray as $singleName)
|
||||
$related->addXMLBranch($singleName);
|
||||
}
|
||||
// corporate
|
||||
// NOTE: a copy of the code for 'corporate_author' above.
|
||||
// Needs to be a separate function later.
|
||||
if (!empty($row['corporate_author'])) {
|
||||
$nameBranch = new XMLBranch("name");
|
||||
$nameBranch->setTagAttribute("type", "corporate");
|
||||
$nameBranch->setTagContent(encodeXMLField('corporate_author', $row['corporate_author']), "name/namePart");
|
||||
if (empty($row['thesis']))
|
||||
$nameBranch->setTagContent("author", "name/role/roleTerm");
|
||||
else // thesis
|
||||
$nameBranch->setTagContent("degree grantor", "name/role/roleTerm");
|
||||
$nameBranch->setTagAttribute("authority", "marcrelator", "name/role/roleTerm");
|
||||
$nameBranch->setTagAttribute("type", "text", "name/role/roleTerm");
|
||||
$related->addXMLBranch($nameBranch);
|
||||
}
|
||||
// conference
|
||||
// NOTE: a copy of the code for 'conference' above.
|
||||
// Needs to be a separate function later.
|
||||
if (!empty($row['conference'])) {
|
||||
$nameBranch = new XMLBranch("name");
|
||||
$nameBranch->setTagAttribute("type", "conference");
|
||||
$nameBranch->setTagContent(encodeXMLField('conference', $row['conference']), "name/namePart");
|
||||
$related->addXMLBranch($nameBranch);
|
||||
}
|
||||
|
||||
// originInfo
|
||||
$relorigin = new XMLBranch("originInfo");
|
||||
// dateIssued
|
||||
if (!empty($row['year']))
|
||||
$relorigin->setTagContent(encodeXMLField('year', $row['year']), "originInfo/dateIssued");
|
||||
// publisher
|
||||
if (!empty($row['publisher']))
|
||||
$relorigin->setTagContent(encodeXMLField('publisher', $row['publisher']), "originInfo/publisher");
|
||||
// place
|
||||
if (!empty($row['place'])) {
|
||||
$relorigin->setTagContent(encodeXMLField('place', $row['place']), "originInfo/place/placeTerm");
|
||||
$relorigin->setTagAttribute("type", "text",
|
||||
"originInfo/place/placeTerm");
|
||||
}
|
||||
// edition
|
||||
if (!empty($row['edition']))
|
||||
$relorigin->setTagContent(encodeXMLField('edition', $row['edition']), "originInfo/edition");
|
||||
if ($relorigin->hasBranch())
|
||||
$related->addXMLBranch($relorigin);
|
||||
|
||||
// genre (and originInfo/issuance)
|
||||
if (empty($row['thesis'])) { // theses will get their own genre (see below)
|
||||
if (preg_match("/^(Journal Article|Magazine Article)$/", $row['type'])) {
|
||||
$related->setTagContent("continuing",
|
||||
"relatedItem/originInfo/issuance");
|
||||
$genremarc = new XMLBranch("genre");
|
||||
$genre = new XMLBranch("genre");
|
||||
|
||||
$genremarc->setTagContent("periodical");
|
||||
$genremarc->setTagAttribute("authority", "marcgt");
|
||||
|
||||
if ($row['type'] == "Magazine Article")
|
||||
$genre->setTagContent("magazine");
|
||||
else
|
||||
$genre->setTagContent("academic journal");
|
||||
|
||||
$related->addXMLBranch($genremarc);
|
||||
$related->addXMLBranch($genre);
|
||||
}
|
||||
else if ($row['type'] == "Abstract") {
|
||||
$record->setTagContent("abstract or summary", "mods/genre");
|
||||
$record->setTagAttribute("authority", "marcgt", "mods/genre");
|
||||
}
|
||||
else if ($row['type'] == "Conference Article") {
|
||||
$related->setTagContent("conference publication", "relatedItem/genre");
|
||||
$related->setTagAttribute("authority", "marcgt", "relatedItem/genre");
|
||||
}
|
||||
else if ($row['type'] == "Newspaper Article") {
|
||||
$related->setTagContent("continuing",
|
||||
"relatedItem/originInfo/issuance");
|
||||
$related->setTagContent("newspaper", "relatedItem/genre");
|
||||
$related->setTagAttribute("authority", "marcgt", "relatedItem/genre");
|
||||
}
|
||||
else { // if ($row['type'] == "Book Chapter")
|
||||
$related->setTagContent("monographic",
|
||||
"relatedItem/originInfo/issuance");
|
||||
$related->setTagContent("book", "relatedItem/genre");
|
||||
$related->setTagAttribute("authority", "marcgt", "relatedItem/genre");
|
||||
}
|
||||
}
|
||||
// thesis
|
||||
else { // if (!empty($row['thesis']))
|
||||
$thesismarc = new XMLBranch("genre");
|
||||
$thesis = new XMLBranch("genre");
|
||||
|
||||
$thesismarc->setTagContent("thesis");
|
||||
$thesismarc->setTagAttribute("authority", "marcgt");
|
||||
|
||||
// tweak thesis names so that Bibutils will recognize them:
|
||||
if ($row['thesis'] == "Master's thesis")
|
||||
$row['thesis'] = "Masters thesis";
|
||||
|
||||
$thesis->setTagContent(encodeXMLField('thesis', $row['thesis']));
|
||||
|
||||
$related->addXMLBranch($thesismarc);
|
||||
$related->addXMLBranch($thesis);
|
||||
}
|
||||
|
||||
if ((!empty($row['year'])) || (!empty($row['volume'])) ||
|
||||
(!empty($row['issue'])) || (!empty($row['pages']))) {
|
||||
$part = new XMLBranch("part");
|
||||
|
||||
if (!empty($row['year']))
|
||||
$part->setTagContent(encodeXMLField('year', $row['year']), "date");
|
||||
if (!empty($row['volume'])) {
|
||||
$detailvolume = new XMLBranch("detail");
|
||||
$detailvolume->setTagContent(encodeXMLField('volume', $row['volume']), "detail/number");
|
||||
$detailvolume->setTagAttribute("type", "volume");
|
||||
$part->addXMLBranch($detailvolume);
|
||||
}
|
||||
if (!empty($row['issue'])) {
|
||||
$detailnumber = new XMLBranch("detail");
|
||||
$detailnumber->setTagContent(encodeXMLField('issue', $row['issue']), "detail/number");
|
||||
$detailnumber->setTagAttribute("type", "issue");
|
||||
$part->addXMLBranch($detailnumber);
|
||||
}
|
||||
if (!empty($row['pages'])) {
|
||||
if (preg_match("/[0-9] *- *[0-9]/", $row['pages'])) { // if a page range
|
||||
// split the page range into start and end pages
|
||||
list($pagestart, $pageend) = preg_split('/\s*[-]\s*/', $row['pages']);
|
||||
if ($pagestart < $pageend) { // extents MUST span multiple pages
|
||||
$pages = new XMLBranch("extent");
|
||||
$pages->setTagContent(encodeXMLField('pages', $pagestart), "extent/start");
|
||||
$pages->setTagContent(encodeXMLField('pages', $pageend), "extent/end");
|
||||
$pages->setTagAttribute("unit", "page");
|
||||
}
|
||||
else {
|
||||
$pages = new XMLBranch("detail");
|
||||
if ($pagestart == $pageend) // single-page item
|
||||
$pages->setTagContent(encodeXMLField('pages', $pagestart), "detail/number");
|
||||
else
|
||||
$pages->setTagContent(encodeXMLField('pages', $row['pages']), "detail/number");
|
||||
$pages->setTagAttribute("type", "page");
|
||||
}
|
||||
}
|
||||
else {
|
||||
$pages = new XMLBranch("detail");
|
||||
$pages->setTagContent(encodeXMLField('pages', $row['pages']), "detail/number");
|
||||
$pages->setTagAttribute("type", "page");
|
||||
}
|
||||
$part->addXMLBranch($pages);
|
||||
}
|
||||
$related->addXMLBranch($part);
|
||||
}
|
||||
|
||||
// identifier
|
||||
// isbn
|
||||
if (!empty($row['isbn'])) {
|
||||
$identifier = new XMLBranch("identifier");
|
||||
$identifier->setTagContent(encodeXMLField('isbn', $row['isbn']));
|
||||
$identifier->setTagAttribute("type", "isbn");
|
||||
$related->addXMLBranch($identifier);
|
||||
}
|
||||
// issn
|
||||
if (!empty($row['issn'])) {
|
||||
$identifier = new XMLBranch("identifier");
|
||||
$identifier->setTagContent(encodeXMLField('issn', $row['issn']));
|
||||
$identifier->setTagAttribute("type", "issn");
|
||||
$related->addXMLBranch($identifier);
|
||||
}
|
||||
|
||||
// series
|
||||
if ((!empty($row['series_editor'])) || (!empty($row['series_title'])) ||
|
||||
(!empty($row['abbrev_series_title'])) ||
|
||||
(!empty($row['series_volume'])) || (!empty($row['series_issue']))) {
|
||||
$related->addXMLBranch(serialBranch($row['series_editor'],
|
||||
$row['series_title'],
|
||||
$row['abbrev_series_title'],
|
||||
$row['series_volume'],
|
||||
$row['series_issue']));
|
||||
}
|
||||
|
||||
$record->addXMLBranch($related);
|
||||
}
|
||||
|
||||
// --- END TYPE == ABSTRACT || BOOK CHAPTER || CONFERENCE ARTICLE || JOURNAL ARTICLE || MAGAZINE ARTICLE || NEWSPAPER ARTICLE ---
|
||||
|
||||
|
||||
return $record;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Encode special chars, perform charset conversions and apply any
|
||||
// field-specific search & replace actions:
|
||||
function encodeXMLField($fieldName, $fieldValue)
|
||||
{
|
||||
global $fieldSpecificSearchReplaceActionsArray; // defined in function 'modsCollection()'
|
||||
|
||||
// function 'encodeField()' is defined in 'include.inc.php'
|
||||
$encodedFieldValue = encodeField($fieldName, $fieldValue, $fieldSpecificSearchReplaceActionsArray, array(), true, "XML");
|
||||
|
||||
return $encodedFieldValue;
|
||||
}
|
||||
|
||||
?>
|
||||
510
includes/oaidcxml.inc.php
Normal file
510
includes/oaidcxml.inc.php
Normal file
@@ -0,0 +1,510 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/oaidcxml.inc.php
|
||||
// Repository: $HeadURL$
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 05-Mar-08, 21:52
|
||||
// Modified: $Date: 2017-04-13 02:00:18 +0000 (Thu, 13 Apr 2017) $
|
||||
// $Author$
|
||||
// $Revision: 1416 $
|
||||
|
||||
// This include file contains functions that'll export records to OAI_DC XML.
|
||||
// Requires ActiveLink PHP XML Package, which is available under the GPL from:
|
||||
// <http://www.active-link.com/software/>
|
||||
// TODO: I18n
|
||||
|
||||
|
||||
// Incorporate some include files:
|
||||
include_once 'includes/webservice.inc.php'; // include functions that are commonly used with the refbase webservices
|
||||
|
||||
// Import the ActiveLink Packages
|
||||
require_once("classes/include.php");
|
||||
import("org.active-link.xml.XML");
|
||||
import("org.active-link.xml.XMLDocument");
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Return records as OAI_DC (i.e. simple/unqualified Dublin Core) XML as required
|
||||
// by the Open Archives Initiative Protocol for Metadata Harvesting (OAI-PMH):
|
||||
//
|
||||
// Spec: <http://www.openarchives.org/OAI/openarchivesprotocol.html>
|
||||
// Guides: <http://www.oaforum.org/tutorial/english/page5.htm>
|
||||
// <http://dublincore.org/documents/dc-xml-guidelines/>
|
||||
function oaidcCollection($result)
|
||||
{
|
||||
global $contentTypeCharset; // these variables are defined in 'ini.inc.php'
|
||||
global $convertExportDataToUTF8;
|
||||
|
||||
global $citeKeysArray; // '$citeKeysArray' is made globally available from
|
||||
// within this function
|
||||
|
||||
// Individual records are objects and collections of records are strings
|
||||
|
||||
$oaidcCollectionDoc = new XMLDocument();
|
||||
|
||||
if (($convertExportDataToUTF8 == "yes") AND ($contentTypeCharset != "UTF-8"))
|
||||
$oaidcCollectionDoc->setEncoding("UTF-8");
|
||||
else
|
||||
$oaidcCollectionDoc->setEncoding($contentTypeCharset);
|
||||
|
||||
$oaidcCollection = new XML("dcCollection");
|
||||
$oaidcCollection->setTagAttribute("xmlns:oai_dc", "http://www.openarchives.org/OAI/2.0/oai_dc/");
|
||||
$oaidcCollection->setTagAttribute("xmlns:dc", "http://purl.org/dc/elements/1.1/");
|
||||
$oaidcCollection->setTagAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
|
||||
$oaidcCollection->setTagAttribute("xsi:schemaLocation", "http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd");
|
||||
|
||||
// ----------------------------------------------------------
|
||||
|
||||
// Add OAI_DC XML entries:
|
||||
|
||||
$exportArray = array(); // array for individually exported records
|
||||
$citeKeysArray = array(); // array of cite keys (used to ensure uniqueness of cite keys among all exported records)
|
||||
|
||||
// Generate the export for each record and push them onto an array:
|
||||
while ($row = @ mysqli_fetch_array($result))
|
||||
{
|
||||
// Export the current record as OAI_DC XML:
|
||||
$record = oaidcRecord($row, "oai_dc");
|
||||
|
||||
if (!empty($record)) // unless the record buffer is empty...
|
||||
array_push($exportArray, $record); // ...add it to an array of exports
|
||||
}
|
||||
|
||||
// for each of the OAI_DC XML entries in the result set...
|
||||
foreach ($exportArray as $oaidc)
|
||||
$oaidcCollection->addXMLasBranch($oaidc);
|
||||
|
||||
$oaidcCollectionDoc->setXML($oaidcCollection);
|
||||
$oaidcCollectionString = $oaidcCollectionDoc->getXMLString();
|
||||
|
||||
return $oaidcCollectionString;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Generate an OAI_DC (i.e. simple/unqualified Dublin Core) XML record:
|
||||
// (returns an XML object (oaidc) of a single record)
|
||||
//
|
||||
// TODO: - see inline comments labeled with "TODO"
|
||||
function oaidcRecord($row, $metadataPrefix = "oai_dc", $addNameSpaceInfo = true)
|
||||
{
|
||||
global $databaseBaseURL; // these variables are defined in 'ini.inc.php'
|
||||
global $contentTypeCharset;
|
||||
global $fileVisibility;
|
||||
global $fileVisibilityException;
|
||||
global $filesBaseURL;
|
||||
global $convertExportDataToUTF8;
|
||||
global $defaultCiteStyle;
|
||||
|
||||
global $citeStyle;
|
||||
|
||||
global $alnum, $alpha, $cntrl, $dash, $digit, $graph, $lower, $print, $punct, $space, $upper, $word, $patternModifiers; // defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
|
||||
|
||||
// The array '$transtab_refbase_unicode' contains search & replace patterns for conversion from refbase markup to Unicode entities.
|
||||
global $transtab_refbase_unicode; // defined in 'transtab_refbase_unicode.inc.php'
|
||||
|
||||
// The array '$transtab_refbase_ascii' contains search & replace patterns for conversion from refbase markup to plain text.
|
||||
global $transtab_refbase_ascii; // defined in 'transtab_refbase_ascii.inc.php'
|
||||
|
||||
// Define inline text markup to generate a plain text citation string:
|
||||
// (to be included within a 'dcterms:bibliographicCitation' element)
|
||||
$markupPatternsArrayPlain = array("bold-prefix" => "", // NOTE: should we rather keep refbase font-shape markup (like _italic_ and **bold**) for plain text output?
|
||||
"bold-suffix" => "",
|
||||
"italic-prefix" => "",
|
||||
"italic-suffix" => "",
|
||||
"underline-prefix" => "",
|
||||
"underline-suffix" => "",
|
||||
"endash" => "-",
|
||||
"emdash" => "-",
|
||||
"ampersand" => "&",
|
||||
"double-quote" => '"',
|
||||
"double-quote-left" => '"',
|
||||
"double-quote-right" => '"',
|
||||
"single-quote" => "'",
|
||||
"single-quote-left" => "'",
|
||||
"single-quote-right" => "'",
|
||||
"less-than" => "<",
|
||||
"greater-than" => ">",
|
||||
"newline" => "\n"
|
||||
);
|
||||
|
||||
|
||||
// This is a stupid hack that maps the names of the '$row' array keys to those used
|
||||
// by the '$formVars' array (which is required by function 'generateCiteKey()')
|
||||
// (eventually, the '$formVars' array should use the MySQL field names as names for its array keys)
|
||||
$formVars = buildFormVarsArray($row); // function 'buildFormVarsArray()' is defined in 'include.inc.php'
|
||||
|
||||
// Generate or extract the cite key for this record:
|
||||
// (to be included within a 'dc:identifier' element)
|
||||
$citeKey = generateCiteKey($formVars); // function 'generateCiteKey()' is defined in 'include.inc.php'
|
||||
|
||||
// Generate OpenURL data:
|
||||
// (to be included within a 'dc:identifier' element)
|
||||
$openURL = openURL($row, "openurl:"); // function 'openURL()' is defined in 'openurl.inc.php'
|
||||
|
||||
// Encode special chars and perform charset conversions:
|
||||
foreach ($row as $rowFieldName => $rowFieldValue)
|
||||
{
|
||||
// We only convert those special chars to entities which are supported by XML:
|
||||
// function 'encodeHTMLspecialchars()' is defined in 'include.inc.php'
|
||||
$row[$rowFieldName] = encodeHTMLspecialchars($row[$rowFieldName]);
|
||||
|
||||
// Convert field data to UTF-8:
|
||||
// (if '$convertExportDataToUTF8' is set to "yes" in 'ini.inc.php' and character encoding is not UTF-8 already)
|
||||
// (Note that charset conversion can only be done *after* the cite key has been generated, otherwise cite key
|
||||
// generation will produce garbled text!)
|
||||
// function 'convertToCharacterEncoding()' is defined in 'include.inc.php'
|
||||
if (($convertExportDataToUTF8 == "yes") AND ($contentTypeCharset != "UTF-8"))
|
||||
$row[$rowFieldName] = convertToCharacterEncoding("UTF-8", "IGNORE", $row[$rowFieldName]);
|
||||
}
|
||||
|
||||
// Defines field-specific search & replace 'actions' that will be applied to all those refbase fields that are listed in the corresponding 'fields' element:
|
||||
// (If you don't want to perform any search and replace actions, specify an empty array, like: '$fieldSpecificSearchReplaceActionsArray = array();'.
|
||||
// Note that the search patterns MUST include the leading & trailing slashes -- which is done to allow for mode modifiers such as 'imsxU'.)
|
||||
// "/Search Pattern/" => "Replace Pattern"
|
||||
$fieldSpecificSearchReplaceActionsArray = array();
|
||||
|
||||
if ($convertExportDataToUTF8 == "yes")
|
||||
$fieldSpecificSearchReplaceActionsArray[] = array('fields' => array("title", "publication", "abbrev_journal", "address", "keywords", "abstract", "orig_title", "series_title", "abbrev_series_title", "notes"),
|
||||
'actions' => $transtab_refbase_unicode
|
||||
);
|
||||
|
||||
// Apply field-specific search & replace 'actions' to all fields that are listed in the 'fields' element of the arrays contained in '$fieldSpecificSearchReplaceActionsArray':
|
||||
foreach ($fieldSpecificSearchReplaceActionsArray as $fieldActionsArray)
|
||||
foreach ($row as $rowFieldName => $rowFieldValue)
|
||||
if (in_array($rowFieldName, $fieldActionsArray['fields']))
|
||||
$row[$rowFieldName] = searchReplaceText($fieldActionsArray['actions'], $rowFieldValue, true); // function 'searchReplaceText()' is defined in 'include.inc.php'
|
||||
|
||||
// Fetch the name of the citation style file that's associated with the style given in '$citeStyle':
|
||||
$citeStyleFile = getStyleFile($citeStyle); // function 'getStyleFile()' is defined in 'include.inc.php'
|
||||
|
||||
if (empty($citeStyleFile))
|
||||
{
|
||||
$citeStyle = $defaultCiteStyle; // if the given cite style could not be found, we'll use the default cite style which is defined by the '$defaultCiteStyle' variable in 'ini.inc.php'
|
||||
$citeStyleFile = getStyleFile($citeStyle);
|
||||
}
|
||||
|
||||
// Include the found citation style file *once*:
|
||||
include_once "cite/" . $citeStyleFile;
|
||||
|
||||
// Generate a proper citation for this record, ordering attributes according to the chosen output style & record type:
|
||||
// - Plain text version of citation string:
|
||||
$recordCitationPlain = citeRecord($row, $citeStyle, "", $markupPatternsArrayPlain, false); // function 'citeRecord()' is defined in the citation style file given in '$citeStyleFile' (which, in turn, must reside in the 'styles' directory of the refbase root directory)
|
||||
|
||||
// Convert any refbase markup that remains in the citation string (such as _italic_ or **bold**) to plain text:
|
||||
$recordCitationPlain = searchReplaceText($transtab_refbase_ascii, $recordCitationPlain, true);
|
||||
|
||||
// Convert any remaining refbase markup in the 'title', 'keywords' & 'abstract' fields to plain text:
|
||||
$row['title'] = searchReplaceText($transtab_refbase_ascii, $row['title'], true);
|
||||
$row['keywords'] = searchReplaceText($transtab_refbase_ascii, $row['keywords'], true);
|
||||
$row['abstract'] = searchReplaceText($transtab_refbase_ascii, $row['abstract'], true);
|
||||
|
||||
// Strip any " (ed)" or " (eds)" suffix from author/editor string:
|
||||
if (preg_match("/ *\(eds?\)$/", $row['author']))
|
||||
$row['author'] = preg_replace("/[ \r\n]*\(eds?\)/i", "", $row['author']);
|
||||
|
||||
if (preg_match("/ *\(eds?\)$/", $row['editor']))
|
||||
$row['editor'] = preg_replace("/[ \r\n]*\(eds?\)/i", "", $row['editor']);
|
||||
|
||||
// Include a link to any corresponding file if one of the following conditions is met:
|
||||
// - the variable '$fileVisibility' (defined in 'ini.inc.php') is set to 'everyone'
|
||||
// - the variable '$fileVisibility' is set to 'login' AND the user is logged in
|
||||
// - the variable '$fileVisibility' is set to 'user-specific' AND the 'user_permissions' session variable contains 'allow_download'
|
||||
// - the array variable '$fileVisibilityException' (defined in 'ini.inc.php') contains a pattern (in array element 1) that matches the contents of the field given (in array element 0)
|
||||
//
|
||||
// TODO: - the URL-generating code should be made into a dedicated function (since it's shared with 'modsxml.inc.php' and 'atomxml.inc.php')
|
||||
$printURL = false;
|
||||
|
||||
if ($fileVisibility == "everyone" OR ($fileVisibility == "login" AND isset($_SESSION['loginEmail'])) OR ($fileVisibility == "user-specific" AND (isset($_SESSION['user_permissions']) AND preg_match("/allow_download/", $_SESSION['user_permissions']))) OR (!empty($fileVisibilityException) AND preg_match($fileVisibilityException[1], $row[$fileVisibilityException[0]])))
|
||||
{
|
||||
if (!empty($row['file']))
|
||||
{
|
||||
if (preg_match('#^(https?|ftp|file)://#i', $row['file'])) // if the 'file' field contains a full URL (starting with "http://", "https://", "ftp://", or "file://")
|
||||
{
|
||||
$URLprefix = ""; // we don't alter the URL given in the 'file' field
|
||||
}
|
||||
else // if the 'file' field contains only a partial path (like 'polarbiol/10240001.pdf') or just a file name (like '10240001.pdf')
|
||||
{
|
||||
// use the base URL of the standard files directory as prefix:
|
||||
if (preg_match('#^/#', $filesBaseURL)) // absolute path -> file dir is located outside of refbase root dir
|
||||
$URLprefix = 'http://' . $_SERVER['HTTP_HOST'] . $filesBaseURL;
|
||||
else // relative path -> file dir is located within refbase root dir
|
||||
$URLprefix = $databaseBaseURL . $filesBaseURL;
|
||||
}
|
||||
|
||||
$printURL = true;
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------
|
||||
|
||||
// Start OAI_DC XML record:
|
||||
|
||||
if (!empty($metadataPrefix))
|
||||
$recordPrefix = $metadataPrefix . ":";
|
||||
|
||||
$record = new XML($recordPrefix . "dc"); // create an XML object for a single record
|
||||
|
||||
if ($addNameSpaceInfo)
|
||||
{
|
||||
if ($metadataPrefix == "oai_dc")
|
||||
$record->setTagAttribute("xmlns:oai_dc", "http://www.openarchives.org/OAI/2.0/oai_dc/");
|
||||
elseif ($metadataPrefix == "srw_dc")
|
||||
$record->setTagAttribute("xmlns:srw_dc", "info:srw/schema/1/dc-v1.1");
|
||||
|
||||
$record->setTagAttribute("xmlns:dc", "http://purl.org/dc/elements/1.1/");
|
||||
|
||||
if ($metadataPrefix == "oai_dc") // NOTE: should we include these for 'srw_dc:dc' output as well?
|
||||
{
|
||||
$record->setTagAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
|
||||
$record->setTagAttribute("xsi:schemaLocation", "http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd");
|
||||
}
|
||||
elseif ($metadataPrefix == "srw_dc")
|
||||
$record->setTagAttribute("xmlns:prism", "http://prismstandard.org/namespaces/1.2/basic/");
|
||||
}
|
||||
|
||||
|
||||
// Add Dublin Core elements:
|
||||
// NOTE: With a few exceptions, we try to adhere to the guidelines given at
|
||||
// "Using simple Dublin Core to describe eprints" by Andy Powell et al.
|
||||
// See: <http://eprints-uk.rdn.ac.uk/project/docs/simpledc-guidelines/>
|
||||
|
||||
// - 'dc:title':
|
||||
if (!empty($row['title']))
|
||||
addMetaElement($record, "dc", "title", array(), $row['title']); // function 'addMetaElement()' is defined in 'webservice.inc.php'
|
||||
|
||||
// - 'dc:creator':
|
||||
if (!empty($row['author']) AND ($row['author'] != $row['editor']))
|
||||
addMetaElement($record, "dc", "creator", array(), $row['author']);
|
||||
|
||||
// - 'dc:creator':
|
||||
// TODO: add refbase corporate author(s) as 'dc:creator'
|
||||
|
||||
// - 'dc:contributor':
|
||||
if (!empty($row['editor']))
|
||||
addMetaElement($record, "dc", "contributor", array(), $row['editor']);
|
||||
|
||||
// - 'dc:description':
|
||||
if (!empty($row['abstract']))
|
||||
addMetaElement($record, "dc", "description", array(), $row['abstract']);
|
||||
|
||||
// - 'dc:identifier':
|
||||
|
||||
// - DOI:
|
||||
if (!empty($row['doi']))
|
||||
addMetaElement($record, "dc", "identifier", array(), $row['doi'], "doi");
|
||||
|
||||
// - PMID:
|
||||
if (!empty($row['notes']) AND preg_match("/PMID *: *\d+/i", $row['notes']))
|
||||
addMetaElement($record, "dc", "identifier", array(), $row['notes'], "pmid");
|
||||
|
||||
// - arXiv:
|
||||
if (!empty($row['notes']) AND preg_match("/arXiv *: *[^ ;]+/i", $row['notes']))
|
||||
addMetaElement($record, "dc", "identifier", array(), $row['notes'], "arxiv");
|
||||
|
||||
// - ISBN:
|
||||
if (!empty($row['isbn']))
|
||||
addMetaElement($record, "dc", "identifier", array(), $row['isbn'], "isbn");
|
||||
|
||||
// - OpenURL:
|
||||
addMetaElement($record, "dc", "identifier", array(), $openURL, "openurl");
|
||||
|
||||
// - refbase ID:
|
||||
addMetaElement($record, "dc", "identifier", array(), $databaseBaseURL . generateURL("show.php", "html", array("record" => $row['serial']), true), "url");
|
||||
|
||||
// - Cite key:
|
||||
addMetaElement($record, "dc", "identifier", array(), $citeKey, "citekey");
|
||||
|
||||
// - Bibliographic citation:
|
||||
// NOTE: In 'atomxml.inc.php', the bibliographic citation is put into a
|
||||
// 'dcterms:bibliographicCitation' element so that it can be uniquely
|
||||
// identified and extracted easily. However, in case of simple Dublin
|
||||
// Core output, we just put it into a 'dc:identifier' element and
|
||||
// use a "citation:" prefix.
|
||||
addMetaElement($record, "dc", "identifier", array(), encodeHTMLspecialchars($recordCitationPlain), "citation");
|
||||
|
||||
// - 'dc:source':
|
||||
// NOTE: - In <http://eprints-uk.rdn.ac.uk/project/docs/simpledc-guidelines/>,
|
||||
// Andy Powell et al. recommend that this element should NOT be used!
|
||||
// However, we use 'dc:source' elements for publication & series info
|
||||
// (publication/series title plus volume & issue) to provide a dedicated
|
||||
// source string that's easily readable and parsable.
|
||||
// Example: <dc:source>Polar Biology, Vol. 25, No. 10</dc:source>
|
||||
// - While we could also append the page info to the publication
|
||||
// 'dc:source' element, this info is more pertinent to the article
|
||||
// itself and is thus not included. For 'srw_dc:dc' output, page info is
|
||||
// included in PRISM elements (see below).
|
||||
// - All metadata (including the page info) are also provided as a machine
|
||||
// parsable citation in form of an OpenURL ContextObject (see above).
|
||||
|
||||
// - Publication info:
|
||||
// NOTE: We only include the 'dc:source' element for 'oai_dc:dc' output. In case of 'srw_dc:dc'
|
||||
// output, we use the more fine-grained PRISM elements instead (see below)
|
||||
if (($metadataPrefix == "oai_dc") AND (!empty($row['publication']) OR !empty($row['abbrev_journal'])))
|
||||
{
|
||||
if (!empty($row['publication']))
|
||||
$source = $row['publication'];
|
||||
elseif (!empty($row['abbrev_journal']))
|
||||
$source = $row['abbrev_journal'];
|
||||
|
||||
if (!empty($row['volume']))
|
||||
$source .= ", Vol. " . $row['volume'];
|
||||
|
||||
if (!empty($row['issue']))
|
||||
$source .= ", No. " . $row['issue'];
|
||||
|
||||
if (!empty($source))
|
||||
addMetaElement($record, "dc", "source", array(), $source);
|
||||
}
|
||||
|
||||
// - Series info:
|
||||
if (!empty($row['series_title']) OR !empty($row['abbrev_series_title']))
|
||||
{
|
||||
if (!empty($row['series_title']))
|
||||
$series = $row['series_title'];
|
||||
elseif (!empty($row['abbrev_series_title']))
|
||||
$series = $row['abbrev_series_title'];
|
||||
|
||||
if (!empty($row['series_volume']))
|
||||
$series .= ", Vol. " . $row['series_volume'];
|
||||
|
||||
if (!empty($row['series_issue']))
|
||||
$series .= ", No. " . $row['series_issue'];
|
||||
|
||||
if (!empty($series))
|
||||
addMetaElement($record, "dc", "source", array(), $series);
|
||||
// NOTE: To distinguish between regular publication & series info,
|
||||
// should we better use a "series:" prefix here? If so, use:
|
||||
// addMetaElement($record, "dc", "source", array(), $series, "series");
|
||||
}
|
||||
|
||||
// - ISSN:
|
||||
// NOTE: for 'srw_dc:dc' output, we put the ISSN into the 'prism:issn' element
|
||||
if (($metadataPrefix == "oai_dc") AND !empty($row['issn']))
|
||||
addMetaElement($record, "dc", "source", array(), $row['issn'], "issn");
|
||||
|
||||
// - 'dc:date':
|
||||
if (!empty($row['year']))
|
||||
addMetaElement($record, "dc", "date", array(), $row['year']);
|
||||
|
||||
// - 'dc:type':
|
||||
if (!empty($row['type']))
|
||||
addMetaElement($record, "dc", "type", array(), $row['type'], $row['thesis']);
|
||||
|
||||
// In case of a thesis, we add another 'dc:type' element with the actual thesis type:
|
||||
if (!empty($row['thesis']))
|
||||
addMetaElement($record, "dc", "type", array(), $row['thesis']);
|
||||
|
||||
// - 'dc:format':
|
||||
// TODO: ideally, we should parse the content of the refbase 'medium' field and map it
|
||||
// to a media-type term from <http://www.iana.org/assignments/media-types/>
|
||||
if (!empty($row['medium']))
|
||||
$mediaType = $row['medium'];
|
||||
else
|
||||
$mediaType = "text";
|
||||
|
||||
addMetaElement($record, "dc", "format", array(), $mediaType);
|
||||
|
||||
// - 'dc:subject':
|
||||
// TODO: add user-specific keywords (from field 'user_keys') if the user is logged in
|
||||
if (!empty($row['keywords']))
|
||||
addMetaElement($record, "dc", "subject", array(), $row['keywords']);
|
||||
|
||||
// - 'dc:coverage':
|
||||
// TODO: should we add contents from the refbase 'area' field as 'dc:coverage' element(s)?
|
||||
|
||||
// - 'dc:relation':
|
||||
|
||||
// - Related URL:
|
||||
if (!empty($row['url']))
|
||||
addMetaElement($record, "dc", "relation", array(), $row['url'], "url");
|
||||
|
||||
// - Related FILE:
|
||||
if ($printURL)
|
||||
addMetaElement($record, "dc", "relation", array(), $URLprefix . $row['file'], "file");
|
||||
|
||||
// - 'dc:publisher':
|
||||
if (!empty($row['publisher']))
|
||||
addMetaElement($record, "dc", "publisher", array(), $row['publisher']);
|
||||
|
||||
// - 'dc:language':
|
||||
// TODO: convert to ISO notation (i.e. "en" instead of "English", etc)
|
||||
if (!empty($row['language']))
|
||||
addMetaElement($record, "dc", "language", array(), $row['language']);
|
||||
|
||||
|
||||
// ----------------------------------------------------------
|
||||
|
||||
// Add PRISM elements:
|
||||
// NOTE: When using the 'srw_dc' namespace (i.e. 'info:srw/schema/1/dc-v1.1' as detailed at
|
||||
// <http://www.loc.gov/standards/sru/resources/dc-schema.html>), I don't think it's allowed
|
||||
// to include anything but the fifteen elements from simple Dublin Core. Is this correct?
|
||||
// If so, then:
|
||||
//
|
||||
// TODO: Do we need to put the PRISM elements in <extraRecordData> instead? Or can we put them within
|
||||
// a separate branch outside of (and next to) the '<srw_dc:dc>' element? Or shall we better omit
|
||||
// them entirely?
|
||||
// More info on SRU Extra Data>: <http://www.loc.gov/standards/sru/specs/extra-data.html>
|
||||
//
|
||||
// See also "Mixing DC metadata with other metadata schemas" in "Guidelines for implementing
|
||||
// Dublin Core in XML" <http://dublincore.org/documents/dc-xml-guidelines/>
|
||||
|
||||
if ($metadataPrefix == "srw_dc") // we only include PRISM elements for 'srw_dc:dc' output
|
||||
{
|
||||
// - 'prism:issn':
|
||||
if (!empty($row['issn']))
|
||||
addMetaElement($record, "prism", "issn", array(), $row['issn']);
|
||||
|
||||
// - 'prism:publicationName':
|
||||
if (!empty($row['publication']))
|
||||
addMetaElement($record, "prism", "publicationName", array(), $row['publication']);
|
||||
elseif (!empty($row['abbrev_journal']))
|
||||
addMetaElement($record, "prism", "publicationName", array(), $row['abbrev_journal']);
|
||||
|
||||
// - 'prism:publicationDate':
|
||||
if (!empty($row['year']))
|
||||
addMetaElement($record, "prism", "publicationDate", array(), $row['year']);
|
||||
|
||||
// - 'prism:volume':
|
||||
if (!empty($row['volume']))
|
||||
addMetaElement($record, "prism", "volume", array(), $row['volume']);
|
||||
|
||||
// - 'prism:number':
|
||||
if (!empty($row['issue']))
|
||||
addMetaElement($record, "prism", "number", array(), $row['issue']);
|
||||
|
||||
// - 'prism:startingPage', 'prism:endingPage':
|
||||
// TODO: Similar code is used in 'include.in.php', 'modsxml.inc.php' and 'openurl.inc.php',
|
||||
// so this should be made into a dedicated function!
|
||||
if (!empty($row['pages']) AND preg_match("/\d+/i", $row['pages'])) // if the 'pages' field contains a number
|
||||
{
|
||||
$pages = preg_replace("/^\D*(\d+)( *[$dash]+ *\d+)?.*/i$patternModifiers", "\\1\\2", $row['pages']); // extract page range (if there's any), otherwise just the first number
|
||||
$startPage = preg_replace("/^\D*(\d+).*/i", "\\1", $row['pages']); // extract starting page
|
||||
$endPage = extractDetailsFromField("pages", $pages, "/\D+/", "[-1]"); // extract ending page (function 'extractDetailsFromField()' is defined in 'include.inc.php')
|
||||
// NOTE: To extract the ending page, we'll use function 'extractDetailsFromField()'
|
||||
// instead of just grabbing a matched regex pattern since it'll also work
|
||||
// when just a number but no range is given (e.g. when startPage = endPage)
|
||||
|
||||
// - 'prism:startingPage':
|
||||
if (preg_match("/\d+ *[$dash]+ *\d+/i$patternModifiers", $row['pages'])) // if there's a page range
|
||||
addMetaElement($record, "prism", "startingPage", array(), $startPage);
|
||||
|
||||
// - 'prism:endingPage':
|
||||
addMetaElement($record, "prism", "endingPage", array(), $endPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $record;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
?>
|
||||
523
includes/odfxml.inc.php
Normal file
523
includes/odfxml.inc.php
Normal file
@@ -0,0 +1,523 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/odfxml.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/odfxml.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 01-Jun-06, 12:49
|
||||
// Modified: $Date: 2017-04-13 02:00:18 +0000 (Thu, 13 Apr 2017) $
|
||||
// $Author: karnesky $
|
||||
// $Revision: 1416 $
|
||||
|
||||
// This include file contains functions that'll export records to ODF XML
|
||||
// in spreadsheet format ('.ods').
|
||||
// Requires ActiveLink PHP XML Package, which is available under the GPL from:
|
||||
// <http://www.active-link.com/software/>
|
||||
|
||||
|
||||
// Incorporate some include files:
|
||||
include_once 'includes/webservice.inc.php'; // include functions that are commonly used with the refbase webservices
|
||||
include_once 'includes/transtab_refbase_unicode.inc.php'; // include refbase markup -> Unicode search & replace patterns
|
||||
include_once 'includes/zip.inc.php';
|
||||
|
||||
// Import the ActiveLink Packages
|
||||
require_once("classes/include.php");
|
||||
import("org.active-link.xml.XML");
|
||||
import("org.active-link.xml.XMLDocument");
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Generates an ODF XML document
|
||||
function odfDocument($result, $odfBodyContentType)
|
||||
{
|
||||
global $contentTypeCharset; // these variables are defined in 'ini.inc.php'
|
||||
global $convertExportDataToUTF8;
|
||||
|
||||
$odfDocumentDoc = new XMLDocument();
|
||||
|
||||
if (($convertExportDataToUTF8 == "yes") AND ($contentTypeCharset != "UTF-8"))
|
||||
$odfDocumentDoc->setEncoding("UTF-8");
|
||||
else
|
||||
$odfDocumentDoc->setEncoding($contentTypeCharset);
|
||||
|
||||
// Setup root element:
|
||||
$odfDocument = new XML("office:document-content");
|
||||
|
||||
$rootAttributesArray = array(
|
||||
"xmlns:office" => "urn:oasis:names:tc:opendocument:xmlns:office:1.0",
|
||||
"xmlns:style" => "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
|
||||
"xmlns:text" => "urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
"xmlns:table" => "urn:oasis:names:tc:opendocument:xmlns:table:1.0",
|
||||
"xmlns:draw" => "urn:urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
|
||||
"xmlns:fo" => "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
|
||||
"xmlns:xlink" => "http://www.w3.org/1999/xlink",
|
||||
"xmlns:dc" => "http://purl.org/dc/elements/1.1/",
|
||||
"xmlns:meta" => "urn:oasis:names:tc:opendocument:xmlns:meta:1.0",
|
||||
"xmlns:number" => "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0",
|
||||
"xmlns:svg" => "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",
|
||||
"xmlns:chart" => "urn:oasis:names:tc:opendocument:xmlns:chart:1.0",
|
||||
"xmlns:dr3d" => "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",
|
||||
"xmlns:math" => "http://www.w3.org/1998/Math/MathML",
|
||||
"xmlns:form" => "urn:oasis:names:tc:opendocument:xmlns:form:1.0",
|
||||
"xmlns:script" => "urn:oasis:names:tc:opendocument:xmlns:script:1.0",
|
||||
"xmlns:ooo" => "http://openoffice.org/2004/office",
|
||||
"xmlns:ooow" => "http://openoffice.org/2004/writer",
|
||||
"xmlns:oooc" => "http://openoffice.org/2004/calc",
|
||||
"xmlns:dom" => "http://www.w3.org/2001/xml-events",
|
||||
"xmlns:xforms" => "http://www.w3.org/2002/xforms",
|
||||
"xmlns:xsd" => "http://www.w3.org/2001/XMLSchema",
|
||||
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
|
||||
"office:version" => "1.0"
|
||||
);
|
||||
|
||||
foreach ($rootAttributesArray as $attributeKey => $attributeValue)
|
||||
$odfDocument->setTagAttribute($attributeKey, $attributeValue);
|
||||
|
||||
// Add common attributes:
|
||||
addNewBranch($odfDocument, "office-document-common-attrs", array(), ""); // function 'addNewBranch()' is defined in 'webservice.inc.php'
|
||||
|
||||
// Add scripts:
|
||||
addNewBranch($odfDocument, "office:scripts", array(), "");
|
||||
|
||||
// Add font face declarations:
|
||||
$odfDocumentFontFaceDcls = new XMLBranch("office:font-face-decls");
|
||||
addNewBranch($odfDocumentFontFaceDcls, "style:font-face", array("style:name" => "Arial1", "svg:font-family" => "Arial", "style:font-pitch" => "variable"), "");
|
||||
addNewBranch($odfDocumentFontFaceDcls, "style:font-face", array("style:name" => "Lucidasans", "svg:font-family" => "Lucidasans", "style:font-pitch" => "variable"), "");
|
||||
addNewBranch($odfDocumentFontFaceDcls, "style:font-face", array("style:name" => "Arial", "svg:font-family" => "Arial", "style:font-family-generic" => "swiss", "style:font-pitch" => "variable"), "");
|
||||
$odfDocument->addXMLBranch($odfDocumentFontFaceDcls);
|
||||
|
||||
// Add automatic styles:
|
||||
if ($odfBodyContentType == "spreadsheet") // Define spreadsheet styles:
|
||||
{
|
||||
$odfDocumentAutoStyles = new XMLBranch("office:automatic-styles");
|
||||
|
||||
// Define table style:
|
||||
$odfDocumentStyle = new XMLBranch("style:style");
|
||||
$odfDocumentStyle->setTagAttribute("style:name", "ta1");
|
||||
$odfDocumentStyle->setTagAttribute("style:family", "table");
|
||||
$odfDocumentStyle->setTagAttribute("style:master-page-name", "Default");
|
||||
addNewBranch($odfDocumentStyle, "style:table-properties", array("table:display" => "true", "style:writing-mode" => "lr-tb"), "");
|
||||
$odfDocumentAutoStyles->addXMLBranch($odfDocumentStyle);
|
||||
|
||||
// Define style for first table row:
|
||||
$odfDocumentStyle = new XMLBranch("style:style");
|
||||
$odfDocumentStyle->setTagAttribute("style:name", "ro1");
|
||||
$odfDocumentStyle->setTagAttribute("style:family", "table-row");
|
||||
addNewBranch($odfDocumentStyle, "style:table-row-properties", array("style:row-height" => "0.1681in", "fo:break-before" => "auto", "style:use-optimal-row-height" => "true"), "");
|
||||
$odfDocumentAutoStyles->addXMLBranch($odfDocumentStyle);
|
||||
|
||||
// Define style for all other table rows:
|
||||
$odfDocumentStyle = new XMLBranch("style:style");
|
||||
$odfDocumentStyle->setTagAttribute("style:name", "ro2");
|
||||
$odfDocumentStyle->setTagAttribute("style:family", "table-row");
|
||||
addNewBranch($odfDocumentStyle, "style:table-row-properties", array("style:row-height" => "0.6425in", "fo:break-before" => "auto", "style:use-optimal-row-height" => "true"), "");
|
||||
$odfDocumentAutoStyles->addXMLBranch($odfDocumentStyle);
|
||||
|
||||
$odfDocument->addXMLBranch($odfDocumentAutoStyles);
|
||||
}
|
||||
|
||||
// Add body:
|
||||
$odfDocumentBody = new XMLBranch("office:body");
|
||||
|
||||
if ($odfBodyContentType == "spreadsheet") // generate ODF spreadsheet data
|
||||
{
|
||||
$odfSpreadsheet = odfSpreadsheet($result);
|
||||
$odfDocumentBody->addXMLasBranch($odfSpreadsheet);
|
||||
}
|
||||
|
||||
$odfDocument->addXMLBranch($odfDocumentBody);
|
||||
|
||||
$odfDocumentDoc->setXML($odfDocument);
|
||||
$odfDocumentString = $odfDocumentDoc->getXMLString();
|
||||
|
||||
return $odfDocumentString;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Generates ODF spreadsheet XML
|
||||
function odfSpreadsheet($result)
|
||||
{
|
||||
global $citeKeysArray; // '$citeKeysArray' is made globally available from within this function
|
||||
|
||||
$exportArray = array(); // array for individually exported records
|
||||
$citeKeysArray = array(); // array of cite keys (used to ensure uniqueness of cite keys among all exported records)
|
||||
|
||||
// Map ODF indexes to refbase field names, map ODF reference types to refbase types and define search & replace patterns:
|
||||
list($universalSearchReplaceActionsArray, $fieldSpecificSearchReplaceActionsArray, $odfIndexesToRefbaseFieldsArray, $referenceTypesToRefbaseTypesArray) = initializeArrays();
|
||||
|
||||
// Generate the export for each record and push them onto an array:
|
||||
while ($row = @ mysqli_fetch_array($result))
|
||||
{
|
||||
// Parse the current record into an array of field data that shall be exported to ODF:
|
||||
$recordExportArray = parseRecord($row, $odfIndexesToRefbaseFieldsArray, $referenceTypesToRefbaseTypesArray, $universalSearchReplaceActionsArray, $fieldSpecificSearchReplaceActionsArray);
|
||||
|
||||
// Export the current record as ODF XML in a spreadsheet table row:
|
||||
$record = odfSpreadsheetTableRow($recordExportArray, "data");
|
||||
|
||||
if (!empty($record)) // unless the record buffer is empty...
|
||||
array_push($exportArray, $record); // ...add it to an array of exports
|
||||
}
|
||||
|
||||
$odfSpreadsheet = new XML("office:spreadsheet");
|
||||
|
||||
$odfSpreadsheetTable = new XMLBranch("table:table");
|
||||
$odfSpreadsheetTable->setTagAttribute("table:name", "biblio");
|
||||
$odfSpreadsheetTable->setTagAttribute("table:style-name", "ta1");
|
||||
|
||||
$columnHeadings = odfSpreadsheetTableRow($odfIndexesToRefbaseFieldsArray, "heading"); // export column headings as ODF XML in a spreadsheet table row
|
||||
$odfSpreadsheetTable->addXMLasBranch($columnHeadings);
|
||||
|
||||
foreach ($exportArray as $tableRowXML)
|
||||
$odfSpreadsheetTable->addXMLasBranch($tableRowXML);
|
||||
|
||||
$odfSpreadsheet->addXMLBranch($odfSpreadsheetTable);
|
||||
|
||||
return $odfSpreadsheet;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Returns an XML table-row object of a single record
|
||||
function odfSpreadsheetTableRow($recordExportArray, $rowType)
|
||||
{
|
||||
// create an XML object for a single record
|
||||
$record = new XML("table:table-row");
|
||||
|
||||
if ($rowType == "heading")
|
||||
{
|
||||
$record->setTagAttribute("table:style-name", "ro1");
|
||||
|
||||
foreach ($recordExportArray as $odfIndex => $indexValue)
|
||||
{
|
||||
$tableCell = new XMLBranch("table:table-cell");
|
||||
|
||||
$tableCell->setTagAttribute("office:value-type", "string");
|
||||
$tableCell->setTagContent($odfIndex, "table:table-cell/text:p");
|
||||
|
||||
$record->addXMLBranch($tableCell);
|
||||
}
|
||||
}
|
||||
else // $rowType = "data"
|
||||
{
|
||||
$record->setTagAttribute("table:style-name", "ro2");
|
||||
|
||||
foreach ($recordExportArray as $odfIndex => $indexValue)
|
||||
{
|
||||
$tableCell = new XMLBranch("table:table-cell");
|
||||
|
||||
if (!empty($indexValue))
|
||||
{
|
||||
$tableCell->setTagAttribute("office:value-type", "string");
|
||||
$tableCell->setTagContent($indexValue, "table:table-cell/text:p");
|
||||
}
|
||||
|
||||
$record->addXMLBranch($tableCell);
|
||||
}
|
||||
}
|
||||
|
||||
return $record;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Parse a refbase record into an array of field data that shall be exported to ODF:
|
||||
function parseRecord($row, $odfIndexesToRefbaseFieldsArray, $referenceTypesToRefbaseTypesArray, $universalSearchReplaceActionsArray, $fieldSpecificSearchReplaceActionsArray)
|
||||
{
|
||||
global $officialDatabaseName; // these variables are defined in 'ini.inc.php'
|
||||
global $databaseBaseURL;
|
||||
global $contentTypeCharset;
|
||||
global $convertExportDataToUTF8;
|
||||
|
||||
$fieldParametersArray = array();
|
||||
|
||||
// this is a stupid hack that maps the names of the '$row' array keys to those used
|
||||
// by the '$formVars' array (which is required by function 'generateCiteKey()')
|
||||
// (eventually, the '$formVars' array should use the MySQL field names as names for its array keys)
|
||||
$formVars = buildFormVarsArray($row); // function 'buildFormVarsArray()' is defined in 'include.inc.php'
|
||||
|
||||
// generate or extract the cite key for this record
|
||||
$citeKey = generateCiteKey($formVars); // function 'generateCiteKey()' is defined in 'include.inc.php'
|
||||
|
||||
|
||||
// PARSE RECORD:
|
||||
|
||||
// parse the '$odfIndexesToRefbaseFieldsArray' which maps ODF indexes to refbase field names and assign fields accordingly:
|
||||
foreach ($odfIndexesToRefbaseFieldsArray as $odfIndex => $refbaseField)
|
||||
{
|
||||
if (empty($odfIndexesToRefbaseFieldsArray[$odfIndex]))
|
||||
{
|
||||
$fieldParametersArray[$odfIndex] = ""; // for any unsupported ODF index we'll insert an empty string
|
||||
}
|
||||
else
|
||||
{
|
||||
// copy row field data to array of field parameters (using the corresponding ODF index name as element key):
|
||||
if(!is_array($odfIndexesToRefbaseFieldsArray[$odfIndex]))
|
||||
{
|
||||
if (!empty($refbaseField) AND !empty($row[$refbaseField]))
|
||||
$fieldParametersArray[$odfIndex] = $row[$refbaseField];
|
||||
}
|
||||
else // if the current index's value in '$odfIndexesToRefbaseFieldsArray' is an array...
|
||||
{
|
||||
$useDefault = true;
|
||||
|
||||
// ...we'll extract field data from different refbase fields depending on the current record's reference type:
|
||||
foreach ($odfIndexesToRefbaseFieldsArray[$odfIndex] as $referenceType => $refbaseField)
|
||||
if (($row['type'] == $referenceType))
|
||||
{
|
||||
$useDefault = false;
|
||||
|
||||
if (is_array($odfIndexesToRefbaseFieldsArray[$odfIndex][$referenceType]))
|
||||
{
|
||||
foreach ($odfIndexesToRefbaseFieldsArray[$odfIndex][$referenceType] as $refbaseField)
|
||||
if (!empty($refbaseField) AND !empty($row[$refbaseField]))
|
||||
{
|
||||
$fieldParametersArray[$odfIndex] = $row[$refbaseField];
|
||||
break;
|
||||
}
|
||||
}
|
||||
elseif (!empty($refbaseField) AND !empty($row[$refbaseField]))
|
||||
{
|
||||
$fieldParametersArray[$odfIndex] = $row[$refbaseField];
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// 'Other' is used as default for all refbase types that were NOT explicitly specified:
|
||||
if ($useDefault AND !isset($fieldParametersArray[$odfIndex]) AND isset($odfIndexesToRefbaseFieldsArray[$odfIndex]['Other']))
|
||||
{
|
||||
if (is_array($odfIndexesToRefbaseFieldsArray[$odfIndex]['Other']))
|
||||
{
|
||||
foreach ($odfIndexesToRefbaseFieldsArray[$odfIndex]['Other'] as $refbaseField)
|
||||
if (!empty($refbaseField) AND !empty($row[$refbaseField]))
|
||||
{
|
||||
$fieldParametersArray[$odfIndex] = $row[$refbaseField];
|
||||
break;
|
||||
}
|
||||
}
|
||||
elseif (!empty($odfIndexesToRefbaseFieldsArray[$odfIndex]['Other']) AND !empty($row[$odfIndexesToRefbaseFieldsArray[$odfIndex]['Other']]))
|
||||
$fieldParametersArray[$odfIndex] = $row[$odfIndexesToRefbaseFieldsArray[$odfIndex]['Other']];
|
||||
}
|
||||
|
||||
// if this ODF field is still not set, 'Any' is used as default, no matter whether any refbase types were specified explicitly or not:
|
||||
if (!isset($fieldParametersArray[$odfIndex]) AND isset($odfIndexesToRefbaseFieldsArray[$odfIndex]['Any']))
|
||||
{
|
||||
if (is_array($odfIndexesToRefbaseFieldsArray[$odfIndex]['Any']))
|
||||
{
|
||||
foreach ($odfIndexesToRefbaseFieldsArray[$odfIndex]['Any'] as $refbaseField)
|
||||
if (!empty($refbaseField) AND !empty($row[$refbaseField]))
|
||||
{
|
||||
$fieldParametersArray[$odfIndex] = $row[$refbaseField];
|
||||
break;
|
||||
}
|
||||
}
|
||||
elseif (!empty($odfIndexesToRefbaseFieldsArray[$odfIndex]['Any']) AND !empty($row[$odfIndexesToRefbaseFieldsArray[$odfIndex]['Any']]))
|
||||
$fieldParametersArray[$odfIndex] = $row[$odfIndexesToRefbaseFieldsArray[$odfIndex]['Any']];
|
||||
}
|
||||
}
|
||||
|
||||
// if this ODF field isn't set yet, provide an empty string:
|
||||
if (!isset($fieldParametersArray[$odfIndex]))
|
||||
$fieldParametersArray[$odfIndex] = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// POST-PROCESS FIELD DATA:
|
||||
|
||||
// currently, we'll always overwrite the record serial in the 'Identifier' field with the generated cite key:
|
||||
// (this means that NO identifier will be exported if you've unchecked the export option "Include cite keys on export")
|
||||
$fieldParametersArray['Identifier'] = $citeKey;
|
||||
|
||||
// convert refbase type names into ODF type numbers:
|
||||
$fieldParametersArray['BibliographyType'] = $referenceTypesToRefbaseTypesArray[$fieldParametersArray['BibliographyType']];
|
||||
|
||||
// for theses, set the correct ODF type:
|
||||
if (!empty($row['thesis']))
|
||||
{
|
||||
if (($row['thesis'] == "Ph.D. thesis") OR ($row['thesis'] == "Doctoral thesis"))
|
||||
$fieldParametersArray['BibliographyType'] = "11"; // Dissertation
|
||||
else
|
||||
$fieldParametersArray['BibliographyType'] = "9"; // Thesis
|
||||
|
||||
if (isset($fieldParametersArray['Annote']))
|
||||
$fieldParametersArray['Annote'] .= "; " . $row['thesis']; // append type of thesis to ODF 'Annote' field
|
||||
else
|
||||
$fieldParametersArray['Annote'] = $row['thesis'];
|
||||
}
|
||||
|
||||
// if a DOI was copied to the URL field, we'll need to add the DOI resolver:
|
||||
if (!empty($row['doi']) AND preg_match("/^\d{2}\.\d{4}\//", $fieldParametersArray['URL']))
|
||||
$fieldParametersArray['URL'] = "http://dx.doi.org/" . $fieldParametersArray['URL'];
|
||||
|
||||
// use the series volume as volume if 'series_volume' contains some info, but 'volume' doesn't:
|
||||
if (empty($row['volume']) AND !empty($row['series_volume']))
|
||||
$fieldParametersArray['Volume'] = $row['series_volume'];
|
||||
|
||||
// set the fourth ODF custom field to a refbase database attribution string and the database URL:
|
||||
$fieldParametersArray['Custom4'] = "exported from " . $officialDatabaseName . " (" . $databaseBaseURL . ")";
|
||||
|
||||
// set the fifth ODF custom field to the record's permanent database URL:
|
||||
$fieldParametersArray['Custom5'] = $databaseBaseURL . "show.php?record=" . $row['serial'];
|
||||
|
||||
// apply universal search & replace actions, encode special chars and charset conversions to every field that shall be exported:
|
||||
foreach ($fieldParametersArray as $fieldName => $fieldValue)
|
||||
if (!empty($fieldValue))
|
||||
{
|
||||
// perform universal search & replace actions:
|
||||
if (!empty($universalSearchReplaceActionsArray))
|
||||
$fieldParametersArray[$fieldName] = searchReplaceText($universalSearchReplaceActionsArray, $fieldParametersArray[$fieldName], true); // function 'searchReplaceText()' is defined in 'include.inc.php'
|
||||
|
||||
// we only convert those special chars to entities which are supported by XML:
|
||||
$fieldParametersArray[$fieldName] = encodeHTMLspecialchars($fieldParametersArray[$fieldName]); // function 'encodeHTMLspecialchars()' is defined in 'include.inc.php'
|
||||
|
||||
// convert field data to UTF-8 (if '$convertExportDataToUTF8' is set to "yes" in 'ini.inc.php' and character encoding is not UTF-8 already):
|
||||
// (note that charset conversion can only be done *after* the cite key has been generated, otherwise cite key generation will produce garbled text!)
|
||||
if (($convertExportDataToUTF8 == "yes") AND ($contentTypeCharset != "UTF-8"))
|
||||
$fieldParametersArray[$fieldName] = convertToCharacterEncoding("UTF-8", "IGNORE", $fieldParametersArray[$fieldName]); // function 'convertToCharacterEncoding()' is defined in 'include.inc.php'
|
||||
}
|
||||
|
||||
// apply field-specific search & replace 'actions' to all fields that are listed in the 'fields' element of the arrays contained in '$fieldSpecificSearchReplaceActionsArray':
|
||||
foreach ($fieldSpecificSearchReplaceActionsArray as $fieldActionsArray)
|
||||
foreach ($fieldParametersArray as $fieldName => $fieldValue)
|
||||
if (in_array($fieldName, $fieldActionsArray['fields']))
|
||||
$fieldParametersArray[$fieldName] = searchReplaceText($fieldActionsArray['actions'], $fieldValue, true); // function 'searchReplaceText()' is defined in 'include.inc.php'
|
||||
|
||||
return $fieldParametersArray;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Map ODF indexes to refbase field names, map ODF reference types to refbase types and define search & replace patterns:
|
||||
function initializeArrays()
|
||||
{
|
||||
global $convertExportDataToUTF8; // defined in 'ini.inc.php'
|
||||
|
||||
// The array '$transtab_refbase_unicode' contains search & replace patterns for conversion from refbase markup to Unicode entities.
|
||||
global $transtab_refbase_unicode; // defined in 'transtab_refbase_unicode.inc.php'
|
||||
|
||||
// Defines universal search & replace actions:
|
||||
// (Note that the order of array elements IS important since it defines when a search/replace action gets executed)
|
||||
// (If you don't want to perform any search and replace actions, specify an empty array, like: '$universalSearchReplaceActionsArray = array();'.
|
||||
// Note that the search patterns MUST include the leading & trailing slashes -- which is done to allow for mode modifiers such as 'imsxU'.)
|
||||
// "/Search Pattern/" => "Replace Pattern"
|
||||
$universalSearchReplaceActionsArray = array(); // example: 'array("/&/" => "&", "/</" => "<");'
|
||||
|
||||
|
||||
// Defines field-specific search & replace 'actions' that will be applied to all those ODF fields that are listed in the corresponding 'fields' element:
|
||||
// (If you don't want to perform any search and replace actions, specify an empty array, like: '$fieldSpecificSearchReplaceActionsArray = array();'.
|
||||
// Note that the search patterns MUST include the leading & trailing slashes -- which is done to allow for mode modifiers such as 'imsxU'.)
|
||||
// "/Search Pattern/" => "Replace Pattern"
|
||||
$fieldSpecificSearchReplaceActionsArray = array();
|
||||
|
||||
if ($convertExportDataToUTF8 == "yes")
|
||||
$fieldSpecificSearchReplaceActionsArray[] = array(
|
||||
'fields' => array("Author", "Title", "Booktitle", "Journal", "Organizations", "Custom1", "Series", "Pages", "Note"),
|
||||
'actions' => $transtab_refbase_unicode
|
||||
);
|
||||
|
||||
|
||||
// Map ODF indexes to refbase field names:
|
||||
// Notes: - the special array key "Other" serves as a default for all refbase types that were NOT specified explicitly
|
||||
// - the special array key "Any" serves as a default for all refbase types
|
||||
// - instead of specifying a string with a single refbase field name, you can also give a sub-array of multiple refbase field names
|
||||
// where the first non-empty field will be taken as ODF field value
|
||||
// "ODF index name" => "refbase field name" // ODF index description (comment)
|
||||
$odfIndexesToRefbaseFieldsArray = array(
|
||||
"Identifier" => "serial", // a unique identifier for the bibliographic data (the 'parseRecord()' function will overwrite the record serial with a correct cite key if necessary)
|
||||
"BibliographyType" => "type", // the type of the bibliographic reference. It is of the type bibliographydatafield
|
||||
"Address" => "place", // the address of the publisher
|
||||
"Annote" => "notes", // an annotation
|
||||
"Author" => "author", // the name(s) of the author(s)
|
||||
"Booktitle" => array("Book Chapter" => "publication"), // the title of the book
|
||||
"Chapter" => array("Book Chapter" => "volume"), // name or number of the chapter
|
||||
"Edition" => "edition", // the number or name of the edition
|
||||
"Editor" => "editor", // the name(s) of the editor(s)
|
||||
"Howpublished" => "", // a description of the type of the publishing
|
||||
"Institution" => "", // the name of the institution where the publishing was created
|
||||
"Journal" => array("Journal Article" => array("publication", "abbrev_journal")), // the name of the journal
|
||||
"Month" => "", // number or name of the month of the publishing
|
||||
"Note" => "user_notes", // a note
|
||||
"Number" => "issue", // the number of the publishing
|
||||
"Organizations" => "address", // the name of the organizations where the publishing was created
|
||||
"Pages" => "pages", // the number(s) of the page(s) of the reference into a publishing
|
||||
"Publisher" => "publisher", // the name of the publisher
|
||||
"School" => "corporate_author", // the name of the university or school where the publishing was created
|
||||
"Series" => array("Any" => array("series_title", "abbrev_series_title")), // the series of the publishing
|
||||
"Title" => "title", // the title of the publishing
|
||||
"ReportType" => "", // a description of the type of the report
|
||||
"Volume" => "volume", // the volume of the publishing
|
||||
"Year" => "year", // the year when the publishing was created
|
||||
"URL" => array("Any" => array("doi", "url")), // URL of the publishing (in case of a DOI, the 'parseRecord()' function will prefix it with a DOI resolver)
|
||||
"ISBN" => "isbn", // the ISBN data of the publishing
|
||||
"Custom1" => "keywords", // user defined data
|
||||
"Custom2" => "user_keys", // user defined data
|
||||
"Custom3" => "user_groups", // user defined data
|
||||
"Custom4" => "", // user defined data (this field will be set to the database name and URL in function 'parseRecord()')
|
||||
"Custom5" => "" // user defined data (this field will be set to the record's permanent URL in function 'parseRecord()')
|
||||
);
|
||||
|
||||
|
||||
// This array matches ODF reference types with their corresponding refbase types:
|
||||
// ODF types which are currently not supported by refbase are commented out;
|
||||
// '#fallback#' in comments indicates a type mapping that is not a perfect match but as close as currently possible)
|
||||
// "refbase type" => "ODF type" // display name of ODF reference type (comment)
|
||||
$referenceTypesToRefbaseTypesArray = array(
|
||||
// "Journal Article" => "0", // Article (#fallback#; correct?)
|
||||
"Book Whole" => "1", // Book
|
||||
// "Book Whole" => "2", // Brochures (#fallback#)
|
||||
// "Book Whole" => "3", // Conference proceeding (correct? conference?)
|
||||
// "Book Chapter" => "4", // Book excerpt (#fallback#)
|
||||
"Book Chapter" => "5", // Book excerpt with title
|
||||
"Conference Article" => "6", // Conference proceeding (correct? inproceedings?)
|
||||
"Journal Article" => "7", // Journal (AFAIK, 'Journal' means a journal article and not a whole journal)
|
||||
"Manual" => "8", // Tech. Documentation (#fallback#)
|
||||
// "Book Whole" => "9", // Thesis (#fallback#; function 'parseRecord()' will set the ODF type to 'Thesis' if the refbase 'thesis' field isn't empty)
|
||||
"Miscellaneous" => "10", // Miscellaneous
|
||||
// "Book Whole" => "11", // Dissertation (#fallback#; function 'parseRecord()' will set the ODF type to 'Dissertation' if the refbase 'thesis' field contains either 'Ph.D. thesis' or 'Doctoral thesis'))
|
||||
"Conference Volume" => "12", // Conference proceeding (correct? proceedings?)
|
||||
"Report" => "13", // Research report (#fallback#)
|
||||
"Manuscript" => "14", // Unpublished (#fallback#)
|
||||
// "" => "15", // e-mail (currently not supported by refbase)
|
||||
// "" => "16", // WWW document (currently not supported by refbase)
|
||||
"Newspaper Article" => "17", // User-defined1
|
||||
"Magazine Article" => "18", // User-defined2
|
||||
"Patent" => "19", // User-defined3
|
||||
"Software" => "20", // User-defined4
|
||||
"Map" => "21" // User-defined5
|
||||
// "Abstract" => "" // could we specify more than 21 ODF types?
|
||||
// "Journal" => ""
|
||||
);
|
||||
|
||||
|
||||
return array($universalSearchReplaceActionsArray, $fieldSpecificSearchReplaceActionsArray, $odfIndexesToRefbaseFieldsArray, $referenceTypesToRefbaseTypesArray);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Encloses the ODF XML document given in '$content' with a minimal ODF file & directory
|
||||
// structure, and zips the generated directory of XML files as an ODF spreadsheet (ODS file)
|
||||
//
|
||||
// Author: Richard Karnesky <mailto:karnesky@gmail.com>
|
||||
function zipODF($content) {
|
||||
$zipfile = new zipfile();
|
||||
//$zipfile -> add_dir("META-INF/");
|
||||
$zipfile -> addFile($content, "content.xml"); // function 'addFile()' is defined in 'zip.inc.php'
|
||||
$zipfile -> addFile("", "styles.xml");
|
||||
$zipfile -> addFile("application/vnd.oasis.opendocument.spreadsheet","mimetype");
|
||||
$zipfile -> addFile("<?xml version=\"1.0\" encoding=\"UTF-8\"?><office:document-meta xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\" xmlns:ooo=\"http://openoffice.org/2004/office\" office:version=\"1.0\"><office:meta><meta:generator>refbase</meta:generator></office:meta></office:document-meta>","meta.xml");
|
||||
$zipfile -> addFile("<?xml version=\"1.0\" encoding=\"UTF-8\"?><manifest:manifest xmlns:manifest=\"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0\"><manifest:file-entry manifest:media-type=\"application/vnd.oasis.opendocument.spreadsheet\" manifest:full-path=\"/\"/><manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"content.xml\"/><manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"styles.xml\"/><manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"meta.xml\"/></manifest:manifest>","META-INF/manifest.xml");
|
||||
return $zipfile;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
?>
|
||||
330
includes/opensearch.inc.php
Normal file
330
includes/opensearch.inc.php
Normal file
@@ -0,0 +1,330 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/opensearch.inc.php
|
||||
// Repository: $HeadURL$
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 09-Jan-08, 00:30
|
||||
// Modified: $Date: 2008-09-18 13:54:33 +0000 (Thu, 18 Sep 2008) $
|
||||
// $Author$
|
||||
// $Revision: 1240 $
|
||||
|
||||
// This include file contains functions that'll return an OpenSearch response.
|
||||
// Requires ActiveLink PHP XML Package, which is available under the GPL from:
|
||||
// <http://www.active-link.com/software/>. See 'opensearch.php' for more info.
|
||||
// TODO: I18n
|
||||
|
||||
|
||||
// Incorporate some include files:
|
||||
include_once 'includes/webservice.inc.php'; // include functions that are commonly used with the refbase webservices
|
||||
|
||||
// Import the ActiveLink Packages
|
||||
require_once("classes/include.php");
|
||||
import("org.active-link.xml.XML");
|
||||
import("org.active-link.xml.XMLDocument");
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Return an OpenSearch description document if the OpenSearch client issued:
|
||||
// - .../opensearch.php?operation=explain
|
||||
//
|
||||
// Spec: <http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document>
|
||||
// See also: <http://developer.mozilla.org/en/docs/Creating_OpenSearch_plugins_for_Firefox>
|
||||
function openSearchDescription($exportStylesheet)
|
||||
{
|
||||
global $contentTypeCharset; // these variables are specified in 'ini.inc.php'
|
||||
global $convertExportDataToUTF8;
|
||||
global $officialDatabaseName;
|
||||
global $hostInstitutionName;
|
||||
global $hostInstitutionAbbrevName;
|
||||
global $feedbackEmail;
|
||||
global $databaseBaseURL;
|
||||
global $databaseKeywords;
|
||||
global $logoSmallImageURL;
|
||||
global $logoSmallImageWidth;
|
||||
global $logoSmallImageHeight;
|
||||
global $logoSmallImageType;
|
||||
global $faviconImageURL;
|
||||
|
||||
global $loc; // defined in 'locales/core.php'
|
||||
|
||||
$openSearchCollectionDoc = new XMLDocument();
|
||||
$openSearchCollectionDoc->setEncoding($contentTypeCharset);
|
||||
|
||||
$openSearchCollection = openSearchGenerateBaseTags("Description");
|
||||
|
||||
|
||||
// --- begin search engine info -----------------------------
|
||||
|
||||
// (note that we don't enforce any character length limits)
|
||||
|
||||
// The 'ShortName' element contains a brief human-readable title that identifies this search engine:
|
||||
// (the value must contain 16 or fewer characters of plain text)
|
||||
addNewBranch($openSearchCollection, "ShortName", array(), "refbase (" . $hostInstitutionAbbrevName . ")"); // function 'addNewBranch()' is defined in 'webservice.inc.php'
|
||||
|
||||
// The 'LongName' element contains an extended human-readable title that identifies this search engine:
|
||||
// (the value must contain 48 or fewer characters of plain text)
|
||||
addNewBranch($openSearchCollection, "LongName", array(), $officialDatabaseName);
|
||||
|
||||
// The 'Description' element contains a human-readable text description of the search engine:
|
||||
// (the value must contain 1024 or fewer characters of plain text)
|
||||
addNewBranch($openSearchCollection,
|
||||
"Description",
|
||||
array(),
|
||||
$officialDatabaseName . ": " . $loc["SearchMain"] . ". " . $loc["ThisDatabaseIsMaintained"] . " " . $hostInstitutionName . " (" . $hostInstitutionAbbrevName . ")."
|
||||
);
|
||||
|
||||
// The 'Tags' element contains a set of words that are used as keywords to identify and categorize the search content:
|
||||
// (the value must contain 256 or fewer characters of plain text; tags must be a single word and are delimited by the space character)
|
||||
addNewBranch($openSearchCollection, "Tags", array(), $databaseKeywords);
|
||||
|
||||
// The 'Contact' element contains an email address at which the maintainer of the description document can be reached:
|
||||
// (the value must conform to the requirements of Section 3.4.1 "Addr-spec specification" in RFC 2822 <http://tools.ietf.org/html/rfc2822>)
|
||||
addNewBranch($openSearchCollection, "Contact", array(), $feedbackEmail);
|
||||
|
||||
// The 'Attribution' element contains a list of all sources or entities that should be credited for the content contained in the search feed:
|
||||
// (the value must contain 256 or fewer characters of plain text)
|
||||
// addNewBranch($openSearchCollection, "Attribution", array(), "Search data copyright ..."); // uncomment and edit copyright statement if desired
|
||||
|
||||
// The 'SyndicationRight' element contains a value that indicates the degree to which the search results provided by this search engine can be queried, displayed, and redistributed:
|
||||
// (possible values: "open", "limited", "private", "closed"; see <http://www.opensearch.org/Specifications/OpenSearch/1.1#The_.22SyndicationRight.22_element>)
|
||||
addNewBranch($openSearchCollection, "SyndicationRight", array(), "open");
|
||||
|
||||
// The 'AdultContent' element contains a boolean value that should be set to true if the search results may contain material intended only for adults:
|
||||
// (possible values: "true", "false")
|
||||
addNewBranch($openSearchCollection, "AdultContent", array(), "false");
|
||||
|
||||
// The 'Language' element contains a string that indicates that the search engine supports search results in the specified language:
|
||||
// (the value must conform to the XML 1.0 Language Identification, as specified by RFC 3066 in <http://tools.ietf.org/html/rfc3066>;
|
||||
// in addition, a value of "*" signifies that the search engine does not restrict search results to any particular language)
|
||||
addNewBranch($openSearchCollection, "Language", array(), "*");
|
||||
|
||||
// The 'InputEncoding' element contains a string that indicates that the search engine supports search requests encoded with the specified character encoding:
|
||||
// (the value must conform to the XML 1.0 Character Encodings, as specified by the IANA Character Set Assignments: <http://www.iana.org/assignments/character-sets>)
|
||||
addNewBranch($openSearchCollection, "InputEncoding", array(), $contentTypeCharset);
|
||||
|
||||
// The 'OutputEncoding' element contains a string that indicates that the search engine supports search responses encoded with the specified character encoding:
|
||||
// (the value must conform to the XML 1.0 Character Encodings, as specified by the IANA Character Set Assignments: <http://www.iana.org/assignments/character-sets>)
|
||||
if (($convertExportDataToUTF8 == "yes") AND ($contentTypeCharset != "UTF-8"))
|
||||
addNewBranch($openSearchCollection, "OutputEncoding", array(), "UTF-8");
|
||||
else
|
||||
addNewBranch($openSearchCollection, "OutputEncoding", array(), $contentTypeCharset);
|
||||
|
||||
// The 'Developer' element contains the human-readable name or identifier of the creator or maintainer of the description document:
|
||||
// (the value must contain 64 or fewer characters of plain text)
|
||||
addNewBranch($openSearchCollection, "Developer", array(), "Web Reference Database (http://refbase.sourceforge.net)");
|
||||
|
||||
// The 'Query' element defines a search query that can be performed by search clients:
|
||||
// (Spec: <http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_Query_element>)
|
||||
addNewBranch($openSearchCollection,
|
||||
"Query",
|
||||
array("role" => "example",
|
||||
"title" => "Sample search",
|
||||
"searchTerms" => "Miller", // search term example (we could also use ".+" but an ubiquitous author name such as "Miller" seems more intuitive and almost always results in some hits)
|
||||
"startIndex" => "1", // index number of the first search result, starting with one
|
||||
"count" => $_SESSION['userRecordsPerPage'] // default number of records per page preferred by the current user
|
||||
),
|
||||
""
|
||||
);
|
||||
|
||||
// The 'Image' element contains a URL that identifies the location of an image that can be used in association with the search content:
|
||||
// (images with square aspect ratios are recommended, e.g. a 16x16 image of type ".ico" and a 64x64 image of type ".jpeg" or ".png")
|
||||
// - favicon image (16x16):
|
||||
addNewBranch($openSearchCollection,
|
||||
"Image",
|
||||
array("type" => "image/x-icon", // MIME type of this image
|
||||
"height" => "16", // image height, in pixels
|
||||
"width" => "16" // image width, in pixels
|
||||
),
|
||||
$databaseBaseURL . $faviconImageURL
|
||||
);
|
||||
|
||||
// - small logo image (e.g. 64x64):
|
||||
addNewBranch($openSearchCollection,
|
||||
"Image",
|
||||
array("type" => $logoSmallImageType,
|
||||
"height" => $logoSmallImageHeight,
|
||||
"width" => $logoSmallImageWidth
|
||||
),
|
||||
$databaseBaseURL . $logoSmallImageURL
|
||||
);
|
||||
|
||||
// --- end search engine info -------------------------------
|
||||
|
||||
|
||||
// --- begin URL templates ----------------------------------
|
||||
|
||||
// The 'Url' element describes an interface by which a search client can make search requests of the search engine:
|
||||
// - URL template for output of OpenSearch Atom XML (which is the default):
|
||||
addNewBranch($openSearchCollection,
|
||||
"Url",
|
||||
array("type" => "application/atom+xml", // MIME type of the search result format
|
||||
"template" => $databaseBaseURL . "opensearch.php?query={searchTerms}&startRecord={startIndex?}&maximumRecords={count?}&recordSchema=atom", // search URL template to be processed according to the OpenSearch URL template syntax
|
||||
"indexOffset" => "1", // index number of the first search result, starting with one
|
||||
// "pageOffset" => "1" // page number of the first set of search results (NOTE: currently, page-based searches are not supported by refbase)
|
||||
),
|
||||
""
|
||||
);
|
||||
|
||||
// - URL template for output of RSS XML:
|
||||
addNewBranch($openSearchCollection,
|
||||
"Url",
|
||||
array("type" => "application/rss+xml",
|
||||
"template" => $databaseBaseURL . "opensearch.php?query={searchTerms}&startRecord={startIndex?}&maximumRecords={count?}&recordSchema=rss",
|
||||
"indexOffset" => "1"
|
||||
),
|
||||
""
|
||||
);
|
||||
|
||||
// - URL template for output of SRW_DC XML:
|
||||
addNewBranch($openSearchCollection,
|
||||
"Url",
|
||||
array("type" => "application/xml",
|
||||
"template" => $databaseBaseURL . "opensearch.php?query={searchTerms}&startRecord={startIndex?}&maximumRecords={count?}&recordSchema=srw_dc",
|
||||
"indexOffset" => "1"
|
||||
),
|
||||
""
|
||||
);
|
||||
|
||||
// - URL template for output of SRW_MODS XML:
|
||||
addNewBranch($openSearchCollection,
|
||||
"Url",
|
||||
array("type" => "application/xml",
|
||||
"template" => $databaseBaseURL . "opensearch.php?query={searchTerms}&startRecord={startIndex?}&maximumRecords={count?}&recordSchema=srw_mods",
|
||||
"indexOffset" => "1"
|
||||
),
|
||||
""
|
||||
);
|
||||
|
||||
// - URL template for output of HTML:
|
||||
addNewBranch($openSearchCollection,
|
||||
"Url",
|
||||
array("type" => "text/html",
|
||||
"template" => $databaseBaseURL . "opensearch.php?query={searchTerms}&startRecord={startIndex?}&maximumRecords={count?}&recordSchema=html",
|
||||
"indexOffset" => "1"
|
||||
),
|
||||
""
|
||||
);
|
||||
|
||||
// - URL template for output of JSON-formatted search suggestions:
|
||||
//
|
||||
// NOTE: An URL template with 'type="application/x-suggestions+json"' is used by Firefox
|
||||
// to specify the URL to use for fetching search suggestions in JSON format
|
||||
// See also: <http://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox>
|
||||
// <http://developer.mozilla.org/en/Supporting_search_suggestions_in_search_plugins>
|
||||
// <http://www.opensearch.org/Specifications/OpenSearch/Extensions/Suggestions/1.0>
|
||||
// <http://hublog.hubmed.org/archives/001681.html>
|
||||
addNewBranch($openSearchCollection,
|
||||
"Url",
|
||||
array("type" => "application/x-suggestions+json",
|
||||
"template" => $databaseBaseURL . "opensearch.php?query={searchTerms}&startRecord={startIndex?}&maximumRecords={count?}&recordSchema=json&operation=suggest&client=sug-refbase_suggest-1.0",
|
||||
"indexOffset" => "1"
|
||||
),
|
||||
""
|
||||
);
|
||||
|
||||
// --- end URL templates ------------------------------------
|
||||
|
||||
|
||||
// --- begin Mozilla-specific elements ----------------------
|
||||
|
||||
// The 'SearchForm' element contains the URL to go to to open up the search page at the site for which the plugin is designed to search:
|
||||
// (this provides a way for Firefox to let the user visit the web site directly)
|
||||
addNewBranch($openSearchCollection, "mozilla:SearchForm", array(), $databaseBaseURL); // this will show the main refbase page with the Quick Search form (to link to other search pages, append '. "simple_search.php"' etc)
|
||||
|
||||
// --- end Mozilla-specific elements ------------------------
|
||||
|
||||
|
||||
$openSearchCollectionDoc->setXML($openSearchCollection);
|
||||
$openSearchCollectionString = $openSearchCollectionDoc->getXMLString();
|
||||
|
||||
// Add the XML Stylesheet definition:
|
||||
// Note that this is just a hack (that should get fixed) since I don't know how to do it properly using the ActiveLink PHP XML Package ?:-/
|
||||
if (!empty($exportStylesheet))
|
||||
$openSearchCollectionString = preg_replace("/(?=\<OpenSearchDescription)/i","<?xml-stylesheet type=\"text/xsl\" href=\"" . $exportStylesheet . "\"?>\n",$openSearchCollectionString);
|
||||
|
||||
return $openSearchCollectionString;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Return OpenSearch diagnostics (i.e. OpenSearch error information) wrapped into OpenSearch Atom XML:
|
||||
function openSearchDiagnostics($diagCode, $diagDetails, $exportStylesheet)
|
||||
{
|
||||
global $contentTypeCharset; // defined in 'ini.inc.php'
|
||||
|
||||
// Map SRU/W diagnostic numbers to their corresponding messages:
|
||||
// (i.e., for OpenSearch diagnostics, we simply re-use the SRU/W diagnostics)
|
||||
$diagMessages = mapSRWDiagnostics(); // function 'mapSRWDiagnostics()' is defined in 'webservice.inc.php'
|
||||
|
||||
if (isset($diagMessages[$diagCode]))
|
||||
$diagMessage = $diagMessages[$diagCode];
|
||||
else
|
||||
$diagMessage = "Unknown error";
|
||||
|
||||
$atomCollectionDoc = new XMLDocument();
|
||||
$atomCollectionDoc->setEncoding($contentTypeCharset);
|
||||
|
||||
$atomCollection = openSearchGenerateBaseTags("Error");
|
||||
|
||||
// add feed-level tags:
|
||||
|
||||
// - 'id':
|
||||
addNewBranch($atomCollection, "id", array(), "info:srw/diagnostic/1/"); // could something else be used as diagnostics feed ID instead?
|
||||
|
||||
// - OpenSearch elements:
|
||||
addNewBranch($atomCollection, "opensearch:totalResults", array(), "1");
|
||||
addNewBranch($atomCollection, "openSearch:startIndex", array(), "1");
|
||||
addNewBranch($atomCollection, "openSearch:itemsPerPage", array(), "1");
|
||||
|
||||
$diagnosticsBranch = new XMLBranch("entry");
|
||||
|
||||
// add entry-level tags:
|
||||
addNewBranch($diagnosticsBranch, "title", array(), $diagMessage);
|
||||
// addNewBranch($atomCollection, "link", array("href" => ""), ""); // TODO (what could be used as link for a diagnostics entry?)
|
||||
addNewBranch($diagnosticsBranch, "updated", array(), generateISO8601TimeStamp()); // function 'generateISO8601TimeStamp()' is defined in 'include.inc.php'
|
||||
addNewBranch($diagnosticsBranch, "id", array(), "info:srw/diagnostic/1/" . $diagCode);
|
||||
|
||||
$diagContent = $diagMessage;
|
||||
if (!empty($diagDetails))
|
||||
$diagContent .= ": " . $diagDetails;
|
||||
|
||||
addNewBranch($diagnosticsBranch, "content", array("type" => "text"), "Error " . $diagCode . ": " . $diagContent); // TODO: I18n
|
||||
|
||||
$atomCollection->addXMLBranch($diagnosticsBranch);
|
||||
|
||||
$atomCollectionDoc->setXML($atomCollection);
|
||||
$atomCollectionString = $atomCollectionDoc->getXMLString();
|
||||
|
||||
return $atomCollectionString;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Generate the basic OpenSearch XML tree required for a query response:
|
||||
function openSearchGenerateBaseTags($openSearchOperation)
|
||||
{
|
||||
if ($openSearchOperation == "Error") // OpenSearch Atom XML is used for diagnostics
|
||||
$atomCollection = atomGenerateBaseTags($openSearchOperation); // function 'atomGenerateBaseTags()' is defined in 'atomxml.inc.php'
|
||||
|
||||
elseif ($openSearchOperation == "Description") // OpenSearch Description XML
|
||||
{
|
||||
$atomCollection = new XML("OpenSearchDescription");
|
||||
|
||||
$atomCollection->setTagAttribute("xmlns", "http://a9.com/-/spec/opensearch/1.1/");
|
||||
$atomCollection->setTagAttribute("xmlns:opensearch", "http://a9.com/-/spec/opensearch/1.1/");
|
||||
$atomCollection->setTagAttribute("xmlns:mozilla", "http://www.mozilla.org/2006/browser/search/");
|
||||
}
|
||||
|
||||
return $atomCollection;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
?>
|
||||
261
includes/openurl.inc.php
Normal file
261
includes/openurl.inc.php
Normal file
@@ -0,0 +1,261 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/openurl.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/openurl.inc.php $
|
||||
// Author(s): Richard Karnesky <mailto:karnesky@gmail.com>
|
||||
//
|
||||
// Created: 06-Sep-06, 16:30
|
||||
// Modified: $Date: 2012-02-29 00:15:45 +0000 (Wed, 29 Feb 2012) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1349 $
|
||||
|
||||
// This include file contains functions that generate OpenURL and COinS data.
|
||||
// More info about the OpenURL standard (including pointers to further documentation) is available
|
||||
// at <http://en.wikipedia.org/wiki/OpenURL>. For more info about COinS, see <http://ocoins.info/>.
|
||||
|
||||
// TODO: Multiple aus have the same array key, so we apped a number that is later stripped
|
||||
// Cleanup if possible
|
||||
|
||||
|
||||
// Include refbase markup -> plain text search & replace patterns
|
||||
include 'includes/transtab_refbase_ascii.inc.php';
|
||||
|
||||
function openURL($row, $resolver = "") {
|
||||
global $openURLResolver; // these variables are defined in 'ini.inc.php'
|
||||
global $crossRefReqDat;
|
||||
global $hostInstitutionAbbrevName;
|
||||
|
||||
$co = contextObject($row);
|
||||
$co["sid"] = "refbase:" . $hostInstitutionAbbrevName;
|
||||
|
||||
if (empty($resolver))
|
||||
$resolver = $openURLResolver;
|
||||
|
||||
$openURL = $resolver;
|
||||
|
||||
if (!preg_match("/\?/", $resolver))
|
||||
$openURL .= "?";
|
||||
else
|
||||
$openURL .= "&";
|
||||
|
||||
if (preg_match("#^http://www\.crossref\.org/openurl#", $openURL) && !empty($crossRefReqDat))
|
||||
$openURL .= "pid=" . rawurlencode($crossRefReqDat) . "&";
|
||||
|
||||
$openURL .= "ctx_ver=Z39.88-2004";
|
||||
|
||||
foreach ($co as $coKey => $coValue) {
|
||||
$coKey = preg_replace("/rft./i", "", $coKey);
|
||||
$coKey = preg_replace("/au[0-9]*/i", "au", $coKey);
|
||||
$openURL .= "&" . $coKey . "=" . rawurlencode($coValue);
|
||||
}
|
||||
|
||||
return $openURL;
|
||||
}
|
||||
|
||||
function coins($row) {
|
||||
// fmt_info (type)
|
||||
$fmt = "info:ofi/fmt:kev:mtx:";
|
||||
// 'dissertation' is compatible with the 1.0 spec, but not the 0.1 spec
|
||||
if (!empty($row['thesis']))
|
||||
$fmt .= "dissertation";
|
||||
elseif (preg_match("/Journal/", $row['type']))
|
||||
$fmt .= "journal";
|
||||
elseif (preg_match("/Patent/", $row['type']))
|
||||
$fmt .= "patent";
|
||||
elseif (preg_match("/Book/", $row['type']))
|
||||
$fmt .= "book";
|
||||
// 'dc' (dublin core) is compatible with the 1.0 spec, but not the 0.1 spec.
|
||||
// We default to this, as it is the most generic type.
|
||||
else
|
||||
$fmt .= "dc";
|
||||
|
||||
$co = contextObject($row);
|
||||
|
||||
$coins = "ctx_ver=Z39.88-2004" . "&rft_val_fmt=" . urlencode($fmt);
|
||||
|
||||
foreach ($co as $coKey => $coValue) {
|
||||
// 'urlencode()' differs from 'rawurlencode() (i.e., RFC1738 encoding)
|
||||
// in that spaces are encoded as plus (+) signs
|
||||
$coKey = preg_replace("/au[0-9]*/i", "au", $coKey);
|
||||
|
||||
// While COinS does not specify encoding, most javascript tools assume that it is UTF-8
|
||||
// TODO: use function 'detectCharacterEncoding()' instead of the 'mb_*()' functions?
|
||||
// if (($contentTypeCharset == "ISO-8859-1") AND (detectCharacterEncoding($coValue) != "UTF-8"))
|
||||
if (mb_detect_encoding($coValue) != "UTF-8" || !(mb_check_encoding($coValue,"UTF-8")))
|
||||
$coValue = utf8_encode($coValue);
|
||||
$coins .= "&" . $coKey . "=" . urlencode($coValue);
|
||||
}
|
||||
$coins .= "%26ctx_enc%3Dinfo%3Aofi%2Fenc%3AUTF-8";
|
||||
|
||||
$coinsSpan = "<span class=\"Z3988\" title=\"" . $coins . "\"></span>";
|
||||
|
||||
return $coinsSpan;
|
||||
}
|
||||
|
||||
function contextObject($row) {
|
||||
global $databaseBaseURL; // defined in 'ini.inc.php'
|
||||
|
||||
// The array '$transtab_refbase_ascii' contains search & replace patterns for
|
||||
// conversion from refbase markup to plain text
|
||||
global $transtab_refbase_ascii; // defined in 'transtab_refbase_ascii.inc.php'
|
||||
|
||||
// Defines search & replace 'actions' that will be applied to all those
|
||||
// refbase fields that are listed in the corresponding 'fields' element:
|
||||
$plainTextSearchReplaceActionsArray = array(
|
||||
array(
|
||||
'fields' => array("title", "publication", "abbrev_journal", "address", "keywords", "abstract", "orig_title", "series_title", "abbrev_series_title", "notes"),
|
||||
'actions' => $transtab_refbase_ascii
|
||||
)
|
||||
);
|
||||
|
||||
foreach ($row as $rowFieldName => $rowFieldValue)
|
||||
// Apply search & replace 'actions' to all fields that are listed in the 'fields'
|
||||
// element of the arrays contained in '$plainTextSearchReplaceActionsArray':
|
||||
foreach ($plainTextSearchReplaceActionsArray as $fieldActionsArray)
|
||||
if (in_array($rowFieldName, $fieldActionsArray['fields']))
|
||||
// function 'searchReplaceText()' is defined in 'include.inc.php'
|
||||
$row[$rowFieldName] = searchReplaceText($fieldActionsArray['actions'], $row[$rowFieldName], true);
|
||||
|
||||
$co = array();
|
||||
|
||||
// rfr_id
|
||||
$co["rfr_id"] = "info:sid/" . preg_replace("#http://#", "", $databaseBaseURL);
|
||||
|
||||
// genre (type)
|
||||
if (isset($row['type'])) {
|
||||
if ($row['type'] == "Journal Article")
|
||||
$co["rft.genre"] = "article";
|
||||
elseif ($row['type'] == "Book Chapter")
|
||||
$co["rft.genre"] = "bookitem";
|
||||
elseif ($row['type'] == "Book Whole")
|
||||
$co["rft.genre"] = "book";
|
||||
elseif ($row['type'] == "Conference Article")
|
||||
$co["rft.genre"] = "proceeding";
|
||||
elseif ($row['type'] == "Conference Volume")
|
||||
$co["rft.genre"] = "conference";
|
||||
elseif ($row['type'] == "Journal")
|
||||
$co["rft.genre"] = "journal";
|
||||
elseif ($row['type'] == "Manuscript")
|
||||
$co["rft.genre"] = "preprint";
|
||||
elseif ($row['type'] == "Report")
|
||||
$co["rft.genre"] = "report"; // "report" is only supported by OpenURL v1.0 (but not v0.1)
|
||||
}
|
||||
|
||||
// atitle, btitle, title (title, publication)
|
||||
if (($row['type'] == "Journal Article") || ($row['type'] == "Book Chapter")) {
|
||||
if (!empty($row['title']))
|
||||
$co["rft.atitle"] = $row['title'];
|
||||
if (!empty($row['publication'])) {
|
||||
$co["rft.title"] = $row['publication'];
|
||||
if ($row['type'] == "Book Chapter")
|
||||
$co["rft.btitle"] = $row['publication'];
|
||||
}
|
||||
}
|
||||
elseif (!empty($row['title']))
|
||||
$co["rft.title"] = $row['title'];
|
||||
if (($row['type'] == "Book Whole") && (!empty($row['title'])))
|
||||
$co["rft.btitle"] = $row['title'];
|
||||
|
||||
// stitle (abbrev_journal)
|
||||
if (!empty($row['abbrev_journal'])) {
|
||||
$co["rft.stitle"] = $row['abbrev_journal'];
|
||||
if (empty($row['publication']) && (!isset($co["rft.title"]))) {
|
||||
// we duplicate the abbreviated journal name to 'rft.title' since the
|
||||
// CrossRef resolver seems to require 'rft.title' (otherwise it aborts
|
||||
// with an error: "No journal identifier supplied")
|
||||
$co["rft.title"] = $row['abbrev_journal'];
|
||||
}
|
||||
}
|
||||
|
||||
// series (series_title)
|
||||
if (!empty($row['series_title']))
|
||||
$co["rft.series"] = $row['series_title'];
|
||||
|
||||
// issn
|
||||
if (!empty($row['issn']))
|
||||
$co["rft.issn"] = $row['issn'];
|
||||
|
||||
// isbn
|
||||
if (!empty($row['isbn']))
|
||||
$co["rft.isbn"] = $row['isbn'];
|
||||
|
||||
// date (year)
|
||||
if (!empty($row['year']))
|
||||
$co["rft.date"] = $row['year'];
|
||||
|
||||
// volume
|
||||
if (!empty($row['volume']))
|
||||
$co["rft.volume"] = $row['volume'];
|
||||
|
||||
// issue
|
||||
if (!empty($row['issue']))
|
||||
$co["rft.issue"] = $row['issue'];
|
||||
|
||||
// spage, epage, tpages (pages)
|
||||
// NOTE: lifted from modsxml.inc.php--should throw some into a new include file
|
||||
if (!empty($row['pages'])) {
|
||||
if (preg_match("/[0-9] *- *[0-9]/", $row['pages'])) {
|
||||
list($pagestart, $pageend) = preg_split('/\s*[-]\s*/', $row['pages']);
|
||||
if ($pagestart < $pageend) {
|
||||
$co["rft.spage"] = $pagestart;
|
||||
$co["rft.epage"] = $pageend;
|
||||
}
|
||||
}
|
||||
elseif ($row['type'] == "Book Whole") {
|
||||
$pagetotal = preg_replace('/^(\d+)\s*pp?\.?$/', "\\1", $row['pages']);
|
||||
$co["rft.tpages"] = $pagetotal;
|
||||
}
|
||||
else
|
||||
$co["rft.spage"] = $row['pages'];
|
||||
}
|
||||
|
||||
// aulast, aufirst, author (author)
|
||||
if (!empty($row['author'])) {
|
||||
$author = $row['author'];
|
||||
$aulast = extractAuthorsLastName("/ *; */", "/ *, */", 1, $author);
|
||||
$aufirst = extractAuthorsGivenName("/ *; */", "/ *, */", 1, $author);
|
||||
if (!empty($aulast))
|
||||
$co["rft.aulast"] = $aulast;
|
||||
if (!empty($aufirst))
|
||||
$co["rft.aufirst"] = $aufirst;
|
||||
// TODO: cleanup and put this function in include.inc.php?
|
||||
$authorcount = count(preg_split("/ *; */", $author));
|
||||
for ($i=0; $i < $authorcount-1; $i++){
|
||||
$aul = extractAuthorsLastName("/ *; */", "/ *, */", $i+2, $author);
|
||||
$auf = extractAuthorsGivenName("/ *; */", "/ *, */", $i+2, $author);
|
||||
if (!empty($aul)) {
|
||||
$au = $aul;
|
||||
if (!empty($auf))
|
||||
$au .= ", ";
|
||||
}
|
||||
if (!empty($auf))
|
||||
$au .= $auf;
|
||||
if (!empty($au))
|
||||
$co["rft.au".$i] = $au;
|
||||
}
|
||||
}
|
||||
|
||||
// pub (publisher)
|
||||
if (!empty($row['publisher']))
|
||||
$co["rft.pub"] = $row['publisher'];
|
||||
|
||||
// place
|
||||
if (!empty($row['place']))
|
||||
$co["rft.place"] = $row['place'];
|
||||
|
||||
// id (doi, url)
|
||||
if (!empty($row['doi']))
|
||||
$co["rft_id"] = "info:doi/" . $row['doi'];
|
||||
elseif (!empty($row['url']))
|
||||
$co["rft_id"] = $row['url'];
|
||||
|
||||
return $co;
|
||||
}
|
||||
?>
|
||||
75
includes/results_header.inc.php
Normal file
75
includes/results_header.inc.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/results_header.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/results_header.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 07-May-04, 14:38
|
||||
// Modified: $Date: 2008-09-29 21:36:08 +0000 (Mon, 29 Sep 2008) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1248 $
|
||||
|
||||
// This is the results header include file.
|
||||
// It contains functions that build the results header
|
||||
// which gets displayed on every search results page.
|
||||
// TODO: I18n
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
function displayResultsHeader($href, $formElementsGroup, $formElementsRefine, $formElementsDisplayOptions, $displayType)
|
||||
{
|
||||
global $useVisualEffects; // these variables are defined in 'ini.inc.php'
|
||||
global $displayResultsHeaderDefault;
|
||||
|
||||
global $loc; // defined in 'locales/core.php'
|
||||
|
||||
$resultsHeaderToggleText = "Search & Display Options";
|
||||
|
||||
if (isset($displayResultsHeaderDefault[$displayType]) AND ($displayResultsHeaderDefault[$displayType] == "open"))
|
||||
{
|
||||
$resultsHeaderDisplayStyle = "block";
|
||||
$resultsHeaderToggleImage = "img/open.gif";
|
||||
$resultsHeaderInitialToggleText = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
$resultsHeaderDisplayStyle = "none";
|
||||
$resultsHeaderToggleImage = "img/closed.gif";
|
||||
$resultsHeaderInitialToggleText = encodeHTML($resultsHeaderToggleText); // function 'encodeHTML()' is defined in 'include.inc.php'
|
||||
}
|
||||
|
||||
if ($useVisualEffects == "yes")
|
||||
$toggleVisibilityFunction = "toggleVisibilitySlide";
|
||||
else
|
||||
$toggleVisibilityFunction = "toggleVisibility";
|
||||
?>
|
||||
|
||||
<div class="resultsheader">
|
||||
<div class="showhide">
|
||||
<a href="javascript:<?php echo $toggleVisibilityFunction; ?>('resultoptions','resultsHeaderToggleimg','resultsHeaderToggletxt','<?php echo rawurlencode($resultsHeaderToggleText); ?>')"<?php echo addAccessKey("attribute", "header"); ?> title="<?php echo $loc["LinkTitle_ToggleVisibility"] . addAccessKey("title", "header"); ?>">
|
||||
<img id="resultsHeaderToggleimg" class="toggleimg" src="<?php echo $resultsHeaderToggleImage; ?>" alt="<?php echo $loc["LinkTitle_ToggleVisibility"]; ?>" width="9" height="9" hspace="0" border="0">
|
||||
<span id="resultsHeaderToggletxt" class="toggletxt"><?php echo $resultsHeaderInitialToggleText; ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div id="resultoptions" style="display: <?php echo $resultsHeaderDisplayStyle; ?>;">
|
||||
<div id="showgroup">
|
||||
<?php echo $formElementsGroup; ?>
|
||||
</div>
|
||||
<div id="refineresults">
|
||||
<?php echo $formElementsRefine; ?>
|
||||
</div>
|
||||
<div id="displayopt">
|
||||
<?php echo $formElementsDisplayOptions; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div><?php
|
||||
}
|
||||
?>
|
||||
696
includes/srwxml.inc.php
Normal file
696
includes/srwxml.inc.php
Normal file
@@ -0,0 +1,696 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/srwxml.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/srwxml.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de> and
|
||||
// Richard Karnesky <mailto:karnesky@gmail.com>
|
||||
//
|
||||
// Created: 17-May-05, 16:38
|
||||
// Modified: $Date: 2017-04-13 02:00:18 +0000 (Thu, 13 Apr 2017) $
|
||||
// $Author: karnesky $
|
||||
// $Revision: 1416 $
|
||||
|
||||
// This include file contains functions that'll export records to SRW XML.
|
||||
// Requires ActiveLink PHP XML Package, which is available under the GPL from:
|
||||
// <http://www.active-link.com/software/>. See 'sru.php' for more info.
|
||||
|
||||
|
||||
// Incorporate some include files:
|
||||
include_once 'includes/webservice.inc.php'; // include functions that are commonly used with the refbase webservices
|
||||
|
||||
// Import the ActiveLink Packages
|
||||
require_once("classes/include.php");
|
||||
import("org.active-link.xml.XML");
|
||||
import("org.active-link.xml.XMLDocument");
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Return DC XML or MODS XML records wrapped into SRW XML ('searchRetrieveResponse'):
|
||||
function srwCollection($result, $rowOffset, $showRows, $exportStylesheet, $displayType)
|
||||
{
|
||||
global $contentTypeCharset; // these variables are defined in 'ini.inc.php'
|
||||
global $convertExportDataToUTF8;
|
||||
|
||||
global $exportFormat; // this is needed so that we can distinguish between "SRW_DC XML" and "SRW_MODS XML" record formats
|
||||
|
||||
// The array '$transtab_refbase_unicode' contains search & replace patterns
|
||||
// for conversion from refbase markup to Unicode entities.
|
||||
global $transtab_refbase_unicode; // defined in 'transtab_refbase_unicode.inc.php'
|
||||
|
||||
global $fieldSpecificSearchReplaceActionsArray;
|
||||
|
||||
// Individual records are objects and collections of records are strings
|
||||
|
||||
// Defines field-specific search & replace 'actions' that will be applied to all those refbase fields that are listed in the corresponding 'fields' element:
|
||||
// (If you don't want to perform any search and replace actions, specify an empty array, like: '$fieldSpecificSearchReplaceActionsArray = array();'.
|
||||
// Note that the search patterns MUST include the leading & trailing slashes -- which is done to allow for mode modifiers such as 'imsxU'.)
|
||||
// "/Search Pattern/" => "Replace Pattern"
|
||||
$fieldSpecificSearchReplaceActionsArray = array();
|
||||
|
||||
if ($convertExportDataToUTF8 == "yes")
|
||||
$fieldSpecificSearchReplaceActionsArray[] = array('fields' => array("title", "publication", "abbrev_journal", "address", "keywords", "abstract", "orig_title", "series_title", "abbrev_series_title", "notes"),
|
||||
'actions' => $transtab_refbase_unicode
|
||||
);
|
||||
|
||||
$srwCollectionDoc = new XMLDocument();
|
||||
|
||||
if (($convertExportDataToUTF8 == "yes") AND ($contentTypeCharset != "UTF-8"))
|
||||
$srwCollectionDoc->setEncoding("UTF-8");
|
||||
else
|
||||
$srwCollectionDoc->setEncoding($contentTypeCharset);
|
||||
|
||||
$srwCollection = srwGenerateBaseTags("searchRetrieveResponse");
|
||||
|
||||
$showRowsOriginal = $showRows; // save original value of '$showRows' (which may get modified by the 'seekInMySQLResultsToOffset()' function below)
|
||||
|
||||
// Find out how many rows are available and (if there were rows found) seek to the current offset:
|
||||
// function 'seekInMySQLResultsToOffset()' is defined in 'include.inc.php'
|
||||
list($result, $rowOffset, $showRows, $rowsFound, $previousOffset, $nextOffset, $showMaxRow) = seekInMySQLResultsToOffset($result, $rowOffset, $showRows, $displayType, "");
|
||||
|
||||
addNewBranch($srwCollection, "srw:numberOfRecords", array(), $rowsFound); // function 'addNewBranch()' is defined in 'webservice.inc.php'
|
||||
|
||||
// <srw:resultSetId> not supported
|
||||
// <srw:resultSetIdleTime> not supported
|
||||
|
||||
$srwRecordsBranch = new XMLBranch("srw:records");
|
||||
|
||||
if ($showRowsOriginal != 0) // we omit the records list in the response if the SRU query did contain 'maximumRecords=0'
|
||||
{
|
||||
$exportArray = array(); // Array for individually exported records
|
||||
|
||||
// Generate the export for each record and push them onto an array:
|
||||
for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ mysqli_fetch_array($result))); $rowCounter++)
|
||||
{
|
||||
if (preg_match("/DC/i", $exportFormat)) // export the current record as DC XML (i.e. simple Dublin Core):
|
||||
$record = oaidcRecord($row, "srw_dc"); // function 'oaidcRecord()' is defined in 'oaidcxml.inc.php'
|
||||
else // by default, we export the current record as MODS XML:
|
||||
$record = modsRecord($row); // function 'modsRecord()' is defined in 'modsxml.inc.php'
|
||||
|
||||
// TODO: build 'extraRecordData' for OAI-PMH (see below) using:
|
||||
// $row['serial'], $row['modified_date'], $row['modified_time']
|
||||
|
||||
if (!empty($record)) // unless the record buffer is empty...
|
||||
array_push($exportArray, $record); // ...add it to an array of exports
|
||||
}
|
||||
|
||||
$i = $rowOffset; // initialize counter
|
||||
|
||||
// for each of the DC/MODS records in the result set...
|
||||
foreach ($exportArray as $record)
|
||||
{
|
||||
++$i; // increment $i by one, then return $i
|
||||
|
||||
$srwRecordBranch = new XMLBranch("srw:record");
|
||||
|
||||
if (preg_match("/DC/i", $exportFormat))
|
||||
srwGeneratePackingSchema($srwRecordBranch, "xml", "dc");
|
||||
else
|
||||
srwGeneratePackingSchema($srwRecordBranch, "xml", "mods");
|
||||
|
||||
$srwRecordDataBranch = new XMLBranch("srw:recordData");
|
||||
|
||||
if (preg_match("/MODS/i", $exportFormat))
|
||||
{
|
||||
// NOTE: converting the MODS object into a string to perform search & replace actions
|
||||
// may be very clumsy but I don't know any better... ?:-/
|
||||
$recordString = $record->getXMLString();
|
||||
$recordString = preg_replace('/<mods/i','<mods xmlns="http://www.loc.gov/mods/v3"',$recordString);
|
||||
// alternatively to the above line we could add a 'mods:' identifier to all MODS XML tags:
|
||||
// $recordString = preg_replace("#<(/)?#","<\\1mods:",$recordString);
|
||||
$record->removeAllBranches();
|
||||
$record->parseFromString($recordString);
|
||||
}
|
||||
|
||||
$srwRecordDataBranch->addXMLasBranch($record);
|
||||
$srwRecordBranch->addXMLBranch($srwRecordDataBranch);
|
||||
|
||||
// TODO: add 'extraRecordData' for OAI-PMH as explained in <http://www.dlib.org/dlib/february05/sanderson/02sanderson.html>
|
||||
// Example:
|
||||
// <extraRecordData>
|
||||
// <oai:header xmlns:oai="http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
|
||||
// <oai:identifier>...</oai:identifier>
|
||||
// <oai:datestamp>...</oai:datestamp>
|
||||
// <oai:setSpec>...</oai:setSpec>
|
||||
// </oai:header>
|
||||
// </extraRecordData>
|
||||
//
|
||||
// Then add to the SRW 'Explain' response:
|
||||
// 1. an oai.identifier index containing a unique identifier for each record in the database
|
||||
// 2. an oai.datestamp index containing the date/time the record was added or changed in the database
|
||||
// 3. an optional oai.set index, browsable via the scan operation, to support selective harvesting of records
|
||||
|
||||
addNewBranch($srwRecordBranch, "srw:recordPosition", array(), $i);
|
||||
|
||||
$srwRecordsBranch->addXMLBranch($srwRecordBranch);
|
||||
}
|
||||
}
|
||||
|
||||
$srwCollection->addXMLBranch($srwRecordsBranch);
|
||||
|
||||
if (($showRowsOriginal != 0) && ($showMaxRow < $rowsFound)) // show 'nextRecordPosition' if the SRU query did not contain 'maximumRecords=0' and if there are any remaining records to be displayed
|
||||
addNewBranch($srwCollection, "srw:nextRecordPosition", array(), ($showMaxRow + 1));
|
||||
|
||||
$srwCollectionDoc->setXML($srwCollection);
|
||||
$srwCollectionString = $srwCollectionDoc->getXMLString();
|
||||
|
||||
// Add the XML Stylesheet definition:
|
||||
// Note that this is just a hack (that should get fixed) since I don't know how to do it properly using the ActiveLink PHP XML Package ?:-/
|
||||
if (!empty($exportStylesheet))
|
||||
$srwCollectionString = preg_replace("/(?=\<srw:searchRetrieveResponse)/i","<?xml-stylesheet type=\"text/xsl\" href=\"" . $exportStylesheet . "\"?>\n",$srwCollectionString);
|
||||
|
||||
return $srwCollectionString;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// return an SRW 'explainResponse' if the SRW/U client issued either of the following:
|
||||
// - http://.../refs/sru.php?operation=explain
|
||||
// - http://.../refs/sru.php?
|
||||
// - http://.../refs/sru.php
|
||||
function srwExplainResponse($exportStylesheet)
|
||||
{
|
||||
global $contentTypeCharset; // these variables are specified in 'ini.inc.php'
|
||||
global $databaseBaseURL;
|
||||
global $officialDatabaseName;
|
||||
global $hostInstitutionName;
|
||||
global $feedbackEmail;
|
||||
global $logoImageURL;
|
||||
global $defaultLanguage;
|
||||
global $defaultFeedFormat;
|
||||
|
||||
global $loc; // defined in 'locales/core.php'
|
||||
|
||||
$srwCollectionDoc = new XMLDocument();
|
||||
$srwCollectionDoc->setEncoding($contentTypeCharset);
|
||||
|
||||
$srwCollection = srwGenerateBaseTags("explainResponse");
|
||||
|
||||
$srwRecordBranch = new XMLBranch("srw:record");
|
||||
|
||||
srwGeneratePackingSchema($srwRecordBranch, "xml", "zeerex");
|
||||
|
||||
$srwRecordDataBranch = new XMLBranch("srw:recordData");
|
||||
|
||||
$srwExplainBranch = new XMLBranch("explain");
|
||||
$srwExplainBranch->setTagAttribute("xmlns", "http://explain.z3950.org/dtd/2.0/");
|
||||
$srwExplainBranch->setTagAttribute("xmlns:refb", "http://refbase.net/");
|
||||
|
||||
|
||||
// extract the protocol from the base URL:
|
||||
if (preg_match("#^([^:]+)://.*#",$databaseBaseURL))
|
||||
$databaseProtocol = preg_replace("#^([^:]+)://.*#","\\1",$databaseBaseURL);
|
||||
else
|
||||
$databaseProtocol = "";
|
||||
|
||||
// extract the host from the base URL:
|
||||
if (preg_match("#^[^:]+://(?:www\.)?[^/]+.*#",$databaseBaseURL))
|
||||
$databaseHost = preg_replace("#^[^:]+://(?:www\.)?([^/]+).*#","\\1",$databaseBaseURL);
|
||||
else
|
||||
$databaseHost = $databaseBaseURL;
|
||||
|
||||
// extract the path on server from the base URL:
|
||||
if (preg_match("#^[^:]+://(?:www\.)?[^/]+/.+#",$databaseBaseURL))
|
||||
$databasePathOnServer = preg_replace("#^[^:]+://(?:www\.)?[^/]+/(.+)#","\\1",$databaseBaseURL);
|
||||
else
|
||||
$databasePathOnServer = "";
|
||||
|
||||
// get the total number of records in the database:
|
||||
$recordCount = getTotalNumberOfRecords(); // function 'getTotalNumberOfRecords()' is defined in 'include.inc.php'
|
||||
|
||||
// get the default number of records per page preferred by the current user:
|
||||
$showRows = $_SESSION['userRecordsPerPage'];
|
||||
|
||||
// get date/time information when the database was last modified:
|
||||
$lastModified = getLastModifiedDateTime(); // function 'getLastModifiedDateTime()' is defined in 'include.inc.php'
|
||||
|
||||
|
||||
// --- begin server info ------------------------------------
|
||||
$srwServerInfoBranch = new XMLBranch("serverInfo");
|
||||
$srwServerInfoBranch->setTagAttribute("protocol", "SRU");
|
||||
$srwServerInfoBranch->setTagAttribute("version", "1.1");
|
||||
if (!empty($databaseProtocol))
|
||||
$srwServerInfoBranch->setTagAttribute("transport", $databaseProtocol);
|
||||
|
||||
$srwServerInfoBranch->setTagContent($databaseHost, "serverInfo/host");
|
||||
$srwServerInfoBranch->setTagContent("80", "serverInfo/port"); // NOTE: this should really be a variable in 'ini.inc.php' or such
|
||||
|
||||
addNewBranch($srwServerInfoBranch, "database", array("numRecs" => $recordCount, "lastUpdate" => $lastModified), $databasePathOnServer . "sru.php"); // function 'addNewBranch()' is defined in 'webservice.inc.php'
|
||||
|
||||
// IMPORTANT: if you want to allow remote users who are NOT logged in (userID=0) to query the refbase database
|
||||
// via 'sru.php' then either the 'Export' or the 'Batch export' user permission needs to be
|
||||
// enabled at 'user_options.php?userID=0'. This will allow export of XML records via 'sru.php'
|
||||
// but won't allow a user who isn't logged in to export records via the web interface. However, you
|
||||
// should be aware that a direct GET query like 'show.php?author=miller&submit=Export&exportFormat=MODS%20XML'
|
||||
// will be also allowed then!
|
||||
|
||||
// As an alternative, you can provide explicit login information within the 'serverInfo/authentication' tag
|
||||
// below. But, obviously, the provided login information should be only given for an account that has the
|
||||
// 'Export' permission bit enabled but has otherwise limited access rights!
|
||||
|
||||
// If the 'authentication' element is present, but empty, then it implies that authentication is required
|
||||
// to connect to the server, however there is no publically available login. If it contains a string, then
|
||||
// this is the token to give in order to authenticate. Otherwise it may contain three elements:
|
||||
// 1. user: The username to supply.
|
||||
// 2. group: The group to supply.
|
||||
// 3. password: The password to supply.
|
||||
// $srwServerInfoAuthenticationBranch = new XMLBranch("authentication");
|
||||
// $srwServerInfoAuthenticationBranch->setTagContent("LOGINEMAIL", "authentication/user");
|
||||
// $srwServerInfoAuthenticationBranch->setTagContent("PASSWORD", "authentication/password");
|
||||
// $srwServerInfoBranch->addXMLBranch($srwServerInfoAuthenticationBranch);
|
||||
|
||||
$srwExplainBranch->addXMLBranch($srwServerInfoBranch);
|
||||
// --- end server info --------------------------------------
|
||||
|
||||
|
||||
// --- begin database info ----------------------------------
|
||||
$srwDatabaseInfoBranch = new XMLBranch("databaseInfo");
|
||||
|
||||
addNewBranch($srwDatabaseInfoBranch, "title", array("lang" => $defaultLanguage, "primary" => "true"), $officialDatabaseName);
|
||||
|
||||
addNewBranch($srwDatabaseInfoBranch, "description", array("lang" => $defaultLanguage, "primary" => "true"), encodeHTMLspecialchars($loc["ThisDatabaseAttempts"]));
|
||||
|
||||
$srwDatabaseInfoBranch->setTagContent(encodeHTMLspecialchars($hostInstitutionName), "databaseInfo/author");
|
||||
|
||||
$srwDatabaseInfoBranch->setTagContent(encodeHTMLspecialchars($hostInstitutionName) . " (" . $feedbackEmail . ")", "databaseInfo/contact");
|
||||
|
||||
$srwDatabaseImplementationBranch = new XMLBranch("implementation");
|
||||
$srwDatabaseImplementationBranch->setTagAttribute("version", "0.9.6");
|
||||
$srwDatabaseImplementationBranch->setTagAttribute("identifier", "refbase");
|
||||
$srwDatabaseImplementationBranch->setTagContent("Web Reference Database (http://refbase.sourceforge.net)", "implementation/title");
|
||||
$srwDatabaseInfoBranch->addXMLBranch($srwDatabaseImplementationBranch);
|
||||
|
||||
$srwDatabaseLinksBranch = new XMLBranch("links");
|
||||
|
||||
addNewBranch($srwDatabaseLinksBranch, "link", array("type" => "www"), $databaseBaseURL);
|
||||
addNewBranch($srwDatabaseLinksBranch, "link", array("type" => "sru"), $databaseBaseURL . "sru.php");
|
||||
addNewBranch($srwDatabaseLinksBranch, "link", array("type" => "rss"), $databaseBaseURL . generateURL("show.php", $defaultFeedFormat, array("where" => 'serial RLIKE ".+"'), true, $showRows)); // function 'generateURL()' is defined in 'include.inc.php'
|
||||
addNewBranch($srwDatabaseLinksBranch, "link", array("type" => "icon"), $databaseBaseURL . $logoImageURL);
|
||||
|
||||
$srwDatabaseInfoBranch->addXMLBranch($srwDatabaseLinksBranch);
|
||||
|
||||
$srwExplainBranch->addXMLBranch($srwDatabaseInfoBranch);
|
||||
// --- end database info ------------------------------------
|
||||
|
||||
|
||||
// --- begin index info -------------------------------------
|
||||
$srwIndexInfoBranch = new XMLBranch("indexInfo");
|
||||
|
||||
addNewBranch($srwIndexInfoBranch, "set", array("identifier" => "info:srw/cql-context-set/1/cql-v1.1", "name" => "cql"), "");
|
||||
addNewBranch($srwIndexInfoBranch, "set", array("identifier" => "info:srw/cql-context-set/1/dc-v1.1", "name" => "dc"), "");
|
||||
addNewBranch($srwIndexInfoBranch, "set", array("identifier" => "http://zing.z3950.org/cql/bath/2.0/", "name" => "bath"), "");
|
||||
addNewBranch($srwIndexInfoBranch, "set", array("identifier" => "info:srw/cql-context-set/2/rec-1.1", "name" => "rec"), "");
|
||||
|
||||
// TODO: The index info of the refbase explain response should also list the original refbase field names,
|
||||
// similar to how the COPAC SRU gateway does it (<http://tweed.lib.ed.ac.uk:8080/elf/search/copac>).
|
||||
// Example:
|
||||
// <index search="true" scan="false" sort="false">
|
||||
// <title>Author</title>
|
||||
|
||||
// <map>
|
||||
// <name>
|
||||
// author
|
||||
// </name>
|
||||
// </map>
|
||||
// <map>
|
||||
// <name set="dc">
|
||||
// creator
|
||||
// </name>
|
||||
// </map>
|
||||
// </index>
|
||||
|
||||
$indexArray = array(); // TODO: '$indexArray' should be an array of arrays so that it can hold multiple mappings
|
||||
|
||||
$indexArray["dc.creator"] = array("_set" => "dc",
|
||||
"_index" => "creator",
|
||||
"_title" => "author(s) of the resource",
|
||||
"_refbaseIndex" => "refbase-author");
|
||||
|
||||
$indexArray["dc.title"] = array("_set" => "dc",
|
||||
"_index" => "title",
|
||||
"_title" => "publication title of the resource",
|
||||
"_refbaseIndex" => "refbase-title");
|
||||
|
||||
$indexArray["dc.date"] = array("_set" => "dc",
|
||||
"_index" => "date",
|
||||
"_title" => "year of publication of the resource",
|
||||
"_refbaseIndex" => "refbase-year");
|
||||
|
||||
$indexArray["dc.language"] = array("_set" => "dc",
|
||||
"_index" => "language",
|
||||
"_title" => "language of the resource",
|
||||
"_refbaseIndex" => "refbase-language");
|
||||
|
||||
$indexArray["dc.description"] = array("_set" => "dc",
|
||||
"_index" => "description",
|
||||
"_title" => "abstract or summary of the resource",
|
||||
"_refbaseIndex" => "refbase-abstract");
|
||||
|
||||
$indexArray["dc.contributor"] = array("_set" => "dc",
|
||||
"_index" => "contributor",
|
||||
"_title" => "editor(s) of the resource",
|
||||
"_refbaseIndex" => "refbase-editor"); // the mapping dc.contributor <-> refbase-editor might be suboptimal, but probably as best as we can do for now
|
||||
|
||||
$indexArray["dc.subject"] = array("_set" => "dc",
|
||||
"_index" => "subject",
|
||||
"_title" => "topic of the resource",
|
||||
"_refbaseIndex" => "refbase-keywords");
|
||||
|
||||
$indexArray["dc.format"] = array("_set" => "dc",
|
||||
"_index" => "format",
|
||||
"_title" => "physical or digital manifestation of the resource",
|
||||
"_refbaseIndex" => "refbase-medium");
|
||||
|
||||
// Note: Currently, we simply expose the contents of the refbase 'type' field as 'dc.type'.
|
||||
// This may not be ideal since it differs from the approved terms that should be used as values for the 'dc.type' element: <http://dublincore.org/documents/dcmi-type-vocabulary/>.
|
||||
// However, the document "Using simple Dublin Core to describe eprints" (<http://eprints-uk.rdn.ac.uk/project/docs/simpledc-guidelines/#type>)
|
||||
// recommends type values that are much closer (but still not identical) to our own type values.
|
||||
$indexArray["dc.type"] = array("_set" => "dc",
|
||||
"_index" => "type",
|
||||
"_title" => "nature or genre of the resource",
|
||||
"_refbaseIndex" => "refbase-type");
|
||||
|
||||
$indexArray["dc.publisher"] = array("_set" => "dc",
|
||||
"_index" => "publisher",
|
||||
"_title" => "publisher",
|
||||
"_refbaseIndex" => "refbase-publisher");
|
||||
|
||||
$indexArray["dc.coverage"] = array("_set" => "dc",
|
||||
"_index" => "coverage",
|
||||
"_title" => "geographic or topographic area of research",
|
||||
"_refbaseIndex" => "refbase-area");
|
||||
|
||||
// Note: I'm note sure, if 'bath.name' (or maybe better: 'bath.personalName') can be also used to describe the author/creator ('dc.creator') of a publication
|
||||
// "'Name Search -- Keyword' searches for complete word in headings (or references) for people, corporate bodies, conferences, and geographic names."
|
||||
// $indexArray["bath.name"] = array("_set" => "bath",
|
||||
// "_index" => "name",
|
||||
// "_title" => "author",
|
||||
// "_refbaseIndex" => "refbase-author");
|
||||
|
||||
// Note: Not sure again whether 'bath.topicalSubject' can be offered as synonym for 'dc.subject'
|
||||
// "'Topical Subject Search -- Keyword' searches for complete word in a topical subject heading or reference."
|
||||
// $indexArray["bath.topicalSubject"] = array("_set" => "bath",
|
||||
// "_index" => "topicalSubject",
|
||||
// "_title" => "keywords",
|
||||
// "_refbaseIndex" => "refbase-keywords");
|
||||
|
||||
// NOTE: I'm not sure if 'isbn' is a valid name for the Bath Context Set? At least, it's not listed at <http://zing.z3950.org/srw/bath/2.0/#2>.
|
||||
// However, 'bath.isbn' is used e.g. by <http://z3950.loc.gov:7090/voyager?operation=explain&version=1.1> and other SRU servers.
|
||||
$indexArray["bath.isbn"] = array("_set" => "bath",
|
||||
"_index" => "isbn",
|
||||
"_title" => "international standard book number",
|
||||
"_refbaseIndex" => "refbase-isbn");
|
||||
|
||||
$indexArray["bath.issn"] = array("_set" => "bath",
|
||||
"_index" => "issn",
|
||||
"_title" => "international standard serial number",
|
||||
"_refbaseIndex" => "refbase-issn");
|
||||
|
||||
$indexArray["bath.corporateName"] = array("_set" => "bath",
|
||||
"_index" => "corporateName",
|
||||
"_title" => "corporate author of this publication",
|
||||
"_refbaseIndex" => "refbase-corporate_author");
|
||||
|
||||
$indexArray["bath.conferenceName"] = array("_set" => "bath",
|
||||
"_index" => "conferenceName",
|
||||
"_title" => "conference this publication was presented at",
|
||||
"_refbaseIndex" => "refbase-conference");
|
||||
|
||||
// NOTE: I'm not sure if 'notes' is a valid name for the Bath Context Set?
|
||||
// 'bath.notes' is mentioned at <http://www.loc.gov/z3950/lcserver.html> and <http://zing.z3950.org/srw/bath/2.0/#3>.
|
||||
$indexArray["bath.notes"] = array("_set" => "bath",
|
||||
"_index" => "notes",
|
||||
"_title" => "notes about the resource",
|
||||
"_refbaseIndex" => "refbase-notes");
|
||||
|
||||
$indexArray["rec.identifier"] = array("_set" => "rec",
|
||||
"_index" => "identifier",
|
||||
"_title" => "database record number",
|
||||
"_refbaseIndex" => "refbase-serial");
|
||||
|
||||
$indexArray["rec.creationDate"] = array("_set" => "rec",
|
||||
"_index" => "creationDate",
|
||||
"_title" => "date/time at which the record was created",
|
||||
"_refbaseIndex" => "refbase-created_date-created_time"); // 'sru.php': CQL search term should get splitted into date & time information!
|
||||
|
||||
$indexArray["rec.creationAgentName"] = array("_set" => "rec",
|
||||
"_index" => "creationAgentName",
|
||||
"_title" => "name of the agent responsible for creation of the record",
|
||||
"_refbaseIndex" => "refbase-created_by");
|
||||
|
||||
$indexArray["rec.lastModificationDate"] = array("_set" => "rec",
|
||||
"_index" => "lastModificationDate",
|
||||
"_title" => "date/time at which the record was last modified",
|
||||
"_refbaseIndex" => "refbase-modified_date-modified_time"); // 'sru.php': CQL search term should get splitted into date & time information!
|
||||
|
||||
$indexArray["rec.lastModificationAgentName"] = array("_set" => "rec",
|
||||
"_index" => "lastModificationAgentName",
|
||||
"_title" => "name of the agent responsible for last modifying the record",
|
||||
"_refbaseIndex" => "refbase-modified_by");
|
||||
|
||||
$indexArray["bib.citekey"] = array("_set" => "bib",
|
||||
"_index" => "citekey",
|
||||
"_title" => "user-specific cite key for the record",
|
||||
"_refbaseIndex" => "refbase-cite_key");
|
||||
|
||||
// Not sure how these fields can be mapped:
|
||||
// "publication" => "Book title or journal name",
|
||||
// "abbrev_journal" => "Abbreviated journal name",
|
||||
// "volume" => "Publication volume",
|
||||
// "issue" => "Publication issue",
|
||||
// "pages" => "Range or total number of pages",
|
||||
// "place" => "Place of publication",
|
||||
// "series_title" => "Series title", // -> could 'bath.seriesTitle' be used? compare with <http://www.loc.gov/z3950/lcserver.html> and <http://copac.ac.uk/interfaces/srw/>
|
||||
// "abbrev_series_title" => "Abbreviated series title",
|
||||
// "series_volume" => "Series volume",
|
||||
// "series_issue" => "Series issue",
|
||||
// "thesis" => "Thesis",
|
||||
// "doi" => "Digital object identifier",
|
||||
// "url" => "Uniform resource locator",
|
||||
|
||||
foreach ($indexArray as $indexKey => $index)
|
||||
{
|
||||
$srwIndexBranch = new XMLBranch("index");
|
||||
$srwIndexBranch->setTagAttribute("search", "true");
|
||||
$srwIndexBranch->setTagAttribute("scan", "false");
|
||||
$srwIndexBranch->setTagAttribute("sort", "false");
|
||||
$srwIndexBranch->setTagAttribute("refb:index", $index["_refbaseIndex"]);
|
||||
|
||||
addNewBranch($srwIndexBranch, "title", array("lang" => "en"), $index["_title"]);
|
||||
|
||||
$srwIndexMapBranch = new XMLBranch("map");
|
||||
|
||||
addNewBranch($srwIndexMapBranch, "name", array("set" => $index["_set"]), $index["_index"]);
|
||||
|
||||
$srwIndexBranch->addXMLBranch($srwIndexMapBranch);
|
||||
|
||||
$srwIndexInfoBranch->addXMLBranch($srwIndexBranch);
|
||||
}
|
||||
|
||||
$srwExplainBranch->addXMLBranch($srwIndexInfoBranch);
|
||||
// --- end index info ---------------------------------------
|
||||
|
||||
|
||||
// --- begin schema info -------------------------------------
|
||||
$srwSchemaInfoBranch = new XMLBranch("schemaInfo");
|
||||
|
||||
// MODS:
|
||||
$modsSchemaBranch = new XMLBranch("schema");
|
||||
$modsSchemaBranch->setTagAttribute("identifier", "http://www.loc.gov/mods/v3"); // or should 'info:srw/schema/1/mods-v3.2' be used?
|
||||
$modsSchemaBranch->setTagAttribute("location", "http://www.loc.gov/standards/mods/v3/mods-3-0.xsd");
|
||||
$modsSchemaBranch->setTagAttribute("sort", "false");
|
||||
$modsSchemaBranch->setTagAttribute("retrieve", "true");
|
||||
$modsSchemaBranch->setTagAttribute("name", "mods");
|
||||
|
||||
addNewBranch($modsSchemaBranch, "title", array("lang" => "en"), "Metadata Object Description Schema (MODS) v3");
|
||||
|
||||
$srwSchemaInfoBranch->addXMLBranch($modsSchemaBranch);
|
||||
|
||||
// Simple Dublin Core (DC):
|
||||
$dcSchemaBranch = new XMLBranch("schema");
|
||||
$dcSchemaBranch->setTagAttribute("identifier", "http://purl.org/dc/elements/1.1/"); // or should 'info:srw/schema/1/dc-v1.1' be used?
|
||||
$dcSchemaBranch->setTagAttribute("location", "http://dublincore.org/schemas/xmls/simpledc20021212.xsd");
|
||||
$dcSchemaBranch->setTagAttribute("sort", "false");
|
||||
$dcSchemaBranch->setTagAttribute("retrieve", "true");
|
||||
$dcSchemaBranch->setTagAttribute("name", "dc");
|
||||
|
||||
addNewBranch($dcSchemaBranch, "title", array("lang" => "en"), "Simple Dublin Core (DC) v1.1");
|
||||
|
||||
$srwSchemaInfoBranch->addXMLBranch($dcSchemaBranch);
|
||||
|
||||
// Simple Dublin Core (OAI_DC):
|
||||
// See recommendations for use of simple Dublin Core metadata to describe eprints in eprint archives: <http://eprints-uk.rdn.ac.uk/project/docs/simpledc-guidelines/>
|
||||
// Example SRW+DC output from LoC: <http://z3950.loc.gov:7090/voyager?query=dc.creator+%3D+%22miller%22&version=1.1&operation=searchRetrieve&recordSchema=dc&startRecord=1&maximumRecords=10>
|
||||
// $oaidcSchemaBranch = new XMLBranch("schema");
|
||||
// $oaidcSchemaBranch->setTagAttribute("identifier", "http://www.openarchives.org/OAI/2.0/oai_dc/");
|
||||
// $oaidcSchemaBranch->setTagAttribute("location", "http://www.openarchives.org/OAI/2.0/oai_dc.xsd");
|
||||
// $oaidcSchemaBranch->setTagAttribute("sort", "false");
|
||||
// $oaidcSchemaBranch->setTagAttribute("retrieve", "true");
|
||||
// $oaidcSchemaBranch->setTagAttribute("name", "oai_dc");
|
||||
//
|
||||
// addNewBranch($oaidcSchemaBranch, "title", array("lang" => "en"), "Simple Dublin Core for OAI-PMH (OAI_DC)");
|
||||
//
|
||||
// $srwSchemaInfoBranch->addXMLBranch($oaidcSchemaBranch);
|
||||
|
||||
$srwExplainBranch->addXMLBranch($srwSchemaInfoBranch);
|
||||
// --- end schema info ---------------------------------------
|
||||
|
||||
|
||||
// --- begin config info -------------------------------------
|
||||
$srwConfigInfoBranch = new XMLBranch("configInfo");
|
||||
|
||||
// default:
|
||||
addNewBranch($srwConfigInfoBranch, "default", array("type" => "retrieveSchema"), "mods");
|
||||
addNewBranch($srwConfigInfoBranch, "default", array("type" => "numberOfRecords"), $showRows);
|
||||
addNewBranch($srwConfigInfoBranch, "default", array("type" => "stylesheet"), $databaseBaseURL . "srwmods2html.xsl");
|
||||
addNewBranch($srwConfigInfoBranch, "default", array("type" => "contextSet"), "cql");
|
||||
addNewBranch($srwConfigInfoBranch, "default", array("type" => "index"), "cql.serverChoice");
|
||||
addNewBranch($srwConfigInfoBranch, "default", array("type" => "relation"), "all");
|
||||
|
||||
// setting:
|
||||
addNewBranch($srwConfigInfoBranch, "setting", array("type" => "sortSchema"), "identifier");
|
||||
addNewBranch($srwConfigInfoBranch, "setting", array("type" => "recordPacking"), "xml");
|
||||
|
||||
// supports:
|
||||
addNewBranch($srwConfigInfoBranch, "supports", array("type" => "proximity"), "false");
|
||||
addNewBranch($srwConfigInfoBranch, "supports", array("type" => "resultSets"), "false");
|
||||
addNewBranch($srwConfigInfoBranch, "supports", array("type" => "relationModifier"), "false");
|
||||
addNewBranch($srwConfigInfoBranch, "supports", array("type" => "booleanModifier"), "false"); // TODO: set to 'true' when Rob's CQL-PHP has been implemented successfully
|
||||
addNewBranch($srwConfigInfoBranch, "supports", array("type" => "sort"), "false");
|
||||
addNewBranch($srwConfigInfoBranch, "supports", array("type" => "maskingCharacter"), "true");
|
||||
addNewBranch($srwConfigInfoBranch, "supports", array("type" => "anchoring"), "true");
|
||||
addNewBranch($srwConfigInfoBranch, "supports", array("type" => "emptyTerm"), "false");
|
||||
addNewBranch($srwConfigInfoBranch, "supports", array("type" => "recordXPath"), "false");
|
||||
addNewBranch($srwConfigInfoBranch, "supports", array("type" => "scan"), "false");
|
||||
|
||||
$srwExplainBranch->addXMLBranch($srwConfigInfoBranch);
|
||||
// --- end config info ---------------------------------------
|
||||
|
||||
|
||||
$srwRecordDataBranch->addXMLBranch($srwExplainBranch);
|
||||
|
||||
$srwRecordBranch->addXMLBranch($srwRecordDataBranch);
|
||||
|
||||
$srwCollection->addXMLBranch($srwRecordBranch);
|
||||
|
||||
$srwCollectionDoc->setXML($srwCollection);
|
||||
$srwCollectionString = $srwCollectionDoc->getXMLString();
|
||||
|
||||
// Add the XML Stylesheet definition:
|
||||
// Note that this is just a hack (that should get fixed) since I don't know how to do it properly using the ActiveLink PHP XML Package ?:-/
|
||||
if (!empty($exportStylesheet))
|
||||
$srwCollectionString = preg_replace("/(?=\<srw:explainResponse)/i","<?xml-stylesheet type=\"text/xsl\" href=\"" . $exportStylesheet . "\"?>\n",$srwCollectionString);
|
||||
|
||||
return $srwCollectionString;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Return SRW diagnostics (i.e. SRW error information) wrapped into SRW XML ('searchRetrieveResponse'):
|
||||
function srwDiagnostics($diagCode, $diagDetails, $exportStylesheet)
|
||||
{
|
||||
global $contentTypeCharset; // defined in 'ini.inc.php'
|
||||
|
||||
// Map SRU/W diagnostic numbers to their corresponding messages:
|
||||
$diagMessages = mapSRWDiagnostics(); // function 'mapSRWDiagnostics()' is defined in 'webservice.inc.php'
|
||||
|
||||
if (isset($diagMessages[$diagCode]))
|
||||
$diagMessage = $diagMessages[$diagCode];
|
||||
else
|
||||
$diagMessage = "Unknown error";
|
||||
|
||||
$srwCollectionDoc = new XMLDocument();
|
||||
$srwCollectionDoc->setEncoding($contentTypeCharset);
|
||||
|
||||
$srwCollection = srwGenerateBaseTags("searchRetrieveResponse");
|
||||
|
||||
$diagnosticsBranch = new XMLBranch("srw:diagnostics");
|
||||
|
||||
// since we've defined the 'diag' namespace in the <searchRetrieveResponse> element (see function 'srwGenerateBaseTags()'),
|
||||
// we can simply use '<diag:diagnostic>' below; otherwise we should use '<diagnostic xmlns="http://www.loc.gov/zing/srw/diagnostic/">':
|
||||
// addNewBranch($diagnosticsBranch, "diagnostic", array("xmlns" => "http://www.loc.gov/zing/srw/diagnostic/"), "");
|
||||
|
||||
$diagnosticsBranch->setTagContent("info:srw/diagnostic/1/" . $diagCode, "srw:diagnostics/diag:diagnostic/uri");
|
||||
$diagnosticsBranch->setTagContent($diagMessage, "srw:diagnostics/diag:diagnostic/message");
|
||||
if (!empty($diagDetails))
|
||||
$diagnosticsBranch->setTagContent(encodeHTMLspecialchars($diagDetails), "srw:diagnostics/diag:diagnostic/details");
|
||||
|
||||
$srwCollection->addXMLBranch($diagnosticsBranch);
|
||||
|
||||
$srwCollectionDoc->setXML($srwCollection);
|
||||
$srwCollectionString = $srwCollectionDoc->getXMLString();
|
||||
|
||||
// Add the XML Stylesheet definition:
|
||||
// Note that this is just a hack (that should get fixed) since I don't know how to do it properly using the ActiveLink PHP XML Package ?:-/
|
||||
if (!empty($exportStylesheet))
|
||||
$srwCollectionString = preg_replace("/(?=\<srw:searchRetrieveResponse)/i","<?xml-stylesheet type=\"text/xsl\" href=\"" . $exportStylesheet . "\"?>\n",$srwCollectionString);
|
||||
|
||||
return $srwCollectionString;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Generate the basic SRW XML tree required for a 'searchRetrieveResponse' or 'explainResponse':
|
||||
function srwGenerateBaseTags($srwOperation)
|
||||
{
|
||||
global $exportFormat; // this is needed so that we can distinguish between "SRW_DC XML" and "SRW_MODS XML" record formats
|
||||
|
||||
$srwCollection = new XML("srw:" . $srwOperation);
|
||||
$srwCollection->setTagAttribute("xmlns:srw", "http://www.loc.gov/zing/srw/");
|
||||
|
||||
if ($srwOperation == "searchRetrieveResponse")
|
||||
{
|
||||
$srwCollection->setTagAttribute("xmlns:diag", "http://www.loc.gov/zing/srw/diagnostic/");
|
||||
$srwCollection->setTagAttribute("xmlns:xcql", "http://www.loc.gov/zing/cql/xcql/");
|
||||
|
||||
if (preg_match("/DC/i", $exportFormat)) // add namespace declarations for "SRW_DC XML":
|
||||
{
|
||||
$srwCollection->setTagAttribute("xmlns:srw_dc", "info:srw/schema/1/dc-v1.1");
|
||||
$srwCollection->setTagAttribute("xmlns:dc", "http://purl.org/dc/elements/1.1/");
|
||||
$srwCollection->setTagAttribute("xmlns:prism", "http://prismstandard.org/namespaces/1.2/basic/");
|
||||
}
|
||||
else // add namespace declarations for "SRW_MODS XML":
|
||||
$srwCollection->setTagAttribute("xmlns:mods", "http://www.loc.gov/mods/v3");
|
||||
}
|
||||
// elseif ($srwOperation == "explainResponse")
|
||||
// {
|
||||
// $srwCollection->setTagAttribute("xmlns:zr", "http://explain.z3950.org/dtd/2.0/");
|
||||
// }
|
||||
|
||||
addNewBranch($srwCollection, "srw:version", array(), "1.1"); // function 'addNewBranch()' is defined in 'webservice.inc.php'
|
||||
|
||||
return $srwCollection;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Generate the basic SRW XML elements 'recordPacking' and 'recordSchema':
|
||||
function srwGeneratePackingSchema(&$thisObject, $srwPacking, $srwSchema)
|
||||
{
|
||||
// available schemas taken from <http://www.loc.gov/z3950/agency/zing/srw/record-schemas.html>
|
||||
$srwSchemas = array("dc" => "info:srw/schema/1/dc-v1.1", // or should <http://purl.org/dc/elements/1.1/> be used?
|
||||
// "dcterms" => "http://purl.org/dc/terms/",
|
||||
"diag" => "info:srw/schema/1/diagnostic-v1.1", // it says 'info:srw/schema/1/diagnostics-v1.1' at <http://www.loc.gov/standards/sru/diagnostics.html> ?:-/
|
||||
"zeerex" => "http://explain.z3950.org/dtd/2.0/",
|
||||
"mods" => "info:srw/schema/1/mods-v3.2",
|
||||
"onix" => "info:srw/schema/1/onix-v2.0",
|
||||
"marcxml" => "info:srw/schema/1/marcxml-v1.1",
|
||||
"ead" => "info:srw/schema/1/ead-2002",
|
||||
"zthes" => "http://zthes.z3950.org/xml/0.5/",
|
||||
"ccg" => "http://srw.cheshire3.org/schemas/ccg/1.0/",
|
||||
"rec" => "info:srw/schema/2/rec-1.0",
|
||||
"server-choice" => "info:srw/schema/1/server-choice",
|
||||
"xpath" => "info:srw/schema/1/xpath-1.0");
|
||||
|
||||
addNewBranch($thisObject, "srw:recordPacking", array(), $srwPacking); // function 'addNewBranch()' is defined in 'webservice.inc.php'
|
||||
addNewBranch($thisObject, "srw:recordSchema", array(), $srwSchemas[$srwSchema]);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
?>
|
||||
128
includes/transtab_bibtex_refbase.inc.php
Normal file
128
includes/transtab_bibtex_refbase.inc.php
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_bibtex_refbase.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_bibtex_refbase.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 10-Aug-06, 21:00
|
||||
// Modified: $Date: 2008-07-30 14:16:35 +0000 (Wed, 30 Jul 2008) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1182 $
|
||||
|
||||
// Search & replace patterns for conversion from LaTeX/BibTeX markup & entities to refbase markup. Converts LaTeX fontshape markup (italic, bold, underline)
|
||||
// into appropriate refbase commands, super- and subscript as well as greek letters in math mode get converted into the respective refbase commands.
|
||||
// You may need to adopt the LaTeX markup to suit your individual needs.
|
||||
// Notes: - search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes
|
||||
|
||||
$transtab_bibtex_refbase = array(
|
||||
|
||||
'/\\\\(?:ul|hl|uuline|uwave)\\{(.+?)\\}/i' => "__\\1__",
|
||||
'/\\\\(?:text)?it\\{(.+?)\\}/i' => "_\\1_",
|
||||
'/\\\\(?:text)?bf\\{(.+?)\\}/i' => "**\\1**",
|
||||
'/((\\$\\^\\{.+?\\}\\$|\\\\textsuperscript\\{.+?\\}|\\{\\\\text(one|two|three)superior\\})+)/ie' => "bibtexSuperScriptToRefbase('\\1')", // function 'bibtexSuperScriptToRefbase()' will convert LaTeX/BibTeX superscript markup to appropriate refbase markup
|
||||
'/((\\$\\_\\{.+?\\}\\$|\\\\textsubscript\\{.+?\\})+)/ie' => "bibtexSubScriptToRefbase('\\1')", // function 'bibtexSubScriptToRefbase()' will convert LaTeX/BibTeX subscript markup to appropriate refbase markup
|
||||
'/\\{\\\\textperthousand\\}/' => "[permil]",
|
||||
'/\\$\\\\infty\\$/' => "[infinity]",
|
||||
'/\\$\\\\alpha\\$/' => "[alpha]",
|
||||
'/\\$\\\\beta\\$/' => "[beta]",
|
||||
'/\\$\\\\gamma\\$/' => "[gamma]",
|
||||
'/\\$\\\\delta\\$/' => "[delta]",
|
||||
'/\\$\\\\epsilon\\$/' => "[epsilon]",
|
||||
'/\\$\\\\zeta\\$/' => "[zeta]",
|
||||
'/\\$\\\\eta\\$/' => "[eta]",
|
||||
'/\\$\\\\theta\\$/' => "[theta]",
|
||||
'/\\$\\\\iota\\$/' => "[iota]",
|
||||
'/\\$\\\\kappa\\$/' => "[kappa]",
|
||||
'/\\$\\\\lambda\\$/' => "[lambda]",
|
||||
'/\\$\\\\mu\\$/' => "[mu]",
|
||||
'/\\$\\\\nu\\$/' => "[nu]",
|
||||
'/\\$\\\\xi\\$/' => "[xi]",
|
||||
'/\\$o\\$/' => "[omicron]",
|
||||
'/\\$\\\\pi\\$/' => "[pi]",
|
||||
'/\\$\\\\rho\\$/' => "[rho]",
|
||||
'/\\$\\\\varsigma\\$/' => "[sigmaf]",
|
||||
'/\\$\\\\sigma\\$/' => "[sigma]",
|
||||
'/\\$\\\\tau\\$/' => "[tau]",
|
||||
'/\\$\\\\upsilon\\$/' => "[upsilon]",
|
||||
'/\\$\\\\phi\\$/' => "[phi]",
|
||||
'/\\$\\\\chi\\$/' => "[chi]",
|
||||
'/\\$\\\\psi\\$/' => "[psi]",
|
||||
'/\\$\\\\omega\\$/' => "[omega]",
|
||||
'/\\$A\\$/' => "[Alpha]",
|
||||
'/\\$B\\$/' => "[Beta]",
|
||||
'/\\$\\\\Gamma\\$/' => "[Gamma]",
|
||||
'/\\$\\\\Delta\\$/' => "[Delta]",
|
||||
'/\\$E\\$/' => "[Epsilon]",
|
||||
'/\\$Z\\$/' => "[Zeta]",
|
||||
'/\\$H\\$/' => "[Eta]",
|
||||
'/\\$\\\\Theta\\$/' => "[Theta]",
|
||||
'/\\$I\\$/' => "[Iota]",
|
||||
'/\\$K\\$/' => "[Kappa]",
|
||||
'/\\$\\\\Lambda\\$/' => "[Lambda]",
|
||||
'/\\$M\\$/' => "[Mu]",
|
||||
'/\\$N\\$/' => "[Nu]",
|
||||
'/\\$\\\\Xi\\$/' => "[Xi]",
|
||||
'/\\$O\\$/' => "[Omicron]",
|
||||
'/\\$\\\\Pi\\$/' => "[Pi]",
|
||||
'/\\$R\\$/' => "[Rho]",
|
||||
'/\\$\\\\Sigma\\$/' => "[Sigma]",
|
||||
'/\\$T\\$/' => "[Tau]",
|
||||
'/\\$\\\\Upsilon\\$/' => "[Upsilon]",
|
||||
'/\\$\\\\Phi\\$/' => "[Phi]",
|
||||
'/\\$X\\$/' => "[Chi]",
|
||||
'/\\$\\\\Psi\\$/' => "[Psi]",
|
||||
'/\\$\\\\Omega\\$/' => "[Omega]",
|
||||
'/^opt(?=(URL|LOCATION|NOTE|KEYWORDS)=)/mi' => ""
|
||||
|
||||
);
|
||||
|
||||
|
||||
$bibtexSuperScriptSearchReplaceActionsArray = array(
|
||||
|
||||
"/\\$\\^\\{(.+?)\\}\\$/" => '\\1',
|
||||
"/\\\\textsuperscript\\{(.+?)\\}/i" => '\\1',
|
||||
"/\\{\\\\textonesuperior\\}/i" => '1', // (superscript one)
|
||||
"/\\{\\\\texttwosuperior\\}/i" => '2', // (superscript two)
|
||||
"/\\{\\\\textthreesuperior\\}/i" => '3' // (superscript three)
|
||||
|
||||
);
|
||||
|
||||
|
||||
$bibtexSubScriptSearchReplaceActionsArray = array(
|
||||
|
||||
"/\\$\\_\\{(.+?)\\}\\$/" => '\\1',
|
||||
"/\\\\textsubscript\\{(.+?)\\}/i" => '\\1'
|
||||
|
||||
);
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Converts LaTeX/BibTeX superscript markup to appropriate refbase markup:
|
||||
function bibtexSuperScriptToRefbase($sourceString)
|
||||
{
|
||||
global $bibtexSuperScriptSearchReplaceActionsArray;
|
||||
|
||||
$sourceString = searchReplaceText($bibtexSuperScriptSearchReplaceActionsArray, $sourceString, true); // function 'searchReplaceText()' is defined in 'include.inc.php'
|
||||
|
||||
return "[super:" . $sourceString . "]";
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Converts LaTeX/BibTeX subscript markup to appropriate refbase markup:
|
||||
function bibtexSubScriptToRefbase($sourceString)
|
||||
{
|
||||
global $bibtexSubScriptSearchReplaceActionsArray;
|
||||
|
||||
$sourceString = searchReplaceText($bibtexSubScriptSearchReplaceActionsArray, $sourceString, true); // function 'searchReplaceText()' is defined in 'include.inc.php'
|
||||
|
||||
return "[sub:" . $sourceString . "]";
|
||||
}
|
||||
?>
|
||||
40
includes/transtab_endnotexml_refbase.inc.php
Normal file
40
includes/transtab_endnotexml_refbase.inc.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_endnotexml_refbase.inc.php
|
||||
// Repository: $HeadURL$
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 18-Jul-07, 13:15
|
||||
// Modified: $Date: 2008-07-30 14:16:35 +0000 (Wed, 30 Jul 2008) $
|
||||
// $Author$
|
||||
// $Revision: 1182 $
|
||||
|
||||
// Search & replace patterns for conversion from Endnote XML text style markup to refbase markup. Converts fontshape markup (italic, bold, underline) as well
|
||||
// as super- and subscript into appropriate refbase markup. Note that greek letters are left as is, so import of greek letters will require an UTF-8 database.
|
||||
// Notes: - search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes
|
||||
|
||||
$transtab_endnotexml_refbase = array(
|
||||
|
||||
'#<style face="italic"[^<>\r\n]*>(.+?)</style>#i' => "_\\1_",
|
||||
'#<style face="bold"[^<>\r\n]*>(.+?)</style>#i' => "**\\1**",
|
||||
'#<style face="underline"[^<>\r\n]*>(.+?)</style>#i' => "__\\1__",
|
||||
'#<style face="superscript"[^<>\r\n]*>(.+?)</style>#i' => "[super:\\1]",
|
||||
'#<style face="subscript"[^<>\r\n]*>(.+?)</style>#i' => "[sub:\\1]",
|
||||
'#<style face="[^<>"]*"[^<>\r\n]*>(.+?)</style>#i' => "\\1", // remove all remaining <style> information
|
||||
|
||||
// Bibutils 'endx2xml' v3.34 seems to require that titles are enclosed within a <style> container, so we put one back in:
|
||||
'#(?<=<title>)(.+?)(?=</title>)#i' => '<style face="normal" font="default" size="100%">' . "\\1" . '</style>', // title
|
||||
'#(?<=<secondary-title>)(.+?)(?=</secondary-title>)#i' => '<style face="normal" font="default" size="100%">' . "\\1" . '</style>', // secondary-title
|
||||
'#(?<=<full-title>)(.+?)(?=</full-title>)#i' => '<style face="normal" font="default" size="100%">' . "\\1" . '</style>', // full-title
|
||||
'#(?<=<alt-title>)(.+?)(?=</alt-title>)#i' => '<style face="normal" font="default" size="100%">' . "\\1" . '</style>', // alt-title
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
939
includes/transtab_latex_latin1.inc.php
Normal file
939
includes/transtab_latex_latin1.inc.php
Normal file
@@ -0,0 +1,939 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_latex_latin1.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_latex_latin1.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 10-Aug-06, 23:55
|
||||
// Modified: $Date: 2007-04-15 16:48:07 +0000 (Sun, 15 Apr 2007) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 938 $
|
||||
|
||||
// This is a translation table for best-effort conversion from LaTeX to ISO-8859-1 (Latin1) entities. It contains a comprehensive list of substitution strings for LaTeX characters,
|
||||
// which are used with the 'T1' font encoding. Uses commands from the 'textcomp' package. Latin1 characters that can't be matched uniquely are commented out. LaTeX markup which has
|
||||
// no equivalents in the ISO-8859-1 character set will be replaced with its closest ASCII representations. Adopted from 'transtab' by Markus Kuhn
|
||||
// (transtab.utf v1.8 2000-10-12 11:01:28+01 mgk25 Exp); see <http://www.cl.cam.ac.uk/~mgk25/unicode.html> for more info about Unicode and transtab.
|
||||
|
||||
$transtab_latex_latin1 = array(
|
||||
|
||||
// NUMBER SIGN
|
||||
'\\$\\\\#\\$' => "#",
|
||||
// <U0023> <U0023>
|
||||
|
||||
// PERCENT SIGN
|
||||
"\\\\%" => "%",
|
||||
// <U0025> <U0025>
|
||||
|
||||
// AMPERSAND
|
||||
"\\\\&" => "&",
|
||||
// <U0026> <U0026>
|
||||
|
||||
// APOSTROPHE
|
||||
"\\{\\\\textquoteright\\}" => "'",
|
||||
// <U2019> <U0027>
|
||||
|
||||
// GRAVE ACCENT
|
||||
"\\{\\\\textquoteleft\\}" => "`",
|
||||
// <U201B>;<U2018> <U0060>
|
||||
|
||||
// NO-BREAK SPACE
|
||||
"(?<!\\\\)~" => "<EFBFBD>",
|
||||
// <U007E> <U00A0>
|
||||
|
||||
// INVERTED EXCLAMATION MARK
|
||||
"\\{\\\\textexclamdown\\}" => "<EFBFBD>",
|
||||
// <U0021> <U00A1>
|
||||
|
||||
// CENT SIGN
|
||||
"\\{\\\\textcent\\}" => "<EFBFBD>",
|
||||
// <U0063> <U00A2>
|
||||
|
||||
// POUND SIGN
|
||||
"\\{\\\\textsterling\\}" => "<EFBFBD>",
|
||||
// "<U0047><U0042><U0050>" <U00A3>
|
||||
|
||||
// YEN SIGN
|
||||
"\\{\\\\textyen\\}" => "<EFBFBD>",
|
||||
// <U0059> <U00A5>
|
||||
|
||||
// BROKEN BAR
|
||||
"\\{\\\\textbrokenbar\\}" => "<EFBFBD>",
|
||||
// <U007C> <U00A6>
|
||||
|
||||
// SECTION SIGN
|
||||
"\\{\\\\textsection\\}" => "<EFBFBD>",
|
||||
// <U0053> <U00A7>
|
||||
|
||||
// DIAERESIS
|
||||
"\\{\\\\textasciidieresis\\}" => "<EFBFBD>",
|
||||
// <U0022> <U00A8>
|
||||
|
||||
// COPYRIGHT SIGN
|
||||
"\\{\\\\textcopyright\\}" => "<EFBFBD>",
|
||||
// "<U0028><U0063><U0029>";<U0063> <U00A9>
|
||||
|
||||
// FEMININE ORDINAL INDICATOR
|
||||
"\\{\\\\textordfeminine\\}" => "<EFBFBD>",
|
||||
// <U0061> <U00AA>
|
||||
|
||||
// LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
"\\{\\\\guillemotleft\\}" => "<EFBFBD>",
|
||||
// "<U003C><U003C>" <U00AB>
|
||||
|
||||
// NOT SIGN
|
||||
"\\{\\\\textlnot\\}" => "<EFBFBD>",
|
||||
// <U002D> <U00AC>
|
||||
|
||||
// SOFT HYPHEN
|
||||
// "-" => "<22>", // correct?
|
||||
// <U002D> <U00AD>
|
||||
|
||||
// REGISTERED SIGN
|
||||
"\\{\\\\textregistered\\}" => "<EFBFBD>",
|
||||
// "<U0028><U0052><U0029>" <U00AE>
|
||||
|
||||
// MACRON
|
||||
"\\{\\\\textasciimacron\\}" => "<EFBFBD>",
|
||||
// <U002D> <U00AF>
|
||||
|
||||
// DEGREE SIGN
|
||||
"\\{\\\\textdegree\\}" => "<EFBFBD>",
|
||||
// <U0020> <U00B0>
|
||||
|
||||
// PLUS-MINUS SIGN
|
||||
"\\{\\\\textpm\\}" => "<EFBFBD>",
|
||||
// "<U002B><U002F><U002D>" <U00B1>
|
||||
|
||||
// SUPERSCRIPT TWO
|
||||
"\\{\\\\texttwosuperior\\}" => "<EFBFBD>", // "[super:2]"
|
||||
// "<U005E><U0032>";<U0032> <U00B2>
|
||||
|
||||
// SUPERSCRIPT THREE
|
||||
"\\{\\\\textthreesuperior\\}" => "<EFBFBD>", // "[super:3]"
|
||||
// "<U005E><U0033>";<U0033> <U00B3>
|
||||
|
||||
// ACUTE ACCENT
|
||||
"\\{\\\\textasciiacute\\}" => "<EFBFBD>",
|
||||
// <U0027> <U00B4>
|
||||
|
||||
// MICRO SIGN
|
||||
"\\{\\\\textmu\\}" => "<EFBFBD>",
|
||||
// <U03BC>;<U0075> <U00B5>
|
||||
|
||||
// PILCROW SIGN
|
||||
"\\{\\\\textparagraph\\}" => "<EFBFBD>",
|
||||
// <U0050> <U00B6>
|
||||
|
||||
// MIDDLE DOT
|
||||
"\\{\\\\textperiodcentered\\}" => "<EFBFBD>",
|
||||
// <U002E> <U00B7>
|
||||
|
||||
// CEDILLA
|
||||
"\\{\\\\c\\\\ \\}" => "<EFBFBD>",
|
||||
// <U002C> <U00B8>
|
||||
|
||||
// SUPERSCRIPT ONE
|
||||
"\\{\\\\textonesuperior\\}" => "<EFBFBD>", // "[super:1]"
|
||||
// "<U005E><U0031>";<U0031> <U00B9>
|
||||
|
||||
// MASCULINE ORDINAL INDICATOR
|
||||
"\\{\\\\textordmasculine\\}" => "<EFBFBD>",
|
||||
// <U006F> <U00BA>
|
||||
|
||||
// RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
"\\{\\\\guillemotright\\}" => "<EFBFBD>",
|
||||
// "<U003E><U003E>" <U00BB>
|
||||
|
||||
// VULGAR FRACTION ONE QUARTER
|
||||
"\\{\\\\textonequarter\\}" => "<EFBFBD>",
|
||||
// "<U0020><U0031><U002F><U0034>" <U00BC>
|
||||
|
||||
// VULGAR FRACTION ONE HALF
|
||||
"\\{\\\\textonehalf\\}" => "<EFBFBD>",
|
||||
// "<U0020><U0031><U002F><U0032>" <U00BD>
|
||||
|
||||
// VULGAR FRACTION THREE QUARTERS
|
||||
"\\{\\\\textthreequarters\\}" => "<EFBFBD>",
|
||||
// "<U0020><U0033><U002F><U0034>" <U00BE>
|
||||
|
||||
// INVERTED QUESTION MARK
|
||||
"\\{\\\\textquestiondown\\}" => "<EFBFBD>",
|
||||
// <U003F> <U00BF>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH GRAVE
|
||||
"\\{\\\\`A\\}" => "<EFBFBD>", // \symbol{"C0}
|
||||
// <U0041> <U00C0>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH ACUTE
|
||||
"\\{\\\\'A\\}" => "<EFBFBD>", // \symbol{"C1}
|
||||
// <U0041> <U00C1>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH CIRCUMFLEX
|
||||
"\\{\\\\\\^A\\}" => "<EFBFBD>", // \symbol{"C2}
|
||||
// <U0041> <U00C2>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH TILDE
|
||||
"\\{\\\\~A\\}" => "<EFBFBD>", // \symbol{"C3}
|
||||
// <U0041> <U00C3>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH DIAERESIS
|
||||
"\\{\\\\\"A\\}" => "<EFBFBD>", // \symbol{"C4}
|
||||
// "<U0041><U0065>";<U0041> <U00C4>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH RING ABOVE
|
||||
"\\{\\\\r A\\}" => "<EFBFBD>", // "\\\\AA" // \symbol{"C5}
|
||||
// "<U0041><U0061>";<U0041> <U00C5>
|
||||
|
||||
// LATIN CAPITAL LETTER AE
|
||||
"\\{\\\\AE\\}" => "<EFBFBD>", // \symbol{"C6}
|
||||
// "<U0041><U0045>";<U0041> <U00C6>
|
||||
|
||||
// LATIN CAPITAL LETTER C WITH CEDILLA
|
||||
"\\{\\\\c C\\}" => "<EFBFBD>", // \symbol{"C7}
|
||||
// <U0043> <U00C7>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH GRAVE
|
||||
"\\{\\\\`E\\}" => "<EFBFBD>", // \symbol{"C8}
|
||||
// <U0045> <U00C8>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH ACUTE
|
||||
"\\{\\\\'E\\}" => "<EFBFBD>", // \symbol{"C9}
|
||||
// <U0045> <U00C9>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH CIRCUMFLEX
|
||||
"\\{\\\\\\^E\\}" => "<EFBFBD>", // \symbol{"CA}
|
||||
// <U0045> <U00CA>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH DIAERESIS
|
||||
"\\{\\\\\"E\\}" => "<EFBFBD>", // \symbol{"CB}
|
||||
// <U0045> <U00CB>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH GRAVE
|
||||
"\\{\\\\`I\\}" => "<EFBFBD>", // \symbol{"CC}
|
||||
// <U0049> <U00CC>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH ACUTE
|
||||
"\\{\\\\'I\\}" => "<EFBFBD>", // \symbol{"CD}
|
||||
// <U0049> <U00CD>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH CIRCUMFLEX
|
||||
"\\{\\\\\\^I\\}" => "<EFBFBD>", // \symbol{"CE}
|
||||
// <U0049> <U00CE>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH DIAERESIS
|
||||
"\\{\\\\\"I\\}" => "<EFBFBD>", // \symbol{"CF}
|
||||
// <U0049> <U00CF>
|
||||
|
||||
// LATIN CAPITAL LETTER ETH
|
||||
"\\{\\\\DH\\}" => "<EFBFBD>", // \symbol{"D0}
|
||||
// <U0044> <U00D0>
|
||||
|
||||
// LATIN CAPITAL LETTER N WITH TILDE
|
||||
"\\{\\\\~N\\}" => "<EFBFBD>", // \symbol{"D1}
|
||||
// <U004E> <U00D1>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH GRAVE
|
||||
"\\{\\\\`O\\}" => "<EFBFBD>", // \symbol{"D2}
|
||||
// <U004F> <U00D2>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH ACUTE
|
||||
"\\{\\\\'O\\}" => "<EFBFBD>", // \symbol{"D3}
|
||||
// <U004F> <U00D3>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH CIRCUMFLEX
|
||||
"\\{\\\\\\^O\\}" => "<EFBFBD>", // \symbol{"D4}
|
||||
// <U004F> <U00D4>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH TILDE
|
||||
"\\{\\\\~O\\}" => "<EFBFBD>", // \symbol{"D5}
|
||||
// <U004F> <U00D5>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH DIAERESIS
|
||||
"\\{\\\\\"O\\}" => "<EFBFBD>", // \symbol{"D6}
|
||||
// "<U004F><U0065>";<U004F> <U00D6>
|
||||
|
||||
// MULTIPLICATION SIGN
|
||||
"\\{\\\\texttimes\\}" => "<EFBFBD>", // \symbol{"D7}
|
||||
// <U0078> <U00D7>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH STROKE
|
||||
"\\{\\\\O\\}" => "<EFBFBD>", // \symbol{"D8}
|
||||
// <U004F> <U00D8>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH GRAVE
|
||||
"\\{\\\\`U\\}" => "<EFBFBD>", // \symbol{"D9}
|
||||
// <U0055> <U00D9>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH ACUTE
|
||||
"\\{\\\\'U\\}" => "<EFBFBD>", // \symbol{"DA}
|
||||
// <U0055> <U00DA>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH CIRCUMFLEX
|
||||
"\\{\\\\\\^U\\}" => "<EFBFBD>", // \symbol{"DB}
|
||||
// <U0055> <U00DB>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH DIAERESIS
|
||||
"\\{\\\\\"U\\}" => "<EFBFBD>", // \symbol{"DC}
|
||||
// "<U0055><U0065>";<U0055> <U00DC>
|
||||
|
||||
// LATIN CAPITAL LETTER Y WITH ACUTE
|
||||
"\\{\\\\'Y\\}" => "<EFBFBD>", // \symbol{"DD}
|
||||
// <U0059> <U00DD>
|
||||
|
||||
// LATIN CAPITAL LETTER THORN
|
||||
"\\{\\\\TH\\}" => "<EFBFBD>", // \symbol{"DE}
|
||||
// "<U0054><U0068>" <U00DE>
|
||||
|
||||
// LATIN SMALL LETTER SHARP S
|
||||
"\\{\\\\ss\\}" => "<EFBFBD>", // \symbol{"DF}
|
||||
// "<U0073><U0073>";<U03B2> <U00DF>
|
||||
|
||||
// LATIN SMALL LETTER A WITH GRAVE
|
||||
"\\{\\\\`a\\}" => "<EFBFBD>", // \symbol{"E0}
|
||||
// <U0061> <U00E0>
|
||||
|
||||
// LATIN SMALL LETTER A WITH ACUTE
|
||||
"\\{\\\\'a\\}" => "<EFBFBD>", // \symbol{"E1}
|
||||
// <U0061> <U00E1>
|
||||
|
||||
// LATIN SMALL LETTER A WITH CIRCUMFLEX
|
||||
"\\{\\\\\\^a\\}" => "<EFBFBD>", // \symbol{"E2}
|
||||
// <U0061> <U00E2>
|
||||
|
||||
// LATIN SMALL LETTER A WITH TILDE
|
||||
"\\{\\\\~a\\}" => "<EFBFBD>", // \symbol{"E3}
|
||||
// <U0061> <U00E3>
|
||||
|
||||
// LATIN SMALL LETTER A WITH DIAERESIS
|
||||
"\\{\\\\\"a\\}" => "<EFBFBD>", // \symbol{"E4}
|
||||
// "<U0061><U0065>";<U0061> <U00E4>
|
||||
|
||||
// LATIN SMALL LETTER A WITH RING ABOVE
|
||||
"\\{\\\\r a\\}" => "<EFBFBD>", // "\\\\aa" // \symbol{"E5}
|
||||
// "<U0061><U0061>";<U0061> <U00E5>
|
||||
|
||||
// LATIN SMALL LETTER AE
|
||||
"\\{\\\\ae\\}" => "<EFBFBD>", // \symbol{"E6}
|
||||
// "<U0061><U0065>";<U0061> <U00E6>
|
||||
|
||||
// LATIN SMALL LETTER C WITH CEDILLA
|
||||
"\\{\\\\c c\\}" => "<EFBFBD>", // \symbol{"E7}
|
||||
// <U0063> <U00E7>
|
||||
|
||||
// LATIN SMALL LETTER E WITH GRAVE
|
||||
"\\{\\\\`e\\}" => "<EFBFBD>", // \symbol{"E8}
|
||||
// <U0065> <U00E8>
|
||||
|
||||
// LATIN SMALL LETTER E WITH ACUTE
|
||||
"\\{\\\\'e\\}" => "<EFBFBD>", // \symbol{"E9}
|
||||
// <U0065> <U00E9>
|
||||
|
||||
// LATIN SMALL LETTER E WITH CIRCUMFLEX
|
||||
"\\{\\\\\\^e\\}" => "<EFBFBD>", // \symbol{"EA}
|
||||
// <U0065> <U00EA>
|
||||
|
||||
// LATIN SMALL LETTER E WITH DIAERESIS
|
||||
"\\{\\\\\"e\\}" => "<EFBFBD>", // \symbol{"EB}
|
||||
// <U0065> <U00EB>
|
||||
|
||||
// LATIN SMALL LETTER I WITH GRAVE
|
||||
"\\{\\\\`\\\\i\\}" => "<EFBFBD>", // \symbol{"EC}
|
||||
// <U0069> <U00EC>
|
||||
|
||||
// LATIN SMALL LETTER I WITH ACUTE
|
||||
"\\{\\\\'\\\\i\\}" => "<EFBFBD>", // \symbol{"ED}
|
||||
// <U0069> <U00ED>
|
||||
|
||||
// LATIN SMALL LETTER I WITH CIRCUMFLEX
|
||||
"\\{\\\\\\^\\\\i\\}" => "<EFBFBD>", // \symbol{"EE}
|
||||
// <U0069> <U00EE>
|
||||
|
||||
// LATIN SMALL LETTER I WITH DIAERESIS
|
||||
"\\{\\\\\"\\\\i\\}" => "<EFBFBD>", // \symbol{"EF}
|
||||
// <U0069> <U00EF>
|
||||
|
||||
// LATIN SMALL LETTER ETH
|
||||
"\\{\\\\dh\\}" => "<EFBFBD>", // \symbol{"F0}
|
||||
// <U0064> <U00F0>
|
||||
|
||||
// LATIN SMALL LETTER N WITH TILDE
|
||||
"\\{\\\\~n\\}" => "<EFBFBD>", // \symbol{"F1}
|
||||
// <U006E> <U00F1>
|
||||
|
||||
// LATIN SMALL LETTER O WITH GRAVE
|
||||
"\\{\\\\`o\\}" => "<EFBFBD>", // \symbol{"F2}
|
||||
// <U006F> <U00F2>
|
||||
|
||||
// LATIN SMALL LETTER O WITH ACUTE
|
||||
"\\{\\\\'o\\}" => "<EFBFBD>", // \symbol{"F3}
|
||||
// <U006F> <U00F3>
|
||||
|
||||
// LATIN SMALL LETTER O WITH CIRCUMFLEX
|
||||
"\\{\\\\\\^o\\}" => "<EFBFBD>", // \symbol{"F4}
|
||||
// <U006F> <U00F4>
|
||||
|
||||
// LATIN SMALL LETTER O WITH TILDE
|
||||
"\\{\\\\~o\\}" => "<EFBFBD>", // \symbol{"F5}
|
||||
// <U006F> <U00F5>
|
||||
|
||||
// LATIN SMALL LETTER O WITH DIAERESIS
|
||||
"\\{\\\\\"o\\}" => "<EFBFBD>", // \symbol{"F6}
|
||||
// "<U006F><U0065>";<U006F> <U00F6>
|
||||
|
||||
// DIVISION SIGN
|
||||
"\\{\\\\textdiv\\}" => "<EFBFBD>", // \symbol{"F7}
|
||||
// <U003A> <U00F7>
|
||||
|
||||
// LATIN SMALL LETTER O WITH STROKE
|
||||
"\\{\\\\o\\}" => "<EFBFBD>", // \symbol{"F8}
|
||||
// <U006F> <U00F8>
|
||||
|
||||
// LATIN SMALL LETTER U WITH GRAVE
|
||||
"\\{\\\\`u\\}" => "<EFBFBD>", // \symbol{"F9}
|
||||
// <U0075> <U00F9>
|
||||
|
||||
// LATIN SMALL LETTER U WITH ACUTE
|
||||
"\\{\\\\'u\\}" => "<EFBFBD>", // \symbol{"FA}
|
||||
// <U0075> <U00FA>
|
||||
|
||||
// LATIN SMALL LETTER U WITH CIRCUMFLEX
|
||||
"\\{\\\\\\^u\\}" => "<EFBFBD>", // \symbol{"FB}
|
||||
// <U0075> <U00FB>
|
||||
|
||||
// LATIN SMALL LETTER U WITH DIAERESIS
|
||||
"\\{\\\\\"u\\}" => "<EFBFBD>", // \symbol{"FC}
|
||||
// "<U0075><U0065>";<U0075> <U00FC>
|
||||
|
||||
// LATIN SMALL LETTER Y WITH ACUTE
|
||||
"\\{\\\\'y\\}" => "<EFBFBD>", // \symbol{"FD}
|
||||
// <U0079> <U00FD>
|
||||
|
||||
// LATIN SMALL LETTER THORN
|
||||
"\\{\\\\th\\}" => "<EFBFBD>", // \symbol{"FE}
|
||||
// "<U0074><U0068>" <U00FE>
|
||||
|
||||
// LATIN SMALL LETTER Y WITH DIAERESIS
|
||||
"\\{\\\\\"y\\}" => "<EFBFBD>", // \symbol{"FF}
|
||||
// <U0079> <U00FF>
|
||||
|
||||
// Note: AFAIK, the LaTeX markup below has no equivalents in the ISO-8859-1 (Latin1) character set, --------------------------------------------------
|
||||
// therefore we'll replace this LaTeX markup with its closest ASCII representations.
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH BREVE
|
||||
"\\{\\\\u A\\}" => "A",
|
||||
// <U0041> <U0102>
|
||||
|
||||
// LATIN SMALL LETTER A WITH BREVE
|
||||
"\\{\\\\u a\\}" => "a",
|
||||
// <U0061> <U0103>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH OGONEK
|
||||
"\\{\\\\k A\\}" => "A",
|
||||
// <U0041> <U0104>
|
||||
|
||||
// LATIN SMALL LETTER A WITH OGONEK
|
||||
"\\{\\\\k a\\}" => "a",
|
||||
// <U0061> <U0105>
|
||||
|
||||
// LATIN CAPITAL LETTER C WITH ACUTE
|
||||
"\\{\\\\'C\\}" => "C",
|
||||
// <U0043> <U0106>
|
||||
|
||||
// LATIN SMALL LETTER C WITH ACUTE
|
||||
"\\{\\\\'c\\}" => "c",
|
||||
// <U0063> <U0107>
|
||||
|
||||
// LATIN CAPITAL LETTER C WITH CARON
|
||||
"\\{\\\\v C\\}" => "C",
|
||||
// <U0043> <U010C>
|
||||
|
||||
// LATIN SMALL LETTER C WITH CARON
|
||||
"\\{\\\\v c\\}" => "c",
|
||||
// <U0063> <U010D>
|
||||
|
||||
// LATIN CAPITAL LETTER D WITH CARON
|
||||
"\\{\\\\v D\\}" => "D",
|
||||
// <U0044> <U010E>
|
||||
|
||||
// LATIN SMALL LETTER D WITH CARON
|
||||
"\\{\\\\v d\\}" => "d",
|
||||
// <U0064> <U010F>
|
||||
|
||||
// LATIN CAPITAL LETTER D WITH STROKE
|
||||
"\\{\\\\DJ\\}" => "D",
|
||||
// <U0044> <U0110>
|
||||
|
||||
// LATIN SMALL LETTER D WITH STROKE
|
||||
"\\{\\\\dj\\}" => "d",
|
||||
// <U0064> <U0111>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH OGONEK
|
||||
"\\{\\\\k E\\}" => "E",
|
||||
// <U0045> <U0118>
|
||||
|
||||
// LATIN SMALL LETTER E WITH OGONEK
|
||||
"\\{\\\\k e\\}" => "e",
|
||||
// <U0065> <U0119>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH CARON
|
||||
"\\{\\\\v E\\}" => "E",
|
||||
// <U0045> <U011A>
|
||||
|
||||
// LATIN SMALL LETTER E WITH CARON
|
||||
"\\{\\\\v e\\}" => "e",
|
||||
// <U0065> <U011B>
|
||||
|
||||
// LATIN CAPITAL LETTER G WITH BREVE
|
||||
"\\{\\\\u G\\}" => "G",
|
||||
// <U0047> <U011E>
|
||||
|
||||
// LATIN SMALL LETTER G WITH BREVE
|
||||
"\\{\\\\u g\\}" => "g",
|
||||
// <U0067> <U011F>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH DOT ABOVE
|
||||
"\\{\\\\.I\\}" => "I",
|
||||
// <U0049> <U0130>
|
||||
|
||||
// LATIN SMALL LETTER DOTLESS I
|
||||
"\\{\\\\i\\}" => "i",
|
||||
// <U0069> <U0131>
|
||||
|
||||
// LATIN CAPITAL LETTER L WITH ACUTE
|
||||
"\\{\\\\'L\\}" => "L",
|
||||
// <U004C> <U0139>
|
||||
|
||||
// LATIN SMALL LETTER L WITH ACUTE
|
||||
"\\{\\\\'l\\}" => "l",
|
||||
// <U006C> <U013A>
|
||||
|
||||
// LATIN CAPITAL LETTER L WITH CARON
|
||||
"\\{\\\\v L\\}" => "L",
|
||||
// <U004C> <U013D>
|
||||
|
||||
// LATIN SMALL LETTER L WITH CARON
|
||||
"\\{\\\\v l\\}" => "l",
|
||||
// <U006C> <U013E>
|
||||
|
||||
// LATIN CAPITAL LETTER L WITH STROKE
|
||||
"\\{\\\\L\\}" => "L",
|
||||
// <U004C> <U0141>
|
||||
|
||||
// LATIN SMALL LETTER L WITH STROKE
|
||||
"\\{\\\\l\\}" => "l",
|
||||
// <U006C> <U0142>
|
||||
|
||||
// LATIN CAPITAL LETTER N WITH ACUTE
|
||||
"\\{\\\\'N\\}" => "N",
|
||||
// <U004E> <U0143>
|
||||
|
||||
// LATIN SMALL LETTER N WITH ACUTE
|
||||
"\\{\\\\'n\\}" => "n",
|
||||
// <U006E> <U0144>
|
||||
|
||||
// LATIN CAPITAL LETTER N WITH CARON
|
||||
"\\{\\\\v N\\}" => "N",
|
||||
// <U004E> <U0147>
|
||||
|
||||
// LATIN SMALL LETTER N WITH CARON
|
||||
"\\{\\\\v n\\}" => "n",
|
||||
// <U006E> <U0148>
|
||||
|
||||
// LATIN CAPITAL LETTER ENG
|
||||
"\\{\\\\NG\\}" => "NG", // "N"
|
||||
// "<U004E><U0047>";<U004E> <U014A>
|
||||
|
||||
// LATIN SMALL LETTER ENG
|
||||
"\\{\\\\ng\\}" => "ng", // "n"
|
||||
// "<U006E><U0067>";<U006E> <U014B>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
|
||||
"\\{\\\\H O\\}" => "O",
|
||||
// <U004F> <U0150>
|
||||
|
||||
// LATIN SMALL LETTER O WITH DOUBLE ACUTE
|
||||
"\\{\\\\H o\\}" => "o",
|
||||
// <U006F> <U0151>
|
||||
|
||||
// LATIN CAPITAL LIGATURE OE
|
||||
"\\{\\\\OE\\}" => "OE",
|
||||
// "<U004F><U0045>" <U0152>
|
||||
|
||||
// LATIN SMALL LIGATURE OE
|
||||
"\\{\\\\oe\\}" => "oe",
|
||||
// "<U006F><U0065>" <U0153>
|
||||
|
||||
// LATIN CAPITAL LETTER R WITH ACUTE
|
||||
"\\{\\\\'R\\}" => "R",
|
||||
// <U0052> <U0154>
|
||||
|
||||
// LATIN SMALL LETTER R WITH ACUTE
|
||||
"\\{\\\\'r\\}" => "r",
|
||||
// <U0072> <U0155>
|
||||
|
||||
// LATIN CAPITAL LETTER R WITH CARON
|
||||
"\\{\\\\v R\\}" => "R",
|
||||
// <U0052> <U0158>
|
||||
|
||||
// LATIN SMALL LETTER R WITH CARON
|
||||
"\\{\\\\v r\\}" => "r",
|
||||
// <U0072> <U0159>
|
||||
|
||||
// LATIN CAPITAL LETTER S WITH ACUTE
|
||||
"\\{\\\\'S\\}" => "S",
|
||||
// <U0053> <U015A>
|
||||
|
||||
// LATIN SMALL LETTER S WITH ACUTE
|
||||
"\\{\\\\'s\\}" => "s",
|
||||
// <U0073> <U015B>
|
||||
|
||||
// LATIN CAPITAL LETTER S WITH CEDILLA
|
||||
"\\{\\\\c S\\}" => "S",
|
||||
// <U0053> <U015E>
|
||||
|
||||
// LATIN SMALL LETTER S WITH CEDILLA
|
||||
"\\{\\\\c s\\}" => "s",
|
||||
// <U0073> <U015F>
|
||||
|
||||
// LATIN CAPITAL LETTER S WITH CARON
|
||||
"\\{\\\\v S\\}" => "S",
|
||||
// <U0053> <U0160>
|
||||
|
||||
// LATIN SMALL LETTER S WITH CARON
|
||||
"\\{\\\\v s\\}" => "s",
|
||||
// <U0073> <U0161>
|
||||
|
||||
// LATIN CAPITAL LETTER T WITH CEDILLA
|
||||
"\\{\\\\c T\\}" => "T",
|
||||
// <U0054> <U0162>
|
||||
|
||||
// LATIN SMALL LETTER T WITH CEDILLA
|
||||
"\\{\\\\c t\\}" => "t",
|
||||
// <U0074> <U0163>
|
||||
|
||||
// LATIN CAPITAL LETTER T WITH CARON
|
||||
"\\{\\\\v T\\}" => "T",
|
||||
// <U0054> <U0164>
|
||||
|
||||
// LATIN SMALL LETTER T WITH CARON
|
||||
"\\{\\\\v t\\}" => "t",
|
||||
// <U0074> <U0165>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH RING ABOVE
|
||||
"\\{\\\\r U\\}" => "U",
|
||||
// <U0055> <U016E>
|
||||
|
||||
// LATIN SMALL LETTER U WITH RING ABOVE
|
||||
"\\{\\\\r u\\}" => "u",
|
||||
// <U0075> <U016F>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
|
||||
"\\{\\\\H U\\}" => "U",
|
||||
// <U0055> <U0170>
|
||||
|
||||
// LATIN SMALL LETTER U WITH DOUBLE ACUTE
|
||||
"\\{\\\\H u\\}" => "u",
|
||||
// <U0075> <U0171>
|
||||
|
||||
// LATIN CAPITAL LETTER Y WITH DIAERESIS
|
||||
"\\{\\\\\"Y\\}" => "Y",
|
||||
// <U0059> <U0178>
|
||||
|
||||
// LATIN CAPITAL LETTER Z WITH ACUTE
|
||||
"\\{\\\\'Z\\}" => "Z",
|
||||
// <U005A> <U0179>
|
||||
|
||||
// LATIN SMALL LETTER Z WITH ACUTE
|
||||
"\\{\\\\'z\\}" => "z",
|
||||
// <U007A> <U017A>
|
||||
|
||||
// LATIN CAPITAL LETTER Z WITH DOT ABOVE
|
||||
"\\{\\\\.Z\\}" => "Z",
|
||||
// <U005A> <U017B>
|
||||
|
||||
// LATIN SMALL LETTER Z WITH DOT ABOVE
|
||||
"\\{\\\\.z\\}" => "z",
|
||||
// <U007A> <U017C>
|
||||
|
||||
// LATIN CAPITAL LETTER Z WITH CARON
|
||||
"\\{\\\\v Z\\}" => "Z",
|
||||
// <U005A> <U017D>
|
||||
|
||||
// LATIN SMALL LETTER Z WITH CARON
|
||||
"\\{\\\\v z\\}" => "z",
|
||||
// <U007A> <U017E>
|
||||
|
||||
// LATIN SMALL LETTER F WITH HOOK
|
||||
"\\{\\\\textflorin\\}" => "f",
|
||||
// <U0066> <U0192>
|
||||
|
||||
// MODIFIER LETTER CIRCUMFLEX ACCENT
|
||||
"\\{\\\\textasciicircum\\}" => "^",
|
||||
// <U005E> <U02C6>
|
||||
|
||||
// DOUBLE ACUTE ACCENT
|
||||
"\\{\\\\textacutedbl\\}" => "\"",
|
||||
// <U0022> <U02DD>
|
||||
|
||||
// EN DASH
|
||||
"\\{\\\\textendash\\}|--" => "<EFBFBD>", // note that this endash is NOT <U2013>
|
||||
// <U002D> <U2013>
|
||||
|
||||
// EM DASH
|
||||
"\\{\\\\textemdash\\}|---" => "<EFBFBD><EFBFBD>", // I don't know how to correctly print an emdash using the latin1 charset so we'll currently use two endashes instead
|
||||
// "<U002D><U002D>" <U2014>
|
||||
|
||||
// DOUBLE VERTICAL LINE
|
||||
"\\{\\\\textbardbl\\}" => "||",
|
||||
// "<U007C><U007C>" <U2016>
|
||||
|
||||
// DOUBLE LOW LINE
|
||||
"\\{\\\\textunderscore\\}" => "_",
|
||||
// <U005F> <U2017>
|
||||
|
||||
// LEFT SINGLE QUOTATION MARK
|
||||
"\\{\\\\textquoteleft\\}" => "'",
|
||||
// <U0027> <U2018>
|
||||
|
||||
// RIGHT SINGLE QUOTATION MARK
|
||||
"\\{\\\\textquoteright\\}" => "'",
|
||||
// <U0027> <U2019>
|
||||
|
||||
// SINGLE LOW-9 QUOTATION MARK
|
||||
"\\{\\\\quotesinglbase\\}" => "'",
|
||||
// <U0027> <U201A>
|
||||
|
||||
// LEFT DOUBLE QUOTATION MARK
|
||||
"\\{\\\\textquotedblleft\\}" => "\"",
|
||||
// <U0022> <U201C>
|
||||
|
||||
// RIGHT DOUBLE QUOTATION MARK
|
||||
"\\{\\\\textquotedblright\\}" => "\"",
|
||||
// <U0022> <U201D>
|
||||
|
||||
// DOUBLE LOW-9 QUOTATION MARK
|
||||
"\\{\\\\quotedblbase\\}" => "\"",
|
||||
// <U0022> <U201E>
|
||||
|
||||
// DAGGER
|
||||
"\\{\\\\textdagger\\}" => "+",
|
||||
// <U002B> <U2020>
|
||||
|
||||
// DOUBLE DAGGER
|
||||
"\\{\\\\textdaggerdbl\\}" => "++",
|
||||
// "<U002B><U002B>" <U2021>
|
||||
|
||||
// BULLET
|
||||
"\\{\\\\textbullet\\}" => "o",
|
||||
// <U006F> <U2022>
|
||||
|
||||
// HORIZONTAL ELLIPSIS
|
||||
"\\{\\\\textellipsis\\}" => "...",
|
||||
// "<U002E><U002E><U002E>" <U2026>
|
||||
|
||||
// PER MILLE SIGN
|
||||
// "\\{\\\\textperthousand\\}" => "0/00", // "[permil]" // this is translated into proper refbase markup via 'transtab_bibtex_refbase.inc.php'
|
||||
// "<U0020><U0030><U002F><U0030><U0030>" <U2030>
|
||||
|
||||
// SINGLE LEFT-POINTING ANGLE QUOTATION MARK
|
||||
"\\{\\\\guilsinglleft\\}" => "<",
|
||||
// <U003C> <U2039>
|
||||
|
||||
// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
|
||||
"\\{\\\\guilsinglright\\}" => ">",
|
||||
// <U003E> <U203A>
|
||||
|
||||
// FRACTION SLASH
|
||||
"\\{\\\\textfractionsolidus\\}" => "/",
|
||||
// <U002F> <U2044>
|
||||
|
||||
// SUPERSCRIPT ZERO
|
||||
// '\\$\\^\\{0\\}\\$' => "^0", // "[super:0]" // superscript markup is translated into proper refbase markup via 'transtab_bibtex_refbase.inc.php'
|
||||
// "<U005E><U0030>";<U0030> <U2070>
|
||||
|
||||
// SUPERSCRIPT FOUR
|
||||
// '\\$\\^\\{4\\}\\$' => "^4", // "[super:4]"
|
||||
// "<U005E><U0034>";<U0034> <U2074>
|
||||
|
||||
// SUPERSCRIPT FIVE
|
||||
// '\\$\\^\\{5\\}\\$' => "^5", // "[super:5]"
|
||||
// "<U005E><U0035>";<U0035> <U2075>
|
||||
|
||||
// SUPERSCRIPT SIX
|
||||
// '\\$\\^\\{6\\}\\$' => "^6", // "[super:6]"
|
||||
// "<U005E><U0036>";<U0036> <U2076>
|
||||
|
||||
// SUPERSCRIPT SEVEN
|
||||
// '\\$\\^\\{7\\}\\$' => "^7", // "[super:7]"
|
||||
// "<U005E><U0037>";<U0037> <U2077>
|
||||
|
||||
// SUPERSCRIPT EIGHT
|
||||
// '\\$\\^\\{8\\}\\$' => "^8", // "[super:8]"
|
||||
// "<U005E><U0038>";<U0038> <U2078>
|
||||
|
||||
// SUPERSCRIPT NINE
|
||||
// '\\$\\^\\{9\\}\\$' => "^9", // "[super:9]"
|
||||
// "<U005E><U0039>";<U0039> <U2079>
|
||||
|
||||
// SUPERSCRIPT PLUS SIGN
|
||||
// '\\$\\^\\{+\\}\\$' => "^+", // "[super:+]"
|
||||
// "<U005E><U002B>";<U002B> <U207A>
|
||||
|
||||
// SUPERSCRIPT MINUS
|
||||
// '\\$\\^\\{-\\}\\$' => "^-", // "[super:-]"
|
||||
// "<U005E><U002D>";<U002D> <U207B>
|
||||
|
||||
// SUPERSCRIPT EQUALS SIGN
|
||||
// '\\$\\^\\{=\\}\\$' => "^=", // "[super:=]"
|
||||
// "<U005E><U003D>";<U003D> <U207C>
|
||||
|
||||
// SUPERSCRIPT LEFT PARENTHESIS
|
||||
// '\\$\\^\\{\\(\\}\\$' => "^(", // "[super:(]"
|
||||
// "<U005E><U0028>";<U0028> <U207D>
|
||||
|
||||
// SUPERSCRIPT RIGHT PARENTHESIS
|
||||
// '\\$\\^\\{\\)\\}\\$' => "^)", // "[super:)]"
|
||||
// "<U005E><U0029>";<U0029> <U207E>
|
||||
|
||||
// SUPERSCRIPT LATIN SMALL LETTER N
|
||||
// '\\$\\^\\{n\\}\\$' => "^n", // "[super:n]"
|
||||
// "<U005E><U006E>";<U006E> <U207F>
|
||||
|
||||
// SUBSCRIPT ZERO
|
||||
// '\\$_\\{0\\}\\$' => "_0", // "[sub:0]" // subscript markup is translated into proper refbase markup via 'transtab_bibtex_refbase.inc.php'
|
||||
// "<U005F><U0030>";<U0030> <U2080>
|
||||
|
||||
// SUBSCRIPT ONE
|
||||
// '\\$_\\{1\\}\\$' => "_1", // "[sub:1]"
|
||||
// "<U005F><U0031>";<U0031> <U2081>
|
||||
|
||||
// SUBSCRIPT TWO
|
||||
// '\\$_\\{2\\}\\$' => "_2", // "[sub:2]"
|
||||
// "<U005F><U0032>";<U0032> <U2082>
|
||||
|
||||
// SUBSCRIPT THREE
|
||||
// '\\$_\\{3\\}\\$' => "_3", // "[sub:3]"
|
||||
// "<U005F><U0033>";<U0033> <U2083>
|
||||
|
||||
// SUBSCRIPT FOUR
|
||||
// '\\$_\\{4\\}\\$' => "_4", // "[sub:4]"
|
||||
// "<U005F><U0034>";<U0034> <U2084>
|
||||
|
||||
// SUBSCRIPT FIVE
|
||||
// '\\$_\\{5\\}\\$' => "_5", // "[sub:5]"
|
||||
// "<U005F><U0035>";<U0035> <U2085>
|
||||
|
||||
// SUBSCRIPT SIX
|
||||
// '\\$_\\{6\\}\\$' => "_6", // "[sub:6]"
|
||||
// "<U005F><U0036>";<U0036> <U2086>
|
||||
|
||||
// SUBSCRIPT SEVEN
|
||||
// '\\$_\\{7\\}\\$' => "_7", // "[sub:7]"
|
||||
// "<U005F><U0037>";<U0037> <U2087>
|
||||
|
||||
// SUBSCRIPT EIGHT
|
||||
// '\\$_\\{8\\}\\$' => "_8", // "[sub:8]"
|
||||
// "<U005F><U0038>";<U0038> <U2088>
|
||||
|
||||
// SUBSCRIPT NINE
|
||||
// '\\$_\\{9\\}\\$' => "_9", // "[sub:9]"
|
||||
// "<U005F><U0039>";<U0039> <U2089>
|
||||
|
||||
// SUBSCRIPT PLUS SIGN
|
||||
// '\\$_\\{+\\}\\$' => "_+", // "[sub:+]"
|
||||
// "<U005F><U002B>";<U002B> <U208A>
|
||||
|
||||
// SUBSCRIPT MINUS
|
||||
// '\\$_\\{-\\}\\$' => "_-", // "[sub:-]"
|
||||
// "<U005F><U002D>";<U002D> <U208B>
|
||||
|
||||
// SUBSCRIPT EQUALS SIGN
|
||||
// '\\$_\\{=\\}\\$' => "_=", // "[sub:=]"
|
||||
// "<U005F><U003D>";<U003D> <U208C>
|
||||
|
||||
// SUBSCRIPT LEFT PARENTHESIS
|
||||
// '\\$_\\{\\(\\}\\$' => "_(", // "[sub:(]"
|
||||
// "<U005F><U0028>";<U0028> <U208D>
|
||||
|
||||
// SUBSCRIPT RIGHT PARENTHESIS
|
||||
// '\\$_\\{\\)\\}\\$' => "_)", // "[sub:)]"
|
||||
// "<U005F><U0029>";<U0029> <U208E>
|
||||
|
||||
// EURO SIGN
|
||||
"\\{\\\\texteuro\\}" => "EUR", // "E"
|
||||
// "<U0045><U0055><U0052>";<U0045> <U20AC>
|
||||
|
||||
// DEGREE CELSIUS
|
||||
"\\{\\\\textcelsius\\}" => "<EFBFBD>C",
|
||||
// "<U00B0><U0043>";<U0043> <U2103>
|
||||
|
||||
// NUMERO SIGN
|
||||
"\\{\\\\textnumero\\}" => "No", // "N<>"
|
||||
// "<U004E><U00BA>";"<U004E><U006F>" <U2116>
|
||||
|
||||
// SOUND RECORDING COPYRIGHT
|
||||
"\\{\\\\textcircledP\\}" => "(P)",
|
||||
// "<U0028><U0050><U0029>" <U2117>
|
||||
|
||||
// SERVICE MARK
|
||||
"\\{\\\\textservicemark\\}" => "[SM]",
|
||||
// "<U005B><U0053><U004D><U005D>" <U2120>
|
||||
|
||||
// TRADE MARK SIGN
|
||||
"\\{\\\\texttrademark\\}" => "[TM]",
|
||||
// "<U005B><U0054><U004D><U005D>" <U2122>
|
||||
|
||||
// OHM SIGN
|
||||
"\\{\\\\textohm\\}" => "ohm", // "O"
|
||||
// <U03A9>;"<U006F><U0068><U006D>";<U004F> <U2126>
|
||||
|
||||
// ESTIMATED SYMBOL
|
||||
"\\{\\\\textestimated\\}" => "e",
|
||||
// <U0065> <U212E>
|
||||
|
||||
// LEFTWARDS ARROW
|
||||
"\\{\\\\textleftarrow\\}" => "<-",
|
||||
// "<U003C><U002D>" <U2190>
|
||||
|
||||
// UPWARDS ARROW
|
||||
"\\{\\\\textuparrow\\}" => "^",
|
||||
// <U005E> <U2191>
|
||||
|
||||
// RIGHTWARDS ARROW
|
||||
"\\{\\\\textrightarrow\\}" => "->",
|
||||
// "<U002D><U003E>" <U2192>
|
||||
|
||||
// DOWNWARDS ARROW
|
||||
"\\{\\\\textdownarrow\\}" => "v",
|
||||
// <U0076> <U2193>
|
||||
|
||||
// INFINITY
|
||||
// '\\$\\\\infty\\$' => "inf", // "[infinity]" // this is translated into proper refbase markup via 'transtab_bibtex_refbase.inc.php'
|
||||
// "<U0069><U006E><U0066>" <U221E>
|
||||
|
||||
// LEFT-POINTING ANGLE BRACKET
|
||||
"\\{\\\\textlangle\\}" => "<",
|
||||
// <U003C> <U2329>
|
||||
|
||||
// RIGHT-POINTING ANGLE BRACKET
|
||||
"\\{\\\\textrangle\\}" => ">",
|
||||
// <U003E> <U232A>
|
||||
|
||||
// OPEN BOX
|
||||
"\\{\\\\textvisiblespace\\}" => "_",
|
||||
// <U005F> <U2423>
|
||||
|
||||
// WHITE BULLET
|
||||
"\\{\\\\textopenbullet\\}" => "o"
|
||||
// <U006F> <U25E6>
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
3348
includes/transtab_latex_unicode.inc.php
Normal file
3348
includes/transtab_latex_unicode.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
415
includes/transtab_latin1_ascii.inc.php
Normal file
415
includes/transtab_latin1_ascii.inc.php
Normal file
@@ -0,0 +1,415 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_latin1_ascii.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_latin1_ascii.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 24-Aug-05, 20:11
|
||||
// Modified: $Date: 2007-02-17 01:10:14 +0000 (Sat, 17 Feb 2007) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 894 $
|
||||
|
||||
// This is a transliteration table for a best-effort conversion from ISO-8859-1 to ASCII. It contains a list of substitution strings for 'ISO-8859-1 West European' characters,
|
||||
// comparable to the fallback notations that people use commonly in email and on typewriters to represent unavailable characters. Adopted from 'transtab' by Markus Kuhn
|
||||
// (transtab.utf v1.8 2000-10-12 11:01:28+01 mgk25 Exp); see <http://www.cl.cam.ac.uk/~mgk25/unicode.html> for more info about Unicode and transtab.
|
||||
|
||||
$transtab_latin1_ascii = array(
|
||||
|
||||
// APOSTROPHE
|
||||
"'" => "'",
|
||||
// <U0027> <U2019>
|
||||
|
||||
// GRAVE ACCENT
|
||||
"`" => "'",
|
||||
// <U0060> <U201B>;<U2018>
|
||||
|
||||
// NO-BREAK SPACE
|
||||
"<EFBFBD>" => " ",
|
||||
// <U00A0> <U0020>
|
||||
|
||||
// INVERTED EXCLAMATION MARK
|
||||
"<EFBFBD>" => "!",
|
||||
// <U00A1> <U0021>
|
||||
|
||||
// CENT SIGN
|
||||
"<EFBFBD>" => "c",
|
||||
// <U00A2> <U0063>
|
||||
|
||||
// POUND SIGN
|
||||
"<EFBFBD>" => "GBP",
|
||||
// <U00A3> "<U0047><U0042><U0050>"
|
||||
|
||||
// YEN SIGN
|
||||
"<EFBFBD>" => "Y",
|
||||
// <U00A5> <U0059>
|
||||
|
||||
// BROKEN BAR
|
||||
"<EFBFBD>" => "|",
|
||||
// <U00A6> <U007C>
|
||||
|
||||
// SECTION SIGN
|
||||
"<EFBFBD>" => "S",
|
||||
// <U00A7> <U0053>
|
||||
|
||||
// DIAERESIS
|
||||
"<EFBFBD>" => "\"",
|
||||
// <U00A8> <U0022>
|
||||
|
||||
// COPYRIGHT SIGN
|
||||
"<EFBFBD>" => "(c)", // "c"
|
||||
// <U00A9> "<U0028><U0063><U0029>";<U0063>
|
||||
|
||||
// FEMININE ORDINAL INDICATOR
|
||||
"<EFBFBD>" => "a",
|
||||
// <U00AA> <U0061>
|
||||
|
||||
// LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
"<EFBFBD>" => "<<",
|
||||
// <U00AB> "<U003C><U003C>"
|
||||
|
||||
// NOT SIGN
|
||||
"<EFBFBD>" => "-",
|
||||
// <U00AC> <U002D>
|
||||
|
||||
// SOFT HYPHEN
|
||||
"<EFBFBD>" => "-",
|
||||
// <U00AD> <U002D>
|
||||
|
||||
// REGISTERED SIGN
|
||||
"<EFBFBD>" => "(R)",
|
||||
// <U00AE> "<U0028><U0052><U0029>"
|
||||
|
||||
// MACRON
|
||||
"<EFBFBD>" => "-",
|
||||
// <U00AF> <U002D>
|
||||
|
||||
// DEGREE SIGN
|
||||
"<EFBFBD>" => " ",
|
||||
// <U00B0> <U0020>
|
||||
|
||||
// PLUS-MINUS SIGN
|
||||
"<EFBFBD>" => "+/-",
|
||||
// <U00B1> "<U002B><U002F><U002D>"
|
||||
|
||||
// SUPERSCRIPT TWO
|
||||
"<EFBFBD>" => "^2", // "2"
|
||||
// <U00B2> "<U005E><U0032>";<U0032>
|
||||
|
||||
// SUPERSCRIPT THREE
|
||||
"<EFBFBD>" => "^3", // "3"
|
||||
// <U00B3> "<U005E><U0033>";<U0033>
|
||||
|
||||
// ACUTE ACCENT
|
||||
"<EFBFBD>" => "'",
|
||||
// <U00B4> <U0027>
|
||||
|
||||
// MICRO SIGN
|
||||
"<EFBFBD>" => "u",
|
||||
// <U00B5> <U03BC>;<U0075>
|
||||
|
||||
// PILCROW SIGN
|
||||
"<EFBFBD>" => "P",
|
||||
// <U00B6> <U0050>
|
||||
|
||||
// MIDDLE DOT
|
||||
"<EFBFBD>" => ".",
|
||||
// <U00B7> <U002E>
|
||||
|
||||
// CEDILLA
|
||||
"<EFBFBD>" => ",",
|
||||
// <U00B8> <U002C>
|
||||
|
||||
// SUPERSCRIPT ONE
|
||||
"<EFBFBD>" => "^1", // "1"
|
||||
// <U00B9> "<U005E><U0031>";<U0031>
|
||||
|
||||
// MASCULINE ORDINAL INDICATOR
|
||||
"<EFBFBD>" => "o",
|
||||
// <U00BA> <U006F>
|
||||
|
||||
// RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
"<EFBFBD>" => ">>",
|
||||
// <U00BB> "<U003E><U003E>"
|
||||
|
||||
// VULGAR FRACTION ONE QUARTER
|
||||
"<EFBFBD>" => " 1/4",
|
||||
// <U00BC> "<U0020><U0031><U002F><U0034>"
|
||||
|
||||
// VULGAR FRACTION ONE HALF
|
||||
"<EFBFBD>" => " 1/2",
|
||||
// <U00BD> "<U0020><U0031><U002F><U0032>"
|
||||
|
||||
// VULGAR FRACTION THREE QUARTERS
|
||||
"<EFBFBD>" => " 3/4",
|
||||
// <U00BE> "<U0020><U0033><U002F><U0034>"
|
||||
|
||||
// INVERTED QUESTION MARK
|
||||
"<EFBFBD>" => "?",
|
||||
// <U00BF> <U003F>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH GRAVE
|
||||
"<EFBFBD>" => "A",
|
||||
// <U00C0> <U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH ACUTE
|
||||
"<EFBFBD>" => "A",
|
||||
// <U00C1> <U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "A",
|
||||
// <U00C2> <U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH TILDE
|
||||
"<EFBFBD>" => "A",
|
||||
// <U00C3> <U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH DIAERESIS
|
||||
"<EFBFBD>" => "Ae", // "A"
|
||||
// <U00C4> "<U0041><U0065>";<U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH RING ABOVE
|
||||
"<EFBFBD>" => "Aa", // "A"
|
||||
// <U00C5> "<U0041><U0061>";<U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER AE
|
||||
"<EFBFBD>" => "AE", // "A"
|
||||
// <U00C6> "<U0041><U0045>";<U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER C WITH CEDILLA
|
||||
"<EFBFBD>" => "C",
|
||||
// <U00C7> <U0043>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH GRAVE
|
||||
"<EFBFBD>" => "E",
|
||||
// <U00C8> <U0045>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH ACUTE
|
||||
"<EFBFBD>" => "E",
|
||||
// <U00C9> <U0045>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "E",
|
||||
// <U00CA> <U0045>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH DIAERESIS
|
||||
"<EFBFBD>" => "E",
|
||||
// <U00CB> <U0045>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH GRAVE
|
||||
"<EFBFBD>" => "I",
|
||||
// <U00CC> <U0049>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH ACUTE
|
||||
"<EFBFBD>" => "I",
|
||||
// <U00CD> <U0049>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "I",
|
||||
// <U00CE> <U0049>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH DIAERESIS
|
||||
"<EFBFBD>" => "I",
|
||||
// <U00CF> <U0049>
|
||||
|
||||
// LATIN CAPITAL LETTER ETH
|
||||
"<EFBFBD>" => "D",
|
||||
// <U00D0> <U0044>
|
||||
|
||||
// LATIN CAPITAL LETTER N WITH TILDE
|
||||
"<EFBFBD>" => "N",
|
||||
// <U00D1> <U004E>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH GRAVE
|
||||
"<EFBFBD>" => "O",
|
||||
// <U00D2> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH ACUTE
|
||||
"<EFBFBD>" => "O",
|
||||
// <U00D3> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "O",
|
||||
// <U00D4> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH TILDE
|
||||
"<EFBFBD>" => "O",
|
||||
// <U00D5> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH DIAERESIS
|
||||
"<EFBFBD>" => "Oe", // "O"
|
||||
// <U00D6> "<U004F><U0065>";<U004F>
|
||||
|
||||
// MULTIPLICATION SIGN
|
||||
"<EFBFBD>" => "x",
|
||||
// <U00D7> <U0078>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH STROKE
|
||||
"<EFBFBD>" => "O",
|
||||
// <U00D8> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH GRAVE
|
||||
"<EFBFBD>" => "U",
|
||||
// <U00D9> <U0055>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH ACUTE
|
||||
"<EFBFBD>" => "U",
|
||||
// <U00DA> <U0055>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "U",
|
||||
// <U00DB> <U0055>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH DIAERESIS
|
||||
"<EFBFBD>" => "Ue", // "U"
|
||||
// <U00DC> "<U0055><U0065>";<U0055>
|
||||
|
||||
// LATIN CAPITAL LETTER Y WITH ACUTE
|
||||
"<EFBFBD>" => "Y",
|
||||
// <U00DD> <U0059>
|
||||
|
||||
// LATIN CAPITAL LETTER THORN
|
||||
"<EFBFBD>" => "Th",
|
||||
// <U00DE> "<U0054><U0068>"
|
||||
|
||||
// LATIN SMALL LETTER SHARP S
|
||||
"<EFBFBD>" => "ss",
|
||||
// <U00DF> "<U0073><U0073>";<U03B2>
|
||||
|
||||
// LATIN SMALL LETTER A WITH GRAVE
|
||||
"<EFBFBD>" => "a",
|
||||
// <U00E0> <U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH ACUTE
|
||||
"<EFBFBD>" => "a",
|
||||
// <U00E1> <U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "a",
|
||||
// <U00E2> <U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH TILDE
|
||||
"<EFBFBD>" => "a",
|
||||
// <U00E3> <U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH DIAERESIS
|
||||
"<EFBFBD>" => "ae", // "a"
|
||||
// <U00E4> "<U0061><U0065>";<U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH RING ABOVE
|
||||
"<EFBFBD>" => "aa", // "a"
|
||||
// <U00E5> "<U0061><U0061>";<U0061>
|
||||
|
||||
// LATIN SMALL LETTER AE
|
||||
"<EFBFBD>" => "ae", // "a"
|
||||
// <U00E6> "<U0061><U0065>";<U0061>
|
||||
|
||||
// LATIN SMALL LETTER C WITH CEDILLA
|
||||
"<EFBFBD>" => "c",
|
||||
// <U00E7> <U0063>
|
||||
|
||||
// LATIN SMALL LETTER E WITH GRAVE
|
||||
"<EFBFBD>" => "e",
|
||||
// <U00E8> <U0065>
|
||||
|
||||
// LATIN SMALL LETTER E WITH ACUTE
|
||||
"<EFBFBD>" => "e",
|
||||
// <U00E9> <U0065>
|
||||
|
||||
// LATIN SMALL LETTER E WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "e",
|
||||
// <U00EA> <U0065>
|
||||
|
||||
// LATIN SMALL LETTER E WITH DIAERESIS
|
||||
"<EFBFBD>" => "e",
|
||||
// <U00EB> <U0065>
|
||||
|
||||
// LATIN SMALL LETTER I WITH GRAVE
|
||||
"<EFBFBD>" => "i",
|
||||
// <U00EC> <U0069>
|
||||
|
||||
// LATIN SMALL LETTER I WITH ACUTE
|
||||
"<EFBFBD>" => "i",
|
||||
// <U00ED> <U0069>
|
||||
|
||||
// LATIN SMALL LETTER I WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "i",
|
||||
// <U00EE> <U0069>
|
||||
|
||||
// LATIN SMALL LETTER I WITH DIAERESIS
|
||||
"<EFBFBD>" => "i",
|
||||
// <U00EF> <U0069>
|
||||
|
||||
// LATIN SMALL LETTER ETH
|
||||
"<EFBFBD>" => "d",
|
||||
// <U00F0> <U0064>
|
||||
|
||||
// LATIN SMALL LETTER N WITH TILDE
|
||||
"<EFBFBD>" => "n",
|
||||
// <U00F1> <U006E>
|
||||
|
||||
// LATIN SMALL LETTER O WITH GRAVE
|
||||
"<EFBFBD>" => "o",
|
||||
// <U00F2> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER O WITH ACUTE
|
||||
"<EFBFBD>" => "o",
|
||||
// <U00F3> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER O WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "o",
|
||||
// <U00F4> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER O WITH TILDE
|
||||
"<EFBFBD>" => "o",
|
||||
// <U00F5> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER O WITH DIAERESIS
|
||||
"<EFBFBD>" => "oe", // "o"
|
||||
// <U00F6> "<U006F><U0065>";<U006F>
|
||||
|
||||
// DIVISION SIGN
|
||||
"<EFBFBD>" => ":",
|
||||
// <U00F7> <U003A>
|
||||
|
||||
// LATIN SMALL LETTER O WITH STROKE
|
||||
"<EFBFBD>" => "o",
|
||||
// <U00F8> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER U WITH GRAVE
|
||||
"<EFBFBD>" => "u",
|
||||
// <U00F9> <U0075>
|
||||
|
||||
// LATIN SMALL LETTER U WITH ACUTE
|
||||
"<EFBFBD>" => "u",
|
||||
// <U00FA> <U0075>
|
||||
|
||||
// LATIN SMALL LETTER U WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "u",
|
||||
// <U00FB> <U0075>
|
||||
|
||||
// LATIN SMALL LETTER U WITH DIAERESIS
|
||||
"<EFBFBD>" => "ue", // "u"
|
||||
// <U00FC> "<U0075><U0065>";<U0075>
|
||||
|
||||
// LATIN SMALL LETTER Y WITH ACUTE
|
||||
"<EFBFBD>" => "y",
|
||||
// <U00FD> <U0079>
|
||||
|
||||
// LATIN SMALL LETTER THORN
|
||||
"<EFBFBD>" => "th",
|
||||
// <U00FE> "<U0074><U0068>"
|
||||
|
||||
// LATIN SMALL LETTER Y WITH DIAERESIS
|
||||
"<EFBFBD>" => "y"
|
||||
// <U00FF> <U0079>
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
428
includes/transtab_latin1_bibtex.inc.php
Normal file
428
includes/transtab_latin1_bibtex.inc.php
Normal file
@@ -0,0 +1,428 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_latin1_bibtex.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_latin1_bibtex.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 13-Aug-06, 13:30
|
||||
// Modified: $Date: 2007-02-17 01:10:14 +0000 (Sat, 17 Feb 2007) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 894 $
|
||||
|
||||
// This is a translation table for conversion from ISO-8859-1 to LaTeX/BibTeX entities. It contains a list of substitution strings for 'ISO-8859-1 West European' characters,
|
||||
// which can be used with the 'T1' font encoding. Uses commands from the 'textcomp' package.
|
||||
// Adopted from 'transtab' by Markus Kuhn
|
||||
// (transtab.utf v1.8 2000-10-12 11:01:28+01 mgk25 Exp); see <http://www.cl.cam.ac.uk/~mgk25/unicode.html> for more info about Unicode and transtab.
|
||||
|
||||
$transtab_latin1_bibtex = array(
|
||||
|
||||
// NUMBER SIGN
|
||||
"(?<!\\\\)#" => '$\\#$',
|
||||
// <U0023> <U0023>
|
||||
|
||||
// PERCENT SIGN
|
||||
"(?<!\\\\)%" => "\\%",
|
||||
// <U0025> <U0025>
|
||||
|
||||
// AMPERSAND
|
||||
// "(?<!\\\\)&" => "\\&", // encoding of ampersands is already handled by bibutils (which handles it better since it excludes ampersands in URLs from encoding)
|
||||
// <U0026> <U0026>
|
||||
|
||||
// APOSTROPHE
|
||||
"(?<!\\\\)'" => "{\\textquoteright}",
|
||||
// <U0027> <U2019>
|
||||
|
||||
// GRAVE ACCENT
|
||||
"(?<!\\\\)`" => "{\\textquoteleft}",
|
||||
// <U0060> <U201B>;<U2018>
|
||||
|
||||
// NO-BREAK SPACE
|
||||
"<EFBFBD>" => "~",
|
||||
// <U00A0> <U0020>
|
||||
|
||||
// INVERTED EXCLAMATION MARK
|
||||
"<EFBFBD>" => "{\\textexclamdown}",
|
||||
// <U00A1> <U0021>
|
||||
|
||||
// CENT SIGN
|
||||
"<EFBFBD>" => "{\\textcent}",
|
||||
// <U00A2> <U0063>
|
||||
|
||||
// POUND SIGN
|
||||
"<EFBFBD>" => "{\\textsterling}",
|
||||
// <U00A3> "<U0047><U0042><U0050>"
|
||||
|
||||
// YEN SIGN
|
||||
"<EFBFBD>" => "{\\textyen}",
|
||||
// <U00A5> <U0059>
|
||||
|
||||
// BROKEN BAR
|
||||
"<EFBFBD>" => "{\\textbrokenbar}",
|
||||
// <U00A6> <U007C>
|
||||
|
||||
// SECTION SIGN
|
||||
"<EFBFBD>" => "{\\textsection}",
|
||||
// <U00A7> <U0053>
|
||||
|
||||
// DIAERESIS
|
||||
"<EFBFBD>" => "{\\textasciidieresis}",
|
||||
// <U00A8> <U0022>
|
||||
|
||||
// COPYRIGHT SIGN
|
||||
"<EFBFBD>" => "{\\textcopyright}",
|
||||
// <U00A9> "<U0028><U0063><U0029>";<U0063>
|
||||
|
||||
// FEMININE ORDINAL INDICATOR
|
||||
"<EFBFBD>" => "{\\textordfeminine}",
|
||||
// <U00AA> <U0061>
|
||||
|
||||
// LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
"<EFBFBD>" => "{\\guillemotleft}",
|
||||
// <U00AB> "<U003C><U003C>"
|
||||
|
||||
// NOT SIGN
|
||||
"<EFBFBD>" => "{\\textlnot}",
|
||||
// <U00AC> <U002D>
|
||||
|
||||
// SOFT HYPHEN
|
||||
"<EFBFBD>" => "-", // correct?
|
||||
// <U00AD> <U002D>
|
||||
|
||||
// REGISTERED SIGN
|
||||
"<EFBFBD>" => "{\\textregistered}",
|
||||
// <U00AE> "<U0028><U0052><U0029>"
|
||||
|
||||
// MACRON
|
||||
"<EFBFBD>" => "{\\textasciimacron}",
|
||||
// <U00AF> <U002D>
|
||||
|
||||
// DEGREE SIGN
|
||||
"<EFBFBD>" => "{\\textdegree}",
|
||||
// <U00B0> <U0020>
|
||||
|
||||
// PLUS-MINUS SIGN
|
||||
"<EFBFBD>" => "{\\textpm}",
|
||||
// <U00B1> "<U002B><U002F><U002D>"
|
||||
|
||||
// SUPERSCRIPT TWO
|
||||
"<EFBFBD>" => "{\\texttwosuperior}",
|
||||
// <U00B2> "<U005E><U0032>";<U0032>
|
||||
|
||||
// SUPERSCRIPT THREE
|
||||
"<EFBFBD>" => "{\\textthreesuperior}",
|
||||
// <U00B3> "<U005E><U0033>";<U0033>
|
||||
|
||||
// ACUTE ACCENT
|
||||
"<EFBFBD>" => "{\\textasciiacute}",
|
||||
// <U00B4> <U0027>
|
||||
|
||||
// MICRO SIGN
|
||||
"<EFBFBD>" => "{\\textmu}",
|
||||
// <U00B5> <U03BC>;<U0075>
|
||||
|
||||
// PILCROW SIGN
|
||||
"<EFBFBD>" => "{\\textparagraph}",
|
||||
// <U00B6> <U0050>
|
||||
|
||||
// MIDDLE DOT
|
||||
"<EFBFBD>" => "{\\textperiodcentered}",
|
||||
// <U00B7> <U002E>
|
||||
|
||||
// CEDILLA
|
||||
"<EFBFBD>" => "{\\c\\ }",
|
||||
// <U00B8> <U002C>
|
||||
|
||||
// SUPERSCRIPT ONE
|
||||
"<EFBFBD>" => "{\\textonesuperior}",
|
||||
// <U00B9> "<U005E><U0031>";<U0031>
|
||||
|
||||
// MASCULINE ORDINAL INDICATOR
|
||||
"<EFBFBD>" => "{\\textordmasculine}",
|
||||
// <U00BA> <U006F>
|
||||
|
||||
// RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
"<EFBFBD>" => "{\\guillemotright}",
|
||||
// <U00BB> "<U003E><U003E>"
|
||||
|
||||
// VULGAR FRACTION ONE QUARTER
|
||||
"<EFBFBD>" => "{\\textonequarter}",
|
||||
// <U00BC> "<U0020><U0031><U002F><U0034>"
|
||||
|
||||
// VULGAR FRACTION ONE HALF
|
||||
"<EFBFBD>" => "{\\textonehalf}",
|
||||
// <U00BD> "<U0020><U0031><U002F><U0032>"
|
||||
|
||||
// VULGAR FRACTION THREE QUARTERS
|
||||
"<EFBFBD>" => "{\\textthreequarters}",
|
||||
// <U00BE> "<U0020><U0033><U002F><U0034>"
|
||||
|
||||
// INVERTED QUESTION MARK
|
||||
"<EFBFBD>" => "{\\textquestiondown}",
|
||||
// <U00BF> <U003F>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`A}", // \symbol{"C0}
|
||||
// <U00C0> <U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'A}", // \symbol{"C1}
|
||||
// <U00C1> <U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^A}", // \symbol{"C2}
|
||||
// <U00C2> <U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH TILDE
|
||||
"<EFBFBD>" => "{\\~A}", // \symbol{"C3}
|
||||
// <U00C3> <U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"A}", // \symbol{"C4}
|
||||
// <U00C4> "<U0041><U0065>";<U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH RING ABOVE
|
||||
"<EFBFBD>" => "{\\r A}", // "\\AA" // \symbol{"C5}
|
||||
// <U00C5> "<U0041><U0061>";<U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER AE
|
||||
"<EFBFBD>" => "{\\AE}", // \symbol{"C6}
|
||||
// <U00C6> "<U0041><U0045>";<U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER C WITH CEDILLA
|
||||
"<EFBFBD>" => "{\\c C}", // \symbol{"C7}
|
||||
// <U00C7> <U0043>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`E}", // \symbol{"C8}
|
||||
// <U00C8> <U0045>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'E}", // \symbol{"C9}
|
||||
// <U00C9> <U0045>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^E}", // \symbol{"CA}
|
||||
// <U00CA> <U0045>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"E}", // \symbol{"CB}
|
||||
// <U00CB> <U0045>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`I}", // \symbol{"CC}
|
||||
// <U00CC> <U0049>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'I}", // \symbol{"CD}
|
||||
// <U00CD> <U0049>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^I}", // \symbol{"CE}
|
||||
// <U00CE> <U0049>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"I}", // \symbol{"CF}
|
||||
// <U00CF> <U0049>
|
||||
|
||||
// LATIN CAPITAL LETTER ETH
|
||||
"<EFBFBD>" => "{\\DH}", // \symbol{"D0}
|
||||
// <U00D0> <U0044>
|
||||
|
||||
// LATIN CAPITAL LETTER N WITH TILDE
|
||||
"<EFBFBD>" => "{\\~N}", // \symbol{"D1}
|
||||
// <U00D1> <U004E>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`O}", // \symbol{"D2}
|
||||
// <U00D2> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'O}", // \symbol{"D3}
|
||||
// <U00D3> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^O}", // \symbol{"D4}
|
||||
// <U00D4> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH TILDE
|
||||
"<EFBFBD>" => "{\\~O}", // \symbol{"D5}
|
||||
// <U00D5> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"O}", // \symbol{"D6}
|
||||
// <U00D6> "<U004F><U0065>";<U004F>
|
||||
|
||||
// MULTIPLICATION SIGN
|
||||
"<EFBFBD>" => "{\\texttimes}", // \symbol{"D7}
|
||||
// <U00D7> <U0078>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH STROKE
|
||||
"<EFBFBD>" => "{\\O}", // \symbol{"D8}
|
||||
// <U00D8> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`U}", // \symbol{"D9}
|
||||
// <U00D9> <U0055>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'U}", // \symbol{"DA}
|
||||
// <U00DA> <U0055>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^U}", // \symbol{"DB}
|
||||
// <U00DB> <U0055>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"U}", // \symbol{"DC}
|
||||
// <U00DC> "<U0055><U0065>";<U0055>
|
||||
|
||||
// LATIN CAPITAL LETTER Y WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'Y}", // \symbol{"DD}
|
||||
// <U00DD> <U0059>
|
||||
|
||||
// LATIN CAPITAL LETTER THORN
|
||||
"<EFBFBD>" => "{\\TH}", // \symbol{"DE}
|
||||
// <U00DE> "<U0054><U0068>"
|
||||
|
||||
// LATIN SMALL LETTER SHARP S
|
||||
"<EFBFBD>" => "{\\ss}", // \symbol{"DF}
|
||||
// <U00DF> "<U0073><U0073>";<U03B2>
|
||||
|
||||
// LATIN SMALL LETTER A WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`a}", // \symbol{"E0}
|
||||
// <U00E0> <U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'a}", // \symbol{"E1}
|
||||
// <U00E1> <U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^a}", // \symbol{"E2}
|
||||
// <U00E2> <U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH TILDE
|
||||
"<EFBFBD>" => "{\\~a}", // \symbol{"E3}
|
||||
// <U00E3> <U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"a}", // \symbol{"E4}
|
||||
// <U00E4> "<U0061><U0065>";<U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH RING ABOVE
|
||||
"<EFBFBD>" => "{\\r a}", // "\\aa" // \symbol{"E5}
|
||||
// <U00E5> "<U0061><U0061>";<U0061>
|
||||
|
||||
// LATIN SMALL LETTER AE
|
||||
"<EFBFBD>" => "{\\ae}", // \symbol{"E6}
|
||||
// <U00E6> "<U0061><U0065>";<U0061>
|
||||
|
||||
// LATIN SMALL LETTER C WITH CEDILLA
|
||||
"<EFBFBD>" => "{\\c c}", // \symbol{"E7}
|
||||
// <U00E7> <U0063>
|
||||
|
||||
// LATIN SMALL LETTER E WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`e}", // \symbol{"E8}
|
||||
// <U00E8> <U0065>
|
||||
|
||||
// LATIN SMALL LETTER E WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'e}", // \symbol{"E9}
|
||||
// <U00E9> <U0065>
|
||||
|
||||
// LATIN SMALL LETTER E WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^e}", // \symbol{"EA}
|
||||
// <U00EA> <U0065>
|
||||
|
||||
// LATIN SMALL LETTER E WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"e}", // \symbol{"EB}
|
||||
// <U00EB> <U0065>
|
||||
|
||||
// LATIN SMALL LETTER I WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`\\i}", // \symbol{"EC}
|
||||
// <U00EC> <U0069>
|
||||
|
||||
// LATIN SMALL LETTER I WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'\\i}", // \symbol{"ED}
|
||||
// <U00ED> <U0069>
|
||||
|
||||
// LATIN SMALL LETTER I WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^\\i}", // \symbol{"EE}
|
||||
// <U00EE> <U0069>
|
||||
|
||||
// LATIN SMALL LETTER I WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"\\i}", // \symbol{"EF}
|
||||
// <U00EF> <U0069>
|
||||
|
||||
// LATIN SMALL LETTER ETH
|
||||
"<EFBFBD>" => "{\\dh}", // \symbol{"F0}
|
||||
// <U00F0> <U0064>
|
||||
|
||||
// LATIN SMALL LETTER N WITH TILDE
|
||||
"<EFBFBD>" => "{\\~n}", // \symbol{"F1}
|
||||
// <U00F1> <U006E>
|
||||
|
||||
// LATIN SMALL LETTER O WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`o}", // \symbol{"F2}
|
||||
// <U00F2> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER O WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'o}", // \symbol{"F3}
|
||||
// <U00F3> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER O WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^o}", // \symbol{"F4}
|
||||
// <U00F4> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER O WITH TILDE
|
||||
"<EFBFBD>" => "{\\~o}", // \symbol{"F5}
|
||||
// <U00F5> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER O WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"o}", // \symbol{"F6}
|
||||
// <U00F6> "<U006F><U0065>";<U006F>
|
||||
|
||||
// DIVISION SIGN
|
||||
"<EFBFBD>" => "{\\textdiv}", // \symbol{"F7}
|
||||
// <U00F7> <U003A>
|
||||
|
||||
// LATIN SMALL LETTER O WITH STROKE
|
||||
"<EFBFBD>" => "{\\o}", // \symbol{"F8}
|
||||
// <U00F8> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER U WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`u}", // \symbol{"F9}
|
||||
// <U00F9> <U0075>
|
||||
|
||||
// LATIN SMALL LETTER U WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'u}", // \symbol{"FA}
|
||||
// <U00FA> <U0075>
|
||||
|
||||
// LATIN SMALL LETTER U WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^u}", // \symbol{"FB}
|
||||
// <U00FB> <U0075>
|
||||
|
||||
// LATIN SMALL LETTER U WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"u}", // \symbol{"FC}
|
||||
// <U00FC> "<U0075><U0065>";<U0075>
|
||||
|
||||
// LATIN SMALL LETTER Y WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'y}", // \symbol{"FD}
|
||||
// <U00FD> <U0079>
|
||||
|
||||
// LATIN SMALL LETTER THORN
|
||||
"<EFBFBD>" => "{\\th}", // \symbol{"FE}
|
||||
// <U00FE> "<U0074><U0068>"
|
||||
|
||||
// LATIN SMALL LETTER Y WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"y}" // \symbol{"FF}
|
||||
// <U00FF> <U0079>
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
95
includes/transtab_latin1_charset.inc.php
Normal file
95
includes/transtab_latin1_charset.inc.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_latin1_charset.inc.php
|
||||
// Repository: $HeadURL$
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 24-Jul-08, 17:45
|
||||
// Modified: $Date: 2008-08-19 20:05:53 +0000 (Tue, 19 Aug 2008) $
|
||||
// $Author$
|
||||
// $Revision: 1206 $
|
||||
|
||||
// Search & replace patterns and variables for matching (and conversion of) ISO-8859-1 character case & classes.
|
||||
// Search & replace patterns must be specified as perl-style regular expression and search patterns must include the
|
||||
// leading & trailing slashes.
|
||||
|
||||
// NOTE: Quote from <http://www.onphp5.com/article/22> ("i18n with PHP5: Pitfalls"):
|
||||
// "PCRE and other regular expression extensions are not locale-aware. This most notably influences the \w class
|
||||
// that is unable to work for Cyrillic letters. There could be a workaround for this if some preprocessor for the
|
||||
// regex string could replace \w and friends with character range prior to calling PCRE functions."
|
||||
|
||||
// The 'start_session()' function in file 'include.inc.php' should establish an appropriate locale via function
|
||||
// 'setSystemLocale()' so that e.g. '[[:upper:]]' would also match '<27>' etc. However, since locale support depends
|
||||
// on the individual server & system, we keep the workaround which literally specifies higher ASCII chars of the
|
||||
// latin1 character set below. (in order to have this work, the character encoding of 'search.php' must be set to
|
||||
// 'Western (Iso Latin 1)' aka 'ISO-8859-1'!)
|
||||
// higher ASCII chars upper case = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
// higher ASCII chars lower case = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
|
||||
// The variables '$alnum', '$alpha', '$cntrl', '$dash', '$digit', '$graph', '$lower', '$print', '$punct', '$space',
|
||||
// '$upper', '$word' must be used within a perl-style regex character class.
|
||||
|
||||
// Matches ISO-8859-1 letters & digits:
|
||||
$alnum = "[:alnum:]<5D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
|
||||
// Matches ISO-8859-1 letters:
|
||||
$alpha = "[:alpha:]<5D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
|
||||
// Matches ISO-8859-1 control characters:
|
||||
$cntrl = "[:cntrl:]";
|
||||
|
||||
// Matches ISO-8859-1 dashes & hyphens:
|
||||
$dash = "-<2D>";
|
||||
|
||||
// Matches ISO-8859-1 digits:
|
||||
$digit = "[:digit:]";
|
||||
|
||||
// Matches ISO-8859-1 printing characters (excluding space):
|
||||
$graph = "[:graph:]<5D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
|
||||
// Matches ISO-8859-1 lower case letters:
|
||||
$lower = "[:lower:]<5D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
|
||||
// Matches ISO-8859-1 printing characters (including space):
|
||||
$print = "[:print:]<5D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
|
||||
// Matches ISO-8859-1 punctuation:
|
||||
$punct = "[:punct:]";
|
||||
|
||||
// Matches ISO-8859-1 whitespace (separating characters with no visual representation):
|
||||
$space = "[:space:]";
|
||||
|
||||
// Matches ISO-8859-1 upper case letters:
|
||||
$upper = "[:upper:]<5D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
|
||||
// Matches ISO-8859-1 "word" characters:
|
||||
$word = "_[:alnum:]<5D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
|
||||
// Defines the PCRE pattern modifier(s) to be used in conjunction with the above variables:
|
||||
// More info: <http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php>
|
||||
$patternModifiers = "";
|
||||
|
||||
|
||||
// Converts ISO-8859-1 upper case letters to their corresponding lower case letter:
|
||||
// TODO!
|
||||
$transtab_upper_lower = array(
|
||||
|
||||
|
||||
);
|
||||
|
||||
|
||||
// Converts ISO-8859-1 lower case letters to their corresponding upper case letter:
|
||||
// TODO!
|
||||
$transtab_lower_upper = array(
|
||||
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
428
includes/transtab_latin1_latex.inc.php
Normal file
428
includes/transtab_latin1_latex.inc.php
Normal file
@@ -0,0 +1,428 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_latin1_latex.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_latin1_latex.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 28-May-06, 12:39
|
||||
// Modified: $Date: 2008-11-02 18:37:05 +0000 (Sun, 02 Nov 2008) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1290 $
|
||||
|
||||
// This is a translation table for conversion from ISO-8859-1 to LaTeX entities. It contains a list of substitution strings for 'ISO-8859-1 West European' characters,
|
||||
// which can be used with the 'T1' font encoding. Uses commands from the 'textcomp' package.
|
||||
// Adopted from 'transtab' by Markus Kuhn
|
||||
// (transtab.utf v1.8 2000-10-12 11:01:28+01 mgk25 Exp); see <http://www.cl.cam.ac.uk/~mgk25/unicode.html> for more info about Unicode and transtab.
|
||||
|
||||
$transtab_latin1_latex = array(
|
||||
|
||||
// NUMBER SIGN
|
||||
"#" => '$\\#$',
|
||||
// <U0023> <U0023>
|
||||
|
||||
// PERCENT SIGN
|
||||
"%" => "\\%",
|
||||
// <U0025> <U0025>
|
||||
|
||||
// AMPERSAND
|
||||
"&" => "\\&",
|
||||
// <U0026> <U0026>
|
||||
|
||||
// APOSTROPHE
|
||||
"'" => "{\\textquoteright}",
|
||||
// <U0027> <U2019>
|
||||
|
||||
// GRAVE ACCENT
|
||||
"`" => "{\\textquoteleft}",
|
||||
// <U0060> <U201B>;<U2018>
|
||||
|
||||
// NO-BREAK SPACE
|
||||
"<EFBFBD>" => "~",
|
||||
// <U00A0> <U0020>
|
||||
|
||||
// INVERTED EXCLAMATION MARK
|
||||
"<EFBFBD>" => "{\\textexclamdown}",
|
||||
// <U00A1> <U0021>
|
||||
|
||||
// CENT SIGN
|
||||
"<EFBFBD>" => "{\\textcent}",
|
||||
// <U00A2> <U0063>
|
||||
|
||||
// POUND SIGN
|
||||
"<EFBFBD>" => "{\\textsterling}",
|
||||
// <U00A3> "<U0047><U0042><U0050>"
|
||||
|
||||
// YEN SIGN
|
||||
"<EFBFBD>" => "{\\textyen}",
|
||||
// <U00A5> <U0059>
|
||||
|
||||
// BROKEN BAR
|
||||
"<EFBFBD>" => "{\\textbrokenbar}",
|
||||
// <U00A6> <U007C>
|
||||
|
||||
// SECTION SIGN
|
||||
"<EFBFBD>" => "{\\textsection}",
|
||||
// <U00A7> <U0053>
|
||||
|
||||
// DIAERESIS
|
||||
"<EFBFBD>" => "{\\textasciidieresis}",
|
||||
// <U00A8> <U0022>
|
||||
|
||||
// COPYRIGHT SIGN
|
||||
"<EFBFBD>" => "{\\textcopyright}",
|
||||
// <U00A9> "<U0028><U0063><U0029>";<U0063>
|
||||
|
||||
// FEMININE ORDINAL INDICATOR
|
||||
"<EFBFBD>" => "{\\textordfeminine}",
|
||||
// <U00AA> <U0061>
|
||||
|
||||
// LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
"<EFBFBD>" => "{\\guillemotleft}",
|
||||
// <U00AB> "<U003C><U003C>"
|
||||
|
||||
// NOT SIGN
|
||||
"<EFBFBD>" => "{\\textlnot}",
|
||||
// <U00AC> <U002D>
|
||||
|
||||
// SOFT HYPHEN
|
||||
"<EFBFBD>" => "-", // correct?
|
||||
// <U00AD> <U002D>
|
||||
|
||||
// REGISTERED SIGN
|
||||
"<EFBFBD>" => "{\\textregistered}",
|
||||
// <U00AE> "<U0028><U0052><U0029>"
|
||||
|
||||
// MACRON
|
||||
"<EFBFBD>" => "{\\textasciimacron}",
|
||||
// <U00AF> <U002D>
|
||||
|
||||
// DEGREE SIGN
|
||||
"<EFBFBD>" => "{\\textdegree}",
|
||||
// <U00B0> <U0020>
|
||||
|
||||
// PLUS-MINUS SIGN
|
||||
"<EFBFBD>" => "{\\textpm}",
|
||||
// <U00B1> "<U002B><U002F><U002D>"
|
||||
|
||||
// SUPERSCRIPT TWO
|
||||
"<EFBFBD>" => "{\\texttwosuperior}",
|
||||
// <U00B2> "<U005E><U0032>";<U0032>
|
||||
|
||||
// SUPERSCRIPT THREE
|
||||
"<EFBFBD>" => "{\\textthreesuperior}",
|
||||
// <U00B3> "<U005E><U0033>";<U0033>
|
||||
|
||||
// ACUTE ACCENT
|
||||
"<EFBFBD>" => "{\\textasciiacute}",
|
||||
// <U00B4> <U0027>
|
||||
|
||||
// MICRO SIGN
|
||||
"<EFBFBD>" => "{\\textmu}",
|
||||
// <U00B5> <U03BC>;<U0075>
|
||||
|
||||
// PILCROW SIGN
|
||||
"<EFBFBD>" => "{\\textparagraph}",
|
||||
// <U00B6> <U0050>
|
||||
|
||||
// MIDDLE DOT
|
||||
"<EFBFBD>" => "{\\textperiodcentered}",
|
||||
// <U00B7> <U002E>
|
||||
|
||||
// CEDILLA
|
||||
"<EFBFBD>" => "{\\c\\ }",
|
||||
// <U00B8> <U002C>
|
||||
|
||||
// SUPERSCRIPT ONE
|
||||
"<EFBFBD>" => "{\\textonesuperior}",
|
||||
// <U00B9> "<U005E><U0031>";<U0031>
|
||||
|
||||
// MASCULINE ORDINAL INDICATOR
|
||||
"<EFBFBD>" => "{\\textordmasculine}",
|
||||
// <U00BA> <U006F>
|
||||
|
||||
// RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
"<EFBFBD>" => "{\\guillemotright}",
|
||||
// <U00BB> "<U003E><U003E>"
|
||||
|
||||
// VULGAR FRACTION ONE QUARTER
|
||||
"<EFBFBD>" => "{\\textonequarter}",
|
||||
// <U00BC> "<U0020><U0031><U002F><U0034>"
|
||||
|
||||
// VULGAR FRACTION ONE HALF
|
||||
"<EFBFBD>" => "{\\textonehalf}",
|
||||
// <U00BD> "<U0020><U0031><U002F><U0032>"
|
||||
|
||||
// VULGAR FRACTION THREE QUARTERS
|
||||
"<EFBFBD>" => "{\\textthreequarters}",
|
||||
// <U00BE> "<U0020><U0033><U002F><U0034>"
|
||||
|
||||
// INVERTED QUESTION MARK
|
||||
"<EFBFBD>" => "{\\textquestiondown}",
|
||||
// <U00BF> <U003F>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`A}", // \symbol{"C0}
|
||||
// <U00C0> <U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'A}", // \symbol{"C1}
|
||||
// <U00C1> <U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^A}", // \symbol{"C2}
|
||||
// <U00C2> <U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH TILDE
|
||||
"<EFBFBD>" => "{\\~A}", // \symbol{"C3}
|
||||
// <U00C3> <U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"A}", // \symbol{"C4}
|
||||
// <U00C4> "<U0041><U0065>";<U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER A WITH RING ABOVE
|
||||
"<EFBFBD>" => "{\\r A}", // "\\AA" // \symbol{"C5}
|
||||
// <U00C5> "<U0041><U0061>";<U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER AE
|
||||
"<EFBFBD>" => "{\\AE}", // \symbol{"C6}
|
||||
// <U00C6> "<U0041><U0045>";<U0041>
|
||||
|
||||
// LATIN CAPITAL LETTER C WITH CEDILLA
|
||||
"<EFBFBD>" => "{\\c C}", // \symbol{"C7}
|
||||
// <U00C7> <U0043>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`E}", // \symbol{"C8}
|
||||
// <U00C8> <U0045>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'E}", // \symbol{"C9}
|
||||
// <U00C9> <U0045>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^E}", // \symbol{"CA}
|
||||
// <U00CA> <U0045>
|
||||
|
||||
// LATIN CAPITAL LETTER E WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"E}", // \symbol{"CB}
|
||||
// <U00CB> <U0045>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`I}", // \symbol{"CC}
|
||||
// <U00CC> <U0049>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'I}", // \symbol{"CD}
|
||||
// <U00CD> <U0049>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^I}", // \symbol{"CE}
|
||||
// <U00CE> <U0049>
|
||||
|
||||
// LATIN CAPITAL LETTER I WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"I}", // \symbol{"CF}
|
||||
// <U00CF> <U0049>
|
||||
|
||||
// LATIN CAPITAL LETTER ETH
|
||||
"<EFBFBD>" => "{\\DH}", // \symbol{"D0}
|
||||
// <U00D0> <U0044>
|
||||
|
||||
// LATIN CAPITAL LETTER N WITH TILDE
|
||||
"<EFBFBD>" => "{\\~N}", // \symbol{"D1}
|
||||
// <U00D1> <U004E>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`O}", // \symbol{"D2}
|
||||
// <U00D2> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'O}", // \symbol{"D3}
|
||||
// <U00D3> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^O}", // \symbol{"D4}
|
||||
// <U00D4> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH TILDE
|
||||
"<EFBFBD>" => "{\\~O}", // \symbol{"D5}
|
||||
// <U00D5> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"O}", // \symbol{"D6}
|
||||
// <U00D6> "<U004F><U0065>";<U004F>
|
||||
|
||||
// MULTIPLICATION SIGN
|
||||
"<EFBFBD>" => "{\\texttimes}", // \symbol{"D7}
|
||||
// <U00D7> <U0078>
|
||||
|
||||
// LATIN CAPITAL LETTER O WITH STROKE
|
||||
"<EFBFBD>" => "{\\O}", // \symbol{"D8}
|
||||
// <U00D8> <U004F>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`U}", // \symbol{"D9}
|
||||
// <U00D9> <U0055>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'U}", // \symbol{"DA}
|
||||
// <U00DA> <U0055>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^U}", // \symbol{"DB}
|
||||
// <U00DB> <U0055>
|
||||
|
||||
// LATIN CAPITAL LETTER U WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"U}", // \symbol{"DC}
|
||||
// <U00DC> "<U0055><U0065>";<U0055>
|
||||
|
||||
// LATIN CAPITAL LETTER Y WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'Y}", // \symbol{"DD}
|
||||
// <U00DD> <U0059>
|
||||
|
||||
// LATIN CAPITAL LETTER THORN
|
||||
"<EFBFBD>" => "{\\TH}", // \symbol{"DE}
|
||||
// <U00DE> "<U0054><U0068>"
|
||||
|
||||
// LATIN SMALL LETTER SHARP S
|
||||
"<EFBFBD>" => "{\\ss}", // \symbol{"DF}
|
||||
// <U00DF> "<U0073><U0073>";<U03B2>
|
||||
|
||||
// LATIN SMALL LETTER A WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`a}", // \symbol{"E0}
|
||||
// <U00E0> <U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'a}", // \symbol{"E1}
|
||||
// <U00E1> <U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^a}", // \symbol{"E2}
|
||||
// <U00E2> <U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH TILDE
|
||||
"<EFBFBD>" => "{\\~a}", // \symbol{"E3}
|
||||
// <U00E3> <U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"a}", // \symbol{"E4}
|
||||
// <U00E4> "<U0061><U0065>";<U0061>
|
||||
|
||||
// LATIN SMALL LETTER A WITH RING ABOVE
|
||||
"<EFBFBD>" => "{\\r a}", // "\\aa" // \symbol{"E5}
|
||||
// <U00E5> "<U0061><U0061>";<U0061>
|
||||
|
||||
// LATIN SMALL LETTER AE
|
||||
"<EFBFBD>" => "{\\ae}", // \symbol{"E6}
|
||||
// <U00E6> "<U0061><U0065>";<U0061>
|
||||
|
||||
// LATIN SMALL LETTER C WITH CEDILLA
|
||||
"<EFBFBD>" => "{\\c c}", // \symbol{"E7}
|
||||
// <U00E7> <U0063>
|
||||
|
||||
// LATIN SMALL LETTER E WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`e}", // \symbol{"E8}
|
||||
// <U00E8> <U0065>
|
||||
|
||||
// LATIN SMALL LETTER E WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'e}", // \symbol{"E9}
|
||||
// <U00E9> <U0065>
|
||||
|
||||
// LATIN SMALL LETTER E WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^e}", // \symbol{"EA}
|
||||
// <U00EA> <U0065>
|
||||
|
||||
// LATIN SMALL LETTER E WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"e}", // \symbol{"EB}
|
||||
// <U00EB> <U0065>
|
||||
|
||||
// LATIN SMALL LETTER I WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`\\i}", // \symbol{"EC}
|
||||
// <U00EC> <U0069>
|
||||
|
||||
// LATIN SMALL LETTER I WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'\\i}", // \symbol{"ED}
|
||||
// <U00ED> <U0069>
|
||||
|
||||
// LATIN SMALL LETTER I WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^\\i}", // \symbol{"EE}
|
||||
// <U00EE> <U0069>
|
||||
|
||||
// LATIN SMALL LETTER I WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"\\i}", // \symbol{"EF}
|
||||
// <U00EF> <U0069>
|
||||
|
||||
// LATIN SMALL LETTER ETH
|
||||
"<EFBFBD>" => "{\\dh}", // \symbol{"F0}
|
||||
// <U00F0> <U0064>
|
||||
|
||||
// LATIN SMALL LETTER N WITH TILDE
|
||||
"<EFBFBD>" => "{\\~n}", // \symbol{"F1}
|
||||
// <U00F1> <U006E>
|
||||
|
||||
// LATIN SMALL LETTER O WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`o}", // \symbol{"F2}
|
||||
// <U00F2> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER O WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'o}", // \symbol{"F3}
|
||||
// <U00F3> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER O WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^o}", // \symbol{"F4}
|
||||
// <U00F4> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER O WITH TILDE
|
||||
"<EFBFBD>" => "{\\~o}", // \symbol{"F5}
|
||||
// <U00F5> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER O WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"o}", // \symbol{"F6}
|
||||
// <U00F6> "<U006F><U0065>";<U006F>
|
||||
|
||||
// DIVISION SIGN
|
||||
"<EFBFBD>" => "{\\textdiv}", // \symbol{"F7}
|
||||
// <U00F7> <U003A>
|
||||
|
||||
// LATIN SMALL LETTER O WITH STROKE
|
||||
"<EFBFBD>" => "{\\o}", // \symbol{"F8}
|
||||
// <U00F8> <U006F>
|
||||
|
||||
// LATIN SMALL LETTER U WITH GRAVE
|
||||
"<EFBFBD>" => "{\\`u}", // \symbol{"F9}
|
||||
// <U00F9> <U0075>
|
||||
|
||||
// LATIN SMALL LETTER U WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'u}", // \symbol{"FA}
|
||||
// <U00FA> <U0075>
|
||||
|
||||
// LATIN SMALL LETTER U WITH CIRCUMFLEX
|
||||
"<EFBFBD>" => "{\\^u}", // \symbol{"FB}
|
||||
// <U00FB> <U0075>
|
||||
|
||||
// LATIN SMALL LETTER U WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"u}", // \symbol{"FC}
|
||||
// <U00FC> "<U0075><U0065>";<U0075>
|
||||
|
||||
// LATIN SMALL LETTER Y WITH ACUTE
|
||||
"<EFBFBD>" => "{\\'y}", // \symbol{"FD}
|
||||
// <U00FD> <U0079>
|
||||
|
||||
// LATIN SMALL LETTER THORN
|
||||
"<EFBFBD>" => "{\\th}", // \symbol{"FE}
|
||||
// <U00FE> "<U0074><U0068>"
|
||||
|
||||
// LATIN SMALL LETTER Y WITH DIAERESIS
|
||||
"<EFBFBD>" => "{\\\"y}" // \symbol{"FF}
|
||||
// <U00FF> <U0079>
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
91
includes/transtab_refbase_ascii.inc.php
Normal file
91
includes/transtab_refbase_ascii.inc.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_refbase_ascii.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_refbase_ascii.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 28-May-06, 18:24
|
||||
// Modified: $Date: 2008-10-30 17:19:48 +0000 (Thu, 30 Oct 2008) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1288 $
|
||||
|
||||
// Search & replace patterns for conversion from refbase markup to plain text. Removes refbase fontshape markup (italic, bold, underline)
|
||||
// as well as markup for super- and subscript or greek letters from the text. Adopt to your needs if necessary.
|
||||
// Search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes.
|
||||
|
||||
global $patternModifiers; // defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
|
||||
|
||||
$transtab_refbase_ascii = array(
|
||||
|
||||
"/__(?!_)(.+?)__/" => "\\1", // the pattern for underline (__...__) must come before the one for italic (_..._)
|
||||
"/_(.+?)_/" => "\\1",
|
||||
"/\\*\\*(.+?)\\*\\*/" => "\\1",
|
||||
"/\\[super:(.+?)\\]/i" => "\\1",
|
||||
"/\\[sub:(.+?)\\]/i" => "\\1",
|
||||
"/\\[permil\\]/" => "per mille",
|
||||
"/\\[infinity\\]/" => "infinity",
|
||||
"/\\[alpha\\]/" => "alpha",
|
||||
"/\\[beta\\]/" => "beta",
|
||||
"/\\[gamma\\]/" => "gamma",
|
||||
"/\\[delta\\]/" => "delta",
|
||||
"/\\[epsilon\\]/" => "epsilon",
|
||||
"/\\[zeta\\]/" => "zeta",
|
||||
"/\\[eta\\]/" => "eta",
|
||||
"/\\[theta\\]/" => "theta",
|
||||
"/\\[iota\\]/" => "iota",
|
||||
"/\\[kappa\\]/" => "kappa",
|
||||
"/\\[lambda\\]/" => "lambda",
|
||||
"/\\[mu\\]/" => "mu",
|
||||
"/\\[nu\\]/" => "nu",
|
||||
"/\\[xi\\]/" => "xi",
|
||||
"/\\[omicron\\]/" => "omicron",
|
||||
"/\\[pi\\]/" => "pi",
|
||||
"/\\[rho\\]/" => "rho",
|
||||
"/\\[sigmaf\\]/" => "sigmaf",
|
||||
"/\\[sigma\\]/" => "sigma",
|
||||
"/\\[tau\\]/" => "tau",
|
||||
"/\\[upsilon\\]/" => "upsilon",
|
||||
"/\\[phi\\]/" => "phi",
|
||||
"/\\[chi\\]/" => "chi",
|
||||
"/\\[psi\\]/" => "psi",
|
||||
"/\\[omega\\]/" => "omega",
|
||||
"/\\[Alpha\\]/" => "Alpha",
|
||||
"/\\[Beta\\]/" => "Beta",
|
||||
"/\\[Gamma\\]/" => "Gamma",
|
||||
"/\\[Delta\\]/" => "Delta",
|
||||
"/\\[Epsilon\\]/" => "Epsilon",
|
||||
"/\\[Zeta\\]/" => "Zeta",
|
||||
"/\\[Eta\\]/" => "Eta",
|
||||
"/\\[Theta\\]/" => "Theta",
|
||||
"/\\[Iota\\]/" => "Iota",
|
||||
"/\\[Kappa\\]/" => "Kappa",
|
||||
"/\\[Lambda\\]/" => "Lambda",
|
||||
"/\\[Mu\\]/" => "Mu",
|
||||
"/\\[Nu\\]/" => "Nu",
|
||||
"/\\[Xi\\]/" => "Xi",
|
||||
"/\\[Omicron\\]/" => "Omicron",
|
||||
"/\\[Pi\\]/" => "Pi",
|
||||
"/\\[Rho\\]/" => "Rho",
|
||||
"/\\[Sigma\\]/" => "Sigma",
|
||||
"/\\[Tau\\]/" => "Tau",
|
||||
"/\\[Upsilon\\]/" => "Upsilon",
|
||||
"/\\[Phi\\]/" => "Phi",
|
||||
"/\\[Chi\\]/" => "Chi",
|
||||
"/\\[Psi\\]/" => "Psi",
|
||||
"/\\[Omega\\]/" => "Omega",
|
||||
// "/<2F>/$patternModifiers" => "-"
|
||||
// Note that for UTF-8 based systems, '$patternModifiers' contains the "u" (PCRE_UTF8) pattern modifier which should cause PHP/PCRE
|
||||
// to treat pattern strings as UTF-8 (otherwise this conversion pattern would garble UTF-8 characters such as "<22>"). However, the
|
||||
// "<22>" character still seems to cause PREG compilation errors on some UTF8-based systems, which is why the line has been commented
|
||||
// out (it should work fine for a latin1-based system, though).
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
89
includes/transtab_refbase_bibtex.inc.php
Normal file
89
includes/transtab_refbase_bibtex.inc.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_refbase_bibtex.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_refbase_bibtex.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 28-May-06, 17:01
|
||||
// Modified: $Date: 2008-07-30 15:23:57 +0000 (Wed, 30 Jul 2008) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1184 $
|
||||
|
||||
// Search & replace patterns for conversion from refbase markup to LaTeX/BibTeX markup & entities. Converts refbase fontshape markup (italic, bold) into
|
||||
// LaTeX commands of the 'textcomp' package, super- and subscript as well as greek letters get converted into the respective commands in math mode.
|
||||
// You may need to adopt the LaTeX markup to suit your individual needs.
|
||||
// Notes: - when exporting MODS XML with '$convertExportDataToUTF8' set to "yes" in 'ini.inc.php', we convert refbase character markup (such as greek letters)
|
||||
// to appropriate UTF-8 entities and let bibutils take care of the conversion to LaTeX markup; in this case, this conversion table only kicks in for
|
||||
// refbase markup that was NOT converted to UTF-8, i.e. fontshape markup and super- and subscript text that has no matching Unicode entities
|
||||
// - search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes
|
||||
|
||||
$transtab_refbase_bibtex = array(
|
||||
|
||||
"/\\\\_\\\\_(?!_)(.+?)\\\\_\\\\_/" => '\\1', // underline is currently removed; instead, you could use '\\ul{\\1}' which requires '\usepackage{soul}'; the pattern for underline (__...__) must come before the one for italic (_..._); see note below w.r.t. backslashes before substrings
|
||||
"/\\\\_(.+?)\\\\_/" => '\\textit{\\1}', // or use '\\it{\\1}' (the backslashes before the substrings were inserted by bibutils: '_word_' gets '\_word\_')
|
||||
"/\\*\\*(.+?)\\*\\*/" => '\\textbf{\\1}', // or use '\\bf{\\1}'
|
||||
"/\\[super:(.+?)\\]/i" => '$^{\\1}$', // or use '\\textsuperscript{\\1}'
|
||||
"/\\[sub:(.+?)\\]/i" => '$_{\\1}$', // or use '\\textsubscript{\\1}' if defined in your package
|
||||
"/\\[permil\\]/" => '{\\textperthousand}',
|
||||
"/\\[infinity\\]/" => '$\\infty$',
|
||||
"/\\[alpha\\]/" => '$\\alpha$',
|
||||
"/\\[beta\\]/" => '$\\beta$',
|
||||
"/\\[gamma\\]/" => '$\\gamma$',
|
||||
"/\\[delta\\]/" => '$\\delta$',
|
||||
"/\\[epsilon\\]/" => '$\\epsilon$',
|
||||
"/\\[zeta\\]/" => '$\\zeta$',
|
||||
"/\\[eta\\]/" => '$\\eta$',
|
||||
"/\\[theta\\]/" => '$\\theta$',
|
||||
"/\\[iota\\]/" => '$\\iota$',
|
||||
"/\\[kappa\\]/" => '$\\kappa$',
|
||||
"/\\[lambda\\]/" => '$\\lambda$',
|
||||
"/\\[mu\\]/" => '$\\mu$',
|
||||
"/\\[nu\\]/" => '$\\nu$',
|
||||
"/\\[xi\\]/" => '$\\xi$',
|
||||
"/\\[omicron\\]/" => '$o$',
|
||||
"/\\[pi\\]/" => '$\\pi$',
|
||||
"/\\[rho\\]/" => '$\\rho$',
|
||||
"/\\[sigmaf\\]/" => '$\\varsigma$',
|
||||
"/\\[sigma\\]/" => '$\\sigma$',
|
||||
"/\\[tau\\]/" => '$\\tau$',
|
||||
"/\\[upsilon\\]/" => '$\\upsilon$',
|
||||
"/\\[phi\\]/" => '$\\phi$',
|
||||
"/\\[chi\\]/" => '$\\chi$',
|
||||
"/\\[psi\\]/" => '$\\psi$',
|
||||
"/\\[omega\\]/" => '$\\omega$',
|
||||
"/\\[Alpha\\]/" => '$A$',
|
||||
"/\\[Beta\\]/" => '$B$',
|
||||
"/\\[Gamma\\]/" => '$\\Gamma$',
|
||||
"/\\[Delta\\]/" => '$\\Delta$',
|
||||
"/\\[Epsilon\\]/" => '$E$',
|
||||
"/\\[Zeta\\]/" => '$Z$',
|
||||
"/\\[Eta\\]/" => '$H$',
|
||||
"/\\[Theta\\]/" => '$\\Theta$',
|
||||
"/\\[Iota\\]/" => '$I$',
|
||||
"/\\[Kappa\\]/" => '$K$',
|
||||
"/\\[Lambda\\]/" => '$\\Lambda$',
|
||||
"/\\[Mu\\]/" => '$M$',
|
||||
"/\\[Nu\\]/" => '$N$',
|
||||
"/\\[Xi\\]/" => '$\\Xi$',
|
||||
"/\\[Omicron\\]/" => '$O$',
|
||||
"/\\[Pi\\]/" => '$\\Pi$',
|
||||
"/\\[Rho\\]/" => '$R$',
|
||||
"/\\[Sigma\\]/" => '$\\Sigma$',
|
||||
"/\\[Tau\\]/" => '$T$',
|
||||
"/\\[Upsilon\\]/" => '$\\Upsilon$',
|
||||
"/\\[Phi\\]/" => '$\\Phi$',
|
||||
"/\\[Chi\\]/" => '$X$',
|
||||
"/\\[Psi\\]/" => '$\\Psi$',
|
||||
"/\\[Omega\\]/" => '$\\Omega$',
|
||||
"/^(?=(URL|LOCATION|NOTE|KEYWORDS)=)/mi" => 'opt'
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
93
includes/transtab_refbase_html.inc.php
Normal file
93
includes/transtab_refbase_html.inc.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_refbase_html.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_refbase_html.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 28-May-06, 18:24
|
||||
// Modified: $Date: 2008-10-30 17:19:48 +0000 (Thu, 30 Oct 2008) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1288 $
|
||||
|
||||
// Search & replace patterns for conversion from refbase markup to HTML markup & entities. Converts refbase fontshape markup (italic, bold, underline)
|
||||
// and super- and subscript into HTML commands, greek letters get converted into the respective HTML entity codes.
|
||||
// Search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes.
|
||||
|
||||
global $patternModifiers; // defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
|
||||
|
||||
$transtab_refbase_html = array(
|
||||
|
||||
"/__(?!_)(.+?)__/" => "<u>\\1</u>", // the pattern for underline (__...__) must come before the one for italic (_..._)
|
||||
"/_(.+?)_/" => "<i>\\1</i>",
|
||||
"/\\*\\*(.+?)\\*\\*/" => "<b>\\1</b>",
|
||||
"/\\[super:(.+?)\\]/i" => "<sup>\\1</sup>",
|
||||
"/\\[sub:(.+?)\\]/i" => "<sub>\\1</sub>",
|
||||
"/\\[permil\\]/" => "‰",
|
||||
"/\\[infinity\\]/" => "∞",
|
||||
"/\\[alpha\\]/" => "α",
|
||||
"/\\[beta\\]/" => "β",
|
||||
"/\\[gamma\\]/" => "γ",
|
||||
"/\\[delta\\]/" => "δ",
|
||||
"/\\[epsilon\\]/" => "ε",
|
||||
"/\\[zeta\\]/" => "ζ",
|
||||
"/\\[eta\\]/" => "η",
|
||||
"/\\[theta\\]/" => "θ",
|
||||
"/\\[iota\\]/" => "ι",
|
||||
"/\\[kappa\\]/" => "κ",
|
||||
"/\\[lambda\\]/" => "λ",
|
||||
"/\\[mu\\]/" => "μ",
|
||||
"/\\[nu\\]/" => "ν",
|
||||
"/\\[xi\\]/" => "ξ",
|
||||
"/\\[omicron\\]/" => "ο",
|
||||
"/\\[pi\\]/" => "π",
|
||||
"/\\[rho\\]/" => "ρ",
|
||||
"/\\[sigmaf\\]/" => "ς",
|
||||
"/\\[sigma\\]/" => "σ",
|
||||
"/\\[tau\\]/" => "τ",
|
||||
"/\\[upsilon\\]/" => "υ",
|
||||
"/\\[phi\\]/" => "φ",
|
||||
"/\\[chi\\]/" => "χ",
|
||||
"/\\[psi\\]/" => "ψ",
|
||||
"/\\[omega\\]/" => "ω",
|
||||
"/\\[Alpha\\]/" => "Α",
|
||||
"/\\[Beta\\]/" => "Β",
|
||||
"/\\[Gamma\\]/" => "Γ",
|
||||
"/\\[Delta\\]/" => "Δ",
|
||||
"/\\[Epsilon\\]/" => "Ε",
|
||||
"/\\[Zeta\\]/" => "Ζ",
|
||||
"/\\[Eta\\]/" => "Η",
|
||||
"/\\[Theta\\]/" => "Θ",
|
||||
"/\\[Iota\\]/" => "Ι",
|
||||
"/\\[Kappa\\]/" => "Κ",
|
||||
"/\\[Lambda\\]/" => "Λ",
|
||||
"/\\[Mu\\]/" => "Μ",
|
||||
"/\\[Nu\\]/" => "Ν",
|
||||
"/\\[Xi\\]/" => "Ξ",
|
||||
"/\\[Omicron\\]/" => "Ο",
|
||||
"/\\[Pi\\]/" => "Π",
|
||||
"/\\[Rho\\]/" => "Ρ",
|
||||
"/\\[Sigma\\]/" => "Σ",
|
||||
"/\\[Tau\\]/" => "Τ",
|
||||
"/\\[Upsilon\\]/" => "Υ",
|
||||
"/\\[Phi\\]/" => "Φ",
|
||||
"/\\[Chi\\]/" => "Χ",
|
||||
"/\\[Psi\\]/" => "Ψ",
|
||||
"/\\[Omega\\]/" => "Ω",
|
||||
"/(?:\"|")(.+?)(?:\"|")/" => "“\\1”",
|
||||
"/ +- +/" => " – ",
|
||||
// "/<2F>/$patternModifiers" => "–"
|
||||
// Note that for UTF-8 based systems, '$patternModifiers' contains the "u" (PCRE_UTF8) pattern modifier which should cause PHP/PCRE
|
||||
// to treat pattern strings as UTF-8 (otherwise this conversion pattern would garble UTF-8 characters such as "<22>"). However, the
|
||||
// "<22>" character still seems to cause PREG compilation errors on some UTF8-based systems, which is why the line has been commented
|
||||
// out (it should work fine for a latin1-based system, though).
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
95
includes/transtab_refbase_latex.inc.php
Normal file
95
includes/transtab_refbase_latex.inc.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_refbase_latex.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_refbase_latex.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 28-May-06, 17:01
|
||||
// Modified: $Date: 2008-10-30 17:19:48 +0000 (Thu, 30 Oct 2008) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1288 $
|
||||
|
||||
// Search & replace patterns for conversion from refbase markup to LaTeX markup & entities. Converts refbase fontshape markup (italic, bold) into
|
||||
// LaTeX commands of the 'textcomp' package, super- and subscript as well as greek letters get converted into the respective commands in math mode.
|
||||
// You may need to adopt the LaTeX markup to suit your individual needs.
|
||||
// Search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes.
|
||||
|
||||
global $patternModifiers; // defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
|
||||
|
||||
$transtab_refbase_latex = array(
|
||||
|
||||
"/([{}])/" => '\\\\\\1', // escaping of curly brackets has to be done as the first action so that conversion is only applied to field contents and doesn't mess with the generated LaTeX code
|
||||
"/__(?!_)(.+?)__/" => '\\1', // underline is currently removed; instead, you could use '\\ul{\\1}' which requires '\usepackage{soul}'; the pattern for underline (__...__) must come before the one for italic (_..._)
|
||||
"/_(.+?)_/" => '\\textit{\\1}', // or use '\\it{\\1}'
|
||||
"/\\*\\*(.+?)\\*\\*/" => '\\textbf{\\1}', // or use '\\bf{\\1}'
|
||||
"/\\[super:(.+?)\\]/i" => '$^{\\1}$', // or use '\\textsuperscript{\\1}'
|
||||
"/\\[sub:(.+?)\\]/i" => '$_{\\1}$', // or use '\\textsubscript{\\1}' if defined in your package
|
||||
"/\\[permil\\]/" => '{\\textperthousand}',
|
||||
"/\\[infinity\\]/" => '$\\infty$',
|
||||
"/\\[alpha\\]/" => '$\\alpha$',
|
||||
"/\\[beta\\]/" => '$\\beta$',
|
||||
"/\\[gamma\\]/" => '$\\gamma$',
|
||||
"/\\[delta\\]/" => '$\\delta$',
|
||||
"/\\[epsilon\\]/" => '$\\epsilon$',
|
||||
"/\\[zeta\\]/" => '$\\zeta$',
|
||||
"/\\[eta\\]/" => '$\\eta$',
|
||||
"/\\[theta\\]/" => '$\\theta$',
|
||||
"/\\[iota\\]/" => '$\\iota$',
|
||||
"/\\[kappa\\]/" => '$\\kappa$',
|
||||
"/\\[lambda\\]/" => '$\\lambda$',
|
||||
"/\\[mu\\]/" => '$\\mu$',
|
||||
"/\\[nu\\]/" => '$\\nu$',
|
||||
"/\\[xi\\]/" => '$\\xi$',
|
||||
"/\\[omicron\\]/" => '$o$',
|
||||
"/\\[pi\\]/" => '$\\pi$',
|
||||
"/\\[rho\\]/" => '$\\rho$',
|
||||
"/\\[sigmaf\\]/" => '$\\varsigma$',
|
||||
"/\\[sigma\\]/" => '$\\sigma$',
|
||||
"/\\[tau\\]/" => '$\\tau$',
|
||||
"/\\[upsilon\\]/" => '$\\upsilon$',
|
||||
"/\\[phi\\]/" => '$\\phi$',
|
||||
"/\\[chi\\]/" => '$\\chi$',
|
||||
"/\\[psi\\]/" => '$\\psi$',
|
||||
"/\\[omega\\]/" => '$\\omega$',
|
||||
"/\\[Alpha\\]/" => '$A$',
|
||||
"/\\[Beta\\]/" => '$B$',
|
||||
"/\\[Gamma\\]/" => '$\\Gamma$',
|
||||
"/\\[Delta\\]/" => '$\\Delta$',
|
||||
"/\\[Epsilon\\]/" => '$E$',
|
||||
"/\\[Zeta\\]/" => '$Z$',
|
||||
"/\\[Eta\\]/" => '$H$',
|
||||
"/\\[Theta\\]/" => '$\\Theta$',
|
||||
"/\\[Iota\\]/" => '$I$',
|
||||
"/\\[Kappa\\]/" => '$K$',
|
||||
"/\\[Lambda\\]/" => '$\\Lambda$',
|
||||
"/\\[Mu\\]/" => '$M$',
|
||||
"/\\[Nu\\]/" => '$N$',
|
||||
"/\\[Xi\\]/" => '$\\Xi$',
|
||||
"/\\[Omicron\\]/" => '$O$',
|
||||
"/\\[Pi\\]/" => '$\\Pi$',
|
||||
"/\\[Rho\\]/" => '$R$',
|
||||
"/\\[Sigma\\]/" => '$\\Sigma$',
|
||||
"/\\[Tau\\]/" => '$T$',
|
||||
"/\\[Upsilon\\]/" => '$\\Upsilon$',
|
||||
"/\\[Phi\\]/" => '$\\Phi$',
|
||||
"/\\[Chi\\]/" => '$X$',
|
||||
"/\\[Psi\\]/" => '$\\Psi$',
|
||||
"/\\[Omega\\]/" => '$\\Omega$',
|
||||
"/\"(.+?)\"/" => '{\\textquotedblleft}\\1{\\textquotedblright}',
|
||||
"/ +- +/" => " -- ",
|
||||
// "/<2F>/$patternModifiers" => "--"
|
||||
// Note that for UTF-8 based systems, '$patternModifiers' contains the "u" (PCRE_UTF8) pattern modifier which should cause PHP/PCRE
|
||||
// to treat pattern strings as UTF-8 (otherwise this conversion pattern would garble UTF-8 characters such as "<22>"). However, the
|
||||
// "<22>" character still seems to cause PREG compilation errors on some UTF8-based systems, which is why the line has been commented
|
||||
// out (it should work fine for a latin1-based system, though).
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
94
includes/transtab_refbase_markdown.inc.php
Normal file
94
includes/transtab_refbase_markdown.inc.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_refbase_markdown.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_refbase_markdown.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 28-May-06, 18:24
|
||||
// Modified: $Date: 2008-10-30 17:19:48 +0000 (Thu, 30 Oct 2008) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1288 $
|
||||
|
||||
// Search & replace patterns for conversion from refbase markup to "Markdown" markup & entities. Markdown is a plain text formatting syntax
|
||||
// as well as a software tool that converts the plain text formatting back to HTML; see <http://daringfireball.net/projects/markdown/> for more info.
|
||||
// refbase fontshape markup (italic, bold) does not need any conversion since it's identical to (and was in fact modeled after) the Markdown syntax.
|
||||
// Super- and subscript gets converted into HTML commands while greek letters get converted into the respective HTML entity codes.
|
||||
// Search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes.
|
||||
|
||||
global $patternModifiers; // defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
|
||||
|
||||
$transtab_refbase_markdown = array(
|
||||
|
||||
"/__(?!_)(.+?)__/" => "<u>\\1</u>", // the pattern for underline (__...__) must come before the one for italic (_..._)
|
||||
// "/_(.+?)_/" => "_\\1_",
|
||||
// "/\\*\\*(.+?)\\*\\*/" => "**\\1**",
|
||||
"/\\[super:(.+?)\\]/i" => "<sup>\\1</sup>",
|
||||
"/\\[sub:(.+?)\\]/i" => "<sub>\\1</sub>",
|
||||
"/\\[permil\\]/" => "‰",
|
||||
"/\\[infinity\\]/" => "∞",
|
||||
"/\\[alpha\\]/" => "α",
|
||||
"/\\[beta\\]/" => "β",
|
||||
"/\\[gamma\\]/" => "γ",
|
||||
"/\\[delta\\]/" => "δ",
|
||||
"/\\[epsilon\\]/" => "ε",
|
||||
"/\\[zeta\\]/" => "ζ",
|
||||
"/\\[eta\\]/" => "η",
|
||||
"/\\[theta\\]/" => "θ",
|
||||
"/\\[iota\\]/" => "ι",
|
||||
"/\\[kappa\\]/" => "κ",
|
||||
"/\\[lambda\\]/" => "λ",
|
||||
"/\\[mu\\]/" => "μ",
|
||||
"/\\[nu\\]/" => "ν",
|
||||
"/\\[xi\\]/" => "ξ",
|
||||
"/\\[omicron\\]/" => "ο",
|
||||
"/\\[pi\\]/" => "π",
|
||||
"/\\[rho\\]/" => "ρ",
|
||||
"/\\[sigmaf\\]/" => "ς",
|
||||
"/\\[sigma\\]/" => "σ",
|
||||
"/\\[tau\\]/" => "τ",
|
||||
"/\\[upsilon\\]/" => "υ",
|
||||
"/\\[phi\\]/" => "φ",
|
||||
"/\\[chi\\]/" => "χ",
|
||||
"/\\[psi\\]/" => "ψ",
|
||||
"/\\[omega\\]/" => "ω",
|
||||
"/\\[Alpha\\]/" => "Α",
|
||||
"/\\[Beta\\]/" => "Β",
|
||||
"/\\[Gamma\\]/" => "Γ",
|
||||
"/\\[Delta\\]/" => "Δ",
|
||||
"/\\[Epsilon\\]/" => "Ε",
|
||||
"/\\[Zeta\\]/" => "Ζ",
|
||||
"/\\[Eta\\]/" => "Η",
|
||||
"/\\[Theta\\]/" => "Θ",
|
||||
"/\\[Iota\\]/" => "Ι",
|
||||
"/\\[Kappa\\]/" => "Κ",
|
||||
"/\\[Lambda\\]/" => "Λ",
|
||||
"/\\[Mu\\]/" => "Μ",
|
||||
"/\\[Nu\\]/" => "Ν",
|
||||
"/\\[Xi\\]/" => "Ξ",
|
||||
"/\\[Omicron\\]/" => "Ο",
|
||||
"/\\[Pi\\]/" => "Π",
|
||||
"/\\[Rho\\]/" => "Ρ",
|
||||
"/\\[Sigma\\]/" => "Σ",
|
||||
"/\\[Tau\\]/" => "Τ",
|
||||
"/\\[Upsilon\\]/" => "Υ",
|
||||
"/\\[Phi\\]/" => "Φ",
|
||||
"/\\[Chi\\]/" => "Χ",
|
||||
"/\\[Psi\\]/" => "Ψ",
|
||||
"/\\[Omega\\]/" => "Ω",
|
||||
"/ +- +/" => " – ",
|
||||
// "/<2F>/$patternModifiers" => "–"
|
||||
// Note that for UTF-8 based systems, '$patternModifiers' contains the "u" (PCRE_UTF8) pattern modifier which should cause PHP/PCRE
|
||||
// to treat pattern strings as UTF-8 (otherwise this conversion pattern would garble UTF-8 characters such as "<22>"). However, the
|
||||
// "<22>" character still seems to cause PREG compilation errors on some UTF8-based systems, which is why the line has been commented
|
||||
// out (it should work fine for a latin1-based system, though).
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
107
includes/transtab_refbase_pdf.inc.php
Normal file
107
includes/transtab_refbase_pdf.inc.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_refbase_pdf.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_refbase_pdf.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 11-Jun-06, 01:13
|
||||
// Modified: $Date: 2008-10-30 17:19:48 +0000 (Thu, 30 Oct 2008) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1288 $
|
||||
|
||||
// Search & replace patterns for conversion from refbase markup to PDF markup & entities. Note that there's currently no conversion of emdashes
|
||||
// or markup for greek letters and super-/subscript (since I don't know how to print chars by code number or how to print Unicode chars directly).
|
||||
// Search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes.
|
||||
|
||||
$transtab_refbase_pdf = array(
|
||||
|
||||
"/__(?!_)(.+?)__/" => "<u>\\1</u>", // the pattern for underline (__...__) must come before the one for italic (_..._)
|
||||
"/_(.+?)_/" => "<i>\\1</i>", // html-style fontshape markup is recognized and converted by the pdf-php package
|
||||
"/\\*\\*(.+?)\\*\\*/" => "<b>\\1</b>",
|
||||
"/\\[super:(.+?)\\]/ie" => "superScriptToLatin1('\\1')", // function 'superScriptToLatin1()' will convert superscript letters '1', '2' and '3' to appropriate latin1 entities
|
||||
"/\\[sub:(.+?)\\]/i" => "\\1", // we remove markup which we cannot successfully convert to latin1 entities and replace it with an ASCII representation
|
||||
"/\\[permil\\]/" => "per mille",
|
||||
"/\\[infinity\\]/" => "infinity",
|
||||
"/\\[alpha\\]/" => "alpha",
|
||||
"/\\[beta\\]/" => "beta",
|
||||
"/\\[gamma\\]/" => "gamma",
|
||||
"/\\[delta\\]/" => "delta",
|
||||
"/\\[epsilon\\]/" => "epsilon",
|
||||
"/\\[zeta\\]/" => "zeta",
|
||||
"/\\[eta\\]/" => "eta",
|
||||
"/\\[theta\\]/" => "theta",
|
||||
"/\\[iota\\]/" => "iota",
|
||||
"/\\[kappa\\]/" => "kappa",
|
||||
"/\\[lambda\\]/" => "lambda",
|
||||
"/\\[mu\\]/" => "mu",
|
||||
"/\\[nu\\]/" => "nu",
|
||||
"/\\[xi\\]/" => "xi",
|
||||
"/\\[omicron\\]/" => "omicron",
|
||||
"/\\[pi\\]/" => "pi",
|
||||
"/\\[rho\\]/" => "rho",
|
||||
"/\\[sigmaf\\]/" => "sigmaf",
|
||||
"/\\[sigma\\]/" => "sigma",
|
||||
"/\\[tau\\]/" => "tau",
|
||||
"/\\[upsilon\\]/" => "upsilon",
|
||||
"/\\[phi\\]/" => "phi",
|
||||
"/\\[chi\\]/" => "chi",
|
||||
"/\\[psi\\]/" => "psi",
|
||||
"/\\[omega\\]/" => "omega",
|
||||
"/\\[Alpha\\]/" => "Alpha",
|
||||
"/\\[Beta\\]/" => "Beta",
|
||||
"/\\[Gamma\\]/" => "Gamma",
|
||||
"/\\[Delta\\]/" => "Delta",
|
||||
"/\\[Epsilon\\]/" => "Epsilon",
|
||||
"/\\[Zeta\\]/" => "Zeta",
|
||||
"/\\[Eta\\]/" => "Eta",
|
||||
"/\\[Theta\\]/" => "Theta",
|
||||
"/\\[Iota\\]/" => "Iota",
|
||||
"/\\[Kappa\\]/" => "Kappa",
|
||||
"/\\[Lambda\\]/" => "Lambda",
|
||||
"/\\[Mu\\]/" => "Mu",
|
||||
"/\\[Nu\\]/" => "Nu",
|
||||
"/\\[Xi\\]/" => "Xi",
|
||||
"/\\[Omicron\\]/" => "Omicron",
|
||||
"/\\[Pi\\]/" => "Pi",
|
||||
"/\\[Rho\\]/" => "Rho",
|
||||
"/\\[Sigma\\]/" => "Sigma",
|
||||
"/\\[Tau\\]/" => "Tau",
|
||||
"/\\[Upsilon\\]/" => "Upsilon",
|
||||
"/\\[Phi\\]/" => "Phi",
|
||||
"/\\[Chi\\]/" => "Chi",
|
||||
"/\\[Psi\\]/" => "Psi",
|
||||
"/\\[Omega\\]/" => "Omega",
|
||||
// "/\"(.+?)\"/" => "/quotedblleft\\1/quotedblright",
|
||||
// "/ +- +/" => " <20> " // endash (w.r.t. the "<22>" character, see e.g. note in file 'transtab_refbase_rtf.inc.php')
|
||||
|
||||
);
|
||||
|
||||
|
||||
$latin1SuperScriptSearchReplaceActionsArray = array(
|
||||
|
||||
"/1/" => '<27>', // <U00B9> (superscript one)
|
||||
"/2/" => '<27>', // <U00B2> (superscript two)
|
||||
"/3/" => '<27>' // <U00B3> (superscript three)
|
||||
// "/([^<5E><><EFBFBD>]+)/" => '[super:\\1]' // keep superscript markup in place for any text that has no matching superscript entity in Unicode
|
||||
|
||||
);
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Converts superscript text to appropriate Unicode entities:
|
||||
function superScriptToLatin1($sourceString)
|
||||
{
|
||||
global $latin1SuperScriptSearchReplaceActionsArray;
|
||||
|
||||
$sourceString = searchReplaceText($latin1SuperScriptSearchReplaceActionsArray, $sourceString, true); // function 'searchReplaceText()' is defined in 'include.inc.php'
|
||||
|
||||
return $sourceString;
|
||||
}
|
||||
?>
|
||||
94
includes/transtab_refbase_rtf.inc.php
Normal file
94
includes/transtab_refbase_rtf.inc.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_refbase_rtf.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_refbase_rtf.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 28-May-06, 18:21
|
||||
// Modified: $Date: 2008-10-30 17:19:48 +0000 (Thu, 30 Oct 2008) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1288 $
|
||||
|
||||
// Search & replace patterns for conversion from refbase markup to RTF markup & entities. Converts refbase fontshape markup (italic, bold, underline)
|
||||
// and super- and subscript into RTF commands, greek letters get converted into the respective Unicode character codes.
|
||||
// Search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes.
|
||||
|
||||
global $patternModifiers; // defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
|
||||
|
||||
$transtab_refbase_rtf = array(
|
||||
|
||||
"/([{}])/" => '\\\\\\1', // escaping of curly brackets has to be done as the first action so that conversion doesn't mess with the RTF code generated by other actions
|
||||
"/__(?!_)(.+?)__/" => "{\\ul \\1}", // underline; the pattern for underline (__...__) must come before the one for italic (_..._)
|
||||
"/_(.+?)_/" => "{\\i \\1}", // italic
|
||||
"/\\*\\*(.+?)\\*\\*/" => "{\\b \\1}", // bold
|
||||
"/\\[super:(.+?)\\]/i" => "{\\super \\1}", // superscript (or use '\up6')
|
||||
"/\\[sub:(.+?)\\]/i" => "{\\sub \\1}", // subscript (or use '\dn6')
|
||||
"/\\[permil\\]/" => "\\uc0\\u8240 ",
|
||||
"/\\[infinity\\]/" => "\\uc0\\u8734 ",
|
||||
"/\\[alpha\\]/" => "\\uc0\\u945 ",
|
||||
"/\\[beta\\]/" => "\\uc0\\u946 ",
|
||||
"/\\[gamma\\]/" => "\\uc0\\u947 ",
|
||||
"/\\[delta\\]/" => "\\uc0\\u948 ",
|
||||
"/\\[epsilon\\]/" => "\\uc0\\u949 ",
|
||||
"/\\[zeta\\]/" => "\\uc0\\u950 ",
|
||||
"/\\[eta\\]/" => "\\uc0\\u951 ",
|
||||
"/\\[theta\\]/" => "\\uc0\\u952 ",
|
||||
"/\\[iota\\]/" => "\\uc0\\u953 ",
|
||||
"/\\[kappa\\]/" => "\\uc0\\u954 ",
|
||||
"/\\[lambda\\]/" => "\\uc0\\u955 ",
|
||||
"/\\[mu\\]/" => "\\uc0\\u956 ",
|
||||
"/\\[nu\\]/" => "\\uc0\\u957 ",
|
||||
"/\\[xi\\]/" => "\\uc0\\u958 ",
|
||||
"/\\[omicron\\]/" => "\\uc0\\u959 ",
|
||||
"/\\[pi\\]/" => "\\uc0\\u960 ",
|
||||
"/\\[rho\\]/" => "\\uc0\\u961 ",
|
||||
"/\\[sigmaf\\]/" => "\\uc0\\u962 ",
|
||||
"/\\[sigma\\]/" => "\\uc0\\u963 ",
|
||||
"/\\[tau\\]/" => "\\uc0\\u964 ",
|
||||
"/\\[upsilon\\]/" => "\\uc0\\u965 ",
|
||||
"/\\[phi\\]/" => "\\uc0\\u966 ",
|
||||
"/\\[chi\\]/" => "\\uc0\\u967 ",
|
||||
"/\\[psi\\]/" => "\\uc0\\u968 ",
|
||||
"/\\[omega\\]/" => "\\uc0\\u969 ",
|
||||
"/\\[Alpha\\]/" => "\\uc0\\u913 ",
|
||||
"/\\[Beta\\]/" => "\\uc0\\u914 ",
|
||||
"/\\[Gamma\\]/" => "\\uc0\\u915 ",
|
||||
"/\\[Delta\\]/" => "\\uc0\\u916 ",
|
||||
"/\\[Epsilon\\]/" => "\\uc0\\u917 ",
|
||||
"/\\[Zeta\\]/" => "\\uc0\\u918 ",
|
||||
"/\\[Eta\\]/" => "\\uc0\\u919 ",
|
||||
"/\\[Theta\\]/" => "\\uc0\\u920 ",
|
||||
"/\\[Iota\\]/" => "\\uc0\\u921 ",
|
||||
"/\\[Kappa\\]/" => "\\uc0\\u922 ",
|
||||
"/\\[Lambda\\]/" => "\\uc0\\u923 ",
|
||||
"/\\[Mu\\]/" => "\\uc0\\u924 ",
|
||||
"/\\[Nu\\]/" => "\\uc0\\u925 ",
|
||||
"/\\[Xi\\]/" => "\\uc0\\u926 ",
|
||||
"/\\[Omicron\\]/" => "\\uc0\\u927 ",
|
||||
"/\\[Pi\\]/" => "\\uc0\\u928 ",
|
||||
"/\\[Rho\\]/" => "\\uc0\\u929 ",
|
||||
"/\\[Sigma\\]/" => "\\uc0\\u931 ",
|
||||
"/\\[Tau\\]/" => "\\uc0\\u932 ",
|
||||
"/\\[Upsilon\\]/" => "\\uc0\\u933 ",
|
||||
"/\\[Phi\\]/" => "\\uc0\\u934 ",
|
||||
"/\\[Chi\\]/" => "\\uc0\\u935 ",
|
||||
"/\\[Psi\\]/" => "\\uc0\\u936 ",
|
||||
"/\\[Omega\\]/" => "\\uc0\\u937 ",
|
||||
"/\"(.+?)\"/" => "\\ldblquote \\1\\rdblquote ", // see also notes in 'cite_rtf.php' at '$markupPatternsArray'
|
||||
"/ +- +/" => " \\endash ",
|
||||
// "/<2F>/$patternModifiers" => "\\endash "
|
||||
// Note that for UTF-8 based systems, '$patternModifiers' contains the "u" (PCRE_UTF8) pattern modifier which should cause PHP/PCRE
|
||||
// to treat pattern strings as UTF-8 (otherwise this conversion pattern would garble UTF-8 characters such as "<22>"). However, the
|
||||
// "<22>" character still seems to cause PREG compilation errors on some UTF8-based systems, which is why the line has been commented
|
||||
// out (it should work fine for a latin1-based system, though).
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
158
includes/transtab_refbase_unicode.inc.php
Normal file
158
includes/transtab_refbase_unicode.inc.php
Normal file
@@ -0,0 +1,158 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_refbase_unicode.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_refbase_unicode.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 02-Jun-06, 01:41
|
||||
// Modified: $Date: 2008-07-30 14:50:42 +0000 (Wed, 30 Jul 2008) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1183 $
|
||||
|
||||
// Search & replace patterns and functions for conversion from refbase markup to Unicode entities.
|
||||
// Search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes.
|
||||
|
||||
global $patternModifiers; // defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
|
||||
|
||||
$transtab_refbase_unicode = array(
|
||||
|
||||
// "/__(?!_)(.+?)__/" => '\\1', // the pattern for underline (__...__) must come before the one for italic (_..._)
|
||||
// "/_(.+?)_/" => '\\1', // fontshape markup is currently NOT converted (uncomment to strip fontshape markup from exported text)
|
||||
// "/\\*\\*(.+?)\\*\\*/" => '\\1',
|
||||
"/\\[super:(.+?)\\]/ie" => "superScriptToUnicode('\\1')", // function 'superScriptToUnicode()' will convert superscript text to appropriate Unicode entities
|
||||
"/\\[sub:(.+?)\\]/ie" => "subScriptToUnicode('\\1')", // function 'subScriptToUnicode()' will convert subscript text to appropriate Unicode entities
|
||||
"/\\[permil\\]/" => '‰', // <U2030> (per mille sign)
|
||||
"/\\[infinity\\]/" => '∞', // <U221E> (infinity)
|
||||
"/\\[alpha\\]/" => 'α',
|
||||
"/\\[beta\\]/" => 'β',
|
||||
"/\\[gamma\\]/" => 'γ',
|
||||
"/\\[delta\\]/" => 'δ',
|
||||
"/\\[epsilon\\]/" => 'ε',
|
||||
"/\\[zeta\\]/" => 'ζ',
|
||||
"/\\[eta\\]/" => 'η',
|
||||
"/\\[theta\\]/" => 'θ',
|
||||
"/\\[iota\\]/" => 'ι',
|
||||
"/\\[kappa\\]/" => 'κ',
|
||||
"/\\[lambda\\]/" => 'λ',
|
||||
"/\\[mu\\]/" => 'μ',
|
||||
"/\\[nu\\]/" => 'ν',
|
||||
"/\\[xi\\]/" => 'ξ',
|
||||
"/\\[omicron\\]/" => 'ο',
|
||||
"/\\[pi\\]/" => 'π',
|
||||
"/\\[rho\\]/" => 'ρ',
|
||||
"/\\[sigmaf\\]/" => 'ς',
|
||||
"/\\[sigma\\]/" => 'σ',
|
||||
"/\\[tau\\]/" => 'τ',
|
||||
"/\\[upsilon\\]/" => 'υ',
|
||||
"/\\[phi\\]/" => 'φ',
|
||||
"/\\[chi\\]/" => 'χ',
|
||||
"/\\[psi\\]/" => 'ψ',
|
||||
"/\\[omega\\]/" => 'ω',
|
||||
"/\\[Alpha\\]/" => 'Α',
|
||||
"/\\[Beta\\]/" => 'Β',
|
||||
"/\\[Gamma\\]/" => 'Γ',
|
||||
"/\\[Delta\\]/" => 'Δ',
|
||||
"/\\[Epsilon\\]/" => 'Ε',
|
||||
"/\\[Zeta\\]/" => 'Ζ',
|
||||
"/\\[Eta\\]/" => 'Η',
|
||||
"/\\[Theta\\]/" => 'Θ',
|
||||
"/\\[Iota\\]/" => 'Ι',
|
||||
"/\\[Kappa\\]/" => 'Κ',
|
||||
"/\\[Lambda\\]/" => 'Λ',
|
||||
"/\\[Mu\\]/" => 'Μ',
|
||||
"/\\[Nu\\]/" => 'Ν',
|
||||
"/\\[Xi\\]/" => 'Ξ',
|
||||
"/\\[Omicron\\]/" => 'Ο',
|
||||
"/\\[Pi\\]/" => 'Π',
|
||||
"/\\[Rho\\]/" => 'Ρ',
|
||||
"/\\[Sigma\\]/" => 'Σ',
|
||||
"/\\[Tau\\]/" => 'Τ',
|
||||
"/\\[Upsilon\\]/" => 'Υ',
|
||||
"/\\[Phi\\]/" => 'Φ',
|
||||
"/\\[Chi\\]/" => 'Χ',
|
||||
"/\\[Psi\\]/" => 'Ψ',
|
||||
"/\\[Omega\\]/" => 'Ω',
|
||||
"/\"(.+?)\"/" => '“\\1”', // <U201C>...<U201D> (left and right double quotation marks)
|
||||
"/ +- +/" => ' – ', // <U2013> (endash)
|
||||
"//$patternModifiers" => '–' // <U2013> (endash)
|
||||
// Note that for UTF-8 based systems, '$patternModifiers' contains the "u" (PCRE_UTF8) pattern modifier which causes PHP/PCRE
|
||||
// to treat pattern strings as UTF-8 (otherwise this conversion pattern would garble UTF-8 characters such as "Ö")
|
||||
|
||||
);
|
||||
|
||||
|
||||
$unicodeSuperScriptSearchReplaceActionsArray = array(
|
||||
|
||||
"/1/" => '¹', // <U00B9> (superscript one)
|
||||
"/2/" => '²', // <U00B2> (superscript two)
|
||||
"/3/" => '³', // <U00B3> (superscript three)
|
||||
"/4/" => '⁴', // <U2074> (superscript four)
|
||||
"/5/" => '⁵', // <U2075> (superscript five)
|
||||
"/6/" => '⁶', // <U2076> (superscript six)
|
||||
"/7/" => '⁷', // <U2077> (superscript seven)
|
||||
"/8/" => '⁸', // <U2078> (superscript eight)
|
||||
"/9/" => '⁹', // <U2079> (superscript nine)
|
||||
"/0/" => '⁰', // <U2070> (superscript zero)
|
||||
"/\\+/" => '⁺', // <U207A> (superscript plus sign)
|
||||
"/-/" => '⁻', // <U207B> (superscript minus)
|
||||
"/=/" => '⁼', // <U207C> (superscript equals sign)
|
||||
"/\\(/" => '⁽', // <U207D> (superscript left parenthesis)
|
||||
"/\\)/" => '⁾', // <U207E> (superscript right parenthesis)
|
||||
"/n/" => 'ⁿ', // <U207F> (superscript latin small letter n)
|
||||
"/([^¹²³⁴⁵⁶⁷⁸⁹⁰⁺⁻⁼⁽⁾ⁿ]+)/" => '[super:\\1]' // keep superscript markup in place for any text that has no matching superscript entity in Unicode
|
||||
|
||||
);
|
||||
|
||||
|
||||
$unicodeSubScriptSearchReplaceActionsArray = array(
|
||||
|
||||
"/1/" => '₁', // <U2081> (subscript one)
|
||||
"/2/" => '₂', // <U2082> (subscript two)
|
||||
"/3/" => '₃', // <U2083> (subscript three)
|
||||
"/4/" => '₄', // <U2084> (subscript four)
|
||||
"/5/" => '₅', // <U2085> (subscript five)
|
||||
"/6/" => '₆', // <U2086> (subscript six)
|
||||
"/7/" => '₇', // <U2087> (subscript seven)
|
||||
"/8/" => '₈', // <U2088> (subscript eight)
|
||||
"/9/" => '₉', // <U2089> (subscript nine)
|
||||
"/0/" => '₀', // <U2080> (subscript zero)
|
||||
"/\\+/" => '₊', // <U208A> (subscript plus sign)
|
||||
"/-/" => '₋', // <U208B> (subscript minus)
|
||||
"/=/" => '₌', // <U208C> (subscript equals sign)
|
||||
"/\\(/" => '₍', // <U208D> (subscript left parenthesis)
|
||||
"/\\)/" => '₎', // <U208E> (subscript right parenthesis)
|
||||
"/([^₁₂₃₄₅₆₇₈₉₀₊₋₌₍₎]+)/" => '[sub:\\1]' // keep subscript markup in place for any text that has no matching subscript entity in Unicode
|
||||
|
||||
);
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Converts superscript text to appropriate Unicode entities:
|
||||
function superScriptToUnicode($sourceString)
|
||||
{
|
||||
global $unicodeSuperScriptSearchReplaceActionsArray;
|
||||
|
||||
$sourceString = searchReplaceText($unicodeSuperScriptSearchReplaceActionsArray, $sourceString, true); // function 'searchReplaceText()' is defined in 'include.inc.php'
|
||||
|
||||
return $sourceString;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Converts subscript text to appropriate Unicode entities:
|
||||
function subScriptToUnicode($sourceString)
|
||||
{
|
||||
global $unicodeSubScriptSearchReplaceActionsArray;
|
||||
|
||||
$sourceString = searchReplaceText($unicodeSubScriptSearchReplaceActionsArray, $sourceString, true); // function 'searchReplaceText()' is defined in 'include.inc.php'
|
||||
|
||||
return $sourceString;
|
||||
}
|
||||
?>
|
||||
3335
includes/transtab_unicode_ascii.inc.php
Normal file
3335
includes/transtab_unicode_ascii.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
3348
includes/transtab_unicode_bibtex.inc.php
Normal file
3348
includes/transtab_unicode_bibtex.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
92
includes/transtab_unicode_charset.inc.php
Normal file
92
includes/transtab_unicode_charset.inc.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_unicode_charset.inc.php
|
||||
// Repository: $HeadURL$
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 24-Jul-08, 17:00
|
||||
// Modified: $Date: 2012-02-29 00:20:51 +0000 (Wed, 29 Feb 2012) $
|
||||
// $Author$
|
||||
// $Revision: 1351 $
|
||||
|
||||
// Search & replace patterns and variables for matching (and conversion of) Unicode character case & classes.
|
||||
// Search & replace patterns must be specified as perl-style regular expression and search patterns must include the
|
||||
// leading & trailing slashes.
|
||||
|
||||
// NOTE: Quote from <http://www.onphp5.com/article/22> ("i18n with PHP5: Pitfalls"):
|
||||
// "PCRE and other regular expression extensions are not locale-aware. This most notably influences the \w class
|
||||
// that is unable to work for Cyrillic letters. There could be a workaround for this if some preprocessor for the
|
||||
// regex string could replace \w and friends with character range prior to calling PCRE functions."
|
||||
//
|
||||
// In case of a UTF-8 based system, Unicode character properties ("\p{...}" or "\P{...}") can be used instead of the
|
||||
// normal and POSIX character classes. These are available since PHP 4.4.0 and PHP 5.1.0. Note that the use of Unicode
|
||||
// properties requires the "/.../u" PCRE pattern modifier! More info:
|
||||
// <http://www.php.net/manual/en/regexp.reference.unicode.php>
|
||||
|
||||
// The variables '$alnum', '$alpha', '$cntrl', '$dash', '$digit', '$graph', '$lower', '$print', '$punct', '$space',
|
||||
// '$upper', '$word' must be used within a perl-style regex character class and require the "/.../u" PCRE pattern modifier.
|
||||
|
||||
// Matches Unicode letters & digits:
|
||||
$alnum = "\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nd}"; // Unicode-aware equivalent of "[:alnum:]"
|
||||
|
||||
// Matches Unicode letters:
|
||||
$alpha = "\p{Ll}\p{Lu}\p{Lt}\p{Lo}"; // Unicode-aware equivalent of "[:alpha:]"
|
||||
|
||||
// Matches Unicode control codes & characters not in other categories:
|
||||
$cntrl = "\p{C}"; // Unicode-aware equivalent of "[:cntrl:]"
|
||||
|
||||
// Matches Unicode dashes & hyphens:
|
||||
$dash = "\p{Pd}";
|
||||
|
||||
// Matches Unicode digits:
|
||||
$digit = "\p{Nd}"; // Unicode-aware equivalent of "[:digit:]"
|
||||
|
||||
// Matches Unicode printing characters (excluding space):
|
||||
$graph = "^\p{C}\t\n\f\r\p{Z}"; // Unicode-aware equivalent of "[:graph:]"
|
||||
|
||||
// Matches Unicode lower case letters:
|
||||
$lower = "\p{Ll}"; // Unicode-aware equivalent of "[:lower:]"
|
||||
|
||||
// Matches Unicode printing characters (including space):
|
||||
$print = "\P{C}"; // same as "^\p{C}", Unicode-aware equivalent of "[:print:]"
|
||||
|
||||
// Matches Unicode punctuation (printing characters excluding letters & digits):
|
||||
$punct = "\p{P}"; // Unicode-aware equivalent of "[:punct:]"
|
||||
|
||||
// Matches Unicode whitespace (separating characters with no visual representation):
|
||||
$space = "\t\n\f\r\p{Z}"; // Unicode-aware equivalent of "[:space:]"
|
||||
|
||||
// Matches Unicode upper case letters:
|
||||
$upper = "\p{Lu}\p{Lt}"; // Unicode-aware equivalent of "[:upper:]"
|
||||
|
||||
// Matches Unicode "word" characters:
|
||||
$word = "_\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nd}"; // Unicode-aware equivalent of "[:word:]" (or "[:alnum:]" plus "_")
|
||||
|
||||
// Defines the PCRE pattern modifier(s) to be used in conjunction with the above variables:
|
||||
// More info: <http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php>
|
||||
$patternModifiers = "u"; // the "u" (PCRE_UTF8) pattern modifier causes PHP/PCRE to treat pattern strings as UTF-8
|
||||
|
||||
|
||||
// Converts Unicode upper case letters to their corresponding lower case letter:
|
||||
// TODO!
|
||||
$transtab_upper_lower = array(
|
||||
|
||||
|
||||
);
|
||||
|
||||
|
||||
// Converts Unicode lower case letters to their corresponding upper case letter:
|
||||
// TODO!
|
||||
$transtab_lower_upper = array(
|
||||
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
3348
includes/transtab_unicode_latex.inc.php
Normal file
3348
includes/transtab_unicode_latex.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
3337
includes/transtab_unicode_latin1.inc.php
Normal file
3337
includes/transtab_unicode_latin1.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
148
includes/transtab_unicode_refbase.inc.php
Normal file
148
includes/transtab_unicode_refbase.inc.php
Normal file
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/transtab_unicode_refbase.inc.php
|
||||
// Repository: $HeadURL$
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 11-Jun-08, 13:00
|
||||
// Modified: $Date: 2008-06-19 17:56:34 +0000 (Thu, 19 Jun 2008) $
|
||||
// $Author$
|
||||
// $Revision: 1146 $
|
||||
|
||||
// Search & replace patterns and functions for conversion from Unicode entities to refbase markup.
|
||||
// Search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes.
|
||||
|
||||
$transtab_unicode_refbase = array(
|
||||
|
||||
'/‰|/' => "[permil]", // ‰: <U2030> (per mille sign); : ?
|
||||
'/∞/' => "[infinity]", // <U221E> (infinity)
|
||||
'/α/' => "[alpha]",
|
||||
'/β/' => "[beta]",
|
||||
'/γ/' => "[gamma]",
|
||||
'/δ/' => "[delta]",
|
||||
'/ε/' => "[epsilon]",
|
||||
'/ζ/' => "[zeta]",
|
||||
'/η/' => "[eta]",
|
||||
'/θ/' => "[theta]",
|
||||
'/ι/' => "[iota]",
|
||||
'/κ/' => "[kappa]",
|
||||
'/λ/' => "[lambda]",
|
||||
'/μ/' => "[mu]",
|
||||
'/ν/' => "[nu]",
|
||||
'/ξ/' => "[xi]",
|
||||
'/ο/' => "[omicron]",
|
||||
'/π/' => "[pi]",
|
||||
'/ρ/' => "[rho]",
|
||||
'/ς/' => "[sigmaf]",
|
||||
'/σ/' => "[sigma]",
|
||||
'/τ/' => "[tau]",
|
||||
'/υ/' => "[upsilon]",
|
||||
'/φ/' => "[phi]",
|
||||
'/χ/' => "[chi]",
|
||||
'/ψ/' => "[psi]",
|
||||
'/ω/' => "[omega]",
|
||||
'/Α/' => "[Alpha]",
|
||||
'/Β/' => "[Beta]",
|
||||
'/Γ/' => "[Gamma]",
|
||||
'/Δ/' => "[Delta]",
|
||||
'/Ε/' => "[Epsilon]",
|
||||
'/Ζ/' => "[Zeta]",
|
||||
'/Η/' => "[Eta]",
|
||||
'/Θ/' => "[Theta]",
|
||||
'/Ι/' => "[Iota]",
|
||||
'/Κ/' => "[Kappa]",
|
||||
'/Λ/' => "[Lambda]",
|
||||
'/Μ/' => "[Mu]",
|
||||
'/Ν/' => "[Nu]",
|
||||
'/Ξ/' => "[Xi]",
|
||||
'/Ο/' => "[Omicron]",
|
||||
'/Π/' => "[Pi]",
|
||||
'/Ρ/' => "[Rho]",
|
||||
'/Σ/' => "[Sigma]",
|
||||
'/Τ/' => "[Tau]",
|
||||
'/Υ/' => "[Upsilon]",
|
||||
'/Φ/' => "[Phi]",
|
||||
'/Χ/' => "[Chi]",
|
||||
'/Ψ/' => "[Psi]",
|
||||
'/Ω/' => "[Omega]",
|
||||
"/((?:¹|²|³|⁴|⁵|⁶|⁷|⁸|⁹|⁰|⁺|⁻|⁼|⁽|⁾|ⁿ)+)/ie" => "unicodeSuperScriptToRefbase('\\1')", // function 'unicodeSuperScriptToRefbase()' will convert Unicode superscript entities to appropriate refbase superscript markup
|
||||
"/((?:₁|₂|₃|₄|₅|₆|₇|₈|₉|₀|₊|₋|₌|₍|₎)+)/ie" => "unicodeSubScriptToRefbase('\\1')", // function 'unicodeSubScriptToRefbase()' will convert Unicode subscript entities to appropriate refbase subscript markup
|
||||
// Note that, when matching superscript or subscript Unicode characters, we cannot use the double-byte characters within character classes
|
||||
// (like [¹²³⁴⁵⁶⁷⁸⁹⁰⁺⁻⁼⁽⁾ⁿ] or ([₁₂₃₄₅₆₇₈₉₀₊₋₌₍₎]) since this may cause the single-byte parts of these characters to be matched and replaced as well!
|
||||
|
||||
);
|
||||
|
||||
|
||||
$unicodeSuperScriptSearchReplaceActionsArray = array(
|
||||
|
||||
'/¹/' => "1", // <U00B9> (superscript one)
|
||||
'/²/' => "2", // <U00B2> (superscript two)
|
||||
'/³/' => "3", // <U00B3> (superscript three)
|
||||
'/⁴/' => "4", // <U2074> (superscript four)
|
||||
'/⁵/' => "5", // <U2075> (superscript five)
|
||||
'/⁶/' => "6", // <U2076> (superscript six)
|
||||
'/⁷/' => "7", // <U2077> (superscript seven)
|
||||
'/⁸/' => "8", // <U2078> (superscript eight)
|
||||
'/⁹/' => "9", // <U2079> (superscript nine)
|
||||
'/⁰/' => "0", // <U2070> (superscript zero)
|
||||
'/⁺/' => "+", // <U207A> (superscript plus sign)
|
||||
'/⁻/' => "-", // <U207B> (superscript minus)
|
||||
'/⁼/' => "=", // <U207C> (superscript equals sign)
|
||||
'/⁽/' => "(", // <U207D> (superscript left parenthesis)
|
||||
'/⁾/' => ")", // <U207E> (superscript right parenthesis)
|
||||
'/ⁿ/' => "n", // <U207F> (superscript latin small letter n)
|
||||
|
||||
);
|
||||
|
||||
|
||||
$unicodeSubScriptSearchReplaceActionsArray = array(
|
||||
|
||||
'/₁/' => "1", // <U2081> (subscript one)
|
||||
'/₂/' => "2", // <U2082> (subscript two)
|
||||
'/₃/' => "3", // <U2083> (subscript three)
|
||||
'/₄/' => "4", // <U2084> (subscript four)
|
||||
'/₅/' => "5", // <U2085> (subscript five)
|
||||
'/₆/' => "6", // <U2086> (subscript six)
|
||||
'/₇/' => "7", // <U2087> (subscript seven)
|
||||
'/₈/' => "8", // <U2088> (subscript eight)
|
||||
'/₉/' => "9", // <U2089> (subscript nine)
|
||||
'/₀/' => "0", // <U2080> (subscript zero)
|
||||
'/₊/' => "+", // <U208A> (subscript plus sign)
|
||||
'/₋/' => "-", // <U208B> (subscript minus)
|
||||
'/₌/' => "=", // <U208C> (subscript equals sign)
|
||||
'/₍/' => "(", // <U208D> (subscript left parenthesis)
|
||||
'/₎/' => ")", // <U208E> (subscript right parenthesis)
|
||||
|
||||
);
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Converts Unicode superscript entities to appropriate refbase superscript markup:
|
||||
function unicodeSuperScriptToRefbase($sourceString)
|
||||
{
|
||||
global $unicodeSuperScriptSearchReplaceActionsArray;
|
||||
|
||||
$sourceString = searchReplaceText($unicodeSuperScriptSearchReplaceActionsArray, $sourceString, true); // function 'searchReplaceText()' is defined in 'include.inc.php'
|
||||
|
||||
return "[super:" . $sourceString . "]";
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Converts Unicode subscript entities to appropriate refbase subscript markup:
|
||||
function unicodeSubScriptToRefbase($sourceString)
|
||||
{
|
||||
global $unicodeSubScriptSearchReplaceActionsArray;
|
||||
|
||||
$sourceString = searchReplaceText($unicodeSubScriptSearchReplaceActionsArray, $sourceString, true); // function 'searchReplaceText()' is defined in 'include.inc.php'
|
||||
|
||||
return "[sub:" . $sourceString . "]";
|
||||
}
|
||||
?>
|
||||
73
includes/unapi.inc.php
Normal file
73
includes/unapi.inc.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/unapi.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/unapi.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 15-Jul-06, 15:25
|
||||
// Modified: $Date: 2015-01-08 00:03:12 +0000 (Thu, 08 Jan 2015) $
|
||||
// $Author: karnesky $
|
||||
// $Revision: 1400 $
|
||||
|
||||
// This include file contains functions that deal with unAPI response XML.
|
||||
// Requires ActiveLink PHP XML Package, which is available under the GPL from:
|
||||
// <http://www.active-link.com/software/>. See 'unapi.php' for more info.
|
||||
|
||||
|
||||
// Incorporate some include files:
|
||||
include_once 'includes/webservice.inc.php'; // include functions that are commonly used with the refbase webservices
|
||||
|
||||
// Import the ActiveLink Packages
|
||||
require_once("classes/include.php");
|
||||
import("org.active-link.xml.XML");
|
||||
import("org.active-link.xml.XMLDocument");
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// return an unAPI XML response if the unAPI request issued either of the following:
|
||||
// - http://.../refs/unapi.php
|
||||
// - http://.../refs/unapi.php?id=http://polaris.ipoe.uni-kiel.de/refs/show.php?record=1
|
||||
function unapiExplainResponse($unapiID)
|
||||
{
|
||||
global $contentTypeCharset; // these variables are specified in 'ini.inc.php'
|
||||
|
||||
$unapiCollectionDoc = new XMLDocument();
|
||||
$unapiCollectionDoc->setEncoding($contentTypeCharset);
|
||||
|
||||
$unapiCollection = new XML("formats");
|
||||
|
||||
if (!empty($unapiID)) //TODO: we may want to ensure the unapi we are using does, indeed, point back to a record or return an error.
|
||||
$unapiCollection->setTagAttribute("id", encodeHTML($unapiID));
|
||||
|
||||
// Recommended format names are given at <http://unapi.stikipad.com/unapi/show/existing+formats>
|
||||
// TODO: add 'ISI', 'ODF XML' and 'Word XML'
|
||||
addNewBranch($unapiCollection, "format", array("name" => "bibtex", "type" => "text/plain", "docs" => "http://en.wikipedia.org/wiki/BibTeX"), ""); // function 'addNewBranch()' is defined in 'webservice.inc.php'
|
||||
addNewBranch($unapiCollection, "format", array("name" => "endnote", "type" => "text/plain", "docs" => "http://www.ecst.csuchico.edu/~jacobsd/bib/formats/endnote.html"), "");
|
||||
addNewBranch($unapiCollection, "format", array("name" => "ris", "type" => "text/plain", "docs" => "http://www.adeptscience.co.uk/kb/article/A626"), "");
|
||||
addNewBranch($unapiCollection, "format", array("name" => "atom", "type" => "application/atom+xml", "docs" => "http://www.atomenabled.org/developers/syndication/"), "");
|
||||
addNewBranch($unapiCollection, "format", array("name" => "mods", "type" => "application/xml", "docs" => "http://www.loc.gov/standards/mods/"), "");
|
||||
addNewBranch($unapiCollection, "format", array("name" => "oai_dc", "type" => "application/xml", "docs" => "http://www.openarchives.org/OAI/openarchivesprotocol.html#dublincore"), "");
|
||||
addNewBranch($unapiCollection, "format", array("name" => "srw_dc", "type" => "application/xml", "docs" => "http://www.loc.gov/standards/sru/"), "");
|
||||
addNewBranch($unapiCollection, "format", array("name" => "srw_mods", "type" => "application/xml", "docs" => "http://www.loc.gov/standards/sru/"), "");
|
||||
addNewBranch($unapiCollection, "format", array("name" => "html", "type" => "text/html", "docs" => "http://www.w3.org/MarkUp/"), "");
|
||||
addNewBranch($unapiCollection, "format", array("name" => "rtf", "type" => "application/rtf", "docs" => "http://en.wikipedia.org/wiki/Rich_Text_Format"), "");
|
||||
addNewBranch($unapiCollection, "format", array("name" => "pdf", "type" => "application/pdf", "docs" => "http://partners.adobe.com/public/developer/pdf/index_reference.html"), "");
|
||||
addNewBranch($unapiCollection, "format", array("name" => "latex", "type" => "application/x-latex", "docs" => "http://en.wikipedia.org/wiki/LaTeX"), "");
|
||||
addNewBranch($unapiCollection, "format", array("name" => "markdown", "type" => "text/plain", "docs" => "http://daringfireball.net/projects/markdown/"), "");
|
||||
addNewBranch($unapiCollection, "format", array("name" => "text", "type" => "text/plain"), "");
|
||||
|
||||
$unapiCollectionDoc->setXML($unapiCollection);
|
||||
$unapiCollectionString = $unapiCollectionDoc->getXMLString();
|
||||
|
||||
return $unapiCollectionString;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
?>
|
||||
688
includes/webservice.inc.php
Normal file
688
includes/webservice.inc.php
Normal file
@@ -0,0 +1,688 @@
|
||||
<?php
|
||||
// Project: Web Reference Database (refbase) <http://www.refbase.net>
|
||||
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
|
||||
// original author(s).
|
||||
//
|
||||
// This code is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
|
||||
// License for more details.
|
||||
//
|
||||
// File: ./includes/webservice.inc.php
|
||||
// Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/webservice.inc.php $
|
||||
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
|
||||
//
|
||||
// Created: 04-Feb-06, 22:02
|
||||
// Modified: $Date: 2012-02-27 20:25:30 +0000 (Mon, 27 Feb 2012) $
|
||||
// $Author: msteffens $
|
||||
// $Revision: 1337 $
|
||||
|
||||
// This include file contains functions that are used in conjunction with the refbase webservices.
|
||||
// Requires ActiveLink PHP XML Package, which is available under the GPL from:
|
||||
// <http://www.active-link.com/software/>. See 'sru.php' and 'opensearch.php' for more info.
|
||||
|
||||
|
||||
// Import the ActiveLink Packages
|
||||
require_once("classes/include.php");
|
||||
import("org.active-link.xml.XML");
|
||||
import("org.active-link.xml.XMLDocument");
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Add a new XML branch, optionally with an attribute and tag content:
|
||||
//
|
||||
// TODO: this function should also accept arrays to add multiple content tags
|
||||
function addNewBranch(&$thisBranch, $elementName, $elementAttributeArray, $elementContent)
|
||||
{
|
||||
$newBranch = new XMLBranch($elementName);
|
||||
|
||||
if (!empty($elementAttributeArray))
|
||||
foreach ($elementAttributeArray as $elementAttributeKey => $elementAttributeValue)
|
||||
$newBranch->setTagAttribute($elementAttributeKey, $elementAttributeValue);
|
||||
|
||||
if (!empty($elementContent))
|
||||
$newBranch->setTagContent($elementContent);
|
||||
|
||||
$thisBranch->addXMLBranch($newBranch);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Parse CQL query:
|
||||
// This function parses a CQL query into its elements (context set, index, relation and search term(s)),
|
||||
// builds appropriate SQL search terms and returns a hierarchical array containing the converted search terms
|
||||
// (this array, in turn, gets merged into a full SQL WHERE clause by function 'appendToWhereClause()' in
|
||||
// 'include.inc.php')
|
||||
//
|
||||
// NOTE: we don't provide a full CQL parser here but will (for now) concentrate on a rather limited feature
|
||||
// set that makes sense in conjunction with refbase. However, future versions should employ far better
|
||||
// CQL parsing logic.
|
||||
//
|
||||
// TODO: the special index 'main_fields' should be mapped to the user's preferred list of "main fields"
|
||||
function parseCQL($sruVersion, $sruQuery, $operation = "")
|
||||
{
|
||||
global $alnum, $alpha, $cntrl, $dash, $digit, $graph, $lower, $print, $punct, $space, $upper, $word, $patternModifiers; // defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
|
||||
|
||||
// map CQL indexes to refbase field names:
|
||||
$indexNamesArray = mapCQLIndexes();
|
||||
|
||||
$searchArray = array(); // intialize array that will hold information about context set, index name, relation and search value
|
||||
$searchSubArray1 = array();
|
||||
|
||||
// --------------------------------
|
||||
|
||||
if (!empty($sruQuery))
|
||||
{
|
||||
// check for presence of context set/index name and any of the main relations:
|
||||
if (!preg_match('/^[^\" <>=]+( +(all|any|exact|within) +| *(<>|<=|>=|<|>|=) *)/', $sruQuery))
|
||||
{
|
||||
// if no context set/index name and relation was given we'll add meaningful defaults:
|
||||
if (preg_match("/^suggest$/i", $operation))
|
||||
$sruQuery = "main_fields all " . $sruQuery; // for OpenSearch search suggestions, we use the special 'main_fields' index by default
|
||||
else
|
||||
$sruQuery = "cql.serverChoice all " . $sruQuery; // otherwise we currently use 'cql.serverChoice' (since 'main_fields' isn't yet supported for regular OpenSearch queries)
|
||||
}
|
||||
|
||||
// extract the context set:
|
||||
if (preg_match('/^([^\" <>=.]+)\./', $sruQuery))
|
||||
$contextSet = preg_replace('/^([^\" <>=.]+)\..*/', '\\1', $sruQuery);
|
||||
else
|
||||
$contextSet = ""; // use the default context set
|
||||
|
||||
// extract the index:
|
||||
$indexName = preg_replace('/^(?:[^\" <>=.]+\.)?([^\" <>=.]+).*/', '\\1', $sruQuery);
|
||||
|
||||
// ----------------
|
||||
|
||||
// return a fatal diagnostic if the CQL query does contain an unrecognized 'set.index' identifier:
|
||||
// (a) verify that the given context set (if any) is recognized:
|
||||
if (!empty($contextSet))
|
||||
{
|
||||
$contextSetIndexConnector = ".";
|
||||
$contextSetLabel = "context set '" . $contextSet . "'";
|
||||
|
||||
if (!preg_match("/^(dc|bath|rec|bib|cql)$/", $contextSet))
|
||||
{
|
||||
returnDiagnostic(15, $contextSet); // unsupported context set (function 'returnDiagnostic()' is defined in 'opensearch.php' and 'sru.php')
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$contextSetIndexConnector = "";
|
||||
$contextSetLabel = "empty context set";
|
||||
}
|
||||
|
||||
// (b) verify that the given 'set.index' term is recognized:
|
||||
if (!isset($indexNamesArray[$contextSet . $contextSetIndexConnector . $indexName]))
|
||||
{
|
||||
if (isset($indexNamesArray[$indexName]) OR isset($indexNamesArray["dc." . $indexName]) OR isset($indexNamesArray["bath." . $indexName]) OR isset($indexNamesArray["rec." . $indexName]) OR isset($indexNamesArray["bib." . $indexName]) OR isset($indexNamesArray["cql." . $indexName])) // this may be clumsy but I don't know any better, right now
|
||||
{
|
||||
returnDiagnostic(10, "Unsupported combination of " . $contextSetLabel . " with index '" . $indexName . "'"); // unsupported combination of context set & index
|
||||
}
|
||||
else
|
||||
{
|
||||
returnDiagnostic(16, $indexName); // unsupported index
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
// ----------------
|
||||
|
||||
// extract the main relation (relation modifiers aren't supported yet!):
|
||||
$mainRelation = preg_replace('/^[^\" <>=]+( +(all|any|exact|within) +| *(<>|<=|>=|<|>|=) *).*/', '\\1', $sruQuery);
|
||||
// remove any runs of leading or trailing whitespace:
|
||||
$mainRelation = trim($mainRelation);
|
||||
|
||||
// ----------------
|
||||
|
||||
// extract the search term:
|
||||
$searchTerm = preg_replace('/^[^\" <>=]+(?: +(?:all|any|exact|within) +| *(?:<>|<=|>=|<|>|=) *)(.*)/', '\\1', $sruQuery);
|
||||
|
||||
// remove slashes from search term if 'magic_quotes_gpc = On':
|
||||
$searchTerm = stripSlashesIfMagicQuotes($searchTerm); // function 'stripSlashesIfMagicQuotes()' is defined in 'include.inc.php'
|
||||
|
||||
// remove any leading or trailing quotes from the search term:
|
||||
// (note that multiple query parts connected with boolean operators aren't supported yet!)
|
||||
$searchTerm = preg_replace('/^\"/', '', $searchTerm);
|
||||
$searchTerm = preg_replace('/\"$/', '', $searchTerm);
|
||||
|
||||
// OpenSearch search suggestions ('$operation=suggest'): since CQL matches full words (not sub-strings),
|
||||
// we need to make sure that every search term ends with the '*' masking character:
|
||||
if (preg_match("/^suggest$/i", $operation) AND ($mainRelation != "exact"))
|
||||
$searchTerm = preg_replace("/([$word]+)(?![?*^])/$patternModifiers", "\\1*", $searchTerm);
|
||||
|
||||
// escape meta characters (including '/' that is used as delimiter for the PCRE replace functions below and which gets passed as second argument):
|
||||
$searchTerm = preg_quote($searchTerm, "/"); // escape special regular expression characters: . \ + * ? [ ^ ] $ ( ) { } = ! < > | :
|
||||
|
||||
// account for CQL anchoring ('^') and masking ('*' and '?') characters:
|
||||
// NOTE: in the code block above we quote everything to escape possible meta characters,
|
||||
// so all special chars in the block below have to be matched in their escaped form!
|
||||
// (The expression '\\\\' in the patterns below describes only *one* backslash! -> '\'.
|
||||
// The reason for this is that before the regex engine can interpret the \\ into \, PHP interprets it.
|
||||
// Thus, you have to escape your backslashes twice: once for PHP, and once for the regex engine.)
|
||||
//
|
||||
// more info about masking characters in CQL: <http://zing.z3950.org/cql/intro.html#6>
|
||||
// more info about word anchoring in CQL: <http://zing.z3950.org/cql/intro.html#6.1>
|
||||
|
||||
// recognize any anchor at the beginning of a search term (like '^foo'):
|
||||
// (in CQL, a word beginning with ^ must be the first in its field)
|
||||
$searchTerm = preg_replace('/(^| )\\\\\^/', '\\1^', $searchTerm);
|
||||
|
||||
// convert any anchor at the end of a search term (like 'foo^') to the correct MySQL variant ('foo$'):
|
||||
// (in CQL, a word ending with ^ must be the last in its field)
|
||||
$searchTerm = preg_replace('/\\\\\^( |$)/', '$\\1', $searchTerm);
|
||||
|
||||
// recognize any masking ('*' and '?') characters:
|
||||
// Note: by "character" we do refer to *word* characters here, i.e., any character that is not a space or punctuation character (see below);
|
||||
// however, I'm not sure if the masking characters '*' and '?' should also include non-word characters!
|
||||
$searchTerm = preg_replace('/(?<!\\\\)\\\\\*/', '[^[:space:][:punct:]]*', $searchTerm); // a single asterisk ('*') is used to mask zero or more characters
|
||||
$searchTerm = preg_replace('/(?<!\\\\)\\\\\?/', '[^[:space:][:punct:]]', $searchTerm); // a single question mark ('?') is used to mask a single character, thus N consecutive question-marks means mask N characters
|
||||
|
||||
// ----------------
|
||||
|
||||
// construct the WHERE clause:
|
||||
$whereClausePart = $indexNamesArray[$contextSet . $contextSetIndexConnector . $indexName]; // start WHERE clause with field name
|
||||
|
||||
if ($mainRelation == "all") // matches full words (not sub-strings); 'all' means "all of these words"
|
||||
{
|
||||
if (preg_match("/ /", $searchTerm))
|
||||
{
|
||||
$searchTermArray = preg_split("/ +/", $searchTerm);
|
||||
|
||||
foreach ($searchTermArray as $searchTermItem)
|
||||
$whereClauseSubPartsArray[] = " RLIKE " . quote_smart("(^|[[:space:][:punct:]])" . $searchTermItem . "([[:space:][:punct:]]|$)");
|
||||
|
||||
// NOTE: For word-matching relations (like 'all', 'any' or '=') we could also use word boundaries which would be more (too?) restrictive:
|
||||
//
|
||||
// [[:<:]] , [[:>:]]
|
||||
//
|
||||
// They match the beginning and end of words, respectively. A word is a sequence of word characters that is not preceded by or
|
||||
// followed by word characters. A word character is an alphanumeric character in the alnum class or an underscore (_).
|
||||
|
||||
$whereClausePart .= implode(" AND " . $indexNamesArray[$contextSet . $contextSetIndexConnector . $indexName], $whereClauseSubPartsArray);
|
||||
}
|
||||
else
|
||||
$whereClausePart .= " RLIKE " . quote_smart("(^|[[:space:][:punct:]])" . $searchTerm . "([[:space:][:punct:]]|$)");
|
||||
}
|
||||
|
||||
elseif ($mainRelation == "any") // matches full words (not sub-strings); 'any' means "any of these words"
|
||||
{
|
||||
$searchTerm = splitAndMerge("/ +/", "|", $searchTerm); // function 'splitAndMerge()' is defined in 'include.inc.php'
|
||||
$whereClausePart .= " RLIKE " . quote_smart("(^|[[:space:][:punct:]])(" . $searchTerm . ")([[:space:][:punct:]]|$)");
|
||||
}
|
||||
|
||||
elseif ($mainRelation == "exact") // 'exact' is used for exact string matching, i.e., it matches field contents exactly
|
||||
$whereClausePart .= " = " . quote_smart($searchTerm);
|
||||
|
||||
elseif ($mainRelation == "within") // matches a range (i.e. requires two space-separated dimensions)
|
||||
{
|
||||
if (preg_match("/[^ ]+ [^ ]+/", $searchTerm))
|
||||
{
|
||||
$searchTermArray = preg_split("/ +/", $searchTerm);
|
||||
|
||||
$whereClausePart .= " >= " . quote_smart($searchTermArray[0]) . " AND " . $indexNamesArray[$contextSet . $contextSetIndexConnector . $indexName] . " <= " . quote_smart($searchTermArray[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
returnDiagnostic(36, "Search term requires two space-separated dimensions. Example: dc.date within \"2004 2005\"");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
elseif ($mainRelation == "=") // matches full words (not sub-strings); '=' is used for word adjacency, the words appear in that order with no others intervening
|
||||
$whereClausePart .= " RLIKE " . quote_smart("(^|[[:space:][:punct:]])" . $searchTerm . "([[:space:][:punct:]]|$)");
|
||||
|
||||
elseif ($mainRelation == "<>") // does this also match full words (and not sub-strings) ?:-/
|
||||
$whereClausePart .= " NOT RLIKE " . quote_smart("(^|[[:space:][:punct:]])" . $searchTerm . "([[:space:][:punct:]]|$)");
|
||||
|
||||
elseif ($mainRelation == "<")
|
||||
$whereClausePart .= " < " . quote_smart($searchTerm);
|
||||
|
||||
elseif ($mainRelation == "<=")
|
||||
$whereClausePart .= " <= " . quote_smart($searchTerm);
|
||||
|
||||
elseif ($mainRelation == ">")
|
||||
$whereClausePart .= " > " . quote_smart($searchTerm);
|
||||
|
||||
elseif ($mainRelation == ">=")
|
||||
$whereClausePart .= " >= " . quote_smart($searchTerm);
|
||||
|
||||
$searchSubArray1[] = array("_boolean" => "",
|
||||
"_query" => $whereClausePart);
|
||||
}
|
||||
|
||||
// --------------------------------
|
||||
|
||||
else // '$sruQuery' was empty -> return all records:
|
||||
{
|
||||
$searchSubArray1[] = array("_boolean" => "",
|
||||
"_query" => "serial RLIKE " . quote_smart(".+"));
|
||||
}
|
||||
|
||||
// --------------------------------
|
||||
|
||||
if (!empty($searchSubArray1))
|
||||
$searchArray[] = array("_boolean" => "",
|
||||
"_query" => $searchSubArray1);
|
||||
|
||||
|
||||
return $searchArray;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Add a metadata element to the given object:
|
||||
// As an example, the function call 'addMetaElement($object, "dc", "title", array("lang" => "en"), "this is a title")'
|
||||
// would add '<dc:title lang="en">this is a title</dc:title>' as a new branch to the given '$object'.
|
||||
//
|
||||
// TODO: expand function so that it can be also used for formats other than XML (e.g. HTML)
|
||||
function addMetaElement(&$object, $namespace, $elementName, $elementAttributeArray, $elementContent, $elementType = "", $format = "xml")
|
||||
{
|
||||
$addStatus = false;
|
||||
|
||||
if (!empty($elementName) AND !empty($elementContent))
|
||||
{
|
||||
// Preprocess element contents (if necessary):
|
||||
|
||||
// - 'creator', 'contributor':
|
||||
if (preg_match("/^(creator|contributor)$/", $elementName))
|
||||
$elementContent = getPersons($elementContent); // get an array of all creators (i.e. authors) or contributors (e.g. editors)
|
||||
|
||||
// - 'identifier':
|
||||
// NOTE: should we support any other identifiers from the "info" URI scheme?
|
||||
// see <http://info-uri.info/registry/OAIHandler?verb=ListRecords&metadataPrefix=oai_dc>
|
||||
|
||||
// - DOI:
|
||||
elseif ($elementName == "identifier" AND $elementType == "doi")
|
||||
$elementContent = "info:doi/" . $elementContent;
|
||||
|
||||
// - PMID:
|
||||
elseif ($elementName == "identifier" AND $elementType == "pmid")
|
||||
{
|
||||
// extract any PubMed ID from the given '$elementContent':
|
||||
// NOTE: should this better be done in the calling function?
|
||||
$pubmedID = preg_replace("/.*?PMID *: *(\d+).*/i", "\\1", $elementContent);
|
||||
$elementContent = "info:pmid/" . $pubmedID;
|
||||
}
|
||||
|
||||
// - arXiv:
|
||||
elseif ($elementName == "identifier" AND $elementType == "arxiv")
|
||||
{
|
||||
// extract any arXiv ID from the given '$elementContent':
|
||||
// NOTE: see note for PMID
|
||||
$arxivID = preg_replace("/.*?arXiv *: *([^ ;]+).*/i", "\\1", $elementContent);
|
||||
$elementContent = "info:arxiv/" . $arxivID;
|
||||
}
|
||||
|
||||
// - ISBN:
|
||||
// NOTE: we could also output the ISBN or ISSN as a value URI within a
|
||||
// 'dcterms:isPartOf' relation property, e.g.:
|
||||
// '<dcterms:isPartOf>urn:ISSN:0740-8188</dcterms:isPartOf>'
|
||||
elseif ($elementName == "identifier" AND $elementType == "isbn")
|
||||
$elementContent = "urn:ISBN:" . $elementContent;
|
||||
|
||||
// - ISSN:
|
||||
// NOTE: see note for ISBN above
|
||||
elseif ($elementName == "identifier" AND $elementType == "issn")
|
||||
$elementContent = "urn:ISSN:" . $elementContent;
|
||||
|
||||
// - OpenURL:
|
||||
elseif ($elementName == "identifier" AND $elementType == "openurl")
|
||||
{
|
||||
if (!preg_match("/^openurl:/", $elementContent))
|
||||
$elementContent = "openurl:" . $elementContent; // use "openurl:" prefix if doesn't already exist in the given OpenURL
|
||||
}
|
||||
|
||||
// - URL:
|
||||
// NOTE: the 'url:' prefix is non-standard, is there a better way to
|
||||
// include a permanent URL for a record in Simple Dublin Core XML output?
|
||||
elseif ($elementName == "identifier" AND $elementType == "url")
|
||||
$elementContent = "url:" . $elementContent;
|
||||
|
||||
// - Cite key:
|
||||
// NOTE: the 'citekey:' prefix is non-standard, is there a better way to
|
||||
// include the cite key in Simple Dublin Core XML output?
|
||||
elseif ($elementName == "identifier" AND $elementType == "citekey")
|
||||
$elementContent = "citekey:" . $elementContent;
|
||||
|
||||
// - Bibliographic citation:
|
||||
// NOTE: the 'citation:' prefix is non-standard, is there a better way to
|
||||
// include the bibliographic citation in Simple Dublin Core XML output?
|
||||
elseif ($elementName == "identifier" AND $elementType == "citation")
|
||||
$elementContent = "citation:" . $elementContent;
|
||||
|
||||
// - 'source':
|
||||
|
||||
// - Series:
|
||||
// NOTE: the 'series:' prefix is non-standard, is there a better way to
|
||||
// include series information in Simple Dublin Core XML output?
|
||||
elseif ($elementName == "source" AND $elementType == "series")
|
||||
$elementContent = "series:" . $elementContent;
|
||||
|
||||
// - ISSN:
|
||||
// NOTE: see note for ISBN above
|
||||
elseif ($elementName == "source" AND $elementType == "issn")
|
||||
$elementContent = "urn:ISSN:" . $elementContent;
|
||||
|
||||
// - 'relation':
|
||||
|
||||
// - URL:
|
||||
// NOTE: the 'url:' prefix is non-standard, is there a better way to
|
||||
// include a permanent URL for a record in Simple Dublin Core XML output?
|
||||
elseif ($elementName == "relation" AND $elementType == "url")
|
||||
$elementContent = "url:" . $elementContent;
|
||||
|
||||
// - FILE:
|
||||
// NOTE: the 'file:' prefix is non-standard, is there a better way to
|
||||
// include an URL to a file representing this record in Simple Dublin Core XML output?
|
||||
elseif ($elementName == "relation" AND $elementType == "file")
|
||||
$elementContent = "file:" . $elementContent;
|
||||
|
||||
// - 'type':
|
||||
elseif ($elementName == "type")
|
||||
{
|
||||
if (preg_match("/^((Simple|oai)?[- _]?(dc|Dublin[- _]?Core)[- _]?(terms)?)$/i", $namespace))
|
||||
{
|
||||
// Map refbase types to the corresponding eprint/resource types suggested for Simple
|
||||
// Dublin Core (<http://eprints-uk.rdn.ac.uk/project/docs/simpledc-guidelines/#type>):
|
||||
$dcTypesArray = mapDCTypes();
|
||||
|
||||
// NOTE: for '$elementName="type"', variable '$elementType' is supposed to contain the
|
||||
// thesis type from the refbase 'thesis' field (e.g. "Ph.D. thesis")
|
||||
if (isset($dcTypesArray[$elementContent]) AND empty($elementType))
|
||||
$elementContent = $dcTypesArray[$elementContent];
|
||||
elseif (!empty($elementType))
|
||||
$elementContent = $dcTypesArray["Thesis"];
|
||||
}
|
||||
}
|
||||
|
||||
// - 'subject':
|
||||
if ($elementName == "subject")
|
||||
$elementContent = preg_split("/\s*;\s*/", $elementContent, -1, PREG_SPLIT_NO_EMPTY); // get an array of all keywords
|
||||
|
||||
// - 'language':
|
||||
// TODO: convert to ISO notation (i.e. "en" instead of "English", etc)
|
||||
// see <http://www.loc.gov/standards/iso639-2/php/code_list.php>
|
||||
if ($elementName == "language")
|
||||
$elementContent = preg_split("/\s*[;,]\s*/", $elementContent, -1, PREG_SPLIT_NO_EMPTY); // get an array of all languages
|
||||
|
||||
|
||||
// Prefix element name with given namespace:
|
||||
if (!empty($namespace))
|
||||
$elementName = $namespace . ":" . $elementName;
|
||||
|
||||
// Add metadata element(s) to the given object:
|
||||
if (is_array($elementContent)) // add each array item as a new element:
|
||||
{
|
||||
foreach ($elementContent as $singleElement)
|
||||
addNewBranch($object, $elementName, $elementAttributeArray, $singleElement);
|
||||
}
|
||||
else // add string in '$elementContent' as a new element:
|
||||
addNewBranch($object, $elementName, $elementAttributeArray, $elementContent);
|
||||
|
||||
|
||||
$addStatus = true;
|
||||
}
|
||||
|
||||
|
||||
return $addStatus;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Split a string of person names (authors/editors) into an array:
|
||||
function getPersons($personString, $standardizePersonNames = true, $betweenNamesDelim = "/ *; */", $nameGivenDelim = "/ *, */", $newBetweenGivensDelim = ".")
|
||||
{
|
||||
if ($standardizePersonNames)
|
||||
{
|
||||
// NOTE: We standardize person names (e.g. add dots between initials if missing) in an attempt to adhere to
|
||||
// the recommendations given at <http://eprints-uk.rdn.ac.uk/project/docs/simpledc-guidelines/#creator>
|
||||
//
|
||||
// Call the 'reArrangeAuthorContents()' function (defined in 'include.inc.php') in order to re-order contents of the author field. Required Parameters:
|
||||
// 1. input: contents of the author field
|
||||
// 2. input: boolean value that specifies whether the author's family name comes first (within one author) in the source string
|
||||
// ('true' means that the family name is followed by the given name (or initials), 'false' if it's the other way around)
|
||||
//
|
||||
// 3. input: pattern describing old delimiter that separates different authors
|
||||
// 4. output: for all authors except the last author: new delimiter that separates different authors
|
||||
// 5. output: for the last author: new delimiter that separates the last author from all other authors
|
||||
//
|
||||
// 6. input: pattern describing old delimiter that separates author name & initials (within one author)
|
||||
// 7. output: for the first author: new delimiter that separates author name & initials (within one author)
|
||||
// 8. output: for all authors except the first author: new delimiter that separates author name & initials (within one author)
|
||||
// 9. output: new delimiter that separates multiple initials (within one author)
|
||||
// 10. output: for the first author: boolean value that specifies if initials go *before* the author's name ['true'], or *after* the author's name ['false'] (which is the default in the db)
|
||||
// 11. output: for all authors except the first author: boolean value that specifies if initials go *before* the author's name ['true'], or *after* the author's name ['false'] (which is the default in the db)
|
||||
// 12. output: boolean value that specifies whether an author's full given name(s) shall be shortened to initial(s)
|
||||
//
|
||||
// 13. output: if the total number of authors is greater than the given number (integer >= 1), only the number of authors given in (14) will be included in the citation along with the string given in (15); keep empty if all authors shall be returned
|
||||
// 14. output: number of authors (integer >= 1) that is included in the citation if the total number of authors is greater than the number given in (13); keep empty if not applicable
|
||||
// 15. output: string that's appended to the number of authors given in (14) if the total number of authors is greater than the number given in (13); the actual number of authors can be printed by including '__NUMBER_OF_AUTHORS__' (without quotes) within the string
|
||||
//
|
||||
// 16. output: boolean value that specifies whether the re-ordered string shall be returned with higher ASCII chars HTML encoded
|
||||
$personString = reArrangeAuthorContents($personString, // 1.
|
||||
true, // 2.
|
||||
$betweenNamesDelim, // 3.
|
||||
"; ", // 4.
|
||||
"; ", // 5.
|
||||
$nameGivenDelim, // 6.
|
||||
", ", // 7.
|
||||
", ", // 8.
|
||||
$newBetweenGivensDelim, // 9.
|
||||
false, // 10.
|
||||
false, // 11.
|
||||
true, // 12.
|
||||
"", // 13.
|
||||
"", // 14.
|
||||
"", // 15.
|
||||
false); // 16.
|
||||
|
||||
$betweenNamesDelim = "/\s*;\s*/";
|
||||
}
|
||||
|
||||
$nameArray = array();
|
||||
|
||||
if (!preg_match("#^/.*/$#", $betweenNamesDelim))
|
||||
$betweenNamesDelim = "/" . $betweenNamesDelim . "/"; // add search pattern delimiters
|
||||
|
||||
$nameArray = preg_split($betweenNamesDelim, $personString, -1, PREG_SPLIT_NO_EMPTY); // get a list of all authors/editors
|
||||
|
||||
|
||||
return $nameArray;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Map CQL indexes to refbase field names:
|
||||
function mapCQLIndexes()
|
||||
{
|
||||
// TODO: - add support for the OAI indexes 'oai.identifier' and 'oai.datestamp'
|
||||
// - the CQL indexes 'creationDate' and 'lastModificationDate'
|
||||
// contain both date & time info so this needs to be parsed into two
|
||||
// refbase fields (which isn't done yet!)
|
||||
// - if no context set & index name are given in the query, we should search
|
||||
// the user's preferred list of "main fields" by default! (cql.serverChoice)
|
||||
$indexNamesArray = array("dc.creator" => "author", // "CQL context_set.index_name" => "refbase field name"
|
||||
"dc.title" => "title",
|
||||
"dc.date" => "year",
|
||||
"dc.language" => "language",
|
||||
"dc.description" => "abstract",
|
||||
"dc.contributor" => "editor",
|
||||
"dc.subject" => "keywords",
|
||||
"dc.format" => "medium",
|
||||
"dc.type" => "type",
|
||||
"dc.publisher" => "publisher",
|
||||
"dc.coverage" => "area",
|
||||
|
||||
// "bath.name" => "author",
|
||||
// "bath.topicalSubject" => "keywords",
|
||||
"bath.isbn" => "isbn",
|
||||
"bath.issn" => "issn",
|
||||
"bath.corporateName" => "corporate_author",
|
||||
"bath.conferenceName" => "conference",
|
||||
"bath.notes" => "notes",
|
||||
|
||||
"rec.identifier" => "serial",
|
||||
"rec.creationDate" => "created_date-created_time", // see TODO note above
|
||||
"rec.creationAgentName" => "created_by",
|
||||
"rec.lastModificationDate" => "modified_date-modified_time", // see TODO note above
|
||||
"rec.lastModificationAgentName" => "modified_by",
|
||||
|
||||
"bib.citekey" => "cite_key",
|
||||
|
||||
"oai.identifier" => "serial",
|
||||
// "oai.datestamp" => "modified_date-modified_time", // see TODO note above (same as 'rec.lastModificationDate')
|
||||
|
||||
"cql.serverChoice" => "keywords", // TODO: the special index 'main_fields' should resolve to 'cql.serverChoice', and that, in turn, should resolve to the user's preferred list of "main fields";
|
||||
// alternatively, function 'parseCQL()' could map 'main_fields' to the user's preferred list of "main fields" -- and 'cql.serverChoice' would just resolve to a single field (as specified here)
|
||||
"main_fields" => "main_fields", // NOTE: the special index 'main_fields' currently only works for OpenSearch search suggestions, otherwise we'll fall back to 'cql.serverChoice'
|
||||
|
||||
"author" => "author", // for indexes that have no public context set we simply accept refbase field names
|
||||
"title" => "title",
|
||||
"year" => "year",
|
||||
"publication" => "publication",
|
||||
"abbrev_journal" => "abbrev_journal",
|
||||
"volume" => "volume",
|
||||
"issue" => "issue",
|
||||
"pages" => "pages",
|
||||
|
||||
"address" => "address",
|
||||
"corporate_author" => "corporate_author",
|
||||
"keywords" => "keywords",
|
||||
"abstract" => "abstract",
|
||||
"publisher" => "publisher",
|
||||
"place" => "place",
|
||||
"editor" => "editor",
|
||||
"language" => "language",
|
||||
"summary_language" => "summary_language",
|
||||
"orig_title" => "orig_title",
|
||||
|
||||
"series_editor" => "series_editor",
|
||||
"series_title" => "series_title",
|
||||
"abbrev_series_title" => "abbrev_series_title",
|
||||
"series_volume" => "series_volume",
|
||||
"series_issue" => "series_issue",
|
||||
"edition" => "edition",
|
||||
|
||||
"issn" => "issn",
|
||||
"isbn" => "isbn",
|
||||
"medium" => "medium",
|
||||
"area" => "area",
|
||||
"expedition" => "expedition",
|
||||
"conference" => "conference",
|
||||
"notes" => "notes",
|
||||
"approved" => "approved",
|
||||
|
||||
"location" => "location",
|
||||
"call_number" => "call_number",
|
||||
"serial" => "serial",
|
||||
"type" => "type",
|
||||
"thesis" => "thesis",
|
||||
|
||||
"file" => "file",
|
||||
"url" => "url",
|
||||
"doi" => "doi",
|
||||
"contribution_id" => "contribution_id",
|
||||
"online_publication" => "online_publication",
|
||||
"online_citation" => "online_citation",
|
||||
|
||||
"created_date-created_time" => "created_date-created_time", // see TODO note above
|
||||
"created_by" => "created_by",
|
||||
"modified_date-modified_time" => "modified_date-modified_time", // see TODO note above
|
||||
"modified_by" => "modified_by",
|
||||
|
||||
"orig_record" => "orig_record",
|
||||
|
||||
"marked" => "marked", // in case of 'sru.php', querying for user-specific fields requires that the 'x-...authenticationToken' is given in the SRU query
|
||||
"copy" => "copy",// for 'opensearch.php', querying of user-specific fields will only work with a user being logged in
|
||||
"selected" => "selected",
|
||||
"user_keys" => "user_keys",
|
||||
"user_notes" => "user_notes",
|
||||
"user_file" => "user_file",
|
||||
"user_groups" => "user_groups",
|
||||
"related" => "related",
|
||||
"cite_key" => "cite_key" // currently, only the user-specific 'cite_key' field can be queried by every user using 'sru.php'
|
||||
);
|
||||
|
||||
|
||||
return $indexNamesArray;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Map SRU/W diagnostic numbers to their corresponding messages:
|
||||
// Spec: <http://www.loc.gov/standards/sru/specs/diagnostics.html>,
|
||||
// <http://www.loc.gov/standards/sru/resources/diagnostics-list.html>
|
||||
function mapSRWDiagnostics()
|
||||
{
|
||||
$diagMessagesArray = array(1 => "General system error", // Details: Debugging information (traceback)
|
||||
2 => "System temporarily unavailable",
|
||||
3 => "Authentication error",
|
||||
4 => "Unsupported operation",
|
||||
5 => "Unsupported version", // Details: Highest version supported
|
||||
6 => "Unsupported parameter value", // Details: Name of parameter
|
||||
7 => "Mandatory parameter not supplied", // Details: Name of missing parameter
|
||||
8 => "Unsupported Parameter", // Details: Name of the unsupported parameter
|
||||
|
||||
10 => "Query syntax error",
|
||||
15 => "Unsupported context set", // Details: URI or short name of context set
|
||||
16 => "Unsupported index", // Details: Name of index
|
||||
24 => "Unsupported combination of relation and term",
|
||||
36 => "Term in invalid format for index or relation",
|
||||
39 => "Proximity not supported",
|
||||
|
||||
50 => "Result sets not supported",
|
||||
|
||||
61 => "First record position out of range",
|
||||
64 => "Record temporarily unavailable",
|
||||
65 => "Record does not exist",
|
||||
66 => "Unknown schema for retrieval", // Details: Schema URI or short name (of the unsupported one)
|
||||
67 => "Record not available in this schema", // Details: Schema URI or short name
|
||||
68 => "Not authorised to send record",
|
||||
69 => "Not authorised to send record in this schema",
|
||||
70 => "Record too large to send", // Details: Maximum record size
|
||||
71 => "Unsupported record packing",
|
||||
72 => "XPath retrieval unsupported",
|
||||
|
||||
80 => "Sort not supported",
|
||||
|
||||
110 => "Stylesheets not supported"
|
||||
);
|
||||
|
||||
return $diagMessagesArray;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Map refbase types to the corresponding eprint/resource types suggested for Simple Dublin Core[1]:
|
||||
// [1]: <http://eprints-uk.rdn.ac.uk/project/docs/simpledc-guidelines/#type>
|
||||
// for mappings marked with (*), the above article doesn't offer a type that sufficiently matches the refbase type
|
||||
function mapDCTypes()
|
||||
{
|
||||
$dcTypesArray = array("Journal Article" => "JournalArticle",
|
||||
"Abstract" => "Abstract", // (*)
|
||||
"Book Chapter" => "BookChapter",
|
||||
"Book Whole" => "Book",
|
||||
"Conference Article" => "ConferencePaper",
|
||||
"Conference Volume" => "ConferenceProceedings",
|
||||
"Journal" => "Journal", // (*)
|
||||
"Magazine Article" => "MagazineArticle", // (*)
|
||||
"Manual" => "Manual", // (*)
|
||||
"Manuscript" => "Preprint",
|
||||
"Map" => "Map", // (*)
|
||||
"Miscellaneous" => "Other",
|
||||
"Newspaper Article" => "NewsArticle",
|
||||
"Patent" => "Patent", // (*)
|
||||
"Report" => "TechnicalReport",
|
||||
"Software" => "Software", // (*)
|
||||
// "" => "ConferencePoster",
|
||||
// "" => "InCollection",
|
||||
// "" => "OnlineJournalArticle",
|
||||
"Thesis" => "Thesis" // since refbase currently doesn't use a 'Thesis' type, this has to be dealt with in the calling function
|
||||
);
|
||||
|
||||
return $dcTypesArray;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
?>
|
||||
185
includes/zip.inc.php
Normal file
185
includes/zip.inc.php
Normal file
@@ -0,0 +1,185 @@
|
||||
<?php
|
||||
/**
|
||||
* Zip file creation class.
|
||||
* Makes zip files.
|
||||
* From phpmyadmin <http://tinyurl.com/fjpwx>
|
||||
*
|
||||
* Based on :
|
||||
*
|
||||
* http://www.zend.com/codex.php?id=535&single=1
|
||||
* By Eric Mueller <eric@themepark.com>
|
||||
*
|
||||
* http://www.zend.com/codex.php?id=470&single=1
|
||||
* by Denis125 <webmaster@atlant.ru>
|
||||
*
|
||||
* a patch from Peter Listiak <mlady@users.sourceforge.net> for last modified
|
||||
* date and time of the compressed file
|
||||
*
|
||||
* Official ZIP file format: http://www.pkware.com/appnote.txt
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
class zipfile
|
||||
{
|
||||
/**
|
||||
* Array to store compressed data
|
||||
*
|
||||
* @var array $datasec
|
||||
*/
|
||||
var $datasec = array();
|
||||
|
||||
/**
|
||||
* Central directory
|
||||
*
|
||||
* @var array $ctrl_dir
|
||||
*/
|
||||
var $ctrl_dir = array();
|
||||
|
||||
/**
|
||||
* End of central directory record
|
||||
*
|
||||
* @var string $eof_ctrl_dir
|
||||
*/
|
||||
var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";
|
||||
|
||||
/**
|
||||
* Last offset position
|
||||
*
|
||||
* @var integer $old_offset
|
||||
*/
|
||||
var $old_offset = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Converts an Unix timestamp to a four byte DOS date and time format (date
|
||||
* in high two bytes, time in low two bytes allowing magnitude comparison).
|
||||
*
|
||||
* @param integer the current Unix timestamp
|
||||
*
|
||||
* @return integer the current date in a four byte DOS format
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function unix2DosTime($unixtime = 0) {
|
||||
$timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);
|
||||
|
||||
if ($timearray['year'] < 1980) {
|
||||
$timearray['year'] = 1980;
|
||||
$timearray['mon'] = 1;
|
||||
$timearray['mday'] = 1;
|
||||
$timearray['hours'] = 0;
|
||||
$timearray['minutes'] = 0;
|
||||
$timearray['seconds'] = 0;
|
||||
} // end if
|
||||
|
||||
return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) |
|
||||
($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1);
|
||||
} // end of the 'unix2DosTime()' method
|
||||
|
||||
|
||||
/**
|
||||
* Adds "file" to archive
|
||||
*
|
||||
* @param string file contents
|
||||
* @param string name of the file in the archive (may contains the path)
|
||||
* @param integer the current timestamp
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function addFile($data, $name, $time = 0)
|
||||
{
|
||||
$name = str_replace('\\', '/', $name);
|
||||
|
||||
$dtime = dechex($this->unix2DosTime($time));
|
||||
$hexdtime = '\x' . $dtime[6] . $dtime[7]
|
||||
. '\x' . $dtime[4] . $dtime[5]
|
||||
. '\x' . $dtime[2] . $dtime[3]
|
||||
. '\x' . $dtime[0] . $dtime[1];
|
||||
eval('$hexdtime = "' . $hexdtime . '";');
|
||||
|
||||
$fr = "\x50\x4b\x03\x04";
|
||||
$fr .= "\x14\x00"; // ver needed to extract
|
||||
$fr .= "\x00\x00"; // gen purpose bit flag
|
||||
$fr .= "\x08\x00"; // compression method
|
||||
$fr .= $hexdtime; // last mod time and date
|
||||
|
||||
// "local file header" segment
|
||||
$unc_len = strlen($data);
|
||||
$crc = crc32($data);
|
||||
$zdata = gzcompress($data);
|
||||
$zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug
|
||||
$c_len = strlen($zdata);
|
||||
$fr .= pack('V', $crc); // crc32
|
||||
$fr .= pack('V', $c_len); // compressed filesize
|
||||
$fr .= pack('V', $unc_len); // uncompressed filesize
|
||||
$fr .= pack('v', strlen($name)); // length of filename
|
||||
$fr .= pack('v', 0); // extra field length
|
||||
$fr .= $name;
|
||||
|
||||
// "file data" segment
|
||||
$fr .= $zdata;
|
||||
|
||||
// "data descriptor" segment (optional but necessary if archive is not
|
||||
// served as file)
|
||||
// nijel(2004-10-19): this seems not to be needed at all and causes
|
||||
// problems in some cases (bug #1037737)
|
||||
//$fr .= pack('V', $crc); // crc32
|
||||
//$fr .= pack('V', $c_len); // compressed filesize
|
||||
//$fr .= pack('V', $unc_len); // uncompressed filesize
|
||||
|
||||
// add this entry to array
|
||||
$this -> datasec[] = $fr;
|
||||
|
||||
// now add to central directory record
|
||||
$cdrec = "\x50\x4b\x01\x02";
|
||||
$cdrec .= "\x00\x00"; // version made by
|
||||
$cdrec .= "\x14\x00"; // version needed to extract
|
||||
$cdrec .= "\x00\x00"; // gen purpose bit flag
|
||||
$cdrec .= "\x08\x00"; // compression method
|
||||
$cdrec .= $hexdtime; // last mod time & date
|
||||
$cdrec .= pack('V', $crc); // crc32
|
||||
$cdrec .= pack('V', $c_len); // compressed filesize
|
||||
$cdrec .= pack('V', $unc_len); // uncompressed filesize
|
||||
$cdrec .= pack('v', strlen($name) ); // length of filename
|
||||
$cdrec .= pack('v', 0 ); // extra field length
|
||||
$cdrec .= pack('v', 0 ); // file comment length
|
||||
$cdrec .= pack('v', 0 ); // disk number start
|
||||
$cdrec .= pack('v', 0 ); // internal file attributes
|
||||
$cdrec .= pack('V', 32 ); // external file attributes - 'archive' bit set
|
||||
|
||||
$cdrec .= pack('V', $this -> old_offset ); // relative offset of local header
|
||||
$this -> old_offset += strlen($fr);
|
||||
|
||||
$cdrec .= $name;
|
||||
|
||||
// optional extra field, file comment goes here
|
||||
// save to central directory
|
||||
$this -> ctrl_dir[] = $cdrec;
|
||||
} // end of the 'addFile()' method
|
||||
|
||||
|
||||
/**
|
||||
* Dumps out file
|
||||
*
|
||||
* @return string the zipped file
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function file()
|
||||
{
|
||||
$data = implode('', $this -> datasec);
|
||||
$ctrldir = implode('', $this -> ctrl_dir);
|
||||
|
||||
return
|
||||
$data .
|
||||
$ctrldir .
|
||||
$this -> eof_ctrl_dir .
|
||||
pack('v', sizeof($this -> ctrl_dir)) . // total # of entries "on this disk"
|
||||
pack('v', sizeof($this -> ctrl_dir)) . // total # of entries overall
|
||||
pack('V', strlen($ctrldir)) . // size of central dir
|
||||
pack('V', strlen($data)) . // offset to start of central dir
|
||||
"\x00\x00"; // .zip file comment length
|
||||
} // end of the 'file()' method
|
||||
|
||||
} // end of the 'zipfile' class
|
||||
?>
|
||||
Reference in New Issue
Block a user