TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\FrontendEditing\FrontendEditingController Class Reference

Public Member Functions

 initConfigOptions ()
 
 displayEditPanel ($content, array $conf, $currentRecord, array $dataArray)
 
 displayEditIcons ($content, $params, array $conf=[], $currentRecord='', array $dataArray=[], $addUrlParamStr='')
 
 isEditAction ()
 
 isEditFormShown ()
 
 editAction ()
 
 doHide ($table, $uid)
 
 doUnhide ($table, $uid)
 
 doUp ($table, $uid)
 
 doDown ($table, $uid)
 
 doMoveAfter ($table, $uid)
 
 doDelete ($table, $uid)
 
 doSave ($table, $uid)
 
 doSaveAndClose ($table, $uid)
 
 doClose ($table, $uid)
 
 getJavascriptIncludes ()
 
 getHiddenFields (array $dataArray)
 

Public Attributes

 $TSFE_EDIT
 

Protected Member Functions

 move ($table, $uid, $direction='', $afterUID=0)
 
 allowedToEditLanguage ($table, array $currentRecord)
 
 allowedToEdit ($table, array $dataArray, array $conf, $checkEditAccessInternals=true)
 
 getAllowedEditActions ($table, array $conf, $pid, $allow='')
 
 initializeTceMain ()
 

Protected Attributes

 $tce
 

Detailed Description

Controller class for frontend editing.

Definition at line 23 of file FrontendEditingController.php.

Member Function Documentation

◆ allowedToEdit()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::allowedToEdit (   $table,
array  $dataArray,
array  $conf,
  $checkEditAccessInternals = true 
)
protected

Checks whether the user is allowed to edit the requested table.

Parameters
string$tableThe name of the table.
array$dataArrayThe data array.
array$confThe configuration array for the edit panel.
bool$checkEditAccessInternalsBoolean indicating whether recordEditAccessInternals should not be checked. Defaults
Returns
bool

Definition at line 468 of file FrontendEditingController.php.

