getCollationDropdownBox() публичный статический Метод

Generate collation dropdown box
public static getCollationDropdownBox ( string $name = null, string $id = null, null | string $default = null, boolean $label = true, boolean $submitOnChange = false ) : string
$name string Element name
$id string Element id
$default null | string Default value
$label boolean Label
$submitOnChange boolean Submit on change
Результат string
Пример #1
0
/**
 * build html for adding a new user defined column to central list
 *
 * @param string $db current database
 *
 * @return string html of the form to let user add a new user defined column to the
 *                list
 */
function PMA_getHTMLforAddNewColumn($db)
{
    $addNewColumn = '<div id="add_col_div"><a href="#">' . '<span>+</span> ' . __('Add new column') . '</a>' . '<form id="add_new" style="min-width:100%;display:none" ' . 'method="post" action="db_central_columns.php">' . URL::getHiddenInputs($db) . '<input type="hidden" name="add_new_column" value="add_new_column">' . '<table>';
    $addNewColumn .= PMA_getCentralColumnsTableHeader();
    $addNewColumn .= '<tr>' . '<td></td>' . '<td name="col_name" class="nowrap">' . PMA\libraries\Template::get('columns_definitions/column_name')->render(array('columnNumber' => 0, 'ci' => 0, 'ci_offset' => 0, 'columnMeta' => array(), 'cfgRelation' => array('centralcolumnswork' => false))) . '</td>' . '<td name = "col_type" class="nowrap">' . PMA\libraries\Template::get('columns_definitions/column_type')->render(array('columnNumber' => 0, 'ci' => 1, 'ci_offset' => 0, 'type_upper' => '', 'columnMeta' => array())) . '</td>' . '<td class="nowrap" name="col_length">' . PMA\libraries\Template::get('columns_definitions/column_length')->render(array('columnNumber' => 0, 'ci' => 2, 'ci_offset' => 0, 'length_values_input_size' => 8, 'length_to_display' => '')) . '</td>' . '<td class="nowrap" name="col_default">' . PMA\libraries\Template::get('columns_definitions/column_default')->render(array('columnNumber' => 0, 'ci' => 3, 'ci_offset' => 0, 'type_upper' => '', 'columnMeta' => array())) . '</td>' . '<td name="collation" class="nowrap">' . Charsets::getCollationDropdownBox('field_collation[0]', 'field_0_4', null, false) . '</td>' . '<td class="nowrap" name="col_attribute">' . PMA\libraries\Template::get('columns_definitions/column_attribute')->render(array('columnNumber' => 0, 'ci' => 5, 'ci_offset' => 0, 'extracted_columnspec' => array(), 'columnMeta' => array(), 'submit_attribute' => false)) . '</td>' . '<td class="nowrap" name="col_isNull">' . PMA\libraries\Template::get('columns_definitions/column_null')->render(array('columnNumber' => 0, 'ci' => 6, 'ci_offset' => 0, 'columnMeta' => array())) . '</td>' . '<td class="nowrap" name="col_extra">' . PMA\libraries\Template::get('columns_definitions/column_extra')->render(array('columnNumber' => 0, 'ci' => 7, 'ci_offset' => 0, 'columnMeta' => array())) . '</td>' . ' <td>' . '<input id="add_column_save" type="submit" ' . ' value="Save"/></td>' . '</tr>';
    $addNewColumn .= '</table></form></div>';
    return $addNewColumn;
}
Пример #2
0
/**
 * Get HTML fieldset for Table option, it contains HTML table for options
 *
 * @param Table   $pma_table          Table object
 * @param string  $comment            Comment
 * @param array   $tbl_collation      table collation
 * @param string  $tbl_storage_engine table storage engine
 * @param string  $pack_keys          pack keys
 * @param string  $delay_key_write    delay key write
 * @param string  $auto_increment     value of auto increment
 * @param string  $transactional      value of transactional
 * @param string  $page_checksum      value of page checksum
 * @param string  $checksum           the checksum
 *
 * @return string $html_output
 */
