PHP Class helper_plugin_data, dokuwiki-plugin-data

Inheritance: extends DokuWiki_Plugin
Datei anzeigen Open project: splitbrain/dokuwiki-plugin-data Class Usage Examples

Protected Properties

Property Type Description
$aliases stores the alias definitions
$db initialized via _getDb()
$locs stores custom key localizations

Public Methods

Method Description
__construct ( ) Constructor
_a2ua ( string $name, string | array $array ) : array prepare an array to be passed through buildURLparams()
_addPrePostFixes ( string | array $type, string $val, string $pre = '', string $post = '' ) : string Add pre and postfixs to the given value
_aliases ( ) : array Load defined type aliases
_cleanData ( string $value, string | array $type ) : string Makes sure the given data fits with the given type
_column ( string $col ) Split a column name into its parts
_formatData ( array $column, string $value, Doku_Renderer_xhtml $R ) : string Return XHTML formated data, depending on column type
_getDB ( ) : helper_plugin_sqlite | false load the sqlite helper
_getTagUrlparam ( array $column, string $tag ) : array Get url parameters, remove all filters for given column and add filter for desired tag
_get_current_param ( boolean $returnURLparams = true ) : array get current URL parameters
_get_filters ( ) : array Get filters given in the request via GET or POST
_parse_filter ( $filterline ) : array | boolean Parse a filter line into an array
_replacePlaceholdersInSQL ( &$data ) Replace placeholders in sql
_resolveData ( string $value, string $colname ) : string Resolve a value according to its column settings
ensureAbsoluteId ( $id )
makeTranslationReplacement ( string $data ) : string Replace translation related placeholders in given string
ready ( ) : boolean Simple function to check if the database is ready to use

Protected Methods

Method Description
determineLang ( ) : mixed Return language code

Private Methods

Method Description
loadLocalizedLabels ( )
replacePlaceholders ( string $value ) : string Perform replacements on the output values

Method Details

__construct() public method

Loads custom translations
public __construct ( )

_a2ua() public method

prepare an array to be passed through buildURLparams()
public _a2ua ( string $name, string | array $array ) : array
$name string keyname
$array string | array value or key-value pairs
return array

_addPrePostFixes() public method

$type may be an column array with pre and postfixes
public _addPrePostFixes ( string | array $type, string $val, string $pre = '', string $post = '' ) : string
$type string | array
$val string
$pre string
$post string
return string

_aliases() public method

Load defined type aliases
public _aliases ( ) : array
return array

_cleanData() public method

Makes sure the given data fits with the given type
public _cleanData ( string $value, string | array $type ) : string
$value string
$type string | array
return string

_column() public method

Split a column name into its parts
public _column ( string $col )
$col string column name

_formatData() public method

Return XHTML formated data, depending on column type
public _formatData ( array $column, string $value, Doku_Renderer_xhtml $R ) : string
$column array
$value string
$R Doku_Renderer_xhtml
return string

_getDB() public method

load the sqlite helper
public _getDB ( ) : helper_plugin_sqlite | false
return helper_plugin_sqlite | false plugin or false if failed

_getTagUrlparam() public method

Get url parameters, remove all filters for given column and add filter for desired tag
public _getTagUrlparam ( array $column, string $tag ) : array
$column array
$tag string
return array of url parameters

_get_current_param() public method

get current URL parameters
public _get_current_param ( boolean $returnURLparams = true ) : array
$returnURLparams boolean
return array with dataflt, datasrt and dataofs parameters

_get_filters() public method

Get filters given in the request via GET or POST
public _get_filters ( ) : array
return array

_parse_filter() public method

Parse a filter line into an array
public _parse_filter ( $filterline ) : array | boolean
$filterline
return array | boolean - array on success, false on error

_replacePlaceholdersInSQL() public method

Replace placeholders in sql
public _replacePlaceholdersInSQL ( &$data )

_resolveData() public method

This function is registered as a SQL function named DATARESOLVE
public _resolveData ( string $value, string $colname ) : string
$value string
$colname string
return string

determineLang() protected method

Return language code
protected determineLang ( ) : mixed
return mixed

ensureAbsoluteId() public method

public ensureAbsoluteId ( $id )

makeTranslationReplacement() public method

Replace translation related placeholders in given string
public makeTranslationReplacement ( string $data ) : string
$data string
return string

ready() public method

Simple function to check if the database is ready to use
public ready ( ) : boolean
return boolean

Property Details

$aliases protected_oe property

stores the alias definitions
protected $aliases

$db protected_oe property

initialized via _getDb()
protected $db

$locs protected_oe property

stores custom key localizations
protected $locs