本文整理匯總了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);
}