本文整理匯總了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);
}