本文整理汇总了PHP中PMA_getPmaTypeEnum函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getPmaTypeEnum函数的具体用法?PHP PMA_getPmaTypeEnum怎么用?PHP PMA_getPmaTypeEnum使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_getPmaTypeEnum函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_getValueColumn
/**
* Get the HTML elements for value column in insert form
* (here, "column" is used in the sense of HTML column in HTML table)
*
* @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 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
* @param string $special_chars special characters
* @param array $foreignData data about the foreign keys
* @param boolean $odd_row whether row is odd
* @param array $paramTableDbArray array containing $table and $db
* @param integer $rownumber the row number
* @param array $titles An HTML IMG tag for a particular icon from
* a theme, which may be an actual file or
* an icon from a sprite
* @param string $text_dir text direction
* @param string $special_chars_encoded replaced char if the string starts
* with a \r\n pair (0x0d0a) add an extra \n
* @param string $vkey [multi_edit]['row_id']
* @param boolean $is_upload is upload or not
* @param integer $biggest_max_file_size 0 integer
* @param string $default_char_editing default char editing mode which is stored
* in the config.inc.php script
* @param array $no_support_types list of datatypes that are not (yet)
* handled by PMA
* @param array $gis_data_types list of GIS data types
* @param array $extracted_columnspec associative array containing type,
* spec_in_brackets and possibly
* enum_set_values (another array)
*
* @return string an html snippet
*/
function PMA_getValueColumn($column, $backup_field, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $data, $special_chars, $foreignData, $odd_row, $paramTableDbArray, $rownumber, $titles, $text_dir, $special_chars_encoded, $vkey, $is_upload, $biggest_max_file_size, $default_char_editing, $no_support_types, $gis_data_types, $extracted_columnspec)
{
// HTML5 data-* attribute data-type
$data_type = $GLOBALS['PMA_Types']->getTypeClass($column['True_Type']);
$html_output = '';
if ($foreignData['foreign_link'] == true) {
$html_output .= PMA_getForeignLink($column, $backup_field, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $data, $paramTableDbArray, $rownumber, $titles);
} elseif (is_array($foreignData['disp_row'])) {
$html_output .= PMA_dispRowForeignData($backup_field, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $data, $foreignData);
} elseif ($GLOBALS['cfg']['LongtextDoubleTextarea'] && mb_strstr($column['pma_type'], 'longtext')) {
$html_output = ' </td>';
$html_output .= '</tr>';
$html_output .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">' . '<td colspan="5" class="right">';
$html_output .= PMA_getTextarea($column, $backup_field, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $text_dir, $special_chars_encoded, $data_type);
} elseif (mb_strstr($column['pma_type'], 'text')) {
$html_output .= PMA_getTextarea($column, $backup_field, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $text_dir, $special_chars_encoded, $data_type);
$html_output .= "\n";
if (mb_strlen($special_chars) > 32000) {
$html_output .= "</td>\n";
$html_output .= '<td>' . __('Because of its length,<br /> this column might not be editable.');
}
} elseif ($column['pma_type'] == 'enum') {
$html_output .= PMA_getPmaTypeEnum($column, $backup_field, $column_name_appendix, $extracted_columnspec, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $data);
} elseif ($column['pma_type'] == 'set') {
$html_output .= PMA_getPmaTypeSet($column, $extracted_columnspec, $backup_field, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $data);
} elseif ($column['is_binary'] || $column['is_blob']) {
$html_output .= PMA_getBinaryAndBlobColumn($column, $data, $special_chars, $biggest_max_file_size, $backup_field, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $text_dir, $special_chars_encoded, $vkey, $is_upload);
} elseif (!in_array($column['pma_type'], $no_support_types)) {
$html_output .= PMA_getValueColumnForOtherDatatypes($column, $default_char_editing, $backup_field, $column_name_appendix, $onChangeClause, $tabindex, $special_chars, $tabindex_for_value, $idindex, $text_dir, $special_chars_encoded, $data, $extracted_columnspec);
}
if (in_array($column['pma_type'], $gis_data_types)) {
$html_output .= PMA_getHTMLforGisDataTypes();
}
return $html_output;
}
示例2: testGetPmaTypeEnum
/**
* Test for PMA_getPmaTypeEnum
*
* @return void
*/
public function testGetPmaTypeEnum()
{
$extracted_columnspec = $column = array();
$extracted_columnspec['enum_set_values'] = array();
$column['Type'] = 'abababababababababab';
$result = PMA_getPmaTypeEnum($column, 'a', 'b', $extracted_columnspec, 'd', 2, 0, 1, 'foobar');
$this->assertTag(PMA_getTagArray('<input type="hidden" name="fields_typeb" value="enum" />'), $result);
$this->assertTag(PMA_getTagArray('<input type="hidden" name="fieldsb" value=""'), $result);
$column['Type'] = 'ababababababababababa';
$result = PMA_getPmaTypeEnum($column, 'a', 'b', $extracted_columnspec, 'd', 2, 0, 1, 'foobar');
$this->assertTag(PMA_getTagArray('<input type="hidden" name="fields_typeb" value="enum"'), $result);
$this->assertTag(PMA_getTagArray('<input type="hidden" name="fieldsb" value="" />'), $result);
$this->assertContains('<select name="fieldsb" d class="textfield" tabindex="2" ' . 'id="field_1_3">', $result);
}