‪TYPO3CMS  9.5
TYPO3\CMS\Feedit\FrontendEditPanel Class Reference

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

TYPO3 CMS Frontend ContentObject ContentObjectRenderer $cObj
 
TypoScriptFrontendController $frontendController
 
FrontendBackendUserAuthentication $backendUser
 
TYPO3 CMS Core Imaging IconFactory $iconFactory
 

Detailed Description

View class for the edit panels in frontend editing.

this is a concrete TYPO3 implementation and solely used for EXT:feedit and not part of TYPO3's Core API.

Definition at line 32 of file FrontendEditPanel.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor for the edit panel

Parameters
mixed$_‪Previous the database connection
TypoScriptFrontendController$frontendController
FrontendBackendUserAuthentication$backendUser

Definition at line 61 of file FrontendEditPanel.php.

References TYPO3\CMS\Feedit\FrontendEditPanel\$backendUser, TYPO3\CMS\Feedit\FrontendEditPanel\$frontendController, and $GLOBALS.

Member Function Documentation

◆ editIcons()

string 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$content‪The content to which the edit icons should be appended
string$params‪The 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$conf‪TypoScript properties for configuring the edit icons.
string$currentRecord‪The "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$dataArr‪Alternative data array to use. Default is $this->data
string$addUrlParamStr‪Additional 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 207 of file FrontendEditPanel.php.

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

◆ editPanel()

string 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$content‪A 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$conf‪TypoScript configuration properties for the editPanel
string$currentRecord‪The "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$dataArr‪Alternative 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 85 of file FrontendEditPanel.php.

References $GLOBALS, TYPO3\CMS\Feedit\FrontendEditPanel\editPanelLinkWrap(), TYPO3\CMS\Feedit\FrontendEditPanel\getLabel(), TYPO3\CMS\Feedit\FrontendEditPanel\isDisabled(), and TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL.

◆ editPanelLinkWrap()

string 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$string‪The string to wrap in a link, typ. and image used as button in the edit panel.
string$formName‪The name of the form wrapping the edit panel.
string$cmd‪The command of the link. There is a predefined list available: edit, new, up, down etc.
string$currentRecord‪The "table:uid" of the record being processed by the panel.
string$confirm‪Text 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 256 of file FrontendEditPanel.php.

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

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

◆ editPanelLinkWrap_doWrap()

string 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$string‪The string to wrap in a link, typ. and image used as button in the edit panel.
string$url‪The URL of the link. Should be absolute if supposed to work with <base> path set.
string$additionalClasses‪Additional CSS classes
Returns
‪string A tag wrapped string.
See also
editPanelLinkWrap()

Definition at line 296 of file FrontendEditPanel.php.

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

◆ getLabel()

string TYPO3\CMS\Feedit\FrontendEditPanel::getLabel ( string  $key)
protected

Returns the label for key. If a translation for the language set in $this->uc['lang'] is found that is returned, otherwise the default value. If the global variable $LOCAL_LANG is NOT an array (yet) then this function loads the global $LOCAL_LANG array with the content of "EXT:core/Resources/Private/Language/locallang_tsfe.xlf" such that the values therein can be used for labels in the Admin Panel

Parameters
string$key‪Key for a label in the $GLOBALS['LOCAL_LANG'] array of "EXT:core/Resources/Private/Language/locallang_tsfe.xlf
Returns
‪string The value for the $key

Definition at line 342 of file FrontendEditPanel.php.

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

◆ getLanguageService()

LanguageService TYPO3\CMS\Feedit\FrontendEditPanel::getLanguageService ( )
protected
Returns
‪LanguageService

Definition at line 356 of file FrontendEditPanel.php.

◆ isDisabled()

bool 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$table‪The table name
array$row‪The data record
Returns
‪bool

Definition at line 311 of file FrontendEditPanel.php.

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

Member Data Documentation

◆ $backendUser

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

◆ $cObj

TYPO3 CMS Frontend ContentObject ContentObjectRenderer TYPO3\CMS\Feedit\FrontendEditPanel::$cObj
protected

The Content Object Renderer

Definition at line 38 of file FrontendEditPanel.php.

◆ $frontendController

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

Property for accessing TypoScriptFrontendController centrally

Definition at line 44 of file FrontendEditPanel.php.

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

◆ $iconFactory

TYPO3 CMS Core Imaging IconFactory TYPO3\CMS\Feedit\FrontendEditPanel::$iconFactory
protected

Definition at line 52 of file FrontendEditPanel.php.