Documentation TYPO3 par Ameos

user_feAdmin Class Reference

List of all members.

Public Member Functions

 init ($content, $conf)
 parseValues ()
 processFiles ($cmdParts, $theField)
 overrideValues ()
 defaultValues ()
 evalValues ()
 userProcess ($mConfKey, $passVar)
 userProcess_alt ($confVal, $confArr, $passVar)
 save ()
 deleteRecord ()
 deleteFilesFromRecord ($uid)
 displayDeleteScreen ()
 displayCreateScreen ()
 displayEditScreen ()
 displayEditForm ($origArr)
 procesSetFixed ()
 removeRequired ($templateCode, $failure)
 getPlainTemplate ($key, $r='')
 modifyDataArrForFormUpdate ($inputArr)
 setCObjects ($templateCode, $currentArr=array(), $markerArray='', $specialPrefix='')
 sendInfoMail ()
 compileMail ($key, $DBrows, $recipient, $setFixedConfig=array())
 sendMail ($recipient, $admin, $content='', $adminContent='')
 isHTMLContent ($c)
 sendHTMLMail ($content, $recipient, $dummy, $fromEmail, $fromName, $replyTo='')
 aCAuth ($r)
 authCode ($r, $extra='')
 setfixed ($markerArray, $setfixed, $r)
 setfixedHash ($recCopy, $fields='')
 isPreview ()
 createFileFuncObj ()
 clearCacheIfSet ()
 getFailure ($theField, $theCmd, $label)

Public Attributes

 $recInMarkersHSC = TRUE
 $dataArr = array()
 $failureMsg = array()
 $theTable = ''
 $thePid = 0
 $markerArray = array()
 $templateCode = ''
 $cObj
 $cmd
 $preview
 $backURL
 $recUid
 $failure = 0
 $error = ''
 $saved = 0
 $requiredArr
 $currentArr = array()
 $previewLabel = ''
 $nc = ''
 $additionalUpdateFields = ''
 $emailMarkPrefix = 'EMAIL_TEMPLATE_'
 $codeLength
 $cmdKey
 $fileFunc = ''
 $filesStoredInUploadFolders = array()
 $unlinkTempFiles = array()

Detailed Description

Definition at line 132 of file fe_adminLib.inc.


Member Function Documentation

user_feAdmin::init ( content,
conf 
)

Main function. Called from TypoScript. This

Parameters:
string Empty string, ignore.
array TypoScript properties following the USER_INT object which uses this library
Returns:
string HTML content &tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=396&cHash=d267c36546

Definition at line 179 of file fe_adminLib.inc.

References $markerArray, $templateCode, t3lib_div::_GP(), authCode(), clearCacheIfSet(), compileMail(), defaultValues(), deleteRecord(), displayCreateScreen(), displayDeleteScreen(), displayEditScreen(), evalValues(), t3lib_div::getIndpEnv(), overrideValues(), parseValues(), procesSetFixed(), save(), sendInfoMail(), setCObjects(), setfixed(), t3lib_div::trimExplode(), t3lib_div::unlink_tempfile(), and userProcess().

user_feAdmin::parseValues (  ) 

Performs processing on the values found in the input data array, $this->dataArr. The processing is done according to configuration found in TypoScript Examples of this could be to force a value to an integer, remove all non-alphanumeric characters, trimming a value, upper/lowercase it, or process it due to special types like files submitted etc. Called from init() if the $this->dataArr is found to be an array

Returns:
void
See also:
init()

Definition at line 428 of file fe_adminLib.inc.

References $cmd, t3lib_div::_GP(), t3lib_div::intInRange(), processFiles(), and t3lib_div::trimExplode().

Referenced by init(), and modifyDataArrForFormUpdate().

user_feAdmin::processFiles ( cmdParts,
theField 
)

Processing of files. NOTICE: for now files can be handled only on creation of records. But a more advanced feature is that PREVIEW of files is handled.

Parameters:
array Array with cmd-parts (from parseValues()). This will for example contain information about allowed file extensions and max size of uploaded files.
string The fieldname with the files.
Returns:
void private
See also:
parseValues()

Definition at line 523 of file fe_adminLib.inc.

References createFileFuncObj(), isPreview(), t3lib_div::loadTCA(), t3lib_div::trimExplode(), t3lib_div::upload_copy_move(), t3lib_div::upload_to_tempfile(), and t3lib_div::verifyFilenameAgainstDenyPattern().

Referenced by parseValues().

user_feAdmin::overrideValues (  ) 

Overriding values in $this->dataArr if configured for that in TypoScript ([edit/create].overrideValues)

Returns:
void
See also:
init()

Definition at line 629 of file fe_adminLib.inc.

Referenced by init().

user_feAdmin::defaultValues (  ) 

Called if there is no input array in $this->dataArr. Then this function sets the default values configured in TypoScript

