* @return array Modified menuItems array
*/
function main(&$backRef,$menuItems,$table,$uid) {
- global $BE_USER,$TCA,$LANG;
-
$localItems = Array();
- if (!$backRef->cmLevel && $uid>0 && $BE_USER->check('modules','web_txversionM1')) {
+ if (!$backRef->cmLevel && $uid > 0 && $GLOBALS['BE_USER']->check('modules', 'web_txversionM1')) {
// Returns directly, because the clicked item was not from the pages table
- if (in_array('versioning', $backRef->disabledItems) || !$TCA[$table] || !$TCA[$table]['ctrl']['versioningWS']) {
+ if (in_array('versioning', $backRef->disabledItems) || !$GLOBALS['TCA'][$table] || !$GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
return $menuItems;
}
* @return array Local lang array
*/
function includeLL() {
- global $LANG;
-
- return $LANG->includeLLFile('EXT:version/locallang.xml',FALSE);
+ return $GLOBALS['LANG']->includeLLFile('EXT:version/locallang.xml',FALSE);
}
}
* @param $table the table
*/
public function moveRecord($table, $uid, $destPid, array $propArr, array $moveRec, $resolvedPid, &$recordWasMoved, t3lib_TCEmain $tcemainObj) {
- global $TCA;
// Only do something in Draft workspace
if ($tcemainObj->BE_USER->workspace !== 0) {
$WSversion = t3lib_BEfunc::getWorkspaceVersionOfRecord($tcemainObj->BE_USER->workspace, $table, $uid, 'uid,t3ver_oid');
// If no version exists and versioningWS is in version 2, a new placeholder is made automatically:
- if (!$WSversion['uid'] && (int)$TCA[$table]['ctrl']['versioningWS']>=2 && (int)$moveRec['t3ver_state']!=3) {
+ if (!$WSversion['uid'] && (int)$GLOBALS['TCA'][$table]['ctrl']['versioningWS'] >= 2 && (int)$moveRec['t3ver_state'] != 3) {
$tcemainObj->versionizeRecord($table, $uid, 'Placeholder version for moving record');
$WSversion = t3lib_BEfunc::getWorkspaceVersionOfRecord($tcemainObj->BE_USER->workspace, $table, $uid, 'uid,t3ver_oid'); // Will not create new versions in live workspace though...
}
$recIsNewVersion = (int)$moveRec['t3ver_state']>0;
$destRes = $tcemainObj->BE_USER->workspaceAllowLiveRecordsInPID($resolvedPid, $table);
- $canMoveRecord = $recIsNewVersion || (int)$TCA[$table]['ctrl']['versioningWS'] >= 2;
+ $canMoveRecord = $recIsNewVersion || (int)$GLOBALS['TCA'][$table]['ctrl']['versioningWS'] >= 2;
// Workspace source check:
if (!$recIsNewVersion) {
if (!count($workspaceAccessBlocked)) {
// If the move operation is done on a versioned record, which is
// NOT new/deleted placeholder and versioningWS is in version 2, then...
- if ($WSversion['uid'] && !$recIsNewVersion && (int)$TCA[$table]['ctrl']['versioningWS'] >= 2) {
+ if ($WSversion['uid'] && !$recIsNewVersion && (int)$GLOBALS['TCA'][$table]['ctrl']['versioningWS'] >= 2) {
$this->moveRecord_wsPlaceholders($table, $uid, $destPid, $WSversion['uid'], $tcemainObj);
} else {
// moving not needed, just behave like in live workspace
* @see copyPages()
*/
protected function versionizePages($uid, $label, $versionizeTree, t3lib_TCEmain $tcemainObj) {
- global $TCA;
-
$uid = intval($uid);
// returns the branch
$brExist = $tcemainObj->doesBranchExist('', $uid, $tcemainObj->pMap['show'], 1);
// Make list of tables that should come along with a new version of the page:
$verTablesArray = array();
- $allTables = array_keys($TCA);
+ $allTables = array_keys($GLOBALS['TCA']);
foreach ($allTables as $tableName) {
- if ($tableName != 'pages' && ($versionizeTree > 0 || $TCA[$tableName]['ctrl']['versioning_followPages'])) {
+ if ($tableName != 'pages' && ($versionizeTree > 0 || $GLOBALS['TCA'][$tableName]['ctrl']['versioning_followPages'])) {
$verTablesArray[] = $tableName;
}
}
* @return void
*/
protected function version_swap($table, $id, $swapWith, $swapIntoWS=0, t3lib_TCEmain $tcemainObj) {
- global $TCA;
// First, check if we may actually edit the online record
if ($tcemainObj->checkRecordUpdateAccess($table, $id)) {
// Find fields to keep
$keepFields = $tcemainObj->getUniqueFields($table);
- if ($TCA[$table]['ctrl']['sortby']) {
- $keepFields[] = $TCA[$table]['ctrl']['sortby'];
+ if ($GLOBALS['TCA'][$table]['ctrl']['sortby']) {
+ $keepFields[] = $GLOBALS['TCA'][$table]['ctrl']['sortby'];
}
// l10n-fields must be kept otherwise the localization
// will be lost during the publishing
- if (!isset($TCA[$table]['ctrl']['transOrigPointerTable']) && $TCA[$table]['ctrl']['transOrigPointerField']) {
- $keepFields[] = $TCA[$table]['ctrl']['transOrigPointerField'];
+ if (!isset($GLOBALS['TCA'][$table]['ctrl']['transOrigPointerTable']) && $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']) {
+ $keepFields[] = $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'];
}
// Swap "keepfields"
}
// Moving element.
- if ((int)$TCA[$table]['ctrl']['versioningWS']>=2) { // && $t3ver_state['swapVersion']==4 // Maybe we don't need this?
- if ($plhRec = t3lib_BEfunc::getMovePlaceholder($table, $id, 't3ver_state,pid,uid' . ($TCA[$table]['ctrl']['sortby'] ? ',' . $TCA[$table]['ctrl']['sortby'] : ''))) {
+ if ((int)$GLOBALS['TCA'][$table]['ctrl']['versioningWS'] >= 2) {
+ // && $t3ver_state['swapVersion']==4 // Maybe we don't need this?
+ if ($plhRec = t3lib_BEfunc::getMovePlaceholder($table, $id, 't3ver_state,pid,uid' . ($GLOBALS['TCA'][$table]['ctrl']['sortby'] ? ',' . $GLOBALS['TCA'][$table]['ctrl']['sortby'] : ''))) {
$movePlhID = $plhRec['uid'];
$movePlh['pid'] = $swapVersion['pid'];
$swapVersion['pid'] = intval($plhRec['pid']);
$curVersion['t3ver_state'] = intval($swapVersion['t3ver_state']);
$swapVersion['t3ver_state'] = 0;
- if ($TCA[$table]['ctrl']['sortby']) {
+ if ($GLOBALS['TCA'][$table]['ctrl']['sortby']) {
// sortby is a "keepFields" which is why this will work...
- $movePlh[$TCA[$table]['ctrl']['sortby']] = $swapVersion[$TCA[$table]['ctrl']['sortby']];
- $swapVersion[$TCA[$table]['ctrl']['sortby']] = $plhRec[$TCA[$table]['ctrl']['sortby']];
+ $movePlh[$GLOBALS['TCA'][$table]['ctrl']['sortby']] = $swapVersion[$GLOBALS['TCA'][$table]['ctrl']['sortby']];
+ $swapVersion[$GLOBALS['TCA'][$table]['ctrl']['sortby']] = $plhRec[$GLOBALS['TCA'][$table]['ctrl']['sortby']];
}
}
}
if ($table=='pages' && $swapVersion['t3ver_swapmode'] >= 0) {
// Collect table names that should be copied along with the tables:
- foreach ($TCA as $tN => $tCfg) {
+ foreach ($GLOBALS['TCA'] as $tN => $tCfg) {
// For "Branch" publishing swap ALL,
// otherwise for "page" publishing, swap only "versioning_followPages" tables
- if ($swapVersion['t3ver_swapmode'] > 0 || $TCA[$tN]['ctrl']['versioning_followPages']) {
+ if ($swapVersion['t3ver_swapmode'] > 0 || $GLOBALS['TCA'][$tN]['ctrl']['versioning_followPages']) {
$temporaryPid = -($id+1000000);
$GLOBALS['TYPO3_DB']->exec_UPDATEquery($tN, 'pid=' . intval($id), array('pid' => $temporaryPid));
* @return void
*/
protected function version_clearWSID($table, $id, $flush = FALSE, t3lib_TCEmain $tcemainObj) {
- global $TCA;
-
if ($errorCode = $tcemainObj->BE_USER->workspaceCannotEditOfflineVersion($table, $id)) {
$tcemainObj->newlog('Attempt to reset workspace for record failed: ' . $errorCode, 1);
} elseif ($tcemainObj->checkRecordUpdateAccess($table, $id)) {
}
// Remove the move-placeholder if found for live record.
- if ((int)$TCA[$table]['ctrl']['versioningWS'] >= 2) {
+ if ((int)$GLOBALS['TCA'][$table]['ctrl']['versioningWS'] >= 2) {
if ($plhRec = t3lib_BEfunc::getMovePlaceholder($table, $liveRec['uid'], 'uid')) {
$tcemainObj->deleteEl($table, $plhRec['uid'], TRUE, TRUE);
}
* @see versionizePages()
*/
protected function rawCopyPageContent($oldPageId, $newPageId, array $copyTablesArray, t3lib_TCEmain $tcemainObj) {
- global $TCA;
-
if ($newPageId) {
foreach ($copyTablesArray as $table) {
// all records under the page is copied.
- if ($table && is_array($TCA[$table]) && $table != 'pages') {
+ if ($table && is_array($GLOBALS['TCA'][$table]) && $table !== 'pages') {
$mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid',
$table,
* @return array Element data. Key is table name, values are array with first element as online UID, second - offline UID
*/
public function findPageElementsForVersionSwap($table, $id, $offlineId) {
- global $TCA;
-
$rec = t3lib_BEfunc::getRecord($table, $offlineId, 't3ver_wsid');
$workspaceId = $rec['t3ver_wsid'];
}
// Traversing all tables supporting versioning:
- foreach ($TCA as $table => $cfg) {
- if ($TCA[$table]['ctrl']['versioningWS'] && $table != 'pages') {
+ foreach ($GLOBALS['TCA'] as $table => $cfg) {
+ if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] && $table !== 'pages') {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('A.uid AS offlineUid, B.uid AS uid',
$table . ' A,' . $table . ' B',
'A.pid=-1 AND B.pid=' . $pageId . ' AND A.t3ver_wsid=' . $workspaceId .
* @return void
*/
public function findPageElementsForVersionStageChange(array $pageIdList, $workspaceId, array &$elementList) {
- global $TCA;
-
if ($workspaceId != 0) {
// Traversing all tables supporting versioning:
- foreach ($TCA as $table => $cfg) {
- if ($TCA[$table]['ctrl']['versioningWS'] && $table != 'pages') {
+ foreach ($GLOBALS['TCA'] as $table => $cfg) {
+ if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] && $table !== 'pages') {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('DISTINCT A.uid',
$table . ' A,' . $table . ' B',
'A.pid=-1' . // Offline version
* @see moveRecord()
*/
protected function moveRecord_wsPlaceholders($table, $uid, $destPid, $wsUid, t3lib_TCEmain $tcemainObj) {
- global $TCA;
-
if ($plh = t3lib_BEfunc::getMovePlaceholder($table, $uid, 'uid')) {
// If already a placeholder exists, move it:
$tcemainObj->moveRecord_raw($table, $plh['uid'], $destPid);
// First, we create a placeholder record in the Live workspace that
// represents the position to where the record is eventually moved to.
$newVersion_placeholderFieldArray = array();
- if ($TCA[$table]['ctrl']['crdate']) {
- $newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['crdate']] = $GLOBALS['EXEC_TIME'];
+ if ($GLOBALS['TCA'][$table]['ctrl']['crdate']) {
+ $newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['crdate']] = $GLOBALS['EXEC_TIME'];
}
- if ($TCA[$table]['ctrl']['cruser_id']) {
- $newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['cruser_id']] = $tcemainObj->userid;
+ if ($GLOBALS['TCA'][$table]['ctrl']['cruser_id']) {
+ $newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['cruser_id']] = $tcemainObj->userid;
}
- if ($TCA[$table]['ctrl']['tstamp']) {
- $newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['tstamp']] = $GLOBALS['EXEC_TIME'];
+ if ($GLOBALS['TCA'][$table]['ctrl']['tstamp']) {
+ $newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['tstamp']] = $GLOBALS['EXEC_TIME'];
}
if ($table == 'pages') {
// Setting workspace - only so display of place holders can filter out those from other workspaces.
$newVersion_placeholderFieldArray['t3ver_wsid'] = $tcemainObj->BE_USER->workspace;
- $newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['label']] = '[MOVE-TO PLACEHOLDER for #' . $uid . ', WS#' . $tcemainObj->BE_USER->workspace . ']';
+ $newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['label']] = '[MOVE-TO PLACEHOLDER for #' . $uid . ', WS#' . $tcemainObj->BE_USER->workspace . ']';
// moving localized records requires to keep localization-settings for the placeholder too
if (array_key_exists('languageField', $GLOBALS['TCA'][$table]['ctrl']) && array_key_exists('transOrigPointerField', $GLOBALS['TCA'][$table]['ctrl'])) {
if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/version/class.tx_version_tcemain.php'])) {
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/version/class.tx_version_tcemain.php']);
}
-?>
\ No newline at end of file
+?>
require ('conf.php');
require ($BACK_PATH.'init.php');
require ($BACK_PATH.'template.php');
-$LANG->includeLLFile('EXT:version/locallang.xml');
+$GLOBALS['LANG']->includeLLFile('EXT:version/locallang.xml');
// DEFAULT initialization of a module [END]
require_once('../ws/class.wslib.php');
* @return void
*/
function main() {
- global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
-
// Template markers
$markers = array(
'CSH' => '',
// Draw the header.
$this->doc = t3lib_div::makeInstance('template');
- $this->doc->backPath = $BACK_PATH;
+ $this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/version.html');
- // Add styles
+ // Add styles
$this->doc->inDocStylesArray[$GLOBALS['MCONF']['name']] = '
.version-diff-1 { background-color: green; }
.version-diff-2 { background-color: red; }
$pidValue = $this->table==='pages' ? $this->uid : $record['pid'];
// Checking access etc.
- if ($this->recordFound && $TCA[$this->table]['ctrl']['versioningWS']) {
+ if ($this->recordFound && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS']) {
$this->doc->form='<form action="" method="post">';
$this->uid = $record['uid']; // Might have changed if new live record was found!
$this->pageinfo = t3lib_BEfunc::readPageAccess($pidValue,$this->perms_clause);
$access = is_array($this->pageinfo) ? 1 : 0;
- if (($pidValue && $access) || ($BE_USER->user['admin'] && !$pidValue)) {
+ if (($pidValue && $access) || ($GLOBALS['BE_USER']->user['admin'] && !$pidValue)) {
// JavaScript
$this->doc->JScode.= '
';
// If another page module was specified, replace the default Page module with the new one
- $newPageModule = trim($BE_USER->getTSConfigVal('options.overridePageModule'));
+ $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
$this->pageModule = t3lib_BEfunc::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
// Setting publish access permission for workspace:
- $this->publishAccess = $BE_USER->workspacePublishAccess($BE_USER->workspace);
+ $this->publishAccess = $GLOBALS['BE_USER']->workspacePublishAccess($GLOBALS['BE_USER']->workspace);
// Render content:
if ($this->id) {
$markers['CONTENT'] = $this->content;
} else {
// If no access or id value, create empty document
- $this->content = $this->doc->section($LANG->getLL('clickAPage_header'), $LANG->getLL('clickAPage_content'), 0, 1);
+ $this->content = $this->doc->section($GLOBALS['LANG']->getLL('clickAPage_header'), $GLOBALS['LANG']->getLL('clickAPage_content'), 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($LANG->getLL('title'));
+ $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
$this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
$this->content.= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
* @return array all available buttons as an assoc. array
*/
protected function getButtons() {
- global $TCA, $LANG, $BACK_PATH, $BE_USER;
-
$buttons = array(
'csh' => '',
'view' => '',
// CSH
//$buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_txversionM1', '', $GLOBALS['BACK_PATH']);
- if ($this->recordFound && $TCA[$this->table]['ctrl']['versioningWS']) {
+ if ($this->recordFound && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS']) {
// 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) . '">' .
+ $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>';
// Shortcut
- if ($BE_USER->mayMakeShortcut()) {
+ 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']);
}
* @return void
*/
function versioningMgm() {
- global $TCA;
// Diffing:
$diff_1 = t3lib_div::_POST('diff_1');
</tr>
';
foreach($diff_1_record as $fN => $fV) {
- if ($TCA[$this->table]['columns'][$fN] && $TCA[$this->table]['columns'][$fN]['config']['type']!='passthrough' && !t3lib_div::inList('t3ver_label',$fN)) {
+ if ($GLOBALS['TCA'][$this->table]['columns'][$fN] && $GLOBALS['TCA'][$this->table]['columns'][$fN]['config']['type'] !== 'passthrough'
+ && !t3lib_div::inList('t3ver_label', $fN)) {
+
if (strcmp($diff_1_record[$fN],$diff_2_record[$fN])) {
$diffres = $t3lib_diff_Obj->makeDiffDisplay(
* @return string Table with content if any
*/
function pageSubContent($pid,$c=0) {
- global $TCA;
-
- $tableNames = t3lib_div::removeArrayEntryByValue(array_keys($TCA),'pages');
+ $tableNames = t3lib_div::removeArrayEntryByValue(array_keys($GLOBALS['TCA']), 'pages');
$tableNames[] = 'pages';
foreach($tableNames as $tN) {
// Basically list ALL tables - not only those being copied might be found!
- #if ($TCA[$tN]['ctrl']['versioning_followPages'] || $tN=='pages') {
- $mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $tN, 'pid='.intval($pid).t3lib_BEfunc::deleteClause($tN), '', ($TCA[$tN]['ctrl']['sortby'] ? $TCA[$tN]['ctrl']['sortby'] : ''));
+ #if ($GLOBALS['TCA'][$tN]['ctrl']['versioning_followPages'] || $tN=='pages') {
+ $mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+ '*',
+ $tN,
+ 'pid=' . intval($pid) . t3lib_BEfunc::deleteClause($tN),
+ '',
+ ($GLOBALS['TCA'][$tN]['ctrl']['sortby'] ? $GLOBALS['TCA'][$tN]['ctrl']['sortby'] : '')
+ );
if ($GLOBALS['TYPO3_DB']->sql_num_rows($mres)) {
$content.='
<tr>
- <td colspan="4" class="'.($TCA[$tN]['ctrl']['versioning_followPages'] ? 'bgColor6' : ($tN=='pages' ? 'bgColor5' : 'bgColor-10')).'"'.(!$TCA[$tN]['ctrl']['versioning_followPages'] && $tN!='pages' ? ' style="color: #666666; font-style:italic;"':'').'>'.$tN.'</td>
+ <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>
</tr>';
while ($subrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($mres)) {
$ownVer = $this->lookForOwnVersions($tN,$subrow['uid']);
* @return integer Number of versions for record, FALSE if none.
*/
function lookForOwnVersions($table,$uid) {
- global $TCA;
-
$versions = t3lib_BEfunc::selectVersionsOfRecord($table, $uid, 'uid');
if (is_array($versions)) {
return count($versions);
* @return string HTML link tags.
*/
function adminLinks($table,$row) {
- global $BE_USER;
// Edit link:
$adminLink = '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick('&edit['.$table.']['.$row['uid'].']=edit',$this->doc->backPath)).'" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:cm.edit', TRUE) . '">'.
if ($table == 'pages') {
// If another page module was specified, replace the default Page module with the new one
- $newPageModule = trim($BE_USER->getTSConfigVal('options.overridePageModule'));
+ $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
$pageModule = t3lib_BEfunc::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
// Perform some acccess checks:
- $a_wl = $BE_USER->check('modules','web_list');
- $a_wp = t3lib_extMgm::isLoaded('cms') && $BE_USER->check('modules',$pageModule);
+ $a_wl = $GLOBALS['BE_USER']->check('modules', 'web_list');
+ $a_wp = t3lib_extMgm::isLoaded('cms') && $GLOBALS['BE_USER']->check('modules', $pageModule);
$adminLink.='<a href="#" onclick="top.loadEditId('.$row['uid'].');top.goToModule(\''.$pageModule.'\'); return false;">'.
t3lib_iconWorks::getSpriteIcon('actions-page-open') .
$actionLinks.= $this->displayWorkspaceOverview_allStageCmd();
if ($actionLinks || count($errors)) {
- $this->content .= $this->doc->section('', $actionLinks . (count($errors) ? '<h3>' . $GLOABLS['LANG']->getLL('errors') . '</h3><br />' . implode('<br />', $errors) . '<hr />' : ''), 0, 1);
+ $this->content .= $this->doc->section('', $actionLinks . (count($errors) ? '<h3>' . $GLOBALS['LANG']->getLL('errors') . '</h3><br />' . implode('<br />', $errors) . '<hr />' : ''), 0, 1);
}
if (t3lib_div::_POST('_previewLink')) {
* @return array Table rows, see displayWorkspaceOverview()
*/
function displayWorkspaceOverview_list($pArray) {
- global $TCA;
// If there ARE elements on this level, print them:
$warnAboutVersions_nonPages = FALSE;
// Online version display:
// Create the main cells which will span over the number of versions there is.
- $verLinkUrl = $TCA[$table]['ctrl']['versioningWS'];
+ $verLinkUrl = $GLOBALS['TCA'][$table]['ctrl']['versioningWS'];
$origElement = $icon.
($verLinkUrl ? '<a href="'.htmlspecialchars('index.php?table='.$table.'&uid='.$rec_on['uid']).'">' : '').
t3lib_BEfunc::getRecordTitle($table,$rec_on,TRUE).
* @return string HTML content.
*/
function subElements($uid,$treeLevel,$origId=0) {
- global $TCA;
-
- if (!$this->details && ($GLOBALS['BE_USER']->workspace===0 || !$this->MOD_SETTINGS['expandSubElements'])) { // In online workspace we have a reduced view because otherwise it will bloat the listing:
+ // In online workspace we have a reduced view because otherwise it will bloat the listing:
+ if (!$this->details && ($GLOBALS['BE_USER']->workspace === 0 || !$this->MOD_SETTINGS['expandSubElements'])) {
return '<br />
<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/ol/joinbottom.gif','width="18" height="16"').' align="top" alt="" title="" />'.
($origId ?
// Find records that follow pages when swapping versions:
$recList = array();
- foreach($TCA as $tN => $tCfg) {
- if ($tN!='pages' && ($treeLevel>0 || $TCA[$tN]['ctrl']['versioning_followPages'])) {
+ foreach ($GLOBALS['TCA'] as $tN => $tCfg) {
+ if ($tN !== 'pages' && ($treeLevel > 0 || $GLOBALS['TCA'][$tN]['ctrl']['versioning_followPages'])) {
$this->subElements_getNonPageRecords($tN, $uid, $recList);
}
}
// Find all records from page and collect in $recList:
$recList = array();
- foreach($TCA as $tN => $tCfg) {
+ foreach ($GLOBALS['TCA'] as $tN => $tCfg) {
if ($tN!=='pages') {
$this->subElements_getNonPageRecords($tN, $data['row']['uid'], $recList);
}
* @return void
*/
function subElements_getNonPageRecords($tN, $uid, &$recList) {
- global $TCA;
-
$records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'*',
$tN,
'pid='.intval($uid).
- ($TCA[$tN]['ctrl']['versioningWS'] ? ' AND t3ver_state=0' : '').
+ ($GLOBALS['TCA'][$tN]['ctrl']['versioningWS'] ? ' AND t3ver_state=0' : '') .
t3lib_BEfunc::deleteClause($tN),
'',
- $TCA[$tN]['ctrl']['sortby'] ? $TCA[$tN]['ctrl']['sortby'] : $GLOBALS['TYPO3_DB']->stripOrderBy($TCA[$tN]['ctrl']['default_sortby'])
+ $GLOBALS['TCA'][$tN]['ctrl']['sortby'] ? $GLOBALS['TCA'][$tN]['ctrl']['sortby'] : $GLOBALS['TYPO3_DB']->stripOrderBy($GLOBALS['TCA'][$tN]['ctrl']['default_sortby'])
);
foreach($records as $rec) {
* @return void (Content accumulated in $tCell!)
*/
function subElements_renderItem(&$tCell,$tN,$uid,$rec,$origId,$iconMode,$HTMLdata) {
- global $TCA;
// Initialize:
- $origUidFields = $TCA[$tN]['ctrl']['origUid'];
+ $origUidFields = $GLOBALS['TCA'][$tN]['ctrl']['origUid'];
$diffCode = '';
if ($origUidFields) { // If there is a field for this table with original uids we will use that to connect records:
* @return array Array with two keys (0/1) with HTML content / percentage integer (if -1, then it means N/A) indicating amount of change
*/
function createDiffView($table, $diff_1_record, $diff_2_record) {
- global $TCA;
// Initialize:
$pctChange = 'N/A';
// Traversing the first record and process all fields which are editable:
foreach($diff_1_record as $fN => $fV) {
- if ($TCA[$table]['columns'][$fN] && $TCA[$table]['columns'][$fN]['config']['type']!='passthrough' && !t3lib_div::inList('t3ver_label',$fN)) {
+ if ($GLOBALS['TCA'][$table]['columns'][$fN] && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['type'] !== 'passthrough'
+ && !t3lib_div::inList('t3ver_label', $fN)) {
// Check if it is files:
$isFiles = FALSE;
- if (strcmp(trim($diff_1_record[$fN]),trim($diff_2_record[$fN])) &&
- $TCA[$table]['columns'][$fN]['config']['type']=='group' &&
- $TCA[$table]['columns'][$fN]['config']['internal_type']=='file') {
+ if (strcmp(trim($diff_1_record[$fN]), trim($diff_2_record[$fN]))
+ && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['type'] === 'group'
+ && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['internal_type'] === 'file') {
// Initialize:
- $uploadFolder = $TCA[$table]['columns'][$fN]['config']['uploadfolder'];
+ $uploadFolder = $GLOBALS['TCA'][$table]['columns'][$fN]['config']['uploadfolder'];
$files1 = array_flip(t3lib_div::trimExplode(',', $diff_1_record[$fN],1));
$files2 = array_flip(t3lib_div::trimExplode(',', $diff_2_record[$fN],1));
$SOBE->main();
$SOBE->printContent();
-?>
\ No newline at end of file
+?>
* @return array Array of all records uids etc. First key is table name, second key incremental integer. Records are associative arrays with uid, t3ver_oid and t3ver_swapmode fields. The REAL pid of the online record is found as "realpid"
*/
function selectVersionsInWorkspace($wsid,$filter=0,$stage=-99,$pageId=-1) {
- global $TCA;
-
$wsid = intval($wsid);
$filter = intval($filter);
$output = array();
// Traversing all tables supporting versioning:
- foreach($TCA as $table => $cfg) {
- if ($TCA[$table]['ctrl']['versioningWS']) {
+ foreach ($GLOBALS['TCA'] as $table => $cfg) {
+ if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
// Select all records from this table in the database from the workspace
// This joins the online version with the offline version as tables A and B
* @return void
*/
function autoPublishWorkspaces() {
- global $TYPO3_CONF_VARS;
-
// Temporarily set admin rights
// FIXME: once workspaces are cleaned up a better solution should be implemented
$currentAdminStatus = $GLOBALS['BE_USER']->user['admin'];
if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/class.wslib.php'])) {
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/class.wslib.php']);
}
-?>
\ No newline at end of file
+?>
*/
require_once('class.wslib.php');
-$LANG->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
-$LANG->includeLLFile('EXT:lang/locallang_misc.xml');
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xml');
/**
* Library with Workspace GUI related functionality. It is used by main workspace
* @return string Generated HTML
*/
function getWorkspaceOverview(&$doc, $wsid = NULL, $filter = 0, $pageId = -1) {
- global $LANG;
-
// Setup
$this->workspaceId = (!is_null($wsid) ? $wsid : $GLOBALS['BE_USER']->workspace);
$this->showWorkspaceCol = $GLOBALS['BE_USER']->workspace == 0 && $this->workspaceId <= -98;
$tableRows = array();
$tableHeader = '
<tr class="t3-row-header">
- <td nowrap="nowrap" width="100">' . $LANG->getLL('label_pagetree') . '</td>
- <td nowrap="nowrap" colspan="2">' . $LANG->getLL('label_live_version') . '</td>
- <td nowrap="nowrap" colspan="2">' . $LANG->getLL('label_draft_versions') . '</td>
- <td nowrap="nowrap">' . $LANG->getLL('label_stage') . '</td>
- <td nowrap="nowrap">' . $LANG->getLL('label_publish') . '</td>
- <td><select name="_with_selected_do" onchange="if (confirm(\'' . $LANG->getLL('submit_apply_action_on_selected_elements') . '\')) {document.forms[0].submit();}">
- <option value="_">' . $LANG->getLL('label_doaction_default') . '</option>';
+ <td nowrap="nowrap" width="100">' . $GLOBALS['LANG']->getLL('label_pagetree') . '</td>
+ <td nowrap="nowrap" colspan="2">' . $GLOBALS['LANG']->getLL('label_live_version') . '</td>
+ <td nowrap="nowrap" colspan="2">' . $GLOBALS['LANG']->getLL('label_draft_versions') . '</td>
+ <td nowrap="nowrap">' . $GLOBALS['LANG']->getLL('label_stage') . '</td>
+ <td nowrap="nowrap">' . $GLOBALS['LANG']->getLL('label_publish') . '</td>
+ <td><select name="_with_selected_do" onchange="if (confirm(\'' . $GLOBALS['LANG']->getLL('submit_apply_action_on_selected_elements') . '\')) {document.forms[0].submit();}">
+ <option value="_">' . $GLOBALS['LANG']->getLL('label_doaction_default') . '</option>';
if ($this->publishAccess && !($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1)) {
- $tableHeader .= '<option value="publish">' . $LANG->getLL('label_doaction_publish') . '</option>';
+ $tableHeader .= '<option value="publish">' . $GLOBALS['LANG']->getLL('label_doaction_publish') . '</option>';
if ($GLOBALS['BE_USER']->workspaceSwapAccess()) {
- $tableHeader .= '<option value="swap">' . $LANG->getLL('label_doaction_swap') . '</option>';
+ $tableHeader .= '<option value="swap">' . $GLOBALS['LANG']->getLL('label_doaction_swap') . '</option>';
}
}
if ($GLOBALS['BE_USER']->workspace !== 0) {
- $tableHeader .= '<option value="release">' . $LANG->getLL('label_doaction_release') . '</option>';
+ $tableHeader .= '<option value="release">' . $GLOBALS['LANG']->getLL('label_doaction_release') . '</option>';
}
- $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('-1') ? '<option value="stage_-1">' . $LANG->getLL('label_doaction_stage_reject') . '</option>' : '';
- $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('0') ? '<option value="stage_0">' . $LANG->getLL('label_doaction_stage_editing') . '</option>' : '';
- $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('1') ? '<option value="stage_1">' . $LANG->getLL('label_doaction_stage_review') . '</option>' : '';
- $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('10') ? '<option value="stage_10">' . $LANG->getLL('label_doaction_stage_publish') . '</option>' : '';
+ $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('-1') ? '<option value="stage_-1">' . $GLOBALS['LANG']->getLL('label_doaction_stage_reject') . '</option>' : '';
+ $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('0') ? '<option value="stage_0">' . $GLOBALS['LANG']->getLL('label_doaction_stage_editing') . '</option>' : '';
+ $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('1') ? '<option value="stage_1">' . $GLOBALS['LANG']->getLL('label_doaction_stage_review') . '</option>' : '';
+ $tableHeader .= $GLOBALS['BE_USER']->workspaceCheckStageForCurrent('10') ? '<option value="stage_10">' . $GLOBALS['LANG']->getLL('label_doaction_stage_publish') . '</option>' : '';
- $tableHeader .= '<option value="flush">' . $LANG->getLL('label_doaction_flush') . '</option>
+ $tableHeader .= '<option value="flush">' . $GLOBALS['LANG']->getLL('label_doaction_flush') . '</option>
</select></td>
- <td>' . $LANG->getLL('label_lifecycle') . '</td>
- '.($this->showWorkspaceCol ? '<td>' . $LANG->getLL('label_workspace') . '</td>' : '').'
+ <td>' . $GLOBALS['LANG']->getLL('label_lifecycle') . '</td>
+ '.($this->showWorkspaceCol ? '<td>' . $GLOBALS['LANG']->getLL('label_workspace') . '</td>' : '').'
</tr>';
$tableRows[] = $tableHeader;
* @return array Table rows, see displayWorkspaceOverview()
*/
function displayWorkspaceOverview_list($pArray, $tableRows=array(), $c=0, $warnAboutVersions=FALSE) {
- global $TCA, $LANG;
-
// Initialize:
$fullColSpan = $this->showWorkspaceCol ? 10 : 9;
// MAIN CELL / Online version display:
// Create the main cells which will span over the number of versions there is. If the table is "pages" then it will show the page tree icon and title (which was not shown by the code above)
- $verLinkUrl = t3lib_extMgm::isLoaded('version') && $TCA[$table]['ctrl']['versioningWS'];
+ $verLinkUrl = t3lib_extMgm::isLoaded('version') && $GLOBALS['TCA'][$table]['ctrl']['versioningWS'];
$origElement = $icon.
($verLinkUrl ? '<a href="'.htmlspecialchars($this->doc->backPath.t3lib_extMgm::extRelPath('version').'cm1/index.php?table='.$table.'&uid='.$rec_on['uid']).'">' : '').
t3lib_BEfunc::getRecordTitle($table,$rec_on,TRUE).
$diffCode = '';
list($diffHTML,$diffPct) = $this->createDiffView($table, $rec_off, $rec_on);
if ($rec_on['t3ver_state']==1) { // New record:
- $diffCode.= $this->doc->icons(1) . $LANG->getLL('label_newrecord') . '<br />';
+ $diffCode.= $this->doc->icons(1) . $GLOBALS['LANG']->getLL('label_newrecord') . '<br />';
$diffCode.= $diffHTML;
} elseif ($rec_off['t3ver_state']==2) {
- $diffCode.= $this->doc->icons(2) . $LANG->getLL('label_deletedrecord') . '<br/>';
+ $diffCode.= $this->doc->icons(2) . $GLOBALS['LANG']->getLL('label_deletedrecord') . '<br/>';
} elseif ($rec_on['t3ver_state']==3) {
- $diffCode.= $this->doc->icons(1) . $LANG->getLL('label_moveto_placeholder') . '<br/>';
+ $diffCode.= $this->doc->icons(1) . $GLOBALS['LANG']->getLL('label_moveto_placeholder') . '<br/>';
} elseif ($rec_off['t3ver_state']==4) {
- $diffCode.= $this->doc->icons(1) . $LANG->getLL('label_moveto_pointer') . '<br/>';
+ $diffCode.= $this->doc->icons(1) . $GLOBALS['LANG']->getLL('label_moveto_pointer') . '<br/>';
} else {
- $diffCode .= ($diffPct < 0 ? $LANG->getLL('label_notapplicable') :
- ($diffPct ? sprintf($LANG->getLL('label_percentChange'), $diffPct) : ''));
+ $diffCode .= ($diffPct < 0 ? $GLOBALS['LANG']->getLL('label_notapplicable') :
+ ($diffPct ? sprintf($GLOBALS['LANG']->getLL('label_percentChange'), $diffPct) : ''));
$diffCode.= $diffHTML;
}
switch($vType) {
case 'element':
- $swapLabel = ' ['.$LANG->getLL('label_element').']';
+ $swapLabel = ' [' . $GLOBALS['LANG']->getLL('label_element') . ']';
$swapClass = 'ver-element'; // Do not translate!
$warnAboutVersions_nonPages = $warnAboutVersions_page; // Setting this if sub elements are found with a page+content (must be rendered prior to this of course!)
break;
case 'page':
- $swapLabel = ' ['.$LANG->getLL('label_page').']';
+ $swapLabel = ' [' . $GLOBALS['LANG']->getLL('label_page') . ']';
$swapClass = 'ver-page'; // Do not translate!
$warnAboutVersions_page = !$this->showWorkspaceCol; // This value is TRUE only if multiple workspaces are shown and we need the opposite here.
break;
case 'branch':
- $swapLabel = ' ['.$LANG->getLL('label_branch').']';
+ $swapLabel = ' [' . $GLOBALS['LANG']->getLL('label_branch') . ']';
$swapClass = 'ver-branch'; // Do not translate!
$warnAboutVersions_next = !$this->showWorkspaceCol; // This value is TRUE only if multiple workspaces are shown and we need the opposite here.
break;
// Create version element:
$versionsInOtherWS = $this->versionsInOtherWS($table, $rec_on['uid']);
- $versionsInOtherWSWarning = $versionsInOtherWS && $GLOBALS['BE_USER']->workspace !== 0 ? '<br />' . $this->doc->icons(2) . $LANG->getLL('label_otherversions') . ' ' . $versionsInOtherWS : '';
- $multipleWarning = (!$mainCell && $GLOBALS['BE_USER']->workspace !==0 ? '<br />' . $this->doc->icons(3) . '<strong>' . $LANG->getLL('label_multipleversions') . '</strong>' : '');
- $verWarning = $warnAboutVersions || ($warnAboutVersions_nonPages && $GLOBALS['TCA'][$table]['ctrl']['versioning_followPages']) ? '<br />' . $this->doc->icons(3) . '<strong>' . $LANG->getLL('label_nestedversions') . '</strong>' : '';
+ $versionsInOtherWSWarning = $versionsInOtherWS && $GLOBALS['BE_USER']->workspace !== 0 ? '<br />' . $this->doc->icons(2) . $GLOBALS['LANG']->getLL('label_otherversions') . ' ' . $versionsInOtherWS : '';
+ $multipleWarning = (!$mainCell && $GLOBALS['BE_USER']->workspace !==0 ? '<br />' . $this->doc->icons(3) . '<strong>' . $GLOBALS['LANG']->getLL('label_multipleversions') . '</strong>' : '');
+ $verWarning = $warnAboutVersions || ($warnAboutVersions_nonPages && $GLOBALS['TCA'][$table]['ctrl']['versioning_followPages']) ? '<br />' . $this->doc->icons(3) . '<strong>' . $GLOBALS['LANG']->getLL('label_nestedversions') . '</strong>' : '';
$verElement = $icon.
'<a href="'.htmlspecialchars($this->doc->backPath.t3lib_extMgm::extRelPath('version').'cm1/index.php?id='.($table==='pages'?$rec_on['uid']:$rec_on['pid']).'&details='.rawurlencode($table.':'.$rec_off['uid']).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'.
t3lib_BEfunc::getRecordTitle($table,$rec_off,TRUE).
* @return array Array with two keys (0/1) with HTML content / percentage integer (if -1, then it means N/A) indicating amount of change
*/
function createDiffView($table, $diff_1_record, $diff_2_record) {
- global $TCA, $LANG;
-
// Initialize:
$pctChange = 'N/A';
$tRows = array();
$tRows[] = '
<tr class="bgColor5 tableheader">
- <td>' . $LANG->getLL('diffview_label_field_name') . '</td>
- <td width="98%" nowrap="nowrap">' . $LANG->getLL('diffview_label_colored_diff_view') . '</td>
+ <td>' . $GLOBALS['LANG']->getLL('diffview_label_field_name') . '</td>
+ <td width="98%" nowrap="nowrap">' . $GLOBALS['LANG']->getLL('diffview_label_colored_diff_view') . '</td>
</tr>
';
// Traversing the first record and process all fields which are editable:
foreach($diff_1_record as $fN => $fV) {
- if ($TCA[$table]['columns'][$fN] && $TCA[$table]['columns'][$fN]['config']['type']!='passthrough' && !t3lib_div::inList('t3ver_label',$fN)) {
+ if ($GLOBALS['TCA'][$table]['columns'][$fN] && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['type'] !== 'passthrough'
+ && !t3lib_div::inList('t3ver_label', $fN)) {
// Check if it is files:
$isFiles = FALSE;
- if (strcmp(trim($diff_1_record[$fN]),trim($diff_2_record[$fN])) &&
- $TCA[$table]['columns'][$fN]['config']['type']=='group' &&
- $TCA[$table]['columns'][$fN]['config']['internal_type']=='file') {
+ if (strcmp(trim($diff_1_record[$fN]), trim($diff_2_record[$fN]))
+ && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['type'] === 'group'
+ && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['internal_type'] === 'file') {
// Initialize:
- $uploadFolder = $TCA[$table]['columns'][$fN]['config']['uploadfolder'];
+ $uploadFolder = $GLOBALS['TCA'][$table]['columns'][$fN]['config']['uploadfolder'];
$files1 = array_flip(t3lib_div::trimExplode(',', $diff_1_record[$fN],1));
$files2 = array_flip(t3lib_div::trimExplode(',', $diff_2_record[$fN],1));
$pctChange = $allStrLen ? ceil($diffStrLen*100/$allStrLen) : -1;
// Create visual representation of result:
- if (count($tRows)>1) {
- $content.= '<table border="0" cellpadding="1" cellspacing="1" class="diffTable">'.implode('',$tRows).'</table>';
+ if (count($tRows) > 1) {
+ $content .= '<table border="0" cellpadding="1" cellspacing="1" class="diffTable">' . implode('', $tRows) . '</table>';
} else {
- $content.= '<span class="nobr">'.$this->doc->icons(1).$LANG->getLL('diffview_complete_match').'</span>';
+ $content .= '<span class="nobr">' . $this->doc->icons(1) . $GLOBALS['LANG']->getLL('diffview_complete_match') . '</span>';
}
- } else $content.= $this->doc->icons(3).$LANG->getLL('diffview_cannot_find_records');
+ } else $content .= $this->doc->icons(3) . $GLOBALS['LANG']->getLL('diffview_cannot_find_records');
// Return value:
return array($content,$pctChange);
* @return string HTML code.
*/
function showStageChangeLog($table,$id,$stageCommands) {
- global $LANG;
-
$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'log_data,tstamp,userid',
'sys_log',
switch($data['stage']) {
case 1:
- $text = $LANG->getLL('stage_sent_to_review');
+ $text = $GLOBALS['LANG']->getLL('stage_sent_to_review');
break;
case 10:
- $text = $LANG->getLL('stage_approved_for_publish');
+ $text = $GLOBALS['LANG']->getLL('stage_approved_for_publish');
break;
case -1:
- $text = $LANG->getLL('stage_rejected');
+ $text = $GLOBALS['LANG']->getLL('stage_rejected');
break;
case 0:
- $text = $LANG->getLL('stage_reset_to_editing');
+ $text = $GLOBALS['LANG']->getLL('stage_reset_to_editing');
break;
default:
- $text = $LANG->getLL('stage_undefined');
+ $text = $GLOBALS['LANG']->getLL('stage_undefined');
break;
}
$text = t3lib_BEfunc::datetime($dat['tstamp']).': ' . sprintf($text, htmlspecialchars($username));
- $text.= ($data['comment'] ? '<br />' . $LANG->getLL('stage_label_user_comment') . ' <em>' . htmlspecialchars($data['comment']) . '</em>' : '');
+ $text.= ($data['comment'] ? '<br />' . $GLOBALS['LANG']->getLL('stage_label_user_comment') . ' <em>' . htmlspecialchars($data['comment']) . '</em>' : '');
$entry[] = $text;
}
* @return string HTML content, mainly link tags and images.
*/
function displayWorkspaceOverview_commandLinks($table,&$rec_on,&$rec_off,$vType) {
- global $LANG;
-
if ($this->publishAccess && (!($GLOBALS['BE_USER']->workspaceRec['publish_access']&1) || (int)$rec_off['t3ver_stage']===-10)) {
$actionLinks =
'<a href="'.htmlspecialchars($this->doc->issueCommand(
'&cmd['.$table.']['.$rec_on['uid'].'][version][action]=swap'.
'&cmd['.$table.']['.$rec_on['uid'].'][version][swapWith]='.$rec_off['uid']
- )).' " title="' . $LANG->getLL('img_title_publish') . '">'.
+ )).' " title="' . $GLOBALS['LANG']->getLL('img_title_publish') . '">'.
t3lib_iconWorks::getSpriteIcon('actions-version-workspace-sendtostage') .
'</a>';
if ($GLOBALS['BE_USER']->workspaceSwapAccess()) {
- $actionLinks.=
+ $actionLinks .=
'<a href="'.htmlspecialchars($this->doc->issueCommand(
- '&cmd['.$table.']['.$rec_on['uid'].'][version][action]=swap'.
- '&cmd['.$table.']['.$rec_on['uid'].'][version][swapWith]='.$rec_off['uid'].
- '&cmd['.$table.']['.$rec_on['uid'].'][version][swapIntoWS]=1'
- )).'" title="' . $LANG->getLL('img_title_swap') . '">'.
- t3lib_iconWorks::getSpriteIcon('actions-version-swap-workspace') .
- '</a>';
+ '&cmd[' . $table . '][' . $rec_on['uid'] . '][version][action]=swap'
+ . '&cmd[' . $table . '][' . $rec_on['uid'] . '][version][swapWith]=' . $rec_off['uid']
+ . '&cmd[' . $table . '][' . $rec_on['uid'] . '][version][swapIntoWS]=1'
+ )) . '" title="' . $GLOBALS['LANG']->getLL('img_title_swap') . '">'
+ . t3lib_iconWorks::getSpriteIcon('actions-version-swap-workspace')
+ . '</a>';
}
}
if (!$GLOBALS['BE_USER']->workspaceCannotEditOfflineVersion($table,$rec_off)) {
if ($GLOBALS['BE_USER']->workspace!==0) {
// Release
- $confirm = $LANG->JScharCode($LANG->getLL('remove_from_ws_confirmation'));
+ $confirm = $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('remove_from_ws_confirmation'));
$actionLinks.=
- '<a href="'.htmlspecialchars($this->doc->issueCommand('&cmd['.$table.']['.$rec_off['uid'].'][version][action]=clearWSID')).'" onclick="return confirm(' . $confirm . ');" title="' . $LANG->getLL('img_title_remove_from_ws') . '">'.
- t3lib_iconWorks::getSpriteIcon('actions-version-document-remove') .
- '</a>';
+ '<a href="'.htmlspecialchars($this->doc->issueCommand('&cmd['.$table.']['.$rec_off['uid'].'][version][action]=clearWSID')).'" onclick="return confirm(' . $confirm . ');" title="' . $GLOBALS['LANG']->getLL('img_title_remove_from_ws') . '">'
+ . t3lib_iconWorks::getSpriteIcon('actions-version-document-remove')
+ . '</a>';
}
// Edit
if ($table==='pages' && $vType!=='element') {
$tempUid = ($vType==='branch' || $GLOBALS['BE_USER']->workspace===0 ? $rec_off['uid'] : $rec_on['uid']);
$actionLinks.=
- '<a href="#" onclick="top.loadEditId('.$tempUid.');top.goToModule(\''.$this->pageModule.'\'); return false;" title="' . $LANG->getLL('img_title_edit_page') . '">'.
- t3lib_iconWorks::getSpriteIcon('actions-page-open') .
- '</a>';
+ '<a href="#" onclick="top.loadEditId(' . $tempUid . ');top.goToModule(\'' . $this->pageModule . '\'); return false;" title="' . $GLOBALS['LANG']->getLL('img_title_edit_page') . '">'
+ . t3lib_iconWorks::getSpriteIcon('actions-page-open')
+ . '</a>';
} else {
$params = '&edit['.$table.']['.$rec_off['uid'].']=edit';
$actionLinks.=
- '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->doc->backPath)).'" title="' . $LANG->getLL('img_title_edit_element') . '">'.
- t3lib_iconWorks::getSpriteIcon('actions-document-open') .
- '</a>';
+ '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $this->doc->backPath)) . '" title="' . $GLOBALS['LANG']->getLL('img_title_edit_element') . '">'
+ . t3lib_iconWorks::getSpriteIcon('actions-document-open')
+ . '</a>';
}
}
// History/Log
$actionLinks.=
- '<a href="'.htmlspecialchars($this->doc->backPath.'show_rechis.php?element='.rawurlencode($table.':'.$rec_off['uid']).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'" title="' . $LANG->getLL('img_title_show_log') . '">' .
- t3lib_iconWorks::getSpriteIcon('actions-document-history-open') .
- '</a>';
+ '<a href="' . htmlspecialchars($this->doc->backPath . 'show_rechis.php?element=' . rawurlencode($table . ':' . $rec_off['uid']) . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '" title="' . $GLOBALS['LANG']->getLL('img_title_show_log') . '">'
+ . t3lib_iconWorks::getSpriteIcon('actions-document-history-open')
+ . '</a>';
// View
if ($table==='pages') {
* @return string String translation of count.
*/
function formatCount($count) {
- global $LANG;
-
// Render, if not cached:
if (!isset($this->formatCount_cache[$count])) {
switch($count) {
case 0:
- $this->formatCount_cache[$count] = $LANG->getLL('workspace_list_publishing_count_draft');
+ $this->formatCount_cache[$count] = $GLOBALS['LANG']->getLL('workspace_list_publishing_count_draft');
break;
case 1:
- $this->formatCount_cache[$count] = $LANG->getLL('workspace_list_publishing_count_archive');
+ $this->formatCount_cache[$count] = $GLOBALS['LANG']->getLL('workspace_list_publishing_count_archive');
break;
default:
- $this->formatCount_cache[$count] = sprintf($LANG->getLL('workspace_list_publishing_count'), $count);
+ $this->formatCount_cache[$count] = sprintf($GLOBALS['LANG']->getLL('workspace_list_publishing_count'), $count);
break;
}
}
* @return string HTML content.
*/
function subElements($uid,$treeLevel,$origId=0) {
- global $TCA, $LANG;
-
if ($GLOBALS['BE_USER']->workspace===0 || !$this->expandSubElements) { // In online workspace we have a reduced view because otherwise it will bloat the listing:
return '<br />
<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/ol/joinbottom.gif','width="18" height="16"').' align="top" alt="" title="" />'.
($origId ?
'<a href="'.htmlspecialchars($this->doc->backPath.t3lib_extMgm::extRelPath('version').'cm1/index.php?id='.$uid.'&details='.rawurlencode('pages:'.$uid).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'.
- '<span class="typo3-dimmed"><em>['.$LANG->getLL('label_subelementsdetails').']</em><span></a>' :
- '<span class="typo3-dimmed"><em>['.$LANG->getLL('label_subelements').']</em><span>');
+ '<span class="typo3-dimmed"><em>[' . $GLOBALS['LANG']->getLL('label_subelementsdetails') . ']</em><span></a>' :
+ '<span class="typo3-dimmed"><em>[' . $GLOBALS['LANG']->getLL('label_subelements') . ']</em><span>');
} else { // For an offline workspace, show sub elements:
$tCell = array();
// Find records that follow pages when swapping versions:
$recList = array();
- foreach($TCA as $tN => $tCfg) {
- if ($tN!='pages' && ($treeLevel>0 || $TCA[$tN]['ctrl']['versioning_followPages'])) {
+ foreach($GLOBALS['TCA'] as $tN => $tCfg) {
+ if ($tN !== 'pages' && ($treeLevel > 0 || $GLOBALS['TCA'][$tN]['ctrl']['versioning_followPages'])) {
$this->subElements_getNonPageRecords($tN, $uid, $recList);
}
}
if ($treeLevel>0) {
// Drawing tree:
+ /** @var $tree t3lib_pageTree */
$tree = t3lib_div::makeInstance('t3lib_pageTree');
$tree->init('AND '.$GLOBALS['BE_USER']->getPagePermsClause(1));
$tree->makeHTML = 2; // 2=Also rendering depth-data into the result array
// Find all records from page and collect in $recList:
$recList = array();
- foreach($TCA as $tN => $tCfg) {
+ foreach ($GLOBALS['TCA'] as $tN => $tCfg) {
if ($tN!=='pages') {
$this->subElements_getNonPageRecords($tN, $data['row']['uid'], $recList);
}
* @return void
*/
function subElements_getNonPageRecords($tN, $uid, &$recList) {
- global $TCA;
-
$records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'*',
$tN,
'pid='.intval($uid).
- ($TCA[$tN]['ctrl']['versioningWS'] ? ' AND t3ver_state=0' : '').
+ ($GLOBALS['TCA'][$tN]['ctrl']['versioningWS'] ? ' AND t3ver_state=0' : '') .
t3lib_BEfunc::deleteClause($tN),
'',
- $TCA[$tN]['ctrl']['sortby'] ? $TCA[$tN]['ctrl']['sortby'] : $GLOBALS['TYPO3_DB']->stripOrderBy($TCA[$tN]['ctrl']['default_sortby'])
+ $GLOBALS['TCA'][$tN]['ctrl']['sortby'] ? $GLOBALS['TCA'][$tN]['ctrl']['sortby'] : $GLOBALS['TYPO3_DB']->stripOrderBy($GLOBALS['TCA'][$tN]['ctrl']['default_sortby'])
);
foreach($records as $rec) {
* @return void (Content accumulated in $tCell!)
*/
function subElements_renderItem(&$tCell,$tN,$uid,$rec,$origId,$iconMode,$HTMLdata) {
- global $TCA;
// Initialize:
- $origUidFields = $TCA[$tN]['ctrl']['origUid'];
+ $origUidFields = $GLOBALS['TCA'][$tN]['ctrl']['origUid'];
$diffCode = '';
if ($origUidFields) { // If there is a field for this table with original uids we will use that to connect records:
* @return string HTML content, mainly link tags and images.
*/
function displayWorkspaceOverview_commandLinksSub($table,$rec,$origId) {
- global $LANG;
-
$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="' . $LANG->getLL('img_title_edit_page') . '">'.
- t3lib_iconWorks::getSpriteIcon('actions-page-open') .
- '</a>';
+ $actionLinks .=
+ '<a href="#" onclick="top.loadEditId(' . $uid . ');top.goToModule(\'' . $this->pageModule . '\'); return false;" title="' . $GLOBALS['LANG']->getLL('img_title_edit_page') . '">'
+ . t3lib_iconWorks::getSpriteIcon('actions-page-open')
+ . '</a>';
} else {
$params = '&edit['.$table.']['.$uid.']=edit';
- $actionLinks.=
- '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->doc->backPath)).'" title="' . $LANG->getLL('img_title_edit_element') . '">'.
- t3lib_iconWorks::getSpriteIcon('actions-document-open') .
- '</a>';
+ $actionLinks .=
+ '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $this->doc->backPath)) . '" title="' . $GLOBALS['LANG']->getLL('img_title_edit_element') . '">'
+ . 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(t3lib_div::getIndpEnv('REQUEST_URI'))).'" title="' . $LANG->getLL('img_title_show_log') . '">'.
- t3lib_iconWorks::getSpriteIcon('actions-document-history-open') .
- '</a>';
+ '<a href="' . htmlspecialchars($this->doc->backPath . 'show_rechis.php?element=' . rawurlencode($table . ':' . $uid) . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '" title="' . $GLOBALS['LANG']->getLL('img_title_show_log') . '">'
+ . t3lib_iconWorks::getSpriteIcon('actions-document-history-open')
+ . '</a>';
}
// View
* @return string HTML content, mainly link tags and images.
*/
function displayWorkspaceOverview_stageCmd($table,&$rec_off) {
- global $LANG;
-
switch((int)$rec_off['t3ver_stage']) {
case 0:
$sId = 1;
- $sLabel = $LANG->getLL('stage_editing');
+ $sLabel = $GLOBALS['LANG']->getLL('stage_editing');
$color = '#666666'; // TODO Use CSS?
- $label = $LANG->getLL('label_commentforreviewer');
- $titleAttrib = $LANG->getLL('label_sendtoreview');
+ $label = $GLOBALS['LANG']->getLL('label_commentforreviewer');
+ $titleAttrib = $GLOBALS['LANG']->getLL('label_sendtoreview');
break;
case 1:
$sId = 10;
- $sLabel = $LANG->getLL('label_review');
+ $sLabel = $GLOBALS['LANG']->getLL('label_review');
$color = '#6666cc'; // TODO Use CSS?
- $label = $LANG->getLL('label_commentforpublisher');
- $titleAttrib = $LANG->getLL('label_approveforpublishing');
+ $label = $GLOBALS['LANG']->getLL('label_commentforpublisher');
+ $titleAttrib = $GLOBALS['LANG']->getLL('label_approveforpublishing');
break;
case 10:
- $sLabel = $LANG->getLL('label_publish');
+ $sLabel = $GLOBALS['LANG']->getLL('label_publish');
$color = '#66cc66'; // TODO Use CSS?
break;
case -1:
- $sLabel = $this->doc->icons(2).$LANG->getLL('label_rejected');
+ $sLabel = $this->doc->icons(2) . $GLOBALS['LANG']->getLL('label_rejected');
$sId = 0;
$color = '#ff0000'; // TODO Use CSS?
- $label = $LANG->getLL('stage_label_user_comment');
- $titleAttrib = $LANG->getLL('label_resetstage');
+ $label = $GLOBALS['LANG']->getLL('stage_label_user_comment');
+ $titleAttrib = $GLOBALS['LANG']->getLL('label_resetstage');
break;
default:
- $sLabel = $LANG->getLL('label_undefined');
+ $sLabel = $GLOBALS['LANG']->getLL('label_undefined');
$sId = 0;
$color = '';
break;
$raiseOk = !$GLOBALS['BE_USER']->workspaceCannotEditOfflineVersion($table,$rec_off);
if ($raiseOk && $rec_off['t3ver_stage'] != -1 && $GLOBALS['BE_USER']->workspaceCheckStageForCurrent($sId)) {
- $onClick = 'var commentTxt=window.prompt("'.$LANG->getLL('explain_reject').'","");
- if (commentTxt!=null) {window.location.href="'.$this->doc->issueCommand(
- '&cmd['.$table.']['.$rec_off['uid'].'][version][action]=setStage'.
- '&cmd['.$table.']['.$rec_off['uid'].'][version][stageId]=-1'
- ).'&cmd['.$table.']['.$rec_off['uid'].'][version][comment]="+escape(commentTxt);}'.
- ' return false;';
+ $onClick = 'var commentTxt=window.prompt("' . $GLOBALS['LANG']->getLL('explain_reject') . '","");
+ if (commentTxt!=null) {window.location.href="'
+ . $this->doc->issueCommand(
+ '&cmd[' . $table . '][' . $rec_off['uid'] . '][version][action]=setStage'
+ . '&cmd[' . $table . '][' . $rec_off['uid'] . '][version][stageId]=-1'
+ ).'&cmd[' . $table . '][' . $rec_off['uid'] . '][version][comment]="+escape(commentTxt);}'
+ . ' return false;';
// Reject:
$actionLinks.=
- '<a href="#" onclick="'.htmlspecialchars($onClick).'"title="'.$LANG->getLL('label_reject').'"> '.
- t3lib_iconWorks::getSpriteIcon('actions-move-down') .
- '</a>';
+ '<a href="#" onclick="' . htmlspecialchars($onClick) . '"title="' . $GLOBALS['LANG']->getLL('label_reject') . '"> '
+ . t3lib_iconWorks::getSpriteIcon('actions-move-down')
+ . '</a>';
} else {
// Reject:
$actionLinks.=
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/mod/user/ws/class.wslib_gui.php']);
}
-?>
\ No newline at end of file
+?>
// Initialize module:
unset($MCONF);
require ('conf.php');
-require ($BACK_PATH.'init.php');
-require ($BACK_PATH.'template.php');
-$BE_USER->modAccess($MCONF,1);
+require ($GLOBALS['BACK_PATH'].'init.php');
+require ($GLOBALS['BACK_PATH'].'template.php');
+$GLOBALS['BE_USER']->modAccess($MCONF,1);
// Include libraries of various kinds used inside:
-$LANG->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
-$LANG->includeLLFile('EXT:lang/locallang_misc.xml');
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xml');
require_once('class.wslib.php');
require_once('class.wslib_gui.php');
* @return void
*/
function menuConfig() {
- global $LANG;
-
// fetches the configuration of the version extension
$versionExtconf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['version']);
// show draft workspace only if enabled in the version extensions config
// Menu items:
$this->MOD_MENU = array(
'function' => array(
- 'publish' => $LANG->getLL('menuitem_review'),
- 'workspaces' => $LANG->getLL('menuitem_workspaces'),
+ 'publish' => $GLOBALS['LANG']->getLL('menuitem_review'),
+ 'workspaces' => $GLOBALS['LANG']->getLL('menuitem_workspaces'),
),
'filter' => array(
- 1 => $LANG->getLL('filter_drafts'),
- 2 => $LANG->getLL('filter_archive'),
- 0 => $LANG->getLL('filter_all'),
+ 1 => $GLOBALS['LANG']->getLL('filter_drafts'),
+ 2 => $GLOBALS['LANG']->getLL('filter_archive'),
+ 0 => $GLOBALS['LANG']->getLL('filter_all'),
),
'display' => array(
- 0 => '['.$LANG->getLL('shortcut_onlineWS').']',
- -98 => $LANG->getLL('label_offlineWSes'),
- -99 => $LANG->getLL('label_allWSes')
+ 0 => '[' . $GLOBALS['LANG']->getLL('shortcut_onlineWS') . ']',
+ -98 => $GLOBALS['LANG']->getLL('label_offlineWSes'),
+ -99 => $GLOBALS['LANG']->getLL('label_allWSes')
),
'diff' => array(
- 0 => $LANG->getLL('diff_no_diff'),
- 1 => $LANG->getLL('diff_show_inline'),
- 2 => $LANG->getLL('diff_show_popup'),
+ 0 => $GLOBALS['LANG']->getLL('diff_no_diff'),
+ 1 => $GLOBALS['LANG']->getLL('diff_show_inline'),
+ 2 => $GLOBALS['LANG']->getLL('diff_show_popup'),
),
'expandSubElements' => '',
);
// check if draft workspace was enabled, and if the user has access to it
if ($this->showDraftWorkspace === TRUE && $GLOBALS['BE_USER']->checkWorkspace(array('uid' => -1))) {
- $this->MOD_MENU['display'][-1] = '[' . $LANG->getLL('shortcut_offlineWS') . ']';
+ $this->MOD_MENU['display'][-1] = '[' . $GLOBALS['LANG']->getLL('shortcut_offlineWS') . ']';
}
// Add workspaces:
* @return void
*/
function init() {
- global $BACK_PATH, $BE_USER;
// Setting module configuration:
$this->MCONF = $GLOBALS['MCONF'];
// Initialize Document Template object:
$this->doc = t3lib_div::makeInstance('template');
- $this->doc->backPath = $BACK_PATH;
+ $this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/ws.html');
// JavaScript
$this->doc->getContextMenuCode();
// Setting publish access permission for workspace:
- $this->publishAccess = $BE_USER->workspacePublishAccess($BE_USER->workspace);
+ $this->publishAccess = $GLOBALS['BE_USER']->workspacePublishAccess($GLOBALS['BE_USER']->workspace);
// Parent initialization:
parent::init();
* @return void
*/
function main() {
- global $LANG, $BE_USER, $BACK_PATH;
-
// See if we need to switch workspace
$changeWorkspace = t3lib_div::_GET('changeWorkspace');
if ($changeWorkspace != '') {
- $BE_USER->setWorkspace($changeWorkspace);
- $this->content .= $this->doc->wrapScriptTags('top.location.href="' . $BACK_PATH . t3lib_BEfunc::getBackendScript() . '";');
+ $GLOBALS['BE_USER']->setWorkspace($changeWorkspace);
+ $this->content .= $this->doc->wrapScriptTags('top.location.href="' . $GLOBALS['BACK_PATH'] . t3lib_BEfunc::getBackendScript() . '";');
} else {
// Starting page:
- $this->content.=$this->doc->header($LANG->getLL('title'));
+ $this->content.=$this->doc->header($GLOBALS['LANG']->getLL('title'));
$this->content.=$this->doc->spacer(5);
// Get usernames and groupnames
// Build top menu:
$menuItems = array();
$menuItems[] = array(
- 'label' => $LANG->getLL('menuitem_review'),
+ 'label' => $GLOBALS['LANG']->getLL('menuitem_review'),
'content' => $this->moduleContent_publish()
);
$menuItems[] = array(
- 'label' => $LANG->getLL('menuitem_workspaces'),
+ 'label' => $GLOBALS['LANG']->getLL('menuitem_workspaces'),
'content' => $this->moduleContent_workspaceList()
);
$markers['CONTENT'] = $this->content;
// Build the <body> for the module
- $this->content = $this->doc->startPage($LANG->getLL('title'));
+ $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
$this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
$this->content.= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
* @return array all available buttons as an assoc. array
*/
protected function getButtons() {
- global $LANG, $BACK_PATH;
-
$buttons = array(
'new_record' => '',
);
// workspace creation link
if ($GLOBALS['BE_USER']->isAdmin() || 0 != ($GLOBALS['BE_USER']->groupData['workspace_perms'] & 4)) {
$buttons['new_record'] = '<a href="' . $newWkspUrl . '">' .
- '<img ' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/add_workspaces.gif') . ' alt="' . $LANG->getLL('img_title_create_new_workspace') . '" id="ver-wl-new-workspace-icon" />' .
+ '<img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/add_workspaces.gif') . ' alt="' . $GLOBALS['LANG']->getLL('img_title_create_new_workspace') . '" id="ver-wl-new-workspace-icon" />' .
'</a>';
}
return $buttons;
* @return string HTML content
*/
function moduleContent_publish() {
- global $LANG;
-
// Initialize:
$content = '';
$details = t3lib_div::_GP('details');
}
$menu.= t3lib_BEfunc::getFuncMenu(0,'SET[diff]',$this->MOD_SETTINGS['diff'],$this->MOD_MENU['diff']);
if ($GLOBALS['BE_USER']->workspace!==0) {
- $menu.= t3lib_BEfunc::getFuncCheck(0,'SET[expandSubElements]',$this->MOD_SETTINGS['expandSubElements'],'','','id="checkExpandSubElements"').' <label for="checkExpandSubElements">'.$LANG->getLL('label_showsubelements').'</label> ';
+ $menu .= t3lib_BEfunc::getFuncCheck(0, 'SET[expandSubElements]', $this->MOD_SETTINGS['expandSubElements'], '', '', 'id="checkExpandSubElements"') . ' <label for="checkExpandSubElements">' . $GLOBALS['LANG']->getLL('label_showsubelements') . '</label> ';
}
// Create header:
$description = '';
switch($GLOBALS['BE_USER']->workspace) {
case 0:
- $title = t3lib_iconWorks::getIconImage('sys_workspace', array(), $this->doc->backPath, ' align="top"').'['.$LANG->getLL('shortcut_onlineWS').']';
- $description = $LANG->getLL('workspace_description_live');
+ $title = t3lib_iconWorks::getIconImage('sys_workspace', array(), $this->doc->backPath, ' align="top"') . '[' . $GLOBALS['LANG']->getLL('shortcut_onlineWS') . ']';
+ $description = $GLOBALS['LANG']->getLL('workspace_description_live');
break;
case -1:
- $title = t3lib_iconWorks::getIconImage('sys_workspace', array(), $this->doc->backPath, ' align="top"').'['.$LANG->getLL('shortcut_offlineWS').']';
- $description = $LANG->getLL('workspace_description_draft');
+ $title = t3lib_iconWorks::getIconImage('sys_workspace', array(), $this->doc->backPath, ' align="top"') . '[' . $GLOBALS['LANG']->getLL('shortcut_offlineWS') . ']';
+ $description = $GLOBALS['LANG']->getLL('workspace_description_draft');
break;
case -99:
- $title = $this->doc->icons(3).'[' . $LANG->getLL('shortcut_noWSfound') . ']';
- $description = $LANG->getLL('workspace_description_no_access');
+ $title = $this->doc->icons(3) . '[' . $GLOBALS['LANG']->getLL('shortcut_noWSfound') . ']';
+ $description = $GLOBALS['LANG']->getLL('workspace_description_no_access');
break;
default:
$title = t3lib_iconWorks::getIconImage('sys_workspace', $GLOBALS['BE_USER']->workspaceRec, $this->doc->backPath, ' align="top"').
$actionLinks = '';
if ($GLOBALS['BE_USER']->workspace!==0) {
if ($this->publishAccess) {
- $confirmation = $LANG->JScharCode($LANG->getLL(($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1) ? 'submit_publish_workspace_confirmation_1' : 'submit_publish_workspace_confirmation_2'));
- $actionLinks.= '<input type="submit" name="_publish" value="' . $LANG->getLL('submit_publish_workspace') . '" onclick="if (confirm(' . $confirmation . ')) window.location.href=\'publish.php?swap=0\';return false"/>';
+ $confirmation = $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL(($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1) ? 'submit_publish_workspace_confirmation_1' : 'submit_publish_workspace_confirmation_2'));
+ $actionLinks.= '<input type="submit" name="_publish" value="' . $GLOBALS['LANG']->getLL('submit_publish_workspace') . '" onclick="if (confirm(' . $confirmation . ')) window.location.href=\'publish.php?swap=0\';return false"/>';
if ($GLOBALS['BE_USER']->workspaceSwapAccess()) {
- $confirmation = $LANG->JScharCode($LANG->getLL(($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1) ? 'submit_swap_workspace_confirmation_1' : 'submit_swap_workspace_confirmation_2'));
- $actionLinks.= '<input type="submit" name="_swap" value="' . $LANG->getLL('submit_swap_workspace') . '" onclick="if (confirm(' . $confirmation . ')) window.location.href=\'publish.php?swap=1\';return false ;" />';
+ $confirmation = $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL(($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1) ? 'submit_swap_workspace_confirmation_1' : 'submit_swap_workspace_confirmation_2'));
+ $actionLinks.= '<input type="submit" name="_swap" value="' . $GLOBALS['LANG']->getLL('submit_swap_workspace') . '" onclick="if (confirm(' . $confirmation . ')) window.location.href=\'publish.php?swap=1\';return false ;" />';
}
} else {
- $actionLinks.= $this->doc->icons(1) . $LANG->getLL('no_publish_permission');
+ $actionLinks.= $this->doc->icons(1) . $GLOBALS['LANG']->getLL('no_publish_permission');
}
// Preview of workspace link
$content = '
<table border="0" cellpadding="0" cellspacing="0" id="t3-user-ws-wsinfotable" class="t3-table t3-table-info">
<tr>
- <td class="t3-col-header" nowrap="nowrap">' . $LANG->getLL('label_workspace') . ' </th>
+ <td class="t3-col-header" nowrap="nowrap">' . $GLOBALS['LANG']->getLL('label_workspace') . ' </th>
<td nowrap="nowrap">' . $title . '</td>
</tr>
<tr>' . ($description ? '
- <td class="t3-col-header" nowrap="nowrap">' . $LANG->getLL('label_description') . ' </td>
+ <td class="t3-col-header" nowrap="nowrap">' . $GLOBALS['LANG']->getLL('label_description') . ' </td>
<td>' . $description . '</td>
</tr>' : '') . ($GLOBALS['BE_USER']->workspace!=-99 && !$details ? '
<tr>
- <td class="t3-col-header" nowrap="nowrap">' . $LANG->getLL('label_options') . ' </td>
+ <td class="t3-col-header" nowrap="nowrap">' . $GLOBALS['LANG']->getLL('label_options') . ' </td>
<td>' . $menu . $actionLinks . '</td>
</tr>
<tr>
- <td class="t3-col-header" nowrap="nowrap">' . $LANG->getLL('label_status') . ' </td>
- <td>' . $LANG->getLL('label_access_level') . ' ' . $GLOBALS['LANG']->getLL('workspace_list_access_' . $wsAccess['_ACCESS']) . '</td>
+ <td class="t3-col-header" nowrap="nowrap">' . $GLOBALS['LANG']->getLL('label_status') . ' </td>
+ <td>' . $GLOBALS['LANG']->getLL('label_access_level') . ' ' . $GLOBALS['LANG']->getLL('workspace_list_access_' . $wsAccess['_ACCESS']) . '</td>
</tr>' : '').'
</table>
<br />
* @return string Generated HTML code
*/
function workspaceList_displayUserWorkspaceList() {
- global $BACK_PATH, $LANG;
-
// table header
$content = $this->workspaceList_displayUserWorkspaceListHeader();
$content .= '<td>' .
'<a href="javascript:expandCollapse(' . $rowNum . ')">' .
t3lib_iconWorks::getSpriteIcon('actions-view-table-expand', array(
- 'title' => $LANG->getLL('img_title_show_more'),
+ 'title' => $GLOBALS['LANG']->getLL('img_title_show_more'),
'id' => 'spanw1_' . $rowNum
)) .
'</a></td>';
// row #1, column #3: current workspace indicator
$content .= '<td nowrap="nowrap" style="text-align: center">'; // Mozilla Firefox will attempt wrap due to `width="1"` on topmost column
- $content .= (!$currentWksp ? ' ' : '<img ' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/icon_ok.gif', 'width="18" height="16"') . ' id="wl_' . $rowNum . 'i" border="0" hspace="1" alt="' . $LANG->getLL('img_title_current_workspace') . '" />');
+ $content .= (!$currentWksp ? ' ' : '<img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/icon_ok.gif', 'width="18" height="16"') . ' id="wl_' . $rowNum . 'i" border="0" hspace="1" alt="' . $GLOBALS['LANG']->getLL('img_title_current_workspace') . '" />');
$content .= '</td>';
// row #1, column #4 and 5: title and description
* @return string Formatted workspace information
*/
function workspaceList_formatWorkspaceData(&$wksp) {
- global $LANG;
-
$content = '<table cellspacing="0" cellpadding="0" width="100%" class="ver-wl-details-table">' .
- '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_file_mountpoints') . '</strong></td>' .
+ '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_file_mountpoints') . '</strong></td>' .
'<td class="ver-wl-details">' . $this->workspaceList_getFileMountPoints($wksp) . '</td></tr>' .
- '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_db_mountpoints') . '</strong></td>' .
+ '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_db_mountpoints') . '</strong></td>' .
'<td class="ver-wl-details">' . $this->workspaceList_getWebMountPoints($wksp) . '</td></tr>';
if ($wksp['uid'] > 0) {
// Displaying information below makes sence only for custom workspaces
$content .=
- '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_frozen') . '</strong></td>' .
- '<td class="ver-wl-details">' . $LANG->getLL($wksp['freeze'] ? 'workspace_list_label_frozen_yes' : 'workspace_list_label_frozen_no') . '</td></tr>' .
- '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_publish_date') . '</strong></td>' .
+ '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_frozen') . '</strong></td>' .
+ '<td class="ver-wl-details">' . $GLOBALS['LANG']->getLL($wksp['freeze'] ? 'workspace_list_label_frozen_yes' : 'workspace_list_label_frozen_no') . '</td></tr>' .
+ '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_publish_date') . '</strong></td>' .
'<td class="ver-wl-details">' . ($wksp['publish_time'] == 0 ? ' –' : t3lib_BEfunc::datetime($wksp['publish_time'])) . '</td></tr>' .
- '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_unpublish_date') . '</strong></td>' .
+ '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_unpublish_date') . '</strong></td>' .
'<td class="ver-wl-details">' . ($wksp['unpublish_time'] == 0 ? ' –' : t3lib_BEfunc::datetime($wksp['unpublish_time'])) . '</td></tr>' .
- '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_your_access') . '</strong></td>' .
- '<td class="ver-wl-details">' . $LANG->getLL('workspace_list_access_' . $wksp['_ACCESS']) . '</td></tr>' .
- '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_workspace_users') . '</strong></td>' .
+ '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_your_access') . '</strong></td>' .
+ '<td class="ver-wl-details">' . $GLOBALS['LANG']->getLL('workspace_list_access_' . $wksp['_ACCESS']) . '</td></tr>' .
+ '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_workspace_users') . '</strong></td>' .
'<td class="ver-wl-details">' . $this->workspaceList_getUserList($wksp) . '</td></tr>';
}
elseif ($GLOBALS['BE_USER']->isAdmin()) {
// show users for draft/live workspace only to admin users
- $content .= '<tr><td class="ver-wl-details-label"><strong>' . $LANG->getLL('workspace_list_label_workspace_users') . '</strong></td>' .
- '<td class="ver-wl-details">' . $this->workspaceList_getUserList($wksp) . '</td></tr>';
+ $content .= '<tr><td class="ver-wl-details-label"><strong>' . $GLOBALS['LANG']->getLL('workspace_list_label_workspace_users') . '</strong></td>'
+ . '<td class="ver-wl-details">' . $this->workspaceList_getUserList($wksp) . '</td></tr>';
}
$content .= '</table>';
// We need to fetch user's mount point list (including MPS mounted from groups).
// This list must not be affects by current user's workspace. It means we cannot use
- // $BE_USER->isInWebMount() to check mount points.
+ // $GLOBALS['BE_USER']->isInWebMount() to check mount points.
$mountpointList = $GLOBALS['BE_USER']->groupData['webmounts'];
// If there are DB mountpoints in the workspace record,
- // then only show the ones that are allowed there (and that are in the users' webmounts)
+ // then only show the ones that are allowed there (and that are in the users' webmounts)
if (trim($wksp['db_mountpoints'])) {
$userMountpoints = explode(',', $mountpointList);
- // now filter the users' to only keep the mountpoints
+ // now filter the users' to only keep the mountpoints
// that are also in the workspaces' db_mountpoints
$workspaceMountpoints = explode(',', $wksp['db_mountpoints']);
$filteredMountpoints = array_intersect($userMountpoints, $workspaceMountpoints);
// We need to fetch user's mount point list (including MPS mounted from groups).
// This list must not be affects by current user's workspace. It means we cannot use
- // $BE_USER->isInWebMount() to check mount points.
+ // $GLOBALS['BE_USER']->isInWebMount() to check mount points.
$mountpointList = implode(',', $GLOBALS['BE_USER']->groupData['filemounts']);
// If there are file mountpoints in the workspace record,
- // then only show the ones that are allowed there (and that are in the users' file mounts)
+ // then only show the ones that are allowed there (and that are in the users' file mounts)
if (trim($wksp['file_mountpoints'])) {
$userMountpoints = explode(',', $mountpointList);
- // now filter the users' to only keep the mountpoints
+ // now filter the users' to only keep the mountpoints
// that are also in the workspaces' file_mountpoints
$workspaceMountpoints = explode(',', $wksp['file_mountpoints']);
$filteredMountpoints = array_intersect($userMountpoints, $workspaceMountpoints);
* @return string Generated content
*/
function workspaceList_displayUserWorkspaceListHeader() {
- global $LANG;
// TODO CSH lables?
return '<table border="0" cellpadding="0" cellspacing="0" class="workspace-overview">
<tr class="t3-row-header">
<td width="1"> </td>
<td width="1"> </td>
- <td nowrap="nowrap">' . $LANG->getLL('workspace_list_label_current_workspace') . '</td>
- <td nowrap="nowrap">' . $LANG->getLL('workspace_list_label_workspace_title') . '</td>
- <td nowrap="nowrap">' . $LANG->getLL('workspace_list_label_workspace_description') . '</td>
+ <td nowrap="nowrap">' . $GLOBALS['LANG']->getLL('workspace_list_label_current_workspace') . '</td>
+ <td nowrap="nowrap">' . $GLOBALS['LANG']->getLL('workspace_list_label_workspace_title') . '</td>
+ <td nowrap="nowrap">' . $GLOBALS['LANG']->getLL('workspace_list_label_workspace_description') . '</td>
</tr>';
}
* @return string Generated content
*/
function workspaceList_getUserList(&$wksp) {
- global $LANG;
-
if ($wksp['uid'] > 0) {
// custom workspaces
- $content = $this->workspaceList_getUserListWithAccess($wksp['adminusers'], $LANG->getLL('workspace_list_label_owners')); // owners
- $content .= $this->workspaceList_getUserListWithAccess($wksp['members'], $LANG->getLL('workspace_list_label_members')); // members
- $content .= $this->workspaceList_getUserListWithAccess($wksp['reviewers'], $LANG->getLL('workspace_list_label_reviewers')); // reviewers
+ $content = $this->workspaceList_getUserListWithAccess($wksp['adminusers'], $GLOBALS['LANG']->getLL('workspace_list_label_owners')); // owners
+ $content .= $this->workspaceList_getUserListWithAccess($wksp['members'], $GLOBALS['LANG']->getLL('workspace_list_label_members')); // members
+ $content .= $this->workspaceList_getUserListWithAccess($wksp['reviewers'], $GLOBALS['LANG']->getLL('workspace_list_label_reviewers')); // reviewers
if ($content != '') {
$content = '<table cellpadding="0" cellspacing="1" width="100%" class="lrPadding workspace-overview">' . $content . '</table>';
} else {
- $content = $LANG->getLL($wksp['uid'] > 0 ? 'workspace_list_access_admins_only' : 'workspace_list_access_anyone');
+ $content = $GLOBALS['LANG']->getLL($wksp['uid'] > 0 ? 'workspace_list_access_admins_only' : 'workspace_list_access_anyone');
}
}
else {
* @return string Generated content
*/
function workspaceList_displayIcons($currentWorkspace, &$wksp) {
- global $BACK_PATH, $LANG;
-
$content = '';
// `edit workspace` button
if ($this->workspaceList_hasEditAccess($wksp)) {
// User can modify workspace parameters, display corresponding link and icon
$editUrl = 'workspaceforms.php?action=edit&wkspId=' . $wksp['uid'];
- $content .= '<a href="' . $editUrl . '" title="'. $LANG->getLL('workspace_list_icon_title_edit_workspace') .'"/>' .
- t3lib_iconWorks::getSpriteIcon('actions-document-open') .
- '</a>';
+ $content .= '<a href="' . $editUrl . '" title="' . $GLOBALS['LANG']->getLL('workspace_list_icon_title_edit_workspace') . '"/>'
+ . t3lib_iconWorks::getSpriteIcon('actions-document-open')
+ . '</a>';
} else {
// User can NOT modify workspace parameters, display space
// Get only withdth and height from skinning API
$content .= '<img src="clear.gif" ' .
- t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/edit2.gif', 'width="11" height="12"', 2) .
+ t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="11" height="12"', 2) .
' border="0" alt="" hspace="1" align="middle" />';
}
// `switch workspace` button
// Workspace switching button
$content .= '<a href="' .
t3lib_div::getIndpEnv('SCRIPT_NAME') .
- '?changeWorkspace=' . $wksp['uid'] . '" title="'. $LANG->getLL('workspace_list_icon_title_switch_workspace') . '"/>' .
+ '?changeWorkspace=' . $wksp['uid'] . '" title="'. $GLOBALS['LANG']->getLL('workspace_list_icon_title_switch_workspace') . '"/>' .
t3lib_iconWorks::getSpriteIcon('actions-version-swap-workspace') .
'</a>';
} else {
//
// Here get only width and height from skinning API
$content .= '<img src="clear.gif" ' .
- t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/switch.png', 'width="18" height="16"', 2) .
+ t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/switch.png', 'width="18" height="16"', 2) .
' border="0" alt="" hspace="1" align="middle" alt="" />';
}
return $content;
* @return array Generated record (see <code>sys_workspaces</code> for structure)
*/
function workspaceList_createFakeWorkspaceRecord($uid) {
- global $BE_USER, $LANG;
-
$record = array(
'uid' => $uid,
'pid' => 0, // always 0!
'tstamp' => 0, // does not really matter
'deleted' => 0,
- 'title' => ($uid == 0 ? '['.$LANG->getLL('shortcut_onlineWS').']' : '['.$LANG->getLL('shortcut_offlineWS').']'),
- 'description' => ($uid == 0 ? $LANG->getLL('shortcut_onlineWS') : $LANG->getLL('shortcut_offlineWS')),
+ 'title' => ($uid == 0 ? '[' . $GLOBALS['LANG']->getLL('shortcut_onlineWS') . ']' : '[' . $GLOBALS['LANG']->getLL('shortcut_offlineWS').']'),
+ 'description' => ($uid == 0 ? $GLOBALS['LANG']->getLL('shortcut_onlineWS') : $GLOBALS['LANG']->getLL('shortcut_offlineWS')),
'adminusers' => '',
'members' => '',
'reviewers' => '',
$SOBE->main();
$SOBE->printContent();
-?>
\ No newline at end of file
+?>
$BE_USER->modAccess($MCONF,1);
// Include libraries of various kinds used inside:
-$LANG->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_mod_user_ws.xml');
/**
* Module: Workspace forms for editing/creating workspaces.
* @return void
*/
function main() {
- global $LANG;
-
// see what we have to do and get parameters (call before processing data!!!)
$this->getModuleParameters();
$this->content .= $this->doc->startPage($title);
$this->content .= $this->doc->header($title);
$this->content .= $this->doc->spacer(5);
- $this->content .= $LANG->getLL($this->isEditAction ? 'edit_workspace_no_permission' : 'create_workspace_no_permission');
+ $this->content .= $GLOBALS['LANG']->getLL($this->isEditAction ? 'edit_workspace_no_permission' : 'create_workspace_no_permission');
$this->content .= $this->doc->spacer(5);
$goBack = $GLOBALS['LANG']->getLL('edit_workspace_go_back');
$this->content .= t3lib_iconWorks::getSpriteIcon('actions-view-go-back') .
* @return array all available buttons as an assoc. array
*/
protected function getButtons() {
- global $LANG;
-
$buttons = array(
'close' => '',
'save' => '',
);
// Close, `n` below is simply to prevent caching
- $buttons['close'] = '<a href="index.php?n=' . uniqid('wksp') . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-close') . '</a>';
+ $buttons['close'] = '<a href="index.php?n=' . uniqid('wksp') . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-close') . '</a>';
// Save
- $buttons['save'] = '<input type="image" class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedok.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" value="_savedok" />';
+ $buttons['save'] = '<input type="image" class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedok.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" value="_savedok" />';
// Save & Close
- $buttons['save_close'] = '<input type="image" class="c-inputButton" name="_saveandclosedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/saveandclosedok.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', 1) . '" value="_saveandclosedok" />';
+ $buttons['save_close'] = '<input type="image" class="c-inputButton" name="_saveandclosedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/saveandclosedok.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', 1) . '" value="_saveandclosedok" />';
return $buttons;
}
* @return string User record formatted for TCEForms
*/
function getOwnerUser($uid) {
+ /** @var $loadDB t3lib_loadDBGroup */
$loadDB = t3lib_div::makeInstance('t3lib_loadDBGroup');
- // Make sure that `sys_workspace` is in $TCA
+ // Make sure that `sys_workspace` is in $GLOBALS['TCA']
t3lib_div::loadTCA('sys_workspace');
// shortcut to `config` of `adminusers` field -- shorter code and better PHP performance
$config = &$GLOBALS['TCA']['sys_workspace']['columns']['adminusers']['config'];
- // Notice: $config['MM'] is not set in the current version of $TCA but
+ // Notice: $config['MM'] is not set in the current version of $GLOBALS['TCA'] but
// we still pass it to ensure compatibility with feature versions!
$loadDB->start($GLOBALS['BE_USER']->user['uid'], $config['allowed'], $config['MM'], $uid, 'sys_workspace', $config);
$loadDB->getFromDB();
* @return void
*/
function processData() {
+ /** @var $tce t3lib_TCEmain */
$tce = t3lib_div::makeInstance('t3lib_TCEmain');
$tce->stripslashes_values = 0;
/**
- * Fixes various <code>$TCA</code> fields for better visual representation of workspace editor.
+ * Fixes various <code>$GLOBALS['TCA']</code> fields for better visual representation of workspace editor.
*
* @return void
*/
/**
- * "Fixes" <code>$TCA</code> to enable blinding for users/groups for non-admin users only.
+ * "Fixes" <code>$GLOBALS['TCA']</code> to enable blinding for users/groups for non-admin users only.
*
* @param string $fieldName Name of the field to change
* @return void
class user_SC_mod_user_ws_workspaceForms {
/**
- * Callback function to blind user and group accounts. Used as <code>itemsProcFunc</code> in <code>$TCA</code>.
+ * Callback function to blind user and group accounts. Used as <code>itemsProcFunc</code> in <code>$GLOBALS['TCA']</code>.
*
- * @param array $conf Configuration array. The following elements are set:<ul><li>items - initial set of items (empty in our case)</li><li>config - field config from <code>$TCA</code></li><li>TSconfig - this function name</li><li>table - table name</li><li>row - record row (???)</li><li>field - field name</li></ul>
+ * @param array $conf Configuration array. The following elements are set:<ul><li>items - initial set of items (empty in our case)</li><li>config - field config from <code>$GLOBALS['TCA']</code></li><li>TSconfig - this function name</li><li>table - table name</li><li>row - record row (???)</li><li>field - field name</li></ul>
* @param object $tceforms <code>t3lib_div::TCEforms</code> object
* @return void
*/