36 $this->cObj->start(array());
54 public function editPanel($content, array $conf, $currentRecord =
'', array $dataArr = array(), $table =
'', $allow =
'', $newUID = 0, array $hiddenFields = array()) {
55 $hiddenFieldString = $command =
'';
58 $GLOBALS[
'TSFE']->set_no_cache(
'Frontend edit panel is shown', TRUE);
60 $formName =
'TSFE_EDIT_FORM_' . substr(
$GLOBALS[
'TSFE']->uniqueHash(), 0, 4);
61 $formTag =
'<form name="' . $formName .
'" id ="' . $formName .
'" action="' . htmlspecialchars(
GeneralUtility::getIndpEnv(
'REQUEST_URI')) .
'" method="post" enctype="' . htmlspecialchars(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'form_enctype']) .
'" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
62 $sortField =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'sortby'];
63 $labelField =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'label'];
64 $hideField =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'enablecolumns'][
'disabled'];
66 $TSFE_EDIT =
$GLOBALS[
'BE_USER']->frontendEdit->TSFE_EDIT;
67 if (is_array($TSFE_EDIT) && $TSFE_EDIT[
'record'] == $currentRecord && !$TSFE_EDIT[
'update_close']) {
68 $command = $TSFE_EDIT[
'cmd'];
72 if (isset($allow[
'toolbar']) &&
$GLOBALS[
'BE_USER']->adminPanel instanceof \
TYPO3\CMS\Frontend\View\AdminPanelView) {
73 $panel .=
$GLOBALS[
'BE_USER']->adminPanel->ext_makeToolBar();
75 if (isset($allow[
'edit'])) {
77 $panel .= $this->
editPanelLinkWrap($icon, $formName,
'edit', $dataArr[
'_LOCALIZED_UID'] ? $table .
':' . $dataArr[
'_LOCALIZED_UID'] : $currentRecord);
80 if (isset($allow[
'move']) && $sortField &&
$GLOBALS[
'BE_USER']->workspace === 0) {
88 if (isset($allow[
'hide']) && $hideField &&
$GLOBALS[
'BE_USER']->workspace === 0 && !$dataArr[
'_LOCALIZED_UID']) {
89 if ($dataArr[$hideField]) {
97 if (isset($allow[
'new'])) {
98 if ($table ===
'pages') {
103 $panel .= $this->
editPanelLinkWrap($icon, $formName,
'new', $currentRecord,
'', $newUID);
108 if (isset($allow[
'delete']) &&
$GLOBALS[
'BE_USER']->workspace === 0 && !$dataArr[
'_LOCALIZED_UID']) {
113 $labelTxt = $this->cObj->stdWrap($conf[
'label'], $conf[
'label.']);
114 foreach ((array)$hiddenFields as $name => $value) {
115 $hiddenFieldString .=
'<input type="hidden" name="TSFE_EDIT[' . htmlspecialchars($name) .
']" value="' . htmlspecialchars($value) .
'"/>' . LF;
118 $panel =
'<!-- BE_USER Edit Panel: --> 119 ' . $formTag . $hiddenFieldString .
' 120 <input type="hidden" name="TSFE_EDIT[cmd]" value="" /> 121 <input type="hidden" name="TSFE_EDIT[record]" value="' . $currentRecord .
'" /> 122 <div class="typo3-editPanel">' 124 ($labelTxt ?
'<div class="typo3-editPanel-label">' . sprintf($labelTxt, htmlspecialchars(
GeneralUtility::fixed_lgd_cs($dataArr[$labelField], 50))) .
'</div>' :
'') .
' 129 if ($conf[
'innerWrap']) {
130 $panel = $this->cObj->wrap($panel, $conf[
'innerWrap']);
132 if ($conf[
'innerWrap.']) {
133 $panel = $this->cObj->stdWrap($panel, $conf[
'innerWrap.']);
137 if ($conf[
'outerWrap']) {
138 $panel = $this->cObj->wrap($panel, $conf[
'outerWrap']);
140 if ($conf[
'outerWrap.']) {
141 $panel = $this->cObj->stdWrap($panel, $conf[
'outerWrap.']);
143 if ($conf[
'printBeforeContent']) {
144 $finalOut = $panel . $content;
146 $finalOut = $content . $panel;
149 $hidden = $this->
isDisabled($table, $dataArr) ?
' typo3-feedit-element-hidden' :
'';
150 $outerWrapConfig = isset($conf[
'stdWrap.'])
152 : array(
'wrap' =>
'<div class="typo3-feedit-element' . $hidden .
'">|</div>');
153 $finalOut = $this->cObj->stdWrap($finalOut, $outerWrapConfig);
173 public function editIcons($content, $params, array $conf = array(), $currentRecord =
'', array $dataArr = array(), $addUrlParamStr =
'', $table, $editUid, $fieldList) {
175 $GLOBALS[
'TSFE']->set_no_cache(
'Display frontend edit icons', TRUE);
176 $style = $conf[
'styleAttribute'] ?
' style="' . htmlspecialchars($conf[
'styleAttribute']) .
'"' :
'';
177 $iconTitle = $this->cObj->stdWrap($conf[
'iconTitle'], $conf[
'iconTitle.']);
178 $iconImg = $conf[
'iconImg'] ? $conf[
'iconImg'] :
'<img ' .
\TYPO3\CMS\Backend\Utility\IconUtility::skinImg(TYPO3_mainDir,
'gfx/edit_fe.gif',
'width="11" height="12" border="0" align="top" ') .
' title="' . htmlspecialchars($iconTitle, ENT_COMPAT,
'UTF-8', FALSE) .
'"' . $style .
' class="frontEndEditIcons" alt="" />';
181 $icon = $this->
editPanelLinkWrap_doWrap($iconImg, $adminURL .
'alt_doc.php?edit[' . $table .
'][' . $editUid .
']=edit&columnsOnly=' . rawurlencode($fieldList) .
'&noView=' . $nV . $addUrlParamStr);
182 if ($conf[
'beforeLastTag'] < 0) {
183 $content = $icon . $content;
184 } elseif ($conf[
'beforeLastTag'] > 0) {
185 $cBuf = rtrim($content);
187 while ($secureCount && substr($cBuf, -1) ==
'>' && substr($cBuf, -4) !=
'</a>') {
188 $cBuf = rtrim(preg_replace(
'/<[^<]*>$/',
'', $cBuf));
191 $content = strlen($cBuf) && $secureCount ? substr($content, 0, strlen($cBuf)) . $icon . substr($content, strlen($cBuf)) : ($content = $icon . $content);
210 protected function editPanelLinkWrap($string, $formName, $cmd, $currentRecord =
'', $confirm =
'', $nPid =
'') {
213 if ($cmd ==
'edit') {
214 $rParts = explode(
':', $currentRecord);
215 $out = $this->
editPanelLinkWrap_doWrap($string, $adminURL .
'alt_doc.php?edit[' . $rParts[0] .
'][' . $rParts[1] .
']=edit&noView=' . $nV, $currentRecord);
216 } elseif ($cmd ==
'new') {
217 $rParts = explode(
':', $currentRecord);
218 if ($rParts[0] ==
'pages') {
219 $out = $this->
editPanelLinkWrap_doWrap($string, $adminURL .
'db_new.php?id=' . $rParts[1] .
'&pagesOnly=1', $currentRecord);
224 $out = $this->
editPanelLinkWrap_doWrap($string, $adminURL .
'alt_doc.php?edit[' . $rParts[0] .
'][' . $nPid .
']=new&noView=' . $nV, $currentRecord);
227 if ($confirm &&
$GLOBALS[
'BE_USER']->jsConfirmation(8)) {
234 $out =
'<a href="#" onclick="' . htmlspecialchars(($cf1 .
'document.' . $formName .
'[\'TSFE_EDIT[cmd]\'].value=\'' . $cmd .
'\'; document.
' . $formName . '.submit();
' . $cf2 . ' return false;
')) . '">' . $string . '</a>'; 248 protected function editPanelLinkWrap_doWrap($string, $url) { 249 // Open in the current frame? 250 if ($GLOBALS['BE_USER']->adminPanel->extGetFeAdminValue('edit', 'editNoPopup')) { 251 $href = htmlspecialchars($url . '&returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI'))); 252 return '<a href="' . $href . '" class="frontEndEditIconLinks
">' . $string . '</a>'; 254 $onclick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue($url . '&returnUrl=close.html') . 255 ',\'FEquickEditWindow\',\'width=690,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;'; 256 return '<a href="#
" onclick="' . htmlspecialchars($onclick) . '" class="frontEndEditIconLinks
">' . $string . '</a>'; 267 protected function isDisabled($table, array $row) { 270 $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'] && 271 $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled']] || 272 $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['fe_group'] && 273 $GLOBALS['TSFE']->simUserGroup && 274 $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['fe_group']] == $GLOBALS['TSFE']->simUserGroup || 275 $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['starttime'] && 276 $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['starttime']] > $GLOBALS['EXEC_TIME'] || 277 $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime'] && 278 $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime']] && 279 $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime']] < $GLOBALS['EXEC_TIME']
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
editPanelLinkWrap($string, $formName, $cmd, $currentRecord='', $confirm='', $nPid='')
editPanelLinkWrap_doWrap($string, $url)
static quoteJSvalue($value)
static canBeInterpretedAsInteger($var)
static getIndpEnv($getEnvName)
static makeInstance($className)
isDisabled($table, array $row)
editPanel($content, array $conf, $currentRecord='', array $dataArr=array(), $table='', $allow='', $newUID=0, array $hiddenFields=array())
editIcons($content, $params, array $conf=array(), $currentRecord='', array $dataArr=array(), $addUrlParamStr='', $table, $editUid, $fieldList)
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
static fixed_lgd_cs($string, $chars, $appendString='...')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]