WIKINDX API trunk

LOADCONFIG
in package

LOADCONFIG

Load config variables from the database

Table of Contents

Methods

allowRun()  : bool
When a user logs on, the routines here are called again with the user's information.
condJoin()  : array<string|int, mixed>
Create condition and join clauses for loadDbConfig() related to quarantine and bibliography settings.
filterMethod()  : mixed
Filter function for method GET parameter
getVars()  : mixed
Make sure we get HTTP VARS in whatever format they come in
setBrowserTabID()  : bool
At this point, we need to define WIKINDX_BROWSER_TAB_ID so we can set up the storage system and use STORE.
stats()  : mixed
Load and store statistical information about the database and its resources (used, e.g. in advsearch and in decisions about which menu options to make available). Avoids multiple db calls.
stripHtmlTags()  : mixed
Strip some HTML tags from string (and check for json-encoded array).

Methods

allowRun()

When a user logs on, the routines here are called again with the user's information.

private allowRun() : bool

This routine stops the initial database query for routines such as stats when that information would be useless. The routine is also used for publication lists.

Faster loading of the initial logon is the result.

Return values
bool

condJoin()

Create condition and join clauses for loadDbConfig() related to quarantine and bibliography settings.

private condJoin(string $field[, bool $joinMisc = FALSE ]) : array<string|int, mixed>

This helps control what menu options are available, fields searchable in advsearch, etc.

Parameters
$field : string
$joinMisc : bool = FALSE

= FALSE

Return values
array<string|int, mixed>

filterMethod()

Filter function for method GET parameter

private filterMethod(mixed $value) : mixed

Method should have the format of an array key of a wikindxMessages() catalog

Parameters
$value : mixed

getVars()

Make sure we get HTTP VARS in whatever format they come in

private getVars() : mixed

Use $vars = GLOBALS::getVars(); to get querystrings and form elements

setBrowserTabID()

At this point, we need to define WIKINDX_BROWSER_TAB_ID so we can set up the storage system and use STORE.

private setBrowserTabID(array<string|int, mixed> $tmp_config) : bool

Using browserTabID depends on the browser supporting localstorage. However, tempStorage is used in two ways:

  1. Storage of 'session' variables is in memory during the lifetime of the script and variables can be accessed with the GLOBALS class methods.
  2. If browserTabID is working, GLOBALS::initTempstorage grabs any previous 'session' variables unique to the browser window/tab from the temp_storage table and loads them into memory for access with the GLOBALS class methods. As the script closes, the CLOSE class (and inherited classes) writes those variables to the temp_storage table. The CLOSE::tidySession() method handles any use by AJAX routines as long as those routines set the pure session variable 'browserTabID' and appropriate arrays of keys in 'removeTempStorage' or key-value pairs in 'addTempStorage'.

The core/libs/TEMPSTORAGE namespace handles direct access to the temp_storage table.

Note that, when viewing a publications list, LOADCONFIG is called again so we must check if WIKINDX_BROWSER_TAB_ID is defined or not.

Parameters
$tmp_config : array<string|int, mixed>
Return values
bool

stats()

Load and store statistical information about the database and its resources (used, e.g. in advsearch and in decisions about which menu options to make available). Avoids multiple db calls.

private stats(int $userId) : mixed
Parameters
$userId : int

stripHtmlTags()

Strip some HTML tags from string (and check for json-encoded array).

private stripHtmlTags(mixed $element) : mixed

Since adding tinymce, we only strip javascript and the enclosing

tag tinymce adds

Parameters
$element : mixed

        
On this page

Search results