本文整理汇总了PHP中PMA_Util::getIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Util::getIcon方法的具体用法?PHP PMA_Util::getIcon怎么用?PHP PMA_Util::getIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Util
的用法示例。
在下文中一共展示了PMA_Util::getIcon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_getHtmlForAdvisor
/**
* Returns html with Advisor
*
* @return string
*/
function PMA_getHtmlForAdvisor()
{
$output = '<a href="#openAdvisorInstructions">';
$output .= PMA_Util::getIcon('b_help.png', __('Instructions'));
$output .= '</a>';
$output .= '<div id="statustabs_advisor"></div>';
$output .= '<div id="advisorInstructionsDialog" style="display:none;">';
$output .= '<p>';
$output .= __('The Advisor system can provide recommendations ' . 'on server variables by analyzing the server status variables.');
$output .= '</p>';
$output .= '<p>';
$output .= __('Do note however that this system provides recommendations ' . 'based on simple calculations and by rule of thumb which may ' . 'not necessarily apply to your system.');
$output .= '</p>';
$output .= '<p>';
$output .= __('Prior to changing any of the configuration, be sure to know ' . 'what you are changing (by reading the documentation) and how ' . 'to undo the change. Wrong tuning can have a very negative ' . 'effect on performance.');
$output .= '</p>';
$output .= '<p>';
$output .= __('The best way to tune your system would be to change only one ' . 'setting at a time, observe or benchmark your database, and undo ' . 'the change if there was no clearly measurable improvement.');
$output .= '</p>';
$output .= '</div>';
$output .= '<div id="advisorData" style="display:none;">';
$advisor = new Advisor();
$output .= htmlspecialchars(json_encode($advisor->run()));
$output .= '</div>';
return $output;
}
示例2: PMA_RTE_getFooterLinks
/**
* Creates a fieldset for adding a new item, if the user has the privileges.
*
* @param string $docu String used to create a link to the MySQL docs
* @param string $priv Privilege to check for adding a new item
* @param string $name MySQL name of the item
*
* @return string An HTML snippet with the link to add a new item
*/
function PMA_RTE_getFooterLinks($docu, $priv, $name)
{
global $db, $url_query, $ajax_class;
$icon = 'b_' . strtolower($name) . '_add.png';
$retval = "";
$retval .= "<!-- ADD " . $name . " FORM START -->\n";
$retval .= "<fieldset class='left'>\n";
$retval .= "<legend>" . _pgettext('Create new procedure', 'New') . "</legend>\n";
$retval .= " <div class='wrap'>\n";
if (PMA_Util::currentUserHasPrivilege($priv, $db)) {
$retval .= " <a {$ajax_class['add']} ";
$retval .= "href='db_" . strtolower($name) . "s.php";
$retval .= "?{$url_query}&add_item=1' onclick='\$.datepicker.initialized = false;'>";
$retval .= PMA_Util::getIcon($icon);
$retval .= PMA_RTE_getWord('add') . "</a>\n";
} else {
$retval .= " " . PMA_Util::getIcon($icon);
$retval .= PMA_RTE_getWord('no_create') . "\n";
}
$retval .= " " . PMA_Util::showMySQLDocu($docu) . "\n";
$retval .= " </div>\n";
$retval .= "</fieldset>\n";
$retval .= "<!-- ADD " . $name . " FORM END -->\n\n";
return $retval;
}
示例3: PMA_getHtmlForSubPageHeader
/**
* Returns the html for the sub-page heading
*
* @param string $type Sub page type
* @param string $link Link to the official MySQL documentation
* @param bool $is_image Display image or icon, true: image, false: icon
*
* @return string
*/
function PMA_getHtmlForSubPageHeader($type, $link = '', $is_image = true)
{
//array contains Sub page icon and text
$header = array();
$header['variables']['image'] = 's_vars.png';
$header['variables']['text'] = __('Server variables and settings');
$header['engines']['image'] = 'b_engine.png';
$header['engines']['text'] = __('Storage Engines');
$header['plugins']['image'] = 'b_engine.png';
$header['plugins']['text'] = __('Plugins');
$header['binlog']['image'] = 's_tbl.png';
$header['binlog']['text'] = __('Binary log');
$header['collations']['image'] = 's_asci.png';
$header['collations']['text'] = __('Character Sets and Collations');
$header['replication']['image'] = 's_replication.png';
$header['replication']['text'] = __('Replication');
$header['database_statistics']['image'] = 's_db.png';
$header['database_statistics']['text'] = __('Databases statistics');
$header['databases']['image'] = 's_db.png';
$header['databases']['text'] = __('Databases');
$header['privileges']['image'] = 'b_usrlist.png';
$header['privileges']['text'] = __('Privileges');
if ($is_image) {
$html = '<h2>' . "\n" . PMA_Util::getImage($header[$type]['image']) . ' ' . $header[$type]['text'] . "\n" . $link . '</h2>' . "\n";
} else {
$html = '<h2>' . "\n" . PMA_Util::getIcon($header[$type]['image']) . ' ' . $header[$type]['text'] . "\n" . $link . '</h2>' . "\n";
}
return $html;
}
示例4: testGetIconWithForceText
/**
* Test for getIcon
*
* @return void
*/
function testGetIconWithForceText()
{
$GLOBALS['cfg']['ActionLinksMode'] = 'icons';
$alternate_text = 'alt_str';
// Here we are checking for an icon embedded inside a span (i.e not a menu
// bar icon
$this->assertEquals('<span class="nowrap"><img src="themes/dot.gif" title="' . $alternate_text . '" alt="' . $alternate_text . '" class="icon ic_b_comment" /> ' . $alternate_text . '</span>', PMA_Util::getIcon('b_comment.png', $alternate_text, true, false));
}
示例5: testGetIconWithForceText
function testGetIconWithForceText()
{
$GLOBALS['cfg']['PropertiesIconic'] = true;
$alternate_text = 'alt_str';
$this->assertEquals(
'<span class="nowrap"><img src="themes/dot.gif" title="' . $alternate_text . '" alt="' . $alternate_text
. '" class="icon ic_b_comment" /> ' . $alternate_text . '</span>',
PMA_Util::getIcon('b_comment.png', $alternate_text, true)
);
}
示例6: testBuildActionTitles
/**
* Test for buildActionTitles
*
* @return void
*/
function testBuildActionTitles()
{
$titles = array();
$titles['Browse'] = PMA_Util::getIcon('b_browse.png', __('Browse'));
$titles['NoBrowse'] = PMA_Util::getIcon('bd_browse.png', __('Browse'));
$titles['Search'] = PMA_Util::getIcon('b_select.png', __('Search'));
$titles['NoSearch'] = PMA_Util::getIcon('bd_select.png', __('Search'));
$titles['Insert'] = PMA_Util::getIcon('b_insrow.png', __('Insert'));
$titles['NoInsert'] = PMA_Util::getIcon('bd_insrow.png', __('Insert'));
$titles['Structure'] = PMA_Util::getIcon('b_props.png', __('Structure'));
$titles['Drop'] = PMA_Util::getIcon('b_drop.png', __('Drop'));
$titles['NoDrop'] = PMA_Util::getIcon('bd_drop.png', __('Drop'));
$titles['Empty'] = PMA_Util::getIcon('b_empty.png', __('Empty'));
$titles['NoEmpty'] = PMA_Util::getIcon('bd_empty.png', __('Empty'));
$titles['Edit'] = PMA_Util::getIcon('b_edit.png', __('Edit'));
$titles['NoEdit'] = PMA_Util::getIcon('bd_edit.png', __('Edit'));
$titles['Export'] = PMA_Util::getIcon('b_export.png', __('Export'));
$titles['NoExport'] = PMA_Util::getIcon('bd_export.png', __('Export'));
$titles['Execute'] = PMA_Util::getIcon('b_nextpage.png', __('Execute'));
$titles['NoExecute'] = PMA_Util::getIcon('bd_nextpage.png', __('Execute'));
$titles['Favorite'] = PMA_Util::getIcon('b_favorite.png', '');
$titles['NoFavorite'] = PMA_Util::getIcon('b_no_favorite.png', '');
$this->assertEquals($titles, PMA_Util::buildActionTitles());
}
示例7: PMA_getActionTitlesArray
/**
* Get action titles (image or string array
*
* @return array $titles
*/
function PMA_getActionTitlesArray()
{
$titles = array();
$titles['Change'] = PMA_Util::getIcon('b_edit.png', __('Change'));
$titles['Drop'] = PMA_Util::getIcon('b_drop.png', __('Drop'));
$titles['NoDrop'] = PMA_Util::getIcon('b_drop.png', __('Drop'));
$titles['Primary'] = PMA_Util::getIcon('b_primary.png', __('Primary'));
$titles['Index'] = PMA_Util::getIcon('b_index.png', __('Index'));
$titles['Unique'] = PMA_Util::getIcon('b_unique.png', __('Unique'));
$titles['Spatial'] = PMA_Util::getIcon('b_spatial.png', __('Spatial'));
$titles['IdxFulltext'] = PMA_Util::getIcon('b_ftext.png', __('Fulltext'));
$titles['NoPrimary'] = PMA_Util::getIcon('bd_primary.png', __('Primary'));
$titles['NoIndex'] = PMA_Util::getIcon('bd_index.png', __('Index'));
$titles['NoUnique'] = PMA_Util::getIcon('bd_unique.png', __('Unique'));
$titles['NoSpatial'] = PMA_Util::getIcon('bd_spatial.png', __('Spatial'));
$titles['NoIdxFulltext'] = PMA_Util::getIcon('bd_ftext.png', __('Fulltext'));
$titles['DistinctValues'] = PMA_Util::getIcon('b_browse.png', __('Distinct values'));
return $titles;
}
示例8: __
$tabs['import']['fragment'] = '#';
$tabs['import']['attr'] = 'onclick="PMA_querywindowCommit(\'files\');return false;"';
$tabs['import']['active'] = (bool) ($querydisplay_tab == 'files');
$tabs['history']['icon'] = 'b_bookmark.png';
$tabs['history']['text'] = __('SQL history');
$tabs['history']['fragment'] = '#';
$tabs['history']['attr'] = 'onclick="PMA_querywindowCommit(\'history\');return false;"';
$tabs['history']['active'] = (bool) ($querydisplay_tab == 'history');
if ($GLOBALS['cfg']['QueryWindowDefTab'] == 'full') {
$tabs['all']['text'] = __('All');
$tabs['all']['fragment'] = '#';
$tabs['all']['attr'] = 'onclick="PMA_querywindowCommit(\'full\');return false;"';
$tabs['all']['active'] = (bool) ($querydisplay_tab == 'full');
}
}
$titles['Change'] = PMA_Util::getIcon('b_edit.png', __('Change'));
$url_query = PMA_URL_getCommon($db, $table);
if (!empty($sql_query)) {
$show_query = 1;
}
if ($no_js) {
// ... we redirect to appropriate query sql page
// works only full if $db and $table is also stored/grabbed from $_COOKIE
if (strlen($table)) {
include 'tbl_sql.php';
} elseif (strlen($db)) {
include 'db_sql.php';
} else {
include 'server_sql.php';
}
exit;
示例9: PMA_getHtmlForUserOverview
/**
* Get HTML snippet for display user overview page
*
* @param string $pmaThemeImage a image source link
* @param string $text_dir text directory
*
* @return string $html_output
*/
function PMA_getHtmlForUserOverview($pmaThemeImage, $text_dir)
{
$html_output = '<h2>' . "\n" . PMA_Util::getIcon('b_usrlist.png') . __('Users overview') . "\n" . '</h2>' . "\n";
$password_column = 'Password';
if (PMA_Util::getServerType() == 'MySQL' && PMA_MYSQL_INT_VERSION >= 50706) {
$password_column = 'authentication_string';
}
// $sql_query is for the initial-filtered,
// $sql_query_all is for counting the total no. of users
$sql_query = $sql_query_all = 'SELECT *,' . " IF(`" . $password_column . "` = _latin1 '', 'N', 'Y') AS 'Password'" . ' FROM `mysql`.`user`';
$sql_query .= isset($_REQUEST['initial']) ? PMA_rangeOfUsers($_REQUEST['initial']) : '';
$sql_query .= ' ORDER BY `User` ASC, `Host` ASC;';
$sql_query_all .= ' ;';
$res = $GLOBALS['dbi']->tryQuery($sql_query, null, PMA_DatabaseInterface::QUERY_STORE);
$res_all = $GLOBALS['dbi']->tryQuery($sql_query_all, null, PMA_DatabaseInterface::QUERY_STORE);
if (!$res) {
// the query failed! This may have two reasons:
// - the user does not have enough privileges
// - the privilege tables use a structure of an earlier version.
// so let's try a more simple query
$GLOBALS['dbi']->freeResult($res);
$GLOBALS['dbi']->freeResult($res_all);
$sql_query = 'SELECT * FROM `mysql`.`user`';
$res = $GLOBALS['dbi']->tryQuery($sql_query, null, PMA_DatabaseInterface::QUERY_STORE);
if (!$res) {
$html_output .= PMA_getHtmlForViewUsersError();
$html_output .= PMA_getAddUserHtmlFieldset();
} else {
// This message is hardcoded because I will replace it by
// a automatic repair feature soon.
$raw = 'Your privilege table structure seems to be older than' . ' this MySQL version!<br />' . 'Please run the <code>mysql_upgrade</code> command' . '(<code>mysql_fix_privilege_tables</code> on older systems)' . ' that should be included in your MySQL server distribution' . ' to solve this problem!';
$html_output .= PMA_Message::rawError($raw)->getDisplay();
}
$GLOBALS['dbi']->freeResult($res);
} else {
$db_rights = PMA_getDbRightsForUserOverview();
// for all initials, even non A-Z
$array_initials = array();
/**
* Displays the initials
* Also not necessary if there is less than 20 privileges
*/
if ($GLOBALS['dbi']->numRows($res_all) > 20) {
$html_output .= PMA_getHtmlForInitials($array_initials);
}
/**
* Display the user overview
* (if less than 50 users, display them immediately)
*/
if (isset($_REQUEST['initial']) || isset($_REQUEST['showall']) || $GLOBALS['dbi']->numRows($res) < 50) {
$html_output .= PMA_getUsersOverview($res, $db_rights, $pmaThemeImage, $text_dir);
} else {
$html_output .= PMA_getAddUserHtmlFieldset();
}
// end if (display overview)
if (!$GLOBALS['is_ajax_request'] || !empty($_REQUEST['ajax_page_request'])) {
$flushnote = new PMA_Message(__('Note: phpMyAdmin gets the users\' privileges directly ' . 'from MySQL\'s privilege tables. The content of these tables ' . 'may differ from the privileges the server uses, ' . 'if they have been changed manually. In this case, ' . 'you should %sreload the privileges%s before you continue.'), PMA_Message::NOTICE);
$flushLink = '<a href="server_privileges.php' . PMA_URL_getCommon(array('flush_privileges' => 1)) . '" id="reload_privileges_anchor">';
$flushnote->addParam($flushLink, false);
$flushnote->addParam('</a>', false);
$html_output .= $flushnote->getDisplay();
}
}
return $html_output;
}
示例10: 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="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . $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)) {
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 (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 (strlen($key) > 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);
}
示例11: _getResultsOperations
/**
* Get operations that are available on results.
*
* @param array $displayParts the parts to display
* @param array $analyzed_sql the analyzed query
* @param boolean $only_view Whether to show only view
*
* @return string $results_operations_html html content
*
* @access private
*
* @see getTable()
*/
private function _getResultsOperations($displayParts, $analyzed_sql, $only_view = false)
{
global $printview;
$results_operations_html = '';
$fields_meta = $this->__get('fields_meta');
// To safe use in foreach
$header_shown = false;
$header = '<fieldset><legend>' . __('Query results operations') . '</legend>';
$_url_params = array('db' => $this->__get('db'), 'table' => $this->__get('table'), 'printview' => '1', 'sql_query' => $this->__get('sql_query'));
$url_query = PMA_URL_getCommon($_url_params);
if (!$header_shown) {
$results_operations_html .= $header;
$header_shown = true;
}
// if empty result set was produced we need to
// show only view and not other options
if ($only_view == true) {
$results_operations_html .= $this->_getLinkForCreateView($analyzed_sql, $url_query);
if ($header_shown) {
$results_operations_html .= '</fieldset><br />';
}
return $results_operations_html;
}
if ($displayParts['ins_row'] == '1' || $displayParts['pview_lnk'] == '1') {
// Displays "printable view" link if required
if ($displayParts['pview_lnk'] == '1') {
$results_operations_html .= PMA_Util::linkOrButton('sql.php' . $url_query, PMA_Util::getIcon('b_print.png', __('Print view'), true), array('target' => 'print_view'), true, true, 'print_view') . "\n";
if ($_SESSION['tmpval']['pftext']) {
$_url_params['pftext'] = self::DISPLAY_FULL_TEXT;
$results_operations_html .= PMA_Util::linkOrButton('sql.php' . PMA_URL_getCommon($_url_params), PMA_Util::getIcon('b_print.png', __('Print view (with full texts)'), true), array('target' => 'print_view'), true, true, 'print_view') . "\n";
unset($_url_params['pftext']);
}
}
// end displays "printable view"
}
// Export link
// (the url_query has extra parameters that won't be used to export)
// (the single_table parameter is used in display_export.inc.php
// to hide the SQL and the structure export dialogs)
// If the parser found a PROCEDURE clause
// (most probably PROCEDURE ANALYSE()) it makes no sense to
// display the Export link).
if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == self::QUERY_TYPE_SELECT && !isset($printview) && !isset($analyzed_sql[0]['queryflags']['procedure'])) {
if (isset($analyzed_sql[0]['table_ref'][0]['table_true_name']) && !isset($analyzed_sql[0]['table_ref'][1]['table_true_name'])) {
$_url_params['single_table'] = 'true';
}
if (!$header_shown) {
$results_operations_html .= $header;
$header_shown = true;
}
$_url_params['unlim_num_rows'] = $this->__get('unlim_num_rows');
/**
* At this point we don't know the table name; this can happen
* for example with a query like
* SELECT bike_code FROM (SELECT bike_code FROM bikes) tmp
* As a workaround we set in the table parameter the name of the
* first table of this database, so that tbl_export.php and
* the script it calls do not fail
*/
if (empty($_url_params['table']) && !empty($_url_params['db'])) {
$_url_params['table'] = $GLOBALS['dbi']->fetchValue("SHOW TABLES");
/* No result (probably no database selected) */
if ($_url_params['table'] === false) {
unset($_url_params['table']);
}
}
$results_operations_html .= PMA_Util::linkOrButton('tbl_export.php' . PMA_URL_getCommon($_url_params), PMA_Util::getIcon('b_tblexport.png', __('Export'), true), '', true, true, '') . "\n";
// prepare chart
$results_operations_html .= PMA_Util::linkOrButton('tbl_chart.php' . PMA_URL_getCommon($_url_params), PMA_Util::getIcon('b_chart.png', __('Display chart'), true), '', true, true, '') . "\n";
// prepare GIS chart
$geometry_found = false;
// If at least one geometry field is found
foreach ($fields_meta as $meta) {
if ($meta->type == self::GEOMETRY_FIELD) {
$geometry_found = true;
break;
}
}
if ($geometry_found) {
$results_operations_html .= PMA_Util::linkOrButton('tbl_gis_visualization.php' . PMA_URL_getCommon($_url_params), PMA_Util::getIcon('b_globe.gif', __('Visualize GIS data'), true), '', true, true, '') . "\n";
}
}
// CREATE VIEW
/**
*
* @todo detect privileges to create a view
* (but see 2006-01-19 note in display_create_table.lib.php,
//.........这里部分代码省略.........
示例12: getItemUnhideDialog
/**
* Returns HTML for the dialog to show hidden navigation items.
*
* @param string $dbName database name
* @param string $itemType type of the items to include
* @param string $tableName table name
*
* @return string HTML for the dialog to show hidden navigation items
*/
public function getItemUnhideDialog($dbName, $itemType = null, $tableName = null)
{
$html = '<form method="post" action="navigation.php" class="ajax">';
$html .= '<fieldset>';
$html .= PMA_URL_getHiddenInputs($dbName, $tableName);
$navTable = PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . "." . PMA_Util::backquote($GLOBALS['cfgRelation']['navigationhiding']);
$sqlQuery = "SELECT `item_name`, `item_type` FROM " . $navTable . " WHERE `username`='" . PMA_Util::sqlAddSlashes($GLOBALS['cfg']['Server']['user']) . "'" . " AND `db_name`='" . PMA_Util::sqlAddSlashes($dbName) . "'" . " AND `table_name`='" . (!empty($tableName) ? PMA_Util::sqlAddSlashes($tableName) : '') . "'";
$result = PMA_queryAsControlUser($sqlQuery, false);
$hidden = array();
if ($result) {
while ($row = $GLOBALS['dbi']->fetchArray($result)) {
$type = $row['item_type'];
if (!isset($hidden[$type])) {
$hidden[$type] = array();
}
$hidden[$type][] = $row['item_name'];
}
}
$GLOBALS['dbi']->freeResult($result);
$typeMap = array('event' => __('Events:'), 'function' => __('Functions:'), 'procedure' => __('Procedures:'), 'table' => __('Tables:'), 'view' => __('Views:'));
if (empty($tableName)) {
$first = true;
foreach ($typeMap as $t => $lable) {
if ((empty($itemType) || $itemType == $t) && isset($hidden[$t])) {
$html .= (!$first ? '<br/>' : '') . '<strong>' . $lable . '</strong>';
$html .= '<table width="100%"><tbody>';
$odd = true;
foreach ($hidden[$t] as $hiddenItem) {
$html .= '<tr class="' . ($odd ? 'odd' : 'even') . '">';
$html .= '<td>' . htmlspecialchars($hiddenItem) . '</td>';
$html .= '<td style="width:80px"><a href="navigation.php' . PMA_URL_getCommon() . '&unhideNavItem=true' . '&itemType=' . urlencode($t) . '&itemName=' . urlencode($hiddenItem) . '&dbName=' . urlencode($dbName) . '"' . ' class="unhideNavItem ajax">' . PMA_Util::getIcon('lightbulb.png', __('Show')) . '</a></td>';
$odd = !$odd;
}
$html .= '</tbody></table>';
$first = false;
}
}
}
$html .= '</fieldset>';
$html .= '</form>';
return $html;
}
示例13: getZoomResultsForm
/**
* Provides form for displaying point data and also the scatter plot
* (for tbl_zoom_select.php)
*
* @param string $goto Goto URL
* @param array $data Array containing SQL query data
*
* @return string form's html
*/
public function getZoomResultsForm($goto, $data)
{
$html_output = '';
$titles = array('Browse' => PMA_Util::getIcon('b_browse.png', __('Browse foreign values')));
$html_output .= '<form method="post" action="tbl_zoom_select.php"' . ' name="displayResultForm" id="zoom_display_form"' . ' class="ajax"' . '>';
$html_output .= PMA_URL_getHiddenInputs($this->_db, $this->_table);
$html_output .= '<input type="hidden" name="goto" value="' . $goto . '" />';
$html_output .= '<input type="hidden" name="back" value="tbl_zoom_select.php" />';
$html_output .= '<fieldset id="displaySection">';
$html_output .= '<legend>' . __('Browse/Edit the points') . '</legend>';
//JSON encode the data(query result)
$html_output .= '<center>';
if (isset($_POST['zoom_submit']) && !empty($data)) {
$html_output .= '<div id="resizer">';
$html_output .= '<center><a href="#" onclick="displayHelp();">' . __('How to use') . '</a></center>';
$html_output .= '<div id="querydata" style="display:none">' . json_encode($data) . '</div>';
$html_output .= '<div id="querychart"></div>';
$html_output .= '<button class="button-reset">' . __('Reset zoom') . '</button>';
$html_output .= '</div>';
}
$html_output .= '</center>';
//Displays rows in point edit form
$html_output .= '<div id="dataDisplay" style="display:none">';
$html_output .= '<table><thead>';
$html_output .= '<tr>';
$html_output .= '<th>' . __('Column') . '</th>' . '<th>' . __('Null') . '</th>' . '<th>' . __('Value') . '</th>';
$html_output .= '</tr>';
$html_output .= '</thead>';
$html_output .= '<tbody>';
$odd_row = true;
for ($column_index = 0, $nb = count($this->_columnNames); $column_index < $nb; $column_index++) {
$fieldpopup = $this->_columnNames[$column_index];
$foreignData = PMA_getForeignData($this->_foreigners, $fieldpopup, false, '', '');
$html_output .= '<tr class="noclick ' . ($odd_row ? 'odd' : 'even') . '">';
$odd_row = !$odd_row;
//Display column Names
$html_output .= '<th>' . htmlspecialchars($this->_columnNames[$column_index]) . '</th>';
//Null checkbox if column can be null
$html_output .= '<th>' . ($this->_columnNullFlags[$column_index] == 'YES' ? '<input type="checkbox" class="checkbox_null"' . ' name="criteriaColumnNullFlags[' . $column_index . ']"' . ' id="edit_fields_null_id_' . $column_index . '" />' : '');
$html_output .= '</th>';
//Column's Input box
$html_output .= '<th>';
$html_output .= $this->_getInputbox($foreignData, $fieldpopup, $this->_columnTypes[$column_index], $column_index, $titles, $GLOBALS['cfg']['ForeignKeyMaxLimit'], '', false, true);
$html_output .= '</th></tr>';
}
$html_output .= '</tbody></table>';
$html_output .= '</div>';
$html_output .= '<input type="hidden" id="queryID" name="sql_query" />';
$html_output .= '</form>';
return $html_output;
}
示例14: PMA_getHtmlForDisplayUserOverviewPage
/**
* Get HTML snippet for display user overview page
*
* @param string $link_edit standard link to edit privileges
* @param string $pmaThemeImage a image source link
* @param string $text_dir text directory
* @param string $conditional_class if ajaxable 'Ajax' otherwise ''
* @param string $link_export standard link to export privileges
*
* @return string $html_output
*/
function PMA_getHtmlForDisplayUserOverviewPage($link_edit, $pmaThemeImage, $text_dir, $conditional_class, $link_export)
{
$html_output = '<h2>' . "\n" . PMA_Util::getIcon('b_usrlist.png') . __('Users overview') . "\n" . '</h2>' . "\n";
$sql_query = 'SELECT *,' . " IF(`Password` = _latin1 '', 'N', 'Y') AS 'Password'" . ' FROM `mysql`.`user`';
$sql_query .= isset($_REQUEST['initial']) ? PMA_rangeOfUsers($_REQUEST['initial']) : '';
$sql_query .= ' ORDER BY `User` ASC, `Host` ASC;';
$res = PMA_DBI_try_query($sql_query, null, PMA_DBI_QUERY_STORE);
if (!$res) {
// the query failed! This may have two reasons:
// - the user does not have enough privileges
// - the privilege tables use a structure of an earlier version.
// so let's try a more simple query
$sql_query = 'SELECT * FROM `mysql`.`user`';
$res = PMA_DBI_try_query($sql_query, null, PMA_DBI_QUERY_STORE);
if (!$res) {
$html_output .= PMA_Message::error(__('No Privileges'))->getDisplay();
PMA_DBI_free_result($res);
unset($res);
} else {
// This message is hardcoded because I will replace it by
// a automatic repair feature soon.
$raw = 'Your privilege table structure seems to be older than' . ' this MySQL version!<br />' . 'Please run the <code>mysql_upgrade</code> command' . '(<code>mysql_fix_privilege_tables</code> on older systems)' . ' that should be included in your MySQL server distribution' . ' to solve this problem!';
$html_output .= PMA_Message::rawError($raw)->getDisplay();
}
} else {
$db_rights = PMA_getDbRightsForUserOverview();
// for all initials, even non A-Z
$array_initials = array();
/**
* Displays the initials
* Also not necassary if there is less than 20 privileges
*/
if (PMA_DBI_num_rows($res) > 20) {
$html_output .= PMA_getHtmlForDisplayTheInitials($array_initials, $conditional_class);
}
/**
* Display the user overview
* (if less than 50 users, display them immediately)
*/
if (isset($_REQUEST['initial']) || isset($_REQUEST['showall']) || PMA_DBI_num_rows($res) < 50) {
$html_output .= PMA_getUsersOverview($res, $db_rights, $link_edit, $pmaThemeImage, $text_dir, $conditional_class, $link_export);
} else {
$html_output .= PMA_getAddUserHtmlFieldset($conditional_class);
}
// end if (display overview)
if (!$GLOBALS['is_ajax_request'] || !empty($_REQUEST['ajax_page_request'])) {
$flushnote = new PMA_Message(__('Note: phpMyAdmin gets the users\' privileges directly from MySQL\'s privilege tables. The content of these tables may differ from the privileges the server uses, if they have been changed manually. In this case, you should %sreload the privileges%s before you continue.'), PMA_Message::NOTICE);
$flushLink = '<a href="server_privileges.php?' . $GLOBALS['url_query'] . '&' . 'flush_privileges=1" id="reload_privileges_anchor" ' . 'class="' . $conditional_class . '">';
$flushnote->addParam($flushLink, false);
$flushnote->addParam('</a>', false);
$html_output .= $flushnote->getDisplay();
}
return $html_output;
}
}
示例15: PMA_getHTMLforCentralColumnsTableRow
/**
* build html for a row in central columns table
*
* @param array $row array contains complete information of
* a particular row of central list table
* @param boolean $odd_row set true if the row is at odd number position
* @param int $row_num position the row in the table
* @param string $db current database
*
* @return html of a particular row in the central columns table.
*/
function PMA_getHTMLforCentralColumnsTableRow($row, $odd_row, $row_num, $db)
{
$tableHtml = '<tr data-rownum="' . $row_num . '" id="f_' . $row_num . '" ' . 'class="' . ($odd_row ? 'odd' : 'even') . '">' . PMA_URL_getHiddenInputs($db) . '<input type="hidden" name="edit_save" value="save">' . '<td class="nowrap">' . '<input type="checkbox" class="checkall" name="selected_fld[]" ' . 'value="' . htmlspecialchars($row['col_name']) . '" ' . 'id="checkbox_row_' . $row_num . '"/>' . '</td>' . '<td id="edit_' . $row_num . '" class="edit center">' . '<a href="#">' . PMA_Util::getIcon('b_edit.png', __('Edit')) . '</a></td>' . '<td class="del_row" data-rownum = "' . $row_num . '">' . '<a hrf="#">' . PMA_Util::getIcon('b_drop.png', __('Delete')) . '</a>' . '<input type="submit" data-rownum = "' . $row_num . '"' . ' class="edit_cancel_form" value="Cancel"></td>' . '<td id="save_' . $row_num . '" style="display:none">' . '<input type="submit" data-rownum = "' . $row_num . '"' . ' class="edit_save_form" value="Save"></td>';
$tableHtml .= '<td name="col_name" class="nowrap">' . '<span>' . htmlspecialchars($row['col_name']) . '</span>' . '<input name="orig_col_name" type="hidden" ' . 'value="' . htmlspecialchars($row['col_name']) . '">' . PMA_getHtmlForColumnName($row_num, 0, 0, array('Field' => $row['col_name']), array('central_columnswork' => false)) . '</td>';
$tableHtml .= '<td name = "col_type" class="nowrap"><span>' . htmlspecialchars($row['col_type']) . '</span>' . PMA_getHtmlForColumnType($row_num, 1, 0, mb_strtoupper($row['col_type']), array()) . '</td>';
$tableHtml .= '<td class="nowrap" name="col_length">' . '<span>' . ($row['col_length'] ? htmlspecialchars($row['col_length']) : "") . '</span>' . PMA_getHtmlForColumnLength($row_num, 2, 0, 8, $row['col_length']) . '</td>';
$meta = array();
if (!isset($row['col_default']) || $row['col_default'] == '') {
$meta['DefaultType'] = 'NONE';
} else {
if ($row['col_default'] == 'CURRENT_TIMESTAMP' || $row['col_default'] == 'NULL') {
$meta['DefaultType'] = $row['col_default'];
} else {
$meta['DefaultType'] = 'USER_DEFINED';
$meta['DefaultValue'] = $row['col_default'];
}
}
$tableHtml .= '<td class="nowrap" name="col_default"><span>' . (isset($row['col_default']) ? htmlspecialchars($row['col_default']) : 'None') . '</span>' . PMA_getHtmlForColumnDefault($row_num, 3, 0, mb_strtoupper($row['col_type']), '', $meta) . '</td>';
$tableHtml .= '<td name="collation" class="nowrap">' . '<span>' . htmlspecialchars($row['col_collation']) . '</span>' . PMA_getHtmlForColumnCollation($row_num, 4, 0, array('Collation' => $row['col_collation'])) . '</td>';
$tableHtml .= '<td class="nowrap" name="col_attribute">' . '<span>' . ($row['col_attribute'] ? htmlspecialchars($row['col_attribute']) : "") . '</span>' . PMA_getHtmlForColumnAttribute($row_num, 5, 0, array(), $row['col_attribute'], false, null) . '</td>';
$tableHtml .= '<td class="nowrap" name="col_isNull">' . '<span>' . ($row['col_isNull'] ? __('Yes') : __('No')) . '</span>' . PMA_getHtmlForColumnNull($row_num, 6, 0, array('Null' => $row['col_isNull'])) . '</td>';
$tableHtml .= '<td class="nowrap" name="col_extra"><span>' . htmlspecialchars($row['col_extra']) . '</span>' . PMA_getHtmlForColumnExtra($row_num, 7, 0, array('Extra' => $row['col_extra'])) . '</td>';
$tableHtml .= '</tr>';
return $tableHtml;
}