Description of class CITEFORMAT.

Format citations.

package wikindx4\core\bibcitation
author Mark Grimshaw
param

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

 Methods

CITEFORMAT

__construct(string $output) 

Parameters

$output

string

Default is 'html'

Handle initials.

checkInitials(array $creator, int $initialsStyle, boolean $firstNameInitial) : string
see \formatNames()
author Mark Grimshaw
version 1

Parameters

$creator

array

Associative array of creator name e.g.

array(['surname'] => 'Grimshaw', ['firstname'] => Mark, ['initials'] => 'M N G', ['prefix'] => ))

Initials must be space-delimited.

$initialsStyle

int

$firstNameInitial

boolean

Returns

stringFormatted string of initials.

For any replacement templates used for in-text citations, check we have fields to populate it with.

checkTemplateFields(array $template) 

If not, return FALSE to indicate that we use original $this->template

author Mark Grimshaw
version 1

Parameters

$template

array

Reformat the array representation of citation into a more useable format - Endnote style citations

citationToArrayEndnoteStyle() 
author Mark Grimshaw
version 1

Reformat the array representation of citation into a more useable format - In-text style citations

citationToArrayInTextStyle() 
author Mark Grimshaw
version 1

Collate the bibliography array for in-text-style citations.

collateIntextBibliography() : string
author Mark Grimshaw
version 1

Returns

string

Create RTF stylesheet

createStyleSheet() : string

Returns

string

Disambiguate any ambiguous citations

disambiguate() 
author Mark Grimshaw
version 1

Format the endnotes for endnote-style citations

endnoteProcess() : string
author Mark Grimshaw
version 1

Returns

string

Removing trailing spaces and punctuation for endnote-style bibliographic entries.

endnoteRemovePunc(string $entry) : string
author Mark Grimshaw
version 1

Parameters

$entry

string

Returns

string

Endnote style citations

endnoteStyle() : \Complete
author Mark Grimshaw
version 1

Returns

\Completestring ready for printing to the output medium.

Find alternate fields dependent on previous or following fields and deal with accordingly.

findAlternates(array $typeArray) 
author Mark Grimshaw
version 1

Parameters

$typeArray

array

Format the citation ID for endnote-style citations

formatCitationId(string $pre, string $post) : string
author Mark Grimshaw

Parameters

$pre

string

pre-characters

$post

string

post-characters

Returns

string

Format creator name lists (authors, editors, etc.)

formatNames(array $creators, int $citationId) 
author Mark Grimshaw
version 1

Parameters

$creators

array

Multi-associative array of creator names e.g. this array might be of the primary authors:

array([0] => array(['surname'] => 'Grimshaw', ['firstname'] => Mark, ['initials'] => 'N', ['prefix'] => ),
   [1] => array(['surname'] => 'Witt', ['firstname'] => Jan, ['initials'] => , ['prefix'] => 'de'))

$citationId

int

Format pages.

formatPages(string $start, string $end) : string

$this->style['pageFormat']: 0 == 132-9 1 == 132-39 2 == 132-139

author Mark Grimshaw
version 1

Parameters

$start

string

Page start.

$end

string

Page end.

Returns

stringof pages.

Format preText and postText.

formatPrePostText(string $preText, string $postText) 

[cite]23:34-35|see ` for example[/cite] (as used by WIKINDX)

author Mark Grimshaw
version 1

Parameters

$preText

string

$postText

string

Format a shortTitle.

formatShortTitle(string $pString, string $delimitLeft, string $delimitRight) : string

Anything enclosed in $delimitLeft...$delimitRight is to be left unchanged

author Mark Grimshaw
version 1

Parameters

$pString

string

Raw title string.

$delimitLeft

string

Default FALSE

$delimitRight

string

Default FALSE

Returns

stringFormatted title string.

Format a title.

formatTitle(string $pString, string $delimitLeft, string $delimitRight) : string

Anything enclosed in $delimitLeft...$delimitRight is to be left unchanged

author Mark Grimshaw
version 1

Parameters

$pString

string

Raw title string.

$delimitLeft

string

Default FALSE

$delimitRight

string

Default FALSE

Returns

stringFormatted title string.

Format URL.

formatUrl(string $url) 
author Mark Grimshaw
version 1

Parameters

$url

string

Format publication year.

formatYear(string $year) : string

$this->style['yearFormat']: 0 == 1998 1 == '98 2 == 98

author Mark Grimshaw
version 1

Parameters

$year

string

Returns

stringof year.

In-text style citations

inTextStyle() : \Complete
author Mark Grimshaw
version 1

Returns

\Completestring ready for printing to the output medium.

Some system initialisation

initialise() 

Localisations etc.

loadArrays() 
author Mark Grimshaw
version 1

Map the $item array against the style array and produce a string ready to be formatted for bold, italics etc.

map(array $template) : string
author Mark Grimshaw
version 1

Parameters

$template

array

Returns

stringready for printing to the output medium.

Format multiple citations

multiple(array $multiples) : string
author Mark Grimshaw
version 1

Parameters

$multiples

array

Citations

Returns

string

Parse independent strings of templates

parseIndependent($array) 
Author Mark Grimshaw

Parameters

$array

Print the bibliography for endnote-style citations.

printEndnoteBibliography(string $pString) : string
author Mark Grimshaw
version 1

Parameters

$pString

string

Returns

string

Loop through $this->items

process() : \Complete
author Mark Grimshaw
version 1

Returns

\Completestring ready for printing to the output medium.

Collate and format the bibliography for endnote-style citations.

processEndnoteBibliography(array $rows, array $ids) 

Must be processed in the same order as $ids. Where the id nos. are the same for each resource (endnote-style citations), store the bibliographic id order with an incrementing citation id no.

author Mark Grimshaw
version 1

Parameters

$rows

array

multiple array of raw bibliographic data to be processed by $this->bibStyle

$ids

array

resource ids giving order of processing bibliography

Format the bibliography for in-text-style citations.

processIntextBibliography(array $row) 
author Mark Grimshaw
version 1

Parameters

$row

array

array of raw bibliographic data for one resource to be processed by $this->bibStyle

Format RTF Page numbers

rtfPageNumbers(object $session) : string

Parameters

$session

object

Returns

string

Discover if creator name(s) is in same sentence and split citation if requested.

sameSentence(string $text) 
author Mark Grimshaw
version 1

Parameters

$text

string

Use subsequentTemplate only if creator surname, title or shortTitle exists in same sentence as citation

subsequentSentenceCheck() 

Transform the raw data from the XML file into usable arrays

getStyle() 
author Mark Grimshaw
version 1

 Properties

 

$dir 
 

$hyperlinkBase 
 

$items 
 

$output 
 

$rtfBibExport 
 

$suwpExport 
 

$wikindx 
 

$bibStyle 
 

$citationIds 
 

$citationInSameSentence 
 

$consecutiveCreatorSep 
 

$creatorIds 
 

$creatorSurnames 
 

$creators 
 

$endnoteCitations 
 

$endnoteSameIds 
 

$endnoteSameIdsArray 
 

$endnoteString 
 

$endnoteStringArray 
 

$endnotes 
 

$export 
 

$html 
 

$inTextDoneIds 
 

$intextBibliography 
 

$matchNameSplit 
 

$matchNameSplitEtAl 
 

$multipleCitations 
 

$nameInSameSentence 
 

$newParagraph 
 

$newSection 
 

$opCit 
 

$pageSplitDone 
 

$parseXml 
 

$previousNameInSameSentenceId 
 

$rtfDoneIds 
 

$storeOriginalTemplate 
 

$styleMap 
 

$styleSheet 
 

$template 
 

$utf8