本文整理汇总了PHP中PMA_getHtmlForColumnPrivileges函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getHtmlForColumnPrivileges函数的具体用法?PHP PMA_getHtmlForColumnPrivileges怎么用?PHP PMA_getHtmlForColumnPrivileges使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_getHtmlForColumnPrivileges函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_getHtmlForAttachedPrivilegesToTableSpecificColumn
/**
* Get HTML snippet for privileges that are attached to a specific column
*
* @param array $columns columns array
* @param array $row first row from result or boolean false
*
* @return string $html_output
*/
function PMA_getHtmlForAttachedPrivilegesToTableSpecificColumn($columns, $row)
{
$html_output = PMA_getHtmlForColumnPrivileges($columns, $row, 'Select_priv', 'SELECT', 'select', __('Allows reading data.'), 'Select');
$html_output .= PMA_getHtmlForColumnPrivileges($columns, $row, 'Insert_priv', 'INSERT', 'insert', __('Allows inserting and replacing data.'), 'Insert');
$html_output .= PMA_getHtmlForColumnPrivileges($columns, $row, 'Update_priv', 'UPDATE', 'update', __('Allows changing data.'), 'Update');
$html_output .= PMA_getHtmlForColumnPrivileges($columns, $row, 'References_priv', 'REFERENCES', 'references', __('Has no effect in this MySQL version.'), 'References');
return $html_output;
}
示例2: testPMAGetHtmlForColumnPrivileges
/**
* Test for PMA_getHtmlForColumnPrivileges
*
* @return void
*/
public function testPMAGetHtmlForColumnPrivileges()
{
$columns = array('row1' => 'name1');
$row = array('name_for_select' => 'Y');
$name_for_select = 'name_for_select';
$priv_for_header = 'priv_for_header';
$name = 'name';
$name_for_dfn = 'name_for_dfn';
$name_for_current = 'name_for_current';
$html = PMA_getHtmlForColumnPrivileges($columns, $row, $name_for_select, $priv_for_header, $name, $name_for_dfn, $name_for_current);
//$name
$this->assertContains($name, $html);
//$name_for_dfn
$this->assertContains($name_for_dfn, $html);
//$priv_for_header
$this->assertContains($priv_for_header, $html);
//$name_for_select
$this->assertContains($name_for_select, $html);
//$columns and $row
$this->assertContains(htmlspecialchars('row1'), $html);
//$columns and $row
$this->assertContains(_pgettext('None privileges', 'None'), $html);
}