本文整理汇总了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;
}