RESOURCECOMMON class

Common functions for quotes and paraphrases

version 1
package wikindx4\core\resources
author Mark Grimshaw

 Methods

RESOURCECOMMON

__construct() 

Do pattern highlighting after a SEARCH operation

doHighlight(string $text) : string

Parameters

$text

string

Returns

string

Return resultset for one or more resources.

getResource(array $ids, string $order1, string $order2, string $order3, string $subQuery, boolean $sqlOnly) : mixed

NB -- resource ID conditions can be set elsewhere $orderX is for footnote ordering in CITESTYLE/CITEFORMAT or $order1 is for the ordering of CMS output.

Parameters

$ids

array

Resource IDs, default is FALSE

$order1

string

Default is FALSE

$order2

string

Default is FALSE

$order3

string

Default is FALSE

$subQuery

string

Can come from elsewhere such as core/cms/CMS.php. Default is FALSE

$sqlOnly

boolean

Don't execute, just return SQL statement. Default is FALSE

Returns

mixedSQL statement|SQL resource object

Insert new resource into database.

insert(array $v, boolean $alreadyExisted, array $errs) : \returns: mixed
todo Needs code-review! Is this even where this function should be?

Parameters

$v

array

POST/GET variables needed to create resource (the actual required and optional keys should be specified)

$alreadyExisted

boolean

Indicates if the resource already exists. Reference, default is FALSE

$errs

array

Array to push any errors that occur. Reference, default is empty array

Returns

\returnsthe id of the (new or already existing) resource or returns FALSE on failure.
mixedFALSE|Resource ID

Set up highlighting of text if required (after a search operation).

setHighlightPatterns() 

Creates array of regexp expressions for search terms

show citations about this resource

showCitations(int $resourceId, boolean $countOnly) 

Parameters

$resourceId

int

$countOnly

boolean

Default is FALSE

set DB stuff including list operation fields

tableSetup() 

Add field to fields array

addField(array $fields, string $prefix, string $name, string $value) 

Parameters

$fields

array

Reference

$prefix

string

$name

string

$value

string

Format field name

fieldName(string $prefix, string $base) : string

Parameters

$prefix

string

$base

string

Returns

string

 Properties

 

$attachmentFields 
 

$categoryFields 
 

$collectionFields 
 

$groupByResourceId 
 

$keywordFields 
 

$languageFields 
 

$listFields 
 

$musingFields 
 

$pageFields 
 

$publisherFields 
 

$resourceFields 
 

$resourceMiscFields 
 

$summaryFields 
 

$textFields 
 

$timestampFields 
 

$unixTimestampFields 
 

$userFields 
 

$withUnixTimestamp 
 

$yearFields 
 

$commonBib 
 

$commonBrowse 
 

$db 
 

$errors 
 

$gatekeep 
 

$highlightPatterns 
 

$html 
 

$messages 
 

$resourceMap 
 

$session