本文整理匯總了PHP中PMA_getHtmlForUserGroupDialog函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_getHtmlForUserGroupDialog函數的具體用法?PHP PMA_getHtmlForUserGroupDialog怎麽用?PHP PMA_getHtmlForUserGroupDialog使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了PMA_getHtmlForUserGroupDialog函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testPMAGetHtmlForUserGroupDialog
/**
* Test for PMA_getHtmlForUserGroupDialog
*
* @return void
*/
public function testPMAGetHtmlForUserGroupDialog()
{
$username = "pma_username";
$is_menuswork = true;
$_REQUEST['edit_user_group_dialog'] = "edit_user_group_dialog";
$GLOBALS['is_ajax_request'] = false;
//PMA_getHtmlForUserGroupDialog
$html = PMA_getHtmlForUserGroupDialog($username, $is_menuswork);
$this->assertContains('<form class="ajax" id="changeUserGroupForm"', $html);
//PMA_URL_getHiddenInputs
$params = array('username' => $username);
$html_output = PMA_URL_getHiddenInputs($params);
$this->assertContains($html_output, $html);
//__('User group')
$this->assertContains(__('User group'), $html);
}
示例2: ob_get_contents
$content = ob_get_contents();
ob_end_clean();
$response->addHTML($content . "\n");
} else {
if (! empty($GLOBALS['message'])) {
$response->addHTML(PMA\libraries\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);
if ($response->isAjax()) {
示例3: ob_start
$sub_part = '_structure';
ob_start();
include 'libraries/db_info.inc.php';
$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
示例4: testPMAGetHtmlForUserGroupDialog
/**
* Test for PMA_getHtmlForUserGroupDialog
*
* @return void
*/
public function testPMAGetHtmlForUserGroupDialog()
{
$username = "pma_username";
$is_menuswork = true;
$_REQUEST['edit_user_group_dialog'] = "edit_user_group_dialog";
/* Assertion 1 */
//PMA_getHtmlForUserGroupDialog
$html = PMA_getHtmlForUserGroupDialog($username, $is_menuswork);
$this->assertContains(
'<form class="ajax" id="changeUserGroupForm"',
$html
);
//URL::getHiddenInputs
$params = array('username' => $username);
$html_output = URL::getHiddenInputs($params);
$this->assertContains(
$html_output,
$html
);
//__('User group')
$this->assertContains(
__('User group'),
$html
);
/* Assertion 2 */
$oldDbi = $GLOBALS['dbi'];
//Mock DBI
$dbi = $this->getMockBuilder('PMA\libraries\DatabaseInterface')
->disableOriginalConstructor()
->getMock();
$dbi->expects($this->any())
->method('fetchValue')
->will($this->returnValue('userG'));
$dbi->expects($this->any())
->method('tryQuery')
->will($this->returnValue(true));
$dbi->expects($this->any())
->method('fetchRow')
->willReturnOnConsecutiveCalls(array('userG'), null);
$dbi->expects($this->any())->method('escapeString')
->will($this->returnArgument(0));
$GLOBALS['dbi'] = $dbi;
$actualHtml = PMA_getHtmlForUserGroupDialog($username, $is_menuswork);
$this->assertContains(
'<form class="ajax" id="changeUserGroupForm"',
$actualHtml
);
//URL::getHiddenInputs
$params = array('username' => $username);
$html_output = URL::getHiddenInputs($params);
$this->assertContains(
$html_output,
$actualHtml
);
//__('User group')
$this->assertContains(
__('User group'),
$actualHtml
);
// Empty default user group
$this->assertContains(
'<option value=""></option>',
$actualHtml
);
// Current user's group selected
$this->assertContains(
'<option value="userG" selected="selected">userG</option>',
$actualHtml
);
/* reset original dbi */
$GLOBALS['dbi'] = $oldDbi;
}