当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_Util::getReloadNavigationScript方法代码示例

本文整理汇总了PHP中PMA_Util::getReloadNavigationScript方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Util::getReloadNavigationScript方法的具体用法?PHP PMA_Util::getReloadNavigationScript怎么用?PHP PMA_Util::getReloadNavigationScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMA_Util的用法示例。


在下文中一共展示了PMA_Util::getReloadNavigationScript方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_jsFormat

                                .html('<img src="<?php 
    echo $GLOBALS['pmaThemeImage'];
    ?>
ajax_clock_small.gif" width="16" height="16" alt="ajax clock" /> <?php 
    echo PMA_jsFormat(__('The file is being processed, please be patient.'), false);
    ?>
 ')
                                .show();
                            $('#import_form_status').load('import_status.php?message=true&<?php 
    echo PMA_generate_common_url();
    ?>
'); // loads the message, either success or mysql error
                            <?php 
    // reload the left sidebar when the import is finished
    $GLOBALS['reload'] = true;
    echo PMA_Util::getReloadNavigationScript(true);
    ?>

                        } // if finished
                        else {
                            setTimeout(perform_upload, 1000);
                        }
                    });
                }
                setTimeout(perform_upload, 1000);

    <?php 
} else {
    // no plugin available
    ?>
                $('#upload_form_status_info').html('<img src="<?php 
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:31,代码来源:display_import.lib.php

示例2: PMA_addUserAndCreateDatabase

/**
 * Prepares queries for adding users and
 * also create database and return query and message
 *
 * @param boolean $_error         whether user create or not
 * @param string  $real_sql_query SQL query for add a user
 * @param string  $sql_query      SQL query to be displayed
 * @param string  $username       username
 * @param string  $hostname       host name
 *
 * @return array  $sql_query, $message
 */
function PMA_addUserAndCreateDatabase($_error, $real_sql_query, $sql_query, $username, $hostname)
{
    if ($_error || !PMA_DBI_try_query($real_sql_query)) {
        $_REQUEST['createdb-1'] = $_REQUEST['createdb-2'] = $_REQUEST['createdb-3'] = false;
        $message = PMA_Message::rawError(PMA_DBI_getError());
    } else {
        $message = PMA_Message::success(__('You have added a new user.'));
    }
    if (isset($_REQUEST['createdb-1'])) {
        // Create database with same name and grant all privileges
        $q = 'CREATE DATABASE IF NOT EXISTS ' . PMA_Util::backquote(PMA_Util::sqlAddSlashes($username)) . ';';
        $sql_query .= $q;
        if (!PMA_DBI_try_query($q)) {
            $message = PMA_Message::rawError(PMA_DBI_getError());
        }
        /**
         * If we are not in an Ajax request, we can't reload navigation now
         */
        if ($GLOBALS['is_ajax_request'] != true) {
            // this is needed in case tracking is on:
            $GLOBALS['db'] = $username;
            $GLOBALS['reload'] = true;
            echo PMA_Util::getReloadNavigationScript();
        }
        $q = 'GRANT ALL PRIVILEGES ON ' . PMA_Util::backquote(PMA_Util::escapeMysqlWildcards(PMA_Util::sqlAddSlashes($username))) . '.* TO \'' . PMA_Util::sqlAddSlashes($username) . '\'@\'' . PMA_Util::sqlAddSlashes($hostname) . '\';';
        $sql_query .= $q;
        if (!PMA_DBI_try_query($q)) {
            $message = PMA_Message::rawError(PMA_DBI_getError());
        }
    }
    if (isset($_REQUEST['createdb-2'])) {
        // Grant all privileges on wildcard name (username\_%)
        $q = 'GRANT ALL PRIVILEGES ON ' . PMA_Util::backquote(PMA_Util::sqlAddSlashes($username) . '\\_%') . '.* TO \'' . PMA_Util::sqlAddSlashes($username) . '\'@\'' . PMA_Util::sqlAddSlashes($hostname) . '\';';
        $sql_query .= $q;
        if (!PMA_DBI_try_query($q)) {
            $message = PMA_Message::rawError(PMA_DBI_getError());
        }
    }
    if (isset($_REQUEST['createdb-3'])) {
        // Grant all privileges on the specified database to the new user
        $q = 'GRANT ALL PRIVILEGES ON ' . PMA_Util::backquote(PMA_Util::sqlAddSlashes($dbname)) . '.* TO \'' . PMA_Util::sqlAddSlashes($username) . '\'@\'' . PMA_Util::sqlAddSlashes($hostname) . '\';';
        $sql_query .= $q;
        if (!PMA_DBI_try_query($q)) {
            $message = PMA_Message::rawError(PMA_DBI_getError());
        }
    }
    return array($sql_query, $message);
}
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:60,代码来源:server_privileges.lib.php

示例3: _addDefaultScripts

 /**
  * Loads common scripts
  *
  * @return void
  */
 private function _addDefaultScripts()
 {
     $this->_scripts->addFile('jquery/jquery-1.6.2.js');
     $this->_scripts->addFile('jquery/jquery-ui-1.8.16.custom.js');
     $this->_scripts->addFile('jquery/jquery.sprintf.js');
     $this->_scripts->addFile('update-location.js');
     $this->_scripts->addFile('jquery/jquery.qtip-1.0.0-rc3.js');
     if ($GLOBALS['cfg']['CodemirrorEnable']) {
         $this->_scripts->addFile('codemirror/lib/codemirror.js');
         $this->_scripts->addFile('codemirror/mode/mysql/mysql.js');
     }
     // Cross-framing protection
     if ($GLOBALS['cfg']['AllowThirdPartyFraming'] === false) {
         $this->_scripts->addFile('cross_framing_protection.js');
     }
     // Localised strings
     $params = array('lang' => $GLOBALS['lang']);
     if (isset($GLOBALS['db'])) {
         $params['db'] = $GLOBALS['db'];
     }
     $this->_scripts->addFile('messages.php' . PMA_generate_common_url($params));
     // Append the theme id to this url to invalidate
     // the cache on a theme change
     $this->_scripts->addFile('get_image.js.php?theme=' . urlencode($_SESSION['PMA_Theme']->getId()));
     $this->_scripts->addFile('functions.js');
     $this->_scripts->addCode(PMA_Util::getReloadNavigationScript(true));
 }
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:32,代码来源:Header.class.php

示例4: testWriteReloadNavigation

    /**
     * other output tests
     */

    public function testWriteReloadNavigation()
    {
        $GLOBALS['reload'] = true;
        $GLOBALS['db'] = 'test_db';

        $url = './navigation.php?'.PMA_generate_common_url($GLOBALS['db'], '', '&');
        $write = '<script type="text/javascript">' . PHP_EOL .
                    '//<![CDATA[' . PHP_EOL .
                    'if (typeof(window.parent) != "undefined"' . PHP_EOL .
                    '    && typeof(window.parent.frame_navigation) != "undefined"' . PHP_EOL .
                    '    && window.parent.goTo) {' . PHP_EOL .
                    '    window.parent.goTo("' . $url . '");' . PHP_EOL .
                    '}' . PHP_EOL .
                    '//]]>' . PHP_EOL .
                    '</script>' . PHP_EOL;

        $this->expectOutputString($write);
        echo PMA_Util::getReloadNavigationScript();

        $this->assertFalse(isset($GLOBALS['reload']));
        unset($GLOBALS['db']);
    }
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:26,代码来源:PMA_headerLocation_test.php

示例5: __

                __('Deleting %s'),
                '\'' . $this_user . '\'@\'' . $this_host . '\''
            )
            . ' ...';
        $queries[] = 'DROP USER \''
            . PMA_Util::sqlAddSlashes($this_user)
            . '\'@\'' . PMA_Util::sqlAddSlashes($this_host) . '\';';

        if (isset($_REQUEST['drop_users_db'])) {
            $queries[] = 'DROP DATABASE IF EXISTS '
                . PMA_Util::backquote($this_user) . ';';
            $GLOBALS['reload'] = true;

            if ($GLOBALS['is_ajax_request'] != true) {
                $response->addHTML(
                    PMA_Util::getReloadNavigationScript()
                );
            }
        }
    }
    if (empty($_REQUEST['change_copy'])) {
        list($sql_query, $message) = PMA_deleteUser($queries);
    }
}

/**
 * Changes / copies a user, part V
 */
if (isset($_REQUEST['change_copy'])) {
    $tmp_count = 0;
    foreach ($queries as $sql_query) {
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:31,代码来源:server_privileges.php


注:本文中的PMA_Util::getReloadNavigationScript方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。