getValidators() public static method

Returns validator list
public static getValidators ( PMA\libraries\config\ConfigFile $cf ) : array
$cf PMA\libraries\config\ConfigFile Config file instance
return array
Example #1
0
 /**
  * Outputs HTML for the forms under the menu tab
  *
  * @param bool  $show_restore_default whether to show "restore default"
  *                                    button besides the input field
  * @param array &$js_default          stores JavaScript code
  *                                    to be displayed
  * @param array &$js                  will be updated with javascript code
  * @param bool  $show_buttons         whether show submit and reset button
  *
  * @return string $htmlOutput
  */
 private function _displayForms($show_restore_default, array &$js_default, array &$js, $show_buttons)
 {
     $htmlOutput = '';
     $validators = Validator::getValidators($this->_configFile);
     foreach ($this->_forms as $form) {
         /* @var $form Form */
         $form_desc = isset($GLOBALS["strConfigForm_{$form->name}_desc"]) ? PMA_lang("Form_{$form->name}_desc") : '';
         $form_errors = isset($this->_errors[$form->name]) ? $this->_errors[$form->name] : null;
         $htmlOutput .= PMA_displayFieldsetTop(PMA_lang("Form_{$form->name}"), $form_desc, $form_errors, array('id' => $form->name));
         foreach ($form->fields as $field => $path) {
             $work_path = array_search($path, $this->_systemPaths);
             $translated_path = $this->_translatedPaths[$work_path];
             // always true/false for user preferences display
             // otherwise null
             $userprefs_allow = isset($this->_userprefsKeys[$path]) ? !isset($this->_userprefsDisallow[$path]) : null;
             // display input
             $htmlOutput .= $this->_displayFieldInput($form, $field, $path, $work_path, $translated_path, $show_restore_default, $userprefs_allow, $js_default);
             // register JS validators for this field
             if (isset($validators[$path])) {
                 PMA_addJsValidate($translated_path, $validators[$path], $js);
             }
         }
         $htmlOutput .= PMA_displayFieldsetBottom($show_buttons);
     }
     return $htmlOutput;
 }