/** * Renders Content Elements from the tt_content table from page id * * @param integer Page id * @return string HTML for the listing */ function getTable_tt_content($id) { global $TCA; $this->initializeLanguages(); // Initialize: $RTE = $GLOBALS['BE_USER']->isRTE(); $lMarg = 1; $showHidden = $this->tt_contentConfig['showHidden'] ? '' : t3lib_BEfunc::BEenableFields('tt_content'); $pageTitleParamForAltDoc = '&recTitle=' . rawurlencode(t3lib_BEfunc::getRecordTitle('pages', t3lib_BEfunc::getRecordWSOL('pages', $id), TRUE)); $GLOBALS['SOBE']->doc->getPageRenderer()->loadExtJs(); $GLOBALS['SOBE']->doc->getPageRenderer()->addJsFile($GLOBALS['BACK_PATH'] . 'sysext/cms/layout/js/typo3pageModule.js'); // Get labels for CTypes and tt_content element fields in general: $this->CType_labels = array(); foreach ($TCA['tt_content']['columns']['CType']['config']['items'] as $val) { $this->CType_labels[$val[1]] = $GLOBALS['LANG']->sL($val[0]); } $this->itemLabels = array(); foreach ($TCA['tt_content']['columns'] as $name => $val) { $this->itemLabels[$name] = $GLOBALS['LANG']->sL($val['label']); } // Select display mode: if (!$this->tt_contentConfig['single']) { // MULTIPLE column display mode, side by side: // Setting language list: $langList = $this->tt_contentConfig['sys_language_uid']; if ($this->tt_contentConfig['languageMode']) { if ($this->tt_contentConfig['languageColsPointer']) { $langList = '0,' . $this->tt_contentConfig['languageColsPointer']; } else { $langList = implode(',', array_keys($this->tt_contentConfig['languageCols'])); } $languageColumn = array(); } $langListArr = explode(',', $langList); $defLanguageCount = array(); $defLangBinding = array(); // For EACH languages... : foreach ($langListArr as $lP) { // If NOT languageMode, then we'll only be through this once. $showLanguage = $this->defLangBinding && $lP == 0 ? ' AND sys_language_uid IN (0,-1)' : ' AND sys_language_uid=' . $lP; $cList = explode(',', $this->tt_contentConfig['cols']); $content = array(); $head = array(); // For EACH column, render the content into a variable: foreach ($cList as $key) { if (!$lP) { $defLanguageCount[$key] = array(); } // Select content elements from this column/language: $queryParts = $this->makeQueryArray('tt_content', $id, 'AND colPos=' . intval($key) . $showHidden . $showLanguage); $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts); // If it turns out that there are not content elements in the column, then display a big button which links directly to the wizard script: if ($this->doEdit && $this->option_showBigButtons && !intval($key) && !$GLOBALS['TYPO3_DB']->sql_num_rows($result)) { $onClick = "window.location.href='db_new_content_el.php?id=" . $id . '&colPos=' . intval($key) . '&sys_language_uid=' . $lP . '&uid_pid=' . $id . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . "';"; $theNewButton = $GLOBALS['SOBE']->doc->t3Button($onClick, $GLOBALS['LANG']->getLL('newPageContent')); $content[$key] .= '<img src="clear.gif" width="1" height="5" alt="" /><br />' . $theNewButton; } // Traverse any selected elements and render their display code: $rowArr = $this->getResult($result); foreach ($rowArr as $rKey => $row) { if (is_array($row) && (int) $row['t3ver_state'] != 2) { $singleElementHTML = ''; if (!$lP) { $defLanguageCount[$key][] = $row['uid']; } $editUidList .= $row['uid'] . ','; $singleElementHTML .= $this->tt_content_drawHeader($row, $this->tt_contentConfig['showInfo'] ? 15 : 5, $this->defLangBinding && $lP > 0, TRUE); $isRTE = $RTE && $this->isRTEforField('tt_content', $row, 'bodytext'); $singleElementHTML .= '<div ' . ($row['_ORIG_uid'] ? ' class="ver-element"' : '') . '>' . $this->tt_content_drawItem($row, $isRTE) . '</div>'; // NOTE: this is the end tag for <div class="t3-page-ce-body"> // because of bad (historic) conception, starting tag has to be placed inside tt_content_drawHeader() $singleElementHTML .= '</div>'; $statusHidden = $this->isDisabled('tt_content', $row) ? ' t3-page-ce-hidden' : ''; $singleElementHTML = '<div class="t3-page-ce' . $statusHidden . '">' . $singleElementHTML . '</div>'; if ($this->defLangBinding && $this->tt_contentConfig['languageMode']) { $defLangBinding[$key][$lP][$row[$lP ? 'l18n_parent' : 'uid']] = $singleElementHTML; } else { $content[$key] .= $singleElementHTML; } } else { unset($rowArr[$rKey]); } } // Add new-icon link, header: $newP = $this->newContentElementOnClick($id, $key, $lP); $head[$key] .= $this->tt_content_drawColHeader(t3lib_BEfunc::getProcessedValue('tt_content', 'colPos', $key), $this->doEdit && count($rowArr) ? '&edit[tt_content][' . $editUidList . ']=edit' . $pageTitleParamForAltDoc : '', $newP); $editUidList = ''; } // For EACH column, fit the rendered content into a table cell: $out = ''; foreach ($cList as $k => $key) { if (!$k) { $out .= ' <td><img src="clear.gif" width="' . $lMarg . '" height="1" alt="" /></td>'; } else { $out .= ' <td><img src="clear.gif" width="4" height="1" alt="" /></td> <td bgcolor="#cfcfcf"><img src="clear.gif" width="1" height="1" alt="" /></td> <td><img src="clear.gif" width="4" height="1" alt="" /></td>'; } $out .= ' <td class="t3-page-column t3-page-column-' . $key . '">' . $head[$key] . $content[$key] . '</td>'; // Storing content for use if languageMode is set: if ($this->tt_contentConfig['languageMode']) { $languageColumn[$key][$lP] = $head[$key] . $content[$key]; if (!$this->defLangBinding) { $languageColumn[$key][$lP] .= '<br /><br />' . $this->newLanguageButton($this->getNonTranslatedTTcontentUids($defLanguageCount[$key], $id, $lP), $lP); } } } // Wrap the cells into a table row: $out = ' <table border="0" cellpadding="0" cellspacing="0" class="t3-page-columns"> <tr>' . $out . ' </tr> </table>'; // CSH: $out .= t3lib_BEfunc::cshItem($this->descrTable, 'columns_multi', $GLOBALS['BACK_PATH']); } // If language mode, then make another presentation: // Notice that THIS presentation will override the value of $out! But it needs the code above to execute since $languageColumn is filled with content we need! if ($this->tt_contentConfig['languageMode']) { // Get language selector: $languageSelector = $this->languageSelector($id); // Reset out - we will make new content here: $out = ''; // Separator between language columns (black thin line) $midSep = ' <td><img src="clear.gif" width="4" height="1" alt="" /></td> <td bgcolor="black"><img src="clear.gif" width="1" height="1" alt="" /></td> <td><img src="clear.gif" width="4" height="1" alt="" /></td>'; // Traverse languages found on the page and build up the table displaying them side by side: $cCont = array(); $sCont = array(); foreach ($langListArr as $lP) { // Header: $cCont[$lP] = ' <td valign="top" align="center" class="bgColor6"><strong>' . htmlspecialchars($this->tt_contentConfig['languageCols'][$lP]) . '</strong></td>'; // "View page" icon is added: $viewLink = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->id, $this->backPath, t3lib_BEfunc::BEgetRootLine($this->id), '', '', '&L=' . $lP)) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>'; // Language overlay page header: if ($lP) { list($lpRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay', 'pid', $id, 'AND sys_language_uid=' . intval($lP)); t3lib_BEfunc::workspaceOL('pages_language_overlay', $lpRecord); $params = '&edit[pages_language_overlay][' . $lpRecord['uid'] . ']=edit&overrideVals[pages_language_overlay][sys_language_uid]=' . $lP; $lPLabel = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon(t3lib_iconWorks::getSpriteIconForRecord('pages_language_overlay', $lpRecord), $lpRecord['uid']) . $viewLink . ($GLOBALS['BE_USER']->check('tables_modify', 'pages_language_overlay') ? '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $this->backPath)) . '" title="' . $GLOBALS['LANG']->getLL('edit', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>' : '') . htmlspecialchars(t3lib_div::fixed_lgd_cs($lpRecord['title'], 20)); } else { $lPLabel = $viewLink; } $sCont[$lP] = ' <td nowrap="nowrap">' . $lPLabel . '</td>'; } // Add headers: $out .= ' <tr class="bgColor5">' . implode($midSep, $cCont) . ' </tr>'; $out .= ' <tr class="bgColor5">' . implode($midSep, $sCont) . ' </tr>'; // Traverse previously built content for the columns: foreach ($languageColumn as $cKey => $cCont) { $out .= ' <tr> <td valign="top">' . implode('</td>' . $midSep . ' <td valign="top">', $cCont) . '</td> </tr>'; if ($this->defLangBinding) { // "defLangBinding" mode foreach ($defLanguageCount[$cKey] as $defUid) { $cCont = array(); foreach ($langListArr as $lP) { $cCont[] = $defLangBinding[$cKey][$lP][$defUid] . '<br/>' . $this->newLanguageButton($this->getNonTranslatedTTcontentUids(array($defUid), $id, $lP), $lP); } $out .= ' <tr> <td valign="top">' . implode('</td>' . $midSep . ' <td valign="top">', $cCont) . '</td> </tr>'; } // Create spacer: $cCont = array(); foreach ($langListArr as $lP) { $cCont[] = ' '; } $out .= ' <tr> <td valign="top">' . implode('</td>' . $midSep . ' <td valign="top">', $cCont) . '</td> </tr>'; } } // Finally, wrap it all in a table and add the language selector on top of it: $out = $languageSelector . ' <table border="0" cellpadding="0" cellspacing="0" width="480" class="typo3-page-langMode"> ' . $out . ' </table>'; // CSH: $out .= t3lib_BEfunc::cshItem($this->descrTable, 'language_list', $GLOBALS['BACK_PATH']); } } else { // SINGLE column mode (columns shown beneath each other): #debug('single column'); if ($this->tt_contentConfig['sys_language_uid'] == 0 || !$this->defLangBinding) { // Initialize: if ($this->defLangBinding && $this->tt_contentConfig['sys_language_uid'] == 0) { $showLanguage = ' AND sys_language_uid IN (0,-1)'; $lP = 0; } else { $showLanguage = ' AND sys_language_uid=' . $this->tt_contentConfig['sys_language_uid']; $lP = $this->tt_contentConfig['sys_language_uid']; } $cList = explode(',', $this->tt_contentConfig['showSingleCol']); $content = array(); $out = ''; // Expand the table to some preset dimensions: $out .= ' <tr> <td><img src="clear.gif" width="' . $lMarg . '" height="1" alt="" /></td> <td valign="top"><img src="clear.gif" width="150" height="1" alt="" /></td> <td><img src="clear.gif" width="10" height="1" alt="" /></td> <td valign="top"><img src="clear.gif" width="300" height="1" alt="" /></td> </tr>'; // Traverse columns to display top-on-top foreach ($cList as $counter => $key) { // Select content elements: $queryParts = $this->makeQueryArray('tt_content', $id, 'AND colPos=' . intval($key) . $showHidden . $showLanguage); $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts); $c = 0; $rowArr = $this->getResult($result); $rowOut = ''; // If it turns out that there are not content elements in the column, then display a big button which links directly to the wizard script: if ($this->doEdit && $this->option_showBigButtons && !intval($key) && !$GLOBALS['TYPO3_DB']->sql_num_rows($result)) { $onClick = "window.location.href='db_new_content_el.php?id=" . $id . '&colPos=' . intval($key) . '&sys_language_uid=' . $lP . '&uid_pid=' . $id . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . "';"; $theNewButton = $GLOBALS['SOBE']->doc->t3Button($onClick, $GLOBALS['LANG']->getLL('newPageContent')); $theNewButton = '<img src="clear.gif" width="1" height="5" alt="" /><br />' . $theNewButton; } else { $theNewButton = ''; } // Traverse any selected elements: foreach ($rowArr as $rKey => $row) { if (is_array($row) && (int) $row['t3ver_state'] != 2) { $c++; $editUidList .= $row['uid'] . ','; $isRTE = $RTE && $this->isRTEforField('tt_content', $row, 'bodytext'); // Create row output: $rowOut .= ' <tr> <td></td> <td valign="top">' . $this->tt_content_drawHeader($row) . '</td> <td> </td> <td' . ($row['_ORIG_uid'] ? ' class="ver-element"' : '') . ' valign="top">' . $this->tt_content_drawItem($row, $isRTE) . '</td> </tr>'; // If the element was not the last element, add a divider line: if ($c != $GLOBALS['TYPO3_DB']->sql_num_rows($result)) { $rowOut .= ' <tr> <td></td> <td colspan="3"><img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/stiblet_medium2.gif', 'width="468" height="1"') . ' class="c-divider" alt="" /></td> </tr>'; } } else { unset($rowArr[$rKey]); } } // Add spacer between sections in the vertical list if ($counter) { $out .= ' <tr> <td></td> <td colspan="3"><br /><br /><br /><br /></td> </tr>'; } // Add section header: $newP = $this->newContentElementOnClick($id, $key, $this->tt_contentConfig['sys_language_uid']); $out .= ' <!-- Column header: --> <tr> <td></td> <td valign="top" colspan="3">' . $this->tt_content_drawColHeader(t3lib_BEfunc::getProcessedValue('tt_content', 'colPos', $key), $this->doEdit && count($rowArr) ? '&edit[tt_content][' . $editUidList . ']=edit' . $pageTitleParamForAltDoc : '', $newP) . $theNewButton . '<br /></td> </tr>'; // Finally, add the content from the records in this column: $out .= $rowOut; } // Finally, wrap all table rows in one, big table: $out = ' <table border="0" cellpadding="0" cellspacing="0" width="400" class="typo3-page-columnsMode"> ' . $out . ' </table>'; // CSH: $out .= t3lib_BEfunc::cshItem($this->descrTable, 'columns_single', $GLOBALS['BACK_PATH']); } else { $out = '<br/><br/>' . $GLOBALS['SOBE']->doc->icons(1) . 'Sorry, you cannot view a single language in this localization mode (Default Language Binding is enabled)<br/><br/>'; } } // Add the big buttons to page: if ($this->option_showBigButtons) { $bArray = array(); if (!$GLOBALS['SOBE']->current_sys_language) { if ($this->ext_CALC_PERMS & 2) { $bArray[0] = $GLOBALS['SOBE']->doc->t3Button(t3lib_BEfunc::editOnClick('&edit[pages][' . $id . "]=edit", $this->backPath, ''), $GLOBALS['LANG']->getLL('editPageProperties')); } } else { if ($this->doEdit && $GLOBALS['BE_USER']->check('tables_modify', 'pages_language_overlay')) { list($languageOverlayRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay', 'pid', $id, 'AND sys_language_uid=' . intval($GLOBALS['SOBE']->current_sys_language)); $bArray[0] = $GLOBALS['SOBE']->doc->t3Button(t3lib_BEfunc::editOnClick('&edit[pages_language_overlay][' . $languageOverlayRecord['uid'] . "]=edit", $this->backPath, ''), $GLOBALS['LANG']->getLL('editPageProperties_curLang')); } } if ($this->ext_CALC_PERMS & 4 || $this->ext_CALC_PERMS & 2) { $bArray[1] = $GLOBALS['SOBE']->doc->t3Button("window.location.href='" . $this->backPath . "move_el.php?table=pages&uid=" . $id . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . "';", $GLOBALS['LANG']->getLL('move_page')); } if ($this->ext_CALC_PERMS & 8) { $bArray[2] = $GLOBALS['SOBE']->doc->t3Button("window.location.href='" . $this->backPath . "db_new.php?id=" . $id . '&pagesOnly=1&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . "';", $GLOBALS['LANG']->getLL('newPage2')); } if ($this->doEdit && $this->ext_function == 1) { $bArray[3] = $GLOBALS['SOBE']->doc->t3Button("window.location.href='db_new_content_el.php?id=" . $id . '&sys_language_uid=' . $GLOBALS['SOBE']->current_sys_language . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . "';", $GLOBALS['LANG']->getLL('newPageContent2')); } $out = ' <table border="0" cellpadding="4" cellspacing="0" class="typo3-page-buttons"> <tr> <td>' . implode('</td> <td>', $bArray) . '</td> <td>' . t3lib_BEfunc::cshItem($this->descrTable, 'button_panel', $GLOBALS['BACK_PATH']) . '</td> </tr> </table> <br /> ' . $out; } // Return content: return $out; }
/** * Main function, rendering the document with the iframe with the RTE in. * * @return void */ function main() { global $BE_USER, $LANG; // translate id to the workspace version: if ($versionRec = t3lib_BEfunc::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace, $this->P['table'], $this->P['uid'], 'uid')) { $this->P['uid'] = $versionRec['uid']; } // If all parameters are available: if ($this->P['table'] && $this->P['field'] && $this->P['uid'] && $this->checkEditAccess($this->P['table'], $this->P['uid'])) { // Getting the raw record (we need only the pid-value from here...) $rawRec = t3lib_BEfunc::getRecord($this->P['table'], $this->P['uid']); t3lib_BEfunc::fixVersioningPid($this->P['table'], $rawRec); // Setting JavaScript, including the pid value for viewing: $this->doc->JScode = $this->doc->wrapScriptTags(' function jumpToUrl(URL,formEl) { // if (document.editform) { if (!TBE_EDITOR.isFormChanged()) { window.location.href = URL; } else if (formEl) { if (formEl.type=="checkbox") formEl.checked = formEl.checked ? 0 : 1; } } else window.location.href = URL; } ' . ($this->popView ? t3lib_BEfunc::viewOnClick($rawRec['pid'], '', t3lib_BEfunc::BEgetRootLine($rawRec['pid'])) : '') . ' '); // Initialize TCeforms - for rendering the field: $tceforms = t3lib_div::makeInstance('t3lib_TCEforms'); $tceforms->initDefaultBEMode(); // Init... $tceforms->disableWizards = 1; // SPECIAL: Disables all wizards - we are NOT going to need them. $tceforms->colorScheme[0] = $this->doc->bgColor; // SPECIAL: Setting background color of the RTE to ordinary background // Initialize style for RTE object: $RTEobj = t3lib_BEfunc::RTEgetObj(); // Getting reference to the RTE object used to render the field! if ($RTEobj->ID == 'rte') { $RTEobj->RTEdivStyle = 'position:relative; left:0px; top:0px; height:100%; width:100%; border:solid 0px;'; // SPECIAL: Setting style for the RTE <DIV> layer containing the IFRAME } // Fetching content of record: $trData = t3lib_div::makeInstance('t3lib_transferData'); $trData->lockRecords = 1; $trData->fetchRecord($this->P['table'], $this->P['uid'], ''); // Getting the processed record content out: reset($trData->regTableItems_data); $rec = current($trData->regTableItems_data); $rec['uid'] = $this->P['uid']; $rec['pid'] = $rawRec['pid']; // TSconfig, setting width: $fieldTSConfig = $tceforms->setTSconfig($this->P['table'], $rec, $this->P['field']); if (strcmp($fieldTSConfig['RTEfullScreenWidth'], '')) { $width = $fieldTSConfig['RTEfullScreenWidth']; } else { $width = '100%'; } // Get the form field and wrap it in the table with the buttons: $formContent = $tceforms->getSoloField($this->P['table'], $rec, $this->P['field']); $formContent = ' <!-- RTE wizard: --> <table border="0" cellpadding="0" cellspacing="0" width="' . $width . '" id="typo3-rtewizard"> <tr> <td width="' . $width . '" colspan="2" id="c-formContent">' . $formContent . '</td> <td></td> </tr> </table>'; // Adding hidden fields: $formContent .= '<input type="hidden" name="redirect" value="' . htmlspecialchars($this->R_URI) . '" /> <input type="hidden" name="_serialNumber" value="' . md5(microtime()) . '" />' . t3lib_TCEforms::getHiddenTokenField('tceAction'); // Finally, add the whole setup: $this->content .= $tceforms->printNeededJSFunctions_top() . $formContent . $tceforms->printNeededJSFunctions(); } else { // ERROR: $this->content .= $this->doc->section($LANG->getLL('forms_title'), '<span class="typo3-red">' . $LANG->getLL('table_noData', 1) . '</span>', 0, 1); } // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CONTENT'] = $this->content; // Build the <body> for the module $this->content = $this->doc->startPage(''); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Step 6: Done. * * @return void */ function wizard_step6() { $this->saveMenuCode(); $outputString .= '<b>Congratulations!</b> You have completed the initial creation of a new website in TYPO3 based on the TemplaVoila engine. After you click the "Finish" button you can go to the Web>Page module to edit your pages! <br/> <br/> <input type="submit" value="Finish Wizard!" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->wizardData['rootPageId'], $this->doc->backPath) . 'document.location=\'index.php?SET[wiz_step]=0\'; return false;') . '" /> '; // Add output: $this->content .= $this->doc->section('Step 6: Done', $outputString, 0, 1); }
/** * Rendering the localization information table. * * @param array The Page tree data * @return string HTML for the localization information table. */ function renderL10nTable(&$tree) { global $LANG; // Title length: $titleLen = $GLOBALS['BE_USER']->uc['titleLen']; // Put together the TREE: $output = ''; $newOL_js = array(); $langRecUids = array(); //Init DDD $dao = t3lib_div::makeInstance('tx_languagevisibility_daocommon'); if (version_compare(TYPO3_version, '4.3.0', '<')) { $elementfactory = new tx_languagevisibility_elementFactory($dao); } else { $elementfactory = t3lib_div::makeInstance('tx_languagevisibility_elementFactory', $dao); } $languageRep = t3lib_div::makeInstance('tx_languagevisibility_languagerepository'); $languageList = $languageRep->getLanguages(); $visibility = t3lib_div::makeInstance('tx_languagevisibility_visibilityService'); //traverse Tree: foreach ($tree->tree as $data) { $tCells = array(); $element = $elementfactory->getElementForTable('pages', $data['row']['uid']); //first cell (tree): // Page icons / titles etc. $tCells[] = '<td' . ($data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '') . '>' . $data['HTML'] . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'], $titleLen)) . (strcmp($data['row']['nav_title'], '') ? ' [Nav: <em>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['nav_title'], $titleLen)) . '</em>]' : '') . '</td>'; //language cells: foreach ($languageList as $language) { $info = ''; $editUid = $data['row']['uid']; $params = '&edit[pages][' . $editUid . ']=edit'; $langId = $language->getUid(); if ($visibility->isVisible($language, $element)) { $isVisible = TRUE; $statusVis = 'c-visible'; } else { $isVisible = FALSE; $statusVis = 'c-notvisible'; } if ($element->hasTranslation($langId)) { $statusTrans = 'c-translated'; } else { $statusTrans = 'c-nottranslated'; } if ($language->getUid() == 0) { //Default //"View page" link is created: $viewPageLink = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($data['row']['uid'], $GLOBALS['BACK_PATH'], '', '', '', '&L=###LANG_UID###')) . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/zoom.gif', 'width="12" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_viewPage', '1') . '" border="0" alt="" />' . '</a>'; $info .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editDefaultLanguagePage', '1') . '" border="0" alt="" />' . '</a>'; $info .= '<a href="#" onclick="' . htmlspecialchars('top.loadEditId(' . intval($data['row']['uid']) . ',"&SET[language]=0"); return false;') . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit_page.gif', 'width="12" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editPage', '1') . '" border="0" alt="" />' . '</a>'; $info .= str_replace('###LANG_UID###', '0', $viewPageLink); $info .= $data['row']['l18n_cfg'] & 1 ? '<span title="' . $LANG->sL('LLL:EXT:cms/locallang_tca.php:pages.l18n_cfg.I.1', '1') . '">D</span>' : ' '; // Put into cell: $tCells[] = '<td class="' . $statusTrans . ' c-leftLine">' . $info . '</td>'; $tCells[] = '<td class="' . $statusTrans . '" title="' . $LANG->getLL('lang_renderl10n_CEcount', '1') . '" align="center">' . $this->getContentElementCount($data['row']['uid'], 0) . '</td>'; } else { //Normal Language: if ($element->hasTranslation($langId)) { $status = 'c-ok'; $overLayRow = $element->getOverLayRecordForCertainLanguage($langId); //add uid of overlay to list of editable records: $langRecUids[$langId][] = $overLayRow['uid']; $icon = t3lib_iconWorks::getIconImage('pages_language_overlay', $overLayRow, $GLOBALS['BACK_PATH'], 'align="top" class="c-recIcon"'); $info = $icon . htmlspecialchars(t3lib_div::fixed_lgd_cs($overLayRow['title'], $titleLen)) . (strcmp($overLayRow['nav_title'], '') ? ' [Nav: <em>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($overLayRow['nav_title'], $titleLen)) . '</em>]' : '') . ($row['_COUNT'] > 1 ? '<div>' . $LANG->getLL('lang_renderl10n_badThingThereAre', '1') . '</div>' : ''); $tCells[] = '<td class="' . $statusTrans . ' c-leftLine">' . $info . '</td>'; // Edit whole record: $info = ''; $editUid = $overLayRow['uid']; $params = '&edit[pages_language_overlay][' . $editUid . ']=edit'; $info .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editLanguageOverlayRecord', '1') . '" border="0" alt="" />' . '</a>'; $info .= '<a href="#" onclick="' . htmlspecialchars('top.loadEditId(' . intval($data['row']['uid']) . ',"&SET[language]=' . $langId . '"); return false;') . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit_page.gif', 'width="12" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editPageLang', '1') . '" border="0" alt="" />' . '</a>'; $info .= str_replace('###LANG_UID###', $langId, $viewPageLink); $tCells[] = '<td class="' . $statusTrans . '">' . $info . '</td>'; $tCells[] = '<td class="' . $statusTrans . '" title="' . $LANG->getLL('lang_renderl10n_CEcount', '1') . '" align="center">' . $this->getContentElementCount($data['row']['uid'], $langId) . '</td>'; } else { $status = t3lib_div::hideIfNotTranslated($data['row']['l18n_cfg']) || $data['row']['l18n_cfg'] & 1 ? 'c-blocked' : 'c-fallback'; $tCells[] = '<td class="' . $statusTrans . ' c-leftLine"> </td>'; $tCells[] = '<td class="' . $statusTrans . '"> </td>'; //add to JS $infoCell = '<input type="checkbox" name="newOL[' . $langId . '][' . $data['row']['uid'] . ']" value="1" />'; $newOL_js[$langId] .= ' +(document.webinfoForm[\'newOL[' . $langId . '][' . $data['row']['uid'] . ']\'].checked ? \'&edit[pages_language_overlay][' . $data['row']['uid'] . ']=new\' : \'\') '; $tCells[] = '<td class="' . $statusTrans . '">' . $infoCell . '</td>'; } } //last cell show status $tCells[] = '<td class="' . $statusVis . '">' . $this->_getStatusImage($isVisible) . '</td>'; } $output .= ' <tr class="bgColor5"> ' . implode(' ', $tCells) . ' </tr>'; } //first ROW: //**************** $firstRowCells[] = '<td>' . $LANG->getLL('lang_renderl10n_page', '1') . ':</td>'; foreach ($languageList as $language) { $langId = $language->getUid(); if ($this->pObj->MOD_SETTINGS['lang'] == 0 || (int) $this->pObj->MOD_SETTINGS['lang'] === (int) $langId) { $firstRowCells[] = '<td class="c-leftLine">' . $language->getTitle() . $language->getFlagImg() . '</td>'; if ($langId == 0) { $firstRowCells[] = '<td></td>'; $firstRowCells[] = '<td></td>'; } else { // Title: // Edit language overlay records: if (is_array($langRecUids[$langId])) { $params = '&edit[pages_language_overlay][' . implode(',', $langRecUids[$langId]) . ']=edit&columnsOnly=title,nav_title,hidden'; $firstRowCells[] = '<td><a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '"> <img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editLangOverlays', '1') . '" border="0" alt="" /> </a></td>'; } else { $firstRowCells[] = '<td> </td>'; } // Create new overlay records: $params = "'" . $newOL_js[$langId] . "+'&columnsOnly=title,hidden,sys_language_uid&defVals[pages_language_overlay][sys_language_uid]=" . $langId; $firstRowCells[] = '<td><a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '"> <img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/new_el.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('lang_getlangsta_createNewTranslationHeaders', '1') . '" border="0" alt="" /> </a></td>'; $firstRowCells[] = '<td></td>'; } } } $output = ' <tr class="bgColor4"> ' . implode(' ', $firstRowCells) . ' </tr>' . $output; $output = ' <table border="0" cellspacing="0" cellpadding="0" id="langTable">' . $output . ' </table>'; return $output; }
/** * Rendering the information * * @param array The Page tree data * @return string HTML for the information table. */ function renderModule(t3lib_pageTree $tree) { // Initialize: $searchPath = trim(t3lib_div::_GP('pathPrefixSearch')); $cmd = t3lib_div::_GET('cmd'); $entry = t3lib_div::_GET('entry'); $searchForm_replace = t3lib_div::_POST('_replace'); $searchForm_delete = t3lib_div::_POST('_delete'); $trackSameUrl = array(); $this->searchResultCounter = 0; // Traverse tree: $output = ''; $cc=0; foreach($tree->tree as $row) { // Get all pagepath entries for page: $pathCacheInfo = $this->getPathCache($row['row']['uid']); // Row title: $rowTitle = $row['HTML'].t3lib_BEfunc::getRecordTitle('pages',$row['row'],TRUE); $cellAttrib = ($row['row']['_CSSCLASS'] ? ' class="'.$row['row']['_CSSCLASS'].'"' : ''); // Add at least one empty element: if (!count($pathCacheInfo)) { // Add title: $tCells = array(); $tCells[]='<td nowrap="nowrap"'.$cellAttrib.'>'.$rowTitle.'</td>'; // Empty row: $tCells[]='<td colspan="10" align="center"> </td>'; // Compile Row: $output.= ' <tr class="bgColor'.($cc%2 ? '-20':'-10').'"> '.implode(' ',$tCells).' </tr>'; $cc++; } else { foreach($pathCacheInfo as $c => $inf) { // Init: $deletedEntry = FALSE; $hash = $inf['pagepath'].'|'.$inf['rootpage_id'].'|'.$inf['language_id']; // MP is not a part of this because the path itself should be different simply because the MP makes a different path! (see tx_realurl_advanced::pagePathtoID()) // Add icon/title and ID: $tCells = array(); if (!$c) { $tCells[]='<td nowrap="nowrap" rowspan="'.count($pathCacheInfo).'"'.$cellAttrib.'>'.$rowTitle.'</td>'; $tCells[]='<td rowspan="'.count($pathCacheInfo).'">'.$inf['page_id'].'</td>'; } // Add values from alternative field used to generate URL: $baseRow = $row['row']; // page row as base. $onClick = t3lib_BEfunc::editOnClick('&edit[pages]['.$row['row']['uid'].']=edit&columnsOnly=title,nav_title,alias,tx_realurl_pathsegment',$this->pObj->doc->backPath); $editIcon = '<a href="#" onclick="'.htmlspecialchars($onClick).'">'. '<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/edit2.gif','width="11" height="12"').' title="" alt="" />'. '</a>'; $onClick = t3lib_BEfunc::viewOnClick($row['row']['uid'],$this->pObj->doc->backPath,'','','',''); $editIcon.= '<a href="#" onclick="'.htmlspecialchars($onClick).'">'. '<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/zoom.gif','width="12" height="12"').' title="" alt="" />'. '</a>'; if ($inf['language_id']>0) { // For alternative languages, show another list of fields, form page overlay record: $editIcon = ''; list($olRec) = t3lib_BEfunc::getRecordsByField('pages_language_overlay','pid',$row['row']['uid'],' AND sys_language_uid='.intval($inf['language_id'])); if (is_array($olRec)) { $baseRow = array_merge($baseRow,$olRec); $onClick = t3lib_BEfunc::editOnClick('&edit[pages_language_overlay]['.$olRec['uid'].']=edit&columnsOnly=title,nav_title',$this->pObj->doc->backPath); $editIcon = '<a href="#" onclick="'.htmlspecialchars($onClick).'">'. '<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/edit2.gif','width="11" height="12"').' title="" alt="" />'. '</a>'; $onClick = t3lib_BEfunc::viewOnClick($row['row']['uid'],$this->pObj->doc->backPath,'','','','&L='.$olRec['sys_language_uid']); $editIcon.= '<a href="#" onclick="'.htmlspecialchars($onClick).'">'. '<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/zoom.gif','width="12" height="12"').' title="" alt="" />'. '</a>'; } else { $baseRow = array(); } } $tCells[]='<td>'.$editIcon.'</td>'; // Sources for segment: $sources = count($baseRow) ? implode(' | ',array($baseRow['tx_realurl_pathsegment'], $baseRow['alias'], $baseRow['nav_title'], $baseRow['title'])) : ''; $tCells[]='<td nowrap="nowrap">'.htmlspecialchars($sources).'</td>'; // Show page path: if (strcmp($searchPath,'') && t3lib_div::isFirstPartOfStr($inf['pagepath'],$searchPath) && !$inf['expire']) { // Delete entry: if ($searchForm_delete) { $this->deletePathCacheEntry($inf['cache_id']); $deletedEntry = TRUE; $pagePath = '[DELETED]'; } elseif ($searchForm_replace) { $replacePart = trim(t3lib_div::_POST('pathPrefixReplace')); $this->editPathCacheEntry($inf['cache_id'], $replacePart.substr($inf['pagepath'],strlen($searchPath))); $pagePath = '<span class="typo3-red">'. htmlspecialchars($replacePart). '</span>'. htmlspecialchars(substr($inf['pagepath'],strlen($searchPath))); } else { $pagePath = '<span class="typo3-red">'. htmlspecialchars(substr($inf['pagepath'],0,strlen($searchPath))). '</span>'. htmlspecialchars(substr($inf['pagepath'],strlen($searchPath))); $this->searchResultCounter++; } } else { // Delete entries: if ($cmd==='edit' && (!strcmp($entry,$inf['cache_id']) || !strcmp($entry,'ALL'))) { $pagePath = '<input type="text" name="edit['.$inf['cache_id'].']" value="'.htmlspecialchars($inf['pagepath']).'" size="40" />'; if ($cmd==='edit' && $entry!='ALL') { $pagePath.= $this->saveCancelButtons(); } } else { $pagePath = htmlspecialchars($inf['pagepath']); } } $tCells[]='<td'.($inf['expire'] ? ' style="font-style: italic; color:#999999;"' : '').'>'.$pagePath.'</td>'; if ($deletedEntry) { $tCells[]='<td> </td>'; } else { $tCells[]='<td>'. '<a href="'.$this->linkSelf('&cmd=delete&entry='.$inf['cache_id']).'">'. '<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/garbage.gif','width="11" height="12"').' title="Delete" alt="" />'. '</a>'. '<a href="'.$this->linkSelf('&cmd=edit&entry='.$inf['cache_id']).'">'. '<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/edit2.gif','width="11" height="12"').' title="Edit" alt="" />'. '</a>'. '<a href="'.$this->linkSelf('&pathPrefixSearch='.rawurlencode($inf['pagepath'])).'">'. '<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/napshot.gif','width="12" height="12"').' title="Use for search" alt="" />'. '</a>'. '<a href="'.$this->linkSelf('&cmd=copy&entry='.$inf['cache_id']).'">'. '<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/clip_copy.gif','width="12" height="12"').' title="Copy entry" alt="" />'. '</a>'. '</td>'; } $tCells[]='<td'.($inf['expire'] && $inf['expire']<time() ? ' style="color: red;"':'').'>'. ($inf['expire'] ? htmlspecialchars(t3lib_BEfunc::dateTimeAge($inf['expire'],-1)) : ''). ($inf['expire'] ? '<a href="'.$this->linkSelf('&cmd=raiseExpire&entry='.$inf['cache_id']).'">'. '<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/up.gif','width="14" height="14"').' title="Set expire time to 30 days" alt="" />'. '</a>' : ''). '</td>'; // Set error msg: $error = ''; if (!strcmp($inf['pagepath'],'')) { if ($row['row']['uid']!=$this->pObj->id) { // Show error of "Empty" only for levels under the root. Yes, we cannot know that the pObj->id is the true root of the site, but at least any SUB page should probably have a path string! $error = $this->pObj->doc->icons(2).'Empty'; } } elseif (isset($trackSameUrl[$hash])) { $error = $this->pObj->doc->icons(2).'Already used on page ID '.$trackSameUrl[$hash]; } else { $error = ' '; } $tCells[]='<td>'.$error.'</td>'; $tCells[]='<td>'.htmlspecialchars($inf['language_id']).'</td>'; $tCells[]='<td>'.htmlspecialchars($inf['mpvar']).'</td>'; $tCells[]='<td>'.htmlspecialchars($inf['rootpage_id']).'</td>'; #$tCells[]='<td nowrap="nowrap">'.htmlspecialchars(t3lib_BEfunc::datetime($inf['expire'])).' / '.htmlspecialchars(t3lib_BEfunc::calcAge($inf['expire']-time())).'</td>'; $trackSameUrl[$hash] = $inf['page_id']; // Compile Row: $rowClass = 'bgColor'.($cc%2 ? '-20':'-10'); $output.= ' <tr class="'.$rowClass.'"> '.implode(' ',$tCells).' </tr>'; $cc++; } } } // Create header: $tCells = array(); $tCells[]='<td>Title:</td>'; $tCells[]='<td>ID:</td>'; $tCells[]='<td> </td>'; $tCells[]='<td>PathSegment | Alias | NavTitle | Title:</td>'; $tCells[]='<td>Pagepath:</td>'; $tCells[]='<td>'. '<a href="'.$this->linkSelf('&cmd=delete&entry=ALL').'" onclick="return confirm(\'Are you sure you want to flush all cached page paths?\');">'. '<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/garbage.gif','width="11" height="12"').' alt="" />'. '</a>'. '<a href="'.$this->linkSelf('&cmd=edit&entry=ALL').'">'. '<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/edit2.gif','width="11" height="12"').' title="" alt="" />'. '</a>'. '</td>'; $tCells[]='<td>Expires:'. '<a href="'.$this->linkSelf('&cmd=flushExpired').'">'. '<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/garbage.gif','width="11" height="12"').' title="Flush all expired" alt="" />'. '</a>'. '</td>'; $tCells[]='<td>Errors:</td>'; $tCells[]='<td>Lang:</td>'; $tCells[]='<td>&MP:</td>'; $tCells[]='<td>RootPage ID:</td>'; #$tCells[]='<td>Expire:</td>'; $output = ' <tr class="bgColor5 tableheader"> '.implode(' ',$tCells).' </tr>'.$output; // Compile final table and return: $output = ' <table border="0" cellspacing="1" cellpadding="0" id="tx-realurl-pathcacheTable" class="lrPadding c-list">'.$output.' </table>'; if ($cmd==='edit' && $entry=='ALL') { $output.= $this->saveCancelButtons(); } return $output; }
/** * Initialize the normal module operation * * @return void */ function init() { global $BE_USER, $LANG, $BACK_PATH; // Setting more GPvars: $this->popViewId = t3lib_div::_GP('popViewId'); $this->popViewId_addParams = t3lib_div::_GP('popViewId_addParams'); $this->viewUrl = t3lib_div::_GP('viewUrl'); $this->editRegularContentFromId = t3lib_div::_GP('editRegularContentFromId'); $this->recTitle = t3lib_div::_GP('recTitle'); $this->disHelp = t3lib_div::_GP('disHelp'); $this->noView = t3lib_div::_GP('noView'); $this->perms_clause = $BE_USER->getPagePermsClause(1); // Set other internal variables: $this->R_URL_getvars['returnUrl'] = $this->retUrl; $this->R_URI = $this->R_URL_parts['path'] . '?' . t3lib_div::implodeArrayForUrl('', $this->R_URL_getvars); // MENU-ITEMS: // If array, then it's a selector box menu // If empty string it's just a variable, that'll be saved. // Values NOT in this array will not be saved in the settings-array for the module. $this->MOD_MENU = array('showPalettes' => ''); // Setting virtual document name $this->MCONF['name'] = 'xMOD_alt_doc.php'; // CLEANSE SETTINGS $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']); // Create an instance of the document template object $this->doc = $GLOBALS['TBE_TEMPLATE']; $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('templates/alt_doc.html'); $this->doc->form = '<form action="' . htmlspecialchars($this->R_URI) . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="document.editform._scrollPosition.value=(document.documentElement.scrollTop || document.body.scrollTop); return TBE_EDITOR.checkSubmit(1);">'; $this->doc->getPageRenderer()->loadPrototype(); $this->doc->JScode = $this->doc->wrapScriptTags(' function jumpToUrl(URL,formEl) { // if (!TBE_EDITOR.isFormChanged()) { window.location.href = URL; } else if (formEl && formEl.type=="checkbox") { formEl.checked = formEl.checked ? 0 : 1; } } // Object: TS: // passwordDummy and decimalSign are used by tbe_editor.js and have to be declared here as // TS object overwrites the object declared in tbe_editor.js function typoSetup () { // this.uniqueID = ""; this.passwordDummy = "********"; this.decimalSign = "."; } var TS = new typoSetup(); // Info view: function launchView(table,uid,bP) { // var backPath= bP ? bP : ""; var thePreviewWindow=""; thePreviewWindow = window.open(backPath+"show_item.php?table="+encodeURIComponent(table)+"&uid="+encodeURIComponent(uid),"ShowItem"+TS.uniqueID,"height=300,width=410,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0"); if (thePreviewWindow && thePreviewWindow.focus) { thePreviewWindow.focus(); } } function deleteRecord(table,id,url) { // if ( ' . ($GLOBALS['BE_USER']->jsConfirmation(4) ? 'confirm(' . $LANG->JScharCode($LANG->getLL('deleteWarning')) . ')' : '1==1') . ' ) { window.location.href = "tce_db.php?cmd["+table+"]["+id+"][delete]=1' . t3lib_BEfunc::getUrlToken('tceAction') . '&redirect="+escape(url)+"&vC=' . $BE_USER->veriCode() . '&prErr=1&uPT=1"; } return false; } ' . (isset($_POST['_savedokview_x']) && $this->popViewId ? 'if (window.opener) { ' . t3lib_BEfunc::viewOnClick($this->popViewId, '', t3lib_BEfunc::BEgetRootLine($this->popViewId), '', $this->viewUrl, $this->popViewId_addParams, FALSE) . ' } else { ' . t3lib_BEfunc::viewOnClick($this->popViewId, '', t3lib_BEfunc::BEgetRootLine($this->popViewId), '', $this->viewUrl, $this->popViewId_addParams) . ' } ' : '')); // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); $this->doc->bodyTagAdditions = 'onload="window.scrollTo(0,' . t3lib_div::intInRange(t3lib_div::_GP('_scrollPosition'), 0, 10000) . ');"'; }
/** * Rendering a single element in outline: * * @param array $contentTreeArr: DataStructure info array (the whole tree) * @param array $entries: Entries accumulated in this array (passed by reference) * @param integer $indentLevel: Indentation level * @param array $parentPointer: Element position in structure * @param string $controls: HTML for controls to add for this element * @return void * @access protected * @see render_outline_allSheets() */ function render_outline_element($contentTreeArr, &$entries, $indentLevel = 0, $parentPointer = array(), $controls = '') { global $LANG, $TYPO3_CONF_VARS; // Get record of element: $elementBelongsToCurrentPage = $contentTreeArr['el']['table'] == 'pages' || $contentTreeArr['el']['pid'] == $this->rootElementUid_pidForContent; // Prepare the record icon including a context sensitive menu link wrapped around it: if (isset($contentTreeArr['el']['iconTag'])) { $recordIcon = $contentTreeArr['el']['iconTag']; } else { $recordIcon = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, $contentTreeArr['el']['icon'], '') . ' border="0" title="' . htmlspecialchars('[' . $contentTreeArr['el']['table'] . ':' . $contentTreeArr['el']['uid'] . ']') . '" alt="" />'; } $titleBarLeftButtons = $this->translatorMode ? $recordIcon : $this->doc->wrapClickMenuOnIcon($recordIcon, $contentTreeArr['el']['table'], $contentTreeArr['el']['uid'], 1, '&callingScriptId=' . rawurlencode($this->doc->scriptID), 'new,copy,cut,pasteinto,pasteafter,delete'); $titleBarLeftButtons .= $this->getRecordStatHookValue($contentTreeArr['el']['table'], $contentTreeArr['el']['uid']); // Prepare table specific settings: switch ($contentTreeArr['el']['table']) { case 'pages': $iconEdit = t3lib_iconWorks::getSpriteIcon('actions-document-open', array('title' => $LANG->sL('LLL:EXT:lang/locallang_mod_web_list.xml:editPage'))); $titleBarLeftButtons .= $this->translatorMode ? '' : $this->link_edit($iconEdit, $contentTreeArr['el']['table'], $contentTreeArr['el']['uid']); $titleBarRightButtons = ''; $addGetVars = $this->currentLanguageUid ? '&L=' . $this->currentLanguageUid : ''; $viewPageOnClick = 'onclick= "' . htmlspecialchars(t3lib_BEfunc::viewOnClick($contentTreeArr['el']['uid'], $this->doc->backPath, t3lib_BEfunc::BEgetRootLine($contentTreeArr['el']['uid']), '', '', $addGetVars)) . '"'; $viewPageIcon = t3lib_iconWorks::getSpriteIcon('actions-document-view', array('title' => $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.showPage', 1))); $titleBarLeftButtons .= '<a href="#" ' . $viewPageOnClick . '>' . $viewPageIcon . '</a>'; break; case 'tt_content': $languageUid = $contentTreeArr['el']['sys_language_uid']; $elementPointer = 'tt_content:' . $contentTreeArr['el']['uid']; if ($this->translatorMode) { $titleBarRightButtons = ''; } else { // Create CE specific buttons: $iconMakeLocal = t3lib_iconWorks::getSpriteIcon('extensions-templavoila-makelocalcopy', array('title' => $LANG->getLL('makeLocal'))); $linkMakeLocal = !$elementBelongsToCurrentPage ? $this->link_makeLocal($iconMakeLocal, $parentPointer) : ''; if ($this->modTSconfig['properties']['enableDeleteIconForLocalElements'] < 2 || !$elementBelongsToCurrentPage || $this->global_tt_content_elementRegister[$contentTreeArr['el']['uid']] > 1) { $iconUnlink = t3lib_iconWorks::getSpriteIcon('extensions-templavoila-unlink', array('title' => $LANG->getLL('unlinkRecord'))); $linkUnlink = $this->link_unlink($iconUnlink, $parentPointer, FALSE); } else { $linkUnlink = ''; } if ($this->modTSconfig['properties']['enableDeleteIconForLocalElements'] && $elementBelongsToCurrentPage) { $hasForeignReferences = tx_templavoila_div::hasElementForeignReferences($contentTreeArr['el'], $contentTreeArr['el']['pid']); $iconDelete = t3lib_iconWorks::getSpriteIcon('actions-edit-delete', array('title' => $LANG->getLL('deleteRecord'))); $linkDelete = $this->link_unlink($iconDelete, $parentPointer, TRUE, $hasForeignReferences); } else { $linkDelete = ''; } $iconEdit = t3lib_iconWorks::getSpriteIcon('actions-document-open', array('title' => $LANG->getLL('editrecord'))); $linkEdit = $elementBelongsToCurrentPage ? $this->link_edit($iconEdit, $contentTreeArr['el']['table'], $contentTreeArr['el']['uid']) : ''; $titleBarRightButtons = $linkEdit . $this->clipboardObj->element_getSelectButtons($parentPointer) . $linkMakeLocal . $linkUnlink . $linkDelete; } break; } // Prepare the language icon: if ($languageUid > 0) { $languageLabel = htmlspecialchars($this->pObj->allAvailableLanguages[$languageUid]['title']); if ($this->pObj->allAvailableLanguages[$languageUid]['flagIcon']) { $languageIcon = tx_templavoila_icons::getFlagIconForLanguage($this->pObj->allAvailableLanguages[$languageUid]['flagIcon'], array('title' => $languageLabel, 'alt' => $languageLabel)); } else { $languageIcon = '[' . $languageLabel . ']'; } } else { $languageIcon = ''; } // If there was a langauge icon and the language was not default or [all] and if that langauge is accessible for the user, then wrap the flag with an edit link (to support the "Click the flag!" principle for translators) if ($languageIcon && $languageUid > 0 && $GLOBALS['BE_USER']->checkLanguageAccess($languageUid) && $contentTreeArr['el']['table'] === 'tt_content') { $languageIcon = $this->link_edit($languageIcon, 'tt_content', $contentTreeArr['el']['uid'], TRUE); } // Create warning messages if neccessary: $warnings = ''; if ($this->global_tt_content_elementRegister[$contentTreeArr['el']['uid']] > 1 && $this->rootElementLangParadigm != 'free') { $warnings .= '<br/>' . $this->doc->icons(2) . ' <em>' . htmlspecialchars(sprintf($LANG->getLL('warning_elementusedmorethanonce', ''), $this->global_tt_content_elementRegister[$contentTreeArr['el']['uid']], $contentTreeArr['el']['uid'])) . '</em>'; } // Displaying warning for container content (in default sheet - a limitation) elements if localization is enabled: $isContainerEl = count($contentTreeArr['sub']['sDEF']); if (!$this->modTSconfig['properties']['disableContainerElementLocalizationWarning'] && $this->rootElementLangParadigm != 'free' && $isContainerEl && $contentTreeArr['el']['table'] === 'tt_content' && $contentTreeArr['el']['CType'] === 'templavoila_pi1' && !$contentTreeArr['ds_meta']['langDisable']) { if ($contentTreeArr['ds_meta']['langChildren']) { if (!$this->modTSconfig['properties']['disableContainerElementLocalizationWarning_warningOnly']) { $warnings .= '<br/>' . $this->doc->icons(2) . ' <b>' . $LANG->getLL('warning_containerInheritance_short') . '</b>'; } } else { $warnings .= '<br/>' . $this->doc->icons(3) . ' <b>' . $LANG->getLL('warning_containerSeparate_short') . '</b>'; } } // Create entry for this element: $entries[] = array('indentLevel' => $indentLevel, 'icon' => $titleBarLeftButtons, 'title' => ($elementBelongsToCurrentPage ? '' : '<em>') . htmlspecialchars($contentTreeArr['el']['title']) . ($elementBelongsToCurrentPage ? '' : '</em>'), 'warnings' => $warnings, 'controls' => $titleBarRightButtons . $controls, 'table' => $contentTreeArr['el']['table'], 'uid' => $contentTreeArr['el']['uid'], 'flag' => $languageIcon, 'isNewVersion' => $contentTreeArr['el']['_ORIG_uid'] ? TRUE : FALSE, 'elementTitlebarClass' => (!$elementBelongsToCurrentPage ? 'tpm-elementRef' : 'tpm-element') . ' tpm-outline-level' . $indentLevel); // Create entry for localizaitons... $this->render_outline_localizations($contentTreeArr, $entries, $indentLevel + 1); // Create entries for sub-elements in all sheets: if ($contentTreeArr['sub']) { foreach ($contentTreeArr['sub'] as $sheetKey => $sheetInfo) { if (is_array($sheetInfo)) { $this->render_outline_subElements($contentTreeArr, $sheetKey, $entries, $indentLevel + 1); } } } }
/** * Renders the display framework of a single sheet. Calls itself recursively * * @param array $contentTreeArr: DataStructure info array (the whole tree) * @param string $languageKey: Language key for the display * @param string $sheet: The sheet key of the sheet which should be rendered * @param array $parentPointer: Flexform pointer to parent element * @param array $parentDsMeta: Meta array from parent DS (passing information about parent containers localization mode) * @return string HTML * @access protected * @see render_framework_singleSheet() */ function render_framework_singleSheet($contentTreeArr, $languageKey, $sheet, $parentPointer = array(), $parentDsMeta = array()) { global $LANG, $TYPO3_CONF_VARS; $elementBelongsToCurrentPage = $contentTreeArr['el']['table'] == 'pages' || $contentTreeArr['el']['pid'] == $this->rootElementUid_pidForContent; $canEditPage = $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'edit'); $canEditContent = $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'editcontent'); // Prepare the record icon including a content sensitive menu link wrapped around it: $recordIcon = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, $contentTreeArr['el']['icon'], '') . ' style="text-align: center; vertical-align: middle;" width="18" height="16" border="0" title="' . htmlspecialchars('[' . $contentTreeArr['el']['table'] . ':' . $contentTreeArr['el']['uid'] . ']') . '" alt="" />'; $menuCommands = array(); if ($GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'new')) { $menuCommands[] = 'new'; } if ($canEditContent) { $menuCommands[] = 'copy,cut,pasteinto,pasteafter,delete'; } $titleBarLeftButtons = $this->translatorMode ? $recordIcon : (count($menuCommands) == 0 ? $recordIcon : $this->doc->wrapClickMenuOnIcon($recordIcon, $contentTreeArr['el']['table'], $contentTreeArr['el']['uid'], 1, '&callingScriptId=' . rawurlencode($this->doc->scriptID), implode(',', $menuCommands))); unset($menuCommands); // Prepare table specific settings: switch ($contentTreeArr['el']['table']) { case 'pages': $wrap = '|'; $titleBarLeftButtons .= $this->translatorMode || !$canEditPage ? '' : $this->link_edit('<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/edit2.gif', '') . ' title="' . htmlspecialchars($LANG->sL('LLL:EXT:lang/locallang_mod_web_list.xml:editPage')) . '" alt="" style="text-align: center; vertical-align: middle; border:0;" />', $contentTreeArr['el']['table'], $contentTreeArr['el']['uid']); $titleBarRightButtons = ''; $addGetVars = $this->currentLanguageUid ? '&L=' . $this->currentLanguageUid : ''; $viewPageOnClick = 'onclick= "' . htmlspecialchars(t3lib_BEfunc::viewOnClick($contentTreeArr['el']['uid'], $this->doc->backPath, t3lib_BEfunc::BEgetRootLine($contentTreeArr['el']['uid']), '', '', $addGetVars)) . '"'; $viewPageIcon = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/zoom.gif', 'width="12" height="12"') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.showPage', 1) . '" hspace="3" alt="" style="text-align: center; vertical-align: middle;" />'; $titleBarLeftButtons .= '<a href="#" ' . $viewPageOnClick . '>' . $viewPageIcon . '</a>'; break; case 'tt_content': $wrap = '<div style="border: 1px solid #FFD8A9">|</div>'; $elementTitlebarColor = $elementBelongsToCurrentPage ? $this->doc->bgColor5 : $this->doc->bgColor6; $elementTitlebarStyle = 'background-color: ' . $elementTitlebarColor; $languageUid = $contentTreeArr['el']['sys_language_uid']; if (!$this->translatorMode && $canEditContent) { // Create CE specific buttons: $linkMakeLocal = !$elementBelongsToCurrentPage ? $this->link_makeLocal('<img' . t3lib_iconWorks::skinImg($this->doc->backPath, t3lib_extMgm::extRelPath('templavoila') . 'mod1/makelocalcopy.gif', '') . ' title="' . $LANG->getLL('makeLocal') . '" border="0" alt="" />', $parentPointer) : ''; $linkUnlink = $this->link_unlink('<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/garbage.gif', '') . ' title="' . $LANG->getLL('unlinkRecord') . '" border="0" alt="" />', $parentPointer, FALSE); if ($GLOBALS['BE_USER']->recordEditAccessInternals('tt_content', $contentTreeArr['previewData']['fullRow'])) { $linkEdit = $elementBelongsToCurrentPage ? $this->link_edit('<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/edit2.gif', '') . ' title="' . $LANG->getLL('editrecord') . '" border="0" alt="" />', $contentTreeArr['el']['table'], $contentTreeArr['el']['uid']) : ''; } else { $linkEdit = ''; } $titleBarRightButtons = $linkEdit . $this->clipboardObj->element_getSelectButtons($parentPointer) . $linkMakeLocal . $linkUnlink; } else { $titleBarRightButtons = ''; } break; } // Prepare the language icon: $languageLabel = htmlspecialchars($this->allAvailableLanguages[$contentTreeArr['el']['sys_language_uid']]['title']); $languageIcon = $this->allAvailableLanguages[$languageUid]['flagIcon'] ? '<img src="' . $this->allAvailableLanguages[$languageUid]['flagIcon'] . '" title="' . $languageLabel . '" alt="' . $languageLabel . '" style="text-align: center; vertical-align: middle;" />' : ($languageLabel && $languageUid ? '[' . $languageLabel . ']' : ''); // If there was a language icon and the language was not default or [all] and if that langauge is accessible for the user, then wrap the flag with an edit link (to support the "Click the flag!" principle for translators) if ($languageIcon && $languageUid > 0 && $GLOBALS['BE_USER']->checkLanguageAccess($languageUid) && $contentTreeArr['el']['table'] === 'tt_content') { $languageIcon = $this->link_edit($languageIcon, 'tt_content', $contentTreeArr['el']['uid'], TRUE); } // Create warning messages if neccessary: $warnings = ''; if ($this->global_tt_content_elementRegister[$contentTreeArr['el']['uid']] > 1 && $this->rootElementLangParadigm != 'free') { $warnings .= '<br/>' . $this->doc->icons(2) . ' <em>' . htmlspecialchars(sprintf($LANG->getLL('warning_elementusedmorethanonce', ''), $this->global_tt_content_elementRegister[$contentTreeArr['el']['uid']], $contentTreeArr['el']['uid'])) . '</em>'; } // Displaying warning for container content (in default sheet - a limitation) elements if localization is enabled: $isContainerEl = count($contentTreeArr['sub']['sDEF']); if (!$this->modTSconfig['properties']['disableContainerElementLocalizationWarning'] && $this->rootElementLangParadigm != 'free' && $isContainerEl && $contentTreeArr['el']['table'] === 'tt_content' && $contentTreeArr['el']['CType'] === 'templavoila_pi1' && !$contentTreeArr['ds_meta']['langDisable']) { if ($contentTreeArr['ds_meta']['langChildren']) { if (!$this->modTSconfig['properties']['disableContainerElementLocalizationWarning_warningOnly']) { $warnings .= '<br/>' . $this->doc->icons(2) . ' <b>' . $LANG->getLL('warning_containerInheritance') . '</b>'; } } else { $warnings .= '<br/>' . $this->doc->icons(3) . ' <b>' . $LANG->getLL('warning_containerSeparate') . '</b>'; } } // Preview made: $previewContent = $this->render_previewData($contentTreeArr['previewData'], $contentTreeArr['el'], $contentTreeArr['ds_meta'], $languageKey, $sheet); // Wrap workspace notification colors: if ($contentTreeArr['el']['_ORIG_uid']) { $previewContent = '<div class="ver-element">' . ($previewContent ? $previewContent : '<em>[New version]</em>') . '</div>'; } //visibility require_once t3lib_extMgm::extPath("languagevisibility") . 'class.tx_languagevisibility_beservices.php'; $service = t3lib_div::makeInstance('tx_languagevisibility_beservices'); $flags = $elementContentTreeArr['el']['uid'] . $service->getVisibleFlagsForElement($contentTreeArr['el']['uid'], $contentTreeArr['el']['table']); // Finally assemble the table: $finalContent = ' <table cellpadding="0" cellspacing="0" style="width: 100%; border: 1px solid black; margin:5px;"> <tr class="languagevisibility" style="background: #FFE3C1; "> <td style="vertical-align:top; padding: 2px; color: #4B3B27;" colspan="2">' . '<span class="nobr">Visibility:' . $flags . '</span>' . '</td> </tr> <tr style="background: #FFAC4B; "> <td style="vertical-align:top;">' . '<span class="nobr">' . $languageIcon . $titleBarLeftButtons . ($elementBelongsToCurrentPage ? '' : '<em>') . htmlspecialchars($contentTreeArr['el']['title']) . ($elementBelongsToCurrentPage ? '' : '</em>') . '</span>' . $warnings . '</td> <td nowrap="nowrap" style="text-align:right; vertical-align:top;">' . $titleBarRightButtons . '</td> </tr> <tr> <td colspan="2">' . $this->render_framework_subElements($contentTreeArr, $languageKey, $sheet) . $previewContent . '<div style="margin-left: 10px">' . $this->render_localizationInfoTable($contentTreeArr, $parentPointer, $parentDsMeta) . '</div>' . '</td> </tr> </table> '; return str_replace('|', $finalContent, $wrap); }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @return array all available buttons as an associated array */ protected function getButtons() { $buttons = array('view' => '', 'record_list' => '', 'shortcut' => ''); if ($GLOBALS['BE_USER']->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('tx_impexp', '', $this->MCONF['name']); } // Input data grabbed: $inData = t3lib_div::_GP('tx_impexp'); if ((string) $inData['action'] == 'import') { if ($this->id && is_array($this->pageinfo) || $GLOBALS['BE_USER']->user['admin'] && !$this->id) { if (is_array($this->pageinfo) && $this->pageinfo['uid']) { // View $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $this->doc->backPath, t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>'; // Record list // If access to Web>List for user, then link to that module. $buttons['record_list'] = t3lib_BEfunc::getListViewLink(array('id' => $this->pageinfo['uid'], 'returnUrl' => t3lib_div::getIndpEnv('REQUEST_URI')), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList')); } } } return $buttons; }
/** * Adding CM element for View Page * * @param integer Page uid (PID) * @param string Anchor, if any * @return array Item array, element in $menuItems * @internal */ function DB_view($id, $anchor = '') { return $this->linkItem($this->label('view'), $this->excludeIcon(t3lib_iconWorks::getSpriteIcon('actions-document-view')), t3lib_BEfunc::viewOnClick($id, $this->PH_backPath, t3lib_BEfunc::BEgetRootLine($id), $anchor) . 'return hideCM();'); }
/** * Rendering the localization information table. * * @param array The Page tree data * @return string HTML for the localization information table. */ function renderL10nTable(&$tree) { global $LANG; // System languages retrieved: $languages = $this->getSystemLanguages(); // Title length: $titleLen = $GLOBALS['BE_USER']->uc['titleLen']; // Put together the TREE: $output = ''; $newOL_js = array(); $langRecUids = array(); foreach ($tree->tree as $data) { $tCells = array(); $langRecUids[0][] = $data['row']['uid']; // Page icons / titles etc. $tCells[] = '<td' . ($data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '') . '>' . $data['HTML'] . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'], $titleLen)) . (strcmp($data['row']['nav_title'], '') ? ' [Nav: <em>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['nav_title'], $titleLen)) . '</em>]' : '') . '</td>'; // DEFAULT language: // "View page" link is created: $viewPageLink = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($data['row']['uid'], $GLOBALS['BACK_PATH'], '', '', '', '&L=###LANG_UID###')) . '" title="' . $LANG->getLL('lang_renderl10n_viewPage', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>'; $status = $data['row']['l18n_cfg'] & 1 ? 'c-blocked' : 'c-ok'; // Create links: $info = ''; $editUid = $data['row']['uid']; $params = '&edit[pages][' . $editUid . ']=edit'; $info .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '" title="' . $LANG->getLL('lang_renderl10n_editDefaultLanguagePage', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>'; $info .= '<a href="#" onclick="' . htmlspecialchars('top.loadEditId(' . intval($data['row']['uid']) . ',"&SET[language]=0"); return false;') . '" title="' . $LANG->getLL('lang_renderl10n_editPage', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-open') . '</a>'; $info .= str_replace('###LANG_UID###', '0', $viewPageLink); $info .= ' '; $info .= $data['row']['l18n_cfg'] & 1 ? '<span title="' . $LANG->sL('LLL:EXT:cms/locallang_tca.php:pages.l18n_cfg.I.1', '1') . '">D</span>' : ' '; $info .= t3lib_div::hideIfNotTranslated($data['row']['l18n_cfg']) ? '<span title="' . $LANG->sL('LLL:EXT:cms/locallang_tca.php:pages.l18n_cfg.I.2', '1') . '">N</span>' : ' '; // Put into cell: $tCells[] = '<td class="' . $status . ' c-leftLine">' . $info . '</td>'; $tCells[] = '<td class="' . $status . '" title="' . $LANG->getLL('lang_renderl10n_CEcount', '1') . '" align="center">' . $this->getContentElementCount($data['row']['uid'], 0) . '</td>'; $modSharedTSconfig = t3lib_BEfunc::getModTSconfig($data['row']['uid'], 'mod.SHARED'); $disableLanguages = isset($modSharedTSconfig['properties']['disableLanguages']) ? t3lib_div::trimExplode(',', $modSharedTSconfig['properties']['disableLanguages'], 1) : array(); // Traverse system languages: foreach ($languages as $langRow) { if ($this->pObj->MOD_SETTINGS['lang'] == 0 || (int) $this->pObj->MOD_SETTINGS['lang'] === (int) $langRow['uid']) { $row = $this->getLangStatus($data['row']['uid'], $langRow['uid']); $info = ''; if (is_array($row)) { $langRecUids[$langRow['uid']][] = $row['uid']; $status = $row['_HIDDEN'] ? t3lib_div::hideIfNotTranslated($data['row']['l18n_cfg']) || $data['row']['l18n_cfg'] & 1 ? 'c-blocked' : 'c-fallback' : 'c-ok'; $icon = t3lib_iconWorks::getSpriteIconForRecord('pages_language_overlay', $row, array('class' => 'c-recIcon')); $info = $icon . htmlspecialchars(t3lib_div::fixed_lgd_cs($row['title'], $titleLen)) . (strcmp($row['nav_title'], '') ? ' [Nav: <em>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($row['nav_title'], $titleLen)) . '</em>]' : '') . ($row['_COUNT'] > 1 ? '<div>' . $LANG->getLL('lang_renderl10n_badThingThereAre', '1') . '</div>' : ''); $tCells[] = '<td class="' . $status . ' c-leftLine">' . $info . '</td>'; // Edit whole record: $info = ''; $editUid = $row['uid']; $params = '&edit[pages_language_overlay][' . $editUid . ']=edit'; $info .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '" title="' . $LANG->getLL('lang_renderl10n_editLanguageOverlayRecord', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>'; $info .= '<a href="#" onclick="' . htmlspecialchars('top.loadEditId(' . intval($data['row']['uid']) . ',"&SET[language]=' . $langRow['uid'] . '"); return false;') . '" title="' . $LANG->getLL('lang_renderl10n_editPageLang', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-open') . '</a>'; $info .= str_replace('###LANG_UID###', $langRow['uid'], $viewPageLink); $tCells[] = '<td class="' . $status . '">' . $info . '</td>'; $tCells[] = '<td class="' . $status . '" title="' . $LANG->getLL('lang_renderl10n_CEcount', '1') . '" align="center">' . $this->getContentElementCount($data['row']['uid'], $langRow['uid']) . '</td>'; } else { if (in_array($langRow['uid'], $disableLanguages)) { // Language has been disabled for this page $status = 'c-blocked'; $info = ''; } else { $status = t3lib_div::hideIfNotTranslated($data['row']['l18n_cfg']) || $data['row']['l18n_cfg'] & 1 ? 'c-blocked' : 'c-fallback'; $info = '<input type="checkbox" name="newOL[' . $langRow['uid'] . '][' . $data['row']['uid'] . ']" value="1" />'; $newOL_js[$langRow['uid']] .= ' +(document.webinfoForm[\'newOL[' . $langRow['uid'] . '][' . $data['row']['uid'] . ']\'].checked ? \'&edit[pages_language_overlay][' . $data['row']['uid'] . ']=new\' : \'\') '; } $tCells[] = '<td class="' . $status . ' c-leftLine"> </td>'; $tCells[] = '<td class="' . $status . '"> </td>'; $tCells[] = '<td class="' . $status . '">' . $info . '</td>'; } } } $output .= ' <tr class="bgColor4"> ' . implode(' ', $tCells) . ' </tr>'; } // Put together HEADER: $tCells = array(); $tCells[] = '<td>' . $LANG->getLL('lang_renderl10n_page', '1') . ':</td>'; if (is_array($langRecUids[0])) { $params = '&edit[pages][' . implode(',', $langRecUids[0]) . ']=edit&columnsOnly=title,nav_title,l18n_cfg,hidden'; $editIco = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '" title="' . $LANG->getLL('lang_renderl10n_editPageProperties', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-new') . '</a>'; } else { $editIco = ''; } $tCells[] = '<td class="c-leftLine" colspan="2">' . $LANG->getLL('lang_renderl10n_default', '1') . ':' . $editIco . '</td>'; foreach ($languages as $langRow) { if ($this->pObj->MOD_SETTINGS['lang'] == 0 || (int) $this->pObj->MOD_SETTINGS['lang'] === (int) $langRow['uid']) { // Title: $tCells[] = '<td class="c-leftLine">' . htmlspecialchars($langRow['title']) . '</td>'; // Edit language overlay records: if (is_array($langRecUids[$langRow['uid']])) { $params = '&edit[pages_language_overlay][' . implode(',', $langRecUids[$langRow['uid']]) . ']=edit&columnsOnly=title,nav_title,hidden'; $tCells[] = '<td><a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '" title="' . $LANG->getLL('lang_renderl10n_editLangOverlays', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a></td>'; } else { $tCells[] = '<td> </td>'; } // Create new overlay records: $params = "'" . $newOL_js[$langRow['uid']] . "+'&columnsOnly=title,hidden,sys_language_uid&defVals[pages_language_overlay][sys_language_uid]=" . $langRow['uid']; $tCells[] = '<td><a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '" title="' . $LANG->getLL('lang_getlangsta_createNewTranslationHeaders', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-new') . '</a></td>'; } } $output = ' <tr class="t3-row-header"> ' . implode(' ', $tCells) . ' </tr>' . $output; $output = ' <table border="0" cellspacing="0" cellpadding="0" id="langTable" class="typo3-dblist">' . $output . ' </table>'; return $output; }
/** * Renders the display framework of a single sheet. Calls itself recursively * * @param array $contentTreeArr: DataStructure info array (the whole tree) * @param string $languageKey: Language key for the display * @param string $sheet: The sheet key of the sheet which should be rendered * @param array $parentPointer: Flexform pointer to parent element * @param array $parentDsMeta: Meta array from parent DS (passing information about parent containers localization mode) * @return string HTML * @access protected * @see render_framework_singleSheet() */ function render_framework_singleSheet($contentTreeArr, $languageKey, $sheet, $parentPointer = array(), $parentDsMeta = array()) { global $LANG, $TYPO3_CONF_VARS; $elementBelongsToCurrentPage = $contentTreeArr['el']['table'] == 'pages' || $contentTreeArr['el']['pid'] == $this->rootElementUid_pidForContent; $canEditPage = $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'edit'); $canEditContent = $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'editcontent'); // Prepare the record icon including a content sensitive menu link wrapped around it: $recordIcon = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, $contentTreeArr['el']['icon'], '') . ' style="text-align: center; vertical-align: middle;" width="18" height="16" border="0" title="' . htmlspecialchars('[' . $contentTreeArr['el']['table'] . ':' . $contentTreeArr['el']['uid'] . ']') . '" alt="" />'; $menuCommands = array(); if ($GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'new')) { $menuCommands[] = 'new'; } if ($canEditContent) { $menuCommands[] = 'copy,cut,pasteinto,pasteafter,delete'; } else { $menuCommands[] = 'copy'; } $titleBarLeftButtons = $this->translatorMode ? $recordIcon : (count($menuCommands) == 0 ? $recordIcon : $this->doc->wrapClickMenuOnIcon($recordIcon, $contentTreeArr['el']['table'], $contentTreeArr['el']['uid'], 1, '&callingScriptId=' . rawurlencode($this->doc->scriptID), implode(',', $menuCommands))); $titleBarLeftButtons .= $this->getRecordStatHookValue($contentTreeArr['el']['table'], $contentTreeArr['el']['uid']); unset($menuCommands); // Prepare table specific settings: switch ($contentTreeArr['el']['table']) { case 'pages': $titleBarLeftButtons .= $this->translatorMode || !$canEditPage ? '' : $this->link_edit('<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/edit2.gif', '') . ' title="' . htmlspecialchars($LANG->sL('LLL:EXT:lang/locallang_mod_web_list.xml:editPage')) . '" alt="" style="text-align: center; vertical-align: middle; border:0;" />', $contentTreeArr['el']['table'], $contentTreeArr['el']['uid']); $titleBarRightButtons = ''; $addGetVars = $this->currentLanguageUid ? '&L=' . $this->currentLanguageUid : ''; $viewPageOnClick = 'onclick= "' . htmlspecialchars(t3lib_BEfunc::viewOnClick($contentTreeArr['el']['uid'], $this->doc->backPath, t3lib_BEfunc::BEgetRootLine($contentTreeArr['el']['uid']), '', '', $addGetVars)) . '"'; $viewPageIcon = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/zoom.gif', 'width="12" height="12"') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.showPage', 1) . '" hspace="3" alt="" style="text-align: center; vertical-align: middle;" />'; $titleBarLeftButtons .= '<a href="#" ' . $viewPageOnClick . '>' . $viewPageIcon . '</a>'; # ### Mansoor Ahmad - JavaScript for making CEs Draggable # $dragAndDropEnable = 0; if (strstr($_SERVER["HTTP_USER_AGENT"], "Firefox") && strstr($_SERVER["HTTP_USER_AGENT"], "Gecko") || strstr($_SERVER["HTTP_USER_AGENT"], "Chrome")) { $dragAndDropEnable = 1; } break; case 'tt_content': $elementTitlebarColor = $elementBelongsToCurrentPage ? $this->doc->bgColor5 : $this->doc->bgColor6; $elementTitlebarStyle = 'background-color: ' . $elementTitlebarColor; $languageUid = $contentTreeArr['el']['sys_language_uid']; if (!$this->translatorMode && $canEditContent) { // Create CE specific buttons: $linkMakeLocal = !$elementBelongsToCurrentPage ? $this->link_makeLocal('<img' . t3lib_iconWorks::skinImg($this->doc->backPath, t3lib_extMgm::extRelPath('templavoila') . 'mod1/makelocalcopy.gif', '') . ' title="' . $LANG->getLL('makeLocal') . '" border="0" alt="" />', $parentPointer) : ''; // # // ### Mansoor Ahmad - I include it on Caspars recommend // # $linkUnlink = $this->link_unlink('<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/garbage.gif', '') . ' title="' . $LANG->getLL('deleteRecord') . '" border="0" alt="" />', $parentPointer, $elementBelongsToCurrentPage ? TRUE : FALSE); if ($GLOBALS['BE_USER']->recordEditAccessInternals('tt_content', $contentTreeArr['previewData']['fullRow'])) { $linkEdit = $elementBelongsToCurrentPage ? $this->link_edit('<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/edit2.gif', '') . ' title="' . $LANG->getLL('editrecord') . '" border="0" alt="" />', $contentTreeArr['el']['table'], $contentTreeArr['el']['uid']) : ''; } else { $linkEdit = ''; } // # // ### Mansoor Ahmad - I deactivated it for safty way, but now is it active // # //$titleBarRightButtons = $linkEdit . $this->clipboardObj->element_getSelectButtons($parentPointer,'copy,cut') . $linkMakeLocal . $linkUnlink; $titleBarRightButtons = $linkEdit . $this->clipboardObj->element_getSelectButtons($parentPointer) . $linkMakeLocal . $linkUnlink; } else { $titleBarRightButtons = $this->clipboardObj->element_getSelectButtons($parentPointer, 'copy'); } # ### Mansoor Ahmad - JavaScript for making CEs Draggable # $dragAndDropEnable = 0; if (strstr($_SERVER["HTTP_USER_AGENT"], "Firefox") && strstr($_SERVER["HTTP_USER_AGENT"], "Gecko") || strstr($_SERVER["HTTP_USER_AGENT"], "Chrome")) { $makeDraggable = '<script>new Draggable(\'' . $contentTreeArr['el']['CType'] . '-' . $contentTreeArr['el']['uid'] . '\',{ revert:true, ghosting:false });</script>'; $dragAndDropEnable = 1; } // # // ### Mansoor Ahmad - I disable the Buttons of CE's in Flexform Elements // # $classBe = ''; $resPages = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_templavoila_flex', 'pages', 'uid=' . $contentTreeArr['el']['pid']); $rowPages = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resPages); $flexData = t3lib_div::xml2array($rowPages['tx_templavoila_flex']); if (empty($elementBelongsToCurrentPage)) { $classBe = 'go_backend_layout_shortcut_ce'; $titleBarLeftButtons = ''; $titleBarRightButtons = $linkEdit . $this->clipboardObj->element_getSelectButtons($parentPointer, 'cut') . $linkMakeLocal . $linkUnlink; $backLinkToParentCe = '<a href="index.php?id=' . $contentTreeArr['el']['pid'] . '"><u>Springe zum Mutterelement in Seite:</u> <br/><span style="float:left;">' . $this->getPagename($contentTreeArr['el']['pid']) . '</span></a>'; $makeDraggable = ''; } foreach ($flexData['data']['sDEF']['lDEF'] as $fieldName => $fieldArray) { $uidsLevel1 = explode(',', $fieldArray['vDEF']); if (empty($elementBelongsToCurrentPage) && in_array($contentTreeArr['el']['uid'], $uidsLevel1) == FALSE) { $titleBarLeftButtons = ''; //# Bugfix for 4.4.6 //$titleBarRightButtons = ''; } else { break; } } $tableWrap1 = '<table id="' . $contentTreeArr['el']['CType'] . '-' . $contentTreeArr['el']['uid'] . '" style="width: 100%;" class="go_backend_layout_draggable ' . $classBe . '" cellspacing="0" cellpadding="0" onmouseup="dropareaPosClass = \'go_backend_layout_droppables_position\'; ceIdForPos = \'\';" onmousedown="ceIdForPos = \'' . $contentTreeArr['el']['CType'] . '-' . $contentTreeArr['el']['uid'] . '\';dropareaPosClass = \'go_backend_layout_droppables_position_act\';"><tr><td>' . $makeDraggable; $tableWrap2 = '</td></tr></table>'; break; } // Prepare the language icon: $languageLabel = htmlspecialchars($this->allAvailableLanguages[$contentTreeArr['el']['sys_language_uid']]['title']); $languageIcon = $this->allAvailableLanguages[$languageUid]['flagIcon'] ? '<img src="' . $this->allAvailableLanguages[$languageUid]['flagIcon'] . '" title="' . $languageLabel . '" alt="' . $languageLabel . '" style="text-align: center; vertical-align: middle;" />' : ($languageLabel && $languageUid ? '[' . $languageLabel . ']' : ''); // If there was a language icon and the language was not default or [all] and if that langauge is accessible for the user, then wrap the flag with an edit link (to support the "Click the flag!" principle for translators) if ($languageIcon && $languageUid > 0 && $GLOBALS['BE_USER']->checkLanguageAccess($languageUid) && $contentTreeArr['el']['table'] === 'tt_content') { $languageIcon = $this->link_edit($languageIcon, 'tt_content', $contentTreeArr['el']['uid'], TRUE); } // Create warning messages if neccessary: $warnings = ''; if ($this->global_tt_content_elementRegister[$contentTreeArr['el']['uid']] > 1 && $this->rootElementLangParadigm != 'free') { $warnings .= '<br/>' . $this->doc->icons(2) . ' <em>' . htmlspecialchars(sprintf($LANG->getLL('warning_elementusedmorethanonce', ''), $this->global_tt_content_elementRegister[$contentTreeArr['el']['uid']], $contentTreeArr['el']['uid'])) . '</em>'; } // Displaying warning for container content (in default sheet - a limitation) elements if localization is enabled: $isContainerEl = count($contentTreeArr['sub']['sDEF']); if (!$this->modTSconfig['properties']['disableContainerElementLocalizationWarning'] && $this->rootElementLangParadigm != 'free' && $isContainerEl && $contentTreeArr['el']['table'] === 'tt_content' && $contentTreeArr['el']['CType'] === 'templavoila_pi1' && !$contentTreeArr['ds_meta']['langDisable']) { if ($contentTreeArr['ds_meta']['langChildren']) { if (!$this->modTSconfig['properties']['disableContainerElementLocalizationWarning_warningOnly']) { $warnings .= '<br/>' . $this->doc->icons(2) . ' <b>' . $LANG->getLL('warning_containerInheritance') . '</b>'; } } else { $warnings .= '<br/>' . $this->doc->icons(3) . ' <b>' . $LANG->getLL('warning_containerSeparate') . '</b>'; } } $previewContent = $this->render_previewData($contentTreeArr['previewData'], $contentTreeArr['el'], $contentTreeArr['ds_meta'], $languageKey, $sheet); // Wrap workspace notification colors: if ($contentTreeArr['el']['_ORIG_uid']) { $previewContent = '<div class="ver-element">' . ($previewContent ? $previewContent : '<em>[New version]</em>') . '</div>'; } // Finally assemble the table: $finalContent = ' ' . $tableWrap1 . ' <table id="' . $contentTreeArr['el']['CType'] . '" cellpadding="0" cellspacing="0" style="width: 100%; margin-bottom:5px;"> <tr style="' . $elementTitlebarStyle . ';" class="go_backend_layout_ce_header"> <td style="vertical-align:top;">' . '<span class="nobr">' . $titleBarLeftButtons . $backLinkToParentCe . '</span>' . $warnings . '</td> <td nowrap="nowrap" style="text-align:right; vertical-align:top;cursor:move;" >' . $titleBarRightButtons . '</td> </tr> <tr> <td colspan="2" class="' . $contentTreeArr['el']['CType'] . '">' . $this->render_framework_subElements($contentTreeArr, $languageKey, $sheet, $elementBelongsToCurrentPage, $dragAndDropEnable) . $previewContent . $this->render_localizationInfoTable($contentTreeArr, $parentPointer, $parentDsMeta, $elementBelongsToCurrentPage) . '</td> </tr> </table> ' . $tableWrap2 . ' '; return $finalContent; }
/** * Returns the view link of a given node * * @param stdClass $nodeData * @return string */ public static function getViewLink($nodeData) { /** @var $node t3lib_tree_pagetree_Node */ $node = t3lib_div::makeInstance('t3lib_tree_pagetree_Node', (array) $nodeData); $javascriptLink = t3lib_BEfunc::viewOnClick($node->getId()); preg_match('/window\\.open\\(\'([^\']+)\'/i', $javascriptLink, $match); return $match[1]; }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @param string Identifier for function of module * @return array all available buttons as an assoc. array */ protected function getButtons($function = '') { global $TCA, $LANG, $BACK_PATH, $BE_USER; $buttons = array('view' => '', 'history_page' => '', 'new_content' => '', 'move_page' => '', 'move_record' => '', 'new_page' => '', 'edit_page' => '', 'record_list' => '', 'csh' => '', 'shortcut' => '', 'cache' => '', 'savedok' => '', 'savedokshow' => '', 'closedok' => '', 'deletedok' => '', 'undo' => '', 'history_record' => ''); // View page $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $BACK_PATH, t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>'; // Shortcut if ($BE_USER->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']); } // Cache if (!$this->modTSconfig['properties']['disableAdvanced']) { $buttons['cache'] = '<a href="' . htmlspecialchars('db_layout.php?id=' . $this->pageinfo['uid'] . '&clear_cache=1') . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.clear_cache', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-cache-clear') . '</a>'; } // If access to Web>List for user, then link to that module. $buttons['record_list'] = t3lib_BEfunc::getListViewLink(array('id' => $this->pageinfo['uid'], 'returnUrl' => t3lib_div::getIndpEnv('REQUEST_URI')), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList')); if (!$this->modTSconfig['properties']['disableIconToolbar']) { // Page history $buttons['history_page'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(\'' . $BACK_PATH . 'show_rechis.php?element=' . rawurlencode('pages:' . $this->id) . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '#latest\');return false;') . '" title="' . $LANG->getLL('recordHistory', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-history-open') . '</a>'; // New content element $buttons['new_content'] = '<a href="' . htmlspecialchars('db_new_content_el.php?id=' . $this->id . '&sys_language_uid=' . $this->current_sys_language . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '" title="' . $LANG->getLL('newContentElement', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-new') . '</a>'; // Move page $buttons['move_page'] = '<a href="' . htmlspecialchars($BACK_PATH . 'move_el.php?table=pages&uid=' . $this->id . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '" title="' . $LANG->getLL('move_page', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-move') . '</a>'; // Move record if (t3lib_div::testInt($this->eRParts[1])) { $buttons['move_record'] = '<a href="' . htmlspecialchars($BACK_PATH . 'move_el.php?table=' . $this->eRParts[0] . '&uid=' . $this->eRParts[1] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-' . ($this->eRParts[0] == 'tt_content' ? 'document' : 'page') . '-move', array('class' => 'c-inputButton', 'title' => $LANG->getLL('move_' . ($this->eRParts[0] == 'tt_content' ? 'record' : 'page'), 1))) . '</a>'; } // Create new page (wizard) $buttons['new_page'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(\'' . $BACK_PATH . 'db_new.php?id=' . $this->id . '&pagesOnly=1&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '\');return false;') . '" title="' . $LANG->getLL('newPage', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-new') . '</a>'; // Edit page properties if ($this->CALC_PERMS & 2) { $params = '&edit[pages][' . $this->id . ']=edit'; $buttons['edit_page'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $BACK_PATH)) . '" title="' . $LANG->getLL('editPageProperties', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-open') . '</a>'; } // Add CSH (Context Sensitive Help) icon to tool bar if ($function == 'quickEdit') { $buttons['csh'] = t3lib_BEfunc::cshItem($this->descrTable, 'quickEdit', $BACK_PATH, '', TRUE, 'margin-top: 0px; margin-bottom: 0px;'); } else { $buttons['csh'] = t3lib_BEfunc::cshItem($this->descrTable, 'columns_' . $this->MOD_SETTINGS['function'], $BACK_PATH, '', TRUE, 'margin-top: 0px; margin-bottom: 0px;'); } if ($function == 'quickEdit') { // Save record $buttons['savedok'] = '<input class="c-inputButton" type="image" name="savedok"' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/savedok.gif', '') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" alt="" />'; // Save record and show page $buttons['savedokshow'] = '<a href="#" onclick="' . htmlspecialchars('document.editform.redirect.value+=\'&popView=1\'; TBE_EDITOR.checkAndDoSubmit(1); return false;') . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDocShow', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-save-view') . '</a>'; // Close record $buttons['closedok'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(unescape(\'' . rawurlencode($this->closeUrl) . '\')); return false;') . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-close') . '</a>'; // Delete record if ($this->deleteButton) { $buttons['deletedok'] = '<a href="#" onclick="' . htmlspecialchars('return deleteRecord(\'' . $this->eRParts[0] . '\',\'' . $this->eRParts[1] . '\',\'' . t3lib_div::getIndpEnv('SCRIPT_NAME') . '?id=' . $this->id . '\');') . '" title="' . $LANG->getLL('deleteItem', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-delete') . '</a>'; } if ($this->undoButton) { // Undo button $buttons['undo'] = '<a href="#" onclick="' . htmlspecialchars('window.location.href=\'' . $BACK_PATH . 'show_rechis.php?element=' . rawurlencode($this->eRParts[0] . ':' . $this->eRParts[1]) . '&revert=ALL_FIELDS&sumUp=-1&returnUrl=' . rawurlencode($this->R_URI) . '\'; return false;') . '" title="' . htmlspecialchars(sprintf($LANG->getLL('undoLastChange'), t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $this->undoButtonR['tstamp'], $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-undo') . '</a>'; // History button $buttons['history_record'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(\'' . $BACK_PATH . 'show_rechis.php?element=' . rawurlencode($this->eRParts[0] . ':' . $this->eRParts[1]) . '&returnUrl=' . rawurlencode($this->R_URI) . '#latest\');return false;') . '" title="' . $LANG->getLL('recordHistory', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-history-open') . '</a>'; } } } return $buttons; }
/** * Step 6: Done. * * @return void */ function wizard_step6() { $this->saveMenuCode(); $outputString.= $GLOBALS['LANG']->getLL('newsitewizard_sitecreated') . ' <br/> <br/> <input type="submit" value="' . $GLOBALS['LANG']->getLL('newsitewizard_finish', 1) . '" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($this->wizardData['rootPageId'],$this->doc->backPath).'document.location=\'index.php?SET[wiz_step]=0\'; return false;').'" /> '; // Add output: $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('newsitewizard_done', 1), $outputString, 0, 1); }
/** * Makes link to page $id in frontend (view page) * Returns an magnifier-glass icon which links to the frontend index.php document for viewing the page with id $id * $id must be a page-uid * If the BE_USER has access to Web>List then a link to that module is shown as well (with return-url) * * @param integer The page id * @param string The current "BACK_PATH" (the back relative to the typo3/ directory) * @param string Additional parameters for the image tag(s) * @return string HTML string with linked icon(s) */ function viewPageIcon($id, $backPath, $addParams = 'hspace="3"') { global $BE_USER; // If access to Web>List for user, then link to that module. $str = t3lib_BEfunc::getListViewLink(array('id' => $id, 'returnUrl' => t3lib_div::getIndpEnv('REQUEST_URI')), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList')); // Make link to view page $str .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($id, $backPath, t3lib_BEfunc::BEgetRootLine($id))) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/zoom.gif', 'width="12" height="12"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '"' . ($addParams ? ' ' . trim($addParams) : "") . ' hspace="3" alt="" />' . '</a>'; return $str; }
/** * Returns a JavaScript string for viewing the page id, $id * It will detect the correct domain name if needed and provide the link with the right back path. * Also it will re-use any window already open. * * @param int $pageUid Page UID * @param string $backPath Must point back to TYPO3_mainDir (where the site is assumed to be one level above) * @param array|NULL $rootLine If root line is supplied the function will look for the first found domain record and use that URL instead (if found) * @param string $anchorSection Optional anchor to the URL * @param string $alternativeUrl An alternative URL that, if set, will ignore other parameters except $switchFocus: It will return the window.open command wrapped around this URL! * @param string $additionalGetVars Additional GET variables. * @param bool $switchFocus If TRUE, then the preview window will gain the focus. * @return string */ public function viewOnClick($pageUid, $backPath = '', $rootLine = NULL, $anchorSection = '', $alternativeUrl = '', $additionalGetVars = '', $switchFocus = TRUE) { /** @noinspection PhpDeprecationInspection PhpUndefinedClassInspection */ return t3lib_BEfunc::viewOnClick($pageUid, $backPath, $rootLine, $anchorSection, $alternativeUrl, $additionalGetVars, $switchFocus); }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @return array all available buttons as an assoc. array */ function getHeaderButtons() { global $LANG; $buttons = array('csh' => '', 'view' => '', 'edit' => '', 'record_list' => '', 'level_up' => '', 'reload' => '', 'shortcut' => '', 'back' => '', 'csv' => '', 'export' => ''); $backPath = $GLOBALS['BACK_PATH']; // CSH // if (!strlen($this->id)) { // $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_txttnewsM1', 'list_module_noId', $backPath); // } elseif(!$this->id) { // $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_txttnewsM1', 'list_module_root', $backPath); // } else { // $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_txttnewsM1', 'list_module', $backPath); // } if (isset($this->id)) { if ($GLOBALS['BE_USER']->check('modules', 'web_list')) { $href = t3lib_BEfunc::getModuleUrl('web_list', array('id' => $this->pageinfo['uid'], 'returnUrl' => t3lib_div::getIndpEnv('REQUEST_URI'))); $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/list.gif', 'width="11" height="11"') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '" alt="" />' . '</a>'; } // View $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->id, $backPath, t3lib_BEfunc::BEgetRootLine($this->id))) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/zoom.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '" alt="" />' . '</a>'; // If edit permissions are set (see class.t3lib_userauthgroup.php) if ($this->localCalcPerms & 2 && !empty($this->id)) { // Edit $params = '&edit[pages][' . $this->pageinfo['uid'] . ']=edit'; $buttons['edit'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $backPath, -1)) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/edit2.gif') . ' title="' . $LANG->getLL('editPage', 1) . '" alt="" />' . '</a>'; } // if ($this->table) { // Export if (t3lib_extMgm::isLoaded('impexp')) { $modUrl = t3lib_extMgm::extRelPath('impexp') . 'app/index.php'; $params = $modUrl . '?tx_impexp[action]=export&tx_impexp[list][]='; $params .= rawurlencode('tt_news:' . $this->id) . '&tx_impexp[list][]='; $params .= rawurlencode('tt_news_cat:' . $this->id); $buttons['export'] = '<a href="' . htmlspecialchars($backPath . $params) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, t3lib_extMgm::extRelPath('impexp') . 'export.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.export', 1) . '" alt="" />' . '</a>'; } // } // Reload $buttons['reload'] = '<a href="' . htmlspecialchars(t3lib_div::linkThisScript()) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/refresh_n.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.reload', 1) . '" alt="" />' . '</a>'; // Shortcut if ($GLOBALS['BE_USER']->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, showThumbs, pointer, table, search_field, searchLevels, showLimit, sortField, sortRev', implode(',', array_keys($this->MOD_MENU)), 'web_txttnewsM1'); } // Back if ($this->returnUrl) { $buttons['back'] = '<a href="' . htmlspecialchars(t3lib_div::linkThisUrl($this->returnUrl, array('id' => $this->id))) . '" class="typo3-goBack">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/goback.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', 1) . '" alt="" />' . '</a>'; } } return $buttons; }
/** * Add entries for a single record * * @param string Table name * @param integer Record uid * @param array Output lines array (is passed by reference and modified) * @param string Pre-HTML code * @param boolean If you want import validation, you can set this so it checks if the import can take place on the specified page. * @return void */ function singleRecordLines($table, $uid, &$lines, $preCode, $checkImportInPidRecord = 0) { global $TCA, $BE_USER, $LANG; // Get record: $record = $this->dat['header']['records'][$table][$uid]; unset($this->remainHeader['records'][$table][$uid]); if (!is_array($record) && !($table === 'pages' && !$uid)) { $this->error('MISSING RECORD: ' . $table . ':' . $uid, 1); } // Begin to create the line arrays information record, pInfo: $pInfo = array(); $pInfo['ref'] = $table . ':' . $uid; if ($table === '_SOFTREF_') { // Unknown table name: $pInfo['preCode'] = $preCode; $pInfo['title'] = '<em>' . $LANG->getLL('impexpcore_singlereco_softReferencesFiles', 1) . '</em>'; } elseif (!isset($TCA[$table])) { // Unknown table name: $pInfo['preCode'] = $preCode; $pInfo['msg'] = "UNKNOWN TABLE '" . $pInfo['ref'] . "'"; $pInfo['title'] = '<em>' . htmlspecialchars($record['title']) . '</em>'; } else { // Otherwise, set table icon and title. // Import Validation (triggered by $this->display_import_pid_record) will show messages if import is not possible of various items. if (is_array($this->display_import_pid_record)) { if ($checkImportInPidRecord) { if (!$BE_USER->doesUserHaveAccess($this->display_import_pid_record, $table == 'pages' ? 8 : 16)) { $pInfo['msg'] .= "'" . $pInfo['ref'] . "' cannot be INSERTED on this page! "; } if (!$this->checkDokType($table, $this->display_import_pid_record['doktype']) && !$TCA[$table]['ctrl']['rootLevel']) { $pInfo['msg'] .= "'" . $table . "' cannot be INSERTED on this page type (change page type to 'Folder'.) "; } } if (!$BE_USER->check('tables_modify', $table)) { $pInfo['msg'] .= "You are not allowed to CREATE '" . $table . "' tables! "; } if ($TCA[$table]['ctrl']['readOnly']) { $pInfo['msg'] .= "TABLE '" . $table . "' is READ ONLY! "; } if ($TCA[$table]['ctrl']['adminOnly'] && !$BE_USER->isAdmin()) { $pInfo['msg'] .= "TABLE '" . $table . "' is ADMIN ONLY! "; } if ($TCA[$table]['ctrl']['is_static']) { $pInfo['msg'] .= "TABLE '" . $table . "' is a STATIC TABLE! "; } if ($TCA[$table]['ctrl']['rootLevel']) { $pInfo['msg'] .= "TABLE '" . $table . "' will be inserted on ROOT LEVEL! "; } $diffInverse = FALSE; if ($this->update) { $diffInverse = TRUE; // In case of update-PREVIEW we swap the diff-sources. $recInf = $this->doesRecordExist($table, $uid, $this->showDiff ? '*' : ''); $pInfo['updatePath'] = $recInf ? htmlspecialchars($this->getRecordPath($recInf['pid'])) : '<strong>NEW!</strong>'; // Mode selector: $optValues = array(); $optValues[] = $recInf ? $LANG->getLL('impexpcore_singlereco_update') : $LANG->getLL('impexpcore_singlereco_insert'); if ($recInf) { $optValues['as_new'] = $LANG->getLL('impexpcore_singlereco_importAsNew'); } if ($recInf) { if (!$this->global_ignore_pid) { $optValues['ignore_pid'] = $LANG->getLL('impexpcore_singlereco_ignorePid'); } else { $optValues['respect_pid'] = $LANG->getLL('impexpcore_singlereco_respectPid'); } } if (!$recInf && $GLOBALS['BE_USER']->isAdmin()) { $optValues['force_uid'] = sprintf($LANG->getLL('impexpcore_singlereco_forceUidSAdmin'), $uid); } $optValues['exclude'] = $LANG->getLL('impexpcore_singlereco_exclude'); $pInfo['updateMode'] = $this->renderSelectBox('tx_impexp[import_mode][' . $table . ':' . $uid . ']', $this->import_mode[$table . ':' . $uid], $optValues); } // Diff vieiw: if ($this->showDiff) { // For IMPORTS, get new id: if ($newUid = $this->import_mapId[$table][$uid]) { $diffInverse = FALSE; $recInf = $this->doesRecordExist($table, $newUid, '*'); t3lib_BEfunc::workspaceOL($table, $recInf); } if (is_array($recInf)) { $pInfo['showDiffContent'] = $this->compareRecords($recInf, $this->dat['records'][$table . ':' . $uid]['data'], $table, $diffInverse); } } } $pInfo['preCode'] = $preCode . t3lib_iconworks::getSpriteIconForRecord($table, (array) $this->dat['records'][$table . ':' . $uid]['data'], array('title' => htmlspecialchars($table . ':' . $uid))); $pInfo['title'] = htmlspecialchars($record['title']); // View page: if ($table === 'pages') { $viewID = $this->mode === 'export' ? $uid : ($this->doesImport ? $this->import_mapId['pages'][$uid] : 0); if ($viewID) { $pInfo['title'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($viewID, $GLOBALS['BACK_PATH'])) . 'return false;">' . $pInfo['title'] . '</a>'; } } } $pInfo['class'] = $table == 'pages' ? 'bgColor4-20' : 'bgColor4'; $pInfo['type'] = 'record'; $pInfo['size'] = $record['size']; $lines[] = $pInfo; // File relations: if (is_array($record['filerefs'])) { $this->addFiles($record['filerefs'], $lines, $preCode); } // DB relations if (is_array($record['rels'])) { $this->addRelations($record['rels'], $lines, $preCode); } // Soft ref if (count($record['softrefs'])) { $preCode_A = $preCode . ' '; $preCode_B = $preCode . ' '; foreach ($record['softrefs'] as $info) { $pInfo = array(); $pInfo['preCode'] = $preCode_A . t3lib_iconWorks::getSpriteIcon('status-status-reference-soft'); $pInfo['title'] = '<em>' . $info['field'] . ', "' . $info['spKey'] . '" </em>: <span title="' . htmlspecialchars($info['matchString']) . '">' . htmlspecialchars(t3lib_div::fixed_lgd_cs($info['matchString'], 60)) . '</span>'; if ($info['subst']['type']) { if (strlen($info['subst']['title'])) { $pInfo['title'] .= '<br/>' . $preCode_B . '<strong>' . $LANG->getLL('impexpcore_singlereco_title', 1) . '</strong> ' . htmlspecialchars(t3lib_div::fixed_lgd_cs($info['subst']['title'], 60)); } if (strlen($info['subst']['description'])) { $pInfo['title'] .= '<br/>' . $preCode_B . '<strong>' . $LANG->getLL('impexpcore_singlereco_descr', 1) . '</strong> ' . htmlspecialchars(t3lib_div::fixed_lgd_cs($info['subst']['description'], 60)); } $pInfo['title'] .= '<br/>' . $preCode_B . ($info['subst']['type'] == 'file' ? $LANG->getLL('impexpcore_singlereco_filename', 1) . ' <strong>' . $info['subst']['relFileName'] . '</strong>' : '') . ($info['subst']['type'] == 'string' ? $LANG->getLL('impexpcore_singlereco_value', 1) . ' <strong>' . $info['subst']['tokenValue'] . '</strong>' : '') . ($info['subst']['type'] == 'db' ? $LANG->getLL('impexpcore_softrefsel_record', 1) . ' <strong>' . $info['subst']['recordRef'] . '</strong>' : ''); } $pInfo['ref'] = 'SOFTREF'; $pInfo['size'] = ''; $pInfo['class'] = 'bgColor3'; $pInfo['type'] = 'softref'; $pInfo['_softRefInfo'] = $info; $pInfo['type'] = 'softref'; if ($info['error'] && !t3lib_div::inList('editable,exclude', $this->softrefCfg[$info['subst']['tokenID']]['mode'])) { $pInfo['msg'] .= $info['error']; } $lines[] = $pInfo; // Add relations: if ($info['subst']['type'] == 'db') { list($tempTable, $tempUid) = explode(':', $info['subst']['recordRef']); $this->addRelations(array(array('table' => $tempTable, 'id' => $tempUid, 'tokenID' => $info['subst']['tokenID'])), $lines, $preCode_B, array(), ''); } // Add files: if ($info['subst']['type'] == 'file') { #debug($info); $this->addFiles(array($info['file_ID']), $lines, $preCode_B, '', $info['subst']['tokenID']); } } } }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @return array all available buttons as an assoc. array */ protected function getButtons() { global $LANG, $BACK_PATH; $buttons = array('csh' => '', 'back' => '', 'view' => '', 'new_page' => '', 'record_list' => ''); if (!$this->pagesOnly) { // Regular new element: // New page if ($this->showNewRecLink('pages')) { $buttons['new_page'] = '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('pagesOnly' => '1'))) . '" title="' . $LANG->sL('LLL:EXT:cms/layout/locallang.xml:newPage', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-new') . '</a>'; } // CSH $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_regular', $GLOBALS['BACK_PATH'], '', TRUE); } elseif ($this->showNewRecLink('pages')) { // Pages only wizard // CSH $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_pages', $GLOBALS['BACK_PATH'], '', TRUE); } // Back if ($this->R_URI) { $buttons['back'] = '<a href="' . htmlspecialchars($this->R_URI) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-back') . '</a>'; } if (is_array($this->pageinfo) && $this->pageinfo['uid']) { // View $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $this->backPath, t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>'; // Record list // If access to Web>List for user, then link to that module. $buttons['record_list'] = t3lib_BEfunc::getListViewLink(array('id' => $this->pageinfo['uid'], 'returnUrl' => t3lib_div::getIndpEnv('REQUEST_URI')), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList')); } return $buttons; }
/** * Makes link to page $id in frontend (view page) * Returns an magnifier-glass icon which links to the frontend index.php document for viewing the page with id $id * $id must be a page-uid * If the BE_USER has access to Web>List then a link to that module is shown as well (with return-url) * * @param integer The page id * @param string The current "BACK_PATH" (the back relative to the typo3/ directory) * @param string Additional parameters for the image tag(s) * @return string HTML string with linked icon(s) */ function viewPageIcon($id, $backPath, $addParams = 'hspace="3"') { global $BE_USER; $str = ''; // If access to Web>List for user, then link to that module. if ($BE_USER->check('modules', 'web_list')) { $href = $backPath . 'db_list.php?id=' . $id . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); $str .= '<a href="' . htmlspecialchars($href) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/list.gif', 'width="11" height="11"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '"' . ($addParams ? ' ' . trim($addParams) : '') . ' alt="" />' . '</a>'; } // Make link to view page $str .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($id, $backPath, t3lib_BEfunc::BEgetRootLine($id))) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/zoom.gif', 'width="12" height="12"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '"' . ($addParams ? ' ' . trim($addParams) : "") . ' hspace="3" alt="" />' . '</a>'; return $str; }
/** * Generates a view link for a page. * * @static * @param $table * @param $uid * @param $record * @return string */ public static function viewSingleRecord($table, $uid, $record = null) { $viewUrl = ''; if ($table == 'pages') { $viewUrl = t3lib_BEfunc::viewOnClick(t3lib_BEfunc::getLiveVersionIdOfRecord('pages', $uid)); } elseif ($table == 'pages_language_oderlay' || $table == 'tt_content') { $elementRecord = is_array($record) ? $record : t3lib_BEfunc::getLiveVersionOfRecord($table, $uid); $viewUrl = t3lib_BEfunc::viewOnClick($elementRecord['pid']); } else { if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['viewSingleRecord'])) { $_params = array('table' => $table, 'uid' => $uid, 'record' => $record); $_funcRef = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['viewSingleRecord']; $viewUrl = t3lib_div::callUserFunction($_funcRef, $_params, null); } } return $viewUrl; }
/** * Links to publishing etc of a version * * @param string Table name * @param array Record * @param integer The uid of the online version of $uid. If zero it means we are drawing a row for the online version itself while a value means we are drawing display for an offline version. * @return string HTML content, mainly link tags and images. */ function displayWorkspaceOverview_commandLinksSub($table, $rec, $origId) { $uid = $rec['uid']; if ($origId || $GLOBALS['BE_USER']->workspace === 0) { if (!$GLOBALS['BE_USER']->workspaceCannotEditRecord($table, $rec)) { // Edit if ($table === 'pages') { $actionLinks .= '<a href="#" onclick="top.loadEditId(' . $uid . ');top.goToModule(\'' . $this->pageModule . '\'); return false;" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_user_ws.xml:img_title_edit_page', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('apps-version-page-open') . '</a>'; } else { $params = '&edit[' . $table . '][' . $uid . ']=edit'; $actionLinks .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $this->doc->backPath)) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_user_ws.xml:img_title_edit_element', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>'; } } // History/Log $actionLinks .= '<a href="' . htmlspecialchars($this->doc->backPath . 'show_rechis.php?element=' . rawurlencode($table . ':' . $uid) . '&returnUrl=' . rawurlencode($this->REQUEST_URI)) . '" title="' . $GLOBALS['LANG']->getLL('showLog', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-history-open') . '</a>'; } // View if ($table === 'pages') { $actionLinks .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($uid, $this->doc->backPath, t3lib_BEfunc::BEgetRootLine($uid))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>'; } return $actionLinks; }
/** * Renders the data columns * * @param array $item item array * @return array */ function getItemColumns($item) { // Columns rendering $columns = array(); foreach ($this->columnList as $field => $descr) { switch ($field) { case 'page': // Create output item for pages record $pageRow = $item[$field]; $rootline = t3lib_BEfunc::BEgetRootLine($pageRow['uid']); $pageOnClick = t3lib_BEfunc::viewOnClick($pageRow['uid'], $GLOBALS['BACK_PATH'], $rootline); $iconAltText = t3lib_BEfunc::getRecordIconAltText($pageRow, 'pages'); $icon = t3lib_iconWorks::getIconImage('pages', $pageRow, $GLOBALS['BACK_PATH'], 'title="' . $iconAltText . '" align="top"'); if ($this->showRootline) { $title = t3lib_BEfunc::getRecordPath($pageRow['uid'], '1=1', 0); $title = t3lib_div::fixed_lgd_cs($title, -$GLOBALS['BE_USER']->uc['titleLen']); } else { $title = t3lib_BEfunc::getRecordTitle('pages', $pageRow, TRUE); } if ($pageRow['doktype'] == 1 || $pageRow['doktype'] == 6) { if ($this->enableContextMenus) { $columns[$field] = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($icon, 'pages', $pageRow['uid'], 1, '', '+view,edit,info') . $title; } else { $columns[$field] = '<a href="#" onclick="' . htmlspecialchars($pageOnClick) . '">' . $icon . $title . '</a>'; } } else { if ($this->enableContextMenus) { $columns[$field] = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($icon, 'pages', $pageRow['uid'], 1, '', '+edit,info') . $title; } else { $columns[$field] = $icon . $title; } } break; case 'content_element': // Create output item for content record $refTable = $item['tablenames']; $refRow = $item[$field]; if ($refTable == 'pages') { // The reference to the media is on a field of a page record if ($GLOBALS['BE_USER']->isInWebMount($refRow['uid']) && $GLOBALS['BE_USER']->doesUserHaveAccess($refRow, 1)) { $columns[$field] = tx_dam_SCbase::getRecordInfoEditLink($refTable, $refRow); } else { $pageRow = $refRow; $rootline = t3lib_BEfunc::BEgetRootLine($pageRow['uid']); $pageOnClick = t3lib_BEfunc::viewOnClick($pageRow['uid'], $GLOBALS['BACK_PATH'], $rootline); $iconAltText = t3lib_BEfunc::getRecordIconAltText($refRow, $refTable); $icon = t3lib_iconworks::getIconImage($refTable, $refRow, $GLOBALS['BACK_PATH'], 'class="c-recicon" align="top" title="' . $iconAltText . '"'); $title = t3lib_BEfunc::getRecordTitle($refTable, $refRow, 1); if ($pageRow['doktype'] == 1 || $pageRow['doktype'] == 6) { $columns[$field] = '<a href="#" onclick="' . htmlspecialchars($pageOnClick) . '">' . $icon . $title . '</a>'; } else { $columns[$field] = $icon . $title; } } } else { // The reference to the media is on a field of a content element record if ($GLOBALS['BE_USER']->isInWebMount($pageRow['uid']) && $GLOBALS['BE_USER']->doesUserHaveAccess($pageRow, 1)) { $columns[$field] = tx_dam_SCbase::getRecordInfoEditLink($refTable, $refRow); } else { $pageRow = $item['page']; $rootline = t3lib_BEfunc::BEgetRootLine($pageRow['uid']); $pageOnClick = t3lib_BEfunc::viewOnClick($pageRow['uid'], $GLOBALS['BACK_PATH'], $rootline); $iconAltText = t3lib_BEfunc::getRecordIconAltText($refRow, $refTable); $icon = t3lib_iconworks::getIconImage($refTable, $refRow, $GLOBALS['BACK_PATH'], 'class="c-recicon" align="top" title="' . $iconAltText . '"'); $title = t3lib_BEfunc::getRecordTitle($refTable, $refRow, 1); if ($pageRow['doktype'] == 1 || $pageRow['doktype'] == 6) { $columns[$field] = '<a href="#" onclick="' . htmlspecialchars($pageOnClick) . '">' . $icon . $title . '</a>'; } else { $columns[$field] = $icon . $title; } } } break; case 'content_field': // Create output item for reference field $columns[$field] = $item[$field]; break; case 'softref_key': // Create output item for reference key $columns[$field] = $item['softref_key'] ? $GLOBALS['LANG']->sl('LLL:EXT:dam/lib/locallang.xml:softref_key_' . $item['softref_key']) : $GLOBALS['LANG']->sl('LLL:EXT:dam/lib/locallang.xml:softref_key_media'); break; case 'content_age': // Create output text describing the age of the content element $columns[$field] = t3lib_BEfunc::dateTimeAge($item[$field], 1); break; case 'media_element': // Create output item for tx_dam record $columns[$field] = tx_dam_SCbase::getRecordInfoEditLink('tx_dam', $item); break; case 'media_element_age': // Create output text describing the tx_dam record age $columns[$field] = t3lib_BEfunc::dateTimeAge($item['tstamp'], 1); break; case '_CLIPBOARD_': $columns[$field] = $this->clipboard_getItemControl($item); break; case '_CONTROL_': $columns[$field] = $this->getItemControl($item); $this->columnTDAttr[$field] = ' nowrap="nowrap"'; break; default: $content = $item[$field]; $columns[$field] = htmlspecialchars(t3lib_div::fixed_lgd_cs($content, $this->titleLength)); break; } if ($columns[$field] === '') { $columns[$field] = ' '; } } // Thumbsnails? if ($this->showThumbs and $this->thumbnailPossible($item)) { $columns['media_element'] .= '<div style="margin:2px 0 2px 0;">' . $this->getThumbNail($item) . '</div>'; } return $columns; }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @return array all available buttons as an assoc. array */ protected function getButtons() { global $TCA, $LANG, $BACK_PATH, $BE_USER; $buttons = array('csh' => '', 'view' => '', 'record_list' => '', 'shortcut' => ''); // CSH $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH'], '', TRUE); if ($this->id && is_array($this->pageinfo)) { // View page $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $BACK_PATH, t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . ' ">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>'; // Shortcut if ($BE_USER->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']); } // If access to Web>List for user, then link to that module. if ($BE_USER->check('modules', 'web_list')) { $href = $BACK_PATH . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-list-open') . '</a>'; } } return $buttons; }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @return array all available buttons as an assoc. array */ protected function getButtons() { $buttons = array('back' => '', 'close' => '', 'new' => '', 'save' => '', 'save_close' => '', 'view' => '', 'record_list' => '', 'shortcut' => ''); if ($this->id && $this->access) { // View page $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $GLOBALS['BACK_PATH'], t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>'; // If access to Web>List for user, then link to that module. if ($GLOBALS['BE_USER']->check('modules', 'web_list')) { $href = $GLOBALS['BACK_PATH'] . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-list-open') . '</a>'; } if ($this->extClassConf['name'] == 'tx_tstemplateinfo') { // NEW button $buttons['new'] = '<input type="image" class="c-inputButton" name="createExtension" value="New"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/new_el.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:db_new.php.pagetitle', TRUE) . '" />'; if (!empty($this->e) && !t3lib_div::_POST('abort') && !t3lib_div::_POST('saveclose')) { // no NEW-button while edit $buttons['new'] = ''; // SAVE button $buttons['save'] = t3lib_iconWorks::getSpriteIcon('actions-document-save', array('html' => '<input type="image" class="c-inputButton" name="submit" src="clear.gif" ' . 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) . '" ' . 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) . '" ' . '/>')); // SAVE AND CLOSE button $buttons['save_close'] = t3lib_iconWorks::getSpriteIcon('actions-document-save-close', array('html' => '<input type="image" class="c-inputButton" name="saveclose" src="clear.gif" ' . 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', TRUE) . '" ' . 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', TRUE) . '" ' . '/>')); // CLOSE button $buttons['close'] = t3lib_iconWorks::getSpriteIcon('actions-document-close', array('html' => '<input type="image" class="c-inputButton" name="abort" src="clear.gif" ' . 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE) . '" ' . 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE) . '" ' . '/>')); } } elseif ($this->extClassConf['name'] == 'tx_tstemplateceditor' && count($this->MOD_MENU['constant_editor_cat'])) { // SAVE button $buttons['save'] = t3lib_iconWorks::getSpriteIcon('actions-document-save', array('html' => '<input type="image" class="c-inputButton" name="submit" src="clear.gif" ' . 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) . '" ' . 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) . '" ' . '/>')); } elseif ($this->extClassConf['name'] == 'tx_tstemplateobjbrowser') { if (!empty($this->sObj)) { // BACK $buttons['back'] = '<a href="index.php?id=' . $this->id . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-back') . '</a>'; } } // Shortcut if ($GLOBALS['BE_USER']->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']); } } else { // Shortcut if ($GLOBALS['BE_USER']->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('id', '', $this->MCONF['name']); } } return $buttons; }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @return array all available buttons as an associated array */ protected function getButtons() { $buttons = array('view' => '', 'record_list' => '', 'shortcut' => ''); if ($GLOBALS['BE_USER']->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('tx_impexp', '', $this->MCONF['name']); } // Input data grabbed: $inData = t3lib_div::_GP('tx_impexp'); if ((string) $inData['action'] == 'import') { if ($this->id && is_array($this->pageinfo) || $GLOBALS['BE_USER']->user['admin'] && !$this->id) { if (is_array($this->pageinfo) && $this->pageinfo['uid']) { // View $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $this->doc->backPath, t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>'; // Record list if ($GLOBALS['BE_USER']->check('modules', 'web_list')) { $href = $this->doc->backPath . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-list-open') . '</a>'; } } } } return $buttons; }
/** * Builds the array of reference items * * @param array $rows: Array of reference records * @param array $columns: Array of column names required from the entries * @return void */ function processEntries($rows, $columns) { foreach ($rows as $damRow) { $refTable = $damRow['tablenames']; if ($refTable) { // Get main fields from TCA $selectFields = tx_dam_db::getTCAFieldListArray($refTable, TRUE); $orderBy = in_array('tstamp', $selectFields) ? 'tstamp DESC' : ''; $selectFields = tx_dam_db::compileFieldList($refTable, $selectFields, FALSE); $selectFields = $selectFields ? $selectFields : $refTable . '.uid,' . $refTable . '.pid'; // Query for non-deleted tables only $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($selectFields, $refTable, $refTable . '.uid=' . intval($damRow['uid_foreign']) . t3lib_BEfunc::deleteClause($refTable), '', $orderBy, 40); // Assemble data while ($refRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $pageRow = t3lib_BEfunc::getRecord('pages', $refRow['pid']); if (is_array($pageRow)) { $item = array(); $item = $damRow; $rootline = t3lib_BEfunc::BEgetRootLine($pageRow['uid']); $pageOnClick = t3lib_BEfunc::viewOnClick($pageRow['uid'], '', $rootline); foreach ($columns as $element) { switch ($element) { case 'page': $item[$element] = $pageRow; $item['pid'] = $pageRow['uid']; break; case 'content_element': $item[$element] = $refRow; break; case 'content_field': // Create sortable item for reference field $item[$element] = ''; if ($item['ident']) { $item[$element] = trim($GLOBALS['LANG']->sL(t3lib_befunc::getItemLabel($refTable, $item['ident']))); } else { if ($item['field']) { $item[$element] = trim($GLOBALS['LANG']->sL(t3lib_befunc::getItemLabel($refTable, $item['field']))); } } // Removing trailing : from field label, if any if (substr($item[$element], -1) == ':') { $item[$element] = substr($item[$element], 0, -1); } break; case 'content_age': $item[$element] = $refRow['tstamp']; break; default: break; } } $this->entries[] = $item; } } } } }