當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PMA_getHtmlForRequires函數代碼示例

本文整理匯總了PHP中PMA_getHtmlForRequires函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_getHtmlForRequires函數的具體用法?PHP PMA_getHtmlForRequires怎麽用?PHP PMA_getHtmlForRequires使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了PMA_getHtmlForRequires函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: PMA_getHtmlForGlobalOrDbSpecificPrivs

/**
 * Get HTML for global or database specific privileges
 *
 * @param string $db    the database
 * @param string $table the table
 * @param string $row   first row from result or boolean false
 *
 * @return string $html_output
 */
function PMA_getHtmlForGlobalOrDbSpecificPrivs($db, $table, $row)
{
    $privTable_names = array(0 => __('Data'), 1 => __('Structure'), 2 => __('Administration'));
    $privTable = array();
    // d a t a
    $privTable[0] = PMA_getDataPrivilegeTable($db);
    // s t r u c t u r e
    $privTable[1] = PMA_getStructurePrivilegeTable($table, $row);
    // a d m i n i s t r a t i o n
    $privTable[2] = PMA_getAdministrationPrivilegeTable($db);
    $html_output = '<input type="hidden" name="grant_count" value="' . (count($privTable[0]) + count($privTable[1]) + count($privTable[2]) - (isset($row['Grant_priv']) ? 1 : 0)) . '" />';
    if ($db == '*') {
        $legend = __('Global privileges');
        $menu_label = __('Global');
    } else {
        if ($table == '*') {
            $legend = __('Database-specific privileges');
            $menu_label = __('Database');
        } else {
            $legend = __('Table-specific privileges');
            $menu_label = __('Table');
        }
    }
    $html_output .= '<fieldset id="fieldset_user_global_rights">' . '<legend data-submenu-label="' . $menu_label . '">' . $legend . '<input type="checkbox" id="addUsersForm_checkall" ' . 'class="checkall_box" title="' . __('Check All') . '" /> ' . '<label for="addUsersForm_checkall">' . __('Check All') . '</label> ' . '</legend>' . '<p><small><i>' . __('Note: MySQL privilege names are expressed in English.') . '</i></small></p>';
    // Output the Global privilege tables with checkboxes
    $html_output .= PMA_getHtmlForGlobalPrivTableWithCheckboxes($privTable, $privTable_names, $row);
    // The "Resource limits" box is not displayed for db-specific privs
    if ($db == '*') {
        $html_output .= PMA_getHtmlForResourceLimits($row);
        $html_output .= PMA_getHtmlForRequires($row);
    }
    // for Safari 2.0.2
    $html_output .= '<div class="clearfloat"></div>';
    return $html_output;
}
開發者ID:siddhantsomani,項目名稱:phpmyadmin,代碼行數:44,代碼來源:server_privileges.lib.php

示例2: testPMAGetHtmlForRequires

    /**
     * Test for PMA_getHtmlForRequires
     *
     * @return void
     */
    public function testPMAGetHtmlForRequires()
    {
        /* Assertion 1 */
        $row = array(
            'ssl_type'   => '',
            'ssh_cipher' => ''
        );

        $html = PMA_getHtmlForRequires(
            $row
        );
        // <legend>SSL</legend>
        $this->assertContains(
            '<legend>SSL</legend>',
            $html
        );
        $this->assertContains(
            'value="NONE" checked="checked"',
            $html
        );
        $this->assertContains(
            'value="ANY"',
            $html
        );
        $this->assertContains(
            'value="X509"',
            $html
        );
        $this->assertContains(
            'value="SPECIFIED"',
            $html
        );

        /* Assertion 2 */
        $row = array(
            'ssl_type'   => 'ANY',
            'ssh_cipher' => ''
        );

        $html = PMA_getHtmlForRequires(
            $row
        );
        // <legend>SSL</legend>
        $this->assertContains(
            '<legend>SSL</legend>',
            $html
        );
        $this->assertContains(
            'value="NONE"',
            $html
        );
        $this->assertContains(
            'value="ANY" checked="checked"',
            $html
        );
        $this->assertContains(
            'value="X509"',
            $html
        );
        $this->assertContains(
            'value="SPECIFIED"',
            $html
        );

        /* Assertion 3 */
        $row = array(
            'ssl_type'   => 'X509',
            'ssh_cipher' => ''
        );

        $html = PMA_getHtmlForRequires(
            $row
        );
        // <legend>SSL</legend>
        $this->assertContains(
            '<legend>SSL</legend>',
            $html
        );
        $this->assertContains(
            'value="NONE"',
            $html
        );
        $this->assertContains(
            'value="ANY"',
            $html
        );
        $this->assertContains(
            'value="X509" checked="checked"',
            $html
        );
        $this->assertContains(
            'value="SPECIFIED"',
            $html
        );

//.........這裏部分代碼省略.........
開發者ID:nijel,項目名稱:phpmyadmin,代碼行數:101,代碼來源:PMA_server_privileges_test.php


注:本文中的PMA_getHtmlForRequires函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。