Hallo Maik,ich habe mal vor einiger Zeit eine Quick'n'dirty Lösung dazu gehabt. Funktioniert nur mit jQuery (außer Du schreibst es um in mootools Syntax) und nutzt Ajax (ohne die Ajax.php von Andreas Schempp ). Dabei wird per dem Wrapper per Cookie einfach eine CSS Klasse hinzugefügt auf die ich dann mittels größerer Schrift reagieren kann. Ich poste hier einfach mal alles, was ich damals zu dem Thema gemacht habe:
ZUSÄTZLICHE HEADER TAGS (SEITENLAYOUT)
---------------------------------------------
HTML-Code:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($){
$('#sizer span').click(function()
{
fontsizer($(this).attr('class'));
});
function fontsizer(size)
{
$.ajax({
type: "POST",
url: "setfontsize.php",
data: "fontsize="+size
}).done(function(msg) {
window.location.reload();
});
}});
</script>
FE_PAGE.TPL
---------------
PHP-Code:
<div id="wrapper"<?php if ($_COOKIE['fontsize']): ?> class="<?php echo $_COOKIE['fontsize']; ?>"<?php endif; ?>>
MODUL EIGENER HTML-CODE
---------------------------------
PHP-Code:
<div id="sizer"><span class="normal">A</span><span class="big">A</span><span class="biggest">A</span></div>
TL_ROOT/setfontsize.php
--------------------------
PHP-Code:
<?php
require_once('system/initialize.php');
class setFontSize extends Frontend
{
public function __construct()
{
parent::__construct();
}
public function run()
{
// check POST-Data
if (strlen($this->Input->post('fontsize')))
{
if ($this->Input->post('fontsize') == 'normal')
{
setcookie ("fontsize", "", time() + 86400);
}
elseif ($this->Input->post('fontsize') == 'big' || $this->Input->post('fontsize') == 'biggest')
{
setcookie ("fontsize", $this->Input->post('fontsize'), time() + 86400);
}
}
}
}
$objFS = new setFontSize();
$objFS->run();
Lesezeichen