Bundle of functions widely used in several scripts. More...
Go to the source code of this file.
Functions | |
displayTemplateWithErrorsAndSuccesses ($title, $fileName) | |
exitWithErrorTemplate ($errorTextArray=null) | |
exitWithErrorTemplateAndRedirect ($errorTextArray=null, $url, $delay=2) | |
exitWithSuccessTemplateAndRedirect ($successTextArray=null, $url, $delay=2) | |
kdsort (&$arr, $colIdx, $dir=SORT_ASC) | |
isValidEmail ($email) | |
isValidMobile ($mobile) | |
isValidPhone ($phone) | |
prepareFilename ($fileName) | |
addSchemeToURL ($url, $schemeToAdd= 'http://') | |
Variables | |
const | TPL_ERRORS 'error.tpl' |
const | TPL_SUCCESSES 'nocontent.tpl' |
Bundle of functions widely used in several scripts.
The file provides a bundle of functions widely used in several scripts. This include several abstractions of smarty template commands as well as some general purpose filters and the specially designed kdsort-algorithm.
This file requires the global $smarty.
Definition in file functions.php.
addSchemeToURL | ( | $url, | |
$schemeToAdd = 'http://' |
|||
) |
Adds the string http-scheme to an url if not exists
string | $url | url to check and to add scheme |
string | $schemeToAdd |
|
Definition at line 247 of file functions.php.
displayTemplateWithErrorsAndSuccesses | ( | $title, | |
$fileName | |||
) |
Displays a template with error and success messages
string | $title | title of the page assigned by template engine |
string | $fileName | filename of the template to load and display |
Definition at line 30 of file functions.php.
References $errors, $scriptDurationStartValue, $smarty, and $successes.
Referenced by exitWithErrorTemplate(), exitWithErrorTemplateAndRedirect(), and exitWithSuccessTemplateAndRedirect().
exitWithErrorTemplate | ( | $errorTextArray = null ) |
Displays the error template with error messages and stop the execution
array | $errorTextArray | [optional]
|
Definition at line 59 of file functions.php.
References $errors, $smarty, displayTemplateWithErrorsAndSuccesses(), and TPL_ERRORS.
Referenced by fetchContactPersonsWithMailAdresses(), fetchMailAdresses(), fetchMailAdressesNewsletter(), fetchSponsorAddresses(), and fetchSponsorMailNewsletter().
exitWithErrorTemplateAndRedirect | ( | $errorTextArray = null , |
|
$url, | |||
$delay = 2 |
|||
) |
Displays the error template with error messages, stop the execution and redirect to a url
array | $errorTextArray | [optional]
|
string | $url | url to redirect |
integer | $delay | [optional]
|
Definition at line 83 of file functions.php.
References $errors, $smarty, displayTemplateWithErrorsAndSuccesses(), and TPL_ERRORS.
exitWithSuccessTemplateAndRedirect | ( | $successTextArray = null , |
|
$url, | |||
$delay = 2 |
|||
) |
Displays the success template with success messages, stop the execution and redirect to a url
array | $successTextArray | [optional]
|
string | $url | url to redirect |
integer | $delay | [optional]
|
Definition at line 113 of file functions.php.
References $smarty, $successes, displayTemplateWithErrorsAndSuccesses(), and TPL_SUCCESSES.
isValidEmail | ( | $email) |
Checks if an email is valid
string | email to check |
Definition at line 181 of file functions.php.
isValidMobile | ( | $mobile) |
Checks if a mobil number is valid
string | $mobile | mobile number to check |
Definition at line 195 of file functions.php.
isValidPhone | ( | $phone) |
Checks if a telephone number is valid
string | $phone | the phone number to check |
Definition at line 213 of file functions.php.
kdsort | ( | & | $arr, |
$colIdx, | |||
$dir = SORT_ASC |
|||
) |
Sorts an two-dimensional array by a key in the second dimension
array | &$arr | array to sort the array will be sorted in place |
integer | $colIdx | index of the column in the second dimension to sort by |
integer | $dir | [optional]
|
Definition at line 144 of file functions.php.
Referenced by LoggedInUser\storeResult().
prepareFilename | ( | $fileName) |
Gets a valid filename by replacing some special chars
string | $fileName | filename to prepare |
Definition at line 230 of file functions.php.
const TPL_ERRORS 'error.tpl' |
Definition at line 21 of file functions.php.
Referenced by exitWithErrorTemplate(), and exitWithErrorTemplateAndRedirect().
const TPL_SUCCESSES 'nocontent.tpl' |
Definition at line 22 of file functions.php.
Referenced by exitWithSuccessTemplateAndRedirect().