當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PMA_getRadioButtonDependingOnLength函數代碼示例

本文整理匯總了PHP中PMA_getRadioButtonDependingOnLength函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_getRadioButtonDependingOnLength函數的具體用法?PHP PMA_getRadioButtonDependingOnLength怎麽用?PHP PMA_getRadioButtonDependingOnLength使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了PMA_getRadioButtonDependingOnLength函數的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;
}
開發者ID:hewenhao2008,項目名稱:phpmyadmin,代碼行數:34,代碼來源:insert_edit.lib.php

示例2: testGetRadioButtonDependingOnLength

 /**
  * Test for PMA_getRadioButtonDependingOnLength
  *
  * @return void
  */
 public function testGetRadioButtonDependingOnLength()
 {
     $column_enum_values = array(array('html' => 'foo', 'plain' => 'data'), array('html' => 'bar', 'plain' => ''));
     $result = PMA_getRadioButtonDependingOnLength('a', 'b', 2, array(), 0, 1, 'data', $column_enum_values);
     $this->assertContains('<input type="radio" name="fieldsa" class="textfield" value="foo" ' . 'id="field_1_3_0" b checked="checked" tabindex="2" />', $result);
     $this->assertContains('<label for="field_1_3_0">foo</label>', $result);
     $this->assertContains('<input type="radio" name="fieldsa" class="textfield" value="bar" ' . 'id="field_1_3_1" b tabindex="2" />', $result);
     $this->assertContains('<label for="field_1_3_1">bar</label>', $result);
     // case 2
     $column_enum_values = array(array('html' => 'foo', 'plain' => 'data'));
     $column = array();
     $column['Default'] = 'data';
     $column['Null'] = 'YES';
     $result = PMA_getRadioButtonDependingOnLength('a', 'b', 2, $column, 0, 1, '', $column_enum_values);
     $this->assertContains('<input type="radio" name="fieldsa" class="textfield" value="foo" ' . 'id="field_1_3_0" b checked="checked" tabindex="2" />', $result);
 }
開發者ID:kfjihailong,項目名稱:phpMyAdmin,代碼行數:21,代碼來源:PMA_insert_edit_test.php


注:本文中的PMA_getRadioButtonDependingOnLength函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。