wCMF
3.6
|
Public Member Functions | |
hasView () | |
executeKernel () | |
saveUploadFile ($data) | |
checkFile ($oid, $valueName, $dataType, $filename, $mimeType=null) | |
getMimeTypes ($oid, $valueName, $dataType) | |
getImageConstraints ($oid, $valueName, $dataType) | |
getUploadFilename ($oid, $valueName, $dataType, $filename) | |
shouldOverride ($oid, $valueName, $dataType, $filename) | |
getUploadDir ($oid, $valueName, $dataType) | |
confirmSave (&$node, $valueName, $valueType, $newValue) | |
modify (&$node, $valueName, $valueType, $oldValue) | |
afterSave (&$node) | |
Public Member Functions inherited from Controller | |
Controller (&$delegate) | |
initialize (&$request, &$response) | |
validate () | |
hasView () | |
execute () | |
executeKernel () | |
getErrorMsg () | |
setErrorMsg ($msg) | |
appendErrorMsg ($msg) | |
& | getRequest () |
& | getResponse () |
& | getView () |
& | getDelegate () |
getViewTemplate ($controller, $context, $action) | |
getCacheId () | |
assignViewDefaults (&$view) | |
isLocalizedRequest () | |
Public Attributes | |
$_fileUtil = null | |
$_graphicsUtil = null | |
Public Attributes inherited from Controller | |
$_request = null | |
$_response = null | |
$_errorMsg = '' | |
$_view = null | |
$_delegate = null | |
SaveController is a controller that saves Node data.
wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH
Licensed under the terms of any of the following licenses at your choice:
See the license.txt file distributed with this work for additional information.
Input actions:
Output actions:
[in] | <oid> | A list of nodes defining what to save. Each node should only contain those values, that should be changed This may be achived by creating the node using the node constructor (instead of using PersistenceFacade::create) and setting the values on it. |
[in] | uploadDir | The directory where uploaded files should be placed (see SaveController::getUploadDir()) (optional) |
[out] | oid | The oid of the last Node saved |
Errors concerning single input fields are added to the session (the keys are the input field names)
Definition at line 52 of file class.SaveController.php.
SaveController::hasView | ( | ) |
Definition at line 60 of file class.SaveController.php.
SaveController::executeKernel | ( | ) |
Save Node data.
Definition at line 69 of file class.SaveController.php.
References afterSave(), Controller\appendErrorMsg(), BUILDDEPTH_SINGLE, checkFile(), confirmSave(), Message\get(), FormUtil\getInputFieldDelimiter(), LockManager\getInstance(), PersistenceFacade\getInstance(), Localization\getInstance(), SessionData\getInstance(), PersistenceFacade\getOIDParameter(), getUploadDir(), PersistenceFacade\isKnownType(), Controller\isLocalizedRequest(), PersistenceFacade\isValidOID(), URIUtil\makeRelative(), modify(), and saveUploadFile().
SaveController::saveUploadFile | ( | $data | ) |
Save uploaded file. This method calls checkFile which will prevent upload if returning false.
data | An assoziative array with keys 'oid', 'name', 'dataType', 'value' where value holds an assoziative array with keys 'name', 'type', 'size', 'tmp_name', 'error' as contained in the php $_FILES array. |
Definition at line 319 of file class.SaveController.php.
References Controller\appendErrorMsg(), checkFile(), Message\get(), InifileParser\getInstance(), getUploadDir(), and shouldOverride().
Referenced by executeKernel().
SaveController::checkFile | ( | $oid, | |
$valueName, | |||
$dataType, | |||
$filename, | |||
$mimeType = null |
|||
) |
Check if the file is valid for a given object value.
oid | The oid of the object |
valueName | The name of the value of the object identified by oid |
dataType | The data type value |
filename | The name of the file to upload (including path) |
mimeType | The mime type of the file (if null it will not be checked) [default: null] |
Definition at line 393 of file class.SaveController.php.
References Controller\appendErrorMsg(), Message\get(), getImageConstraints(), and getMimeTypes().
Referenced by executeKernel(), and saveUploadFile().
SaveController::getMimeTypes | ( | $oid, | |
$valueName, | |||
$dataType | |||
) |
Determine possible mime types for an object value.
oid | The oid of the object |
valueName | The name of the value of the object identified by oid |
dataType | The data type value |
Definition at line 448 of file class.SaveController.php.
Referenced by checkFile().
SaveController::getImageConstraints | ( | $oid, | |
$valueName, | |||
$dataType | |||
) |
Get the image constraints for an object value.
oid | The oid of the object |
valueName | The name of the value of the object identified by oid |
dataType | The data type value |
Definition at line 464 of file class.SaveController.php.
References InifileParser\getInstance(), PersistenceFacade\getOIDParameter(), and PersistenceFacade\isValidOID().
Referenced by checkFile().
SaveController::getUploadFilename | ( | $oid, | |
$valueName, | |||
$dataType, | |||
$filename | |||
) |
Get the name for the uploaded file.
oid | The oid of the object |
valueName | The name of the value of the object identified by oid |
dataType | The data type value |
filename | The name of the file to upload (including path) |
Definition at line 506 of file class.SaveController.php.
SaveController::shouldOverride | ( | $oid, | |
$valueName, | |||
$dataType, | |||
$filename | |||
) |
Determine what to do if a file with the same name already exists.
oid | The oid of the object |
valueName | The name of the value of the object identified by oid |
dataType | The data type value |
filename | The name of the file to upload (including path) |
Definition at line 521 of file class.SaveController.php.
Referenced by saveUploadFile().
SaveController::getUploadDir | ( | $oid, | |
$valueName, | |||
$dataType | |||
) |
Get the name of the directory to upload a file to and make shure that it exists.
oid | The oid of the object which will hold the association to the file |
valueName | The name of the value which will hold the association to the file |
dataType | The data type value |
Definition at line 536 of file class.SaveController.php.
References InifileParser\getInstance(), PersistenceFacade\getOIDParameter(), PersistenceFacade\isValidOID(), and FileUtil\mkdirRec().
Referenced by executeKernel(), and saveUploadFile().
SaveController::confirmSave | ( | & | $node, |
$valueName, | |||
$valueType, | |||
$newValue | |||
) |
Confirm save action on given Node value.
node | A reference to the Node to confirm. |
valueName | The name of the value to save. |
valueType | The data type of the value to save. |
newValue | The new value to set. |
Definition at line 577 of file class.SaveController.php.
Referenced by executeKernel().
SaveController::modify | ( | & | $node, |
$valueName, | |||
$valueType, | |||
$oldValue | |||
) |
Modify a given Node value before save action. The new value is already set.
node | A reference to the Node to modify. |
valueName | The name of the value to save. |
valueType | The data type of the value to save. |
oldValue | The old value. |
Definition at line 590 of file class.SaveController.php.
Referenced by executeKernel().
SaveController::afterSave | ( | & | $node | ) |
Called after save.
node | A reference to the Node saved. |
Definition at line 600 of file class.SaveController.php.
Referenced by executeKernel().
SaveController::$_fileUtil = null |
Definition at line 54 of file class.SaveController.php.
SaveController::$_graphicsUtil = null |
Definition at line 55 of file class.SaveController.php.