当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_getHtmlListOfPrivs函数代码示例

本文整理汇总了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 . '&amp;#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;
}
开发者ID:siddhantsomani,项目名称:phpmyadmin,代码行数:55,代码来源:server_privileges.lib.php

示例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;
}
开发者ID:harryboulderdash,项目名称:PlayGFC,代码行数:47,代码来源:server_privileges.lib.php


注:本文中的PMA_getHtmlListOfPrivs函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。