359060507bcd793f99ca153009fc58c84e8739d2
[Packages/TYPO3.CMS.git] / typo3 / sysext / version / Classes / Controller / VersionModuleController.php
1 <?php
2 namespace TYPO3\CMS\Version\Controller;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Core\Utility\ArrayUtility;
18 use TYPO3\CMS\Core\Utility\GeneralUtility;
19 use TYPO3\CMS\Backend\Utility\BackendUtility;
20 use TYPO3\CMS\Backend\Utility\IconUtility;
21
22 /**
23 * Versioning module, including workspace management
24 */
25 class VersionModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
26
27 /**
28 * Module configuration
29 *
30 * @var array
31 */
32 public $MCONF = array();
33
34 /**
35 * Module menu items
36 *
37 * @var array
38 */
39 public $MOD_MENU = array();
40
41 /**
42 * Module session settings
43 *
44 * @var array
45 */
46 public $MOD_SETTINGS = array();
47
48 /**
49 * document template object
50 *
51 * @var \TYPO3\CMS\Backend\Template\DocumentTemplate
52 */
53 public $doc;
54
55 /**
56 * @var string
57 */
58 public $content;
59
60 /**
61 * Accumulated content
62 *
63 * @var int
64 */
65 public $showWorkspaceCol = 0;
66
67 /**
68 * @var array
69 */
70 public $formatWorkspace_cache = array();
71
72 /**
73 * @var array
74 */
75 public $formatCount_cache = array();
76
77 /**
78 * @var array
79 */
80 public $targets = array();
81
82 /**
83 * Accumulation of online targets.
84 *
85 * @var string
86 */
87 public $pageModule = '';
88
89 /**
90 * Name of page module
91 *
92 * @var bool
93 */
94 public $publishAccess = FALSE;
95
96 /**
97 * @var array
98 */
99 public $stageIndex = array();
100
101 /**
102 * @var array
103 */
104 public $recIndex = array();
105
106 /**
107 * Initialize language files
108 */
109 public function __construct() {
110 $GLOBALS['LANG']->includeLLFile('EXT:version/Resources/Private/Language/locallang.xlf');
111 }
112
113 /**
114 * Initialize menu configuration
115 *
116 * @return void
117 */
118 public function menuConfig() {
119 // CLEANSE SETTINGS
120 $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->MCONF['name'], 'ses');
121 }
122
123 /**
124 * Main function of the module. Write the content to $this->content
125 *
126 * @return void
127 */
128 public function main() {
129 // Template markers
130 $markers = array(
131 'CSH' => '',
132 'FUNC_MENU' => '',
133 'WS_MENU' => '',
134 'CONTENT' => ''
135 );
136 // Setting module configuration:
137 $this->MCONF = $GLOBALS['MCONF'];
138 $this->REQUEST_URI = str_replace('&sendToReview=1', '', GeneralUtility::getIndpEnv('REQUEST_URI'));
139 // Draw the header.
140 $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
141 $this->doc->backPath = $GLOBALS['BACK_PATH'];
142 $this->doc->setModuleTemplate('EXT:version/Resources/Private/Templates/version.html');
143 // Add styles
144 $this->doc->inDocStylesArray[$GLOBALS['MCONF']['name']] = '
145 .version-diff-1 { background-color: green; }
146 .version-diff-2 { background-color: red; }
147 ';
148 // Setting up the context sensitive menu:
149 $this->doc->getContextMenuCode();
150 // Getting input data:
151 $this->id = (int)GeneralUtility::_GP('id');
152
153 // Record uid. Goes with table name to indicate specific record
154 $this->uid = (int)GeneralUtility::_GP('uid');
155 // // Record table. Goes with uid to indicate specific record
156 $this->table = GeneralUtility::_GP('table');
157
158 $this->details = GeneralUtility::_GP('details');
159 // Page id. If set, indicates activation from Web>Versioning module
160 $this->diffOnly = GeneralUtility::_GP('diffOnly');
161 // Flag. If set, shows only the offline version and with diff-view
162 // Force this setting:
163 $this->MOD_SETTINGS['expandSubElements'] = TRUE;
164 $this->MOD_SETTINGS['diff'] = $this->details || $this->MOD_SETTINGS['diff'] ? 1 : 0;
165 // Reading the record:
166 $record = BackendUtility::getRecord($this->table, $this->uid);
167 if ($record['pid'] == -1) {
168 $record = BackendUtility::getRecord($this->table, $record['t3ver_oid']);
169 }
170 $this->recordFound = is_array($record);
171 $pidValue = $this->table === 'pages' ? $this->uid : $record['pid'];
172 // Checking access etc.
173 if ($this->recordFound && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS'] && !$this->id) {
174 $this->doc->form = '<form action="" method="post">';
175 $this->uid = $record['uid'];
176 // Might have changed if new live record was found!
177 // Access check!
178 // The page will show only if there is a valid page and if this page may be viewed by the user
179 $this->pageinfo = BackendUtility::readPageAccess($pidValue, $this->perms_clause);
180 $access = is_array($this->pageinfo) ? 1 : 0;
181 if ($pidValue && $access || $GLOBALS['BE_USER']->user['admin'] && !$pidValue) {
182 // JavaScript
183 $this->doc->JScode .= $this->doc->wrapScriptTags('
184
185 function hlSubelements(origId, verId, over, diffLayer) { //
186 if (over) {
187 document.getElementById(\'orig_\'+origId).attributes.getNamedItem("class").nodeValue = \'typo3-ver-hl\';
188 document.getElementById(\'ver_\'+verId).attributes.getNamedItem("class").nodeValue = \'typo3-ver-hl\';
189 if (diffLayer) {
190 document.getElementById(\'diff_\'+verId).style.visibility = \'visible\';
191 }
192 } else {
193 document.getElementById(\'orig_\'+origId).attributes.getNamedItem("class").nodeValue = \'typo3-ver\';
194 document.getElementById(\'ver_\'+verId).attributes.getNamedItem("class").nodeValue = \'typo3-ver\';
195 if (diffLayer) {
196 document.getElementById(\'diff_\'+verId).style.visibility = \'hidden\';
197 }
198 }
199 }
200 ');
201 // If another page module was specified, replace the default Page module with the new one
202 $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
203 $this->pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
204 // Setting publish access permission for workspace:
205 $this->publishAccess = $GLOBALS['BE_USER']->workspacePublishAccess($GLOBALS['BE_USER']->workspace);
206 $this->versioningMgm();
207 }
208 $this->content .= $this->doc->spacer(10);
209 // Setting up the buttons and markers for docheader
210 $docHeaderButtons = $this->getButtons();
211 $markers['CSH'] = $docHeaderButtons['csh'];
212 $markers['FUNC_MENU'] = BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
213 $markers['CONTENT'] = $this->content;
214 } else {
215 // If no access or id value, create empty document
216 $this->content = $this->doc->section($GLOBALS['LANG']->getLL('clickAPage_header'), $GLOBALS['LANG']->getLL('clickAPage_content'), 0, 1);
217 // Setting up the buttons and markers for docheader
218 $docHeaderButtons = $this->getButtons();
219 $markers['CONTENT'] = $this->content;
220 }
221 // Build the <body> for the module
222 $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
223 $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
224 $this->content .= $this->doc->endPage();
225 $this->content = $this->doc->insertStylesAndJS($this->content);
226 }
227
228 /**
229 * Outputs accumulated module content to browser.
230 *
231 * @return void
232 */
233 public function printContent() {
234 echo $this->content;
235 }
236
237 /**
238 * Create the panel of buttons for submitting the form or otherwise perform operations.
239 *
240 * @return array All available buttons as an assoc. array
241 */
242 protected function getButtons() {
243 $buttons = array(
244 'csh' => '',
245 'view' => '',
246 'record_list' => '',
247 'shortcut' => ''
248 );
249 // CSH
250 if ($this->recordFound && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS']) {
251 // View page
252 $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($this->pageinfo['uid'], $GLOBALS['BACK_PATH'], BackendUtility::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
253 // Shortcut
254 if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
255 $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']);
256 }
257 // If access to Web>List for user, then link to that module.
258 $buttons['record_list'] = BackendUtility::getListViewLink(array(
259 'id' => $this->pageinfo['uid'],
260 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
261 ), '', $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showList'));
262 }
263 return $buttons;
264 }
265
266 /******************************
267 *
268 * Versioning management
269 *
270 ******************************/
271 /**
272 * Management of versions for record
273 *
274 * @return void
275 */
276 public function versioningMgm() {
277 // Diffing:
278 $diff_1 = GeneralUtility::_POST('diff_1');
279 $diff_2 = GeneralUtility::_POST('diff_2');
280 if (GeneralUtility::_POST('do_diff')) {
281 $content = '';
282 $content .= '<h3>' . $GLOBALS['LANG']->getLL('diffing') . ':</h3>';
283 if ($diff_1 && $diff_2) {
284 $diff_1_record = BackendUtility::getRecord($this->table, $diff_1);
285 $diff_2_record = BackendUtility::getRecord($this->table, $diff_2);
286 if (is_array($diff_1_record) && is_array($diff_2_record)) {
287 $diffUtility = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Utility\DiffUtility::class);
288 $tRows = array();
289 $tRows[] = '
290 <tr class="bgColor5 tableheader">
291 <td>' . $GLOBALS['LANG']->getLL('fieldname') . '</td>
292 <td width="98%">' . $GLOBALS['LANG']->getLL('coloredDiffView') . ':</td>
293 </tr>
294 ';
295 foreach ($diff_1_record as $fN => $fV) {
296 if ($GLOBALS['TCA'][$this->table]['columns'][$fN] && $GLOBALS['TCA'][$this->table]['columns'][$fN]['config']['type'] !== 'passthrough' && !GeneralUtility::inList('t3ver_label', $fN)) {
297 if ((string)$diff_1_record[$fN] !== (string)$diff_2_record[$fN]) {
298 $diffres = $diffUtility->makeDiffDisplay(BackendUtility::getProcessedValue($this->table, $fN, $diff_2_record[$fN], 0, 1), BackendUtility::getProcessedValue($this->table, $fN, $diff_1_record[$fN], 0, 1));
299 $tRows[] = '
300 <tr class="bgColor4">
301 <td>' . $fN . '</td>
302 <td width="98%">' . $diffres . '</td>
303 </tr>
304 ';
305 }
306 }
307 }
308 if (count($tRows) > 1) {
309 $content .= '<table border="0" cellpadding="1" cellspacing="1" width="100%">' . implode('', $tRows) . '</table><br /><br />';
310 } else {
311 $content .= $GLOBALS['LANG']->getLL('recordsMatchesCompletely');
312 }
313 } else {
314 $content .= $GLOBALS['LANG']->getLL('errorRecordsNotFound');
315 }
316 } else {
317 $content .= $GLOBALS['LANG']->getLL('errorDiffSources');
318 }
319 }
320 // Element:
321 $record = BackendUtility::getRecord($this->table, $this->uid);
322 $recordIcon = IconUtility::getSpriteIconForRecord($this->table, $record);
323 $recTitle = BackendUtility::getRecordTitle($this->table, $record, TRUE);
324 // Display versions:
325 $content .= '
326 ' . $recordIcon . $recTitle . '
327 <form name="theform" action="' . str_replace('&sendToReview=1', '', $this->REQUEST_URI) . '" method="post">
328 <table border="0" cellspacing="1" cellpadding="1">';
329 $content .= '
330 <tr class="bgColor5 tableheader">
331 <td>&nbsp;</td>
332 <td>&nbsp;</td>
333 <td title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_title') . '">' . $GLOBALS['LANG']->getLL('tblHeader_title') . '</td>
334 <td title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_uid') . '">' . $GLOBALS['LANG']->getLL('tblHeader_uid') . '</td>
335 <td title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_oid') . '">' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_oid') . '</td>
336 <td title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_id') . '">' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_id') . '</td>
337 <td title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_wsid') . '">' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_wsid') . '</td>
338 <td title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_state') . '">' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_state') . '</td>
339 <td title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_stage') . '">' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_stage') . '</td>
340 <td title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_count') . '">' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_count') . '</td>
341 <td title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_pid') . '">' . $GLOBALS['LANG']->getLL('tblHeader_pid') . '</td>
342 <td title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_label') . '">' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_label') . '</td>
343 <td colspan="2"><input class="btn btn-default" type="submit" name="do_diff" value="' . $GLOBALS['LANG']->getLL('diff') . '" /></td>
344 </tr>';
345 $versions = BackendUtility::selectVersionsOfRecord($this->table, $this->uid, '*', $GLOBALS['BE_USER']->workspace);
346 foreach ($versions as $row) {
347 $adminLinks = $this->adminLinks($this->table, $row);
348 $content .= '
349 <tr class="' . ($row['uid'] != $this->uid ? 'bgColor4' : 'bgColor2 tableheader') . '">
350 <td>' . ($row['uid'] != $this->uid ?
351 '<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>' :
352 IconUtility::getSpriteIcon('status-status-current', array('title' => $GLOBALS['LANG']->getLL('currentOnlineVersion', TRUE)))) . '</td>
353 <td nowrap="nowrap">' . $adminLinks . '</td>
354 <td nowrap="nowrap">' . BackendUtility::getRecordTitle($this->table, $row, TRUE) . '</td>
355 <td>' . $row['uid'] . '</td>
356 <td>' . $row['t3ver_oid'] . '</td>
357 <td>' . $row['t3ver_id'] . '</td>
358 <td>' . $row['t3ver_wsid'] . '</td>
359 <td>' . $row['t3ver_state'] . '</td>
360 <td>' . $row['t3ver_stage'] . '</td>
361 <td>' . $row['t3ver_count'] . '</td>
362 <td>' . $row['pid'] . '</td>
363 <td nowrap="nowrap"><a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick('&edit[' . $this->table . '][' . $row['uid'] . ']=edit&columnsOnly=t3ver_label')) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.edit', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-open') . '</a>' . htmlspecialchars($row['t3ver_label']) . '</td>
364 <td class="version-diff-1"><input type="radio" name="diff_1" value="' . $row['uid'] . '"' . ($diff_1 == $row['uid'] ? ' checked="checked"' : '') . '/></td>
365 <td class="version-diff-2"><input type="radio" name="diff_2" value="' . $row['uid'] . '"' . ($diff_2 == $row['uid'] ? ' checked="checked"' : '') . '/></td>
366 </tr>';
367 // Show sub-content if the table is pages AND it is not the online branch (because that will mostly render the WHOLE tree below - not smart;)
368 if ($this->table == 'pages' && $row['uid'] != $this->uid) {
369 $sub = $this->pageSubContent($row['uid']);
370 if ($sub) {
371 $content .= '
372 <tr>
373 <td></td>
374 <td></td>
375 <td colspan="10">' . $sub . '</td>
376 <td colspan="2"></td>
377 </tr>';
378 }
379 }
380 }
381 $content .= '</table></form>';
382 $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('title'), $content, 0, 1);
383 // Create new:
384 $content = '
385
386 <form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_db')) . '" method="post">
387 ' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_label') . ': <input type="text" name="cmd[' . $this->table . '][' . $this->uid . '][version][label]" /><br />
388 <br /><input type="hidden" name="cmd[' . $this->table . '][' . $this->uid . '][version][action]" value="new" />
389 <input type="hidden" name="prErr" value="1" />
390 <input type="hidden" name="redirect" value="' . htmlspecialchars($this->REQUEST_URI) . '" />
391 <input class="btn btn-default" type="submit" name="_" value="' . $GLOBALS['LANG']->getLL('createNewVersion') . '" />
392 ' . \TYPO3\CMS\Backend\Form\FormEngine::getHiddenTokenField('tceAction') . '
393 </form>
394
395 ';
396 $this->content .= $this->doc->spacer(15);
397 $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('createNewVersion'), $content, 0, 1);
398 }
399
400 /**
401 * Recursively look for children for page version with $pid
402 *
403 * @param int $pid UID of page record for which to look up sub-elements following that version
404 * @param int $c Counter, do not set (limits to 100 levels)
405 * @return string Table with content if any
406 */
407 public function pageSubContent($pid, $c = 0) {
408 $tableNames = ArrayUtility::removeArrayEntryByValue(array_keys($GLOBALS['TCA']), 'pages');
409 $tableNames[] = 'pages';
410 $content = '';
411 foreach ($tableNames as $tN) {
412 // Basically list ALL tables - not only those being copied might be found!
413 $mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $tN, 'pid=' . (int)$pid . BackendUtility::deleteClause($tN), '', $GLOBALS['TCA'][$tN]['ctrl']['sortby'] ? $GLOBALS['TCA'][$tN]['ctrl']['sortby'] : '');
414 if ($GLOBALS['TYPO3_DB']->sql_num_rows($mres)) {
415 $content .= '
416 <tr>
417 <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>
418 </tr>';
419 while ($subrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($mres)) {
420 $ownVer = $this->lookForOwnVersions($tN, $subrow['uid']);
421 $content .= '
422 <tr>
423 <td>' . $this->adminLinks($tN, $subrow) . '</td>
424 <td>' . $subrow['uid'] . '</td>
425 ' . ($ownVer > 1 ? '<td style="font-weight: bold; background-color: yellow;"><a href="' .
426 htmlspecialchars(BackendUtility::getModuleUrl('web_txversionM1', array('table' => $tN, 'uid' => $subrow['uid']))) .
427 '">' . ($ownVer - 1) . '</a></td>' : '<td></td>') . '
428 <td width="98%">' . BackendUtility::getRecordTitle($tN, $subrow, TRUE) . '</td>
429 </tr>';
430 if ($tN == 'pages' && $c < 100) {
431 $sub = $this->pageSubContent($subrow['uid'], $c + 1);
432 if ($sub) {
433 $content .= '
434 <tr>
435 <td></td>
436 <td></td>
437 <td></td>
438 <td width="98%">' . $sub . '</td>
439 </tr>';
440 }
441 }
442 }
443 }
444 $GLOBALS['TYPO3_DB']->sql_free_result($mres);
445 }
446 return $content ? '<table border="1" cellpadding="1" cellspacing="0" width="100%">' . $content . '</table>' : '';
447 }
448
449 /**
450 * Look for number of versions of a record
451 *
452 * @param string $table Table name
453 * @param int $uid Record uid
454 * @return int Number of versions for record, FALSE if none.
455 */
456 public function lookForOwnVersions($table, $uid) {
457 $versions = BackendUtility::selectVersionsOfRecord($table, $uid, 'uid');
458 if (is_array($versions)) {
459 return count($versions);
460 }
461 return FALSE;
462 }
463
464 /**
465 * Administrative links for a table / record
466 *
467 * @param string $table Table name
468 * @param array $row Record for which administrative links are generated.
469 * @return string HTML link tags.
470 */
471 public function adminLinks($table, $row) {
472 // Edit link:
473 $adminLink = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick('&edit[' . $table . '][' . $row['uid'] . ']=edit')) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.edit', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-open') . '</a>';
474 // Delete link:
475 $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>';
476 if ($table === 'pages') {
477 // If another page module was specified, replace the default Page module with the new one
478 $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
479 $pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
480 // Perform some acccess checks:
481 $a_wl = $GLOBALS['BE_USER']->check('modules', 'web_list');
482 $a_wp = $GLOBALS['BE_USER']->check('modules', $pageModule);
483 $adminLink .= '<a href="#" onclick="top.loadEditId(' . $row['uid'] . ');top.goToModule(\'' . $pageModule . '\'); return false;">' . IconUtility::getSpriteIcon('actions-page-open') . '</a>';
484 $adminLink .= '<a href="#" onclick="top.loadEditId(' . $row['uid'] . ');top.goToModule(\'web_list\'); return false;">' . IconUtility::getSpriteIcon('actions-system-list-open') . '</a>';
485 // "View page" icon is added:
486 $adminLink .= '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($row['uid'], $this->doc->backPath, BackendUtility::BEgetRootLine($row['uid']))) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
487 } else {
488 if ($row['pid'] == -1) {
489 $getVars = '&ADMCMD_vPrev[' . rawurlencode(($table . ':' . $row['t3ver_oid'])) . ']=' . $row['uid'];
490 // "View page" icon is added:
491 $adminLink .= '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($row['_REAL_PID'], $this->doc->backPath, BackendUtility::BEgetRootLine($row['_REAL_PID']), '', '', $getVars)) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
492 }
493 }
494 return $adminLink;
495 }
496
497 }