コード例 #1
0
                 echo '                ';
                 echo '<option' . $selected . '>' . $cfg['Functions'][$j] . '</option>' . "\n";
             }
         }
         // end for
         unset($selected);
         ?>
         </select>
     </td>
         <?php 
     }
 }
 // end if ($cfg['ShowFunctionFields'])
 // The null column
 // ---------------
 $foreignData = PMA_getForeignData($foreigners, $field['Field'], false, '', '');
 echo '        <td>' . "\n";
 if ($field['Null'] == 'YES') {
     echo '            <input type="hidden" name="fields_null_prev' . $field_name_appendix . '"';
     if ($real_null_value && !$field['first_timestamp']) {
         echo ' value="on"';
     }
     echo ' />' . "\n";
     if (!($cfg['ProtectBinary'] && $field['is_blob'] || $cfg['ProtectBinary'] == 'all' && $field['is_binary'])) {
         echo '            <input type="checkbox" tabindex="' . ($tabindex + $tabindex_for_null) . '"' . ' name="fields_null' . $field_name_appendix . '"';
         if ($real_null_value && !$field['first_timestamp']) {
             echo ' checked="checked"';
         }
         echo ' id="field_' . $idindex . '_2"';
         $onclick = ' onclick="if (this.checked) {nullify(';
         if (strstr($field['True_Type'], 'enum')) {
コード例 #2
0
ファイル: TableSearch.class.php プロジェクト: minggLu/openemr
 /**
  * Provides form for displaying point data and also the scatter plot
  * (for tbl_zoom_select.php)
  *
  * @param string $goto Goto URL
  * @param array  $data Array containing SQL query data
  *
  * @return string form's html
  */
 public function getZoomResultsForm($goto, $data)
 {
     $html_output = '';
     $titles = array('Browse' => PMA_Util::getIcon('b_browse.png', __('Browse foreign values')));
     $html_output .= '<form method="post" action="tbl_zoom_select.php"' . ' name="displayResultForm" id="zoom_display_form"' . ' class="ajax"' . '>';
     $html_output .= PMA_URL_getHiddenInputs($this->_db, $this->_table);
     $html_output .= '<input type="hidden" name="goto" value="' . $goto . '" />';
     $html_output .= '<input type="hidden" name="back" value="tbl_zoom_select.php" />';
     $html_output .= '<fieldset id="displaySection">';
     $html_output .= '<legend>' . __('Browse/Edit the points') . '</legend>';
     //JSON encode the data(query result)
     $html_output .= '<center>';
     if (isset($_POST['zoom_submit']) && !empty($data)) {
         $html_output .= '<div id="resizer">';
         $html_output .= '<center><a href="#" onclick="displayHelp();">' . __('How to use') . '</a></center>';
         $html_output .= '<div id="querydata" style="display:none">' . json_encode($data) . '</div>';
         $html_output .= '<div id="querychart"></div>';
         $html_output .= '<button class="button-reset">' . __('Reset zoom') . '</button>';
         $html_output .= '</div>';
     }
     $html_output .= '</center>';
     //Displays rows in point edit form
     $html_output .= '<div id="dataDisplay" style="display:none">';
     $html_output .= '<table><thead>';
     $html_output .= '<tr>';
     $html_output .= '<th>' . __('Column') . '</th>' . '<th>' . __('Null') . '</th>' . '<th>' . __('Value') . '</th>';
     $html_output .= '</tr>';
     $html_output .= '</thead>';
     $html_output .= '<tbody>';
     $odd_row = true;
     for ($column_index = 0, $nb = count($this->_columnNames); $column_index < $nb; $column_index++) {
         $fieldpopup = $this->_columnNames[$column_index];
         $foreignData = PMA_getForeignData($this->_foreigners, $fieldpopup, false, '', '');
         $html_output .= '<tr class="noclick ' . ($odd_row ? 'odd' : 'even') . '">';
         $odd_row = !$odd_row;
         //Display column Names
         $html_output .= '<th>' . htmlspecialchars($this->_columnNames[$column_index]) . '</th>';
         //Null checkbox if column can be null
         $html_output .= '<th>' . ($this->_columnNullFlags[$column_index] == 'YES' ? '<input type="checkbox" class="checkbox_null"' . ' name="criteriaColumnNullFlags[' . $column_index . ']"' . ' id="edit_fields_null_id_' . $column_index . '" />' : '');
         $html_output .= '</th>';
         //Column's Input box
         $html_output .= '<th>';
         $html_output .= $this->_getInputbox($foreignData, $fieldpopup, $this->_columnTypes[$column_index], $column_index, $titles, $GLOBALS['cfg']['ForeignKeyMaxLimit'], '', false, true);
         $html_output .= '</th></tr>';
     }
     $html_output .= '</tbody></table>';
     $html_output .= '</div>';
     $html_output .= '<input type="hidden" id="queryID" name="sql_query" />';
     $html_output .= '</form>';
     return $html_output;
 }
コード例 #3
0
ファイル: sql.lib.php プロジェクト: harryboulderdash/PlayGFC
/**
 * Get the HTML for relational column dropdown
 * During grid edit, if we have a relational field, returns the html for the
 * dropdown
 *
 * @param string $db         current database
 * @param string $table      current table
 * @param string $column     current column
 * @param string $curr_value current selected value
 *
 * @return string $dropdown html for the dropdown
 */
function PMA_getHtmlForRelationalColumnDropdown($db, $table, $column, $curr_value)
{
    $foreigners = PMA_getForeigners($db, $table, $column);
    $foreignData = PMA_getForeignData($foreigners, $column, false, '', '');
    if ($foreignData['disp_row'] == null) {
        //Handle the case when number of values
        //is more than $cfg['ForeignKeyMaxLimit']
        $_url_params = array('db' => $db, 'table' => $table, 'field' => $column);
        $dropdown = '<span class="curr_value">' . htmlspecialchars($_REQUEST['curr_value']) . '</span>' . '<a href="browse_foreigners.php' . PMA_URL_getCommon($_url_params) . '"' . 'class="ajax browse_foreign" ' . '>' . __('Browse foreign values') . '</a>';
    } else {
        $dropdown = PMA_foreignDropdown($foreignData['disp_row'], $foreignData['foreign_field'], $foreignData['foreign_display'], $curr_value, $GLOBALS['cfg']['ForeignKeyMaxLimit']);
        $dropdown = '<select>' . $dropdown . '</select>';
    }
    return $dropdown;
}
コード例 #4
0
 /**
  * Provides a column's type, collation, operators list, and criteria value
  * to display in table search form
  *
  * @param integer $search_index Row number in table search form
  * @param integer $column_index Column index in ColumnNames array
  *
  * @return array Array containing column's properties
  */
 public function getColumnProperties($search_index, $column_index)
 {
     $selected_operator = isset($_POST['criteriaColumnOperators']) ? $_POST['criteriaColumnOperators'][$search_index] : '';
     $entered_value = isset($_POST['criteriaValues']) ? $_POST['criteriaValues'] : '';
     $titles = array('Browse' => Util::getIcon('b_browse.png', __('Browse foreign values')));
     //Gets column's type and collation
     $type = $this->_columnTypes[$column_index];
     $collation = $this->_columnCollations[$column_index];
     //Gets column's comparison operators depending on column type
     $func = Template::get('table/search/column_comparison_operators')->render(array('search_index' => $search_index, 'columnTypes' => $this->_columnTypes, 'column_index' => $column_index, 'columnNullFlags' => $this->_columnNullFlags, 'selected_operator' => $selected_operator));
     //Gets link to browse foreign data(if any) and criteria inputbox
     $foreignData = PMA_getForeignData($this->_foreigners, $this->_columnNames[$column_index], false, '', '');
     $value = Template::get('table/search/input_box')->render(array('str' => '', 'column_type' => (string) $type, 'column_id' => 'fieldID_', 'in_zoom_search_edit' => false, '_foreigners' => $this->_foreigners, 'column_name' => $this->_columnNames[$column_index], 'foreignData' => $foreignData, 'table' => $this->table, 'column_index' => $search_index, 'foreignMaxLimit' => $GLOBALS['cfg']['ForeignKeyMaxLimit'], 'criteriaValues' => $entered_value, 'db' => $this->db, 'titles' => $titles, 'in_fbs' => true));
     return array('type' => $type, 'collation' => $collation, 'func' => $func, 'value' => $value);
 }
コード例 #5
0
ファイル: browse_foreigners.php プロジェクト: htom78/project
/**
 * Displays the frame
 */
require_once './libraries/transformations.lib.php';
// Transformations
$cfgRelation = PMA_getRelationsParam();
$foreigners = $cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : false;
$override_total = true;
if (!isset($pos)) {
    $pos = 0;
}
$foreign_limit = 'LIMIT ' . $pos . ', ' . $GLOBALS['cfg']['MaxRows'] . ' ';
if (isset($foreign_navig) && $foreign_navig == __('Show all')) {
    unset($foreign_limit);
}
$foreignData = PMA_getForeignData($foreigners, $field, $override_total, isset($foreign_filter) ? $foreign_filter : '', $foreign_limit);
if (isset($rownumber)) {
    $rownumber_param = '&amp;rownumber=' . urlencode($rownumber);
} else {
    $rownumber_param = '';
}
$gotopage = '';
$showall = '';
if (is_array($foreignData['disp_row'])) {
    if ($cfg['ShowAll'] && $foreignData['the_total'] > $GLOBALS['cfg']['MaxRows']) {
        $showall = '<input type="submit" name="foreign_navig" value="' . __('Show all') . '" />';
    }
    $session_max_rows = $GLOBALS['cfg']['MaxRows'];
    $pageNow = @floor($pos / $session_max_rows) + 1;
    $nbTotalPage = @ceil($foreignData['the_total'] / $session_max_rows);
    if ($foreignData['the_total'] > $GLOBALS['cfg']['MaxRows']) {
コード例 #6
0
 * During grid edit, if we have a relational field, show the dropdown for it
 *
 * Logic taken from libraries/display_tbl_lib.php
 *
 * This doesn't seem to be the right place to do this, but I can't think of any
 * better place either.
 */
if (isset($_REQUEST['get_relational_values']) && $_REQUEST['get_relational_values'] == true) {
    include_once 'libraries/relation.lib.php';

    $column = $_REQUEST['column'];
    $foreigners = PMA_getForeigners($db, $table, $column);

    $display_field = PMA_getDisplayField($foreigners[$column]['foreign_db'], $foreigners[$column]['foreign_table']);

    $foreignData = PMA_getForeignData($foreigners, $column, false, '', '');

    if ($_SESSION['tmp_user_values']['relational_display'] == 'D'
        && isset($display_field)
        && strlen($display_field)
        && isset($_REQUEST['relation_key_or_display_column'])
        && $_REQUEST['relation_key_or_display_column']
    ) {
            $curr_value = $_REQUEST['relation_key_or_display_column'];
    } else {
        $curr_value = $_REQUEST['curr_value'];
    }
    if ($foreignData['disp_row'] == null) {
        //Handle the case when number of values is more than $cfg['ForeignKeyMaxLimit']
        $_url_params = array(
                'db' => $db,
コード例 #7
0
/**
 * Function to get html for each insert/edit column
 *
 * @param array  $table_columns         table columns
 * @param int    $column_number         column index in table_columns
 * @param array  $comments_map          comments map
 * @param bool   $timestamp_seen        whether timestamp seen
 * @param array  $current_result        current result
 * @param string $chg_evt_handler       javascript change event handler
 * @param string $jsvkey                javascript validation key
 * @param string $vkey                  validation key
 * @param bool   $insert_mode           whether insert mode
 * @param array  $current_row           current row
 * @param bool   $odd_row               whether odd row
 * @param int    &$o_rows               row offset
 * @param int    &$tabindex             tab index
 * @param int    $columns_cnt           columns count
 * @param bool   $is_upload             whether upload
 * @param int    $tabindex_for_function tab index offset for function
 * @param array  $foreigners            foreigners
 * @param int    $tabindex_for_null     tab index offset for null
 * @param int    $tabindex_for_value    tab index offset for value
 * @param string $table                 table
 * @param string $db                    database
 * @param int    $row_id                row id
 * @param array  $titles                titles
 * @param int    $biggest_max_file_size biggest max file size
 * @param string $default_char_editing  default char editing mode which is stored
 *                                      in the config.inc.php script
 * @param string $text_dir              text direction
 * @param array  $repopulate            the data to be repopulated
 * @param array  $column_mime           the mime information of column
 * @param string $where_clause          the where clause
 *
 * @return string
 */
function PMA_getHtmlForInsertEditFormColumn($table_columns, $column_number, $comments_map, $timestamp_seen, $current_result, $chg_evt_handler, $jsvkey, $vkey, $insert_mode, $current_row, $odd_row, &$o_rows, &$tabindex, $columns_cnt, $is_upload, $tabindex_for_function, $foreigners, $tabindex_for_null, $tabindex_for_value, $table, $db, $row_id, $titles, $biggest_max_file_size, $default_char_editing, $text_dir, $repopulate, $column_mime, $where_clause)
{
    $column = $table_columns[$column_number];
    if (!isset($column['processed'])) {
        $column = PMA_analyzeTableColumnsArray($column, $comments_map, $timestamp_seen);
    }
    $as_is = false;
    if (!empty($repopulate) && !empty($current_row)) {
        $current_row[$column['Field']] = $repopulate[$column['Field_md5']];
        $as_is = true;
    }
    $extracted_columnspec = PMA_Util::extractColumnSpec($column['Type']);
    if (-1 === $column['len']) {
        $column['len'] = $GLOBALS['dbi']->fieldLen($current_result, $column_number);
        // length is unknown for geometry fields,
        // make enough space to edit very simple WKTs
        if (-1 === $column['len']) {
            $column['len'] = 30;
        }
    }
    //Call validation when the form submitted...
    $onChangeClause = $chg_evt_handler . "=\"return verificationsAfterFieldChange('" . PMA_escapeJsString($column['Field_md5']) . "', '" . PMA_escapeJsString($jsvkey) . "','" . $column['pma_type'] . "')\"";
    // Use an MD5 as an array index to avoid having special characters
    // in the name attribute (see bug #1746964 )
    $column_name_appendix = $vkey . '[' . $column['Field_md5'] . ']';
    if ($column['Type'] === 'datetime' && !isset($column['Default']) && !is_null($column['Default']) && $insert_mode) {
        $column['Default'] = date('Y-m-d H:i:s', time());
    }
    $html_output = PMA_getHtmlForFunctionOption($odd_row, $column, $column_name_appendix);
    if ($GLOBALS['cfg']['ShowFieldTypesInDataEditView']) {
        $html_output .= PMA_getHtmlForInsertEditColumnType($column);
    }
    //End if
    // Get a list of GIS data types.
    $gis_data_types = PMA_Util::getGISDatatypes();
    // Prepares the field value
    $real_null_value = false;
    $special_chars_encoded = '';
    if (!empty($current_row)) {
        // (we are editing)
        list($real_null_value, $special_chars_encoded, $special_chars, $data, $backup_field) = PMA_getSpecialCharsAndBackupFieldForExistingRow($current_row, $column, $extracted_columnspec, $real_null_value, $gis_data_types, $column_name_appendix, $as_is);
    } else {
        // (we are inserting)
        // display default values
        $tmp = $column;
        if (isset($repopulate[$column['Field_md5']])) {
            $tmp['Default'] = $repopulate[$column['Field_md5']];
        }
        list($real_null_value, $data, $special_chars, $backup_field, $special_chars_encoded) = PMA_getSpecialCharsAndBackupFieldForInsertingMode($tmp, $real_null_value);
        unset($tmp);
    }
    $idindex = $o_rows * $columns_cnt + $column_number + 1;
    $tabindex = $idindex;
    // Get a list of data types that are not yet supported.
    $no_support_types = PMA_Util::unsupportedDatatypes();
    // The function column
    // -------------------
    if ($GLOBALS['cfg']['ShowFunctionFields']) {
        $html_output .= PMA_getFunctionColumn($column, $is_upload, $column_name_appendix, $onChangeClause, $no_support_types, $tabindex_for_function, $tabindex, $idindex, $insert_mode);
    }
    // The null column
    // ---------------
    $foreignData = PMA_getForeignData($foreigners, $column['Field'], false, '', '');
    $html_output .= PMA_getNullColumn($column, $column_name_appendix, $real_null_value, $tabindex, $tabindex_for_null, $idindex, $vkey, $foreigners, $foreignData);
    // The value column (depends on type)
    // ----------------
    // See bug #1667887 for the reason why we don't use the maxlength
    // HTML attribute
    //add data attributes "no of decimals" and "data type"
    $no_decimals = 0;
    $type = current(explode("(", $column['pma_type']));
    if (preg_match('/\\(([^()]+)\\)/', $column['pma_type'], $match)) {
        $match[0] = trim($match[0], '()');
        $no_decimals = $match[0];
    }
    $html_output .= '<td' . ' data-type="' . $type . '"' . ' data-decimals="' . $no_decimals . '">' . "\n";
    // Will be used by js/tbl_change.js to set the default value
    // for the "Continue insertion" feature
    $html_output .= '<span class="default_value hide">' . $special_chars . '</span>';
    // Check input transformation of column
    $transformed_html = '';
    if (!empty($column_mime['input_transformation'])) {
        $file = $column_mime['input_transformation'];
        $include_file = 'libraries/plugins/transformations/' . $file;
        if (is_file($include_file)) {
            include_once $include_file;
            $class_name = PMA_getTransformationClassName($file);
            $transformation_plugin = new $class_name();
            $transformation_options = PMA_Transformation_getOptions($column_mime['input_transformation_options']);
            $_url_params = array('db' => $db, 'table' => $table, 'transform_key' => $column['Field'], 'where_clause' => $where_clause);
            $transformation_options['wrapper_link'] = PMA_URL_getCommon($_url_params);
            $current_value = '';
            if (isset($current_row[$column['Field']])) {
                $current_value = $current_row[$column['Field']];
            }
            if (method_exists($transformation_plugin, 'getInputHtml')) {
                $transformed_html = $transformation_plugin->getInputHtml($column, $row_id, $column_name_appendix, $transformation_options, $current_value, $text_dir, $tabindex, $tabindex_for_value, $idindex);
            }
            if (method_exists($transformation_plugin, 'getScripts')) {
                $GLOBALS['plugin_scripts'] = array_merge($GLOBALS['plugin_scripts'], $transformation_plugin->getScripts());
            }
        }
    }
    if (!empty($transformed_html)) {
        $html_output .= $transformed_html;
    } else {
        $html_output .= PMA_getValueColumn($column, $backup_field, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $data, $special_chars, $foreignData, $odd_row, array($table, $db), $row_id, $titles, $text_dir, $special_chars_encoded, $vkey, $is_upload, $biggest_max_file_size, $default_char_editing, $no_support_types, $gis_data_types, $extracted_columnspec);
    }
    $html_output .= '</td>' . '</tr>';
    return $html_output;
}
コード例 #8
0
require_once 'libraries/browse_foreigners.lib.php';
/**
 * Sets globals from $_REQUEST
 */
$request_params = array('data', 'field');
foreach ($request_params as $one_request_param) {
    if (isset($_REQUEST[$one_request_param])) {
        $GLOBALS[$one_request_param] = $_REQUEST[$one_request_param];
    }
}
PMA_Util::checkParameters(array('db', 'table', 'field'));
$response = PMA_Response::getInstance();
$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->disableMenu();
$header->setBodyId('body_browse_foreigners');
/**
 * Displays the frame
 */
$cfgRelation = PMA_getRelationsParam();
$foreigners = $cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : false;
$foreign_limit = PMA_getForeignLimit(isset($foreign_navig) ? $foreign_navig : null);
$foreignData = PMA_getForeignData($foreigners, $_REQUEST['field'], true, isset($_REQUEST['foreign_filter']) ? $_REQUEST['foreign_filter'] : '', isset($foreign_limit) ? $foreign_limit : null);
$code = PMA_getJsScriptToHandleSelectRelationalFields();
$header->getScripts()->addCode($code);
// HTML output
$html = PMA_getHtmlForRelationalFieldSelection($db, $table, $_REQUEST['field'], $foreignData, isset($fieldkey) ? $fieldkey : null, isset($data) ? $data : null);
$response->addHtml($html);
?>
>>>>>>> b875702c9c06ab5012e52ff4337439b03918f453
コード例 #9
0
    echo __('Null');
    ?>
 </th>
              <th> <?php 
    echo __('Value');
    ?>
 </th>
            </tr>
          </thead>
          <tbody>
    <?php 
    $odd_row = true;
    for ($i = 4; $i < $fields_cnt + 4; $i++) {
        $tbl_fields_type[$i] = $fields_type[$i - 4];
        $fieldpopup = $fields_list[$i - 4];
        $foreignData = PMA_getForeignData($foreigners, $fieldpopup, false, '', '');
        ?>
            <tr class="noclick <?php 
        echo $odd_row ? 'odd' : 'even';
        $odd_row = !$odd_row;
        ?>
">
              <th><?php 
        echo htmlspecialchars($fields_list[$i - 4]);
        ?>
</th>
              <th><?php 
        echo $fields_null[$i - 4] == 'YES' ? '<input type="checkbox" class="checkbox_null" name="fields_null[ ' . $i . ' ]" id="fields_null_id_' . $i . '" />' : '';
        ?>
              </th>
              <th> <?php 
コード例 #10
0
/**
 * Function to get html for each insert/edit column
 *
 * @param array  $table_columns         table columns
 * @param int    $i                     row counter
 * @param array  $column                column
 * @param array  $comments_map          comments map
 * @param bool   $timestamp_seen        whether timestamp seen
 * @param array  $current_result        current result
 * @param string $chg_evt_handler       javascript change event handler
 * @param string $jsvkey                javascript validation key
 * @param string $vkey                  validation key
 * @param bool   $insert_mode           whether insert mode
 * @param array  $current_row           current row
 * @param bool   $odd_row               whether odd row
 * @param int    &$o_rows               row offset
 * @param int    &$tabindex             tab index
 * @param int    $columns_cnt           columns count
 * @param bool   $is_upload             whether upload
 * @param int    $tabindex_for_function tab index offset for function
 * @param array  $foreigners            foreigners
 * @param int    $tabindex_for_null     tab index offset for null
 * @param int    $tabindex_for_value    tab index offset for value
 * @param string $table                 table
 * @param string $db                    database
 * @param int    $row_id                row id
 * @param array  $titles                titles
 * @param int    $biggest_max_file_size biggest max file size
 * @param string $default_char_editing  default char editing mode which is stroe
 *                                      in the config.inc.php script
 * @param string $text_dir              text direction
 *
 * @return string
 */
function PMA_getHtmlForInsertEditFormColumn($table_columns, $i, $column, $comments_map, $timestamp_seen, $current_result, $chg_evt_handler, $jsvkey, $vkey, $insert_mode, $current_row, $odd_row, &$o_rows, &$tabindex, $columns_cnt, $is_upload, $tabindex_for_function, $foreigners, $tabindex_for_null, $tabindex_for_value, $table, $db, $row_id, $titles, $biggest_max_file_size, $default_char_editing, $text_dir)
{
    if (!isset($table_columns[$i]['processed'])) {
        $column = $table_columns[$i];
        $column = PMA_analyzeTableColumnsArray($column, $comments_map, $timestamp_seen);
    }
    $extracted_columnspec = PMA_Util::extractColumnSpec($column['Type']);
    if (-1 === $column['len']) {
        $column['len'] = $GLOBALS['dbi']->fieldLen($current_result, $i);
        // length is unknown for geometry fields,
        // make enough space to edit very simple WKTs
        if (-1 === $column['len']) {
            $column['len'] = 30;
        }
    }
    //Call validation when the form submitted...
    $unnullify_trigger = $chg_evt_handler . "=\"return verificationsAfterFieldChange('" . PMA_escapeJsString($column['Field_md5']) . "', '" . PMA_escapeJsString($jsvkey) . "','" . $column['pma_type'] . "')\"";
    // Use an MD5 as an array index to avoid having special characters
    // in the name atttibute (see bug #1746964 )
    $column_name_appendix = $vkey . '[' . $column['Field_md5'] . ']';
    if ($column['Type'] == 'datetime' && !isset($column['Default']) && !is_null($column['Default']) && ($insert_mode || !isset($current_row[$column['Field']]))) {
        // INSERT case or
        // UPDATE case with an NULL value
        $current_row[$column['Field']] = date('Y-m-d H:i:s', time());
    }
    $html_output = PMA_getHtmlForFunctionOption($odd_row, $column, $column_name_appendix);
    if ($GLOBALS['cfg']['ShowFieldTypesInDataEditView']) {
        $html_output .= PMA_getHtmlForInsertEditColumnType($column);
    }
    //End if
    // Get a list of GIS data types.
    $gis_data_types = PMA_Util::getGISDatatypes();
    // Prepares the field value
    $real_null_value = false;
    $special_chars_encoded = '';
    if (isset($current_row)) {
        // (we are editing)
        list($real_null_value, $special_chars_encoded, $special_chars, $data, $backup_field) = PMA_getSpecialCharsAndBackupFieldForExistingRow($current_row, $column, $extracted_columnspec, $real_null_value, $gis_data_types, $column_name_appendix);
    } else {
        // (we are inserting)
        // display default values
        list($real_null_value, $data, $special_chars, $backup_field, $special_chars_encoded) = PMA_getSpecialCharsAndBackupFieldForInsertingMode($column, $real_null_value);
    }
    $idindex = $o_rows * $columns_cnt + $i + 1;
    $tabindex = $idindex;
    // Get a list of data types that are not yet supported.
    $no_support_types = PMA_Util::unsupportedDatatypes();
    // The function column
    // -------------------
    if ($GLOBALS['cfg']['ShowFunctionFields']) {
        $html_output .= PMA_getFunctionColumn($column, $is_upload, $column_name_appendix, $unnullify_trigger, $no_support_types, $tabindex_for_function, $tabindex, $idindex, $insert_mode);
    }
    // The null column
    // ---------------
    $foreignData = PMA_getForeignData($foreigners, $column['Field'], false, '', '');
    $html_output .= PMA_getNullColumn($column, $column_name_appendix, $real_null_value, $tabindex, $tabindex_for_null, $idindex, $vkey, $foreigners, $foreignData);
    // The value column (depends on type)
    // ----------------
    // See bug #1667887 for the reason why we don't use the maxlength
    // HTML attribute
    $html_output .= '        <td>' . "\n";
    // Will be used by js/tbl_change.js to set the default value
    // for the "Continue insertion" feature
    $html_output .= '<span class="default_value hide">' . $special_chars . '</span>';
    $html_output .= PMA_getValueColumn($column, $backup_field, $column_name_appendix, $unnullify_trigger, $tabindex, $tabindex_for_value, $idindex, $data, $special_chars, $foreignData, $odd_row, array($table, $db), $row_id, $titles, $text_dir, $special_chars_encoded, $vkey, $is_upload, $biggest_max_file_size, $default_char_editing, $no_support_types, $gis_data_types, $extracted_columnspec);
    $html_output .= '</td>' . '</tr>';
    return $html_output;
}
コード例 #11
0
ファイル: tbl_change.php プロジェクト: nhodges/phpmyadmin
        $no_support_types = PMA_Util::unsupportedDatatypes();

        // The function column
        // -------------------
        if ($cfg['ShowFunctionFields']) {
            $html_output .= PMA_getFunctionColumn(
                $column, $is_upload, $column_name_appendix,
                $unnullify_trigger, $no_support_types, $tabindex_for_function,
                $tabindex, $idindex, $insert_mode
            );
        }

        // The null column
        // ---------------
        $foreignData = PMA_getForeignData(
            $foreigners, $column['Field'], false, '', ''
        );
        $html_output .= PMA_getNullColumn(
            $column, $column_name_appendix, $real_null_value,
            $tabindex, $tabindex_for_null, $idindex, $vkey, $foreigners,
            $foreignData
        );

        // The value column (depends on type)
        // ----------------
        // See bug #1667887 for the reason why we don't use the maxlength
        // HTML attribute
        $html_output .= '        <td>' . "\n";
        // Will be used by js/tbl_change.js to set the default value
        // for the "Continue insertion" feature
        $html_output .= '<span class="default_value hide">'
コード例 #12
0
 /**
  * Provides a column's type, collation, operators list, and criteria value
  * to display in table search form
  *
  * @param integer $search_index Row number in table search form
  * @param integer $column_index Column index in ColumnNames array
  *
  * @return array Array containing column's properties
  */
 public function getColumnProperties($search_index, $column_index)
 {
     $selected_operator = isset($_POST['criteriaColumnOperators']) ? $_POST['criteriaColumnOperators'][$search_index] : '';
     $entered_value = isset($_POST['criteriaValues']) ? $_POST['criteriaValues'] : '';
     $titles = array('Browse' => PMA_Util::getIcon('b_browse.png', __('Browse foreign values')));
     //Gets column's type and collation
     $type = $this->_columnTypes[$column_index];
     $collation = $this->_columnCollations[$column_index];
     //Gets column's comparison operators depending on column type
     $func = PMA\Template::get('table/column_comparison_operators')->render(array('search_index' => $search_index, 'columnTypes' => $this->_columnTypes, 'column_index' => $column_index, 'columnNullFlags' => $this->_columnNullFlags, 'selected_operator' => $selected_operator));
     //Gets link to browse foreign data(if any) and criteria inputbox
     $foreignData = PMA_getForeignData($this->_foreigners, $this->_columnNames[$column_index], false, '', '');
     $value = $this->_getInputbox($foreignData, $this->_columnNames[$column_index], $type, $search_index, $titles, $GLOBALS['cfg']['ForeignKeyMaxLimit'], $entered_value);
     return array('type' => $type, 'collation' => $collation, 'func' => $func, 'value' => $value);
 }