"Fossies" - the Fresh Open Source Software Archive

Member "phpMyAdmin-5.1.0-english/libraries/classes/Controllers/Setup/ConfigController.php" (24 Feb 2021, 1404 Bytes) of package /linux/www/phpMyAdmin-5.1.0-english.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ConfigController.php" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 5.0.4-english_vs_5.1.0-english.

    1 <?php
    2 
    3 declare(strict_types=1);
    4 
    5 namespace PhpMyAdmin\Controllers\Setup;
    6 
    7 use PhpMyAdmin\Config\FormDisplayTemplate;
    8 use PhpMyAdmin\Core;
    9 use PhpMyAdmin\Setup\ConfigGenerator;
   10 
   11 class ConfigController extends AbstractController
   12 {
   13     /**
   14      * @param array $params Request parameters
   15      *
   16      * @return string HTML
   17      */
   18     public function index(array $params): string
   19     {
   20         $pages = $this->getPages();
   21 
   22         $formDisplayTemplate = new FormDisplayTemplate($GLOBALS['PMA_Config']);
   23 
   24         $formTop = $formDisplayTemplate->displayFormTop('config.php');
   25         $fieldsetTop = $formDisplayTemplate->displayFieldsetTop(
   26             'config.inc.php',
   27             '',
   28             null,
   29             ['class' => 'simple']
   30         );
   31         $formBottom = $formDisplayTemplate->displayFieldsetBottom(false);
   32         $fieldsetBottom = $formDisplayTemplate->displayFormBottom();
   33 
   34         $config = ConfigGenerator::getConfigFile($this->config);
   35 
   36         return $this->template->render('setup/config/index', [
   37             'formset' => $params['formset'] ?? '',
   38             'pages' => $pages,
   39             'form_top_html' => $formTop,
   40             'fieldset_top_html' => $fieldsetTop,
   41             'form_bottom_html' => $formBottom,
   42             'fieldset_bottom_html' => $fieldsetBottom,
   43             'eol' => Core::ifSetOr($params['eol'], 'unix'),
   44             'config' => $config,
   45         ]);
   46     }
   47 }