class Replace extends Import (View source)

Traits

Trait ApplicationAwareTrait A trait used with ApplicationAwareInterface

Properties

protected Application $app from ApplicationAwareTrait
protected string[] $helpers The handles of the helpers to be returned by the getHelperObjects method. from AbstractController
protected array $sets The values to be sent to views. from AbstractController
protected string|null $action The action to be performed. from AbstractController
protected Request|null $request The current request instance. from AbstractController
protected array|null $parameters The action parameters. from AbstractController
protected $view from Controller
protected $viewPath {@inheritdoc} from Import
protected $theme from Controller
protected $controllerActionPath from Controller
protected $themeViewTemplate from Controller
protected ErrorList $error The current errors container. from UserInterface
protected string|null $validationToken An identifier to be used when checking tokens. from UserInterface
private FileFolder|null|false $currentFolder The current folder (false: not yet initialized; null: global folder; FileFolder: specific folder). from Import
private Checker|null $currentFolderPermissions The permission checker for the current folder. from Import
private $originalPage The page where the file is originally placed on (false: not yet initialized; null: none; Page: specific page). from Import
private File|null|false $replacingFile The file being replaced (false: not yet initialized; null: not found; File otherwise).

Methods

setApplication(Application $app)

Setter method for the application

__construct()

Initialize the instance.

Request
getRequest()

Get the current request instance.

setRequest(Request $request)

Set the current request instance.

requireAsset()

Add an asset required in views.

addHeaderItem(string $item)

Adds an item to the view's header. This item will then be automatically printed out before the section of the page.

addFooterItem(string $item)

Adds an item to the view's footer. This item will then be automatically printed out before the section of the page.

set(string $key, mixed $val)

Set a value to be sent to the view.

array
getSets()

Get the values to be sent to views.

bool
shouldRunControllerTask()

Should the action be executed? Override this method to answer something different than true.

array
getHelperObjects()

Get the the helpers that will be be automatically sent to Views as variables.

mixed
get(string|null $key = null, mixed $defaultValue = null)

Get the whole $_GET array or a specific querystring value.

getTask() deprecated

No description

string|null
getAction()

Get the action to be performed.

array|null
getParameters()

Get the action parameters.

on_start()

Override this method to perform controller initializations.

on_before_render()

Override this method to do something right before the view is rendered.

isPost() deprecated

No description

mixed
post(string|null $key = null, mixed $defaultValue = null)

Get the whole $_POST array or a specific posted value.

redirect() deprecated

Redirect the clients to a specific URL/page (specify path(s) as argument(s) of this function).

runTask(mixed $action, mixed $parameters) deprecated

No description

mixed
runAction(string $action, array $parameters = [])

Perform an action of this controller (if shouldRunControllerTask returns true).

mixed
request(string|null $key = null)

Get the whole $_REQUEST array or a specific requested value.

setViewObject(View $view)

No description

setTheme($mixed)

No description

getTheme()

No description

setThemeViewTemplate($template)

No description

string
getThemeViewTemplate()

Returns the wrapper file that holds the content of the view. Usually view.php

getControllerActionPath()

No description

flash($key, $value, $isHTML = false)

No description

getViewObject()

No description

action()

No description

bool
canAccess()

Can the current page be accessed?

bool
validateAction()

Check whether the token is valid and if the current page be accessed.

view()

No description

from Import
setViewHelpers()

Set the helpers for the view.

from Import
setViewSets()

Set the variables for the view.

FileFolder|null
getCurrentFolder()

Get the current folder.

$this
setCurrentFolder(FileFolder $value = null)

Set the current folder.

from Import
getCurrentFolderPermissions()

Get the permissions for the current folder.

from Import
Page|null
getOriginalPage()

Get the page where the file is originally placed on.

$this
setOriginalPage(Page $value = null)

Set the page where the file is originally placed on.

from Import
int
getAutomaticChunkSize()

Determine the chunk size for chunked uploads.

from Import
string[]
getIncomingFiles()

Get the list of files available in the "incoming" directory.

from Import
File|null
getReplacingFile()

Get the file being replaced.

$this
setReplacingFile(File $value = null)

Set the file being replaced.

Details

setApplication(Application $app)

Setter method for the application

Parameters

Application $app

__construct()

Initialize the instance.

Request getRequest()

Get the current request instance.

Return Value

Request

setRequest(Request $request)

Set the current request instance.

Parameters

Request $request

requireAsset()

Add an asset required in views.

This function accept the same parameters as the requireAsset method of the ResponseAssetGroup.

See also

ResponseAssetGroup::requireAsset

addHeaderItem(string $item)

Adds an item to the view's header. This item will then be automatically printed out before the section of the page.

Parameters

string $item

addFooterItem(string $item)

Adds an item to the view's footer. This item will then be automatically printed out before the section of the page.

Parameters