Returns:
void
See also:
init()

Definition at line 645 of file fe_adminLib.inc.

Referenced by init().

user_feAdmin::evalValues (  ) 

This will evaluate the input values from $this->dataArr to see if they conforms with the requirements configured in TypoScript per field. For example this could be checking if a field contains a valid email address, a unique value, a value within a certain range etc. It will populate arrays like $this->failure and $this->failureMsg with error messages (which can later be displayed in the template). Mostly it does NOT alter $this->dataArr (such parsing of values was done by parseValues()) Works based on configuration in TypoScript key [create/edit].evalValues

Returns:
void
See also:
init(), parseValues()

Definition at line 664 of file fe_adminLib.inc.

References $cmd, getFailure(), t3lib_div::inList(), t3lib_div::intval_positive(), and t3lib_div::trimExplode().

Referenced by init(), and modifyDataArrForFormUpdate().

user_feAdmin::userProcess ( mConfKey,
passVar 
)

Preforms user processing of input array - triggered right after the function call to evalValues() IF TypoScript property "evalFunc" was set.

Parameters:
string Key pointing to the property in TypoScript holding the configuration for this processing (here: "evalFunc.*"). Well: at least its safe to say that "parentObj" in this array passed to the function is a reference back to this object.
array The $this->dataArr passed for processing
Returns:
array The processed $passVar ($this->dataArr)
See also:
init(), evalValues()

Definition at line 786 of file fe_adminLib.inc.

Referenced by init().

user_feAdmin::userProcess_alt ( confVal,
confArr,
passVar 
)

User processing of contnet

Parameters:
string Value of the TypoScript object triggering the processing.
array Properties of the TypoScript object triggering the processing. The key "parentObj" in this array is passed to the function as a reference back to this object.
mixed Input variable to process
Returns:
mixed Processed input variable, $passVar
See also:
userProcess(), save(), modifyDataArrForFormUpdate()

Definition at line 804 of file fe_adminLib.inc.

Referenced by modifyDataArrForFormUpdate(), procesSetFixed(), and save().

user_feAdmin::save (  ) 

Performs the saving of records, either edited or created.

Returns:
void
See also:
init()

Definition at line 846 of file fe_adminLib.inc.

References $dataArr, aCAuth(), t3lib_div::trimExplode(), and userProcess_alt().

Referenced by init().

user_feAdmin::deleteRecord (  ) 

Deletes the record from table/uid, $this->theTable/$this->recUid, IF the fe-user has permission to do so. If the deleted flag should just be set, then it is done so. Otherwise the record truely is deleted along with any attached files. Called from init() if "cmd" was set to "delete" (and some other conditions)

Returns:
string void
See also:
init()

Definition at line 904 of file fe_adminLib.inc.

References aCAuth(), and deleteFilesFromRecord().

Referenced by init().

user_feAdmin::deleteFilesFromRecord ( uid  ) 

Deletes the files attached to a record and updates the record. Table/uid is $this->theTable/$uid

Parameters:
integer Uid number of the record to delete from $this->theTable
Returns:
void private
See also:
deleteRecord()

Definition at line 934 of file fe_adminLib.inc.

References t3lib_div::loadTCA().

Referenced by deleteRecord().

user_feAdmin::displayDeleteScreen (  ) 

Creates the preview display of delete actions

Returns:
string HTML content
See also:
init()

Definition at line 991 of file fe_adminLib.inc.

References aCAuth(), and getPlainTemplate().

Referenced by init().

user_feAdmin::displayCreateScreen (  ) 

Creates the "create" screen for records

Returns:
string HTML content
See also:
init()

Definition at line 1019 of file fe_adminLib.inc.

References $failure, $markerArray, $templateCode, t3lib_div::_GP(), modifyDataArrForFormUpdate(), removeRequired(), and setCObjects().

Referenced by init().

user_feAdmin::displayEditScreen (  ) 

Creates the edit-screen for records

Returns:
string HTML content
See also:
init()

Definition at line 1042 of file fe_adminLib.inc.

References $markerArray, $templateCode, aCAuth(), displayEditForm(), getPlainTemplate(), and setCObjects().

Referenced by init().

user_feAdmin::displayEditForm ( origArr  ) 

Subfunction for displayEditScreen(); Takes a record and creates an edit form based on the template code for it. This function is called if the user is editing a record and permitted to do so. Checked in displayEditScreen()

Parameters:
array The array with the record to edit
Returns:
string HTML content private
See also:
displayEditScreen()

Definition at line 1093 of file fe_adminLib.inc.

References $currentArr, $failure, $markerArray, $templateCode, t3lib_div::_GP(), modifyDataArrForFormUpdate(), removeRequired(), and setCObjects().

Referenced by displayEditScreen().

