Aris Feryanto a écrit :
Hi,
I've fixed the problem below and implement some suggestions. I've just pushed my commits, so the demo server should be updated in about an hour.
On 8 Mei 2011, at 17:49, Marc Delisle <marc@infomarc.info mailto:marc@infomarc.info> wrote:
Le 2011-05-07 20:53, Aris Feryanto a écrit : Hi Aris,
On the positive side, the new feature works well, both with or without pma_recent.
On the negative side, I can no longer browse any table (no data is shown and there are warnings at the bottom of the browse page).
This is fixed. I used variable $result, which is used by other part of code. I've changed the variable name to $tmp_result.
Ok. Even better would be to move the new code ("add recently used tables...") into a function because we already have too much code in the global scope.
Missing feature:
- in /setup I don't see how to define pma_recent
Added.
Suggestions:
- in saveToDb() you could use REPLACE INTO instead of a SELECT then
UPDATE or INSERT, see http://dev.mysql.com/doc/refman/5.1/en/replace.html
Added.
- in getHtmlSelect() please use jQuery instead of the onchange event;
this is the direction we are taking about js in this project
I use onchange event, because the js code need a value generated from php ($GLOBALS['cfg']['LeftDefaultTabTable'], i.e. where the main frame will jump to when a recent table is selected). Should we change this to jQuery? I think that the code will be separated; the jQuery event in .js and the generated value in <script> tag in php.
Try this: in PHP, generate a span with class "hide" and some id, and put in it, the contents of $GLOBALS['cfg']['LeftDefaultTabTable']. Then from jQuery you can fetch this information and use it.
- about syntax, please write "if (! isset" instead of "if (!isset" (add
a space after the exclamation point)
Updated. But, I did a searching and found many parts of existing code use "if (!isset".
Indeed, these need to be changed.