Le 2011-07-11 06:14, Tyron Madlener a écrit :
On Sat, Jun 25, 2011 at 12:50 PM, Tyron Madlenertyronx@gmail.com wrote:
On Mon, Jun 20, 2011 at 3:02 PM, Tyron Madlenertyronx@gmail.com wrote:
On Fri, Jun 17, 2011 at 10:23 AM, Michal Čihařmichal@cihar.com wrote:
Hi
Dne Fri, 17 Jun 2011 10:13:07 +0200 Tyron Madlenertyronx@gmail.com napsal(a):
For the chart export to work you'll need to define the a js variable in your php code like this:
<script type="text/javascript"> pma_token = '<?php echo $_SESSION[' PMA_token ']; ?>'; </script>
...or maybe we could put this into header.inc.php?
I think it should rather go to js/messages.php, though it's name does not suggest it. We anyway use it for almost all data needs to be passed to javascript and do not change during one session.
I would like to be able to add js vars dynamically. In the case of server_variables.php I need to know whether the current user is a superuser. Whereas in most other pages this information is not required. So instead of putting all possible vars there I'd rather prefer to have only 4-5 variables hardcoded and others addable dynamically through a function, lets call it PMA_AddJSVariable(). But having that in messages.php would means the browser cannot load the file once and use the cached version after. Also those variables might change in value, meaning the messages.php also needs to be refreshed by the browser each time.
It might be better to have that in header.inc.php.
With such solution I could also avoid some inline JSON Code places.
Any objections to this?
OK for me.