Zum Inhalt springen

Cookie - Problem in Extension

Erstellt am 3. März 2006 · 20 Antworten · letzte Antwort am 19. Mai 2006 · Seite 2 von 2

Tags: Cache & Performance, Frage

Mopps ·

die extension, die ich benutze sieht wie folgt aus:

require_once(PATH_tslib.'class.tslib_pibase.php');

class tx_styleswitcher_pi1 extends tslib_pibase {
	var $prefixId = 'tx_styleswitcher_pi1';		// Same as class name
	var $scriptRelPath = 'pi1/class.tx_styleswitcher_pi1.php';	// Path to this script relative to the extension dir.
	var $extKey = 'styleswitcher';	// The extension key.
	var $pi_checkCHash = TRUE;
	
	/*** [Put your description here] ***/

	function main($content,$conf) {
                $this->conf=$conf;
                $this->pi_setPiVarDefaults();
                // $this->pi_loadLL();

$style = $_COOKIE["design"];

if (isset($this->piVars['style'])) {
        $style=$this->piVars['style'];
        setcookie("design", $style, time()+60*60*24*365);
        $GLOBALS['TSFE']->additionalHeaderData[$extKey]='<link rel="stylesheet" type="text/css" href="fileadmin/template/main/'.$style.'.css" media="screen" />';
}
elseif ($style) {
        $GLOBALS['TSFE']->additionalHeaderData[$extKey]='<link rel="stylesheet" type="text/css" href="fileadmin/template/main/'.$style.'.css" media="screen" />';
}
else {
        $GLOBALS['TSFE']->additionalHeaderData[$extKey]='<link rel="stylesheet" type="text/css" href="fileadmin/template/main/standard.css" media="screen" />';
}

$this->piVars['style'] = 'standard';
$content.='<ul><li>';
$content.= $this->pi_linkTP_keepPIvars('Standard',$this->piVars,true);
$this->piVars['style'] = 'kontrast';
$content.='</li><li>';
$content.= $this->pi_linkTP_keepPIvars('Kontrast',$this->piVars,true);
$this->piVars['style'] = 'druck';
$content.='</li><li>';
$content.= $this->pi_linkTP_keepPIvars('Druckansicht',$this->piVars,true);
$this->piVars['style'] = 'ohne';
$content.='</li><li>';
$content.= $this->pi_linkTP_keepPIvars('ohne Stylesheet',$this->piVars,true);
$content.='</li></ul>';
return $content;
}

}



if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/styleswitcher/pi1/class.tx_styleswitcher_pi1.php'])	{
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/styleswitcher/pi1/class.tx_styleswitcher_pi1.php']);
}

?>