本文整理汇总了PHP中PMA_Util::getScriptNameForOption方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Util::getScriptNameForOption方法的具体用法?PHP PMA_Util::getScriptNameForOption怎么用?PHP PMA_Util::getScriptNameForOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Util
的用法示例。
在下文中一共展示了PMA_Util::getScriptNameForOption方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPMASelectServer
/**
* Test for PMA_selectServer
*
* @return void
*/
public function testPMASelectServer()
{
$not_only_options = false;
$omit_fieldset = false;
$GLOBALS['cfg']['DefaultTabServer'] = "welcome";
$GLOBALS['cfg']['Servers'] = array('0' => array('host' => 'host0', 'port' => 'port0', 'only_db' => 'only_db0', 'user' => 'user0', 'auth_type' => 'config'), '1' => array('host' => 'host1', 'port' => 'port1', 'only_db' => 'only_db1', 'user' => 'user1', 'auth_type' => 'config'));
//$not_only_options=false & $omit_fieldset=false
$html = PMA_selectServer($not_only_options, $omit_fieldset);
$server = $GLOBALS['cfg']['Servers']['0'];
//server items
$this->assertContains($server['host'], $html);
$this->assertContains($server['port'], $html);
$this->assertContains($server['only_db'], $html);
$this->assertContains($server['user'], $html);
$not_only_options = true;
$omit_fieldset = true;
$GLOBALS['cfg']['DisplayServersList'] = null;
//$not_only_options=true & $omit_fieldset=true
$html = PMA_selectServer($not_only_options, $omit_fieldset);
//$GLOBALS['cfg']['DefaultTabServer']
$this->assertContains(PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabServer'], 'server'), $html);
//labels
$this->assertContains(__('Current Server:'), $html);
$this->assertContains('(' . __('Servers') . ')', $html);
//server items
$server = $GLOBALS['cfg']['Servers']['0'];
$this->assertContains($server['host'], $html);
$this->assertContains($server['port'], $html);
$this->assertContains($server['only_db'], $html);
$this->assertContains($server['user'], $html);
}
示例2: PMA_buildHtmlForDb
/**
* Builds the HTML td elements for one database to display in the list
* of databases from server_databases.php (which can be modified by
* db_create.php)
*
* @param array $current current database
* @param boolean $is_superuser user status
* @param string $url_query url query
* @param array $column_order column order
* @param array $replication_types replication types
* @param array $replication_info replication info
*
* @return array $column_order, $out
*/
function PMA_buildHtmlForDb($current, $is_superuser, $url_query, $column_order, $replication_types, $replication_info)
{
$out = '';
if ($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) {
$out .= '<td class="tool">';
$out .= '<input type="checkbox" name="selected_dbs[]" class="checkall" ' . 'title="' . htmlspecialchars($current['SCHEMA_NAME']) . '" ' . 'value="' . htmlspecialchars($current['SCHEMA_NAME']) . '"';
if ($GLOBALS['dbi']->isSystemSchema($current['SCHEMA_NAME'], true)) {
$out .= ' disabled="disabled"';
}
$out .= ' /></td>';
}
$out .= '<td class="name">' . '<a href="' . PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database') . $url_query . '&db=' . urlencode($current['SCHEMA_NAME']) . '" title="' . sprintf(__('Jump to database'), htmlspecialchars($current['SCHEMA_NAME'])) . '">' . ' ' . htmlspecialchars($current['SCHEMA_NAME']) . '</a>' . '</td>';
foreach ($column_order as $stat_name => $stat) {
if (array_key_exists($stat_name, $current)) {
$unit = '';
if (is_numeric($stat['footer'])) {
$column_order[$stat_name]['footer'] += $current[$stat_name];
}
if ($stat['format'] === 'byte') {
list($value, $unit) = PMA_Util::formatByteDown($current[$stat_name], 3, 1);
} elseif ($stat['format'] === 'number') {
$value = PMA_Util::formatNumber($current[$stat_name], 0);
} else {
$value = htmlentities($current[$stat_name], 0);
}
$out .= '<td class="value">';
if (isset($stat['description_function'])) {
$out .= '<dfn title="' . $stat['description_function']($current[$stat_name]) . '">';
}
$out .= $value;
if (isset($stat['description_function'])) {
$out .= '</dfn>';
}
$out .= '</td>';
if ($stat['format'] === 'byte') {
$out .= '<td class="unit">' . $unit . '</td>';
}
}
}
foreach ($replication_types as $type) {
if ($replication_info[$type]['status']) {
$out .= '<td class="tool" style="text-align: center;">';
$key = array_search($current["SCHEMA_NAME"], $replication_info[$type]['Ignore_DB']);
if (mb_strlen($key) > 0) {
$out .= PMA_Util::getIcon('s_cancel.png', __('Not replicated'));
} else {
$key = array_search($current["SCHEMA_NAME"], $replication_info[$type]['Do_DB']);
if (mb_strlen($key) > 0 || isset($replication_info[$type]['Do_DB'][0]) && $replication_info[$type]['Do_DB'][0] == "" && count($replication_info[$type]['Do_DB']) == 1) {
// if ($key != null) did not work for index "0"
$out .= PMA_Util::getIcon('s_success.png', __('Replicated'));
}
}
$out .= '</td>';
}
}
if ($is_superuser && !PMA_DRIZZLE) {
$out .= '<td class="tool">' . '<a onclick="' . 'PMA_commonActions.setDb(\'' . PMA_jsFormat($current['SCHEMA_NAME']) . '\');' . '" href="server_privileges.php' . $url_query . '&db=' . urlencode($current['SCHEMA_NAME']) . '&checkprivsdb=' . urlencode($current['SCHEMA_NAME']) . '" title="' . sprintf(__('Check privileges for database "%s".'), htmlspecialchars($current['SCHEMA_NAME'])) . '">' . ' ' . PMA_Util::getIcon('s_rights.png', __('Check Privileges')) . '</a></td>';
}
return array($column_order, $out);
}
示例3: __construct
/**
* Initialises the class
*
* @param string $name An identifier for the new node
* @param int $type Type of node, may be one of CONTAINER or OBJECT
* @param bool $is_group Whether this object has been created
* while grouping nodes
*/
public function __construct($name, $type = Node::OBJECT, $is_group = false)
{
parent::__construct($name, $type, $is_group);
$this->icon = PMA_Util::getImage('s_db.png', __('Database operations'));
$script_name = PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database');
$this->links = array('text' => $script_name . '?server=' . $GLOBALS['server'] . '&db=%1$s&token=' . $_SESSION[' PMA_token '], 'icon' => 'db_operations.php?server=' . $GLOBALS['server'] . '&db=%1$s&token=' . $_SESSION[' PMA_token '], 'title' => __('Structure'));
$this->classes = 'database';
}
示例4: __construct
/**
* Initialises the class
*
* @param string $name An identifier for the new node
* @param int $type Type of node, may be one of CONTAINER or OBJECT
* @param bool $is_group Whether this object has been created
* while grouping nodes
*
* @return Node_Table
*/
public function __construct($name, $type = Node::OBJECT, $is_group = false)
{
parent::__construct($name, $type, $is_group);
$this->icon = array();
$this->_addIcon(PMA_Util::getScriptNameForOption($GLOBALS['cfg']['NavigationTreeDefaultTabTable'], 'table'));
$this->_addIcon(PMA_Util::getScriptNameForOption($GLOBALS['cfg']['NavigationTreeDefaultTabTable2'], 'table'));
$title = PMA_Util::getTitleForTarget($GLOBALS['cfg']['DefaultTabTable']);
$this->title = $title;
$script_name = PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table');
$this->links = array('text' => $script_name . '?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s' . '&pos=0&token=' . $_SESSION[' PMA_token '], 'icon' => array(PMA_Util::getScriptNameForOption($GLOBALS['cfg']['NavigationTreeDefaultTabTable'], 'table') . '?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s&token=' . $_SESSION[' PMA_token '], PMA_Util::getScriptNameForOption($GLOBALS['cfg']['NavigationTreeDefaultTabTable2'], 'table') . '?server=' . $GLOBALS['server'] . '&db=%2$s&table=%1$s&token=' . $_SESSION[' PMA_token ']), 'title' => $this->title);
$this->classes = 'table';
}
示例5: PMA_initQueryForm
/**
* Get initial values for Sql Query Form Insert
*
* @param string $query query to display in the textarea
*
* @return array ($legend, $query, $columns_list)
*
* @usedby PMA_getHtmlForSqlQueryFormInsert()
*/
function PMA_initQueryForm($query)
{
$columns_list = array();
if (!mb_strlen($GLOBALS['db'])) {
// prepare for server related
$legend = sprintf(__('Run SQL query/queries on server %s'), '"' . htmlspecialchars(!empty($GLOBALS['cfg']['Servers'][$GLOBALS['server']]['verbose']) ? $GLOBALS['cfg']['Servers'][$GLOBALS['server']]['verbose'] : $GLOBALS['cfg']['Servers'][$GLOBALS['server']]['host']) . '"');
} elseif (!mb_strlen($GLOBALS['table'])) {
// prepare for db related
$db = $GLOBALS['db'];
// if you want navigation:
$tmp_db_link = '<a href="' . PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database') . PMA_URL_getCommon(array('db' => $db)) . '"';
$tmp_db_link .= '>' . htmlspecialchars($db) . '</a>';
$legend = sprintf(__('Run SQL query/queries on database %s'), $tmp_db_link);
if (empty($query)) {
$query = PMA_Util::expandUserString($GLOBALS['cfg']['DefaultQueryDatabase'], 'backquote');
}
} else {
$db = $GLOBALS['db'];
// Get the list and number of fields
// we do a try_query here, because we could be in the query window,
// trying to synchronize and the table has not yet been created
$columns_list = $GLOBALS['dbi']->getColumns($db, $GLOBALS['table'], null, true);
$tmp_db_link = '<a href="' . PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database') . PMA_URL_getCommon(array('db' => $db)) . '"';
$tmp_db_link .= '>' . htmlspecialchars($db) . '</a>';
$legend = sprintf(__('Run SQL query/queries on database %s'), $tmp_db_link);
if (empty($query)) {
$query = PMA_Util::expandUserString($GLOBALS['cfg']['DefaultQueryTable'], 'backquote');
}
}
$legend .= ': ' . PMA_Util::showMySQLDocu('SELECT');
return array($legend, $query, $columns_list);
}
示例6: _getBreadcrumbs
/**
* Returns the breadcrumbs as HTML
*
* @return string HTML formatted breadcrumbs
*/
private function _getBreadcrumbs()
{
$retval = '';
$tbl_is_view = $GLOBALS['dbi']->getTable($this->_db, $this->_table)->isView();
$server_info = !empty($GLOBALS['cfg']['Server']['verbose']) ? $GLOBALS['cfg']['Server']['verbose'] : $GLOBALS['cfg']['Server']['host'];
$server_info .= empty($GLOBALS['cfg']['Server']['port']) ? '' : ':' . $GLOBALS['cfg']['Server']['port'];
$separator = "<span class='separator item'> »</span>";
$item = '<a href="%1$s%2$s" class="item">';
if (PMA_Util::showText('TabsMode')) {
$item .= '%4$s: ';
}
$item .= '%3$s</a>';
$retval .= "<div id='floating_menubar'></div>";
$retval .= "<div id='serverinfo'>";
if (PMA_Util::showIcons('TabsMode')) {
$retval .= PMA_Util::getImage('s_host.png', '', array('class' => 'item'));
}
$retval .= sprintf($item, PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabServer'], 'server'), PMA_URL_getCommon(), htmlspecialchars($server_info), __('Server'));
if (mb_strlen($this->_db)) {
$retval .= $separator;
if (PMA_Util::showIcons('TabsMode')) {
$retval .= PMA_Util::getImage('s_db.png', '', array('class' => 'item'));
}
$retval .= sprintf($item, PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database'), PMA_URL_getCommon(array('db' => $this->_db)), htmlspecialchars($this->_db), __('Database'));
// if the table is being dropped, $_REQUEST['purge'] is set to '1'
// so do not display the table name in upper div
if (mb_strlen($this->_table) && !(isset($_REQUEST['purge']) && $_REQUEST['purge'] == '1')) {
include './libraries/tbl_info.inc.php';
$retval .= $separator;
if (PMA_Util::showIcons('TabsMode')) {
$icon = $tbl_is_view ? 'b_views.png' : 's_tbl.png';
$retval .= PMA_Util::getImage($icon, '', array('class' => 'item'));
}
$retval .= sprintf($item, PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table'), PMA_URL_getCommon(array('db' => $this->_db, 'table' => $this->_table)), str_replace(' ', ' ', htmlspecialchars($this->_table)), $tbl_is_view ? __('View') : __('Table'));
/**
* Displays table comment
*/
if (!empty($show_comment) && !isset($GLOBALS['avoid_show_comment'])) {
if (mb_strstr($show_comment, '; InnoDB free')) {
$show_comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment);
}
$retval .= '<span class="table_comment"';
$retval .= ' id="span_table_comment">"';
$retval .= htmlspecialchars($show_comment);
$retval .= '"</span>';
}
// end if
} else {
// no table selected, display database comment if present
$cfgRelation = PMA_getRelationsParam();
// Get additional information about tables for tooltip is done
// in PMA_Util::getDbInfo() only once
if ($cfgRelation['commwork']) {
$comment = PMA_getDbComment($this->_db);
/**
* Displays table comment
*/
if (!empty($comment)) {
$retval .= '<span class="table_comment"' . ' id="span_table_comment">"' . htmlspecialchars($comment) . '"</span>';
}
// end if
}
}
}
$retval .= '<div class="clearfloat"></div>';
$retval .= '</div>';
return $retval;
}
示例7: getDbLink
/**
* returns html code for db link to default db page
*
* @param string $database database
*
* @return string html link to default db page
*/
public static function getDbLink($database = null)
{
if (!mb_strlen($database)) {
if (!mb_strlen($GLOBALS['db'])) {
return '';
}
$database = $GLOBALS['db'];
} else {
$database = self::unescapeMysqlWildcards($database);
}
return '<a href="' . PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database') . PMA_URL_getCommon(array('db' => $database)) . '" title="' . htmlspecialchars(sprintf(__('Jump to database "%s".'), $database)) . '">' . htmlspecialchars($database) . '</a>';
}
示例8: preg_replace
/**
* Defines the url to return to in case of error in a sql statement
*/
// Security checks
if (!empty($goto)) {
$is_gotofile = preg_replace('@^([^?]+).*$@s', '\\1', $goto);
if (!@file_exists('' . $is_gotofile)) {
unset($goto);
} else {
$is_gotofile = $is_gotofile == $goto;
}
} else {
if (empty($table)) {
$goto = PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database');
} else {
$goto = PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table');
}
$is_gotofile = true;
}
// end if
if (!isset($err_url)) {
$err_url = (!empty($back) ? $back : $goto) . '?' . PMA_URL_getCommon(array('db' => $GLOBALS['db'])) . (mb_strpos(' ' . $goto, 'db_') != 1 && mb_strlen($table) ? '&table=' . urlencode($table) : '');
}
// end if
// Coming from a bookmark dialog
if (isset($_POST['bkm_fields']['bkm_sql_query'])) {
$sql_query = $_POST['bkm_fields']['bkm_sql_query'];
} elseif (isset($_GET['sql_query'])) {
$sql_query = $_GET['sql_query'];
}
// This one is just to fill $db
示例9: PMA_getColumnOrder
*/
$db_url_params['db'] = $_POST['new_db'];
$is_superuser = $GLOBALS['dbi']->isSuperuser();
$column_order = PMA_getColumnOrder();
$url_query = PMA_URL_getCommon(array('db' => $_POST['new_db']));
/**
* String that will contain the output HTML
* @name $new_db_string
*/
$new_db_string = '<tr>';
if (empty($db_collation_for_ajax)) {
$db_collation_for_ajax = PMA_getServerCollation();
}
// $dbstats comes from the create table dialog
if (!empty($dbstats)) {
$current = array('SCHEMA_NAME' => $_POST['new_db'], 'DEFAULT_COLLATION_NAME' => $db_collation_for_ajax, 'SCHEMA_TABLES' => '0', 'SCHEMA_TABLE_ROWS' => '0', 'SCHEMA_DATA_LENGTH' => '0', 'SCHEMA_MAX_DATA_LENGTH' => '0', 'SCHEMA_INDEX_LENGTH' => '0', 'SCHEMA_LENGTH' => '0', 'SCHEMA_DATA_FREE' => '0');
} else {
$current = array('SCHEMA_NAME' => $_POST['new_db'], 'DEFAULT_COLLATION_NAME' => $db_collation_for_ajax);
}
list($column_order, $generated_html) = PMA_buildHtmlForDb($current, $is_superuser, $url_query, $column_order, $replication_types, $GLOBALS['replication_info']);
$new_db_string .= $generated_html;
$new_db_string .= '</tr>';
$response = PMA_Response::getInstance();
$response->addJSON('message', $message);
$response->addJSON('new_db_string', $new_db_string);
$response->addJSON('sql_query', PMA_Util::getMessage(null, $sql_query, 'success'));
$response->addJSON('url_query', PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database') . $url_query . '&db=' . urlencode($current['SCHEMA_NAME']));
} else {
include_once '' . $cfg['DefaultTabDatabase'];
}
}
示例10: elseif
$scripts->addFile('jqplot/plugins/jqplot.highlighter.js');
/**
* Runs common work
*/
if (mb_strlen($GLOBALS['table'])) {
$url_params['goto'] = PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table');
$url_params['back'] = 'tbl_sql.php';
include 'libraries/tbl_common.inc.php';
include 'libraries/tbl_info.inc.php';
} elseif (mb_strlen($GLOBALS['db'])) {
$url_params['goto'] = PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database');
$url_params['back'] = 'sql.php';
include 'libraries/db_common.inc.php';
include 'libraries/db_info.inc.php';
} else {
$url_params['goto'] = PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabServer'], 'server');
$url_params['back'] = 'sql.php';
include 'libraries/server_common.inc.php';
}
$data = array();
$result = $GLOBALS['dbi']->tryQuery($sql_query);
$fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
$data[] = $row;
}
$keys = array_keys($data[0]);
$numeric_types = array('int', 'real');
$numeric_column_count = 0;
foreach ($keys as $idx => $key) {
if (in_array($fields_meta[$idx]->type, $numeric_types)) {
$numeric_column_count++;
示例11: PMA_URL_getCommon
*/
if (!defined('PHPMYADMIN')) {
exit;
}
/**
* Gets some core libraries
*/
require_once './libraries/bookmark.lib.php';
// Check parameters
PMA_Util::checkParameters(array('db', 'table'));
$db_is_system_schema = $GLOBALS['dbi']->isSystemSchema($db);
/**
* Set parameters for links
* @deprecated
*/
$url_query = PMA_URL_getCommon(array('db' => $db, 'table' => $table));
/**
* Set parameters for links
*/
$url_params = array();
$url_params['db'] = $db;
$url_params['table'] = $table;
/**
* Defines the urls to return to in case of error in a sql statement
*/
$err_url_0 = PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database') . PMA_URL_getCommon(array('db' => $db));
$err_url = PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table') . PMA_URL_getCommon($url_params);
/**
* Ensures the database and the table exist (else move to the "parent" script)
*/
require_once './libraries/db_table_exists.lib.php';
示例12: testPMAGetLinkToDbAndTable
/**
* Test for PMA_getLinkToDbAndTable
*
* @return void
*/
public function testPMAGetLinkToDbAndTable()
{
$url_dbname = "url_dbname";
$dbname = "dbname";
$tablename = "tablename";
$html = PMA_getLinkToDbAndTable($url_dbname, $dbname, $tablename);
//$dbname
$this->assertContains(__('Database'), $html);
$this->assertContains(PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database'), $html);
$item = PMA_URL_getCommon(array('db' => $url_dbname, 'reload' => 1));
$this->assertContains($item, $html);
$this->assertContains(htmlspecialchars($dbname), $html);
//$tablename
$this->assertContains(__('Table'), $html);
$this->assertContains(PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table'), $html);
$item = PMA_URL_getCommon(array('db' => $url_dbname, 'table' => $tablename, 'reload' => 1));
$this->assertContains($item, $html);
$this->assertContains(htmlspecialchars($tablename), $html);
$item = PMA_Util::getTitleForTarget($GLOBALS['cfg']['DefaultTabTable']);
$this->assertContains($item, $html);
}
示例13: getJsParams
/**
* Returns, as an array, a list of parameters
* used on the client side
*
* @return array
*/
public function getJsParams()
{
$db = !empty($GLOBALS['db']) ? $GLOBALS['db'] : '';
$table = !empty($GLOBALS['table']) ? $GLOBALS['table'] : '';
$pftext = !empty($_SESSION['tmpval']['pftext']) ? $_SESSION['tmpval']['pftext'] : '';
// not sure when this happens, but it happens
if (!isset($GLOBALS['collation_connection'])) {
$GLOBALS['collation_connection'] = 'utf8_general_ci';
}
$params = array('common_query' => PMA_URL_getCommon(array(), 'text'), 'opendb_url' => PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database'), 'safari_browser' => PMA_USR_BROWSER_AGENT == 'SAFARI' ? 1 : 0, 'collation_connection' => $GLOBALS['collation_connection'], 'lang' => $GLOBALS['lang'], 'server' => $GLOBALS['server'], 'table' => $table, 'db' => $db, 'token' => $_SESSION[' PMA_token '], 'text_dir' => $GLOBALS['text_dir'], 'show_databases_navigation_as_tree' => $GLOBALS['cfg']['ShowDatabasesNavigationAsTree'], 'pma_absolute_uri' => $GLOBALS['cfg']['PmaAbsoluteUri'], 'pma_text_default_tab' => PMA_Util::getTitleForTarget($GLOBALS['cfg']['DefaultTabTable']), 'pma_text_left_default_tab' => PMA_Util::getTitleForTarget($GLOBALS['cfg']['NavigationTreeDefaultTabTable']), 'pma_text_left_default_tab2' => PMA_Util::getTitleForTarget($GLOBALS['cfg']['NavigationTreeDefaultTabTable2']), 'LimitChars' => $GLOBALS['cfg']['LimitChars'], 'pftext' => $pftext, 'confirm' => $GLOBALS['cfg']['Confirm'], 'LoginCookieValidity' => $GLOBALS['cfg']['LoginCookieValidity'], 'logged_in' => isset($GLOBALS['userlink']) ? true : false);
if (isset($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['auth_type'])) {
$params['auth_type'] = $GLOBALS['cfg']['Server']['auth_type'];
}
return $params;
}
示例14: array
$target_blacklist = array('import.php', 'export.php');
// If we have a valid target, let's load that script instead
if (!empty($_REQUEST['target']) && is_string($_REQUEST['target']) && !preg_match('/^index/', $_REQUEST['target']) && !in_array($_REQUEST['target'], $target_blacklist) && in_array($_REQUEST['target'], $goto_whitelist)) {
include $_REQUEST['target'];
exit;
}
if (isset($_REQUEST['ajax_request']) && !empty($_REQUEST['access_time'])) {
exit;
}
// See FAQ 1.34
if (!empty($_REQUEST['db'])) {
$page = null;
if (!empty($_REQUEST['table'])) {
$page = PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table');
} else {
$page = PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database');
}
include $page;
exit;
}
/**
* Check if it is an ajax request to reload the recent tables list.
*/
require_once 'libraries/RecentFavoriteTable.class.php';
if ($GLOBALS['is_ajax_request'] && !empty($_REQUEST['recent_table'])) {
$response = PMA_Response::getInstance();
$response->addJSON('list', PMA_RecentFavoriteTable::getInstance('recent')->getHtmlList());
exit;
}
if ($GLOBALS['PMA_Config']->isGitRevision()) {
if (isset($_REQUEST['git_revision']) && $GLOBALS['is_ajax_request'] == true) {
示例15: printf
<script type="text/javascript">
var PMA_TEST_THEME = true;
</script>
<script src="../js/get_image.js.php" type="text/javascript"></script>
<script src="../js/functions.js" type="text/javascript"></script>
</head>
<body>
<?php
$separator = '<span class=\'separator item\'> »</span>' . "\n";
$item = '<a href="%1$s?%2$s" class="item">' . ' <img class="icon %5$s" src="../themes/dot.gif"' . ' width="16" height="16" alt="" /> ' . "\n" . '%4$s: %3$s</a>' . "\n";
echo '<div id="serverinfo">' . "\n";
printf($item, PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabserver'], 'server'), PMA_URL_getCommon(), 'Server', __('Server'), 'ic_s_host');
echo $separator;
printf($item, PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database'), '', 'Database', __('Database'), 'ic_s_db');
echo $separator;
printf($item, PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table'), '', 'Table', isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? __('View') : __('Table'), isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? 'ic_b_views' : 'ic_s_tbl');
echo '<span class="table_comment" id="span_table_comment">' . '"Table comment"</span>' . "\n";
echo '</div>';
/**
* Displays tab links
*/
$tabs = array();
$tabs['databases']['icon'] = 's_db.png';
$tabs['databases']['link'] = 'server_databases.php';
$tabs['databases']['text'] = __('Databases');
$tabs['sql']['icon'] = 'b_sql.png';
$tabs['sql']['link'] = 'server_sql.php';
$tabs['sql']['text'] = __('SQL');
$tabs['status']['icon'] = 's_status.png';
$tabs['status']['link'] = 'server_status.php';
$tabs['status']['text'] = __('Status');