PHP Class PMA\libraries\DisplayResults

显示文件 Open project: phpmyadmin/phpmyadmin Class Usage Examples

Public Properties

Property Type Description
$transformation_info One element of this array represent all relevant columns in all tables in one specific database

Public Methods

Method Description
__construct ( string $db, string $table, string $goto, string $sql_query ) Constructor for DisplayResults class
__get ( string $property ) : mixed | void Get any property of this class
__set ( string $property, mixed $value ) : void Set values for any property of this class
getCreateViewQueryResultOp ( array $analyzed_sql_results ) : string Calls the _getResultsOperations with $only_view as true
getTable ( &$dt_result, &$displayParts, array $analyzed_sql_results, boolean $is_limited_display = false ) : string Prepare a table of results returned by a SQL query.
setConfigParamsForDisplayTable ( ) : void Checks the posted options for viewing query results and sets appropriate values in the session.
setProperties ( integer $unlim_num_rows, array $fields_meta, boolean $is_count, integer $is_export, boolean $is_func, integer $is_analyse, integer $num_rows, integer $fields_cnt, double $querytime, string $pmaThemeImage, string $text_dir, boolean $is_maint, boolean $is_explain, boolean $is_show, array $showtable, string $printview, string $url_query, boolean $editable, boolean $is_browse_dist ) : void Set properties which were not initialized at the constructor

Private Methods

