本文整理汇总了PHP中PMA_getIcon函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getIcon函数的具体用法?PHP PMA_getIcon怎么用?PHP PMA_getIcon使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_getIcon函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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>" . __('New') . "</legend>\n";
$retval .= " <div class='wrap'>\n";
if (PMA_currentUserHasPrivilege($priv, $db)) {
$retval .= " <a {$ajax_class['add']} ";
$retval .= "href='db_" . strtolower($name) . "s.php";
$retval .= "?{$url_query}&add_item=1'>";
$retval .= PMA_getIcon($icon);
$retval .= PMA_RTE_getWord('add') . "</a>\n";
} else {
$retval .= " " . PMA_getIcon($icon);
$retval .= PMA_RTE_getWord('no_create') . "\n";
}
$retval .= " " . PMA_showMySQLDocu('SQL-Syntax', $docu) . "\n";
$retval .= " </div>\n";
$retval .= "</fieldset>\n";
$retval .= "<!-- ADD " . $name . " FORM END -->\n\n";
return $retval;
}
示例2: testBuildActionTitles
function testBuildActionTitles()
{
$titles = array();
$titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse'));
$titles['NoBrowse'] = PMA_getIcon('bd_browse.png', __('Browse'));
$titles['Search'] = PMA_getIcon('b_select.png', __('Search'));
$titles['NoSearch'] = PMA_getIcon('bd_select.png', __('Search'));
$titles['Insert'] = PMA_getIcon('b_insrow.png', __('Insert'));
$titles['NoInsert'] = PMA_getIcon('bd_insrow.png', __('Insert'));
$titles['Structure'] = PMA_getIcon('b_props.png', __('Structure'));
$titles['Drop'] = PMA_getIcon('b_drop.png', __('Drop'));
$titles['NoDrop'] = PMA_getIcon('bd_drop.png', __('Drop'));
$titles['Empty'] = PMA_getIcon('b_empty.png', __('Empty'));
$titles['NoEmpty'] = PMA_getIcon('bd_empty.png', __('Empty'));
$titles['Edit'] = PMA_getIcon('b_edit.png', __('Edit'));
$titles['NoEdit'] = PMA_getIcon('bd_edit.png', __('Edit'));
$titles['Export'] = PMA_getIcon('b_export.png', __('Export'));
$titles['NoExport'] = PMA_getIcon('bd_export.png', __('Export'));
$titles['Execute'] = PMA_getIcon('b_nextpage.png', __('Execute'));
$titles['NoExecute'] = PMA_getIcon('bd_nextpage.png', __('Execute'));
$this->assertEquals($titles, PMA_buildActionTitles());
}
示例3: 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_getIcon('b_comment.png', $alternate_text, true)
);
}
示例4: PMA_buttonOrImage
/**
* Generate a button or image tag
*
* @uses PMA_USR_BROWSER_AGENT
* @uses $GLOBALS['pmaThemeImage']
* @uses $GLOBALS['cfg']['PropertiesIconic']
* @param string name of button element
* @param string class of button element
* @param string name of image element
* @param string text to display
* @param string image to display
*
* @access public
* @author Michal Cihar (michal@cihar.com)
*/
function PMA_buttonOrImage($button_name, $button_class, $image_name, $text, $image)
{
if (false === $GLOBALS['cfg']['PropertiesIconic']) {
echo ' <input type="submit" name="' . $button_name . '"' . ' value="' . htmlspecialchars($text) . '"' . ' title="' . htmlspecialchars($text) . '" />' . "\n";
return;
}
/* Opera has trouble with <input type="image"> */
/* IE has trouble with <button> */
if (PMA_USR_BROWSER_AGENT != 'IE') {
echo '<button class="' . $button_class . '" type="submit"' . ' name="' . $button_name . '" value="' . htmlspecialchars($text) . '"' . ' title="' . htmlspecialchars($text) . '">' . "\n" . PMA_getIcon($image, $text) . '</button>' . "\n";
} else {
echo '<input type="image" name="' . $image_name . '" value="' . htmlspecialchars($text) . '" title="' . htmlspecialchars($text) . '" src="' . $GLOBALS['pmaThemeImage'] . $image . '" />' . ($GLOBALS['cfg']['PropertiesIconic'] === 'both' ? ' ' . htmlspecialchars($text) : '') . "\n";
}
}
示例5: PMA_getForeignFields_Values
/**
* Creates the HTML content for:
* 1) Browsing foreign data for a field.
* 2) Creating elements for search criteria input on fields.
*
* @param array $foreigners Array of foreign keys
* @param array $foreignData Foreign keys data
* @param string $field Column name
* @param string $tbl_fields_type Column type
* @param int $i Column index
* @param string $db Selected database
* @param string $table Selected table
* @param array $titles Selected title
* @param int $foreignMaxLimit Max limit of displaying foreign elements
* @param array $fields Array of search criteria inputs
* @param bool $in_fbs Whether we are in 'function based search'
* @param bool $in_zoom_search_edit Whether we are in zoom search edit
*
* @return string HTML content for viewing foreing data and elements
* for search criteria input.
*/
function PMA_getForeignFields_Values($foreigners, $foreignData, $field, $tbl_fields_type, $i, $db, $table, $titles, $foreignMaxLimit, $fields, $in_fbs = false, $in_zoom_search_edit = false)
{
$str = '';
if ($foreigners && isset($foreigners[$field]) && is_array($foreignData['disp_row'])) {
// f o r e i g n k e y s
$str .= '<select name="fields[' . $i . ']" id="fieldID_' . $i . '">' . "\n";
// go back to first row
// here, the 4th parameter is empty because there is no current
// value of data for the dropdown (the search page initial values
// are displayed empty)
$str .= PMA_foreignDropdown($foreignData['disp_row'], $foreignData['foreign_field'], $foreignData['foreign_display'], '', $foreignMaxLimit);
$str .= '</select>' . "\n";
} elseif ($foreignData['foreign_link'] == true) {
if (isset($fields[$i]) && is_string($fields[$i])) {
$str .= '<input type="text" id="fieldID_' . $i . '" name="fields[' . $i . ']" value="' . $fields[$i] . '" id="field_' . md5($field) . '[' . $i . ']" class="textfield" />';
} else {
$str .= '<input type="text" id="fieldID_' . $i . '" name="fields[' . $i . ']" id="field_' . md5($field) . '[' . $i . ']" class="textfield" />';
}
$str .= <<<EOT
<a target="_blank" onclick="window.open(this.href, 'foreigners', 'width=640,height=240,scrollbars=yes'); return false" href="browse_foreigners.php?
EOT;
$str .= '' . PMA_generate_common_url($db, $table) . '&field=' . urlencode($field) . '&fieldkey=' . $i . '"';
if ($in_zoom_search_edit) {
$str .= ' class="browse_foreign"';
}
$str .= '>' . str_replace("'", "\\'", $titles['Browse']) . '</a>';
} elseif (in_array($tbl_fields_type[$i], PMA_getGISDatatypes())) {
// g e o m e t r y
$str .= '<input type="text" name="fields[' . $i . ']"' . ' size="40" class="textfield" id="field_' . $i . '" />' . "\n";
if ($in_fbs) {
$edit_url = 'gis_data_editor.php?' . PMA_generate_common_url();
$edit_str = PMA_getIcon('b_edit.png', __('Edit/Insert'));
$str .= '<span class="open_search_gis_editor">';
$str .= PMA_linkOrButton($edit_url, $edit_str, array(), false, false, '_blank');
$str .= '</span>';
}
} elseif (strncasecmp($tbl_fields_type[$i], 'enum', 4) == 0 || strncasecmp($tbl_fields_type[$i], 'set', 3) == 0 && $in_zoom_search_edit) {
// e n u m s a n d s e t s
// Enum in edit mode --> dropdown
// Enum in search mode --> multiselect
// Set in edit mode --> multiselect
// Set in search mode --> input (skipped here, so the 'else'
// section would handle it)
$value = explode(', ', str_replace("'", '', substr($tbl_fields_type[$i], 5, -1)));
$cnt_value = count($value);
if (strncasecmp($tbl_fields_type[$i], 'enum', 4) && !$in_zoom_search_edit || strncasecmp($tbl_fields_type[$i], 'set', 3) && $in_zoom_search_edit) {
$str .= '<select name="fields[' . $i . '][]" id="fieldID_' . $i . '">' . "\n";
} else {
$str .= '<select name="fields[' . $i . '][]" id="fieldID_' . $i . '"' . ' multiple="multiple" size="' . min(3, $cnt_value) . '">' . "\n";
}
for ($j = 0; $j < $cnt_value; $j++) {
if (isset($fields[$i]) && is_array($fields[$i]) && in_array($value[$j], $fields[$i])) {
$str .= '<option value="' . $value[$j] . '" Selected>' . $value[$j] . '</option>';
} else {
$str .= '<option value="' . $value[$j] . '">' . $value[$j] . '</option>';
}
}
// end for
$str .= '</select>' . "\n";
} else {
// o t h e r c a s e s
$the_class = 'textfield';
$type = $tbl_fields_type[$i];
if ($type == 'date') {
$the_class .= ' datefield';
} elseif ($type == 'datetime' || substr($type, 0, 9) == 'timestamp') {
$the_class .= ' datetimefield';
} elseif (substr($type, 0, 3) == 'bit') {
$the_class .= ' bit';
}
if (isset($fields[$i]) && is_string($fields[$i])) {
$str .= '<input type="text" name="fields[' . $i . ']"' . ' size="40" class="' . $the_class . '" id="fieldID_' . $i . '" value = "' . $fields[$i] . '"/>' . "\n";
} else {
$str .= '<input type="text" name="fields[' . $i . ']"' . ' size="40" class="' . $the_class . '" id="fieldID_' . $i . '" />' . "\n";
}
}
return $str;
}
示例6: PMA_generate_common_hidden_inputs
}
}
if (isset($clause_is_unique)) {
$_form_params['clause_is_unique'] = $clause_is_unique;
}
?>
<!-- Insert/Edit form -->
<form method="post" action="tbl_replace.php" name="insertForm" <?php
if ($is_upload) {
echo ' enctype="multipart/form-data"';
}
?>
>
<?php
echo PMA_generate_common_hidden_inputs($_form_params);
$titles['Browse'] = PMA_getIcon('b_browse.png', $strBrowseForeignValues);
// Set if we passed the first timestamp field
$timestamp_seen = 0;
$fields_cnt = count($table_fields);
$tabindex = 0;
$tabindex_for_function = +3000;
$tabindex_for_null = +6000;
$tabindex_for_value = 0;
$o_rows = 0;
$biggest_max_file_size = 0;
// user can toggle the display of Function column
// (currently does not work for multi-edits)
$url_params['db'] = $db;
$url_params['table'] = $table;
if (isset($where_clause)) {
$url_params['where_clause'] = trim($where_clause);
示例7: PMA_generate_common_hidden_inputs
if ($bs_tables[$table_key]['Exists']) {
$oneBSTableExists = TRUE;
} else {
$allBSTablesExist = FALSE;
}
}
?>
<form method="post" action="./db_operations.php">
<?php
echo PMA_generate_common_hidden_inputs($db);
?>
<fieldset>
<legend>
<?php
echo PMA_getIcon('b_edit.png', $strBLOBRepository, false, true);
?>
</legend>
<?php
echo $strBLOBRepositoryStatus;
?>
:
<?php
// if the blobstreaming tables exist, provide option to disable the BLOB repository
if ($allBSTablesExist) {
?>
<?php
echo $strBLOBRepositoryEnabled;
?>
示例8: PMA_buildActionTitles
/**
* Build titles and icons for action links
*
* @return array the action titles
* @uses PMA_getIcon()
*/
function PMA_buildActionTitles()
{
$titles = array();
$titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse'), true);
$titles['NoBrowse'] = PMA_getIcon('bd_browse.png', __('Browse'), true);
$titles['Search'] = PMA_getIcon('b_select.png', __('Search'), true);
$titles['NoSearch'] = PMA_getIcon('bd_select.png', __('Search'), true);
$titles['Insert'] = PMA_getIcon('b_insrow.png', __('Insert'), true);
$titles['NoInsert'] = PMA_getIcon('bd_insrow.png', __('Insert'), true);
$titles['Structure'] = PMA_getIcon('b_props.png', __('Structure'), true);
$titles['Drop'] = PMA_getIcon('b_drop.png', __('Drop'), true);
$titles['NoDrop'] = PMA_getIcon('bd_drop.png', __('Drop'), true);
$titles['Empty'] = PMA_getIcon('b_empty.png', __('Empty'), true);
$titles['NoEmpty'] = PMA_getIcon('bd_empty.png', __('Empty'), true);
$titles['Edit'] = PMA_getIcon('b_edit.png', __('Edit'), true);
return $titles;
}
示例9: PMA_buildHtmlForDb
function PMA_buildHtmlForDb($current, $is_superuser, $checkall, $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[]" title="' . htmlspecialchars($current['SCHEMA_NAME']) . '" value="' . htmlspecialchars($current['SCHEMA_NAME']) . '" ';
if ($current['SCHEMA_NAME'] != 'mysql' && $current['SCHEMA_NAME'] != 'information_schema') {
$out .= (empty($checkall) ? '' : 'checked="checked" ') . '/>';
} else {
$out .= ' disabled="disabled" />';
}
$out .= '</td>';
}
$out .= '<td class="name">' . ' <a onclick="' . 'if (window.parent.openDb && window.parent.openDb(\'' . PMA_jsFormat($current['SCHEMA_NAME'], false) . '\')) return false;' . '" href="index.php?' . $url_query . '&db=' . urlencode($current['SCHEMA_NAME']) . '" title="' . sprintf(__('Jump to database'), htmlspecialchars($current['SCHEMA_NAME'])) . '" target="_parent">' . ' ' . 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_formatByteDown($current[$stat_name], 3, 1);
} elseif ($stat['format'] === 'number') {
$value = PMA_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;">';
if (strlen(array_search($current["SCHEMA_NAME"], $replication_info[$type]['Ignore_DB'])) > 0) {
$out .= PMA_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_getIcon('s_success.png', __('Replicated'));
}
}
$out .= '</td>';
}
}
if ($is_superuser) {
$out .= '<td class="tool">' . '<a onclick="' . 'if (window.parent.setDb) window.parent.setDb(\'' . PMA_jsFormat($current['SCHEMA_NAME']) . '\');' . '" href="./server_privileges.php?' . $url_query . '&checkprivs=' . urlencode($current['SCHEMA_NAME']) . '" title="' . sprintf(__('Check privileges for database "%s".'), htmlspecialchars($current['SCHEMA_NAME'])) . '">' . ' ' . PMA_getIcon('s_rights.png', __('Check Privileges')) . '</a></td>';
}
return array($column_order, $out);
}
示例10: getView
/**
* Show index data
*
* @param string $table The tablename
* @param array $indexes_info Referenced info array
* @param array $indexes_data Referenced data array
* @param boolean $print_mode
* @access public
* @return array Index collection array
*/
public static function getView($table, $schema, $print_mode = false)
{
$indexes = PMA_Index::getFromTable($table, $schema);
if (count($indexes) < 1) {
return PMA_Message::error(__('No index defined!'))->getDisplay();
}
$r = '';
$r .= '<h2>' . __('Indexes') . ': ';
$r .= PMA_showMySQLDocu('optimization', 'optimizing-database-structure');
$r .= '</h2>';
$r .= '<table>';
$r .= '<thead>';
$r .= '<tr>';
if (!$print_mode) {
$r .= '<th colspan="2">' . __('Action') . '</th>';
}
$r .= '<th>' . __('Keyname') . '</th>';
$r .= '<th>' . __('Type') . '</th>';
$r .= '<th>' . __('Unique') . '</th>';
$r .= '<th>' . __('Packed') . '</th>';
$r .= '<th>' . __('Column') . '</th>';
$r .= '<th>' . __('Cardinality') . '</th>';
$r .= '<th>' . __('Collation') . '</th>';
$r .= '<th>' . __('Null') . '</th>';
$r .= '<th>' . __('Comment') . '</th>';
$r .= '</tr>';
$r .= '</thead>';
$r .= '<tbody>';
$odd_row = true;
foreach ($indexes as $index) {
$row_span = ' rowspan="' . $index->getColumnCount() . '" ';
$r .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
if (!$print_mode) {
$this_params = $GLOBALS['url_params'];
$this_params['index'] = $index->getName();
$r .= '<td ' . $row_span . '>' . ' <a href="tbl_indexes.php' . PMA_generate_common_url($this_params) . '">' . PMA_getIcon('b_edit.png', __('Edit')) . '</a>' . '</td>' . "\n";
$this_params = $GLOBALS['url_params'];
if ($index->getName() == 'PRIMARY') {
$this_params['sql_query'] = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP PRIMARY KEY';
$this_params['message_to_show'] = __('The primary key has been dropped');
$js_msg = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP PRIMARY KEY');
} else {
$this_params['sql_query'] = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP INDEX ' . PMA_backquote($index->getName());
$this_params['message_to_show'] = sprintf(__('Index %s has been dropped'), $index->getName());
$js_msg = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP INDEX ' . $index->getName());
}
$r .= '<td ' . $row_span . '>';
$r .= '<input type="hidden" class="drop_primary_key_index_msg" value="' . $js_msg . '" />';
$r .= ' <a ';
if ($GLOBALS['cfg']['AjaxEnable']) {
$r .= 'class="drop_primary_key_index_anchor" ';
}
$r .= ' href="sql.php' . PMA_generate_common_url($this_params) . '" >' . PMA_getIcon('b_drop.png', __('Drop')) . '</a>' . '</td>' . "\n";
}
$r .= '<th ' . $row_span . '>' . htmlspecialchars($index->getName()) . '</th>';
$r .= '<td ' . $row_span . '>' . htmlspecialchars($index->getType()) . '</td>';
$r .= '<td ' . $row_span . '>' . $index->isUnique(true) . '</td>';
$r .= '<td ' . $row_span . '>' . $index->isPacked(true) . '</td>';
foreach ($index->getColumns() as $column) {
if ($column->getSeqInIndex() > 1) {
$r .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
}
$r .= '<td>' . htmlspecialchars($column->getName());
if ($column->getSubPart()) {
$r .= ' (' . $column->getSubPart() . ')';
}
$r .= '</td>';
$r .= '<td>' . htmlspecialchars($column->getCardinality()) . '</td>';
$r .= '<td>' . htmlspecialchars($column->getCollation()) . '</td>';
$r .= '<td>' . htmlspecialchars($column->getNull()) . '</td>';
if ($column->getSeqInIndex() == 1) {
$r .= '<td ' . $row_span . '>' . htmlspecialchars($index->getComments()) . '</td>';
}
$r .= '</tr>';
}
// end foreach $index['Sequences']
$odd_row = !$odd_row;
}
// end while
$r .= '</tbody>';
$r .= '</table>';
if (!$print_mode) {
$r .= PMA_Index::findDuplicates($table, $schema);
}
return $r;
}
示例11: implode
echo implode("\n", $hidden_fields) . "\n";
?>
</div>
</form>
<?php
// display again the table list navigator
PMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']);
?>
</div>
<hr />
<?php
/**
* Work on the database
*/
/* DATABASE WORK */
/* Printable view of a table */
echo '<p>';
echo '<a href="db_printview.php?' . $url_query . '">';
echo PMA_getIcon('b_print.png', __('Print view'), true) . '</a>';
echo '<a href="./db_datadict.php?' . $url_query . '">';
echo PMA_getIcon('b_tblanalyse.png', __('Data Dictionary'), true) . '</a>';
echo '</p>';
if (empty($db_is_information_schema)) {
include './libraries/display_create_table.lib.php';
}
// end if (Create Table dialog)
/**
* Displays the footer
*/
require './libraries/footer.inc.php';
示例12: PMA_displayResultsOperations
/**
* Displays operations that are available on results.
*
* @param array $the_disp_mode the display mode
* @param array $analyzed_sql the analyzed query
*
* @global string $db the database name
* @global string $table the table name
* @global string $sql_query the current SQL query
* @global integer $unlim_num_rows the total number of rows returned by the
* SQL query without any programmatically
* appended "LIMIT" clause
*
* @access private
*
* @see PMA_showMessage(), PMA_setDisplayMode(),
* PMA_displayTableNavigation(), PMA_displayTableHeaders(),
* PMA_displayTableBody(), PMA_displayResultsOperations()
*
* @return nothing
*/
function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql)
{
global $db, $table, $sql_query, $unlim_num_rows, $fields_meta;
$header_shown = false;
$header = '<fieldset><legend>' . __('Query results operations') . '</legend>';
if ($the_disp_mode[6] == '1' || $the_disp_mode[9] == '1') {
// Displays "printable view" link if required
if ($the_disp_mode[9] == '1') {
if (!$header_shown) {
echo $header;
$header_shown = true;
}
$_url_params = array('db' => $db, 'table' => $table, 'printview' => '1', 'sql_query' => $sql_query);
$url_query = PMA_generate_common_url($_url_params);
echo PMA_linkOrButton('sql.php' . $url_query, PMA_getIcon('b_print.png', __('Print view'), true), '', true, true, 'print_view') . "\n";
if ($_SESSION['tmp_user_values']['display_text']) {
$_url_params['display_text'] = 'F';
echo PMA_linkOrButton('sql.php' . PMA_generate_common_url($_url_params), PMA_getIcon('b_print.png', __('Print view (with full texts)'), true), '', true, true, 'print_view') . "\n";
unset($_url_params['display_text']);
}
}
// 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.lib.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'] == '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) {
echo $header;
$header_shown = true;
}
$_url_params['unlim_num_rows'] = $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'] = PMA_DBI_fetch_value("SHOW TABLES");
/* No result (probably no database selected) */
if ($_url_params['table'] === false) {
unset($_url_params['table']);
}
}
echo PMA_linkOrButton('tbl_export.php' . PMA_generate_common_url($_url_params), PMA_getIcon('b_tblexport.png', __('Export'), true), '', true, true, '') . "\n";
// show chart
echo PMA_linkOrButton('tbl_chart.php' . PMA_generate_common_url($_url_params), PMA_getIcon('b_chart.png', __('Display chart'), true), '', true, true, '') . "\n";
// show GIS chart
$geometry_found = false;
// If atleast one geometry field is found
foreach ($fields_meta as $meta) {
if ($meta->type == 'geometry') {
$geometry_found = true;
break;
}
}
if ($geometry_found) {
echo PMA_linkOrButton('tbl_gis_visualization.php' . PMA_generate_common_url($_url_params), PMA_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,
* I think we cannot detect db-specific privileges reliably)
* Note: we don't display a Create view link if we found a PROCEDURE clause
*/
if (!$header_shown) {
//.........这里部分代码省略.........
示例13: getView
/**
* Show index data
*
* @param string $table The tablename
* @param array $indexes_info Referenced info array
* @param array $indexes_data Referenced data array
* @param boolean $print_mode
* @access public
* @return array Index collection array
* @author Garvin Hicking (pma@supergarv.de)
*/
static public function getView($table, $schema, $print_mode = false)
{
$indexes = PMA_Index::getFromTable($table, $schema);
if (count($indexes) < 1) {
return PMA_Message::warning('strNoIndex')->getDisplay();
}
$r = '';
$r .= '<h2>' . $GLOBALS['strIndexes'] . ': ';
$r .= PMA_showMySQLDocu('optimization', 'optimizing-database-structure');
$r .= '</h2>';
$r .= '<table>';
$r .= '<thead>';
$r .= '<tr>';
if (! $print_mode) {
$r .= '<th colspan="2">' . $GLOBALS['strAction'] . '</th>';
}
$r .= '<th>' . $GLOBALS['strKeyname'] . '</th>';
$r .= '<th>' . $GLOBALS['strType'] . '</th>';
$r .= '<th>' . $GLOBALS['strUnique'] . '</th>';
$r .= '<th>' . $GLOBALS['strPacked'] . '</th>';
$r .= '<th>' . $GLOBALS['strField'] . '</th>';
$r .= '<th>' . $GLOBALS['strCardinality'] . '</th>';
$r .= '<th>' . $GLOBALS['strCollation'] . '</th>';
$r .= '<th>' . $GLOBALS['strNull'] . '</th>';
$r .= '<th>' . $GLOBALS['strComment'] . '</th>';
$r .= '</tr>';
$r .= '</thead>';
$r .= '<tbody>';
$odd_row = true;
foreach ($indexes as $index) {
$row_span = ' rowspan="' . $index->getColumnCount() . '" ';
$r .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
if (! $print_mode) {
$this_params = $GLOBALS['url_params'];
$this_params['index'] = $index->getName();
$r .= '<td ' . $row_span . '>'
. ' <a href="tbl_indexes.php' . PMA_generate_common_url($this_params)
. '">' . PMA_getIcon('b_edit.png', $GLOBALS['strEdit']) . '</a>'
. '</td>' . "\n";
$this_params = $GLOBALS['url_params'];
if ($index->getName() == 'PRIMARY') {
$this_params['sql_query'] = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP PRIMARY KEY';
$this_params['zero_rows'] = $GLOBALS['strPrimaryKeyHasBeenDropped'];
$js_msg = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP PRIMARY KEY');
} else {
$this_params['sql_query'] = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP INDEX ' . PMA_backquote($index->getName());
$this_params['zero_rows'] = sprintf($GLOBALS['strIndexHasBeenDropped'], $index->getName());
$js_msg = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP INDEX ' . $index->getName());
}
$r .= '<td ' . $row_span . '>'
. ' <a href="sql.php' . PMA_generate_common_url($this_params)
. '" onclick="return confirmLink(this, \'' . $js_msg . '\')">'
. PMA_getIcon('b_drop.png', $GLOBALS['strDrop']) . '</a>'
. '</td>' . "\n";
}
$r .= '<th ' . $row_span . '>' . htmlspecialchars($index->getName()) . '</th>';
$r .= '<td ' . $row_span . '>' . htmlspecialchars($index->getType()) . '</td>';
$r .= '<td ' . $row_span . '>' . $index->isUnique(true) . '</td>';
$r .= '<td ' . $row_span . '>' . $index->isPacked(true) . '</td>';
foreach ($index->getColumns() as $column) {
if ($column->getSeqInIndex() > 1) {
$r .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
}
$r .= '<td>' . htmlspecialchars($column->getName());
if ($column->getSubPart()) {
$r .= ' (' . $column->getSubPart() . ')';
}
$r .= '</td>';
$r .= '<td>' . htmlspecialchars($column->getCardinality()) . '</td>';
$r .= '<td>' . htmlspecialchars($column->getCollation()) . '</td>';
$r .= '<td>' . htmlspecialchars($column->getNull()) . '</td>';
if ($column->getSeqInIndex() == 1) {
$r .= '<td ' . $row_span . '>'
. htmlspecialchars($index->getComments()) . '</td>';
}
$r .= '</tr>';
} // end foreach $index['Sequences']
//.........这里部分代码省略.........
示例14: __
<tr>
<th width="300"><?php
echo __('Table');
?>
</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
// Print out list of untracked tables
$style = 'odd';
foreach ($my_tables as $key => $tablename) {
if (PMA_Tracker::getVersion($GLOBALS['db'], $tablename) == -1) {
$my_link = '<a href="tbl_tracking.php?' . $url_query . '&table=' . htmlspecialchars($tablename) . '">';
$my_link .= PMA_getIcon('eye.png', __('Track table')) . '</a>';
?>
<tr class="noclick <?php
echo $style;
?>
">
<td><?php
echo htmlspecialchars($tablename);
?>
</td>
<td><?php
echo $my_link;
?>
</td>
</tr>
<?php
示例15: PMA_getIcon
* Does the common work
*/
$GLOBALS['js_include'][] = 'server_privileges.js';
$GLOBALS['js_include'][] = 'functions.js';
$GLOBALS['js_include'][] = 'mootools.js';
$GLOBALS['js_include'][] = 'mootools_common.js';
require './libraries/server_common.inc.php';
require './libraries/replication.inc.php';
require './libraries/replication_gui.lib.php';
require_once './libraries/server_synchronize.lib.php';
/**
* Checks if the user is allowed to do what he tries to...
*/
if (!$is_superuser) {
require './libraries/server_links.inc.php';
echo '<h2>' . "\n" . PMA_getIcon('s_replication.png') . $GLOBALS['strReplication'] . "\n" . '</h2>' . "\n";
PMA_Message::error('strNoPrivileges')->display();
require_once './libraries/footer.inc.php';
}
/**
* Handling control requests
*/
if (isset($GLOBALS['sr_take_action'])) {
$refresh = false;
if (isset($GLOBALS['slave_changemaster'])) {
$_SESSION['replication']['m_username'] = $sr['username'] = PMA_sqlAddslashes($GLOBALS['username']);
$_SESSION['replication']['m_password'] = $sr['pma_pw'] = PMA_sqlAddslashes($GLOBALS['pma_pw']);
$_SESSION['replication']['m_hostname'] = $sr['hostname'] = PMA_sqlAddslashes($GLOBALS['hostname']);
$_SESSION['replication']['m_port'] = $sr['port'] = PMA_sqlAddslashes($GLOBALS['port']);
$_SESSION['replication']['m_correct'] = '';
$_SESSION['replication']['sr_action_status'] = 'error';