本文整理汇总了PHP中PMA_getColumnSetValueAndSelectSize函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getColumnSetValueAndSelectSize函数的具体用法?PHP PMA_getColumnSetValueAndSelectSize怎么用?PHP PMA_getColumnSetValueAndSelectSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_getColumnSetValueAndSelectSize函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_getPmaTypeSet
/**
* Get the HTML for 'set' pma type
*
* @param array $column description of column in given table
* @param array $extracted_columnspec associative array containing type,
* spec_in_brackets and possibly
* enum_set_values (another array)
* @param string $backup_field hidden input field
* @param string $column_name_appendix the name attribute
* @param string $onChangeClause onchange clause for fields
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
* @param string $data description of the column field
*
* @return string an html snippet
*/
function PMA_getPmaTypeSet($column, $extracted_columnspec, $backup_field, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $data)
{
list($column_set_values, $select_size) = PMA_getColumnSetValueAndSelectSize($column, $extracted_columnspec);
$vset = array_flip(explode(',', $data));
$html_output = $backup_field . "\n";
$html_output .= '<input type="hidden" name="fields_type' . $column_name_appendix . '" value="set" />';
$html_output .= '<select name="fields' . $column_name_appendix . '[]' . '"' . ' class="textfield"' . ' size="' . $select_size . '"' . ' multiple="multiple"' . ' ' . $onChangeClause . ' tabindex="' . ($tabindex + $tabindex_for_value) . '"' . ' id="field_' . $idindex . '_3">';
foreach ($column_set_values as $column_set_value) {
$html_output .= '<option value="' . $column_set_value['html'] . '"';
if (isset($vset[$column_set_value['plain']])) {
$html_output .= ' selected="selected"';
}
$html_output .= '>' . $column_set_value['html'] . '</option>' . "\n";
}
$html_output .= '</select>';
return $html_output;
}
示例2: testGetColumnSetValueAndSelectSize
/**
* Test for PMA_getColumnSetValueAndSelectSize
*
* @return void
*/
public function testGetColumnSetValueAndSelectSize()
{
$extracted_columnspec = $column = array();
$extracted_columnspec['enum_set_values'] = array('a', '<');
$result = PMA_getColumnSetValueAndSelectSize(array(), $extracted_columnspec);
$this->assertEquals(array(array(array('plain' => 'a', 'html' => 'a'), array('plain' => '<', 'html' => '<')), 2), $result);
$column['values'] = array(1, 2);
$column['select_size'] = 3;
$result = PMA_getColumnSetValueAndSelectSize($column, $extracted_columnspec);
$this->assertEquals(array(array(1, 2), 3), $result);
}