PMA\libraries\config\PageSettings::__construct PHP Method

__construct() public method

Constructor
public __construct ( string $formGroupName, string $elemId = null )
$formGroupName string The name of config form group to display
$elemId string Id of the div containing settings
    public function __construct($formGroupName, $elemId = null)
    {
        global $forms;
        if (empty($forms[$formGroupName])) {
            return;
        }
        if (isset($_REQUEST['printview']) && $_REQUEST['printview'] == '1') {
            return;
        }
        if (!empty($elemId)) {
            $this->_elemId = $elemId;
        }
        $this->_groupName = $formGroupName;
        $cf = new ConfigFile($GLOBALS['PMA_Config']->base_settings);
        PMA_userprefsPageInit($cf);
        $form_display = new FormDisplay($cf);
        foreach ($forms[$formGroupName] as $form_name => $form) {
            // skip Developer form if no setting is available
            if ($form_name == 'Developer' && !$GLOBALS['cfg']['UserprefsDeveloperTab']) {
                continue;
            }
            $form_display->registerForm($form_name, $form, 1);
        }
        // Process form
        $error = null;
        if (isset($_POST['submit_save']) && $_POST['submit_save'] == $formGroupName) {
            $this->_processPageSettings($form_display, $cf, $error);
        }
        // Display forms
        $this->_HTML = $this->_getPageSettingsDisplay($form_display, $error);
    }