References $GLOBALS, TYPO3\CMS\Core\Type\Bitmask\Permission\CONTENT_EDIT, TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\getAllowedEditActions(), TYPO3\CMS\Core\Utility\GeneralUtility\strtolower(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\displayEditIcons(), and TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\displayEditPanel().

◆ allowedToEditLanguage()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::allowedToEditLanguage (   $table,
array  $currentRecord 
)
protected

Checks whether the user has access to edit the language for the requested record.

Parameters
string$tableThe name of the table.
array$currentRecordThe record.
Returns
bool

Definition at line 439 of file FrontendEditingController.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\displayEditIcons(), and TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\displayEditPanel().

◆ displayEditIcons()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::displayEditIcons (   $content,
  $params,
array  $conf = [],
  $currentRecord = '',
array  $dataArray = [],
  $addUrlParamStr = '' 
)

Adds an edit icon to the content string. The edit icon links to FormEngine with proper parameters for editing the table/fields of the context. This implements TYPO3 context sensitive editing facilities. Only backend users will have access (if properly configured as well).

Parameters
string$contentThe content to which the edit icons should be appended
string$paramsThe parameters defining which table and fields to edit. Syntax is [tablename]:[fieldname],[fieldname],[fieldname],... OR [fieldname],[fieldname],[fieldname],... (basically "[tablename]:" is optional, default table is the one of the "current record" used in the function). The fieldlist is sent as "&columnsOnly=" parameter to FormEngine
array$confTypoScript properties for configuring the edit icons.
string$currentRecordThe "table:uid" of the record being shown. If empty string then $this->currentRecord is used. For new records (set by $conf['newRecordFromTable']) it's auto-generated to "[tablename]:NEW
array$dataArrayAlternative data array to use. Default is $this->data
string$addUrlParamStrAdditional URL parameters for the link pointing to FormEngine
Returns
string The input content string, possibly with edit icons added (not necessarily in the end but just after the last string of normal content.

Definition at line 116 of file FrontendEditingController.php.

References $GLOBALS, $params, TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\allowedToEdit(), TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\allowedToEditLanguage(), TYPO3\CMS\Core\Utility\GeneralUtility\getUserObj(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\displayEditPanel().

◆ displayEditPanel()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::displayEditPanel (   $content,
array  $conf,
  $currentRecord,
array  $dataArray 
)

Generates the "edit panels" which can be shown for a page or records on a page when the Admin Panel is enabled for a backend users surfing the frontend. With the "edit panel" the user will see buttons with links to editing, moving, hiding, deleting the element This function is used for the cObject EDITPANEL and the stdWrap property ".editPanel"

Parameters
string$contentA content string containing the content related to the edit panel. For cObject "EDITPANEL" this is empty but not so for the stdWrap property. The edit panel is appended to this string and returned.
array$confTypoScript configuration properties for the editPanel
string$currentRecordThe "table:uid" of the record being shown. If empty string then $this->currentRecord is used. For new records (set by $conf['newRecordFromTable']) it's auto-generated to "[tablename]:NEW
array$dataArrayAlternative data array to use. Default is $this->data
Returns
string The input content string with the editPanel appended. This function returns only an edit panel appended to the content string if a backend user is logged in (and has the correct permissions). Otherwise the content string is directly returned.

Definition at line 65 of file FrontendEditingController.php.

References $GLOBALS, $uid, TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\allowedToEdit(), TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\allowedToEditLanguage(), TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\displayEditIcons(), TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\getAllowedEditActions(), TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\getHiddenFields(), and TYPO3\CMS\Core\Utility\GeneralUtility\getUserObj().

◆ doClose()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::doClose (   $table,
  $uid 
)

Stub for closing a record. No real functionality needed since content element rendering will take care of everything.

Parameters
string$tableThe table name for the record to close.
int$uidThe UID for the record to close.
Returns
void

Definition at line 427 of file FrontendEditingController.php.

◆ doDelete()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::doDelete (   $table,
  $uid 
)

Deletes a specific record.

Parameters
string$tableThe table name for the record to delete.
int$uidThe UID for the record to delete.
Returns
void

Definition at line 373 of file FrontendEditingController.php.

References $uid, and TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\initializeTceMain().

◆ doDown()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::doDown (   $table,
  $uid 
)

Moves a record down.

Parameters
string$tableThe table name for the record to move.
int$uidThe UID for the record to move.
Returns
void

Definition at line 282 of file FrontendEditingController.php.

References $uid, and TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\move().

◆ doHide()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::doHide (   $table,
  $uid 
)

Hides a specific record.

Parameters
string$tableThe table name for the record to hide.
int$uidThe UID for the record to hide.
Returns
void

Definition at line 232 of file FrontendEditingController.php.

References $GLOBALS, $uid, and TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\initializeTceMain().

◆ doMoveAfter()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::doMoveAfter (   $table,
  $uid 
)

Moves a record after a given element. Used for drag.

Parameters
string$tableThe table name for the record to move.
int$uidThe UID for the record to move.
Returns
void

Definition at line 294 of file FrontendEditingController.php.

References $GLOBALS, $uid, and TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\move().

◆ doSave()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::doSave (   $table,
  $uid 
)

Saves a record based on its data array.

Parameters
string$tableThe table name for the record to save.
int$uidThe UID for the record to save.
Returns
void

Definition at line 390 of file FrontendEditingController.php.

References $GLOBALS, and TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\initializeTceMain().

Referenced by TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\doSaveAndClose().

◆ doSaveAndClose()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::doSaveAndClose (   $table,
  $uid 
)

Saves a record based on its data array and closes it.

Parameters
string$tableThe table name for the record to save.
int$uidThe UID for the record to save.
Returns
void
Note
This method is only a wrapper for doSave() but is needed so

Definition at line 414 of file FrontendEditingController.php.

References $uid, and TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\doSave().

◆ doUnhide()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::doUnhide (   $table,
  $uid 
)

Unhides (shows) a specific record.

Parameters
string$tableThe table name for the record to unhide.
int$uidThe UID for the record to unhide.
Returns
void

Definition at line 251 of file FrontendEditingController.php.

References $GLOBALS, $uid, and TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\initializeTceMain().

◆ doUp()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::doUp (   $table,
  $uid 
)

Moves a record up.

Parameters
string$tableThe table name for the record to move.
int$uidThe UID for the record to hide.
Returns
void

Definition at line 270 of file FrontendEditingController.php.

References $uid, and TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\move().

◆ editAction()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::editAction ( )

Management of the on-page frontend editing forms and edit panels. Basically taking in the data and commands and passes them on to the proper classes as they should be.

Returns
void
Exceptions
UnexpectedValueExceptionif TSFE_EDIT[cmd] is not a valid command
See also

Definition at line 197 of file FrontendEditingController.php.

References $GLOBALS, $uid, and TYPO3\CMS\Core\Utility\GeneralUtility\callUserFunction().

Referenced by TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\initConfigOptions().

◆ getAllowedEditActions()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::getAllowedEditActions (   $table,
array  $conf,
  $pid,
  $allow = '' 
)
protected

Takes an array of generally allowed actions and filters that list based on page and content permissions.

Parameters
string$tableThe name of the table.
array$confThe configuration array.
int$pidThe PID where editing will occur.
string$allowComma-separated list of actions that are allowed in general.
Returns
array

Definition at line 517 of file FrontendEditingController.php.

References $GLOBALS, TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_DELETE, TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_EDIT, TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_NEW, TYPO3\CMS\Core\Utility\GeneralUtility\strtolower(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\allowedToEdit(), and TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\displayEditPanel().

◆ getHiddenFields()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::getHiddenFields ( array  $dataArray)

Gets the hidden fields (array key=field name, value=field value) to be used in the edit panel for a particular content element. In the normal case, no hidden fields are needed but special controllers such as TemplaVoila need to track flexform pointers, etc.

Parameters
array$dataArrayThe data array for a specific content element.
Returns
array

Definition at line 569 of file FrontendEditingController.php.

Referenced by TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\displayEditPanel().

◆ getJavascriptIncludes()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::getJavascriptIncludes ( )

Adds any extra Javascript includes needed for Front-end editing

Returns
string

Definition at line 556 of file FrontendEditingController.php.

◆ initConfigOptions()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::initConfigOptions ( )

◆ initializeTceMain()

◆ isEditAction()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::isEditAction ( )

Returns TRUE if an edit-action is sent from the Admin Panel

Returns
bool
See also

Definition at line 156 of file FrontendEditingController.php.

Referenced by TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\initConfigOptions().

◆ isEditFormShown()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::isEditFormShown ( )

Returns TRUE if an edit form is shown on the page. Used from RequestHandler where a TRUE return-value will result in classes etc. being included.

Returns
bool
See also

Definition at line 179 of file FrontendEditingController.php.

◆ move()

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::move (   $table,
  $uid,
  $direction = '',
  $afterUID = 0 
)
protected

Moves a record

Parameters
string$tableThe table name for the record to move.
int$uidThe UID for the record to move.
string$directionThe direction to move, either 'up' or 'down'.
int$afterUIDThe UID of record to move after. This is specified for dragging only.
Returns
void

Definition at line 309 of file FrontendEditingController.php.

References $GLOBALS, $uid, TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\initializeTceMain(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\doDown(), TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\doMoveAfter(), and TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\doUp().

Member Data Documentation

◆ $tce

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::$tce
protected

Definition at line 36 of file FrontendEditingController.php.

◆ $TSFE_EDIT

TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::$TSFE_EDIT

Definition at line 31 of file FrontendEditingController.php.