PMA\libraries\DisplayResults::_getDataCellForNonNumericColumns PHP Method

_getDataCellForNonNumericColumns() private method

Get data cell for non numeric type fields
See also: _getTableBody()
private _getDataCellForNonNumericColumns ( string $column, string $class, object $meta, array $map, array $_url_params, boolean $condition_field, object | string $transformation_plugin, string $default_function, string $transform_options, boolean $is_field_truncated, array $analyzed_sql_results, &$dt_result, integer $col_index ) : string
$column string the relevant column in data row
$class string the html class for column
$meta object the meta-information about the field
$map array the list of relations
$_url_params array the parameters for generate url
$condition_field boolean the column should highlighted or not
$transformation_plugin object | string the name of transformation function
$default_function string the default transformation function
$transform_options string the transformation parameters
$is_field_truncated boolean is data truncated due to LimitChars
$analyzed_sql_results array the analyzed query
$col_index integer the column index
return string $cell the prepared data cell, html content
    private function _getDataCellForNonNumericColumns($column, $class, $meta, $map, $_url_params, $condition_field, $transformation_plugin, $default_function, $transform_options, $is_field_truncated, $analyzed_sql_results, &$dt_result, $col_index)
    {
        $original_length = 0;
        $is_analyse = $this->__get('is_analyse');
        $field_flags = $GLOBALS['dbi']->fieldFlags($dt_result, $col_index);
        $bIsText = gettype($transformation_plugin) === 'object' && strpos($transformation_plugin->getMIMEtype(), 'Text') === false;
        // disable inline grid editing
        // if binary fields are protected
        // or transformation plugin is of non text type
        // such as image
        if (stristr($field_flags, self::BINARY_FIELD) && ($GLOBALS['cfg']['ProtectBinary'] === 'all' || $GLOBALS['cfg']['ProtectBinary'] === 'noblob' && !stristr($meta->type, self::BLOB_FIELD) || $GLOBALS['cfg']['ProtectBinary'] === 'blob' && stristr($meta->type, self::BLOB_FIELD)) || $bIsText) {
            $class = str_replace('grid_edit', '', $class);
        }
        if (!isset($column) || is_null($column)) {
            $cell = $this->_buildNullDisplay($class, $condition_field, $meta);
            return $cell;
        }
        if ($column == '') {
            $cell = $this->_buildEmptyDisplay($class, $condition_field, $meta);
            return $cell;
        }
        // Cut all fields to $GLOBALS['cfg']['LimitChars']
        // (unless it's a link-type transformation or binary)
        if (!(gettype($transformation_plugin) === "object" && strpos($transformation_plugin->getName(), 'Link') !== false) && !stristr($field_flags, self::BINARY_FIELD)) {
            list($is_field_truncated, $column, $original_length) = $this->_getPartialText($column);
        }
        $formatted = false;
        if (isset($meta->_type) && $meta->_type === MYSQLI_TYPE_BIT) {
            $column = Util::printableBitValue($column, $meta->length);
            // some results of PROCEDURE ANALYSE() are reported as
            // being BINARY but they are quite readable,
            // so don't treat them as BINARY
        } elseif (stristr($field_flags, self::BINARY_FIELD) && !(isset($is_analyse) && $is_analyse)) {
            // we show the BINARY or BLOB message and field's size
            // (or maybe use a transformation)
            $binary_or_blob = self::BLOB_FIELD;
            if ($meta->type === self::STRING_FIELD) {
                $binary_or_blob = self::BINARY_FIELD;
            }
            $column = $this->_handleNonPrintableContents($binary_or_blob, $column, $transformation_plugin, $transform_options, $default_function, $meta, $_url_params, $is_field_truncated);
            $class = $this->_addClass($class, $condition_field, $meta, '', $is_field_truncated, $transformation_plugin, $default_function);
            $result = strip_tags($column);
            // disable inline grid editing
            // if binary or blob data is not shown
            if (stristr($result, $binary_or_blob)) {
                $class = str_replace('grid_edit', '', $class);
            }
            $formatted = true;
        }
        if ($formatted) {
            $cell = $this->_buildValueDisplay($class, $condition_field, $column);
            return $cell;
        }
        // transform functions may enable no-wrapping:
        $function_nowrap = 'applyTransformationNoWrap';
        $bool_nowrap = $default_function != $transformation_plugin && function_exists($transformation_plugin->{$function_nowrap}()) ? $transformation_plugin->{$function_nowrap}($transform_options) : false;
        // do not wrap if date field type
        $nowrap = preg_match('@DATE|TIME@i', $meta->type) || $bool_nowrap ? ' nowrap' : '';
        $where_comparison = ' = \'' . $GLOBALS['dbi']->escapeString($column) . '\'';
        $cell = $this->_getRowData($class, $condition_field, $analyzed_sql_results, $meta, $map, $column, $transformation_plugin, $default_function, $nowrap, $where_comparison, $transform_options, $is_field_truncated, $original_length);
        return $cell;
    }
DisplayResults