user_feAdmin::procesSetFixed (  ) 

Processes socalled "setfixed" commands. These are commands setting a certain field in a certain record to a certain value. Like a link you can click in an email which will unhide a record to enable something. Or likewise a link which can delete a record by a single click. The idea is that only some allowed actions like this is allowed depending on the configured TypoScript.

Returns:
string HTML content displaying the status of the action

Definition at line 1121 of file fe_adminLib.inc.

References t3lib_div::_GP(), authCode(), clearCacheIfSet(), compileMail(), getPlainTemplate(), setfixed(), setfixedHash(), t3lib_div::trimExplode(), and userProcess_alt().

Referenced by init().

user_feAdmin::removeRequired ( templateCode,
failure 
)

Remove required parts from template code string Works like this:

Only fields that are found in $this->requiredArr is processed.

Parameters:
string The template HTML code
string Comma list of fields which has errors (and therefore should not be removed)
Returns:
string The processed template HTML code

Definition at line 1210 of file fe_adminLib.inc.

References $failure, $templateCode, and t3lib_div::inList().

Referenced by displayCreateScreen(), and displayEditForm().

user_feAdmin::getPlainTemplate ( key,
r = '' 
)

Returns template subpart HTML code for the key given

Parameters:
string Subpart marker to return subpart for.
array Optional data record array. If set, then all fields herein will also be substituted if found as markers in the template
Returns:
string The subpart with all markers found in current $this->markerArray substituted.
See also:
tslib_cObj::fillInMarkerArray()

Definition at line 1228 of file fe_adminLib.inc.

References $templateCode, and setCObjects().

Referenced by displayDeleteScreen(), displayEditScreen(), procesSetFixed(), and sendInfoMail().

user_feAdmin::modifyDataArrForFormUpdate ( inputArr  ) 

Modifies input array for passing on to tslib_cObj::getUpdateJS() which produces some JavaScript for form evaluation or the like.

Parameters:
array The data array
Returns:
array The processed input array
See also:
displayCreateScreen(), displayEditForm(), tslib_cObj::getUpdateJS()

Definition at line 1245 of file fe_adminLib.inc.

References $cmd, evalValues(), isPreview(), parseValues(), t3lib_div::trimExplode(), and userProcess_alt().

Referenced by displayCreateScreen(), and displayEditForm().

user_feAdmin::setCObjects ( templateCode,
currentArr = array(),
markerArray = '',
specialPrefix = '' 
)

Will render TypoScript cObjects (configured in $this->conf['cObjects.']) and add their content to keys in a markerArray, either the array passed to the function or the internal one ($this->markerArray) if the input $markerArray is not set.

Parameters:
string The current template code string. Is used to check if the marker string is found and if not, the content object is not rendered!
array An alternative data record array (if empty then $this->dataArr is used)
mixed An alternative markerArray to fill in (instead of $this->markerArray). If you want to set the cobjects in the internal $this->markerArray, then just set this to non-array value.
string Optional prefix to set for the marker strings.
Returns:
array The processed $markerArray (if given).

Definition at line 1314 of file fe_adminLib.inc.

References $currentArr, $markerArray, $templateCode, and t3lib_div::makeInstance().

Referenced by compileMail(), displayCreateScreen(), displayEditForm(), displayEditScreen(), getPlainTemplate(), and init().

user_feAdmin::sendInfoMail (  ) 

Sends info mail to user

Returns:
string HTML content message
See also:
init(),compileMail(), sendMail()

Definition at line 1376 of file fe_adminLib.inc.

References t3lib_div::_GP(), compileMail(), getPlainTemplate(), sendMail(), setfixed(), and t3lib_div::testInt().

Referenced by init().

user_feAdmin::compileMail ( key,
DBrows,
recipient,
setFixedConfig = array() 
)

Compiles and sends a mail based on input values + template parts. Looks for a normal and an "-admin" template and may send both kinds of emails. See documentation in TSref.

Parameters:
string A key which together with $this->emailMarkPrefix will identify the part from the template code to use for the email.
array An array of records which fields are substituted in the templates
mixed Mail recipient. If string then its supposed to be an email address. If integer then its a uid of a fe_users record which is looked up and the email address from here is used for sending the mail.
array Additional fields to set in the markerArray used in the substitution process
Returns:
void

Definition at line 1424 of file fe_adminLib.inc.

References $markerArray, authCode(), sendMail(), setCObjects(), setfixed(), and t3lib_div::testInt().

Referenced by init(), procesSetFixed(), and sendInfoMail().

user_feAdmin::sendMail ( recipient,
admin,
content = '',
adminContent = '' 
)

Actually sends the requested mails (through $this->cObj->sendNotifyEmail)

