Modes
MMO\client · 1 symbole · générée le 27 Oct 2026
Modes
Modes.php:41The display modes of the application (Mode): one level -- how dense it is, simple, standard or expert -- and any number of layers drawn over it -- dev, writer... A mode is presentation only: what a user may do stays their scopes' (mmo.oauth), a mode only decides what is shown.
- Espace de noms
MMO\client- Étend
- aModule
Index
| LEVELS | the levels mmo.client knows: id => [label, icon, rank, description] | |
| SESSION | the session key of the url's override | |
| access | ||
| all | ||
| cookie | ||
| default | ||
| enabled | ||
| layers | ||
| level | ||
| levels | ||
| modes | ||
| query | ||
| all() | ||
| atLeast($level) | ||
| available() | ||
| css() | ||
| DefaultConfig() static | ||
| export() | ||
| filterContents($contents) | Leave out of the menu what the modes shown do not show (matches): a content keeps its url and its rights. | |
| get($id) | ||
| has($id) | ||
| isAvailable($mode) | ||
| isEnabled() | ||
| isOverridden() | ||
| layerModes() | ||
| layers() | ||
| level() | ||
| levels() | ||
| matches($level, $modes) | Whether what asks a $level and $modes is shown. | |
| onDocumentInit($event) | Give the page its modes: MMO.config.modes, the shell's level and layers attributes, and the css hiding what they leave out -- in the page itself, so nothing flashes before the scripts run. | |
| onPageContents($contents) | ||
| override() | ||
| parse($spec) | Read a modes' spec: what a url, the cookie or a saved preference say. | |
| reset() | forget what was resolved: the next call resolves again (another user, a test) | |
| resolve() | Work out the level and the layers shown, from the first source saying each (see the class). |
Constantes2
LEVELS
the levels mmo.client knows: id => [label, icon, rank, description]
SESSION
the session key of the url's override
Propriétés10
access
- Type
- array
all
cookie
- Type
- string
default
- Type
- array
enabled
- Type
- bool
layers
level
levels
- Type
- array
modes
- Type
- array
query
- Type
- string
Méthodes23
all()
Modes.php:106atLeast($level)
Modes.php:171available()
Modes.php:144| retourne | array | Mode> the modes whoever is asking may turn on |
css()
Modes.php:308| retourne | string | the css hiding what the modes shown leave out: [data-level] above the level, [data-mode] of a layer that is off (or !layer of one that is on) |
DefaultConfig()
staticModes.php:81| retourne | array |
export()
Modes.php:293| retourne | array | what the page is given (MMO.config.modes): the level and the layers shown, every mode whoever is asking may turn on, whether the url overrides them, and the cookie the page saves them in without a user |
filterContents($contents)
Modes.php:325Leave out of the menu what the modes shown do not show (matches): a content keeps its url and its rights.
get($id)
Modes.php:121has($id)
Modes.php:166isAvailable($mode)
Modes.php:136| $mode | Mode | string | |
| retourne | bool | whether whoever is asking may turn $mode on: a mode with no scope is everybody's (ModeAccess) |
isEnabled()
Modes.php:92| retourne | bool |
isOverridden()
Modes.php:281| retourne | bool | whether the url's override is what is shown (the page then says how to leave it) |
layerModes()
Modes.php:131| retourne | array | Mode> the layers |
layers()
Modes.php:157| retourne | array | the layers shown |
level()
Modes.php:151| retourne | string | the level shown |
levels()
Modes.php:126| retourne | array | Mode> the levels, the lowest first |
matches($level, $modes)
Modes.php:186Whether what asks a $level and $modes is shown.
| $level | null | string | the level it is shown from (an unknown one: always shown, as when nothing asks) |
| $modes = null | array | string | null | layers, one of which must be on; !dev one which must be off |
| retourne | bool |
onDocumentInit($event)
Modes.php:345Give the page its modes: MMO.config.modes, the shell's level and layers attributes, and the css hiding what they leave out -- in the page itself, so nothing flashes before the scripts run.
| $event | DocumentInit | |
| retourne | void |
onPageContents($contents)
Modes.php:335- Voir
filterContents, before mmo.oauth's rights hide what a user may not open
| $contents | PageContents | |
| retourne | void |
override()
Modes.php:266| retourne | array | string, layers?: list<string>} what the url says (?modes=simple+dev), kept for the session; ?modes= forgets it |
parse($spec)
Modes.php:206Read a modes' spec: what a url, the cookie or a saved preference say.
| $spec | mixed | simple+dev, expert, +dev (layers alone), or {level, layers} |
| retourne | array | string, layers?: list<string>} what it says, the unknown ids left out; a spec naming layers says they are the only ones (expert alone says nothing of the layers, + says there are none) |
reset()
Modes.php:97forget what was resolved: the next call resolves again (another user, a test)
| retourne | void |
resolve()
Modes.php:230Work out the level and the layers shown, from the first source saying each (see the class).
| retourne | void |
Membres hérités (47)
| Constantes | Déclaré par | Description | |
|---|---|---|---|
ALERT | iLogLevel | Alert: Action must be taken immediately. | |
ALL | iLogLevel | Mask for all | |
ALL_PLUS | iLogLevel | debug everything | |
BACKTRACE | iLogLevel | ||
CRITICAL | iLogLevel | Critical: Critical conditions. | |
DEBUG | iLogLevel | Debug: Detailed debug information. | |
DEEP | iLogLevel | debug everything with arguments | |
EMERGENCY | iLogLevel | Emergency: System is unusable. | |
ERROR | iLogLevel | Error: Runtime errors that do not require immediate action but should typically be logged and monitored. | |
ERROR_PLUS | iLogLevel | Mask for all error | |
FATAL | iLogLevel | Mask for all fatal error | |
INFO | iLogLevel | Info: Interesting events. | |
INFO_PLUS | iLogLevel | Mask for all errors/warning/notices/info | |
MEMORY | iLogLevel | include backtrace object | |
NOTICE | iLogLevel | Notice: Normal but significant events. | |
NOTICE_PLUS | iLogLevel | Mask for all errors/warning/notices/info | |
TRACE | iLogLevel | include backtrace as origins | |
WARNING | iLogLevel | Warning: Exceptional occurrences that are not errors. | |
WARNING_PLUS | iLogLevel | Mask for all errors and warnings |
| Propriétés | Déclaré par | Description | |
|---|---|---|---|
verbosity | aModule |
| Méthodes | Déclaré par | Description | |
|---|---|---|---|
alert($message, $context) | aModule | Action must be taken immediately. | |
backtraces($message, $context) | aModule | Force-log a message at INFO level together with a full stack trace/memory snapshot (iLogLevel::BACKTRACE), bypassing the verbosity mask entirely (any non-zero verbosity is enough to trigger it). | |
Configure($config) | aModule | Merge $config into this module's configuration in the shared Configuration. | |
critical($message, $context) | aModule | Critical conditions. No-op if CRITICAL is currently filtered out by the verbosity mask. | |
debug($message, $context) | aModule | Detailed debug information. | |
debugName() | aModule | Human-readable identifier used as the default {origin} in this instance's log messages. | |
emergency($message, $context) | aModule | System is unusable. No-op if EMERGENCY is currently filtered out by the verbosity mask. | |
error($message, $context) | aModule | Runtime errors that do not require immediate action but should typically be logged and monitored. | |
getVerbosity() | aModule | ||
info($message, $context) | aModule | Interesting events. No-op if INFO is currently filtered out by the verbosity mask. | |
Instantiate($config) | aModule | (Re)create the shared instance immediately, configured with $config merged into the class's existing config. | |
IsShared() | aModule | ||
log($level, $message, $context) | aModule | Logs with an arbitrary level. | |
notice($message, $context) | aModule | Normal but significant events. | |
offsetExists($key) | aModule | \ArrayAccess::offsetExists -- tells whether $key is a declared property at all, regardless of whether it is currently readable/writable through array access. | |
offsetGet($key) | aModule | \ArrayAccess::offsetGet -- reads a property directly, unless it has a #[Serialize(serialize: 'methodName')] attribute, in which case that zero-argument method is called instead (e.g. | |
offsetSet($key, $value) | aModule | \ArrayAccess::offsetSet -- sets a property directly, unless it has a #[Serialize(unserialize: 'methodName')] attribute, in which case that method is called with $value instead (e.g. | |
offsetUnset($key) | aModule | \ArrayAccess::offsetUnset -- equivalent to $module[$key] = null. | |
serialize($path, $serializer) | aModule | \MMO\core\interfaces\iSerializable::serialize -- exports every property (via | |
setVerbosity($verb) | aModule | Set the current verbosity mask, replacing whatever it was before. | |
Shared() | aModule | Get the shared instance, creating (and configuring) it on first call. | |
testVerbosity($level) | aModule | Test whether a given level (or set of levels) is currently enabled by this instance's verbosity mask. | |
traitUnshare($serialize) | aModule | Remove the shared instance, so the next Shared() call creates a fresh one. | |
unserialize($data, $path, $instances) | aModule | \MMO\core\interfaces\iSerializable::unserialize -- merges $data onto DefaultConfig, runs it through the (possibly overridden) constructor, then applies each resulting value to its property (via | |
Unshare($serialize) | aModule | Like tSingleton::Unshare, but also disconnects this module's instance from every event it was listening to (via Event::DisconnectListeners) before dropping it. | |
warning($message, $context) | aModule | Exceptional occurrences that are not errors. | |
__construct($config) | aModule | protected constructor, so it is not possible to do new Module(...) called by the serialization process just before being injected with data. |