\qfq Utils

Summary

Methods
Properties
Constants
__construct()
sanitize()
randomAlphaNumUnique()
setLockRecord()
checkLockRecord()
getFEUserName()
createUniqueDir()
createToolTip()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
randomAlphaNum()
$db
N/A

Properties

Methods

__construct()

__construct(  $db = null) 

Parameters

$db

sanitize()

sanitize() : Array

Sanitize GET and POST Parameters. Categorize Parameter: name begins with: 'S_' String: sanitize via t3lib_db::quoteStr, htmltospecialchars 'H_' HTML: no sanitize at all [Typo3, xdebug, zend debugger] special - no change [rest] has to be numeric - if not, will not be copied.

Returns

Array —

of sanitized GET and POST Variables. Only correctly filled variables will be returned.

randomAlphaNumUnique()

randomAlphaNumUnique() : string

Create a new _unique_ (max 20 tries, else breaks) hash string and saves it in $_SESSION[FORMREPORT][$hash]

Returns

string —

A random alphanumeric hash, or false if it was not possible to create a unique hash.

setLockRecord()

setLockRecord(string  $form, integer  $record_id, string  $tablename, string  $dbalias,   $tx_db_pi1) 

If record locking has been enabled in ext_localconf.php, create a record in the lock table

Parameters

string $form
integer $record_id
string $tablename
string $dbalias
$tx_db_pi1

checkLockRecord()

checkLockRecord(integer  $form, integer  $record_id, string  $tablename, \qfq\Db  $dbalias,   $tx_db_pi1) : array|boolean

If record locking has been enabled in ext_localconf.php, delete all expired locking records check if a record exists in the lock table for the currently edited record

Parameters

integer $form

form_id

integer $record_id

record_id

string $tablename

tablename

\qfq\Db $dbalias

Db class object

$tx_db_pi1

Returns

array|boolean —

information on locking mode, locking user and timestamp. false if not locked

getFEUserName()

getFEUserName(integer  $uid,   $tx_db_pi1) : string

Returns username for a fe_user_uid

Parameters

integer $uid

fe_user_uid

$tx_db_pi1

Returns

string —

username

createUniqueDir()

createUniqueDir(string  $path) : string

Create a unique directory in $path

Parameters

string $path

path

Throws

\qfq\codeException

Returns

string —

path/uniqedir

createToolTip()

createToolTip(string  $note) : array

Create a ToolTip: $toolTip[0] and $toolTip[1] have to inserted in HTML code accordingly.

Parameters

string $note

Text to be shown in the tooltip

Returns

array —

$toolTip $toolTip[0]: JS to show '$toolTip[1]'. $toolTip[1]: '...' with the tooltip text.

randomAlphaNum()

randomAlphaNum(integer  $length) : string

Parameters

integer $length

Length of the required hash string

Returns

string —

A random alphanumeric hash