PMA\libraries\DisplayResults::_getRowData PHP Method

_getRowData() private method

Prepares the displayable content of a data cell in Browse mode, taking into account foreign key description field and transformations
private _getRowData ( string $class, boolean $condition_field, array $analyzed_sql_results, object $meta, array $map, string $data, object | string $transformation_plugin, string $default_function, string $nowrap, string $where_comparison, array $transform_options, boolean $is_field_truncated, string $original_length = '' ) : string
$class string css classes for the td element
$condition_field boolean whether the column is a part of the where clause
$analyzed_sql_results array the analyzed query
$meta object the meta-information about the field
$map array the list of relations
$data string data
$transformation_plugin object | string transformation plugin. Can also be the default function: PMA_mimeDefaultFunction
$default_function string default function
$nowrap string 'nowrap' if the content should not be wrapped
$where_comparison string data for the where clause
$transform_options array options for transformation
$is_field_truncated boolean whether the field is truncated
$original_length string of a truncated column, or ''
return string formatted data
    private function _getRowData($class, $condition_field, $analyzed_sql_results, $meta, $map, $data, $transformation_plugin, $default_function, $nowrap, $where_comparison, $transform_options, $is_field_truncated, $original_length = '')
    {
        $relational_display = $_SESSION['tmpval']['relational_display'];
        $printview = $this->__get('printview');
        $decimals = isset($meta->decimals) ? $meta->decimals : '-1';
        $result = '<td data-decimals="' . $decimals . '"' . ' data-type="' . $meta->type . '"';
        if (!empty($original_length)) {
            // cannot use data-original-length
            $result .= ' data-originallength="' . $original_length . '"';
        }
        $result .= ' class="' . $this->_addClass($class, $condition_field, $meta, $nowrap, $is_field_truncated, $transformation_plugin, $default_function) . '">';
        if (!empty($analyzed_sql_results['statement']->expr)) {
            foreach ($analyzed_sql_results['statement']->expr as $expr) {
                if (empty($expr->alias) || empty($expr->column)) {
                    continue;
                }
                if (strcasecmp($meta->name, $expr->alias) == 0) {
                    $meta->name = $expr->column;
                }
            }
        }
        if (isset($map[$meta->name])) {
            // Field to display from the foreign table?
            if (isset($map[$meta->name][2]) && strlen($map[$meta->name][2]) > 0) {
                $dispval = $this->_getFromForeign($map, $meta, $where_comparison);
            } else {
                $dispval = '';
            }
            // end if... else...
            if (isset($printview) && $printview == '1') {
                $result .= ($transformation_plugin != $default_function ? $transformation_plugin->applyTransformation($data, $transform_options, $meta) : $default_function($data)) . ' <code>[-&gt;' . $dispval . ']</code>';
            } else {
                if ($relational_display == self::RELATIONAL_KEY) {
                    // user chose "relational key" in the display options, so
                    // the title contains the display field
                    $title = !empty($dispval) ? ' title="' . htmlspecialchars($dispval) . '"' : '';
                } else {
                    $title = ' title="' . htmlspecialchars($data) . '"';
                }
                $_url_params = array('db' => $map[$meta->name][3], 'table' => $map[$meta->name][0], 'pos' => '0', 'sql_query' => 'SELECT * FROM ' . Util::backquote($map[$meta->name][3]) . '.' . Util::backquote($map[$meta->name][0]) . ' WHERE ' . Util::backquote($map[$meta->name][1]) . $where_comparison);
                $result .= '<a class="ajax" href="sql.php' . URL::getCommon($_url_params) . '"' . $title . '>';
                if ($transformation_plugin != $default_function) {
                    // always apply a transformation on the real data,
                    // not on the display field
                    $result .= $transformation_plugin->applyTransformation($data, $transform_options, $meta);
                } else {
                    if ($relational_display == self::RELATIONAL_DISPLAY_COLUMN && !empty($map[$meta->name][2])) {
                        // user chose "relational display field" in the
                        // display options, so show display field in the cell
                        $result .= $default_function($dispval);
                    } else {
                        // otherwise display data in the cell
                        $result .= $default_function($data);
                    }
                }
                $result .= '</a>';
            }
        } else {
            $result .= $transformation_plugin != $default_function ? $transformation_plugin->applyTransformation($data, $transform_options, $meta) : $default_function($data);
        }
        $result .= '</td>' . "\n";
        return $result;
    }
DisplayResults