本文整理汇总了PHP中PMA_getHtmlListOfPrivs函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getHtmlListOfPrivs函数的具体用法?PHP PMA_getHtmlListOfPrivs怎么用?PHP PMA_getHtmlListOfPrivs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_getHtmlListOfPrivs函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_getHtmlTableBodyForSpecificDbOrTablePrivs
/**
* Get HTML snippet for table body of specific database or table privileges
*
* @param array $privMap privilege map
* @param string $db database
*
* @return string $html_output
*/
function PMA_getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db)
{
$html_output = '<tbody>';
$index_checkbox = 0;
$odd_row = true;
if (empty($privMap)) {
$html_output .= '<tr class="odd">' . '<td colspan="6">' . __('No user found.') . '</td>' . '</tr>' . '</tbody>';
return $html_output;
}
foreach ($privMap as $current_user => $val) {
foreach ($val as $current_host => $current_privileges) {
$nbPrivileges = count($current_privileges);
$html_output .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
$value = htmlspecialchars($current_user . '&#27;' . $current_host);
$html_output .= '<td';
if ($nbPrivileges > 1) {
$html_output .= ' rowspan="' . $nbPrivileges . '"';
}
$html_output .= '>';
$html_output .= '<input type="checkbox" class="checkall" name="selected_usr[]" ' . 'id="checkbox_sel_users_' . $index_checkbox++ . '" ' . 'value="' . $value . '" /></td>' . "\n";
// user
$html_output .= '<td';
if ($nbPrivileges > 1) {
$html_output .= ' rowspan="' . $nbPrivileges . '"';
}
$html_output .= '>';
if (empty($current_user)) {
$html_output .= '<span style="color: #FF0000">' . __('Any') . '</span>';
} else {
$html_output .= htmlspecialchars($current_user);
}
$html_output .= '</td>';
// host
$html_output .= '<td';
if ($nbPrivileges > 1) {
$html_output .= ' rowspan="' . $nbPrivileges . '"';
}
$html_output .= '>';
$html_output .= htmlspecialchars($current_host);
$html_output .= '</td>';
$html_output .= PMA_getHtmlListOfPrivs($db, $current_privileges, $current_user, $current_host, $odd_row);
$odd_row = !$odd_row;
}
}
$html_output .= '</tbody>';
return $html_output;
}
示例2: PMA_getHtmlTableBodyForSpecificDbOrTablePrivs
/**
* Get HTML snippet for table body of specific database or table privileges
*
* @param array $privMap privilege map
* @param string $db database
*
* @return string $html_output
*/
function PMA_getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db)
{
$html_output = '<tbody>';
$odd_row = true;
if (empty($privMap)) {
$html_output .= '<tr class="odd">' . '<td colspan="6">' . __('No user found.') . '</td>' . '</tr>' . '</tbody>';
return $html_output;
}
foreach ($privMap as $current_user => $val) {
foreach ($val as $current_host => $current_privileges) {
$nbPrivileges = count($current_privileges);
$html_output .= '<tr class="noclick ' . ($odd_row ? 'odd' : 'even') . '">';
// user
$html_output .= '<td';
if ($nbPrivileges > 1) {
$html_output .= ' rowspan="' . $nbPrivileges . '"';
}
$html_output .= '>';
if (empty($current_user)) {
$html_output .= '<span style="color: #FF0000">' . __('Any') . '</span>';
} else {
$html_output .= htmlspecialchars($current_user);
}
$html_output .= '</td>';
// host
$html_output .= '<td';
if ($nbPrivileges > 1) {
$html_output .= ' rowspan="' . $nbPrivileges . '"';
}
$html_output .= '>';
$html_output .= htmlspecialchars($current_host);
$html_output .= '</td>';
$html_output .= PMA_getHtmlListOfPrivs($db, $current_privileges, $current_user, $current_host, $odd_row);
$odd_row = !$odd_row;
}
}
$html_output .= '</tbody>';
return $html_output;
}