Method Description
_addClass ( string $class, boolean $condition_field, object $meta, string $nowrap, boolean $is_field_truncated = false, object | string $transformation_plugin = '', string $default_function = '' ) : string Adds the relevant classes.
_buildEmptyDisplay ( string $class, boolean $condition_field, object $meta, string $align = '' ) : string Prepares the display for an empty value
_buildNullDisplay ( string $class, boolean $condition_field, object $meta, string $align = '' ) : string Prepares the display for a null value
_buildValueDisplay ( string $class, boolean $condition_field, string $value ) : string Prepares the display for a value
_getActionLinkContent ( string $icon, string $display_text ) : string Get content inside the table row action links (Edit/Copy/Delete)
_getAdditionalFieldsForTableNavigation ( string $html_sql_query ) : string Prepare fields for table navigation Number of rows
_getCheckboxAndLinks ( string $position, string $del_url, array $displayParts, string $row_no, string $where_clause, string $where_clause_html, array $condition_array, string $edit_url, string $copy_url, string $class, string $edit_str, string $copy_str, string $del_str, string $js_conf ) : string Prepare checkbox and links at some position (left or right) (only called for horizontal mode)
_getCheckboxForMultiRowSubmissions ( string $del_url, array $displayParts, string $row_no, string $where_clause_html, array $condition_array, string $id_suffix, string $class ) : string Prepares a checkbox for multi-row submits
_getClassForDateTimeRelatedFields ( string $type ) : string Get class for datetime related fields
_getClassForNumericColumnType ( array $fields_meta, &$th_class ) : void Check if the column contains numeric data. If yes, then set the column header's alignment right
_getClassesForColumn ( string $grid_edit_class, string $not_null_class, string $relation_class, string $hide_class, string $field_type_class ) : string Get the combined classes for a column
_getColumnAtRightSide ( &$displayParts, string $full_or_partial_text_link, string $colspan ) : string Prepare column to show at right side - check boxes or empty column
_getColumnParams ( array $analyzed_sql_results ) : array Get column order and column visibility
_getCommentForRow ( array $comments_map, array $fields_meta ) : string Get comment for row
_getCopyLink ( string $copy_url, string $copy_str, string $where_clause, string $where_clause_html, string $class ) : string Prepares an Copy link
_getCopytoclipboardLinks ( ) : string Get copy to clipboard links for results operations
_getDataCellForGeometryColumns ( string $column, string $class, object $meta, array $map, array $_url_params, boolean $condition_field, object | string $transformation_plugin, string $default_function, string $transform_options, array $analyzed_sql_results ) : string Get data cell for geometry type fields
_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 Get data cell for non numeric type fields
_getDataCellForNumericColumns ( string $column, string $class, boolean $condition_field, object $meta, array $map, boolean $is_field_truncated, array $analyzed_sql_results, object | string $transformation_plugin, string $default_function, array $transform_options ) : string Prepare data cell for numeric type fields
_getDataForResettingColumnOrder ( ) : string Prepare data for column restoring and show/hide
_getDeleteAndKillLinks ( string $where_clause, boolean $clause_is_unique, string $url_sql_query, string $del_lnk, array $row ) : array Get delete and kill links
_getDeleteLink ( string $del_url, string $del_str, string $js_conf, string $class ) : string Prepares a Delete link
_getDraggableClassForNonSortableColumns ( boolean $col_visib, string $col_visib_j, boolean $condition_field, array $fields_meta, string $comments ) : string Prepare columns to draggable effect for non sortable columns
_getDraggableClassForSortableColumns ( boolean $col_visib, string $col_visib_j, array $fields_meta, string $order_link, string $comments ) : string Prepare columns to draggable effect for sortable columns
_getEditLink ( string $edit_url, string $class, string $edit_str, string $where_clause, string $where_clause_html ) : string Prepares an Edit link
_getFieldVisibilityParams ( &$displayParts, string $full_or_partial_text_link ) : array Set column span, row span and prepare html with full/partial text button or link
_getFormForMultiRowOperations ( string $del_lnk ) : string Prepare html form for multi row operations
_getFromForeign ( array $map, object $meta, string $where_comparison ) : string Retrieves the associated foreign key info for a data cell
_getFullOrPartialTextButtonOrLink ( ) : string Get full/partial text button or link
_getHtmlPageSelector ( string $table_navigation_html ) : array Possibly return a page selector for table navigation
_getLinkForCreateView ( array $analyzed_sql_results, string $url_query ) : string Generates HTML to display the Create view in span tag
_getModifiedLinks ( string $where_clause, boolean $clause_is_unique, string $url_sql_query ) : array Get modified links
_getMoveBackwardButtonsForTableNavigation ( string $html_sql_query, integer $pos_prev ) : string Prepare move backward buttons - previous and first
_getMoveForwardButtonsForTableNavigation ( string $html_sql_query, integer $pos_next, boolean $is_innodb ) : string Prepare move forward buttons - next and last
_getMultiRowOperationLinks ( &$dt_result, array $analyzed_sql_results, string $del_link ) : string Prepare multi field edit/delete links
_getOffsets ( ) : array Get offsets for next page and previous page
_getOptionsBlock ( ) : string Prepare option fields block
_getOrderLinkAndSortedHeaderHtml ( array $fields_meta, array $sort_expression, array $sort_expression_nodirection, integer $column_index, string $unsorted_sql_query, integer $session_max_rows, string $comments, array $sort_direction, boolean $col_visib, string $col_visib_j ) : array Prepare parameters and html for sorted table header fields
_getPartialText ( string $str ) : mixed Truncates given string based on LimitChars configuration and Session pftext variable (string is truncated only if necessary)
_getPlacedLinks ( string $dir, string $del_url, array $displayParts, integer $row_no, string $where_clause, string $where_clause_html, array $condition_array, string $edit_url, string $copy_url, string $edit_anchor_class, string $edit_str, string $copy_str, string $del_str, string $js_conf ) : string Prepare placed links
_getPlacedTableNavigations ( integer $pos_next, integer $pos_prev, string $place, boolean $is_innodb, string $sort_by_key_html ) : string Prepare table navigation bar at the top or bottom
_getPrintviewLinks ( ) : string Get printview links for results operations
_getRepeatingHeaders ( array $display_params ) : string Get HTML for repeating headers
_getResultsOperations ( array $displayParts, array $analyzed_sql_results, boolean $only_view = false ) : string Get operations that are available on results.
_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 Prepares the displayable content of a data cell in Browse mode, taking into account foreign key description field and transformations
_getRowInfoForSpecialLinks ( array $row, array $col_order ) : array Prepare row information for display special links
_getRowValues ( &$dt_result, array $row, integer $row_no, array $col_order, array $map, string $grid_edit_class, boolean | array | string $col_visib, string $url_sql_query, array $analyzed_sql_results ) : string Get the values for one data row
_getShowAllCheckboxForTableNavigation ( boolean $showing_all, string $html_sql_query ) : string Prepare Show All checkbox for table navigation
_getSingleAndMultiSortUrls ( array $sort_expression, array $sort_expression_nodirection, string $sort_tbl, string $name_to_use_in_sort, array $sort_direction, array $fields_meta, integer $column_index ) : array Prepare parameters and html for sorted table header fields
_getSortByKeyDropDown ( Index[] $indexes, string $sort_expression, string $unsorted_sql_query ) : string Prepare sort by key dropdown - html code segment
_getSortOrderLink ( string $order_img, integer $col_index, array $fields_meta, string $order_url, string $multi_order_url ) : string Get sort order link
_getSortedColumnMessage ( &$dt_result, string $sort_expression_nodirection ) : string Prepare sorted column message
_getSortingUrlParams ( array $sort_direction, string $sort_order, integer $column_index, integer $index ) : array Get sort url parameters - sort order and order image
_getSpecialLinkUrl ( string $column_value, array $row_info, string $field_name ) : string Get link for display special schema links
_getTableBody ( &$dt_result, &$displayParts, array $map, array $analyzed_sql_results, boolean $is_limited_display = false ) : string Prepare the body of the results table
_getTableCommentsArray ( array $analyzed_sql_results ) : array Get table comments as array
_getTableHeaders ( &$displayParts, array $analyzed_sql_results, string $unsorted_sql_query, array $sort_expression = [], array $sort_expression_nodirection = '', array $sort_direction = [], boolean $is_limited_display = false ) : string Get the headers of the results table
_getTableHeadersForColumns ( array $displayParts, array $analyzed_sql_results, array $sort_expression, array $sort_expression_nodirection, array $sort_direction, boolean $is_limited_display, string $unsorted_sql_query ) : string Get the headers of the results table, for all of the columns
_getTableNavigation ( integer $pos_next, integer $pos_prev, boolean $is_innodb, string $sort_by_key_html ) : string Get a navigation bar to browse among the results of a SQL query
_getTableNavigationButton ( string $caption, string $title, integer $pos, string $html_sql_query, boolean $back, string $onsubmit = '', string $input_for_real_end = '', string $onclick = '' ) : string Get a navigation button
_getUnsortedSqlAndSortByKeyDropDown ( array $analyzed_sql_results, string $sort_expression ) : array Prepare unsorted sql query and sort by key drop down
_getUrlSqlQuery ( array $analyzed_sql_results ) : string Get url sql query without conditions to shorten URLs
_handleNonPrintableContents ( string $category, string $content, mixed $transformation_plugin, string $transform_options, string $default_function, object $meta, array $url_params = [], &$is_truncated = null ) : mixed Verifies what to do with non-printable contents (binary or BLOB) in Browse mode.
_isInSorted ( array $sort_expression, array $sort_expression_nodirection, string $sort_tbl, string $name_to_use_in_sort ) : boolean Check whether the column is sorted
_isSelect ( array $analyzed_sql_results ) : boolean Return true if we are executing a query in the form of "SELECT * FROM .
_setDefaultTransformations ( ) : void Sets default transformations for some columns
_setDisplayPartsAndTotal ( array $displayParts ) : array Defines the parts to display for the results of a SQL query and the total number of rows
_setDisplayPartsForNonData ( array $displayParts ) : array Defines the parts to display for statements not related to data
_setDisplayPartsForPrintView ( array $displayParts ) : array Defines the parts to display for a print view
_setDisplayPartsForSelect ( array $displayParts ) : array Defines the parts to display for other statements (probably SELECT)
_setDisplayPartsForShow ( array $displayParts ) : array Defines the parts to display for a SHOW statement
_setHighlightedColumnGlobalField ( array $analyzed_sql_results ) : void Set global array for store highlighted header fields
_setMessageInformation ( string $sorted_column_message, array $analyzed_sql_results, integer $total, integer $pos_next, string $pre_count, string $after_count ) : Message Set the content that needs to be shown in message
_setMimeMap ( ) : void Sets the MIME details of the columns in the results set
_setParamForLinkForeignKeyRelatedTables ( &$map ) : void Set the value of $map array for linking foreign key related tables