function PMA_getTableOptionFieldset($pma_table, $comment, $tbl_collation, $tbl_storage_engine, $pack_keys, $delay_key_write, $auto_increment, $transactional, $page_checksum, $checksum)
{
    $html_output = '<fieldset>' . '<legend>' . __('Table options') . '</legend>';
    $html_output .= '<table>';
    $html_output .= PMA_getHtmlForRenameTable();
    $html_output .= PMA_getHtmlForTableComments($comment);
    //Storage engine
    $html_output .= '<tr><td class="vmiddle">' . __('Storage Engine') . '&nbsp;' . Util::showMySQLDocu('Storage_engines') . '</td>' . '<td>' . StorageEngine::getHtmlSelect('new_tbl_storage_engine', null, $tbl_storage_engine) . '</td>' . '</tr>';
    //Table character set
    $html_output .= '<tr><td class="vmiddle">' . __('Collation') . '</td>' . '<td>' . Charsets::getCollationDropdownBox('tbl_collation', null, $tbl_collation, false) . '</td>' . '</tr>';
    // Change all Column collations
    $html_output .= '<tr><td></td><td>' . '<input type="checkbox" name="change_all_collations" value="1" ' . 'id="checkbox_change_all_collations" />' . '<label for="checkbox_change_all_collations">' . __('Change all column collations') . '</label>' . '</td></tr>';
    if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'ISAM'))) {
        $html_output .= PMA_getHtmlForPackKeys($pack_keys);
    }
    // end if (MYISAM|ISAM)
    if ($pma_table->isEngine(array('MYISAM', 'ARIA'))) {
        $html_output .= PMA_getHtmlForTableRow('new_checksum', 'CHECKSUM', $checksum);
        $html_output .= PMA_getHtmlForTableRow('new_delay_key_write', 'DELAY_KEY_WRITE', $delay_key_write);
    }
    // end if (MYISAM)
    if ($pma_table->isEngine('ARIA')) {
        $html_output .= PMA_getHtmlForTableRow('new_transactional', 'TRANSACTIONAL', $transactional);
        $html_output .= PMA_getHtmlForTableRow('new_page_checksum', 'PAGE_CHECKSUM', $page_checksum);
    }
    // end if (ARIA)
    if (strlen($auto_increment) > 0 && $pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'PBXT'))) {
        $html_output .= '<tr><td class="vmiddle">' . '<label for="auto_increment_opt">AUTO_INCREMENT</label></td>' . '<td><input type="number" name="new_auto_increment" ' . 'id="auto_increment_opt"' . 'value="' . $auto_increment . '" /></td>' . '</tr> ';
    }
    // end if (MYISAM|INNODB)
    $possible_row_formats = PMA_getPossibleRowFormat();
    // for MYISAM there is also COMPRESSED but it can be set only by the
    // myisampack utility, so don't offer here the choice because if we
    // try it inside an ALTER TABLE, MySQL (at least in 5.1.23-maria)
    // does not return a warning
    // (if the table was compressed, it can be seen on the Structure page)
    if (isset($possible_row_formats[$tbl_storage_engine])) {
        $current_row_format = mb_strtoupper($GLOBALS['showtable']['Row_format']);
        $html_output .= '<tr><td class="vmiddle">' . '<label for="new_row_format">ROW_FORMAT</label></td>' . '<td>';
        $html_output .= Util::getDropdown('new_row_format', $possible_row_formats[$tbl_storage_engine], $current_row_format, 'new_row_format');
        $html_output .= '</td></tr>';
    }
    $html_output .= '</table>' . '</fieldset>';
    return $html_output;
}
Пример #3
0
    }
    /**
     * Displays the mysql server related links
     */
    if ($server > 0) {
        include_once 'libraries/check_user_privileges.lib.php';
        // Logout for advanced authentication
        if ($cfg['Server']['auth_type'] != 'config') {
            if ($cfg['ShowChgPassword']) {
                $conditional_class = 'ajax';
                PMA_printListItem(PMA\libraries\Util::getImage('s_passwd.png') . "&nbsp;" . __('Change password'), 'li_change_password', 'user_password.php' . $common_url_query, null, null, 'change_password_anchor', "no_bullets", $conditional_class);
            }
        }
        // end if
        echo '    <li id="li_select_mysql_collation" class="no_bullets" >';
        echo '        <form method="post" action="index.php">', "\n" . URL::getHiddenInputs(null, null, 4, 'collation_connection') . '            <label for="select_collation_connection">' . "\n" . '                ' . PMA\libraries\Util::getImage('s_asci.png') . "&nbsp;" . __('Server connection collation') . "\n" . PMA\libraries\Util::showMySQLDocu('Charset-connection') . ': ' . "\n" . '            </label>' . "\n" . Charsets::getCollationDropdownBox('collation_connection', 'select_collation_connection', $collation_connection, true, true) . '        </form>' . "\n" . '    </li>' . "\n";
    }
    // end of if ($server > 0)
    echo '</ul>';
    echo '</div>';
}
echo '<div class="group">';
echo '<h2>', __('Appearance settings'), '</h2>';
echo '  <ul>';
// Displays language selection combo
if (empty($cfg['Lang'])) {
    echo '<li id="li_select_lang" class="no_bullets">';
    echo PMA\libraries\Util::getImage('s_lang.png'), " ", LanguageManager::getInstance()->getSelectorDisplay();
    echo '</li>';
}
// ThemeManager if available