Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
buechereielektrik:unapi:picarecord.php [2009-12-14 14:35] – Handled empty records for dc and rdf strols | buechereielektrik:unapi:picarecord.php [2010-01-10 22:28] (current) – Redirect rosenke | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | < | + | This file was renamed |
- | <?php | + | |
- | + | ||
- | /* Copyright 2008 2009 Goetz Hatop | + | |
- | | + | |
- | | + | |
- | */ | + | |
- | + | ||
- | /* Copyright 2009 Stephan Rosenke < | + | |
- | + | ||
- | / | + | |
- | | + | |
- | | + | |
- | | + | |
- | * | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | * | + | |
- | | + | |
- | | + | |
- | */ | + | |
- | + | ||
- | /* Version: | + | |
- | + | ||
- | /* Changelog | + | |
- | * | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | */ | + | |
- | + | ||
- | $opac_url = " | + | |
- | //$opac_url = " | + | |
- | //$opac_url = " | + | |
- | //$opac_url = " | + | |
- | + | ||
- | $bibsonomy_url = " | + | |
- | + | ||
- | /** represents a bibliographic data record from oclc/pica LBS | + | |
- | */ | + | |
- | class PicaRecord { | + | |
- | // 15 dublin core elements http:// | + | |
- | var $contributor, | + | |
- | var $identifier, | + | |
- | var $subject, $title, $type; | + | |
- | // 1 for me | + | |
- | var $signatur; | + | |
- | + | ||
- | function PicaRecord() { | + | |
- | // | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | + | ||
- | /** private -- make pica data behave well */ | + | |
- | function decodePica($str) { | + | |
- | $tag = ""; | + | |
- | $res = ""; | + | |
- | for ($i=0; | + | |
- | $ch = substr($str, | + | |
- | switch (ord($ch)) { | + | |
- | case 31: // | + | |
- | $ch = substr($str, | + | |
- | if ($tag!="" | + | |
- | $res .= "</" | + | |
- | $tag = $this-> | + | |
- | $res .= "<" | + | |
- | } else { | + | |
- | $tag = $this-> | + | |
- | $res .= "<" | + | |
- | } | + | |
- | | + | |
- | + | ||
- | case 30: // | + | |
- | $res .= "</" | + | |
- | $tag = ""; | + | |
- | | + | |
- | + | ||
- | case 226: //pica two byte char accent like " | + | |
- | $ch = substr($str, | + | |
- | $res .= $this-> | + | |
- | | + | |
- | + | ||
- | default: | + | |
- | $res .= $this-> | + | |
- | | + | |
- | } //switch | + | |
- | + | ||
- | } | + | |
- | $res .= "</" | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** private -- make pica data behave well and put them to an array*/ | + | |
- | function decodePica_array($str) { | + | |
- | $tag = ""; | + | |
- | $res = ""; | + | |
- | for ($i=0; | + | |
- | $ch = substr($str, | + | |
- | switch (ord($ch)) { | + | |
- | case 31: // | + | |
- | $ch = substr($str, | + | |
- | $tag = $this-> | + | |
- | | + | |
- | + | ||
- | case 30: // | + | |
- | | + | |
- | + | ||
- | case 226: //pica two byte char accent like " | + | |
- | $ch = substr($str, | + | |
- | $res .= $this-> | + | |
- | | + | |
- | + | ||
- | default: | + | |
- | | + | |
- | | + | |
- | } //switch | + | |
- | + | ||
- | } | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- transform raw pica data to array */ | + | |
- | function getArray($str) { | + | |
- | // pica record separator is ascii record separator | + | |
- | | + | |
- | $res = ""; | + | |
- | | + | |
- | $in1 = ltrim($line); | + | |
- | $ch1 = substr($in1, | + | |
- | // | + | |
- | if (ord($ch1) >47 && ord($ch1)< | + | |
- | $pos = strpos($in1, | + | |
- | $key = substr($in1, | + | |
- | $val = substr($in1, | + | |
- | $val = $this-> | + | |
- | $pica_array[$key] = $val; | + | |
- | } else { | + | |
- | //not valid | + | |
- | } | + | |
- | } | + | |
- | $res = $pica_array; | + | |
- | | + | |
- | } | + | |
- | + | ||
- | /** private -- recode pica charset */ | + | |
- | function getCode($ch) { | + | |
- | $xx = ord($ch); | + | |
- | | + | |
- | // | + | |
- | // | + | |
- | case 10: return " | + | |
- | // case 60: return " | + | |
- | case 60: return "& | + | |
- | // case 62: return " | + | |
- | case 62: return "& | + | |
- | case 64: return ""; | + | |
- | case 209: return " | + | |
- | case 210: return " | + | |
- | case 211: return " | + | |
- | case 216: return " | + | |
- | case 193: return " | + | |
- | case 194: return " | + | |
- | case 195: return " | + | |
- | | + | |
- | if ($xx<30 || $xx>128) { | + | |
- | | + | |
- | } | + | |
- | return $ch; | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | /** private -- not complete set of double byte pica characters started with | + | |
- | an accent sign */ | + | |
- | function getCode2($ch) { | + | |
- | | + | |
- | case ' | + | |
- | case ' | + | |
- | case ' | + | |
- | case ' | + | |
- | case ' | + | |
- | case ' | + | |
- | case ' | + | |
- | case ' | + | |
- | | + | |
- | | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | /** public -- return simple dublin core record from pica data */ | + | |
- | //used by unapi | + | |
- | function getDublinCore($str) { | + | |
- | $res = $this-> | + | |
- | + | ||
- | if (empty($res)) return ""; | + | |
- | + | ||
- | $res = "<? | + | |
- | $res .="< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .="</ | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- transform raw pica plus to a more readable diagnostic format */ | + | |
- | //used by unapi | + | |
- | function getPicaPlus($str) { | + | |
- | $res = $this-> | + | |
- | $res = $this-> | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** private -- rename numeric tags not allowed in xml */ | + | |
- | function getTagName($ch) { | + | |
- | if (ord($ch) >47 && ord($ch)< | + | |
- | return " | + | |
- | } else { | + | |
- | return $ch; | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | /** public -- transform raw pica data to valid xml */ | + | |
- | //used by unapi | + | |
- | function getXmlData($str) { | + | |
- | // pica record separator is ascii record separator | + | |
- | | + | |
- | $res = ""; | + | |
- | | + | |
- | $in1 = ltrim($line); | + | |
- | $ch1 = substr($in1, | + | |
- | // | + | |
- | if (ord($ch1) >47 && ord($ch1)< | + | |
- | $pos = strpos($in1, | + | |
- | $key = substr($in1, | + | |
- | $val = substr($in1, | + | |
- | $val = $this-> | + | |
- | //$res .= " | + | |
- | $res .= "< | + | |
- | //side effect to scan dublin core elements | + | |
- | $this-> | + | |
- | } else { | + | |
- | //not valid | + | |
- | } | + | |
- | } | + | |
- | | + | |
- | } | + | |
- | + | ||
- | /** private -- read dublin core elements */ | + | |
- | function readData($key, | + | |
- | // | + | |
- | | + | |
- | case ' | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | // The spatial or temporal topic of the resource | + | |
- | // $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | //The spatial or temporal topic of the resource | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | // $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | //related : A related resource. | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | //related : A related resource. | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | $pub1 = $this-> | + | |
- | $pub2 = $this-> | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | //source : A related resource from which the described is derived. | + | |
- | $this-> | + | |
- | // | + | |
- | break; | + | |
- | case ' | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | if ($this-> | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | if ($this-> | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | if ($this-> | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | if ($this-> | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | if ($this-> | + | |
- | $this-> | + | |
- | break; | + | |
- | case ' | + | |
- | $this-> | + | |
- | $subtitle = $this-> | + | |
- | if ($subtitle!="" | + | |
- | break; | + | |
- | case ' | + | |
- | //type The nature or genre of the resource. | + | |
- | $this-> | + | |
- | break; | + | |
- | | + | |
- | break; | + | |
- | } | + | |
- | | + | |
- | } | + | |
- | + | ||
- | /** public -- parse dublin core data */ | + | |
- | //client functionality | + | |
- | function readDublinCore($str) { | + | |
- | $doc = new DomDocument(); | + | |
- | $doc -> loadXML($str); | + | |
- | $xp = new DomXPath($doc); | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | + | ||
- | /** public -- parse dublin core data */ | + | |
- | // experimental, | + | |
- | function readRDF_DC($str) { | + | |
- | $doc = new DomDocument(); | + | |
- | $doc -> loadXML($str); | + | |
- | $xp = new DomXPath($doc); | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | + | ||
- | /** private -- read tag content from string */ | + | |
- | function readTag($val, | + | |
- | $x = strpos($val,"<" | + | |
- | $y = strpos($val,"</" | + | |
- | if ($x===FALSE) return ""; | + | |
- | | + | |
- | } | + | |
- | + | ||
- | /** public -- read XML data */ | + | |
- | // client functionality | + | |
- | function readXmlData($str) { | + | |
- | | + | |
- | // | + | |
- | | + | |
- | $line = trim($line); | + | |
- | if ($line=="" | + | |
- | $x = strpos($line, | + | |
- | if ($x!==0) continue; | + | |
- | $y = strpos($line, | + | |
- | $key = substr($line, | + | |
- | $z = strpos($line, | + | |
- | if ($z===FALSE) continue; | + | |
- | $val = substr($line, | + | |
- | | + | |
- | // | + | |
- | } | + | |
- | // | + | |
- | } | + | |
- | + | ||
- | /** private -- transcribe separators | + | |
- | function transcribe_pica_rec($str) { | + | |
- | | + | |
- | " | + | |
- | )); | + | |
- | } | + | |
- | + | ||
- | /** private -- pica charset handling (we want utf8) */ | + | |
- | function transcribe_pica_utf8($str) { | + | |
- | | + | |
- | " | + | |
- | " | + | |
- | )); | + | |
- | } | + | |
- | } //end class PicaRecord | + | |
- | + | ||
- | /** get a pica record via pica xml web interface and return */ | + | |
- | class Picappn { | + | |
- | // require php5-curl | + | |
- | var $opac; | + | |
- | var $url; | + | |
- | var $ppn; | + | |
- | var $myself; | + | |
- | + | ||
- | var $prec; // a picarecord | + | |
- | + | ||
- | // | + | |
- | function Picappn() { | + | |
- | //probably localhost on a typical pica psi production system | + | |
- | global $opac_url; | + | |
- | $this-> | + | |
- | $this-> | + | |
- | $this-> | + | |
- | } | + | |
- | + | ||
- | /** public -- convert for output using raw array data*/ | + | |
- | function convOutput($array, | + | |
- | if (empty($array)) return ""; | + | |
- | if (!empty($subfield)) { | + | |
- | if (empty($array[$category][$subfield])) return ""; | + | |
- | $res = $text.$separator.$array[$category][$subfield].$suffix; | + | |
- | } else { | + | |
- | if (empty($array[$category])) return ""; | + | |
- | $res = $text.$separator.$array[$category].$suffix; | + | |
- | } | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- convert for output using nice array data*/ | + | |
- | function convOutputNice($array_nice, | + | |
- | if (empty($array_nice)) return ""; | + | |
- | if (empty($array_nice[$key])) return ""; | + | |
- | $res = $array_text[$key].$prefix.$array_nice[$key].$suffix; | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- return record as Array */ | + | |
- | function getArray() { | + | |
- | if ($this-> | + | |
- | $res = $this-> | + | |
- | $res = $this-> | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- return array with speaking keys */ | + | |
- | function getArrayNice($array_raw) { | + | |
- | if (empty($array_raw)) return ""; | + | |
- | $record = $array_raw; | + | |
- | + | ||
- | //Type | + | |
- | $res[' | + | |
- | + | ||
- | //Author | + | |
- | $res[' | + | |
- | //Editor | + | |
- | $res[' | + | |
- | + | ||
- | //Title | + | |
- | $res[' | + | |
- | + | ||
- | //Series | + | |
- | $res[' | + | |
- | + | ||
- | //Address, especially city | + | |
- | $res[' | + | |
- | // | + | |
- | $res[' | + | |
- | //Edition | + | |
- | $res[' | + | |
- | //Year | + | |
- | $res[' | + | |
- | + | ||
- | //ISBNs | + | |
- | $res[' | + | |
- | $res[' | + | |
- | + | ||
- | //PPN | + | |
- | $res[' | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- return BibTex record from pica data */ | + | |
- | //used by bibsonomy | + | |
- | function getBibsonomy() { | + | |
- | if ($this-> | + | |
- | $record_raw = $this-> | + | |
- | $record_nice = $this-> | + | |
- | $keys_nice = $this-> | + | |
- | + | ||
- | if (substr($record_nice[' | + | |
- | //Type | + | |
- | $res .= "@book {"; | + | |
- | + | ||
- | //create identifier | + | |
- | $res .= $this-> | + | |
- | $res .= $this-> | + | |
- | + | ||
- | //Author et al. | + | |
- | $i = array(' | + | |
- | ' | + | |
- | foreach ($i as $j) { | + | |
- | $res .= $this-> | + | |
- | } | + | |
- | + | ||
- | //Call Number | + | |
- | $res .= $this-> | + | |
- | } | + | |
- | $res .= " | + | |
- | + | ||
- | $res = urlencode($res); | + | |
- | + | ||
- | global $bibsonomy_url; | + | |
- | $res = $bibsonomy_url.$res; | + | |
- | + | ||
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- return BibTex record from pica data */ | + | |
- | //used by unapi | + | |
- | function getBibTex() { | + | |
- | if ($this-> | + | |
- | $record_raw = $this-> | + | |
- | $record_nice = $this-> | + | |
- | $keys_nice = $this-> | + | |
- | + | ||
- | if (substr($record_nice[' | + | |
- | //Type | + | |
- | $res .= "@book {"; | + | |
- | + | ||
- | //create identifier | + | |
- | $res .= $this-> | + | |
- | $res .= $this-> | + | |
- | + | ||
- | //Author et al. | + | |
- | $i = array(' | + | |
- | ' | + | |
- | foreach ($i as $j) { | + | |
- | $res .= $this-> | + | |
- | } | + | |
- | + | ||
- | //Call Number | + | |
- | $res .= $this-> | + | |
- | } | + | |
- | $res .= " | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** private -- get data via pica xml interface */ | + | |
- | function getData($ppn) { | + | |
- | $ch = curl_init(" | + | |
- | curl_setopt($ch, | + | |
- | curl_setopt($ch, | + | |
- | // | + | |
- | curl_setopt($ch, | + | |
- | $res = curl_exec($ch); | + | |
- | curl_close($ch); | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- return simple dublin core record data from pica record */ | + | |
- | function getDublinCore() { | + | |
- | $res = $this-> | + | |
- | $res = $this-> | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- return dublin core rdf data from pica record */ | + | |
- | function getDublinCoreRDF() { | + | |
- | $res = $this-> | + | |
- | $res = $this-> | + | |
- | + | ||
- | if (empty($res)) return ""; | + | |
- | + | ||
- | $res = "<? | + | |
- | $res .= "< | + | |
- | $res .= " | + | |
- | $res .= " | + | |
- | $res .= " | + | |
- | $res .= "< | + | |
- | | + | |
- | $res .= "< | + | |
- | .$this-> | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "< | + | |
- | $res .= "</ | + | |
- | $res .= "</ | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- return array with key names for BibTex*/ | + | |
- | function getKeysBibTex() { | + | |
- | //Type | + | |
- | $res[' | + | |
- | + | ||
- | //Author | + | |
- | $res[' | + | |
- | //Editor | + | |
- | $res[' | + | |
- | + | ||
- | //Title | + | |
- | $res[' | + | |
- | + | ||
- | //Series | + | |
- | $res[' | + | |
- | + | ||
- | //Address, especially city | + | |
- | $res[' | + | |
- | // | + | |
- | $res[' | + | |
- | //Edition | + | |
- | $res[' | + | |
- | //Year | + | |
- | $res[' | + | |
- | + | ||
- | //ISBNs | + | |
- | $res[' | + | |
- | $res[' | + | |
- | + | ||
- | //PPN | + | |
- | $res[' | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- return array with key names for text*/ | + | |
- | function getKeysText() { | + | |
- | //Type | + | |
- | $res[' | + | |
- | + | ||
- | //Author | + | |
- | $res[' | + | |
- | //Editor | + | |
- | $res[' | + | |
- | + | ||
- | //Title | + | |
- | $res[' | + | |
- | + | ||
- | //Series | + | |
- | $res[' | + | |
- | + | ||
- | //Address, especially city | + | |
- | $res[' | + | |
- | // | + | |
- | $res[' | + | |
- | //Edition | + | |
- | $res[' | + | |
- | //Year | + | |
- | $res[' | + | |
- | + | ||
- | //ISBNs | + | |
- | $res[' | + | |
- | $res[' | + | |
- | + | ||
- | //PPN | + | |
- | $res[' | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- return formated pica plus record */ | + | |
- | function getPicaPlus() { | + | |
- | if ($this-> | + | |
- | $res = $this-> | + | |
- | $res = $this-> | + | |
- | $head = "<? | + | |
- | $head .= "< | + | |
- | $tail = "</ | + | |
- | return $head.$res.$tail; | + | |
- | } | + | |
- | + | ||
- | /** public -- return formated plain record */ | + | |
- | function getPlain() { | + | |
- | if ($this-> | + | |
- | $res = $this-> | + | |
- | $res = $this-> | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- return simple text record from pica data */ | + | |
- | //used by unapi | + | |
- | function getText() { | + | |
- | if ($this-> | + | |
- | $record_raw = $this-> | + | |
- | $record_nice = $this-> | + | |
- | $keys_nice = $this-> | + | |
- | + | ||
- | if (substr($record_nice[' | + | |
- | //Type | + | |
- | $res .= " | + | |
- | + | ||
- | //Author | + | |
- | $res .= $this-> | + | |
- | //Editor | + | |
- | $res .= $this-> | + | |
- | + | ||
- | //Title | + | |
- | $res .= $this-> | + | |
- | + | ||
- | //Series | + | |
- | $res .= $this-> | + | |
- | + | ||
- | //Address, especially city | + | |
- | $res .= $this-> | + | |
- | // | + | |
- | $res .= $this-> | + | |
- | //Edition | + | |
- | $res .= $this-> | + | |
- | //Year | + | |
- | $res .= $this-> | + | |
- | + | ||
- | //ISBNs | + | |
- | $res .= $this-> | + | |
- | $res .= $this-> | + | |
- | + | ||
- | //Call Number | + | |
- | $i = 1; | + | |
- | $j = 0; | + | |
- | while ( $i <= 99 ) { | + | |
- | if (($i <= 9) && ($j == 0)) { | + | |
- | $j = " | + | |
- | } elseif (($i > 9) && ($j == 0)) { | + | |
- | $j = $i; | + | |
- | } | + | |
- | $res .= $this-> | + | |
- | $i++; | + | |
- | if ($i <= 9 ) { | + | |
- | $j = " | + | |
- | } else { | + | |
- | $j = $i; | + | |
- | } | + | |
- | if (empty($record_raw[" | + | |
- | } | + | |
- | + | ||
- | $res .= $this-> | + | |
- | } | + | |
- | return $res; | + | |
- | } | + | |
- | + | ||
- | /** public -- return xml formated pica record */ | + | |
- | function getXmlData() { | + | |
- | if ($this-> | + | |
- | $res = $this-> | + | |
- | $res = $this-> | + | |
- | $head = "<? | + | |
- | //$head .= "< | + | |
- | //$head .= "< | + | |
- | //$head .= "< | + | |
- | //$head .= "< | + | |
- | //$head .= "< | + | |
- | $head .= "< | + | |
- | $tail = "</ | + | |
- | return $head.$res.$tail; | + | |
- | } | + | |
- | + | ||
- | //public | + | |
- | function setOpac($opac) { | + | |
- | $this-> | + | |
- | } | + | |
- | + | ||
- | //public -- set ppn, the unapi identifier | + | |
- | function setPpn($ppn) { | + | |
- | $this-> | + | |
- | $this-> | + | |
- | $this-> | + | |
- | } | + | |
- | + | ||
- | } //end class Picappn | + | |
- | + | ||
- | /* Return result or 404 */ | + | |
- | function final_result($res, | + | |
- | if (!empty($res)) { | + | |
- | header(" | + | |
- | echo $res; | + | |
- | } else { | + | |
- | header(' | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | ?> | + | |
- | </ | + |