diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-07-27 10:05:23 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-07-27 10:05:23 +0200 |
| commit | 5bf66662a9bdd62c5bccab15e607cd95cfb8fcab (patch) | |
| tree | 39a1a4629749056191c05dfd899f931701b7acf3 /srcs/phpmyadmin/libraries/classes/Config/Forms/BaseFormList.php | |
| parent | 5afd237bbd22028b85532b8c0b3fcead49a00764 (diff) | |
| download | ft_server-master.tar.gz ft_server-master.tar.bz2 ft_server-master.zip | |
Removed wordpress and phpmyadmin, my server doesn't handle it well and it brings shame on my famillyHEADmaster
Diffstat (limited to 'srcs/phpmyadmin/libraries/classes/Config/Forms/BaseFormList.php')
| -rw-r--r-- | srcs/phpmyadmin/libraries/classes/Config/Forms/BaseFormList.php | 150 |
1 files changed, 0 insertions, 150 deletions
diff --git a/srcs/phpmyadmin/libraries/classes/Config/Forms/BaseFormList.php b/srcs/phpmyadmin/libraries/classes/Config/Forms/BaseFormList.php deleted file mode 100644 index f4a5d32..0000000 --- a/srcs/phpmyadmin/libraries/classes/Config/Forms/BaseFormList.php +++ /dev/null @@ -1,150 +0,0 @@ -<?php -/* vim: set expandtab sw=4 ts=4 sts=4: */ -/** - * User preferences form - * - * @package PhpMyAdmin - */ -declare(strict_types=1); - -namespace PhpMyAdmin\Config\Forms; - -use PhpMyAdmin\Config\ConfigFile; - -/** - * Class BaseFormList - * @package PhpMyAdmin\Config\Forms - */ -class BaseFormList -{ - /** - * List of all forms - */ - protected static $all = []; - - /** - * @var string - */ - protected static $ns = 'PhpMyAdmin\\Config\\Forms\\'; - - /** - * @var array - */ - private $_forms; - - /** - * @return array - */ - public static function getAll() - { - return static::$all; - } - - /** - * @param string $name Name - * @return bool - */ - public static function isValid($name) - { - return in_array($name, static::$all); - } - - /** - * @param string $name Name - * @return null|string - */ - public static function get($name) - { - if (static::isValid($name)) { - return static::$ns . $name . 'Form'; - } - return null; - } - - /** - * Constructor - * - * @param ConfigFile $cf Config file instance - */ - public function __construct(ConfigFile $cf) - { - $this->_forms = []; - foreach (static::$all as $form) { - $class = static::get($form); - $this->_forms[] = new $class($cf); - } - } - - /** - * Processes forms, returns true on successful save - * - * @param bool $allowPartialSave allows for partial form saving - * on failed validation - * @param bool $checkFormSubmit whether check for $_POST['submit_save'] - * - * @return boolean whether processing was successful - */ - public function process($allowPartialSave = true, $checkFormSubmit = true) - { - $ret = true; - foreach ($this->_forms as $form) { - $ret = $ret && $form->process($allowPartialSave, $checkFormSubmit); - } - return $ret; - } - - /** - * Displays errors - * - * @return string HTML for errors - */ - public function displayErrors() - { - $ret = ''; - foreach ($this->_forms as $form) { - $ret .= $form->displayErrors(); - } - return $ret; - } - - /** - * Reverts erroneous fields to their default values - * - * @return void - */ - public function fixErrors() - { - foreach ($this->_forms as $form) { - $form->fixErrors(); - } - } - - /** - * Tells whether form validation failed - * - * @return boolean - */ - public function hasErrors() - { - $ret = false; - foreach ($this->_forms as $form) { - $ret = $ret || $form->hasErrors(); - } - return $ret; - } - - /** - * Returns list of fields used in the form. - * - * @return string[] - */ - public static function getFields() - { - $names = []; - foreach (static::$all as $form) { - $class = static::get($form); - $names = array_merge($names, $class::getFields()); - } - return $names; - } -} |
