LEPTON CMS 7.0.0
feel free to keep it strictly simple...
Loading...
Searching...
No Matches
LEPTON_request Class Reference

Inherits LEPTON_abstract.

Public Member Functions

 initialize ()
 
 testPostValues (array &$aValueList)
 
 testGetValues (array &$aValueList)
 
 get_request (string $aName="", string|int|array|float|null $aDefault=null, string $type="", string|array $range="")
 
- Public Member Functions inherited from LEPTON_abstract
 getHeadInfo ()
 
 showmodinfo (array $modvalues=[], bool $bPrompt=true)
 
 getEditorSettings ()
 
 getAdditionalClass (string $basename="settings", string $classname="")
 

Static Public Member Functions

static add_slash (string &$sText="")
 
static getRequest (string $sField="")
 
static getPageID ()
 
- Static Public Member Functions inherited from LEPTON_abstract
static getInstance ()
 
static saveLastEditSection (int $iSectionID=0)
 
static getConstants ()
 

Data Fields

string $strict_looking_inside = "post"
 
bool $error_mode = false
 
string $logFileName = "LEPTON_request.log"
 
string $logFilePath = "/temp/secure/"
 
array $errors = []
 
- Data Fields inherited from LEPTON_abstract
const NOT_SET_IN_INFO = "(unknown - not set in info.php)"
 
array $language = []
 
array $parents = []
 
string $module_directory = ""
 
string $module_name = ""
 
string $module_function = ""
 
string $module_version = ""
 
string $module_platform = ""
 
int $module_delete = 1
 
string $module_author = ""
 
string $module_license = ""
 
string $module_license_terms = ""
 
string $module_description = ""
 
string $module_guid = ""
 
string $module_home = ""
 

Static Public Attributes

static $instance
 
- Static Public Attributes inherited from LEPTON_abstract
static $instance
 

Protected Member Functions

 testType (string $name, string $expected, string $getTypeResult)
 
 writeInfoToLogfile (string $sMessage="")
 
- Protected Member Functions inherited from LEPTON_abstract
 getParents ()
 
 getModuleInfo ()
 
 getLanguageFile ()
 
 getMainClassNames ( $sAnyClassname)
 

Detailed Description

This file is part of LEPTON Core, released under the GNU GPL Please see LICENSE and COPYING files in your package for details, specially for terms and warranties.

NOTICE:LEPTON CMS Package has several different licenses. Please see the individual license in the header of each single file or info.php of modules and templates.

Author
LEPTON Project

Definition at line 25 of file lepton_request.php.

Member Function Documentation

◆ add_slash()

static add_slash ( string &  $sText = "")
static

Definition at line 514 of file lepton_request.php.

◆ get_request()

get_request ( string  $aName = "",
string|int|array|float|null  $aDefault = null,
string  $type = "",
string|array  $range = "" 
)

Public function that looks for a value in the $_POST or $_GET super-variables. If it is found and the type match it is returned. If not, the given default value is returned. There are also optional settings for the situation, the value has to be in a given range, and/or the string has to be a given size.

Parameters
stringname Name of the value/key
mixeddefault (optional) The default of this value
stringtype (optional) The type of the value, see list below
arrayrange (optional) The settings for testing if the value is inside a range.

@retuns mixed the value

NOTICE: the range-settings have no effekt if the default-value is set to NULL.

Supported types are (quick-, short-, long-notation)

integer Any integer integer+ Any positive integer +0 integer- Any negative integer +0

string Any string string_clean Any string - HTML tags will be removed! string_chars Any String - but tags are converted via htmlspecialchars! string_allowed Any String - HTML tags are removed, exept the given one in "range"!

email Any mail adress array Any array (e.g. from a multible select)

Range got following keys/options

min     the minmium, as for integers the lowest number, as for strings the min. number of chars.
        default: 0;

max     the maximum, as for integers the heights number, as for strings the max. number of chars.
        default: 255;

