[Phpmyadmin-devel] Themes: Artic Ocean and Smooth Yellow

Michal Čihař michal at cihar.com
Mon Mar 8 16:58:06 CET 2010


Hi

Dne Sun, 07 Mar 2010 10:32:30 +0100
Michael Keck <sfnet at michaelkeck.de> napsal(a):

> That was the problem. Now I've fixed it with this hack:
> 
> if (isset($GLOBALS['PMA_Config']) && $GLOBALS['PMA_Config']->get('fontsize') !== null) {
>     $pma_fsize = $GLOBALS['PMA_Config']->get('fontsize');
> } else if (isset($_SESSION['PMA_Config']) && $_SESSION['PMA_Config']->get('fontsize')) {
>     $pma_fsize = $_SESSION['PMA_Config']->get('fontsize');
> } else {
>     if (isset($_COOKIE['pma_fontsize'])) {
>         $pma_fsize = $_COOKIE['pma_fontsize'];
>     }
> }
> $pma_fsize = preg_replace("/[^0-9]/", "", $pma_fsize);
> if (!empty($pma_fsize)) {
>     $pma_fsize = ($pma_fsize * 0.01);
> } else {
>     $pma_fsize = 1;
> }
> 
> This can be a solution on many themes at the moment.
> But - why do we have so many different things to store PMA_Configs?

It used to be in session data, but it turned out to be wrong decision -
we don't want to store sensitive data in session (eg. user password
would end up there). That's why it has been moved to globals (in
trunk, targeted for 3.4).

Anyway I think that this code should be rather in some functions and
all themes would use it.

-- 
	Michal Čihař | http://cihar.com | http://blog.cihar.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20100308/27b4038e/attachment.sig>


More information about the Developers mailing list