userPreferences = new UserPreferences(); $form_class = PageFormList::get($formGroupName); if (is_null($form_class)) { 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); $this->userPreferences->pageInit($cf); $form_display = new $form_class($cf); // 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); } /** * Process response to form * * @param FormDisplay &$form_display Form * @param ConfigFile &$cf Configuration file * @param Message|null &$error Error message * * @return void */ private function _processPageSettings(&$form_display, &$cf, &$error) { if ($form_display->process(false) && !$form_display->hasErrors()) { // save settings $result = $this->userPreferences->save($cf->getConfigArray()); if ($result === true) { // reload page $response = Response::getInstance(); Core::sendHeaderLocation( $response->getFooter()->getSelfUrl('unencoded') ); exit(); } else { $error = $result; } } } /** * Store errors in _errorHTML * * @param FormDisplay &$form_display Form * @param Message|null &$error Error message * * @return void */ private function _storeError(&$form_display, &$error) { $retval = ''; if ($error) { $retval .= $error->getDisplay(); } if ($form_display->hasErrors()) { // form has errors $retval .= '