CITATION STYLE class.

Format citations.

For non-WIKINDX users, you must have set up BIBFORMAT before using this (see documentation for BIBFORMAT()).

package wikindx4\core\bibcitation
author Mark Grimshaw

 Methods

CITESTYLE

__construct(string $output) 

Parameters

$output

string

'html', plain', 'rtf'. Default is 'html'

Gather bibliography of citations.

bibliographyProcess() 

The order is important: 1. for in-text citations as it controls disambiguation where a letter is added after the year. 2. for endnote-style citations, if your bibliographic style says that a resource following another by the same creator(s) should have the creator(s) replaced by something like '_______', order is again important. 3. for endnote-style citations having the same id no. for the same resource where the id no. in the text follows the bibliography order.

Create preText and postText

createPrePostText(string $preText, string $postText) 

Parameters

$preText

string

$postText

string

Create the resource title

createTitle() 

Create the URL

createUrl() 

get names from database for creator, editor, translator etc.

grabNames(int $citationId) 

Parameters

$citationId

int

callback for ordinals

ordinals(array $matches) 

Parameters

$matches

array

Parse the cite tag by extracting resource ID and any page numbers.

parseCiteTag(int $matchIndex, string $tag) : int

Check ID is valid.

PreText and postText can also be encoded: e.g. (see Grimshaw 2003; Boulanger 2004 for example) [cite]23:34-35|see ` for example[/cite]. For multiple citations, only the first encountered preText and postText will be used to enclose the citations.

Parameters

$matchIndex

int

$tag

string

Returns

int

Process bibliography array into string for output -- used for in-text citations and appended bibliographies for footnotes

printBibliography(array $bibliography) 

Parameters

$bibliography

array

Accept a SQL result row of raw bibliographic data and process it.

process(array $row, int $id) 

We build up the $citeFormat->item array with formatted parts from the raw $row

Parameters

$row

array

$id

int

Remove slashes

removeSlashes(string $element) 

Parameters

$element

string

Start the whole process off by finding [cite].

start(string $text, boolean $citeLink) : string

..[/cite] tags in input text.

WIKINDX uses [cite]34[/cite] or [cite]34:23[/cite] or [cite]34:23-24[/cite] where '34' is the resource's unique ID, '23' is a single page for the citation and '23-24' is a page range for the citation. If your system uses something else, you will need to make changes here and in $this->parseCiteTag(). PreText and postText can also be encoded: e.g. (see Grimshaw 2003; Boulanger 2004 for example) [cite]23:34-35|see ` for example[/cite]

Parameters

$text

string

$citeLink

boolean

Returns

string

Initialize the CITESTYLE system

init() 

 Properties

 

$citeFormat 
 

$dir 
 

$output 
 

$rtfBibExport 
 

$citeIds 
 

$db 
 

$html 
 

$pageEnd 
 

$pageStart 
 

$postText 
 

$preText 
 

$res 
 

$session 
 

$setupStyle 
 

$url