当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_getNullifyCodeForNullColumn函数代码示例

本文整理汇总了PHP中PMA_getNullifyCodeForNullColumn函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getNullifyCodeForNullColumn函数的具体用法?PHP PMA_getNullifyCodeForNullColumn怎么用?PHP PMA_getNullifyCodeForNullColumn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_getNullifyCodeForNullColumn函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_getNullColumn

/**
 * The null column
 *
 * @param array   $column               description of column in given table
 * @param string  $column_name_appendix the name attribute
 * @param boolean $real_null_value      is column value null or not null
 * @param integer $tabindex             tab index
 * @param integer $tabindex_for_null    +6000
 * @param integer $idindex              id index
 * @param string  $vkey                 [multi_edit]['row_id']
 * @param array   $foreigners           keys into foreign fields
 * @param array   $foreignData          data about the foreign keys
 *
 * @return string                       an html snippet
 */
function PMA_getNullColumn($column, $column_name_appendix, $real_null_value, $tabindex, $tabindex_for_null, $idindex, $vkey, $foreigners, $foreignData)
{
    if ($column['Null'] != 'YES') {
        return "<td></td>\n";
    }
    $html_output = '';
    $html_output .= '<td>' . "\n";
    $html_output .= '<input type="hidden" name="fields_null_prev' . $column_name_appendix . '"';
    if ($real_null_value && !$column['first_timestamp']) {
        $html_output .= ' value="on"';
    }
    $html_output .= ' />' . "\n";
    $html_output .= '<input type="checkbox" class="checkbox_null" tabindex="' . ($tabindex + $tabindex_for_null) . '"' . ' name="fields_null' . $column_name_appendix . '"';
    if ($real_null_value) {
        $html_output .= ' checked="checked"';
    }
    $html_output .= ' id="field_' . $idindex . '_2" />';
    // nullify_code is needed by the js nullify() function
    $nullify_code = PMA_getNullifyCodeForNullColumn($column, $foreigners, $foreignData);
    // to be able to generate calls to nullify() in jQuery
    $html_output .= '<input type="hidden" class="nullify_code" name="nullify_code' . $column_name_appendix . '" value="' . $nullify_code . '" />';
    $html_output .= '<input type="hidden" class="hashed_field" name="hashed_field' . $column_name_appendix . '" value="' . $column['Field_md5'] . '" />';
    $html_output .= '<input type="hidden" class="multi_edit" name="multi_edit' . $column_name_appendix . '" value="' . PMA_escapeJsString($vkey) . '" />';
    $html_output .= '</td>' . "\n";
    return $html_output;
}
开发者ID:hewenhao2008,项目名称:phpmyadmin,代码行数:41,代码来源:insert_edit.lib.php

示例2: testGetNullifyCodeForNullColumn

 /**
  * Test for PMA_getNullifyCodeForNullColumn
  *
  * @return void
  */
 public function testGetNullifyCodeForNullColumn()
 {
     $column = $foreigners = $foreignData = array();
     $column['True_Type'] = 'enum';
     $column['Type'] = 'ababababababababababa';
     $this->assertEquals('1', PMA_getNullifyCodeForNullColumn($column, null, null));
     $column['True_Type'] = 'enum';
     $column['Type'] = 'abababababababababab';
     $this->assertEquals('2', PMA_getNullifyCodeForNullColumn($column, null, null));
     $column['True_Type'] = 'set';
     $this->assertEquals('3', PMA_getNullifyCodeForNullColumn($column, null, null));
     $column['True_Type'] = '';
     $column['Field'] = 'f';
     $foreigners['f'] = true;
     $foreignData['foreign_link'] = '';
     $this->assertEquals('4', PMA_getNullifyCodeForNullColumn($column, $foreigners, $foreignData));
 }
开发者ID:kfjihailong,项目名称:phpMyAdmin,代码行数:22,代码来源:PMA_insert_edit_test.php


注:本文中的PMA_getNullifyCodeForNullColumn函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。