core/model/modx/modmanagercontroller.class.php
- Package
- modx
\modExtraManagerController
Utility abstract class for usage by Extras that has a subrequest handler that does auto-routing by the &action REQUEST parameter. You must extend this class in your Extra to use it.
- Parent(s)
- \modManagerController
- Abstract
Properties
array
$config= 'array()'
array()
Details- Type
- array
- Inherited_from
- \modManagerController::$$config
string
$content= ''''
''
Details- Type
- string
- Inherited_from
- \modManagerController::$$content
array
$controllersPaths= ''
- Type
- array
- Inherited_from
- \modManagerController::$$controllersPaths
\modMediaSource
$defaultSource= ''
- Type
- \modMediaSource
- Inherited_from
- \modManagerController::$$defaultSource
string
$failureMessage= ''''
''
Details- Type
- string
- Inherited_from
- \modManagerController::$$failureMessage
array
$head= 'array('css' => array(),'js' => array(),'html' => array(),'lastjs' => array())'
array('css' => array(),'js' => array(),'html' => array(),'lastjs' => array())
Details- Type
- array
- Inherited_from
- \modManagerController::$$head
bool
$isFailure= 'false'
false
Details- Type
- bool
- Inherited_from
- \modManagerController::$$isFailure
bool
$loadBaseJavascript= 'true'
true
Details- Type
- bool
- Inherited_from
- \modManagerController::$$loadBaseJavascript
bool
$loadFooter= 'true'
true
Details- Type
- bool
- Inherited_from
- \modManagerController::$$loadFooter
bool
$loadHeader= 'true'
true
Details- Type
- bool
- Inherited_from
- \modManagerController::$$loadHeader
\modX
$modx= ''
- Type
- \modX
- Inherited_from
- \modManagerController::$$modx
array
$placeholders= 'array()'
array()
Details- Type
- array
- Inherited_from
- \modManagerController::$$placeholders
string
$ruleOutput= 'array()'
array()
Details- Type
- string
- Inherited_from
- \modManagerController::$$ruleOutput
array
$scriptProperties= 'array()'
array()
Details- Type
- array
- Inherited_from
- \modManagerController::$$scriptProperties
array
$templatesPaths= 'array()'
array()
Details- Type
- array
- Inherited_from
- \modManagerController::$$templatesPaths
string
$theme= ''default''
'default'
Details- Type
- string
- Inherited_from
- \modManagerController::$$theme
string
$title= ''''
''
Details- Type
- string
- Inherited_from
- \modManagerController::$$title
\modContext
$workingContext= ''
- Type
- \modContext
- Inherited_from
- \modManagerController::$$workingContext
Methods
__construct(
\modX $modx, array $config
=
array()
)
:
void
The constructor for the modManaagerController class.
Inherited from: \modManagerController::__construct()Name | Type | Description |
---|---|---|
$modx | \modX | A reference to the modX object. |
$config | array | A configuration array of options related to this controller's action object. |
_postfixVersionToScript(
string $str, string $version
)
:
string
Appends a version postfix to a script tag
Inherited from: \modManagerController::_postfixVersionToScript()Name | Type | Description |
---|---|---|
$str | string | The script tag to append the version to |
$version | string | The version to append |
Type | Description |
---|---|
string | The adjusted script tag |
- Access
- private
_prepareHead(
)
:
void
Prepare the set html/css/js to be added
Inherited from: \modManagerController::_prepareHead()_prepareVersionPostfix(
)
:
string
Grabs a stripped version of modx to prevent caching of JS after upgrades
Inherited from: \modManagerController::_prepareVersionPostfix()Type | Description |
---|---|
string | The parsed version string |
- Access
- private
addCss(
string $script
)
:
void
Add a external CSS file to the head of the page
Inherited from: \modManagerController::addCss()Name | Type | Description |
---|---|---|
$script | string |
addHtml(
string $script
)
:
void
Add a block of HTML to the head of the page
Inherited from: \modManagerController::addHtml()Name | Type | Description |
---|---|---|
$script | string |
addJavascript(
string $script
)
:
void
Add an external Javascript file to the head of the page
Inherited from: \modManagerController::addJavascript()Name | Type | Description |
---|---|---|
$script | string |
addLastJavascript(
string $script
)
:
void
Add an external Javascript file to the head of the page
Inherited from: \modManagerController::addLastJavascript()Name | Type | Description |
---|---|---|
$script | string |
addLexiconTopic(
string $topic
)
:
string
Adds a topic to the JS language array
Inherited from: \modManagerController::addLexiconTopic()Name | Type | Description |
---|---|---|
$topic | string |
Type | Description |
---|---|
string |
checkFormCustomizationRules(
\xPDOObject $obj
=
null, bool $forParent
=
false
)
:
bool
Checks Form Customization rules for an object.
Inherited from: \modManagerController::checkFormCustomizationRules()Name | Type | Description |
---|---|---|
$obj | \xPDOObject | If passed, will validate against for rules with constraints. |
$forParent | bool |
Type | Description |
---|---|
bool |
checkPermissions(
)
:
bool
Check whether the active user has access to view this page
Type | Description |
---|---|
bool | True if the user passes permission checks |
failure(
string $message
)
:
void
Set a failure on this controller. This will return the error message.
Inherited from: \modManagerController::failure()Name | Type | Description |
---|---|---|
$message | string |
fetchTemplate(
string $tpl
)
:
string
Name | Type | Description |
---|---|---|
$tpl | string | The path to the template |
Type | Description |
---|---|
string | The output of the template |
firePostRenderEvents(
)
:
void
Can be used to fire events after all the CSS/JS is loaded for a page
Inherited from: \modManagerController::firePostRenderEvents()firePreRenderEvents(
)
:
void
Fire any pre-render events for the controller
Inherited from: \modManagerController::firePreRenderEvents()getControllerClassName(
string $action, string $namespace
=
'', string $postFix
=
'ManagerController'
)
:
string
Return the class name of a controller given the action
Name | Type | Description |
---|---|---|
$action | string | The action name, eg: "home" or "create" |
$namespace | string | The namespace of the Exra |
$postFix | string | The string to postfix to the class name |
Type | Description |
---|---|
string | A full class name of the controller class |
- Static
getControllersPaths(
bool $coreOnly
=
false
)
:
array
Get the path to this controller's directory. Override this to point to a custom directory.
Inherited from: \modManagerController::getControllersPaths()Name | Type | Description |
---|---|---|
$coreOnly | bool | Ensure that it grabs the path from the core namespace only. |
Type | Description |
---|---|
array |
getDefaultController(
)
:
string
Define the default controller action for this namespace
Type | Description |
---|---|
string | A default controller action |
- Static
getInstance(
\modX $modx, string $className, array $config
=
array()
)
:
\modManagerController
Get an instance of this extra controller
Name | Type | Description |
---|---|---|
$modx | \modX | A reference to the modX object |
$className | string | The string className that is being requested to load |
$config | array | An array of configuration options built from the modAction object |
Type | Description |
---|---|
\modManagerController | A newly created modManagerController instance |
- Static
getLanguageTopics(
)
:
array
Specify an array of language topics to load for this controller
Inherited from: \modManagerController::getLanguageTopics()Type | Description |
---|---|
array |
getPageTitle(
)
:
string
The page title for this controller
Type | Description |
---|---|
string | The string title of the page |
getPlaceholder(
string $k, mixed $default
=
null
)
:
mixed
Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
getTemplateFile(
)
:
string
Specify the location of the template file
Type | Description |
---|---|
string | The absolute path to the template file |
getTemplatesPaths(
bool $coreOnly
=
false
)
:
array | string
Get an array of possible paths to this controller's template's directory.
Inherited from: \modManagerController::getTemplatesPaths()Override this to point to a custom directory.
Name | Type | Description |
---|---|---|
$coreOnly | bool | Ensure that it grabs the path from the core namespace only. |
Type | Description |
---|---|
array | string |
initialize(
)
:
void
Can be used to provide custom methods prior to processing
Inherited from: \modManagerController::initialize()loadController(
$controller, bool $coreOnly
=
false
)
:
mixed | string
Load another manual controller file (such as header/footer)
Inherited from: \modManagerController::loadController()Name | Type | Description |
---|---|---|
$controller | ||
$coreOnly | bool |
Type | Description |
---|---|
mixed | string |
loadControllersPath(
)
:
array
Load an array of possible paths to this controller's directory. Only override this if you want to override default behavior; otherwise, overriding getControllersPath is preferred.
Inherited from: \modManagerController::loadControllersPath()Type | Description |
---|---|
array |
loadTemplatesPath(
)
:
string
Load the path to this controller's template's directory. Only override this if you want to override default behavior; otherwise, overriding getTemplatesPath is preferred.
Inherited from: \modManagerController::loadTemplatesPath()Type | Description |
---|---|
string |
loadWorkingContext(
)
:
\modContext | string
Load the working context for this controller.
Inherited from: \modManagerController::loadWorkingContext()Type | Description |
---|---|
\modContext | string |
prepareLanguage(
)
:
void
Prepares the language placeholders
Inherited from: \modManagerController::prepareLanguage()process(
array $scriptProperties
=
array()
)
:
void
Do any page-specific logic and/or processing here
Name | Type | Description |
---|---|---|
$scriptProperties | array |
registerBaseScripts(
)
:
void
Registers the core and base JS scripts
Inherited from: \modManagerController::registerBaseScripts()- Access
- public
registerCssJs(
)
:
void
Registers CSS/JS to manager interface
Inherited from: \modManagerController::registerCssJs()setPlaceholder(
string $k, mixed $v
)
:
void
Set a placeholder for this controller's template
Inherited from: \modManagerController::setPlaceholder()Name | Type | Description |
---|---|---|
$k | string | The key of the placeholder |
$v | mixed | The value of the placeholder |
setProperties(
array $properties
)
:
void
Sets the properties array for this controller
Inherited from: \modManagerController::setProperties()Name | Type | Description |
---|---|---|
$properties | array |
setProperty(
string $key, mixed $value
)
:
void
Name | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
setTemplatePaths(
array $paths
)
:
void
Set the possible template paths for this controller
Inherited from: \modManagerController::setTemplatePaths()Name | Type | Description |
---|---|---|
$paths | array |
\modManagerController
Abstract class for manager controllers. Not to be initialized directly; must be extended by the implementing controller.
- Children
- \modManagerControllerDeprecated
- \modExtraManagerController
- \TvInputManagerController
- \TvInputPropertiesManagerController
- \TvPropertiesManagerController
- \WorkspacesPackageViewManagerController
- \WorkspacesManagerController
- \WorkspacesNamespaceManagerController
- \WorkspacesLexiconManagerController
- \ResourceManagerController
- \ResourceSiteScheduleManagerController
- \ResourceDataManagerController
- \SecurityPermissionManagerController
- \SecurityUserManagerController
- \SecurityUserCreateManagerController
- \SecurityUserUpdateManagerController
- \SecurityProfileManagerController
- \SecurityAccessPolicyTemplateUpdateManagerController
- \SecurityAccessPolicyUpdateManagerController
- \SecurityMessageManagerController
- \SecurityResourceGroupIndexManagerController
- \SecurityUserGroupCreateManagerController
- \SecurityUserGroupUpdateManagerController
- \SecurityLogoutManagerController
- \SecurityFormsManagerController
- \SecurityFormsSetUpdateManagerController
- \SecurityFormsProfileUpdateManagerController
- \SecurityLoginManagerController
- \SystemDashboardsManagerController
- \SystemDashboardsWidgetCreateManagerController
- \SystemDashboardsWidgetUpdateManagerController
- \SystemDashboardsCreateManagerController
- \SystemDashboardsUpdateManagerController
- \SystemFileEditManagerController
- \SystemFileCreateManagerController
- \SystemContentTypeManagerController
- \SystemImportManagerController
- \SystemImportHtmlManagerController
- \SystemLogsIndexManagerController
- \SystemEventManagerController
- \SystemSettingsManagerController
- \SystemActionManagerController
- \SystemInfoManagerController
- \HelpManagerController
- \ContextViewManagerController
- \ContextManagerController
- \ContextUpdateManagerController
- \WelcomeManagerController
- \BrowserManagerController
- \SourceIndexManagerController
- \SourceUpdateManagerController
- \SearchManagerController
- \ElementChunkCreateManagerController
- \ElementChunkUpdateManagerController
- \ElementPropertySetIndexManagerController
- \ElementTemplateCreateManagerController
- \ElementTemplateUpdateManagerController
- \ElementSnippetCreateManagerController
- \ElementSnippetUpdateManagerController
- \ElementPluginCreateManagerController
- \ElementPluginUpdateManagerController
- \ElementTVCreateManagerController
- \ElementTVUpdateManagerController
Properties
array
$config= 'array()'
array()
Details- Type
- array
array
$controllersPaths= ''
- Type
- array
\modMediaSource
$defaultSource= ''
- Type
- \modMediaSource
string
$failureMessage= ''''
''
Details- Type
- string
array
$head= 'array('css' => array(),'js' => array(),'html' => array(),'lastjs' => array())'
array('css' => array(),'js' => array(),'html' => array(),'lastjs' => array())
Details- Type
- array
bool
$isFailure= 'false'
false
Details- Type
- bool
bool
$loadBaseJavascript= 'true'
true
Details- Type
- bool
bool
$loadFooter= 'true'
true
Details- Type
- bool
bool
$loadHeader= 'true'
true
Details- Type
- bool
array
$placeholders= 'array()'
array()
Details- Type
- array
string
$ruleOutput= 'array()'
array()
Details- Type
- string
array
$scriptProperties= 'array()'
array()
Details- Type
- array
array
$templatesPaths= 'array()'
array()
Details- Type
- array
Methods
__construct(
\modX $modx, array $config
=
array()
)
:
void
The constructor for the modManaagerController class.
Name | Type | Description |
---|---|---|
$modx | \modX | A reference to the modX object. |
$config | array | A configuration array of options related to this controller's action object. |
_postfixVersionToScript(
string $str, string $version
)
:
string
Appends a version postfix to a script tag
Name | Type | Description |
---|---|---|
$str | string | The script tag to append the version to |
$version | string | The version to append |
Type | Description |
---|---|
string | The adjusted script tag |
- Access
- private
_prepareVersionPostfix(
)
:
string
Grabs a stripped version of modx to prevent caching of JS after upgrades
Type | Description |
---|---|
string | The parsed version string |
- Access
- private
addCss(
string $script
)
:
void
Add a external CSS file to the head of the page
Name | Type | Description |
---|---|---|
$script | string |
addHtml(
string $script
)
:
void
Add a block of HTML to the head of the page
Name | Type | Description |
---|---|---|
$script | string |
addJavascript(
string $script
)
:
void
Add an external Javascript file to the head of the page
Name | Type | Description |
---|---|---|
$script | string |
addLastJavascript(
string $script
)
:
void
Add an external Javascript file to the head of the page
Name | Type | Description |
---|---|---|
$script | string |
addLexiconTopic(
string $topic
)
:
string
Adds a topic to the JS language array
Name | Type | Description |
---|---|---|
$topic | string |
Type | Description |
---|---|
string |
checkFormCustomizationRules(
\xPDOObject $obj
=
null, bool $forParent
=
false
)
:
bool
Checks Form Customization rules for an object.
Name | Type | Description |
---|---|---|
$obj | \xPDOObject | If passed, will validate against for rules with constraints. |
$forParent | bool |
Type | Description |
---|---|
bool |
checkPermissions(
)
:
boolean
Do permission checking in this method. Returning false will present a "permission denied" message.
Type | Description |
---|---|
boolean |
- Abstract
failure(
string $message
)
:
void
Set a failure on this controller. This will return the error message.
Name | Type | Description |
---|---|---|
$message | string |
fetchTemplate(
string $tpl
)
:
string
Fetch the template content
Name | Type | Description |
---|---|---|
$tpl | string | The path to the template |
Type | Description |
---|---|
string | The output of the template |
getControllersPaths(
bool $coreOnly
=
false
)
:
array
Get the path to this controller's directory. Override this to point to a custom directory.
Name | Type | Description |
---|---|---|
$coreOnly | bool | Ensure that it grabs the path from the core namespace only. |
Type | Description |
---|---|
array |
getDefaultState(
)
:
array | mixed | string
Get the default state for the UI
Type | Description |
---|---|
array | mixed | string |
getInstance(
\modX $modx, string $className, array $config
=
array()
)
:
\The
Return the proper instance of the derived class. This can be used to override how the manager loads a controller class; for example, when handling derivative classes with class_key settings.
Name | Type | Description |
---|---|---|
$modx | \modX | A reference to the modX object. |
$className | string | The name of the class that is being requested. |
$config | array | A configuration array of options related to this controller's action object. |
Type | Description |
---|---|
\The | class specified by $className |
- Static
getLanguageTopics(
)
:
array
Specify an array of language topics to load for this controller
Type | Description |
---|---|
array |
getPageTitle(
)
:
string
Return a string to set as the controller's page title.
Type | Description |
---|---|
string |
- Abstract
getPlaceholder(
string $k, mixed $default
=
null
)
:
mixed
Get a specific placeholder set
Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
getTemplateFile(
)
:
string
Return the relative path to the template file to load
Type | Description |
---|---|
string |
- Abstract
getTemplatesPaths(
bool $coreOnly
=
false
)
:
array | string
Get an array of possible paths to this controller's template's directory.
Override this to point to a custom directory.
Name | Type | Description |
---|---|---|
$coreOnly | bool | Ensure that it grabs the path from the core namespace only. |
Type | Description |
---|---|
array | string |
loadController(
$controller, bool $coreOnly
=
false
)
:
mixed | string
Load another manual controller file (such as header/footer)
Name | Type | Description |
---|---|---|
$controller | ||
$coreOnly | bool |
Type | Description |
---|---|
mixed | string |
loadControllersPath(
)
:
array
Load an array of possible paths to this controller's directory. Only override this if you want to override default behavior; otherwise, overriding getControllersPath is preferred.
Type | Description |
---|---|
array |
loadTemplatesPath(
)
:
string
Load the path to this controller's template's directory. Only override this if you want to override default behavior; otherwise, overriding getTemplatesPath is preferred.
Type | Description |
---|---|
string |
loadWorkingContext(
)
:
\modContext | string
Load the working context for this controller.
Type | Description |
---|---|
\modContext | string |
process(
array $scriptProperties
=
array()
)
:
mixed
Process the controller, returning an array of placeholders to set.
Name | Type | Description |
---|---|---|
$scriptProperties | array | A array of REQUEST parameters. |
Type | Description |
---|---|
mixed | Either an error or output string, or an array of placeholders to set. |
- Abstract
setPlaceholder(
string $k, mixed $v
)
:
void
Set a placeholder for this controller's template
Name | Type | Description |
---|---|---|
$k | string | The key of the placeholder |
$v | mixed | The value of the placeholder |
setPlaceholders(
array $keys
)
:
void
Set an array of placeholders
Name | Type | Description |
---|---|---|
$keys | array |
setProperties(
array $properties
)
:
void
Sets the properties array for this controller
Name | Type | Description |
---|---|---|
$properties | array |
setProperty(
string $key, mixed $value
)
:
void
Set a property for this controller
Name | Type | Description |
---|---|---|
$key | string | |
$value | mixed |