Skip to content

Commit

Permalink
Correction for csl-apidev version to provide links to [Page...]text;
Browse files Browse the repository at this point in the history
  • Loading branch information
funderburkjim committed Jan 30, 2022
1 parent 6be897c commit 6094d46
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
3 changes: 2 additions & 1 deletion basicadjust.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public function line_adjust($line) {
$line = preg_replace('/¦/',' ',$line);
$line = preg_replace_callback('|<s>(.*?)</s>|','BasicAdjust::s_callback',$line);
$line = preg_replace_callback('|<key2>(.*?)</key2>|','BasicAdjust::key2_callback',$line);
$line = preg_replace("|\[Page.*?\]|", "<pb>$0</pb>",$line);
//$line = preg_replace("|\[Page.*?\]|", "<pb>$0</pb>",$line);
$line = preg_replace("|\[(Page.*?)\]|", "<pb>$1</pb>",$line);

$line = preg_replace('/<pc>Page(.*)<\/pc>/',"<pc>\\1</pc>",$line);

Expand Down
21 changes: 16 additions & 5 deletions basicdisplay.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// constructor is either a string or an array of strings.
*/
require_once("dbgprint.php");
require_once("parm.php");
class BasicDisplay {

public $parentEl;
public $row;
public $row1;
Expand All @@ -30,10 +30,20 @@ class BasicDisplay {
public $sdata; // class to use for Sanskrit
public $filterin; // transcoding for output
public $key; // the original key being searched for
public $basicOption,$serve;
public function __construct($key,$string_or_array,$filterin,$dict) {

$this->key = $key;
$this->dict = $dict;
$this->filterin = $filterin;
$this->getParms = new Parm();
$this->basicOption = $this->getParms->basicOption;
if ($this->basicOption) {
$this->serve = "../webtc/servepdf.php";
} else {
$this->serve = "servepdf.php";
}

$this->pagecol="";
$this->dbg=false; #false;
$this->inSanskrit=false;
Expand Down Expand Up @@ -652,7 +662,7 @@ public function chrhndl($xp,$data) {
}
} else if ($this->parentEl == "key1"){ // nothing printed
} else if ($this->parentEl == "pb") {
if (in_array($this->dict,array("pwg"))) {
if (true) { // (in_array($this->dict,array("pwg"))) {
$hrefdata = $this->getHrefPage($data);
$style = "font-size:smaller; font-weight:bold;";
$this->row .= "<span style='$style'> $hrefdata</span>";
Expand Down Expand Up @@ -741,15 +751,16 @@ public function getHrefPage($data) {
*/
$ans="";
//$lnums = preg_split('/[,-]/',$data);
$serve = $this->serve;
$lnums = preg_split('/[,]/',$data); //%{pfx}
$serve = "../webtc/servepdf.php";
foreach($lnums as $lnum) {
#list($page,$col) = preg_split('/[-]/',$lnum);
$page = $lnum; # this may be dictionary specific.
if ($ans == "") {
$args = "page=$page";
$dict = $this->dict;
$args = "dict=$dict&page=$page";
#$ans = "<a href='$serve?$args' target='_Blank'>$lnum</a>";
$dictup = strtoupper($this->dict);
$dictup = strtoupper($dict);
$style = "color:rgb(130,130,130);";
$ans = "<a href='$serve?$args' target='_$dictup' style='$style'>$lnum</a>";
}else {
Expand Down

0 comments on commit 6094d46

Please sign in to comment.