Class Context.
More...
|
| initController () |
| Init controller. More...
|
|
| addControllerDefinition ($controller, $path, $className) |
| Add controller definition. More...
|
|
| setControllerFound () |
| Set controller found. More...
|
|
| getRootUrl ($controller='', $moreParams='', $addToken=true) |
| Get root url. More...
|
|
| getControllerUrl ($controller='', $moreParams='', $addToken=true) |
| Get controller url according to context. More...
|
|
| userIsLog () |
| Check if user is logged. More...
|
|
| menuIsActive ($menuName) |
| Is menu enabled ? More...
|
|
| setError ($errors) |
| Set errors. More...
|
|
| getErrors () |
| Get errors. More...
|
|
| clearErrors () |
| Clear errors. More...
|
|
| setEventMessage ($mesgs, $style='mesgs') |
| Set event messages in dol_events session object. More...
|
|
| setEventMessages ($mesg, $mesgs, $style='mesgs') |
| Set event messages in dol_events session object. More...
|
|
| loadEventMessages () |
| Load event messages. More...
|
|
| clearEventMessages () |
| Clear event messages. More...
|
|
| newToken () |
| Return the value of token currently saved into session with name 'newToken'. More...
|
|
| getUrlToken () |
| Get token url. More...
|
|
| getFormToken () |
| Get token input for form. More...
|
|
| getThirdPartyAccountFromLogin ($login, $pass) |
| Try to find the third-party account id from. More...
|
|
|
static | getInstance () |
| Singleton method to create one instance of this object. More...
|
|
static | getRootConfigUrl () |
| Get WebPortal root url. More...
|
|
static | getPublicControllerUrl ($controller='', $moreParams='', $Tparams=array()) |
| Generate public controller URL Used for external link (like email or web page) so remove token and contextual behavior associate with current user. More...
|
|
static | urlOrigin ($withRequestUri=true, $use_forwarded_host=false) |
| Url origin. More...
|
|
Class Context.
Definition at line 32 of file context.class.php.
◆ __construct()
◆ addControllerDefinition()
Context::addControllerDefinition |
( |
|
$controller, |
|
|
|
$path, |
|
|
|
$className |
|
) |
| |
Add controller definition.
- Parameters
-
string | $controller | Name |
string | $path | Path |
string | $className | Class name |
- Returns
- bool
Definition at line 252 of file context.class.php.
◆ clearErrors()
◆ clearEventMessages()
Context::clearEventMessages |
( |
| ) |
|
◆ generateNewToken()
Context::generateNewToken |
( |
| ) |
|
|
protected |
◆ getControllerUrl()
Context::getControllerUrl |
( |
|
$controller = '' , |
|
|
|
$moreParams = '' , |
|
|
|
$addToken = true |
|
) |
| |
Get controller url according to context.
- Parameters
-
string | $controller | Controller name |
string | array | $moreParams | More parameters |
bool | $addToken | Add token hash only if controller is set |
- Returns
- string
Definition at line 324 of file context.class.php.
Referenced by getRootUrl().
◆ getErrors()
◆ getFormToken()
Context::getFormToken |
( |
| ) |
|
◆ getInstance()
static Context::getInstance |
( |
| ) |
|
|
static |
◆ getPublicControllerUrl()
static Context::getPublicControllerUrl |
( |
|
$controller = '' , |
|
|
|
$moreParams = '' , |
|
|
|
$Tparams = array() |
|
) |
| |
|
static |
Generate public controller URL Used for external link (like email or web page) so remove token and contextual behavior associate with current user.
- Parameters
-
string | $controller | Controller |
string | array | $moreParams | More parameters |
array | $Tparams | Parameters |
- Returns
- string
Definition at line 355 of file context.class.php.
◆ getRootConfigUrl()
static Context::getRootConfigUrl |
( |
| ) |
|
|
static |
Get WebPortal root url.
- Returns
- string Web Portal root url
Definition at line 285 of file context.class.php.
◆ getRootUrl()
Context::getRootUrl |
( |
|
$controller = '' , |
|
|
|
$moreParams = '' , |
|
|
|
$addToken = true |
|
) |
| |
◆ getThirdPartyAccountFromLogin()
Context::getThirdPartyAccountFromLogin |
( |
|
$login, |
|
|
|
$pass |
|
) |
| |
Try to find the third-party account id from.
- Parameters
-
string | $login | Login |
string | $pass | Password |
- Returns
- int Third-party account id || <0 if error
Definition at line 662 of file context.class.php.
◆ getUrlToken()
◆ initController()
Context::initController |
( |
| ) |
|
◆ loadEventMessages()
Context::loadEventMessages |
( |
| ) |
|
◆ menuIsActive()
Context::menuIsActive |
( |
|
$menuName | ) |
|
◆ newToken()
Return the value of token currently saved into session with name 'newToken'.
This token must be sent by any POST as it will be used by next page for comparison with value in session. This token depends on controller
- Returns
- string
Definition at line 595 of file context.class.php.
Referenced by generateNewToken(), getFormToken(), and getUrlToken().
◆ setControllerFound()
Context::setControllerFound |
( |
| ) |
|
◆ setError()
Context::setError |
( |
|
$errors | ) |
|
◆ setEventMessage()
Context::setEventMessage |
( |
|
$mesgs, |
|
|
|
$style = 'mesgs' |
|
) |
| |
Set event messages in dol_events session object.
Will be output by calling dol_htmloutput_events. Note: Calling dol_htmloutput_events is done into pages by standard llxFooter() function.
- Parameters
-
string | string[] | $mesgs | Message string or array |
string | $style | Which style to use ('mesgs' by default, 'warnings', 'errors') |
- Returns
- void
Definition at line 510 of file context.class.php.
◆ setEventMessages()
Context::setEventMessages |
( |
|
$mesg, |
|
|
|
$mesgs, |
|
|
|
$style = 'mesgs' |
|
) |
| |
Set event messages in dol_events session object.
Will be output by calling dol_htmloutput_events. Note: Calling dol_htmloutput_events is done into pages by standard llxFooter() function.
- Parameters
-
string | $mesg | Message string |
array | null | $mesgs | Message array |
string | $style | Which style to use ('mesgs' by default, 'warnings', 'errors') |
- Returns
- void
Definition at line 543 of file context.class.php.
◆ urlOrigin()
static Context::urlOrigin |
( |
|
$withRequestUri = true , |
|
|
|
$use_forwarded_host = false |
|
) |
| |
|
static |
Url origin.
- Parameters
-
bool | $withRequestUri | With request URI |
bool | $use_forwarded_host | Use formatted host |
- Returns
- string
Definition at line 409 of file context.class.php.
◆ userIsLog()
The documentation for this class was generated from the following file: