manager/controllers/default/resource/resource.class.php

Show: inherited
Table of Contents

Base controller class for Resources

Package
modx  
Subpackage
manager.controllers  

\ResourceManagerController

Package: modx\manager\controllers

Base controller class for Resources

Parent(s)
\modManagerController
Children
\ResourceCreateManagerController
\ResourceUpdateManagerController

Properties

Propertypublic  $canCreate= 'true'
Default valuetrueDetails
Type
n/a
Propertypublic  $canDelete= 'true'
Default valuetrueDetails
Type
n/a
Propertypublic  $canDuplicate= 'true'
Default valuetrueDetails
Type
n/a
Propertypublic  $canEdit= 'true'
Default valuetrueDetails
Type
n/a
Propertypublic  $canPublish= 'true'
Default valuetrueDetails
Type
n/a
Propertypublic  $canSave= 'true'
Default valuetrueDetails
Type
n/a
Propertypublicarray  $config= 'array()'
inheritedA configuration array of options related to this controller's action object.

Inherited from: \modManagerController::$$config
Default valuearray()Details
Type
array
Inherited_from
\modManagerController::$$config  
Propertypublicstring  $content= ''''
inheritedThe current output content

Inherited from: \modManagerController::$$content
Default value''Details
Type
string
Inherited_from
\modManagerController::$$content  
Propertypublic\modContext  $context= ''

Details
Type
\modContext
Propertypublicarray  $controllersPaths= ''
inheritedAn array of possible paths to this controller's directory.

Inherited from: \modManagerController::$$controllersPaths
Details
Type
array
Inherited_from
\modManagerController::$$controllersPaths  
Propertypublic  $ctx= ''web''
Default value'web'Details
Type
n/a
Propertypublic\modMediaSource  $defaultSource= ''
inheritedThe default media source for the user

Inherited from: \modManagerController::$$defaultSource
Propertyprotectedstring  $failureMessage= ''''
inheritedThe failure message, if existent, for this controller.

Inherited from: \modManagerController::$$failureMessage
Default value''Details
Type
string
Inherited_from
\modManagerController::$$failureMessage  
Propertypublicarray  $head= 'array('css' => array(),'js' => array(),'html' => array(),'lastjs' => array())'
inheritedAn array of css/js/html to load into the HEAD of the page

Inherited from: \modManagerController::$$head
Default valuearray('css' => array(),'js' => array(),'html' => array(),'lastjs' => array())Details
Type
array
Inherited_from
\modManagerController::$$head  
Propertyprotectedbool  $isFailure= 'false'
inheritedWhether or not a failure message was sent by this controller.

Inherited from: \modManagerController::$$isFailure
Default valuefalseDetails
Type
bool
Inherited_from
\modManagerController::$$isFailure  
Propertypublicbool  $loadBaseJavascript= 'true'
inheritedSet to false to prevent loading of the base MODExt JS classes.

Inherited from: \modManagerController::$$loadBaseJavascript
Default valuetrueDetails
Type
bool
Inherited_from
\modManagerController::$$loadBaseJavascript  
Propertypublicbool  $loadFooter= 'true'
inheritedSet to false to prevent loading of the footer HTML.

Inherited from: \modManagerController::$$loadFooter
Default valuetrueDetails
Type
bool
Inherited_from
\modManagerController::$$loadFooter  
Propertypublicbool  $loadHeader= 'true'
inheritedSet to false to prevent loading of the header HTML.

Inherited from: \modManagerController::$$loadHeader
Default valuetrueDetails
Type
bool
Inherited_from
\modManagerController::$$loadHeader  
Propertypublic\modX  $modx= ''
inheritedA reference to the modX object

Inherited from: \modManagerController::$$modx
Details
Type
\modX
Inherited_from
\modManagerController::$$modx  
Propertypublic  $onDocFormRender= ''''
Default value''Details
Type
n/a
Propertypublic\modResource  $parent= ''

Details
Type
\modResource
Propertypublicarray  $placeholders= 'array()'
inheritedAn array of placeholders that are being set to the page

Inherited from: \modManagerController::$$placeholders
Default valuearray()Details
Type
array
Inherited_from
\modManagerController::$$placeholders  
Propertyprotected\modRegister  $reg= ''

Details
Type
\modRegister
Propertypublic\modResource  $resource= ''

Details
Type
\modResource
Propertypublic  $resourceArray= 'array()'
Default valuearray()Details
Type
n/a
Propertypublicstring  $resourceClass= ''modDocument''

Default value'modDocument'Details
Type
string
Propertypublicarray  $rteFields= 'array()'

Default valuearray()Details
Type
array
Propertyprotectedstring  $ruleOutput= 'array()'
inheritedAny Form Customization rule output that was created.

Inherited from: \modManagerController::$$ruleOutput
Default valuearray()Details
Type
string
Inherited_from
\modManagerController::$$ruleOutput  
Propertypublicarray  $scriptProperties= 'array()'
inheritedAn array of request parameters sent to the controller

Inherited from: \modManagerController::$$scriptProperties
Default valuearray()Details
Type
array
Inherited_from
\modManagerController::$$scriptProperties  
Propertypublicarray  $templatesPaths= 'array()'
inheritedAn array of possible paths to this controller's templates directory.

Inherited from: \modManagerController::$$templatesPaths
Default valuearray()Details
Type
array
Inherited_from
\modManagerController::$$templatesPaths  
Propertyprotectedstring  $theme= ''default''
inheritedThe current manager theme.

Inherited from: \modManagerController::$$theme
Default value'default'Details
Type
string
Inherited_from
\modManagerController::$$theme  
Propertyprotectedstring  $title= ''''
inheritedThe pagetitle for this controller.

Inherited from: \modManagerController::$$title
Default value''Details
Type
string
Inherited_from
\modManagerController::$$title  
Propertypublicarray  $tvCounts= 'array()'

Default valuearray()Details
Type
array
Propertypublic\modContext  $workingContext= ''
inheritedThe current working context.

Inherited from: \modManagerController::$$workingContext
Details
Type
\modContext
Inherited_from
\modManagerController::$$workingContext  

Methods

methodpublic__construct( \modX $modx, array $config = array() ) : void
inherited

The constructor for the modManaagerController class.

Inherited from: \modManagerController::__construct()
Parameters
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.

methodprivate_postfixVersionToScript( string $str, string $version ) : string
inherited

Appends a version postfix to a script tag

Inherited from: \modManagerController::_postfixVersionToScript()
Parameters
Name Type Description
$str string

The script tag to append the version to

$version string

The version to append

Returns
Type Description
string The adjusted script tag
Details
Access
private  
methodprivate_prepareHead( ) : void
inherited

Prepare the set html/css/js to be added

Inherited from: \modManagerController::_prepareHead()
methodprivate_prepareVersionPostfix( ) : string
inherited

Grabs a stripped version of modx to prevent caching of JS after upgrades

Inherited from: \modManagerController::_prepareVersionPostfix()
Returns
Type Description
string The parsed version string
Details
Access
private  
methodpublicaddCss( string $script ) : void
inherited

Add a external CSS file to the head of the page

Inherited from: \modManagerController::addCss()
Parameters
Name Type Description
$script string
methodpublicaddHtml( string $script ) : void
inherited

Add a block of HTML to the head of the page

Inherited from: \modManagerController::addHtml()
Parameters
Name Type Description
$script string
methodpublicaddJavascript( string $script ) : void
inherited

Add an external Javascript file to the head of the page

Inherited from: \modManagerController::addJavascript()
Parameters
Name Type Description
$script string
methodpublicaddLastJavascript( string $script ) : void
inherited

Add an external Javascript file to the head of the page

Inherited from: \modManagerController::addLastJavascript()
Parameters
Name Type Description
$script string
methodpublicaddLexiconTopic( string $topic ) : string
inherited

Adds a topic to the JS language array

Inherited from: \modManagerController::addLexiconTopic()
Parameters
Name Type Description
$topic string
Returns
Type Description
string
methodprotectedassignPlaceholders( ) : void
methodpubliccheckFormCustomizationRules( \xPDOObject $obj = null, bool $forParent = false ) : bool
inherited

Checks Form Customization rules for an object.

Inherited from: \modManagerController::checkFormCustomizationRules()
Parameters
Name Type Description
$obj \xPDOObject

If passed, will validate against for rules with constraints.

$forParent bool
Returns
Type Description
bool
methodpubliccheckPermissions( ) : boolean
abstractinherited

Do permission checking in this method. Returning false will present a "permission denied" message.

Inherited from: \modManagerController::checkPermissions()
Returns
Type Description
boolean
Details
Abstract
 
methodpublicfailure( string $message ) : void
inherited

Set a failure on this controller. This will return the error message.

Inherited from: \modManagerController::failure()
Parameters
Name Type Description
$message string
methodpublicfetchTemplate( string $tpl ) : string
inherited

Fetch the template content

Inherited from: \modManagerController::fetchTemplate()
Parameters
Name Type Description
$tpl string

The path to the template

Returns
Type Description
string The output of the template
methodpublicfireOnRenderEvent( ) : string

Fire any render events

Returns
Type Description
string
methodpublicfireOnTVFormRender( ) : mixed

Fire the TV Form Render event

Returns
Type Description
mixed
methodpublicfirePostRenderEvents( ) : void
inherited

Can be used to fire events after all the CSS/JS is loaded for a page

Inherited from: \modManagerController::firePostRenderEvents()
methodpublicfirePreRenderEvents( ) : array | bool | string

Fire any pre-render events

Returns
Type Description
array | bool | string
methodpublicgetControllersPaths( bool $coreOnly = false ) : array
inherited

Get the path to this controller's directory. Override this to point to a custom directory.

Inherited from: \modManagerController::getControllersPaths()
Parameters
Name Type Description
$coreOnly bool

Ensure that it grabs the path from the core namespace only.

Returns
Type Description
array
methodpublicgetDefaultState( ) : array | mixed | string
inherited

Get the default state for the UI

Inherited from: \modManagerController::getDefaultState()
Returns
Type Description
array | mixed | string
methodpublicgetFooter( ) : string
inherited

Get the page footer for the controller.

Inherited from: \modManagerController::getFooter()
Returns
Type Description
string
methodpublicgetHeader( ) : string
inherited

Get the page header for the controller.

Inherited from: \modManagerController::getHeader()
Returns
Type Description
string
methodpublicgetInstance( \modX $modx, string $className, array $config = array() ) : \modManagerController
static

Return the appropriate Resource controller class based on the class_key request parameter

Parameters
Name Type Description
$modx \modX

A reference to the modX instance

$className string

The controller class name that is attempting to be loaded

$config array

An array of configuration options for the action

Returns
Type Description
\modManagerController The proper controller class
Details
Static
 
methodpublicgetLanguageTopics( ) : array

Specify the language topics to load

Returns
Type Description
array
methodpublicgetPageTitle( ) : string
abstractinherited

Return a string to set as the controller's page title.

Inherited from: \modManagerController::getPageTitle()
Returns
Type Description
string
Details
Abstract
 
methodpublicgetPlaceholder( string $k, mixed $default = null ) : mixed
inherited

Get a specific placeholder set

Inherited from: \modManagerController::getPlaceholder()
Parameters
Name Type Description
$k string
$default mixed
Returns
Type Description
mixed
methodpublicgetPlaceholders( ) : array
inherited

Get all the set placeholders

Inherited from: \modManagerController::getPlaceholders()
Returns
Type Description
array
methodprotectedgetReloadData( ) : void

methodpublicgetResourceGroups( ) : void

methodpublicgetTemplateFile( ) : string
abstractinherited

Return the relative path to the template file to load

Inherited from: \modManagerController::getTemplateFile()
Returns
Type Description
string
Details
Abstract
 