Method Details

__construct() public method

Constructor for DisplayResults class
public __construct ( string $db, string $table, string $goto, string $sql_query )
$db string the database name
$table string the table name
$goto string the URL to go back in case of errors
$sql_query string the SQL query

__get() public method

Get any property of this class
public __get ( string $property ) : mixed | void
$property string name of the property
return mixed | void if property exist, value of the relevant property

__set() public method

Set values for any property of this class
public __set ( string $property, mixed $value ) : void
$property string name of the property
$value mixed value to set
return void

getCreateViewQueryResultOp() public method

Calls the _getResultsOperations with $only_view as true
public getCreateViewQueryResultOp ( array $analyzed_sql_results ) : string
$analyzed_sql_results array analyzed sql results
return string

getTable() public method

Prepare a table of results returned by a SQL query.
public getTable ( &$dt_result, &$displayParts, array $analyzed_sql_results, boolean $is_limited_display = false ) : string
$analyzed_sql_results array analyzed sql results
$is_limited_display boolean With limited operations or not
return string $table_html Generated HTML content for resulted table

setConfigParamsForDisplayTable() public method

Checks the posted options for viewing query results and sets appropriate values in the session.

setProperties() public method

Set properties which were not initialized at the constructor
public setProperties ( integer $unlim_num_rows, array $fields_meta, boolean $is_count, integer $is_export, boolean $is_func, integer $is_analyse, integer $num_rows, integer $fields_cnt, double $querytime, string $pmaThemeImage, string $text_dir, boolean $is_maint, boolean $is_explain, boolean $is_show, array $showtable, string $printview, string $url_query, boolean $editable, boolean $is_browse_dist ) : void
$unlim_num_rows integer the total number of rows returned by the SQL query without any appended "LIMIT" clause programmatically
$fields_meta array meta information about fields
$is_count boolean statement is SELECT COUNT
$is_export integer statement contains INTO OUTFILE
$is_func boolean statement contains a function like SUM()
$is_analyse integer statement contains PROCEDURE ANALYSE
$num_rows integer total no. of rows returned by SQL query
$fields_cnt integer total no.of fields returned by SQL query
$querytime double time taken for execute the SQL query
$pmaThemeImage string path for theme images directory
$text_dir string text direction
$is_maint boolean statement contains a maintenance command
$is_explain boolean statement contains EXPLAIN
$is_show boolean statement contains SHOW
$showtable array table definitions
$printview string print view was requested
$url_query string URL query
$editable boolean whether the results set is editable
$is_browse_dist boolean whether browsing distinct values
return void

Property Details

$transformation_info public_oe property

One element of this array represent all relevant columns in all tables in one specific database
public $transformation_info