TYPO3 CMS  TYPO3_6-2
ListController.php
Go to the documentation of this file.
1 <?php
3 
19 
26 
27  // Internal, static:
28  // PID
32  public $pid;
33 
34  // Internal, static: GPvars
35  // Wizard parameters, coming from TCEforms linking to the wizard.
39  public $P;
40 
41  // Table to show, if none, then all tables are listed in list module.
45  public $table;
46 
47  // Page id to list.
51  public $id;
52 
56  public function __construct() {
57  $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_wizards.xlf');
58  $GLOBALS['SOBE'] = $this;
59  $this->P = GeneralUtility::_GP('P');
60  $this->table = GeneralUtility::_GP('table');
61  $this->id = GeneralUtility::_GP('id');
62  }
63 
70  public function main() {
71  // Get this record
72  $origRow = BackendUtility::getRecord($this->P['table'], $this->P['uid']);
73  // Get TSconfig for it.
74  $TSconfig = BackendUtility::getTCEFORM_TSconfig($this->table, is_array($origRow) ? $origRow : array('pid' => $this->P['pid']));
75  // Set [params][pid]
76  if (substr($this->P['params']['pid'], 0, 3) === '###' && substr($this->P['params']['pid'], -3) === '###') {
77  $keyword = substr($this->P['params']['pid'], 3, -3);
78  if (strpos($keyword, 'PAGE_TSCONFIG_') === 0) {
79  $this->pid = (int)$TSconfig[$this->P['field']][$keyword];
80  } else {
81  $this->pid = (int)$TSconfig['_' . $keyword];
82  }
83  } else {
84  $this->pid = (int)$this->P['params']['pid'];
85  }
86  // Make redirect:
87  // If pid is blank OR if id is set, then return...
88  if ((string)$this->id !== '') {
89  $redirectUrl = GeneralUtility::sanitizeLocalUrl($this->P['returnUrl']);
90  } else {
91  // Otherwise, show the list:
92  $urlParameters = array();
93  $urlParameters['id'] = $this->pid;
94  $urlParameters['table'] = $this->P['params']['table'];
95  $urlParameters['returnUrl'] = GeneralUtility::getIndpEnv('REQUEST_URI');
96  $redirectUrl = BackendUtility::getModuleUrl('web_list', $urlParameters);
97  }
99  }
100 
101 }
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
static redirect($url, $httpStatus=self::HTTP_STATUS_303)
Definition: HttpUtility.php:76
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]