[TYPO3-english] Problem with alt_mod_frameset.php

David Bruchmann typo3-en at bruchmann-web.de
Sat May 2 15:59:11 CEST 2009


----- Ursprüngliche Nachricht -----
Von:        David Bruchmann <typo3-en at bruchmann-web.de>
Gesendet:   Mittwoch, 29. April 2009 21:30:28
An:         TYPO3 English <typo3-english at lists.netfielders.de>
CC:
Betreff:    [TYPO3-english] Problem with alt_mod_frameset.php
> Hello,
> 
> I'd like to use the class-file /typo3/alt_mod_frameset.php for an own 
> class in an own main-modul.
> Until now I have some problems with that because of different reasons:
> 
> 1) The class-file alt_mod_frameset.php (and a lot of other files in 
> /typo3/) has inclusions of files by "require ()"
>     Including the file in another class throws an error about 
> double-loaded functions. Under this circumstance the class should 
> include files by "require_once()"
> 
> 2) The class serves as source of several mods, but is there referenced only.
>     Intantiation is done in the class-file itselfe. This makes it hard 
> to change some parameters but see next point ....
> 
> 3) Parameters are taken from GPvar, so it's not possible to instantiate 
> the class directly for individual cases.
> 
> 4) I know classes should be called with mod.php but I don't know how 
> with this class.
> 
> 5) I can't and dont't want to configure it as frameset for the whole 
> mainmodule in ext_localconf.php so I have to call it in another way.
> 
> I've build a working frameset by copying the file in my own extension 
> with changing the call only (and point 1 ), but I don't want to have 
> (nearly) redundant files in my extension.
> 
> Perhaps somone has a tip for me.
> 
> Thanks
> David

Hy,

solution for my question is to set a new header in the calling file / class.
To avoid getting two headers while the first one produces a 404 Error 
for the calling class I set also a 302 Header (Redirect), so only one 
file for the frameset is submitted to the browser:

// setting parameters and build URL
$script = 
'../'.$GLOBALS['TYPO3_LOADED_EXT']['myExt']['siteRelPath'].'modX/myContentScript.php';
$nav = 
'../'.$GLOBALS['TYPO3_LOADED_EXT']['myExt']['siteRelPath'].'modX/myTreeView.php';

$URL_nav = 
htmlspecialchars($nav.'?currentSubScript='.rawurlencode($script));

// setting Headers
header("HTTP/1.0 302 Redirect");
header('Location: '.$BACK_PATH.'alt_mod_frameset.php?'.$URL_nav);

This Method you can use from any class and doesn't need further 
configuration of any variables.

If you get any 404-Errors:
- check the path-values for your files (pathes for your own files have 
to be noted relative to /typo3/- directory)
- check the signs '?' and '&' in your URL (often between the URL and the 
parameters a "&" may be noted instead of "?")

Regards
David


More information about the TYPO3-english mailing list