methodpublicgetTemplatesPaths( bool $coreOnly = false ) : array | string
inherited

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.

Parameters
Name Type Description
$coreOnly bool

Ensure that it grabs the path from the core namespace only.

Returns
Type Description
array | string
methodpublicinitialize( ) : void
inherited

Can be used to provide custom methods prior to processing

Inherited from: \modManagerController::initialize()
methodpublicloadController(  $controller, bool $coreOnly = false ) : mixed | string
inherited

Load another manual controller file (such as header/footer)

Inherited from: \modManagerController::loadController()
Parameters
Name Type Description
$controller
$coreOnly bool
Returns
Type Description
mixed | string
methodpublicloadControllersPath( ) : array
inherited

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()
Returns
Type Description
array
methodpublicloadCustomCssJs( ) : void
abstractinherited

Register any custom CSS or JS in this method.

Inherited from: \modManagerController::loadCustomCssJs()
Details
Abstract
 
methodpublicloadRichTextEditor( ) : void

Initialize a RichText Editor, if set

methodpublicloadTVs( array $reloadData = array() ) : string

Load the TVs for the Resource

Parameters
Name Type Description
$reloadData array

resource data passed if reloading

Returns
Type Description
string The TV editing form
methodpublicloadTemplatesPath( ) : string
inherited

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()
Returns
Type Description
string
methodpublicloadWorkingContext( ) : \modContext | string
inherited

Load the working context for this controller.

Inherited from: \modManagerController::loadWorkingContext()
Returns
Type Description
\modContext | string
methodpublicprepareLanguage( ) : void
inherited

Prepares the language placeholders

Inherited from: \modManagerController::prepareLanguage()
methodpublicprepareResource( ) : void

Used to set values on the resource record sent to the template for derivative classes

methodpublicprocess( array $scriptProperties = array() ) : mixed
abstractinherited

Process the controller, returning an array of placeholders to set.

Inherited from: \modManagerController::process()
Parameters
Name Type Description
$scriptProperties array

A array of REQUEST parameters.

Returns
Type Description
mixed Either an error or output string, or an array of placeholders to set.
Details
Abstract
 
methodpublicregisterBaseScripts( ) : void
inherited

Registers the core and base JS scripts

Inherited from: \modManagerController::registerBaseScripts()
Details
Access
public  
methodpublicregisterCssJs( ) : void
inherited

Registers CSS/JS to manager interface

Inherited from: \modManagerController::registerCssJs()
methodpublicrender( ) : string
inherited

Render the controller.

Inherited from: \modManagerController::render()
Returns
Type Description
string
methodpublicsetContext( ) : \modContext

Get and set the context for this resource

Returns
Type Description
\modContext
methodpublicsetParent( ) : string

Get and set the parent for this resource

Returns
Type Description
string The pagetitle of the parent
methodpublicsetPermissions( ) : void

Setup permissions for this page

methodpublicsetPlaceholder( string $k, mixed $v ) : void
inherited

Set a placeholder for this controller's template

Inherited from: \modManagerController::setPlaceholder()
Parameters
Name Type Description
$k string

The key of the placeholder

$v mixed

The value of the placeholder

methodpublicsetPlaceholders( array $keys ) : void
inherited

Set an array of placeholders

Inherited from: \modManagerController::setPlaceholders()
Parameters
Name Type Description
$keys array
methodpublicsetProperties( array $properties ) : void
inherited

Sets the properties array for this controller

Inherited from: \modManagerController::setProperties()
Parameters
Name Type Description
$properties array
methodpublicsetProperty( string $key, mixed $value ) : void
inherited

Set a property for this controller

Inherited from: \modManagerController::setProperty()
Parameters
Name Type Description
$key string
$value mixed
methodpublicsetResourceToken( ) : void

Set token for validating a request

methodpublicsetTemplatePaths( array $paths ) : void
inherited

Set the possible template paths for this controller

Inherited from: \modManagerController::setTemplatePaths()
Parameters
Name Type Description
$paths array
Documentation was generated by DocBlox 0.18.1.