TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\FrontendEditing\FrontendEditingController Class Reference
Inheritance diagram for TYPO3\CMS\Core\FrontendEditing\FrontendEditingController:
t3lib_frontendedit

Public Member Functions

 initConfigOptions ()
 
 displayEditPanel ($content, array $conf, $currentRecord, array $dataArray)
 
 displayEditIcons ($content, $params, array $conf=array(), $currentRecord='', array $dataArray=array(), $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

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Controller class for frontend editing.

Author
Jeff Segars jeff@.nosp@m.webe.nosp@m.mpowe.nosp@m.redc.nosp@m.hurch.nosp@m..org
David Slayback dave@.nosp@m.webe.nosp@m.mpowe.nosp@m.redc.nosp@m.hurch.nosp@m..org

Definition at line 22 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.
boolean$checkEditAccessInternalsBoolean indicating whether recordEditAccessInternals should not be checked. Defaults
Returns
boolean

Definition at line 451 of file FrontendEditingController.php.

References $GLOBALS, TYPO3\CMS\Core\FrontendEditing\FrontendEditingController\getAllowedEditActions(), 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
boolean

Definition at line 423 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 = array(),
  $currentRecord = '',
array  $dataArray = array(),
  $addUrlParamStr = '' 
)

Adds an edit icon to the content string. The edit icon links to alt_doc.php 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 alt_doc.php
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 alt_doc.php
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 113 of file FrontendEditingController.php.

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

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 63 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.
integer$uidThe UID for the record to close.
Returns
void

Definition at line 411 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.
integer$uidThe UID for the record to delete.
Returns
void

Definition at line 360 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.
integer$uidThe UID for the record to move.
Returns
void

Definition at line 272 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.
integer$uidThe UID for the record to hide.
Returns
void

Definition at line 225 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.
integer$uidThe UID for the record to move.
Returns
void

Definition at line 283 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.
integer$uidThe UID for the record to save.
Returns
void

Definition at line 376 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.
integer$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 399 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.
integer$uidThe UID for the record to unhide.
Returns
void

Definition at line 243 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.
integer$uidThe UID for the record to hide.
Returns
void

Definition at line 261 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
index_ts.php

Definition at line 191 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.
integer$pidThe PID where editing will occur.
string$allowComma-separated list of actions that are allowed in general.
Returns
array

Definition at line 499 of file FrontendEditingController.php.

References $GLOBALS, 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 549 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 537 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
boolean
See also
index_ts.php

Definition at line 152 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 index_ts.php where a TRUE return-value will result in classes etc. being included.

Returns
boolean
See also
index_ts.php

Definition at line 174 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.
integer$uidThe UID for the record to move.
string$directionThe direction to move, either 'up' or 'down'.
integer$afterUIDThe UID of record to move after. This is specified for dragging only.
Returns
void

Definition at line 297 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 35 of file FrontendEditingController.php.

◆ $TSFE_EDIT

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

Definition at line 30 of file FrontendEditingController.php.