PMA\libraries\Index::generateIndexChoiceSelector PHP Method

generateIndexChoiceSelector() public method

Returns HTML for the index choice selector
public generateIndexChoiceSelector ( boolean $edit_table ) : string
$edit_table boolean whether this is table editing
return string HTML for the index choice selector
    public function generateIndexChoiceSelector($edit_table)
    {
        $html_options = '<select name="index[Index_choice]"' . ' id="select_index_choice" ' . ($edit_table ? 'disabled="disabled"' : '') . '>';
        foreach (Index::getIndexChoices() as $each_index_choice) {
            if ($each_index_choice === 'PRIMARY' && $this->_choice !== 'PRIMARY' && Index::getPrimary($this->_table, $this->_schema)) {
                // skip PRIMARY if there is already one in the table
                continue;
            }
            $html_options .= '<option value="' . $each_index_choice . '"' . ($this->_choice == $each_index_choice ? ' selected="selected"' : '') . '>' . $each_index_choice . '</option>' . "\n";
        }
        $html_options .= '</select>';
        return $html_options;
    }