modXThis is the MODx gateway class.
It can be used to interact with the MODx framework and serves as a front controller for handling requests to the virtual resources managed by the MODx Content Management Framework.
Located in /model/modx/modx.class.php (line 52)
xPDO | --modX
static array
sanitize
( &$target, [ $patterns = array()], [integer $depth = 3], [ $nesting = 10], array $target)
void
getActiveChildren
([ $id = 0], [ $sort = 'menuindex'], [ $dir = 'ASC'], [ $fields = 'id, pagetitle, description, parent, alias, menutitle, class_key, context_key'])
void
getAllChildren
([ $id = 0], [ $sort = 'menuindex'], [ $dir = 'ASC'], [ $fields = 'id, pagetitle, description, parent, alias, menutitle, class_key, context_key'])
object A
getCacheManager
([ $class = 'cache.xPDOCacheManager'], [ $options = array('path' => XPDO_CORE_PATH, 'ignorePkg' => true)])
void
getDocumentChildren
([ $parentid = 0], [ $published = 1], [ $deleted = 0], [ $fields = "*"], [ $where = ''], [ $sort = "menuindex"], [ $dir = "ASC"], [ $limit = ""])
void
getDocumentChildrenTVars
([ $parentid = 0], [ $tvidnames = array()], [ $published = 1], [ $docsort = "menuindex"], [ $docsortdir = "ASC"], [ $tvfields = "*"], [ $tvsort = "rank"], [ $tvsortdir = "ASC"])
void
getDocuments
([ $ids = array()], [ $published = 1], [ $deleted = 0], [ $fields = "*"], [ $where = ''], [ $sort = "menuindex"], [ $dir = "ASC"], [ $limit = ""])
mixed
getPageInfo
([integer $pageid = -1], [integer $active = 1], [string $fields = 'id, pagetitle, description, alias, class_key, context_key'])
mixed
getParent
([integer $pid = -1], [integer $active = 1], [string $fields = 'id, pagetitle, description, alias, parent, class_key, context_key'])
mixed
getTemplateVar
([string $idname = ""], [string $fields = "*"], [ $resourceId = ""], [integer $published = 1], integer $docid)
mixed
getTemplateVarOutput
([ $idnames = array()], [integer $resourceId = ""], [integer $published = 1])
void
getTemplateVars
([ $idnames = array()], [ $fields = "*"], [ $resourceId = ""], [ $published = 1], [ $sort = "tv.rank,tvtpl.rank"], [ $dir = "ASC,ASC"])
void
messageQuit
([ $msg = 'unspecified error'], [ $query = ''], [ $is_error = true], [ $nr = ''], [ $file = ''], [ $source = ''], [ $text = ''], [ $line = ''])
string
parseChunk
(string $chunkName, array $chunkArr, [string $prefix = '[[+'], [string $suffix = ']]'])
mixed
runProcessor
([string $action = ''], [array $scriptProperties = array()], [array $options = array()])
string
sanitizeString
(string $str, [array $chars = array('/',"'",'"','(',')',';','>','<')], [string $allowedTags = ''])
void
sendRedirect
(string $url, [array|boolean $options = false], [string $type = ''], [string $responseCode = ''])
array
toPlaceholder
(string $key, mixed $value, [string $prefix = ''], [string $separator = '.'], [boolean $restore = false])
array
toPlaceholders
(array|object $subject, [string $prefix = ''], [string $separator = '.'], [boolean $restore = false])
array
$actionMap
= null (line 116)
array
$aliasMap
= null (line 104)
array
$contentTypes
= null (line 148)
modContext
$context
= null (line 67)
array
$contexts
= array() (line 71)
string
$cultureKey
= '' (line 134)
DBAPI
$db
= null (line 221)
mixed
$documentContent
= null (line 237)
mixed
$documentGenerated
= false (line 240)
mixed
$documentIdentifier
= null (line 235)
mixed
$documentListing
= null (line 234)
mixed
$documentMap
= null (line 233)
mixed
$documentMethod
= null (line 236)
mixed
$documentObject
= null (line 239)
mixed
$documentOutput
= null (line 238)
mixed
$dumpSQL
= false (line 242)
array
$elementCache
= array () (line 120)
object An
$errorHandler
= null (line 189)
mixed
$Event
= null (line 232)
modEvent
$event
= null (line 108)
array
$eventMap
= null (line 112)
array
$jscripts
= array () (line 179)
array
$lexicon
= null (line 138)
mixed
$loadedjscripts
= array () (line 180)
modParser
$parser
= null (line 87)
array
$placeholders
= array () (line 125)
mixed
$pluginCache
= array() (line 223)
modRequest
$request
= null (line 76)
modResource
$resource
= null (line 130)
boolean
$resourceGenerated
= false (line 160)
mixed
$resourceIdentifier
= null (line 152)
array
$resourceListing
= null (line 95)
array
$resourceMap
= null (line 99)
string
$resourceMethod
= null (line 156)
modResponse
$response
= null (line 82)
array
$sanitizePatterns
= array(
array
$sjscripts
= array () (line 174)
mixed
$sourceCache
= array(
mixed
$stopOnNotice
= false (line 241)
modUser
$user
= null (line 143)
array
$version
= null (line 164)
string
$virtualDir
(line 185)
array
$_config
= null (line 205)
boolean
$_initialized
= false (line 169)
mixed
$_logSequence
= 0 (line 214)
integer
$_sessionState
= modX::SESSION_STATE_UNINITIALIZED (line 201)
array
$_systemConfig
= null (line 209)
array
$_userConfig
= array() (line 213)
Inherited from xPDO
xPDO::$cacheManager
xPDO::$cachePath
xPDO::$config
xPDO::$driver
xPDO::$executedQueries
xPDO::$logLevel
xPDO::$logTarget
xPDO::$manager
xPDO::$map
xPDO::$package
xPDO::$packages
xPDO::$pdo
xPDO::$queryTime
xPDO::$startTime
xPDO::$_cacheEnabled
xPDO::$_debug
xPDO::$_escapeCharClose
xPDO::$_escapeCharOpen
static protect (line 250)
Harden the environment against common security flaws.
static sanitize (line 275)
Sanitize values of an array using regular expression patterns.
static toQueryString (line 320)
Turn an associative array into a valid query string.
Constructor __construct (line 335)
Construct a new modX instance.
addEventListener (line 2503)
Add a plugin to the eventMap within the current execution cycle.
beforeProcessing (line 2686)
Executed before parser processing of an element.
beforeRender (line 2699)
Executed before the response is rendered.
beforeRequest (line 2708)
Executed before the handleRequest function.
changePassword (line 2187)
Change current user's password.
changeWebUserPassword (line 2174)
Alias of changePassword().
checkForLocks (line 2629)
Checks for locking on a page.
checkPreview (line 2244)
Checks to see if the preview parameter is set.
checkSession (line 1056)
Checks to see if the user has a session in the specified context.
checkSiteStatus (line 2716)
Determines the current site_status.
cleanDocumentIdentifier (line 2203)
Cleans the document request parameter.
executeProcessor (line 1402)
Executes a specific processor. The only argument is an array, which can take the following values:
getActiveChildren (line 1800)
Get all published children documents of the specified document.
getAllChildren (line 1774)
Get children of the specified resource without regard to status.
getAuthenticatedUser (line 1034)
Gets the user authenticated in the specified context.
getCacheManager (line 492)
Get an extended xPDOCacheManager instance responsible for MODx caching.
getChildIds (line 552)
Gets all of the child resource ids for a given resource.
getChunk (line 1650)
Process and return the output from a Chunk by name.
getConfig (line 1096)
Get the configuration for the site.
getContext (line 2561)
Retrieve a context by name without initializing it.
Within a request, contexts retrieved using this function will cache the context data into the modX::$contexts array to avoid loading the same context multiple times.
getDocGroups (line 2165)
Alias of getUserDocGroups().
getDocument (line 1558)
Get persistent data from a specific document.
getDocumentChildren (line 1831)
Get all children documents of the specified document.
getDocumentChildrenTVars (line 1863)
getDocumentIdentifier (line 2218)
Gets the identifier specifying a requested document.
getDocumentMethod (line 2231)
Gets the method being used to request a document.
getDocumentObject (line 1318)
Legacy call to set the current documentObject being handled by MODx.
getDocuments (line 1576)
Get persistent data from a collection of specified documents.
getEventMap (line 2585)
Gets a map of events and registered plugins for the specified context.
Service #s:
getFullTableName (line 1766)
Returns the full table name based on db settings.
getKeywords (line 2360)
Gets keyword data associated with a document.
getLoginUserID (line 1458)
Returns the current user ID, for the current or specified context.
getLoginUserName (line 1478)
Returns the current user name, for the current or specified context.
getLoginUserType (line 1497)
Returns current login user type - web or manager.
getManagerPath (line 2322)
Gets the URL for the 'mgr' context.
getMETATags (line 2383)
Gets META tag data associated with a document.
getPageInfo (line 2099)
Gets data from a resource.
getParent (line 2077)
Gets the parent resource.
getParentIds (line 526)
Gets all of the parent resource ids for a given resource.
getParser (line 515)
Gets the MODx parser.
Returns an instance of modParser responsible for parsing tags in element content, performing actions, returning content and/or sending other responses in the process.
getPlaceholder (line 710)
Get a placeholder value by key.
getRegisteredClientScripts (line 1288)
Returns all registered JavaScripts.
getRegisteredClientStartupScripts (line 1302)
Returns all registered startup CSS, JavaScript, or HTML blocks.
getRequest (line 1173)
Attempt to load the request handler class, if not already loaded.
getResponse (line 1193)
Attempt to load the response handler class, if not already loaded.
getSessionState (line 2669)
Returns the state of the SESSION being used by modX.
The possible values for session state are:
modX::SESSION_STATE_UNINITIALIZED modX::SESSION_STATE_UNAVAILABLE modX::SESSION_STATE_EXTERNAL modX::SESSION_STATE_INITIALIZED
getSettings (line 1146)
Alias for getConfig().
getTemplateVar (line 1924)
Returns a single TV record.
getTemplateVarOutput (line 2022)
Gets an array of template variable data, with processed output.
getTemplateVars (line 1941)
Returns an array of TV records.
getTree (line 579)
Get a site tree from a single or multiple modResource instances.
getUser (line 973)
Get the current authenticated User and assigns it to the modX instance.
getUserDocGroups (line 1725)
Returns an array of resource groups that current user is assigned to.
This function will first return the web user doc groups when running from frontend otherwise it will return manager user's resource group.
getUserInfo (line 2138)
Returns an array of user data.
getVersionData (line 1069)
Gets the modX core version data.
getWebUserInfo (line 2156)
Returns an array of web user data.
handleRequest (line 1156)
Initialize, cleanse, and process a request made to a modX site.
hasPermission (line 2258)
Returns true if user has the specified policy permission.
initialize (line 389)
Initializes the modX engine.
This includes preparing the session, pre-loading some common classes and objects, the current site and context settings, extension packages used to override session handling, error handling, or other initialization classes
insideManager (line 2492)
Indicates if the request is taking place inside the mgr context.
invokeEvent (line 1335)
Invokes a specified Event with an optional array of parameters.
isBackend (line 2472)
Indicates if modX is executing in the default mgr context.
isFrontend (line 2482)
Indicates if modX is executing in a context other than mgr.
isInitialized (line 1514)
Returns whether modX instance has been initialized or not.
isMemberOfWebGroup (line 1526)
Determines if the current webuser is a member of the specified webgroups.
lexicon (line 2649)
Grabs a processed lexicon string.
logEvent (line 2272)
Add an a alert message to the system event log
logManagerAction (line 2300)
Logs a manager action.
makeUrl (line 767)
Generates a URL representing a specified resource.
-1 : (default value) URL is relative to site_url
0 : see http
1 : see https
full : URL is absolute, prepended with site_url from config
abs : URL is absolute, prepended with base_url from config
http : URL is absolute, forced to http scheme
https : URL is absolute, forced to https scheme
mergeChunkContent (line 2426)
Processes chunk content tags.
mergeDocumentContent (line 2406)
Processes document content tags.
mergePlaceholderContent (line 2436)
Processes placeholder content tags.
mergeSettingsContent (line 2416)
Processes document setting tags (and placeholders).
messageQuit (line 1607)
Legacy fatal error message.
parseChunk (line 1681)
Parse a chunk using an associative array of replacement variables.
putChunk (line 2520)
Alias of getChunk.
regClientCSS (line 1208)
Register CSS to be injected inside the HEAD tag of a resource.
regClientHTMLBlock (line 1278)
Register HTML to be injected before the closing BODY tag.
regClientScript (line 1251)
Register JavaScript to be injected before the closing BODY tag.
regClientStartupHTMLBlock (line 1269)
Register HTML to be injected before the closing HEAD tag.
regClientStartupScript (line 1228)
Register JavaScript to be injected inside the HEAD tag of a resource.
reloadConfig (line 1081)
Reload the config settings.
removeAllEventListener (line 2461)
Remove all registered events for the current request.
removeEventListener (line 2449)
Remove an event from the eventMap so it will not be invoked.
runProcessor (line 1422)
Loads and runs a specific processor.
Optional. An array of options for running the processor, such as:
runSnippet (line 1620)
Process and return the output from a PHP snippet by name.
sanitizeString (line 308)
Sanitizes a string
sendError (line 806)
Send the user to a type-specific core error page and halt PHP execution.
sendErrorPage (line 925)
Send the user to a MODx virtual error page.
sendForward (line 852)
Forwards the request to another resource without changing the URL.
sendRedirect (line 839)
Sends a redirect to the specified URL using the specified options.
Valid 'type' option values include: REDIRECT_REFRESH Uses the header refresh method REDIRECT_META Sends a a META HTTP-EQUIV="Refresh" tag to the output REDIRECT_HEADER Uses the header location method
REDIRECT_HEADER is the default.
sendUnauthorizedPage (line 949)
Send the user to the MODx unauthorized page.
setDebug (line 471)
Sets the debugging features of the modX instance.
setPlaceholder (line 607)
Sets a placeholder value.
setPlaceholders (line 627)
Sets a collection of placeholders stored in an array or as object vars.
An optional namespace parameter can be prepended to each placeholder key in the collection, to isolate the collection of placeholders.
Note that unlike toPlaceholders(), this function does not add separators between the namespace and the placeholder key. Use toPlaceholders() when working with multi-dimensional arrays or objects with variables other than scalars so each level gets delimited by a separator.
stripTags (line 1697)
Strip unwanted HTML and PHP tags and supplied patterns from content.
switchContext (line 2536)
Switches the primary Context for the modX instance.
Be aware that switching contexts does not allow custom session handling classes to be loaded. The gateway defines the session handling that is applied to a single request. To create a context with a custom session handler you must create a unique context gateway that initializes that context directly.
toPlaceholder (line 686)
Recursively validates and sets placeholders appropriate to the value type passed.
toPlaceholders (line 646)
Sets placeholders from values stored in arrays and objects.
Each recursive level adds to the prefix, building an access path using an optional separator.
unsetPlaceholder (line 723)
Unset a placeholder value by key.
unsetPlaceholders (line 735)
Unset multiple placeholders, either by prefix or an array of keys.
userLoggedIn (line 2332)
Checks if a user is authenticated and returns array of data if so.
_initContext (line 2733)
Loads a specified Context.
Merges any context settings with the modX::$config, and performs any other context specific initialization tasks.
_initCulture (line 2767)
Initializes the culture settings.
_initErrorHandler (line 2780)
Loads the error handler for this instance.
_initEventMap (line 2801)
Populates the map of events and registered plugins for each.
_initSession (line 2811)
Loads the session handler and starts the session.
_loadConfig (line 2868)
Loads the modX system configuration settings.
_loadExtensionPackages (line 429)
Loads any specified extension packages
_log (line 2894)
Provides modX the ability to use modRegister instances as log targets.
_logInRegister (line 2932)
Provides custom logging functionality for modRegister targets.
_postProcess (line 2957)
Executed after the response is sent and execution is completed.
Inherited From xPDO
xPDO::__construct()
xPDO::addDerivativeCriteria()
xPDO::addPackage()
xPDO::beginTransaction()
xPDO::call()
xPDO::commit()
xPDO::connect()
xPDO::errorCode()
xPDO::errorInfo()
xPDO::escape()
xPDO::escSplit()
xPDO::exec()
xPDO::fromCache()
xPDO::fromJSON()
xPDO::getAggregates()
xPDO::getAncestry()
xPDO::getAttribute()
xPDO::getCacheManager()
xPDO::getCachePath()
xPDO::getCollection()
xPDO::getCollectionGraph()
xPDO::getComposites()
xPDO::getCount()
xPDO::getCriteria()
xPDO::getCriteriaType()
xPDO::getDebug()
xPDO::getDebugBacktrace()
xPDO::getDriver()
xPDO::getFieldMeta()
xPDO::getFields()
xPDO::getFKDefinition()
xPDO::getIndexMeta()
xPDO::getIterator()
xPDO::getLogLevel()
xPDO::getLogTarget()
xPDO::getManager()
xPDO::getMicroTime()
xPDO::getModelVersion()
xPDO::getObject()
xPDO::getObjectGraph()
xPDO::getObjectLoader()
xPDO::getOption()
xPDO::getPackage()
xPDO::getPDOType()
xPDO::getPK()
xPDO::getPKType()
xPDO::getSelectColumns()
xPDO::getService()
xPDO::getTableMeta()
xPDO::getTableName()
xPDO::getValidationRules()
xPDO::lastInsertId()
xPDO::literal()
xPDO::loadClass()
xPDO::log()
xPDO::newObject()
xPDO::newQuery()
xPDO::parseBindings()
xPDO::parseDSN()
xPDO::prepare()
xPDO::query()
xPDO::quote()
xPDO::removeCollection()
xPDO::removeObject()
xPDO::rollBack()
xPDO::setAttribute()
xPDO::setDebug()
xPDO::setLogLevel()
xPDO::setLogTarget()
xPDO::setOption()
xPDO::setPackage()
xPDO::toCache()
xPDO::toJSON()
xPDO::_getFullTableName()
xPDO::_getLogLevel()
xPDO::_loadClass()
xPDO::_log()
LOG_LEVEL_DEBUG
= 4
(line 57)
LOG_LEVEL_ERROR
= 1
(line 54)
LOG_LEVEL_FATAL
= 0
(line 53)
LOG_LEVEL_INFO
= 3
(line 56)
LOG_LEVEL_WARN
= 2
(line 55)
SESSION_STATE_EXTERNAL
= 2
(line 62)
SESSION_STATE_INITIALIZED
= 1
(line 61)
SESSION_STATE_UNAVAILABLE
= -1
(line 59)
SESSION_STATE_UNINITIALIZED
= 0
(line 60)
Inherited from xPDO
xPDO::LOG_LEVEL_DEBUG
xPDO::LOG_LEVEL_ERROR
xPDO::LOG_LEVEL_FATAL
xPDO::LOG_LEVEL_INFO
xPDO::LOG_LEVEL_WARN
xPDO::OPT_BASE_CLASSES
xPDO::OPT_BASE_PACKAGES
xPDO::OPT_CACHE_COMPRESS
xPDO::OPT_CACHE_DB
xPDO::OPT_CACHE_DB_COLLECTIONS
xPDO::OPT_CACHE_DB_EXPIRES
xPDO::OPT_CACHE_DB_HANDLER
xPDO::OPT_CACHE_DB_OBJECTS_BY_PK
xPDO::OPT_CACHE_EXPIRES
xPDO::OPT_CACHE_HANDLER
xPDO::OPT_CACHE_KEY
xPDO::OPT_CACHE_PATH
xPDO::OPT_CALLBACK_ON_REMOVE
xPDO::OPT_CALLBACK_ON_SAVE
xPDO::OPT_HYDRATE_ADHOC_FIELDS
xPDO::OPT_HYDRATE_FIELDS
xPDO::OPT_HYDRATE_RELATED_OBJECTS
xPDO::OPT_LOADER_CLASSES
xPDO::OPT_ON_SET_STRIPSLASHES
xPDO::OPT_SETUP
xPDO::OPT_TABLE_PREFIX
xPDO::OPT_VALIDATE_ON_SAVE
xPDO::OPT_VALIDATOR_CLASS
xPDO::SCHEMA_VERSION
Documentation generated on Fri, 17 Jun 2011 10:04:01 -0600 by phpDocumentor 1.4.3