string $item

set(string $key, mixed $val)

Set a value to be sent to the view.

Parameters

string $key The name of the value
mixed $val The value

array getSets()

Get the values to be sent to views.

Return Value

array

bool shouldRunControllerTask()

Should the action be executed? Override this method to answer something different than true.

Return Value

bool

See also

\Concrete\Core\Controller\AbstractController::shouldRunControllerTask()

array getHelperObjects()

Get the the helpers that will be be automatically sent to Views as variables.

Array keys are the variable names, array values are the helper instances.

Return Value

array

mixed get(string|null $key = null, mixed $defaultValue = null)

Get the whole $_GET array or a specific querystring value.

Parameters

string|null $key set to null to get the whole $_GET array, or a string to get a specific value in the controller sets or from the querystring parameters
mixed $defaultValue what to return if $key is specified but it does not exist neither in the sets nor in the querystring

Return Value

mixed

getTask() deprecated

deprecated use the getAction() method

string|null getAction()

Get the action to be performed.

Return Value

string|null

array|null getParameters()

Get the action parameters.

Return Value

array|null

on_start()

Override this method to perform controller initializations.

on_before_render()

Override this method to do something right before the view is rendered.

For instance, you can call $this->set('variableName', $variableValue) to send the view additional sets.

isPost() deprecated

deprecated Use $this->getRequest()->isPost();

mixed post(string|null $key = null, mixed $defaultValue = null)

Get the whole $_POST array or a specific posted value.

Parameters

string|null $key set to null to get the whole $_POST array, or a string to get a specific posted value (resulting strings will be trimmed)
mixed $defaultValue what to return if $key is specified but it does not exist in the $_POST

Return Value

mixed

redirect() deprecated

deprecated you should return a Response instance from your methods

Redirect the clients to a specific URL/page (specify path(s) as argument(s) of this function).

runTask(mixed $action, mixed $parameters) deprecated

deprecated use the runAction method

Parameters

mixed $action
mixed $parameters

mixed runAction(string $action, array $parameters = [])

Perform an action of this controller (if shouldRunControllerTask returns true).

Parameters

string $action the action to be performed
array $parameters the action parameters

Return Value

mixed in case the action is executed, you'll receive the result of the action, or NULL otherwise

mixed request(string|null $key = null)

Get the whole $_REQUEST array or a specific requested value.

Parameters

string|null $key set to null to get the whole $_REQUEST array, or a string to get a specific value in $_GET or in $_POST

Return Value

mixed

setViewObject(View $view)

Parameters

View $view

setTheme($mixed)

Parameters

$mixed

getTheme()

setThemeViewTemplate($template)

Parameters

$template

string getThemeViewTemplate()

Returns the wrapper file that holds the content of the view. Usually view.php

Return Value

string

getControllerActionPath()

flash($key, $value, $isHTML = false)

Parameters

$key
$value
$isHTML

getViewObject()

See also

\Concrete\Core\Controller\Controller::getViewObject()

action()

See also

\Concrete\Core\Controller\Controller::action()

protected bool canAccess()

Can the current page be accessed?

Return Value

bool

See also

\Concrete\Controller\Dialog\File\Import::canAccess()

protected bool validateAction()

Check whether the token is valid and if the current page be accessed.

Return Value

bool

view()

protected setViewHelpers()

Set the helpers for the view.

protected setViewSets()

Set the variables for the view.

See also

\Concrete\Controller\Dialog\File\Import::setViewSets()

protected FileFolder|null getCurrentFolder()

Get the current folder.

Return Value

FileFolder|null null if global folder, FileFolder instance otherwise

See also

\Concrete\Controller\Dialog\File\Import::getCurrentFolder()

protected $this setCurrentFolder(FileFolder $value = null)

Set the current folder.

Parameters

FileFolder $value null if global folder, FileFolder instance otherwise

Return Value

$this

protected Checker getCurrentFolderPermissions()

Get the permissions for the current folder.

Return Value

Checker

protected Page|null getOriginalPage()

Get the page where the file is originally placed on.

Return Value

Page|null null: none; Page: specific page

See also

\Concrete\Controller\Dialog\File\Import::getOriginalPage()

protected $this setOriginalPage(Page $value = null)

Set the page where the file is originally placed on.

Parameters

Page $value null: none; Page: specific page

Return Value

$this

protected int getAutomaticChunkSize()

Determine the chunk size for chunked uploads.

Return Value

int

protected string[] getIncomingFiles()

Get the list of files available in the "incoming" directory.

Return Value

string[]

Exceptions

Exception in case of errors

protected File|null getReplacingFile()

Get the file being replaced.

Return Value

File|null null if not found, a File instance otherwise

protected $this setReplacingFile(File $value = null)

Set the file being replaced.

Parameters

File $value null if not found, a File instance otherwise

Return Value

$this