~automne-team/automne/trunk

« back to all changes in this revision

Viewing changes to automne/phpMyAdmin/libraries/List_Database.class.php

  • Committer: sebastien-pauchet
  • Date: 2012-02-15 16:47:40 UTC
  • mfrom: (363.2.105 4.2)
  • Revision ID: seb@automne-cms.org-20120215164740-xrk26iafkvztwv6s
Merge stable branch 4.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/**
4
4
 * holds the PMA_List_Database class
5
5
 *
6
 
 * @version $Id$
7
6
 * @package phpMyAdmin
8
7
 */
9
8
 
295
294
        }
296
295
 
297
296
        foreach ($this->getLimitedItems($offset, $count) as $key => $db) {
298
 
            // garvin: Get comments from PMA comments table
 
297
            // Get comments from PMA comments table
299
298
            $db_tooltip = '';
300
299
 
301
300
            if (isset($db_tooltips[$db])) {
309
308
                // have the db name, the separator, then the rest which
310
309
                // might contain a separator
311
310
                // like dbname_the_rest
312
 
                $pos = strpos($db, $separator);
 
311
                $pos = strpos($db, $separator, 1);
313
312
 
314
313
                if ($pos !== false) {
315
314
                    break;
372
371
        $return = '<ul id="databaseList" xml:lang="en" dir="ltr">' . "\n";
373
372
        foreach ($this->getGroupedDetails($offset, $count) as $group => $dbs) {
374
373
            if (count($dbs) > 1) {
375
 
                $return .= '<li>' . htmlspecialchars($group) . '<ul>' . "\n";
 
374
                $return .= '<li class="group"><span>' . htmlspecialchars($group) . '</span><ul>' . "\n";
376
375
                // whether display db_name cut by the group part
377
376
                $cut = true;
378
377
            } else {
428
427
        $return = '<select name="db" id="lightm_db" xml:lang="en" dir="ltr"'
429
428
            . ' onchange="if (this.value != \'\') window.parent.openDb(this.value);">' . "\n"
430
429
            . '<option value="" dir="' . $GLOBALS['text_dir'] . '">'
431
 
            . '(' . $GLOBALS['strDatabases'] . ') ...</option>' . "\n";
 
430
            . '(' . __('Databases') . ') ...</option>' . "\n";
432
431
        foreach ($this->getGroupedDetails($offset, $count) as $group => $dbs) {
433
432
            if (count($dbs) > 1) {
434
433
                $return .= '<optgroup label="' . htmlspecialchars($group)
468
467
    protected function _checkAgainstPrivTables()
469
468
    {
470
469
        // 1. get allowed dbs from the "mysql.db" table
471
 
        // lem9: User can be blank (anonymous user)
 
470
        // User can be blank (anonymous user)
472
471
        $local_query = "
473
472
            SELECT DISTINCT `Db` FROM `mysql`.`db`
474
473
            WHERE `Select_priv` = 'Y'
488
487
            // now populated with actual database names instead of
489
488
            // with regular expressions.
490
489
            $tmp_alldbs = PMA_DBI_query('SHOW DATABASES;', $GLOBALS['controllink']);
491
 
            // loic1: all databases cases - part 2
 
490
            // all databases cases - part 2
492
491
            if (isset($tmp_mydbs['%'])) {
493
492
                while ($tmp_row = PMA_DBI_fetch_row($tmp_alldbs)) {
494
493
                    $dblist[] = $tmp_row[0];
501
500
                        $tmp_mydbs[$tmp_db] = 0;
502
501
                    } elseif (!isset($dblist[$tmp_db])) {
503
502
                        foreach ($tmp_mydbs as $tmp_matchpattern => $tmp_value) {
504
 
                            // loic1: fixed bad regexp
 
503
                            // fixed bad regexp
505
504
                            // TODO: db names may contain characters
506
505
                            //       that are regexp instructions
507
506
                            $re        = '(^|(\\\\\\\\)+|[^\])';