本文整理汇总了PHP中PMA_buildHtmlForDb函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_buildHtmlForDb函数的具体用法?PHP PMA_buildHtmlForDb怎么用?PHP PMA_buildHtmlForDb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_buildHtmlForDb函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testBuildHtmlForDb
/**
* Test for PMA_buildHtmlForDb
*
* @param array $current Current
* @param boolean $is_superuser Is superuser
* @param string $url_query URL query
* @param array $column_order Column order
* @param array $replication_types Replication types
* @param array $replication_info Replication info
* @param array $tags Tags
*
* @return void
* @dataProvider providerForTestBuildHtmlForDb
*
* @group medium
*/
public function testBuildHtmlForDb($current, $is_superuser, $url_query, $column_order, $replication_types, $replication_info, $html_segments)
{
$result = PMA_buildHtmlForDb($current, $is_superuser, $url_query, $column_order, $replication_types, $replication_info);
$this->assertEquals($column_order, $result[0]);
foreach ($html_segments as $html_segment) {
$this->assertContains($html_segment, $result[1]);
}
}
示例2: testBuildHtmlForDb
/**
* Test for PMA_buildHtmlForDb
*
* @param array $current Current
* @param boolean $is_superuser Is superuser
* @param string $url_query URL query
* @param array $column_order Column order
* @param array $replication_types Replication types
* @param array $replication_info Replication info
* @param array $tags Tags
*
* @return void
* @dataProvider providerForTestBuildHtmlForDb
*
* @group medium
*/
public function testBuildHtmlForDb($current, $is_superuser, $url_query, $column_order, $replication_types, $replication_info, $tags)
{
$result = PMA_buildHtmlForDb($current, $is_superuser, $url_query, $column_order, $replication_types, $replication_info);
$this->assertEquals($column_order, $result[0]);
foreach ($tags as $value) {
$this->assertTag($value, $result[1]);
}
}
示例3: 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\libraries\Response::getInstance();
$response->addJSON('message', $message);
$response->addJSON('new_db_string', $new_db_string);
$response->addJSON('sql_query', PMA\libraries\Util::getMessage(null, $sql_query, 'success'));
$response->addJSON('url_query', PMA\libraries\Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database') . $url_query . '&db=' . urlencode($current['SCHEMA_NAME']));
} else {
include_once '' . $cfg['DefaultTabDatabase'];
}
}
示例4: PMA_getHtmlAndColumnOrderForDatabaseList
/**
* Returns the html for Database List and Column order
*
* @param array $databases GBI return databases
* @param bool $is_superuser User status
* @param Array $url_query Url query
* @param string $column_order column order
* @param string $replication_types replication types
* @param string $replication_info replication info
*
* @return Array
*/
function PMA_getHtmlAndColumnOrderForDatabaseList($databases, $is_superuser, $url_query, $column_order, $replication_types, $replication_info)
{
$odd_row = true;
$html = '<tbody>' . "\n";
foreach ($databases as $current) {
$tr_class = $odd_row ? 'odd' : 'even';
if ($GLOBALS['dbi']->isSystemSchema($current['SCHEMA_NAME'], true)) {
$tr_class .= ' noclick';
}
$html .= '<tr class="' . $tr_class . '">' . "\n";
$odd_row = !$odd_row;
list($column_order, $generated_html) = PMA_buildHtmlForDb($current, $is_superuser, $url_query, $column_order, $replication_types, $replication_info);
$html .= $generated_html;
$html .= '</tr>' . "\n";
}
// end foreach ($databases as $key => $current)
unset($current, $odd_row);
$html .= '</tbody>';
return array($html, $column_order);
}
示例5: elseif
} elseif ($type == "slave") {
$name = __('Slave replication');
}
if (${"server_{$type}_status"}) {
echo ' <th>' . $name . '</th>' . "\n";
}
}
if ($is_superuser) {
echo ' <th>' . ($cfg['PropertiesIconic'] ? '' : __('Action')) . "\n" . ' </th>' . "\n";
}
echo '</tr>' . "\n" . '</thead>' . "\n" . '<tbody>' . "\n";
$odd_row = true;
foreach ($databases as $current) {
echo '<tr class="' . ($odd_row ? 'odd' : 'even') . '">' . "\n";
$odd_row = !$odd_row;
list($column_order, $generated_html) = PMA_buildHtmlForDb($current, $is_superuser, isset($checkall) ? $checkall : '', $url_query, $column_order, $replication_types, $replication_info);
echo $generated_html;
echo '</tr>' . "\n";
}
// end foreach ($databases as $key => $current)
unset($current, $odd_row);
echo '<tr id="db_summary_row">' . "\n";
if ($is_superuser || $cfg['AllowUserDropDatabase']) {
echo ' <th></th>' . "\n";
}
echo ' <th>' . __('Total') . ': <span id="databases_count">' . $databases_count . '</span></th>' . "\n";
foreach ($column_order as $stat_name => $stat) {
if (array_key_exists($stat_name, $first_database)) {
if ($stat['format'] === 'byte') {
list($value, $unit) = PMA_formatByteDown($stat['footer'], 3, 1);
} elseif ($stat['format'] === 'number') {
示例6: testBuildHtmlForDb
/**
* Test for PMA_buildHtmlForDb
*
* @param array $current
* @param boolean $is_superuser
* @param string $checkall
* @param string $url_query
* @param array $column_order
* @param array $replication_types
* @param array $replication_info
* @param string $output
*
* @return void
* @dataProvider providerForTestBuildHtmlForDb
*
* @group medium
*/
public function testBuildHtmlForDb($current, $is_superuser, $checkall,
$url_query, $column_order, $replication_types, $replication_info, $output
) {
$this->assertEquals(
array($column_order, $output),
PMA_buildHtmlForDb(
$current, $is_superuser, $checkall, $url_query,
$column_order, $replication_types, $replication_info
)
);
}
示例7: testPMA_buildHtmlForDb
/**
* Test for PMA_buildHtmlForDb
*
* @param array $current
* @param boolean $is_superuser
* @param string $checkall
* @param string $url_query
* @param array $column_order
* @param array $replication_types
* @param array $replication_info
* @param $output
*
* @dataProvider providerForTestPMA_buildHtmlForDb
*
* @group medium
*/
public function testPMA_buildHtmlForDb($current, $is_superuser, $checkall, $url_query,$column_order, $replication_types, $replication_info, $output){
if (! function_exists('PMA_is_system_schema')) {
function PMA_is_system_schema()
{
return false;
}
}
if (! function_exists('p')) {
function p()
{
return;
}
}
if (! defined('PMA_DRIZZLE')) {
define('PMA_DRIZZLE', false);
}
$GLOBALS['cfg']['PropertiesIconic'] = true;
$_SESSION['PMA_Theme'] = new PMA_Theme();
$GLOBALS['pmaThemeImage'] = '';
$this->assertEquals(
PMA_buildHtmlForDb($current, $is_superuser, $checkall, $url_query,
$column_order, $replication_types, $replication_info),
$output
);
}