TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Feedit\FrontendEditPanel Class Reference

Public Member Functions

 __construct (DatabaseConnection $databaseConnection=null, TypoScriptFrontendController $frontendController=null, FrontendBackendUserAuthentication $backendUser=null)
 
 editPanel ($content, array $conf, $currentRecord='', array $dataArr=[], $table='', array $allow=[], $newUID=0, array $hiddenFields=[])
 
 editIcons ($content, $params, array $conf=[], $currentRecord='', array $dataArr=[], $addUrlParamStr='', $table, $editUid, $fieldList)
 

Protected Member Functions

 editPanelLinkWrap ($string, $formName, $cmd, $currentRecord='', $confirm='', $nPid='')
 
 editPanelLinkWrap_doWrap ($string, $url, $additionalClasses='')
 
 isDisabled ($table, array $row)
 

Protected Attributes

 $cObj
 
 $frontendController
 
 $databaseConnection
 
 $backendUser
 
 $iconFactory
 

Detailed Description

View class for the edit panels in frontend editing.

Definition at line 31 of file FrontendEditPanel.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Feedit\FrontendEditPanel::__construct ( DatabaseConnection  $databaseConnection = null,
TypoScriptFrontendController  $frontendController = null,
FrontendBackendUserAuthentication  $backendUser = null 
)

Constructor for the edit panel

Parameters
DatabaseConnection$databaseConnection
TypoScriptFrontendController$frontendController
FrontendBackendUserAuthentication$backendUser

Definition at line 71 of file FrontendEditPanel.php.

References TYPO3\CMS\Feedit\FrontendEditPanel\$backendUser, TYPO3\CMS\Feedit\FrontendEditPanel\$databaseConnection, TYPO3\CMS\Feedit\FrontendEditPanel\$frontendController, $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Member Function Documentation

◆ editIcons()

TYPO3\CMS\Feedit\FrontendEditPanel::editIcons (   $content,
  $params,
array  $conf = [],
  $currentRecord = '',
array  $dataArr = [],
  $addUrlParamStr = '',
  $table,
  $editUid,
  $fieldList 
)

Adds an edit icon to the content string. The edit icon links to EditDocumentController 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 EditDocumentController
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$dataArrAlternative data array to use. Default is $this->data
string$addUrlParamStrAdditional URL parameters for the link pointing to EditDocumentController
string$table
int$editUid
string$fieldList
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 219 of file FrontendEditPanel.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\_GP(), TYPO3\CMS\Feedit\FrontendEditPanel\editPanelLinkWrap_doWrap(), and TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL.

◆ editPanel()

TYPO3\CMS\Feedit\FrontendEditPanel::editPanel (   $content,
array  $conf,
  $currentRecord = '',
array  $dataArr = [],
  $table = '',
array  $allow = [],
  $newUID = 0,
array  $hiddenFields = [] 
)

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$dataArrAlternative data array to use. Default is $this->data
string$table
array$allow
int$newUID
array$hiddenFields
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 96 of file FrontendEditPanel.php.

References $GLOBALS, TYPO3\CMS\Feedit\FrontendEditPanel\editPanelLinkWrap(), TYPO3\CMS\Core\Utility\GeneralUtility\fixed_lgd_cs(), TYPO3\CMS\Core\Utility\GeneralUtility\getIndpEnv(), TYPO3\CMS\Feedit\FrontendEditPanel\isDisabled(), and TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL.

◆ editPanelLinkWrap()

TYPO3\CMS\Feedit\FrontendEditPanel::editPanelLinkWrap (   $string,
  $formName,
  $cmd,
  $currentRecord = '',
  $confirm = '',
  $nPid = '' 
)
protected

Helper function for editPanel() which wraps icons in the panel in a link with the action of the panel. The links are for some of them not simple hyperlinks but onclick-actions which submits a little form which the panel is wrapped in.

Parameters
string$stringThe string to wrap in a link, typ. and image used as button in the edit panel.
string$formNameThe name of the form wrapping the edit panel.
string$cmdThe command of the link. There is a predefined list available: edit, new, up, down etc.
string$currentRecordThe "table:uid" of the record being processed by the panel.
string$confirmText string with confirmation message; If set a confirm box will be displayed before carrying out the action (if Yes is pressed)
int | string$nPid"New pid" - for new records
Returns
string A tag wrapped string.

Definition at line 267 of file FrontendEditPanel.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\_GP(), TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Feedit\FrontendEditPanel\editPanelLinkWrap_doWrap(), TYPO3\CMS\Core\Type\Bitmask\JsConfirmation\FE_EDIT, and TYPO3\CMS\Core\Utility\GeneralUtility\quoteJSvalue().

Referenced by TYPO3\CMS\Feedit\FrontendEditPanel\editPanel().

◆ editPanelLinkWrap_doWrap()

TYPO3\CMS\Feedit\FrontendEditPanel::editPanelLinkWrap_doWrap (   $string,
  $url,
  $additionalClasses = '' 
)
protected

Creates a link to a script (eg. EditDocumentController or NewRecordController) which either opens in the current frame OR in a pop-up window.

Parameters
string$stringThe string to wrap in a link, typ. and image used as button in the edit panel.
string$urlThe URL of the link. Should be absolute if supposed to work with <base> path set.
string$additionalClassesAdditional CSS classes
Returns
string A tag wrapped string.
See also
editPanelLinkWrap()

Definition at line 305 of file FrontendEditPanel.php.

Referenced by TYPO3\CMS\Feedit\FrontendEditPanel\editIcons(), and TYPO3\CMS\Feedit\FrontendEditPanel\editPanelLinkWrap().

◆ isDisabled()

TYPO3\CMS\Feedit\FrontendEditPanel::isDisabled (   $table,
array  $row 
)
protected

Returns TRUE if the input table/row would be hidden in the frontend, according to the current time and simulate user group

Parameters
string$tableThe table name
array$rowThe data record
Returns
bool

Definition at line 318 of file FrontendEditPanel.php.

Referenced by TYPO3\CMS\Feedit\FrontendEditPanel\editPanel().

Member Data Documentation

◆ $backendUser

TYPO3\CMS\Feedit\FrontendEditPanel::$backendUser
protected

◆ $cObj

TYPO3\CMS\Feedit\FrontendEditPanel::$cObj
protected

Definition at line 38 of file FrontendEditPanel.php.

◆ $databaseConnection

TYPO3\CMS\Feedit\FrontendEditPanel::$databaseConnection
protected

◆ $frontendController

TYPO3\CMS\Feedit\FrontendEditPanel::$frontendController
protected

◆ $iconFactory

TYPO3\CMS\Feedit\FrontendEditPanel::$iconFactory
protected

Definition at line 62 of file FrontendEditPanel.php.