Parameters:
string Recipient email address (or list)
string Possible "admin" email address. Will enable sending of admin emails if also $adminContent is provided
string Content for the regular email to user
string Content for the admin email to administrator
Returns:
void private
See also:
compileMail(), sendInfoMail()

Definition at line 1470 of file fe_adminLib.inc.

References isHTMLContent(), and sendHTMLMail().

Referenced by compileMail(), and sendInfoMail().

user_feAdmin::isHTMLContent ( c  ) 

Detects if content is HTML (looking for <html> tag as first and last in string)

Parameters:
string Content string to test
Returns:
boolean Returns true if the content begins and ends with <html></html>-tags

Definition at line 1515 of file fe_adminLib.inc.

Referenced by sendMail().

user_feAdmin::sendHTMLMail ( content,
recipient,
dummy,
fromEmail,
fromName,
replyTo = '' 
)

Sending HTML email, using same parameters as tslib_cObj::sendNotifyEmail() NOTICE: "t3lib_htmlmail" library must be included for this to work, otherwise an error message is outputted.

Parameters:
string The message content. If blank, no email is sent.
string Comma list of recipient email addresses
string IGNORE this parameter
string "From" email address
string Optional "From" name
string Optional "Reply-To" header email address.
Returns:
void private
See also:
sendMail(), tslib_cObj::sendNotifyEmail()

Definition at line 1536 of file fe_adminLib.inc.

References t3lib_div::makeInstance(), and t3lib_div::makeInstanceClassName().

Referenced by sendMail().

user_feAdmin::aCAuth ( r  ) 

Returns true if authentication is OK based on the "aC" code which is a GET parameter set from outside with a hash string which must match some internal hash string. This allows to authenticate editing without having a fe_users login Uses $this->authCode which is set in init() by "t3lib_div::_GP('aC');"

Parameters:
array The data array for which to evaluate authentication
Returns:
boolean True if authenticated OK
See also:
authCode(), init()

Definition at line 1620 of file fe_adminLib.inc.

References authCode().

Referenced by deleteRecord(), displayDeleteScreen(), displayEditScreen(), and save().

user_feAdmin::authCode ( r,
extra = '' 
)

Creating authentication hash string based on input record and the fields listed in TypoScript property "authcodeFields"

Parameters:
array The data record
string Additional string to include in the hash
Returns:
string Hash string of $this->codeLength (if TypoScript "authcodeFields" was set)
See also:
aCAuth()

Definition at line 1634 of file fe_adminLib.inc.

References t3lib_div::trimExplode().

Referenced by aCAuth(), compileMail(), init(), and procesSetFixed().

user_feAdmin::setfixed ( markerArray,
setfixed,
r 
)

Adding keys to the marker array with "setfixed" GET parameters

Parameters:
array Marker-array to modify/add a key to.
array TypoScript properties configuring "setfixed" for the plugin. Basically this is $this->conf['setfixed.'] passed along.
array The data record
Returns:
array Processed $markerArray
See also:
compileMail()

Definition at line 1660 of file fe_adminLib.inc.

References $markerArray.

Referenced by compileMail(), init(), procesSetFixed(), and sendInfoMail().

user_feAdmin::setfixedHash ( recCopy,
fields = '' 
)

Creating hash string for setFixed. Much similar to authCode()

Parameters:
array The data record
string List of fields to use
Returns:
string Hash string of $this->codeLength (if TypoScript "authcodeFields" was set)
See also:
setfixed(),authCode()

Definition at line 1698 of file fe_adminLib.inc.

References t3lib_div::trimExplode().

Referenced by procesSetFixed().

user_feAdmin::isPreview (  ) 

Returns true if preview display is on.

Returns:
boolean

Definition at line 1719 of file fe_adminLib.inc.

Referenced by modifyDataArrForFormUpdate(), and processFiles().

user_feAdmin::createFileFuncObj (  ) 

Creates an instance of class "t3lib_basicFileFunctions" in $this->fileFunc (if not already done)

Returns:
void

Definition at line 1728 of file fe_adminLib.inc.

References t3lib_div::makeInstance().

Referenced by processFiles().

user_feAdmin::clearCacheIfSet (  ) 

If TypoScript property clearCacheOfPages is set then all page ids in this value will have their cache cleared

Returns:
void

Definition at line 1739 of file fe_adminLib.inc.

Referenced by init(), and procesSetFixed().

user_feAdmin::getFailure ( theField,
theCmd,
label 
)

Returns an error message for the field/command combination inputted. The error message is looked up in the TypoScript properties (evalErrors.[fieldname].[command]) and if empty then the $label value is returned

Parameters:
string Field name
string Command identifier string
string Alternative label, shown if no other error string was found
Returns:
string The error message string

Definition at line 1754 of file fe_adminLib.inc.

Referenced by evalValues().


The documentation for this class was generated from the following file:


Généré par Les experts TYPO3 avec  doxygen 1.4.6