WIKINDX API trunk

EXPORTCOMMON
in package

EXPORT COMMON class

Provides methods common to the export scripts. Exporting of both bibliographic formats (bibTeX, RIS etc.) and document formats (RTF, HTML etc.) is handled here.

Table of Contents

Properties

$citeStyle  : mixed
$context  : mixed
$fileName  : mixed
$filesDir  : mixed
$fp  : mixed
$fullFileName  : mixed
$trueFootnotes  : mixed
$wpPrefs  : mixed

Methods

__construct()  : mixed
checkCitationStyle()  : mixed
Check the citation style being used.
checkExportSections()  : array<string|int, mixed>
Check the WP paper and export preferences to see if there are sections that must be attended to
closeFile()  : mixed
Close a file
createFileName()  : array<string|int, mixed>
Create a file name
documentExportToHtml()  : mixed
Export of blocks of HTML text such as from the word processor Export HTML and write file (written over if it exists).
documentExportToHTML_ideas()  : mixed
Export of ideas Export HTML and write file (written over if it exists).
documentExportToHTML_resources()  : mixed
Export of resources Export HTML and write file (written over if it exists).
exportOptions()  : mixed
exportSections()  : mixed
Export the WP paper where there are sections that must be attended to
formatName()  : string
formatName - format one name depending on the export type
getCommonMetadata()  : array<string|int, mixed>
Get resource's quotes or paraphrases
getCustomFields()  : mixed
getMetadataDetails()  : false|string
Get metadata details such as pages, section etc.—for document export
getSQL()  : mixed
keywordFormat()  : string
keywordFormat - return formatted keywords with different delimiters—for bibliographic export
openFile()  : bool
Open/create a file
pageFormat()  : string
pageFormat - return formatted pageStart and pageEnd with different delimiters
setIdeasCondition()  : bool
set user/group ID conditions for ideas
titleFormat()  : string
titleFormat - format and return the resource title from the supplied SQL $row
writeFilenameToSession()  : mixed
writeFilenameToSession - add filename to session array

Properties

Methods

__construct()

public __construct([mixed $outputType = 'plain' ]) : mixed
Parameters
$outputType : mixed = 'plain'

checkCitationStyle()

Check the citation style being used.

public checkCitationStyle(array<string|int, mixed> $citation[, bool $name = false ]) : mixed

If $name == FALSE, returns integers for each basic style type: 1 —> endInc 2 —> endSameId and endSameIdOrdered 3 —> ftInc 4 —> inText

Else, the style type is returned as a name (one of: inText, ftInc, endInc, endSameId, endSameIdOrdered).

Parameters
$citation : array<string|int, mixed>
$name : bool = false

Default = FALSE

checkExportSections()

Check the WP paper and export preferences to see if there are sections that must be attended to

public checkExportSections(string $paper, array<string|int, mixed> $prefs) : array<string|int, mixed>
Parameters
$paper : string
$prefs : array<string|int, mixed>
Return values
array<string|int, mixed>

createFileName()

Create a file name

public createFileName(string $string, string $extension) : array<string|int, mixed>
Parameters
$string : string
$extension : string
Return values
array<string|int, mixed>

documentExportToHtml()

Export of blocks of HTML text such as from the word processor Export HTML and write file (written over if it exists).

public documentExportToHtml(string $text, array<string|int, mixed> $exportPrefs[, bool $html = true ]) : mixed

If $html = FALSE, this is an intermediary HTML for export to RTF etc. Don't write HTML headers and footers. Unlike documentExportToHTML_ideas() and documentExportToHTML_resources(), the calling script decides where the final file is stored. Thus, there are two options: 1. If $html is true, return the formatted text 2. Else, write the temporary HTML file and the fileName to the public $this->fileName, returning TRUE By default, export to full HTML (option 1.)

Parameters
$text : string
$exportPrefs : array<string|int, mixed>
$html : bool = true

documentExportToHTML_ideas()

Export of ideas Export HTML and write file (written over if it exists).

public documentExportToHTML_ideas([bool $html = true ]) : mixed

By default export to full HTML If $html = FALSE, this is an intermediary HTML for export to RTF etc. Don't write HTML headers and footers.

Parameters
$html : bool = true

documentExportToHTML_resources()

Export of resources Export HTML and write file (written over if it exists).

public documentExportToHTML_resources([bool $html = true ]) : mixed

By default export to full HTML If $html = FALSE, this is an intermediary HTML for export to RTF etc. Don't write HTML headers and footers.

Parameters
$html : bool = true

exportOptions()

public exportOptions([mixed $export = 'html' ]) : mixed
Parameters
$export : mixed = 'html'

exportSections()

Export the WP paper where there are sections that must be attended to

public exportSections(array<string|int, mixed> $sections, array<string|int, mixed> $prefs[, bool $html = true ]) : mixed
Parameters
$sections : array<string|int, mixed>
$prefs : array<string|int, mixed>
$html : bool = true

DEFAULT TRUE

formatName()

formatName - format one name depending on the export type

public formatName(assocArray $creatorRow, string $exportType) : string
Parameters
$creatorRow : assocArray
$exportType : string
Return values
string

getCommonMetadata()

Get resource's quotes or paraphrases

public getCommonMetadata(array<string|int, mixed> $rId, string $type) : array<string|int, mixed>
Parameters
$rId : array<string|int, mixed>
$type : string

('q' or 'p')

Return values
array<string|int, mixed>

getCustomFields()

public getCustomFields([mixed $export = 'bibtex' ]) : mixed
Parameters
$export : mixed = 'bibtex'

getMetadataDetails()

Get metadata details such as pages, section etc.—for document export

public getMetadataDetails(array<string|int, mixed> $row) : false|string
Parameters
$row : array<string|int, mixed>
Return values
false|string

keywordFormat()

keywordFormat - return formatted keywords with different delimiters—for bibliographic export

public keywordFormat(int $resId, string $exportType) : string
Parameters
$resId : int
$exportType : string
Return values
string

openFile()

Open/create a file

public openFile(string $extension[, string $mode = 'w' ][, false|string $string = false ]) : bool
Parameters
$extension : string
$mode : string = 'w'

– default 'w'

$string : false|string = false

– default FALSE

Return values
bool

pageFormat()

pageFormat - return formatted pageStart and pageEnd with different delimiters

public pageFormat(assocArray $row, string $exportType) : string
Parameters
$row : assocArray
$exportType : string
Return values
string

setIdeasCondition()

set user/group ID conditions for ideas

public setIdeasCondition() : bool
Return values
bool

titleFormat()

titleFormat - format and return the resource title from the supplied SQL $row

public titleFormat(assocArray $row[, bool $bibtex = false ]) : string
Parameters
$row : assocArray
$bibtex : bool = false
Return values
string

writeFilenameToSession()

writeFilenameToSession - add filename to session array

public writeFilenameToSession(string $fileName) : mixed
Parameters
$fileName : string

        
On this page

Search results