本文整理汇总了PHP中PMA_getListForExportUserDefinition函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getListForExportUserDefinition函数的具体用法?PHP PMA_getListForExportUserDefinition怎么用?PHP PMA_getListForExportUserDefinition使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_getListForExportUserDefinition函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ob_get_contents
$content = ob_get_contents();
ob_end_clean();
$response->addHTML($content . "\n");
} else {
if (!empty($GLOBALS['message'])) {
$response->addHTML(PMA_Util::getMessage($GLOBALS['message']));
unset($GLOBALS['message']);
}
}
/**
* Displays the page
*/
$response->addHTML(PMA_getHtmlForUserGroupDialog(isset($username) ? $username : null, $cfgRelation['menuswork']));
// export user definition
if (isset($_REQUEST['export']) || isset($_REQUEST['submit_mult']) && $_REQUEST['submit_mult'] == 'export') {
list($title, $export) = PMA_getListForExportUserDefinition(isset($username) ? $username : null, isset($hostname) ? $hostname : null);
unset($username, $hostname, $grants, $one_grant);
$response = PMA_Response::getInstance();
if ($GLOBALS['is_ajax_request']) {
$response->addJSON('message', $export);
$response->addJSON('title', $title);
exit;
} else {
$response->addHTML("<h2>{$title}</h2>{$export}");
}
}
if (isset($_REQUEST['adduser'])) {
// Add user
$response->addHTML(PMA_getHtmlForAddUser(isset($dbname) ? $dbname : ''));
} elseif (isset($_REQUEST['checkprivsdb'])) {
if (isset($_REQUEST['checkprivstable'])) {
示例2: testPMAGetHtmlForExportUserDefinition
/**
* Test for PMA_getListForExportUserDefinition
*
* @return void
*/
public function testPMAGetHtmlForExportUserDefinition()
{
$username = "PMA_username";
$hostname = "PMA_hostname";
list($title, $export) = PMA_getListForExportUserDefinition($username, $hostname);
//validate 1: $export
$this->assertContains('grant user2 delete', $export);
$this->assertContains('grant user1 select', $export);
$this->assertContains('<textarea class="export"', $export);
//validate 2: $title
$title_user = __('User') . ' `' . htmlspecialchars($username) . '`@`' . htmlspecialchars($hostname) . '`';
$this->assertContains($title_user, $title);
}
示例3: testPMAGetHtmlForExportUserDefinition
/**
* Test for PMA_getListForExportUserDefinition
*
* @return void
*/
public function testPMAGetHtmlForExportUserDefinition()
{
$username = "PMA_username";
$hostname = "PMA_hostname";
$GLOBALS['cfg']['TextareaCols'] = 'TextareaCols';
$GLOBALS['cfg']['TextareaRows'] = 'TextareaCols';
list($title, $export) = PMA_getListForExportUserDefinition($username, $hostname);
//validate 1: $export
$result = '<textarea class="export" cols="' . $GLOBALS['cfg']['TextareaCols'] . '" rows="' . $GLOBALS['cfg']['TextareaRows'];
$this->assertContains('grant user2 delete', $export);
$this->assertContains('grant user1 select', $export);
$this->assertContains($result, $export);
//validate 2: $title
$title_user = __('User') . ' `' . htmlspecialchars($username) . '`@`' . htmlspecialchars($hostname) . '`';
$this->assertContains($title_user, $title);
}