#630 Display the last 10 used databases #3141575

Marc Delisle

This patch implements feature #3141575

In the database dropdown selection menu, there will be a new optgroup containing the last 10 accessed databases. Underneath it, another optgroup called Databases will contain all the databases as per normal. The number of databases to be displayed can be configured in config.inc.php by editing the variable $cfg['recent_dbs_nr'].

There are still 3 things that need to be done here:
* add the translation for 'Recent_dbs'
* add the cfg 'rcent_dbs_nr' to the default config
* the sorting is a bit weird (sometimes it' ASC, sometimes DESC)

This feature is closely related to my GSoC proposal [1]. It's mainly a proof of concept of how I will implement the feature, it can be polished a bit right now but it works as intended. You must define the cfg variable in config.inc or else it will be set to 0 and no databases will appear. A possible check to see if it's defined can be written, but I guess putting the cfg in config.default is a better solution.

Let me know what you all think.

[1] http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/andreipicus/1


  • Anonymous

    Display the last 10 used databases

  • Marc Delisle
    Marc Delisle

    • assigned_to: nobody --> lem9
  • Marc Delisle
    Marc Delisle

    Thanks for the patch. A few observations:

    - I would expect a sorting related to the order I accessed the databases
    - When asking for 4 recent, I sometimes only see 3 plus a blank entry
    - To better fit with our session variable names, please use $_SESSION['tmp_user_values']['recent_dbs']

  • Aris Feryanto
    Aris Feryanto


    To resolve the "blank entry", I suggest to check whether $GLOBALS['db'] is empty or not before adding it to the session variable.
    Also, if the sorting is based on how many times user open the database, I think the name should be changed to "Top databases", instead of "Recent databases".

  • Marc Delisle
    Marc Delisle

    can you submit an updated patch?

    By the way, is the sorting based on how many times a user opened the database?

  • Marc Delisle
    Marc Delisle

    • status: open --> pending
    • status: pending --> closed
  • This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).