BIBCITEGATEWAY
in package
BIBCITEGATEWAY class.
Gateway to all bibliographic and citation formatting.
Steps:
- Load the class and set any flags (see below).
- a) For citations, call $this->parseCitations() that takes text to be marked up as the single parameter and returns the marked-up text along with appended bibliography/endnotes.
Table of Contents
Properties
- $allConditions : mixed
- array
- $allJoins : mixed
- array
- $browserTabID : mixed
- bool|string
- $compiledCitationTemplates : mixed
- array
- $customFields : mixed
- array
- $db : mixed
- object
- $footnotesResource : mixed
- array
- $hyperlinkBase : mixed
- bool
- $noHtmlEncode : mixed
- array
- $replaceInTextCitationTemplates : mixed
- array
- $session : mixed
- object
- $stmt : mixed
- object
- $styleMap : mixed
- object
- $templateEndnote : mixed
- array
- $templateEndnoteInText : mixed
- array
- $templateIbid : mixed
- array
- $templateIdem : mixed
- array
- $templateOpCit : mixed
- array
Methods
- cleanText() : string
- Clean the input text by ensuring we have valid cite and footnote tags (remove invalid tags)
- getBibEndnotesInc() : array<string|int, mixed>
- Get items and other data for incrementing endnotes
- getBibEndnotesSameId() : array<string|int, mixed>
- Get items and other data for endnotes using same ID for same resource
- getBibFootnotes() : array<string|int, mixed>
- Get items and other data for footnotes
- getBibInText() : array<string|int, mixed>
- Get items and other data for in-text bibliographies
- getBibliographyFromCitations() : string
- Produce the bibliography from cited text.
- getCreatorIdString() : mixed
- Get creatorIdString for each resource
- getCreatorIdStringWithArray() : mixed
- Get creatorIdString for each resource
- getPreviewBibOrder() : array<string|int, mixed>
- Return ordered $resIds for inText and endSameIdOrdered preview bibliography/endnotes.
- getResourceData() : array<string|int, mixed>
- Get resource data
- getResourcesCollection() : array<string|int, mixed>
- Get collection resource data
- getResourcesCreators() : mixed
- Get creator resource data for each sentence and creatorIdStrings
- getResourcesCustom() : array<string|int, mixed>
- Get custom resource data
- getResourcesPublisher() : array<string|int, mixed>
- Get publisher resource data
- getResourcesUrl() : array<string|int, mixed>
- Get URL resource data from resource ids
- getSentenceResources() : array<string|int, mixed>
- Get resource data for each sentence
- getSentenceResourcesPreview() : array<string|int, mixed>
- Get resource data for each sentence—for style previewing only.
- grabCustomFields() : mixed
- Grab any custom fields
- printBibliography() : string
- Print the bibliography/endnotes
- setCitationOrder() : array<string|int, mixed>
- Set ordering as per the bibliographic ordering set for the style when parsing cited text
- setResourceConditions() : string
- Set the order resources should be returned in, join tables, and return resource fields for a list of resources.
- setResourceOrder() : mixed
- Set the resource order.
- setSingleResourceConditions() : string
- Join tables, and return resource fields when getting data for a single ressource.
Properties
$allConditions
array
private
mixed
$allConditions
= []
$allJoins
array
private
mixed
$allJoins
= []
$browserTabID
bool|string
private
mixed
$browserTabID
= \FALSE
$compiledCitationTemplates
array
private
mixed
$compiledCitationTemplates
= []
$customFields
array
private
mixed
$customFields
= []
$db
object
private
mixed
$db
$footnotesResource
array
private
mixed
$footnotesResource
= []
$hyperlinkBase
bool
private
mixed
$hyperlinkBase
= \WIKINDX_URL_BASE . "/index.php?action=resource_RESOURCEVIEW_CORE&id="
$noHtmlEncode
array
private
mixed
$noHtmlEncode
= ['resourceTitle', 'resourcetextSubtitle', 'resourcetextAbstract', 'resourcetextNote']
$replaceInTextCitationTemplates
array
private
mixed
$replaceInTextCitationTemplates
= []
$session
object
private
mixed
$session
$stmt
object
private
mixed
$stmt
$styleMap
object
private
mixed
$styleMap
$templateEndnote
array
private
mixed
$templateEndnote
= []
$templateEndnoteInText
array
private
mixed
$templateEndnoteInText
= []
$templateIbid
array
private
mixed
$templateIbid
= []
$templateIdem
array
private
mixed
$templateIdem
= []
$templateOpCit
array
private
mixed
$templateOpCit
= []
Methods
cleanText()
Clean the input text by ensuring we have valid cite and footnote tags (remove invalid tags)
private
cleanText(string $text) : string
Parameters
- $text : string
-
Input text
Return values
stringgetBibEndnotesInc()
Get items and other data for incrementing endnotes
private
getBibEndnotesInc(array<string|int, mixed> $footnotes, array<string|int, mixed> $footnotePages, array<string|int, mixed> $resourceData, array<string|int, mixed> $citationData, string $citeLocalisation, string $allPuncPattern, string $shortPuncsPatternStripped, string $space) : array<string|int, mixed>
Parameters
- $footnotes : array<string|int, mixed>
- $footnotePages : array<string|int, mixed>
- $resourceData : array<string|int, mixed>
- $citationData : array<string|int, mixed>
- $citeLocalisation : string
- $allPuncPattern : string
- $shortPuncsPatternStripped : string
- $space : string
Return values
array<string|int, mixed>getBibEndnotesSameId()
Get items and other data for endnotes using same ID for same resource
private
getBibEndnotesSameId(array<string|int, mixed> $resourceData, array<string|int, mixed> $citationData, string $citeLocalisation, string $allPuncPattern, string $shortPuncsPatternStripped, string $space) : array<string|int, mixed>
Parameters
- $resourceData : array<string|int, mixed>
- $citationData : array<string|int, mixed>
- $citeLocalisation : string
- $allPuncPattern : string
- $shortPuncsPatternStripped : string
- $space : string
Return values
array<string|int, mixed>getBibFootnotes()
Get items and other data for footnotes
private
getBibFootnotes(array<string|int, mixed> $footnotes, array<string|int, mixed> $footnotePages, array<string|int, mixed> $resourceData, array<string|int, mixed> $citationData, string $citeLocalisation, string $allPuncPattern, string $shortPuncsPatternStripped, string $space) : array<string|int, mixed>
Parameters
- $footnotes : array<string|int, mixed>
- $footnotePages : array<string|int, mixed>
- $resourceData : array<string|int, mixed>
- $citationData : array<string|int, mixed>
- $citeLocalisation : string
- $allPuncPattern : string
- $shortPuncsPatternStripped : string
- $space : string
Return values
array<string|int, mixed>getBibInText()
Get items and other data for in-text bibliographies
private
getBibInText(array<string|int, mixed> $resourceData, array<string|int, mixed> $citationData, array<string|int, mixed> $footnotes, string $citeLocalisation, string $allPuncPattern, string $shortPuncsPatternStripped, string $space) : array<string|int, mixed>
Parameters
- $resourceData : array<string|int, mixed>
- $citationData : array<string|int, mixed>
- $footnotes : array<string|int, mixed>
- $citeLocalisation : string
- $allPuncPattern : string
- $shortPuncsPatternStripped : string
- $space : string
Return values
array<string|int, mixed>getBibliographyFromCitations()
Produce the bibliography from cited text.
private
getBibliographyFromCitations(array<string|int, mixed> $citationData, array<string|int, mixed> $resourceData, array<string|int, mixed> $bibFootnoteIds, array<string|int, mixed> $footnoteOrder, array<string|int, mixed> $footnotes, mixed $footnotePages, array<string|int, mixed> $endSameIds) : string
Template and creators arrays are dynamic and might be modified by various functions so be careful how you pass them to functions.
NB While the parsing of citations uses $this->info['citeLocalisation'], formatting bibliographies uses $this->info['styleLocalisation']
Parameters
- $citationData : array<string|int, mixed>
- $resourceData : array<string|int, mixed>
- $bibFootnoteIds : array<string|int, mixed>
- $footnoteOrder : array<string|int, mixed>
- $footnotes : array<string|int, mixed>
- $footnotePages : mixed
- $endSameIds : array<string|int, mixed>
Return values
stringgetCreatorIdString()
Get creatorIdString for each resource
private
getCreatorIdString(int $rId, array<string|int, mixed> $creators) : mixed
Parameters
- $rId : int
- $creators : array<string|int, mixed>
-
return string
getCreatorIdStringWithArray()
Get creatorIdString for each resource
private
getCreatorIdStringWithArray(array<string|int, mixed> $creators) : mixed
Parameters
- $creators : array<string|int, mixed>
-
return string
getPreviewBibOrder()
Return ordered $resIds for inText and endSameIdOrdered preview bibliography/endnotes.
private
getPreviewBibOrder() : array<string|int, mixed>
We create temporary table so we can use MySQL ordering as we do for full bibliography output.
Return values
array<string|int, mixed>getResourceData()
Get resource data
private
getResourceData(array<string|int, mixed> $resIds, int $editorSwitch, int $usePrefix[, bool $full = FALSE ][, bool $list = FALSE ][, array<string|int, mixed> $listParams = [] ]) : array<string|int, mixed>
Parameters
- $resIds : array<string|int, mixed>
- $editorSwitch : int
- $usePrefix : int
- $full : bool = FALSE
-
(Default is FALSE)
- $list : bool = FALSE
-
(Default is FALSE)
- $listParams : array<string|int, mixed> = []
-
(Default is [])
Return values
array<string|int, mixed>getResourcesCollection()
Get collection resource data
private
getResourcesCollection(int $id[, bool $withCollection = FALSE ]) : array<string|int, mixed>
$id can be a single resource id or an array of resource ids
Parameters
- $id : int
- $withCollection : bool = FALSE
-
DEfault = FALSE
Return values
array<string|int, mixed>getResourcesCreators()
Get creator resource data for each sentence and creatorIdStrings
private
getResourcesCreators(mixed $id[, book $withCreators = FALSE ]) : mixed
$id can be a single resource id or an array of resource ids
Parameters
- $id : mixed
- $withCreators : book = FALSE
-
Default = FALSE
getResourcesCustom()
Get custom resource data
private
getResourcesCustom(int $id[, book $withCustom = FALSE ]) : array<string|int, mixed>
$id can be a single resource id or an array of resource ids
Parameters
- $id : int
- $withCustom : book = FALSE
-
Default = FALSE
Return values
array<string|int, mixed>getResourcesPublisher()
Get publisher resource data
private
getResourcesPublisher(int $id[, book $withPublisher = FALSE ]) : array<string|int, mixed>
$id can be a single resource id or an array of resource ids
Parameters
- $id : int
- $withPublisher : book = FALSE
-
Default = FALSE
Return values
array<string|int, mixed>getResourcesUrl()
Get URL resource data from resource ids
private
getResourcesUrl(mixed $id[, book $withURL = FALSE ]) : array<string|int, mixed>
$id can be a single resource id or an array of resource ids
Parameters
- $id : mixed
- $withURL : book = FALSE
-
Default = FALSE
Return values
array<string|int, mixed>getSentenceResources()
Get resource data for each sentence
private
getSentenceResources(array<string|int, mixed> $sentences, int $editorSwitch, int $usePrefix) : array<string|int, mixed>
Parameters
- $sentences : array<string|int, mixed>
- $editorSwitch : int
- $usePrefix : int
Return values
array<string|int, mixed>getSentenceResourcesPreview()
Get resource data for each sentence—for style previewing only.
private
getSentenceResourcesPreview(array<string|int, mixed> $sentences) : array<string|int, mixed>
Resource data comes from the array $previewResources which, for each citation, has 'resource', 'creators' and 'URL' elements.
Parameters
- $sentences : array<string|int, mixed>
Return values
array<string|int, mixed>grabCustomFields()
Grab any custom fields
private
grabCustomFields() : mixed
printBibliography()
Print the bibliography/endnotes
private
printBibliography(array<string|int, mixed> $bibEntries, array<string|int, mixed> $bibFootnoteIds, array<string|int, mixed> $endnoteIds) : string
Parameters
- $bibEntries : array<string|int, mixed>
- $bibFootnoteIds : array<string|int, mixed>
- $endnoteIds : array<string|int, mixed>
Return values
stringsetCitationOrder()
Set ordering as per the bibliographic ordering set for the style when parsing cited text
private
setCitationOrder() : array<string|int, mixed>
Return values
array<string|int, mixed>setResourceConditions()
Set the order resources should be returned in, join tables, and return resource fields for a list of resources.
private
setResourceConditions([bool $full = FALSE ][, bool $list = FALSE ][, array<string|int, mixed> $listParams = [] ]) : string
For a bibliography pulled from cited text, minimal information is required. Resources otherwise require more information and this is triggered by setting $full to TRUE (default is FALSE)
Parameters
- $full : bool = FALSE
- $list : bool = FALSE
-
(Default is FALSE)
- $listParams : array<string|int, mixed> = []
-
(Populated if $list = TRUE)
Return values
stringsetResourceOrder()
Set the resource order.
private
setResourceOrder([bool $list = FALSE ][, array<string|int, mixed> $listParams = [] ]) : mixed
The order is important:
- for in-text citations as it controls disambiguation where a letter is added after the year.
- 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.
- for endnote-style citations having the same id no. for the same resource where the id no. in the text follows the bibliography order.
Parameters
- $list : bool = FALSE
-
(Default is FALSE)
- $listParams : array<string|int, mixed> = []
-
(Populated if $list = TRUE)
setSingleResourceConditions()
Join tables, and return resource fields when getting data for a single ressource.
private
setSingleResourceConditions() : string