[TYPO3-core] fe_adminLib.inc formURL as typoLink
Bernhard Kraft
kraftb at kraftb.at
Thu Jul 14 11:32:16 CEST 2005
On Thu, Jul 14, 2005 at 10:44:37AM +0200, Michael Stucki wrote:
> I suggest to remove the "no_cache" property from TSref (not needed anymore)
> _but_ keep it for backwards compatibility _except_ if the new formurl
> property is used.
Completly fine with me to remove the old no_cache option from TSref so people start
to use the one of the typolink ...
> I have added Martins suggestion and removed a duplicate integer test (don't
> know why you checked this with t3lib_div::testInt() AND intval()...?)
intval is necessary. t3lib_div:testInt returns TRUE also when "0" is given.
i dicussed that with michael offlist and we came to the conclusion that intval alone
is enough. If somebody does : "no_cache = 1foobar" it will be valid
And if the new no_cache option shall overrule the old one than it will also be necessary to check
if it isn't already set in the linkConf array like with additionalParams.
attached the modified diff
greets,
Bernhard
--
----------------------------------------------------------------------
"Freiheit ist immer auch die Freiheit des Andersdenkenden"
Rosa Luxemburg, 1871 - 1919
----------------------------------------------------------------------
-------------- next part --------------
--- typo3/sysext/cms/tslib/media/scripts/fe_adminLib.inc.orig 2005-07-14 10:36:36.000000000 +0200
+++ typo3/sysext/cms/tslib/media/scripts/fe_adminLib.inc 2005-07-14 10:37:53.000000000 +0200
@@ -194,8 +194,8 @@
$this->authCode = t3lib_div::_GP('aC');
// get table
$this->theTable = $this->conf['table'];
-
- $this->nc = $this->conf['no_cache'] ? '&no_cache=1' : $this->nc;
+ // link configuration
+ $linkConf = is_array($this->conf['formurl.']) ? $this->conf['formurl.'] : array();
// pid
$this->thePid = intval($this->conf['pid']) ? intval($this->conf['pid']) : $GLOBALS['TSFE']->id;
//
@@ -212,8 +212,18 @@
$this->markerArray['###GC2###'] = $this->cObj->stdWrap($this->conf['color2'],$this->conf['color2.']);
$this->markerArray['###GC3###'] = $this->cObj->stdWrap($this->conf['color3'],$this->conf['color3.']);
+ if (intval($this->conf['no_cache']) && !isset($linkConf['no_cache'])) { // needed for backwards compatibility
+ $linkConf['no_cache'] = 1;
+ }
+ if(!$linkConf['parameter']) {
+ $linkConf['parameter'] = $GLOBALS['TSFE']->id;
+ }
+ if(!$linkConf['additionalParams']) { // needed for backwards compatibility
+ $linkConf['additionalParams'] = $this->conf['addParams'];
+ }
+
// Initialize markerArray, setting FORM_URL and HIDDENFIELDS
- $this->markerArray['###FORM_URL###'] = 'index.php?id='.$GLOBALS['TSFE']->id.'&type='.$GLOBALS['TSFE']->type.$this->nc.$this->conf['addParams'];
+ $this->markerArray['###FORM_URL###'] = $this->cObj->typoLink_URL($linkConf);
$this->markerArray['###FORM_URL_ENC###'] = rawurlencode($this->markerArray['###FORM_URL###']);
$this->markerArray['###FORM_URL_HSC###'] = htmlspecialchars($this->markerArray['###FORM_URL###']);
More information about the TYPO3-team-core
mailing list