130 $GLOBALS[
'LANG']->includeLLFile(
'EXT:version/locallang.xlf');
163 $this->doc->backPath =
$GLOBALS[
'BACK_PATH'];
164 $this->doc->setModuleTemplate(
'EXT:version/Resources/Private/Templates/version.html');
166 $this->doc->inDocStylesArray[
$GLOBALS[
'MCONF'][
'name']] =
' 167 .version-diff-1 { background-color: green; } 168 .version-diff-2 { background-color: red; } 171 $this->doc->getContextMenuCode();
185 $this->MOD_SETTINGS[
'expandSubElements'] = TRUE;
186 $this->MOD_SETTINGS[
'diff'] = $this->details || $this->MOD_SETTINGS[
'diff'] ? 1 : 0;
188 $record = BackendUtility::getRecord($this->table, $this->uid);
189 if ($record[
'pid'] == -1) {
190 $record = BackendUtility::getRecord($this->table, $record[
't3ver_oid']);
192 $this->recordFound = is_array($record);
193 $pidValue = $this->table ===
'pages' ? $this->uid : $record[
'pid'];
195 if ($this->recordFound &&
$GLOBALS[
'TCA'][$this->table][
'ctrl'][
'versioningWS'] && !$this->
id) {
196 $this->doc->form =
'<form action="" method="post">';
197 $this->uid = $record[
'uid'];
202 $access = is_array($this->pageinfo) ? 1 : 0;
203 if ($pidValue && $access ||
$GLOBALS[
'BE_USER']->user[
'admin'] && !$pidValue) {
205 $this->doc->JScode .= $this->doc->wrapScriptTags(
' 207 function hlSubelements(origId, verId, over, diffLayer) { // 209 document.getElementById(\'orig_\'+origId).attributes.getNamedItem("class").nodeValue = \'typo3-ver-hl\'; 210 document.getElementById(\'ver_\'+verId).attributes.getNamedItem("class").nodeValue = \'typo3-ver-hl\'; 212 document.getElementById(\'diff_\'+verId).style.visibility = \'visible\'; 215 document.getElementById(\'orig_\'+origId).attributes.getNamedItem("class").nodeValue = \'typo3-ver\'; 216 document.getElementById(\'ver_\'+verId).attributes.getNamedItem("class").nodeValue = \'typo3-ver\'; 218 document.getElementById(\'diff_\'+verId).style.visibility = \'hidden\'; 224 $newPageModule = trim(
$GLOBALS[
'BE_USER']->getTSConfigVal(
'options.overridePageModule'));
227 $this->publishAccess =
$GLOBALS[
'BE_USER']->workspacePublishAccess(
$GLOBALS[
'BE_USER']->workspace);
230 $this->content .= $this->doc->spacer(10);
233 $markers[
'CSH'] = $docHeaderButtons[
'csh'];
234 $markers[
'FUNC_MENU'] =
BackendUtility::getFuncMenu($this->
id,
'SET[function]', $this->MOD_SETTINGS[
'function'], $this->MOD_MENU[
'function']);
238 $this->content = $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'clickAPage_header'),
$GLOBALS[
'LANG']->getLL(
'clickAPage_content'), 0, 1);
244 $this->content = $this->doc->startPage(
$GLOBALS[
'LANG']->getLL(
'title'));
245 $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
246 $this->content .= $this->doc->endPage();
247 $this->content = $this->doc->insertStylesAndJS($this->content);
272 if ($this->recordFound &&
$GLOBALS[
'TCA'][$this->table][
'ctrl'][
'versioningWS']) {
276 if (
$GLOBALS[
'BE_USER']->mayMakeShortcut()) {
277 $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']);
281 'id' => $this->pageinfo[
'uid'],
283 ),
'',
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.showList'));
306 if ($diff_1 && $diff_2) {
307 $diff_1_record = BackendUtility::getRecord($this->table, $diff_1);
308 $diff_2_record = BackendUtility::getRecord($this->table, $diff_2);
309 if (is_array($diff_1_record) && is_array($diff_2_record)) {
313 <tr class="bgColor5 tableheader"> 314 <td>' .
$GLOBALS[
'LANG']->getLL(
'fieldname') .
'</td> 315 <td width="98%">' .
$GLOBALS[
'LANG']->getLL(
'coloredDiffView') .
':</td> 318 foreach ($diff_1_record as $fN => $fV) {
320 if ((
string)$diff_1_record[$fN] !== (
string)$diff_2_record[$fN]) {
321 $diffres = $t3lib_diff_Obj->makeDiffDisplay(BackendUtility::getProcessedValue($this->table, $fN, $diff_2_record[$fN], 0, 1), BackendUtility::getProcessedValue($this->table, $fN, $diff_1_record[$fN], 0, 1));
323 <tr class="bgColor4"> 325 <td width="98%">' . $diffres .
'</td> 331 if (count($tRows) > 1) {
332 $content .=
'<table border="0" cellpadding="1" cellspacing="1" width="100%">' . implode(
'', $tRows) .
'</table><br /><br />';
344 $record = BackendUtility::getRecord($this->table, $this->uid);
349 ' . $recordIcon . $recTitle .
' 350 <form name="theform" action="' . str_replace(
'&sendToReview=1',
'', $this->REQUEST_URI) .
'" method="post"> 351 <table border="0" cellspacing="1" cellpadding="1">';
353 <tr class="bgColor5 tableheader"> 356 <td title="' .
$GLOBALS[
'LANG']->getLL(
'tblHeaderDesc_title') .
'">' .
$GLOBALS[
'LANG']->getLL(
'tblHeader_title') .
'</td> 357 <td title="' .
$GLOBALS[
'LANG']->getLL(
'tblHeaderDesc_uid') .
'">' .
$GLOBALS[
'LANG']->getLL(
'tblHeader_uid') .
'</td> 358 <td title="' .
$GLOBALS[
'LANG']->getLL(
'tblHeaderDesc_t3ver_oid') .
'">' .
$GLOBALS[
'LANG']->getLL(
'tblHeader_t3ver_oid') .
'</td> 359 <td title="' .
$GLOBALS[
'LANG']->getLL(
'tblHeaderDesc_t3ver_id') .
'">' .
$GLOBALS[
'LANG']->getLL(
'tblHeader_t3ver_id') .
'</td> 360 <td title="' .
$GLOBALS[
'LANG']->getLL(
'tblHeaderDesc_t3ver_wsid') .
'">' .
$GLOBALS[
'LANG']->getLL(
'tblHeader_t3ver_wsid') .
'</td> 361 <td title="' .
$GLOBALS[
'LANG']->getLL(
'tblHeaderDesc_t3ver_state') .
'">' .
$GLOBALS[
'LANG']->getLL(
'tblHeader_t3ver_state') .
'</td> 362 <td title="' .
$GLOBALS[
'LANG']->getLL(
'tblHeaderDesc_t3ver_stage') .
'">' .
$GLOBALS[
'LANG']->getLL(
'tblHeader_t3ver_stage') .
'</td> 363 <td title="' .
$GLOBALS[
'LANG']->getLL(
'tblHeaderDesc_t3ver_count') .
'">' .
$GLOBALS[
'LANG']->getLL(
'tblHeader_t3ver_count') .
'</td> 364 <td title="' .
$GLOBALS[
'LANG']->getLL(
'tblHeaderDesc_pid') .
'">' .
$GLOBALS[
'LANG']->getLL(
'tblHeader_pid') .
'</td> 365 <td title="' .
$GLOBALS[
'LANG']->getLL(
'tblHeaderDesc_t3ver_label') .
'">' .
$GLOBALS[
'LANG']->getLL(
'tblHeader_t3ver_label') .
'</td> 366 <td colspan="2"><input type="submit" name="do_diff" value="' .
$GLOBALS[
'LANG']->getLL(
'diff') .
'" /></td> 369 foreach ($versions as $row) {
370 $adminLinks = $this->
adminLinks($this->table, $row);
372 <tr class="' . ($row[
'uid'] != $this->uid ?
'bgColor4' :
'bgColor2 tableheader') .
'"> 373 <td>' . ($row[
'uid'] != $this->uid ?
374 '<a href="' . $this->doc->issueCommand((
'&cmd[' . $this->table .
'][' . $this->uid .
'][version][swapWith]=' . $row[
'uid'] .
'&cmd[' . $this->table .
'][' . $this->uid .
'][version][action]=swap')) .
'" title="' .
$GLOBALS[
'LANG']->getLL(
'swapWithCurrent', TRUE) .
'">' .
IconUtility::getSpriteIcon(
'actions-version-swap-version') .
'</a>' :
376 <td nowrap="nowrap">' . $adminLinks .
'</td> 378 <td>' . $row[
'uid'] .
'</td> 379 <td>' . $row[
't3ver_oid'] .
'</td> 380 <td>' . $row[
't3ver_id'] .
'</td> 381 <td>' . $row[
't3ver_wsid'] .
'</td> 382 <td>' . $row[
't3ver_state'] .
'</td> 383 <td>' . $row[
't3ver_stage'] .
'</td> 384 <td>' . $row[
't3ver_count'] .
'</td> 385 <td>' . $row[
'pid'] .
'</td> 386 <td nowrap="nowrap"><a href="#" onclick="' . htmlspecialchars(
BackendUtility::editOnClick((
'&edit[' . $this->table .
'][' . $row[
'uid'] .
']=edit&columnsOnly=t3ver_label'), $this->doc->backPath)) .
'" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:cm.edit', TRUE) .
'">' .
IconUtility::getSpriteIcon(
'actions-document-open') .
'</a>' . htmlspecialchars($row[
't3ver_label']) .
'</td> 387 <td class="version-diff-1"><input type="radio" name="diff_1" value="' . $row[
'uid'] .
'"' . ($diff_1 == $row[
'uid'] ?
' checked="checked"' :
'') .
'/></td> 388 <td class="version-diff-2"><input type="radio" name="diff_2" value="' . $row[
'uid'] .
'"' . ($diff_2 == $row[
'uid'] ?
' checked="checked"' :
'') .
'/></td> 391 if ($this->table ==
'pages' && $row[
'uid'] != $this->uid) {
398 <td colspan="10">' . $sub .
'</td> 399 <td colspan="2"></td> 405 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'title'),
$content, 0, 1);
409 <form action="' . $this->doc->backPath .
'tce_db.php" method="post"> 410 ' .
$GLOBALS[
'LANG']->getLL(
'tblHeader_t3ver_label') .
': <input type="text" name="cmd[' . $this->table .
'][' . $this->uid .
'][version][label]" /><br /> 411 <br /><input type="hidden" name="cmd[' . $this->table .
'][' . $this->uid .
'][version][action]" value="new" /> 412 <input type="hidden" name="prErr" value="1" /> 413 <input type="hidden" name="redirect" value="' . htmlspecialchars($this->REQUEST_URI) .
'" /> 414 <input type="submit" name="_" value="' .
$GLOBALS[
'LANG']->getLL(
'createNewVersion') .
'" /> 419 $this->content .= $this->doc->spacer(15);
420 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'createNewVersion'),
$content, 0, 1);
433 $tableNames[] =
'pages';
435 foreach ($tableNames as $tN) {
438 if (
$GLOBALS[
'TYPO3_DB']->sql_num_rows($mres)) {
441 <td colspan="4" class="' . (
$GLOBALS[
'TCA'][$tN][
'ctrl'][
'versioning_followPages'] ?
'bgColor6' : ($tN ==
'pages' ?
'bgColor5' :
'bgColor-10')) .
'"' . (!
$GLOBALS[
'TCA'][$tN][
'ctrl'][
'versioning_followPages'] && $tN !==
'pages' ?
' style="color: #666666; font-style:italic;"' :
'') .
'>' . $tN .
'</td> 443 while ($subrow =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($mres)) {
447 <td>' . $this->
adminLinks($tN, $subrow) .
'</td> 448 <td>' . $subrow[
'uid'] .
'</td> 449 ' . ($ownVer > 1 ?
'<td style="font-weight: bold; background-color: yellow;"><a href="' .
451 '">' . ($ownVer - 1) .
'</a></td>' :
'<td></td>') .
' 454 if ($tN ==
'pages' && $c < 100) {
462 <td width="98%">' . $sub .
'</td> 468 $GLOBALS[
'TYPO3_DB']->sql_free_result($mres);
470 return $content ?
'<table border="1" cellpadding="1" cellspacing="0" width="100%">' .
$content .
'</table>' :
'';
483 if (is_array($versions)) {
484 return count($versions);
499 $adminLink =
'<a href="#" onclick="' . htmlspecialchars(
BackendUtility::editOnClick((
'&edit[' . $table .
'][' . $row[
'uid'] .
']=edit'), $this->doc->backPath)) .
'" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:cm.edit', TRUE) .
'">' .
IconUtility::getSpriteIcon(
'actions-document-open') .
'</a>';
501 $adminLink .=
'<a href="' . htmlspecialchars($this->doc->issueCommand((
'&cmd[' . $table .
'][' . $row[
'uid'] .
'][delete]=1'))) .
'" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:cm.delete', TRUE) .
'">' .
IconUtility::getSpriteIcon(
'actions-edit-delete') .
'</a>';
502 if ($table ===
'pages') {
504 $newPageModule = trim(
$GLOBALS[
'BE_USER']->getTSConfigVal(
'options.overridePageModule'));
507 $a_wl =
$GLOBALS[
'BE_USER']->check(
'modules',
'web_list');
509 $adminLink .=
'<a href="#" onclick="top.loadEditId(' . $row[
'uid'] .
');top.goToModule(\'' .
$pageModule .
'\');
return false;
">' . IconUtility::getSpriteIcon('actions-page-open') . '</a>'; 510 $adminLink .= '<a href="#
" onclick="top.loadEditId(
' . $row['uid
'] . ');top.goToModule(\
'web_list\'); return false;">' .
IconUtility::getSpriteIcon(
'actions-system-list-open') .
'</a>';
514 if ($row[
'pid'] == -1) {
515 $getVars =
'&ADMCMD_vPrev[' . rawurlencode(($table .
':' . $row[
't3ver_oid'])) .
']=' . $row[
'uid'];
static readPageAccess($id, $perms_clause)
static editOnClick($params, $backPath='', $requestUri='')
static BEgetRootLine($uid, $clause='', $workspaceOL=FALSE)
static getIndpEnv($getEnvName)
static makeInstance($className)
static viewOnClick($pageUid, $backPath='', $rootLine='', $anchorSection='', $alternativeUrl='', $additionalGetVars='', $switchFocus=TRUE)
static getRecordTitle($table, $row, $prep=FALSE, $forceResult=TRUE)
static getSpriteIconForRecord($table, array $row, array $options=array())
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
static getModuleData($MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
static isModuleSetInTBE_MODULES($modName)
static getFuncMenu($mainParams, $elementName, $currentValue, $menuItems, $script='', $addparams='')
static selectVersionsOfRecord($table, $uid, $fields=' *', $workspace=0, $includeDeletedRecords=FALSE, $row=NULL)
lookForOwnVersions($table, $uid)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static removeArrayEntryByValue(array $array, $cmpValue)
static inList($list, $item)
pageSubContent($pid, $c=0)
static getListViewLink($urlParameters=array(), $linkTitle='', $linkText='')
static deleteClause($table, $tableAlias='')