use     what kind of use if the value is not inside the range, supported types are
        - default   use the given default value (integer, string, NULL)
        - min       however (value is less or more out of the range) use the min-value.
        - max       however (value is less or more out of the range) use the max-value.
        - near      if the value is less, use the min-value, if it is more, use the max-value.
        - fill      only for strings.
        - cut       only for strings.
                    default: 'default'

char    default: ' 'if #fill is used and the number of chars is less than the min-value,
        the string is 'filled' up with this char.
        default: ' ' (space|blank)

If one of the keys/options is missing, the default-settings are used. NOTICE: the range-settings have no effekt if the default-value is set to NULL.

Exceptions
Exception

Definition at line 219 of file lepton_request.php.

◆ getPageID()

static getPageID ( )
static

Definition at line 672 of file lepton_request.php.

◆ getRequest()

static getRequest ( string  $sField = "")
static

Definition at line 641 of file lepton_request.php.

◆ initialize()

initialize ( )

Abstract declarations - to be overwritten by the child-instance.

Reimplemented from LEPTON_abstract.

Definition at line 76 of file lepton_request.php.

◆ testGetValues()

testGetValues ( array &  $aValueList)

Testing a list of values against the $_GET array and returns a linear list of the results. This method is similar to testPostValues

Parameters
arrayAn array with an assoc. subarray for the 'keys' to test for.
// a simple list of values to test agains $_GET
$aLookUp = array(
'page_id' => array('type' => 'integer+', 'default' => NULL),
'section_id' => array('type' => 'integer+', 'default' => NULL),
'hello_text' => array('type' => 'string', 'default' => ''),
'content' => array('type' => 'string_chars', 'default' => ""),
'text' => array('type' => 'string_clean', 'default' => ""),
'input' => array('type' => 'string_allowed', 'default' => "", 'range' => array('h1','h2','h3') )
);
Returns
array The results as an assoc. array.

Definition at line 142 of file lepton_request.php.

◆ testPostValues()

testPostValues ( array &  $aValueList)

Testing a list of values against the $_POST array and returns a linear list of the results.

Parameters
arrayAn array with an assoc. subarray for the 'keys' to test for.
// a simple list of values to test agains $_POST
$aLookUp = array(
'page_id' => array('type' => 'integer+', 'default' => NULL),
'section_id' => array('type' => 'integer+', 'default' => NULL),
'hello_text' => array('type' => 'string', 'default' => ''),
'content' => array('type' => 'string_chars', 'default' => ""),
'text' => array('type' => 'string_clean', 'default' => ""),
'input' => array('type' => 'string_allowed', 'default' => "", 'range' => array('h1','h2','h3') )
);
Returns
array The results as an assoc. array.

Definition at line 102 of file lepton_request.php.

◆ testType()

testType ( string  $name,
string  $expected,
string  $getTypeResult 
)
protected

Definition at line 711 of file lepton_request.php.

◆ writeInfoToLogfile()

writeInfoToLogfile ( string  $sMessage = "")
protected

Definition at line 739 of file lepton_request.php.

Field Documentation

◆ $error_mode

bool $error_mode = false

By default we are not collecting any errors

Since
0.1.0 @type bool @default false

Definition at line 48 of file lepton_request.php.

◆ $errors

array $errors = []

Public var that holds the errors in an array.

Since
0.1.0 @type array @default empty array

Definition at line 74 of file lepton_request.php.

◆ $instance

$instance
static

Definition at line 28 of file lepton_request.php.

◆ $logFileName

string $logFileName = "LEPTON_request.log"

The name of the log file of the request errors.

@type string @access public

Definition at line 56 of file lepton_request.php.

◆ $logFilePath

string $logFilePath = "/temp/secure/"

The default path for the (error-) log file.

@type string @access public

Definition at line 64 of file lepton_request.php.

◆ $strict_looking_inside

string $strict_looking_inside = "post"

Public var to handle the way the class should look for the value; supported types are 'post', 'get' or 'request'

@type string @default "post"

Definition at line 38 of file lepton_request.php.


The documentation for this class was generated from the following file: