[TYPO3-dev] BE modules: restting the form

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Thu Feb 2 07:32:55 CET 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I am looking for a standard conform way to reset form values. Currently I do
something like this:

function menuConfig(){
    $this->MOD_MENU['sword'] = '';
    $this->MOD_MENU = .....

    if($this->CMD['reset']){
      foreach(array('sword') as $key)
                   $GLOBALS['_POST']['SET'][$key] = '';
      foreach(array('selections1', 'seletions2', 'selections3') as $key)
                   $GLOBALS['_POST']['SET'][$key] = 'all';
    }
    $this->modMenu_type = 'ses';
    $this->modMenu_dontValidateList = 'pointer';
    parent::menuConfig();
     ....
}


This happens in the parent::menuConfig() in t3lib_scbase:

function menuConfig()   {
  [ ... ]
  // CLEANSE 'function' SETTINGS
  $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData(
             $this->MOD_MENU,
             t3lib_div::_GP('SET'),
             $this->MCONF['name'],
             $this->modMenu_type,
             $this->modMenu_dontValidateList,
             $this->modMenu_setDefaultList
  );
}

So I put the "resetted" values already into the POST variables before all this
evaluation happen, as if all this data were send from the form itself. I even
get it set into the session this way.

I don't think this is the standard way to reset the form. I fear it is against
PCG to write to $GLOBALS['_POST'] directly. But I have not found any TYPO3
function to do this.

Regards

Elmar












- --
Climate change 2006 is killing people: floods in California, drought and fires
in Australia, Texas, Sahel, Oklahoma, South Africa. The Bush administration is
responsible for corruption of the Kyoto Protocol. The US majority is responsible
to the world for reelection of a convictable [...censored by Echelon...].

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD4aeXO976RNoy/18RAh3CAJ9TuCY5L8BfwIFTJ9jzAV8jWB7tcgCfUXYb
SLPZ8lJ/7M4bXg58uKYXo5w=
=DKhA
-----END PGP SIGNATURE-----




More information about the TYPO3-dev mailing list