本文整理汇总了PHP中PMA_getDropDownDependingOnLength函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getDropDownDependingOnLength函数的具体用法?PHP PMA_getDropDownDependingOnLength怎么用?PHP PMA_getDropDownDependingOnLength使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_getDropDownDependingOnLength函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_getPmaTypeEnum
/**
* Get HTML for enum type
*
* @param array $column description of column in given table
* @param string $backup_field hidden input field
* @param string $column_name_appendix the name attribute
* @param array $extracted_columnspec associative array containing type,
* spec_in_brackets and possibly
* enum_set_values (another array)
* @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 mixed $data data to edit
*
* @return string an html snippet
*/
function PMA_getPmaTypeEnum($column, $backup_field, $column_name_appendix, $extracted_columnspec, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $data)
{
$html_output = '';
if (!isset($column['values'])) {
$column['values'] = PMA_getColumnEnumValues($column, $extracted_columnspec);
}
$column_enum_values = $column['values'];
$html_output .= '<input type="hidden" name="fields_type' . $column_name_appendix . '" value="enum" />';
$html_output .= '<input type="hidden" name="fields' . $column_name_appendix . '" value="" />';
$html_output .= "\n" . ' ' . $backup_field . "\n";
if (mb_strlen($column['Type']) > 20) {
$html_output .= PMA_getDropDownDependingOnLength($column, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $data, $column_enum_values);
} else {
$html_output .= PMA_getRadioButtonDependingOnLength($column_name_appendix, $onChangeClause, $tabindex, $column, $tabindex_for_value, $idindex, $data, $column_enum_values);
}
return $html_output;
}
示例2: testGetDropDownDependingOnLength
/**
* Test for PMA_getDropDownDependingOnLength
*
* @return void
*/
public function testGetDropDownDependingOnLength()
{
$column_enum_values = array(array('html' => 'foo', 'plain' => 'data'), array('html' => 'bar', 'plain' => ''));
$result = PMA_getDropDownDependingOnLength(array(), 'a', 'b', 2, 0, 1, 'data', $column_enum_values);
$this->assertContains('<select name="fieldsa" b class="textfield" tabindex="2" ' . 'id="field_1_3">', $result);
$this->assertTag(PMA_getTagArray('<option value="foo" selected="selected">', array('content' => 'foo')), $result);
$this->assertTag(PMA_getTagArray('<option value="bar">', array('content' => 'bar')), $result);
// case 2
$column_enum_values = array(array('html' => 'foo', 'plain' => 'data'));
$column = array();
$column['Default'] = 'data';
$column['Null'] = 'YES';
$result = PMA_getDropDownDependingOnLength($column, 'a', 'b', 2, 0, 1, '', $column_enum_values);
$this->assertTag(PMA_getTagArray('<option value="foo" selected="selected">', array('content' => 'foo')), $result);
}