PMA\libraries\controllers\table\TableStructureController::displayStructure PHP Метод

displayStructure() защищенный Метод

Displays the table structure ('show table' works correct since 3.23.03)
protected displayStructure ( array $cfgRelation, array $columns_with_unique_index, mixed $url_params, Index | false $primary_index, array $fields, array $columns_with_index ) : string
$cfgRelation array current relation parameters
$columns_with_unique_index array Columns with unique index
$url_params mixed Contains an associative array with url params
$primary_index PMA\libraries\Index | false primary index or false if no one exists
$fields array Fields
$columns_with_index array Columns with index
Результат string
    protected function displayStructure($cfgRelation, $columns_with_unique_index, $url_params, $primary_index, $fields, $columns_with_index)
    {
        /* TABLE INFORMATION */
        $HideStructureActions = '';
        if ($GLOBALS['cfg']['HideStructureActions'] === true) {
            $HideStructureActions .= ' HideStructureActions';
        }
        // prepare comments
        $comments_map = array();
        $mime_map = array();
        if ($GLOBALS['cfg']['ShowPropertyComments']) {
            include_once 'libraries/transformations.lib.php';
            $comments_map = PMA_getComments($this->db, $this->table);
            if ($cfgRelation['mimework'] && $GLOBALS['cfg']['BrowseMIME']) {
                $mime_map = PMA_getMIME($this->db, $this->table, true);
            }
        }
        include_once 'libraries/central_columns.lib.php';
        $central_list = PMA_getCentralColumnsFromTable($this->db, $this->table);
        $columns_list = array();
        $titles = array('Change' => Util::getIcon('b_edit.png', __('Change')), 'Drop' => Util::getIcon('b_drop.png', __('Drop')), 'NoDrop' => Util::getIcon('b_drop.png', __('Drop')), 'Primary' => Util::getIcon('b_primary.png', __('Primary')), 'Index' => Util::getIcon('b_index.png', __('Index')), 'Unique' => Util::getIcon('b_unique.png', __('Unique')), 'Spatial' => Util::getIcon('b_spatial.png', __('Spatial')), 'IdxFulltext' => Util::getIcon('b_ftext.png', __('Fulltext')), 'NoPrimary' => Util::getIcon('bd_primary.png', __('Primary')), 'NoIndex' => Util::getIcon('bd_index.png', __('Index')), 'NoUnique' => Util::getIcon('bd_unique.png', __('Unique')), 'NoSpatial' => Util::getIcon('bd_spatial.png', __('Spatial')), 'NoIdxFulltext' => Util::getIcon('bd_ftext.png', __('Fulltext')), 'DistinctValues' => Util::getIcon('b_browse.png', __('Distinct values')));
        /**
         * Work on the table
         */
        if ($this->_tbl_is_view && !$this->_db_is_system_schema) {
            $item = $this->dbi->fetchSingleRow(sprintf("SELECT `VIEW_DEFINITION`, `CHECK_OPTION`, `DEFINER`,\n                      `SECURITY_TYPE`\n                    FROM `INFORMATION_SCHEMA`.`VIEWS`\n                    WHERE TABLE_SCHEMA='%s'\n                    AND TABLE_NAME='%s';", $GLOBALS['dbi']->escapeString($this->db), $GLOBALS['dbi']->escapeString($this->table)));
            $createView = $this->dbi->getTable($this->db, $this->table)->showCreate();
            // get algorithm from $createView of the form
            // CREATE ALGORITHM=<ALGORITHM> DE...
            $parts = explode(" ", substr($createView, 17));
            $item['ALGORITHM'] = $parts[0];
            $view = array('operation' => 'alter', 'definer' => $item['DEFINER'], 'sql_security' => $item['SECURITY_TYPE'], 'name' => $this->table, 'as' => $item['VIEW_DEFINITION'], 'with' => $item['CHECK_OPTION'], 'algorithm' => $item['ALGORITHM']);
            $edit_view_url = 'view_create.php' . URL::getCommon($url_params) . '&amp;' . implode('&amp;', array_map(function ($key, $val) {
                return 'view[' . urlencode($key) . ']=' . urlencode($val);
            }, array_keys($view), $view));
        }
        /**
         * Displays Space usage and row statistics
         */
        // BEGIN - Calc Table Space
        // Get valid statistics whatever is the table type
        if ($GLOBALS['cfg']['ShowStats']) {
            //get table stats in HTML format
            $tablestats = $this->getTableStats();
            //returning the response in JSON format to be used by Ajax
            $this->response->addJSON('tableStat', $tablestats);
        }
        // END - Calc Table Space
        return Template::get('table/structure/display_structure')->render(array('HideStructureActions' => $HideStructureActions, 'db' => $this->db, 'table' => $this->table, 'db_is_system_schema' => $this->_db_is_system_schema, 'tbl_is_view' => $this->_tbl_is_view, 'mime_map' => $mime_map, 'url_query' => $this->_url_query, 'titles' => $titles, 'tbl_storage_engine' => $this->_tbl_storage_engine, 'primary' => $primary_index, 'columns_with_unique_index' => $columns_with_unique_index, 'edit_view_url' => isset($edit_view_url) ? $edit_view_url : null, 'columns_list' => $columns_list, 'tablestats' => isset($tablestats) ? $tablestats : null, 'fields' => $fields, 'columns_with_index' => $columns_with_index, 'central_list' => $central_list, 'comments_map' => $comments_map));
    }