PMA\libraries\StorageEngine::getHtmlVariables PHP Method

getHtmlVariables() public method

Returns as HTML table of the engine's server variables
public getHtmlVariables ( ) : string
return string The table that was generated based on the retrieved information
    public function getHtmlVariables()
    {
        $ret = '';
        foreach ($this->getVariablesStatus() as $details) {
            $ret .= '<tr>' . "\n" . '    <td>' . "\n";
            if (!empty($details['desc'])) {
                $ret .= '        ' . Util::showHint($details['desc']) . "\n";
            }
            $ret .= '    </td>' . "\n" . '    <th>' . htmlspecialchars($details['title']) . '</th>' . "\n" . '    <td class="value">';
            switch ($details['type']) {
                case PMA_ENGINE_DETAILS_TYPE_SIZE:
                    $parsed_size = $this->resolveTypeSize($details['value']);
                    $ret .= $parsed_size[0] . '&nbsp;' . $parsed_size[1];
                    unset($parsed_size);
                    break;
                case PMA_ENGINE_DETAILS_TYPE_NUMERIC:
                    $ret .= Util::formatNumber($details['value']) . ' ';
                    break;
                default:
                    $ret .= htmlspecialchars($details['value']) . '   ';
            }
            $ret .= '</td>' . "\n" . '</tr>' . "\n";
        }
        if (!$ret) {
            $ret = '<p>' . "\n" . '    ' . __('There is no detailed status information available for this ' . 'storage engine.') . "\n" . '</p>' . "\n";
        } else {
            $ret = '<table class="data">' . "\n" . $ret . '</table>' . "\n";
        }
        return $ret;
    }

Usage Example

 /**
  * Return HTML for a given Storage Engine
  *
  * @param StorageEngine $engine storage engine
  *
  * @return string
  */
 private function _getHtmlForServerEngine($engine)
 {
     $pageOutput = !empty($_REQUEST['page']) ? $engine->getPage($_REQUEST['page']) : '';
     /**
      * Displays details about a given Storage Engine
      */
     return Template::get('server/engines/engine')->render(array('title' => $engine->getTitle(), 'helpPage' => $engine->getMysqlHelpPage(), 'comment' => $engine->getComment(), 'infoPages' => $engine->getInfoPages(), 'support' => $engine->getSupportInformationMessage(), 'variables' => $engine->getHtmlVariables(), 'pageOutput' => $pageOutput));
 }