PageRenderTime 48ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/phpmyadmin/libraries/config/FormDisplay.class.php

https://bitbucket.org/adarshj/convenient_website
PHP | 758 lines | 532 code | 51 blank | 175 comment | 97 complexity | bb25146f6ded6740dbd69c73a2bd2f78 MD5 | raw file
Possible License(s): Apache-2.0, MPL-2.0-no-copyleft-exception, LGPL-2.1, BSD-2-Clause, GPL-2.0, LGPL-3.0
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Form management class, displays and processes forms
  5. *
  6. * Explanation of used terms:
  7. * o work_path - original field path, eg. Servers/4/verbose
  8. * o system_path - work_path modified so that it points to the first server,
  9. * eg. Servers/1/verbose
  10. * o translated_path - work_path modified for HTML field name, a path with
  11. * slashes changed to hyphens, eg. Servers-4-verbose
  12. *
  13. * @package PhpMyAdmin
  14. */
  15. /**
  16. * Core libraries.
  17. */
  18. require_once './libraries/config/FormDisplay.tpl.php';
  19. require_once './libraries/config/validate.lib.php';
  20. require_once './libraries/js_escape.lib.php';
  21. /**
  22. * Form management class, displays and processes forms
  23. */
  24. class FormDisplay
  25. {
  26. /**
  27. * Form list
  28. * @var Form[]
  29. */
  30. private $forms = array();
  31. /**
  32. * Stores validation errors, indexed by paths
  33. * [ Form_name ] is an array of form errors
  34. * [path] is a string storing error associated with single field
  35. * @var array
  36. */
  37. private $errors = array();
  38. /**
  39. * Paths changed so that they can be used as HTML ids, indexed by paths
  40. * @var array
  41. */
  42. private $translated_paths = array();
  43. /**
  44. * Server paths change indexes so we define maps from current server
  45. * path to the first one, indexed by work path
  46. * @var array
  47. */
  48. private $system_paths = array();
  49. /**
  50. * Language strings which will be sent to PMA_messages JS variable
  51. * Will be looked up in $GLOBALS: str{value} or strSetup{value}
  52. * @var array
  53. */
  54. private $js_lang_strings = array();
  55. /**
  56. * Tells whether forms have been validated
  57. * @var bool
  58. */
  59. private $is_validated = true;
  60. /**
  61. * Dictionary with user preferences keys
  62. * @var array
  63. */
  64. private $userprefs_keys;
  65. /**
  66. * Dictionary with disallowed user preferences keys
  67. * @var array
  68. */
  69. private $userprefs_disallow;
  70. public function __construct()
  71. {
  72. $this->js_lang_strings = array(
  73. 'error_nan_p' => __('Not a positive number'),
  74. 'error_nan_nneg' => __('Not a non-negative number'),
  75. 'error_incorrect_port' => __('Not a valid port number'),
  76. 'error_invalid_value' => __('Incorrect value'),
  77. 'error_value_lte' => __('Value must be equal or lower than %s'));
  78. // initialize validators
  79. PMA_config_get_validators();
  80. }
  81. /**
  82. * Registers form in form manager
  83. *
  84. * @param string $form_name
  85. * @param array $form
  86. * @param int $server_id 0 if new server, validation; >= 1 if editing a server
  87. */
  88. public function registerForm($form_name, array $form, $server_id = null)
  89. {
  90. $this->forms[$form_name] = new Form($form_name, $form, $server_id);
  91. $this->is_validated = false;
  92. foreach ($this->forms[$form_name]->fields as $path) {
  93. $work_path = $server_id === null
  94. ? $path
  95. : str_replace('Servers/1/', "Servers/$server_id/", $path);
  96. $this->system_paths[$work_path] = $path;
  97. $this->translated_paths[$work_path] = str_replace('/', '-', $work_path);
  98. }
  99. }
  100. /**
  101. * Processes forms, returns true on successful save
  102. *
  103. * @param bool $allow_partial_save allows for partial form saving on failed validation
  104. * @param bool $check_form_submit whether check for $_POST['submit_save']
  105. * @return boolean
  106. */
  107. public function process($allow_partial_save = true, $check_form_submit = true)
  108. {
  109. if ($check_form_submit && !isset($_POST['submit_save'])) {
  110. return false;
  111. }
  112. // save forms
  113. if (count($this->forms) > 0) {
  114. return $this->save(array_keys($this->forms), $allow_partial_save);
  115. }
  116. return false;
  117. }
  118. /**
  119. * Runs validation for all registered forms
  120. *
  121. */
  122. private function _validate()
  123. {
  124. if ($this->is_validated) {
  125. return;
  126. }
  127. $cf = ConfigFile::getInstance();
  128. $paths = array();
  129. $values = array();
  130. foreach ($this->forms as $form) {
  131. /* @var $form Form */
  132. $paths[] = $form->name;
  133. // collect values and paths
  134. foreach ($form->fields as $path) {
  135. $work_path = array_search($path, $this->system_paths);
  136. $values[$path] = $cf->getValue($work_path);
  137. $paths[] = $path;
  138. }
  139. }
  140. // run validation
  141. $errors = PMA_config_validate($paths, $values, false);
  142. // change error keys from canonical paths to work paths
  143. if (is_array($errors) && count($errors) > 0) {
  144. $this->errors = array();
  145. foreach ($errors as $path => $error_list) {
  146. $work_path = array_search($path, $this->system_paths);
  147. // field error
  148. if (!$work_path) {
  149. // form error, fix path
  150. $work_path = $path;
  151. }
  152. $this->errors[$work_path] = $error_list;
  153. }
  154. }
  155. $this->is_validated = true;
  156. }
  157. /**
  158. * Outputs HTML for forms
  159. *
  160. * @param bool $tabbed_form
  161. * @param bool $show_restore_default whether show "restore default" button besides the input field
  162. */
  163. public function display($tabbed_form = false, $show_restore_default = false)
  164. {
  165. static $js_lang_sent = false;
  166. $js = array();
  167. $js_default = array();
  168. $tabbed_form = $tabbed_form && (count($this->forms) > 1);
  169. $validators = PMA_config_get_validators();
  170. display_form_top();
  171. if ($tabbed_form) {
  172. $tabs = array();
  173. foreach ($this->forms as $form) {
  174. $tabs[$form->name] = PMA_lang("Form_$form->name");
  175. }
  176. display_tabs_top($tabs);
  177. }
  178. // valdiate only when we aren't displaying a "new server" form
  179. $is_new_server = false;
  180. foreach ($this->forms as $form) {
  181. /* @var $form Form */
  182. if ($form->index === 0) {
  183. $is_new_server = true;
  184. break;
  185. }
  186. }
  187. if (!$is_new_server) {
  188. $this->_validate();
  189. }
  190. // user preferences
  191. $this->_loadUserprefsInfo();
  192. // display forms
  193. foreach ($this->forms as $form) {
  194. /* @var $form Form */
  195. $form_desc = isset($GLOBALS["strConfigForm_{$form->name}_desc"])
  196. ? PMA_lang("Form_{$form->name}_desc")
  197. : '';
  198. $form_errors = isset($this->errors[$form->name])
  199. ? $this->errors[$form->name] : null;
  200. display_fieldset_top(
  201. PMA_lang("Form_$form->name"),
  202. $form_desc,
  203. $form_errors,
  204. array('id' => $form->name)
  205. );
  206. foreach ($form->fields as $field => $path) {
  207. $work_path = array_search($path, $this->system_paths);
  208. $translated_path = $this->translated_paths[$work_path];
  209. // always true/false for user preferences display
  210. // otherwise null
  211. $userprefs_allow = isset($this->userprefs_keys[$path])
  212. ? !isset($this->userprefs_disallow[$path])
  213. : null;
  214. // display input
  215. $this->_displayFieldInput(
  216. $form,
  217. $field,
  218. $path,
  219. $work_path,
  220. $translated_path,
  221. $show_restore_default,
  222. $userprefs_allow,
  223. $js_default
  224. );
  225. // register JS validators for this field
  226. if (isset($validators[$path])) {
  227. js_validate($translated_path, $validators[$path], $js);
  228. }
  229. }
  230. display_fieldset_bottom();
  231. }
  232. if ($tabbed_form) {
  233. display_tabs_bottom();
  234. }
  235. display_form_bottom();
  236. // if not already done, send strings used for valdiation to JavaScript
  237. if (!$js_lang_sent) {
  238. $js_lang_sent = true;
  239. $js_lang = array();
  240. foreach ($this->js_lang_strings as $strName => $strValue) {
  241. $js_lang[] = "'$strName': '" . PMA_jsFormat($strValue, false) . '\'';
  242. }
  243. $js[] = "$.extend(PMA_messages, {\n\t" . implode(",\n\t", $js_lang) . '})';
  244. }
  245. $js[] = "$.extend(defaultValues, {\n\t" . implode(",\n\t", $js_default) . '})';
  246. display_js($js);
  247. }
  248. /**
  249. * Prepares data for input field display and outputs HTML code
  250. *
  251. * @param Form $form
  252. * @param string $field field name as it appears in $form
  253. * @param string $system_path field path, eg. Servers/1/verbose
  254. * @param string $work_path work path, eg. Servers/4/verbose
  255. * @param string $translated_path work path changed so that it can be used as XHTML id
  256. * @param bool $show_restore_default whether show "restore default" button besides the input field
  257. * @param mixed $userprefs_allow whether user preferences are enabled for this field
  258. * (null - no support, true/false - enabled/disabled)
  259. * @param array &$js_default array which stores JavaScript code to be displayed
  260. */
  261. private function _displayFieldInput(Form $form, $field, $system_path, $work_path,
  262. $translated_path, $show_restore_default, $userprefs_allow, array &$js_default)
  263. {
  264. $name = PMA_lang_name($system_path);
  265. $description = PMA_lang_name($system_path, 'desc', '');
  266. $cf = ConfigFile::getInstance();
  267. $value = $cf->get($work_path);
  268. $value_default = $cf->getDefault($system_path);
  269. $value_is_default = false;
  270. if ($value === null || $value === $value_default) {
  271. $value = $value_default;
  272. $value_is_default = true;
  273. }
  274. $opts = array(
  275. 'doc' => $this->getDocLink($system_path),
  276. 'wiki' => $this->getWikiLink($system_path),
  277. 'show_restore_default' => $show_restore_default,
  278. 'userprefs_allow' => $userprefs_allow,
  279. 'userprefs_comment' => PMA_lang_name($system_path, 'cmt', ''));
  280. if (isset($form->default[$system_path])) {
  281. $opts['setvalue'] = $form->default[$system_path];
  282. }
  283. if (isset($this->errors[$work_path])) {
  284. $opts['errors'] = $this->errors[$work_path];
  285. }
  286. switch ($form->getOptionType($field)) {
  287. case 'string':
  288. $type = 'text';
  289. break;
  290. case 'short_string':
  291. $type = 'short_text';
  292. break;
  293. case 'double':
  294. case 'integer':
  295. $type = 'number_text';
  296. break;
  297. case 'boolean':
  298. $type = 'checkbox';
  299. break;
  300. case 'select':
  301. $type = 'select';
  302. $opts['values'] = $form->getOptionValueList($form->fields[$field]);
  303. break;
  304. case 'array':
  305. $type = 'list';
  306. $value = (array) $value;
  307. $value_default = (array) $value_default;
  308. break;
  309. case 'group':
  310. if (substr($field, 7, 4) != 'end:') { // :group:end is changed to :group:end:{unique id} in Form class
  311. display_group_header(substr($field, 7));
  312. } else {
  313. display_group_footer();
  314. }
  315. return;
  316. case 'NULL':
  317. trigger_error("Field $system_path has no type", E_USER_WARNING);
  318. return;
  319. }
  320. // TrustedProxies requires changes before displaying
  321. if ($system_path == 'TrustedProxies') {
  322. foreach ($value as $ip => &$v) {
  323. if (!preg_match('/^-\d+$/', $ip)) {
  324. $v = $ip . ': ' . $v;
  325. }
  326. }
  327. }
  328. $this->_setComments($system_path, $opts);
  329. // send default value to form's JS
  330. $js_line = '\'' . $translated_path . '\': ';
  331. switch ($type) {
  332. case 'text':
  333. case 'short_text':
  334. case 'number_text':
  335. $js_line .= '\'' . PMA_escapeJsString($value_default) . '\'';
  336. break;
  337. case 'checkbox':
  338. $js_line .= $value_default ? 'true' : 'false';
  339. break;
  340. case 'select':
  341. $value_default_js = is_bool($value_default)
  342. ? (int) $value_default
  343. : $value_default;
  344. $js_line .= '[\'' . PMA_escapeJsString($value_default_js) . '\']';
  345. break;
  346. case 'list':
  347. $js_line .= '\'' . PMA_escapeJsString(implode("\n", $value_default)) . '\'';
  348. break;
  349. }
  350. $js_default[] = $js_line;
  351. display_input($translated_path, $name, $description, $type,
  352. $value, $value_is_default, $opts);
  353. }
  354. /**
  355. * Displays errors
  356. *
  357. */
  358. public function displayErrors()
  359. {
  360. $this->_validate();
  361. if (count($this->errors) == 0) {
  362. return;
  363. }
  364. foreach ($this->errors as $system_path => $error_list) {
  365. if (isset($this->system_paths[$system_path])) {
  366. $path = $this->system_paths[$system_path];
  367. $name = PMA_lang_name($path);
  368. } else {
  369. $name = $GLOBALS["strConfigForm_$system_path"];
  370. }
  371. display_errors($name, $error_list);
  372. }
  373. }
  374. /**
  375. * Reverts erroneous fields to their default values
  376. *
  377. *
  378. */
  379. public function fixErrors()
  380. {
  381. $this->_validate();
  382. if (count($this->errors) == 0) {
  383. return;
  384. }
  385. $cf = ConfigFile::getInstance();
  386. foreach (array_keys($this->errors) as $work_path) {
  387. if (!isset($this->system_paths[$work_path])) {
  388. continue;
  389. }
  390. $canonical_path = $this->system_paths[$work_path];
  391. $cf->set($work_path, $cf->getDefault($canonical_path));
  392. }
  393. }
  394. /**
  395. * Validates select field and casts $value to correct type
  396. *
  397. * @param string $value
  398. * @param array $allowed
  399. * @return bool
  400. */
  401. private function _validateSelect(&$value, array $allowed)
  402. {
  403. $value_cmp = is_bool($value)
  404. ? (int) $value
  405. : $value;
  406. foreach ($allowed as $vk => $v) {
  407. // equality comparison only if both values are numeric or not numeric
  408. // (allows to skip 0 == 'string' equalling to true) or identity (for string-string)
  409. if (($vk == $value && !(is_numeric($value_cmp) xor is_numeric($vk)))
  410. || $vk === $value) {
  411. // keep boolean value as boolean
  412. if (!is_bool($value)) {
  413. settype($value, gettype($vk));
  414. }
  415. return true;
  416. }
  417. }
  418. return false;
  419. }
  420. /**
  421. * Validates and saves form data to session
  422. *
  423. * @param array|string $forms array of form names
  424. * @param bool $allow_partial_save allows for partial form saving on failed validation
  425. * @return boolean true on success (no errors and all saved)
  426. */
  427. public function save($forms, $allow_partial_save = true)
  428. {
  429. $result = true;
  430. $cf = ConfigFile::getInstance();
  431. $forms = (array) $forms;
  432. $values = array();
  433. $to_save = array();
  434. $is_setup_script = defined('PMA_SETUP');
  435. if ($is_setup_script) {
  436. $this->_loadUserprefsInfo();
  437. }
  438. $this->errors = array();
  439. foreach ($forms as $form_name) {
  440. /* @var $form Form */
  441. if (isset($this->forms[$form_name])) {
  442. $form = $this->forms[$form_name];
  443. } else {
  444. continue;
  445. }
  446. // get current server id
  447. $change_index = $form->index === 0
  448. ? $cf->getServerCount() + 1
  449. : false;
  450. // grab POST values
  451. foreach ($form->fields as $field => $system_path) {
  452. $work_path = array_search($system_path, $this->system_paths);
  453. $key = $this->translated_paths[$work_path];
  454. $type = $form->getOptionType($field);
  455. // skip groups
  456. if ($type == 'group') {
  457. continue;
  458. }
  459. // ensure the value is set
  460. if (!isset($_POST[$key])) {
  461. // checkboxes aren't set by browsers if they're off
  462. if ($type == 'boolean') {
  463. $_POST[$key] = false;
  464. } else {
  465. $this->errors[$form->name][] = sprintf(
  466. __('Missing data for %s'),
  467. '<i>' . PMA_lang_name($system_path) . '</i>');
  468. $result = false;
  469. continue;
  470. }
  471. }
  472. // user preferences allow/disallow
  473. if ($is_setup_script && isset($this->userprefs_keys[$system_path])) {
  474. if (isset($this->userprefs_disallow[$system_path])
  475. && isset($_POST[$key . '-userprefs-allow'])) {
  476. unset($this->userprefs_disallow[$system_path]);
  477. } else if (!isset($_POST[$key . '-userprefs-allow'])) {
  478. $this->userprefs_disallow[$system_path] = true;
  479. }
  480. }
  481. // cast variables to correct type
  482. switch ($type) {
  483. case 'double':
  484. settype($_POST[$key], 'float');
  485. break;
  486. case 'boolean':
  487. case 'integer':
  488. if ($_POST[$key] !== '') {
  489. settype($_POST[$key], $type);
  490. }
  491. break;
  492. case 'select':
  493. // special treatment for NavigationBarIconic and PropertiesIconic
  494. if ($key === 'NavigationBarIconic' || $key === 'PropertiesIconic') {
  495. if ($_POST[$key] !== 'both') {
  496. settype($_POST[$key], 'boolean');
  497. }
  498. }
  499. if (!$this->_validateSelect($_POST[$key], $form->getOptionValueList($system_path))) {
  500. $this->errors[$work_path][] = __('Incorrect value');
  501. $result = false;
  502. continue;
  503. }
  504. break;
  505. case 'string':
  506. case 'short_string':
  507. $_POST[$key] = trim($_POST[$key]);
  508. break;
  509. case 'array':
  510. // eliminate empty values and ensure we have an array
  511. $post_values = is_array($_POST[$key])
  512. ? $_POST[$key]
  513. : explode("\n", $_POST[$key]);
  514. $_POST[$key] = array();
  515. foreach ($post_values as $v) {
  516. $v = trim($v);
  517. if ($v !== '') {
  518. $_POST[$key][] = $v;
  519. }
  520. }
  521. break;
  522. }
  523. // now we have value with proper type
  524. $values[$system_path] = $_POST[$key];
  525. if ($change_index !== false) {
  526. $work_path = str_replace("Servers/$form->index/",
  527. "Servers/$change_index/", $work_path);
  528. }
  529. $to_save[$work_path] = $system_path;
  530. }
  531. }
  532. // save forms
  533. if ($allow_partial_save || empty($this->errors)) {
  534. foreach ($to_save as $work_path => $path) {
  535. // TrustedProxies requires changes before saving
  536. if ($path == 'TrustedProxies') {
  537. $proxies = array();
  538. $i = 0;
  539. foreach ($values[$path] as $value) {
  540. $matches = array();
  541. if (preg_match("/^(.+):(?:[ ]?)(\\w+)$/", $value, $matches)) {
  542. // correct 'IP: HTTP header' pair
  543. $ip = trim($matches[1]);
  544. $proxies[$ip] = trim($matches[2]);
  545. } else {
  546. // save also incorrect values
  547. $proxies["-$i"] = $value;
  548. $i++;
  549. }
  550. }
  551. $values[$path] = $proxies;
  552. }
  553. $cf->set($work_path, $values[$path], $path);
  554. }
  555. if ($is_setup_script) {
  556. $cf->set('UserprefsDisallow', array_keys($this->userprefs_disallow));
  557. }
  558. }
  559. // don't look for non-critical errors
  560. $this->_validate();
  561. return $result;
  562. }
  563. /**
  564. * Tells whether form validation failed
  565. *
  566. * @return boolean
  567. */
  568. public function hasErrors()
  569. {
  570. return count($this->errors) > 0;
  571. }
  572. /**
  573. * Returns link to documentation
  574. *
  575. * @param string $path
  576. * @return string
  577. */
  578. public function getDocLink($path)
  579. {
  580. $test = substr($path, 0, 6);
  581. if ($test == 'Import' || $test == 'Export') {
  582. return '';
  583. }
  584. return 'Documentation.html#cfg_' . $this->_getOptName($path);
  585. }
  586. /**
  587. * Returns link to wiki
  588. *
  589. * @param string $path
  590. * @return string
  591. */
  592. public function getWikiLink($path)
  593. {
  594. $opt_name = $this->_getOptName($path);
  595. if (substr($opt_name, 0, 7) == 'Servers') {
  596. $opt_name = substr($opt_name, 8);
  597. if (strpos($opt_name, 'AllowDeny') === 0) {
  598. $opt_name = str_replace('_', '_.28', $opt_name) . '.29';
  599. }
  600. }
  601. $test = substr($path, 0, 6);
  602. if ($test == 'Import') {
  603. $opt_name = substr($opt_name, 7);
  604. if ($opt_name == 'format') {
  605. $opt_name = 'format_2';
  606. }
  607. }
  608. if ($test == 'Export') {
  609. $opt_name = substr($opt_name, 7);
  610. }
  611. return PMA_linkURL('http://wiki.phpmyadmin.net/pma/Config#' . $opt_name);
  612. }
  613. /**
  614. * Changes path so it can be used in URLs
  615. *
  616. * @param string $path
  617. * @return string
  618. */
  619. private function _getOptName($path)
  620. {
  621. return str_replace(array('Servers/1/', '/'), array('Servers/', '_'), $path);
  622. }
  623. /**
  624. * Fills out {@link userprefs_keys} and {@link userprefs_disallow}
  625. *
  626. */
  627. private function _loadUserprefsInfo()
  628. {
  629. if ($this->userprefs_keys === null) {
  630. $this->userprefs_keys = array_flip(PMA_read_userprefs_fieldnames());
  631. // read real config for user preferences display
  632. $userprefs_disallow = defined('PMA_SETUP')
  633. ? ConfigFile::getInstance()->get('UserprefsDisallow', array())
  634. : $GLOBALS['cfg']['UserprefsDisallow'];
  635. $this->userprefs_disallow = array_flip($userprefs_disallow);
  636. }
  637. }
  638. /**
  639. * Sets field comments and warnings based on current environment
  640. *
  641. * @param string $system_path
  642. * @param array $opts
  643. */
  644. private function _setComments($system_path, array &$opts)
  645. {
  646. // RecodingEngine - mark unavailable types
  647. if ($system_path == 'RecodingEngine') {
  648. $comment = '';
  649. if (!function_exists('iconv')) {
  650. $opts['values']['iconv'] .= ' (' . __('unavailable') . ')';
  651. $comment = sprintf(__('"%s" requires %s extension'), 'iconv', 'iconv');
  652. }
  653. if (!function_exists('recode_string')) {
  654. $opts['values']['recode'] .= ' (' . __('unavailable') . ')';
  655. $comment .= ($comment ? ", " : '') . sprintf(__('"%s" requires %s extension'),
  656. 'recode', 'recode');
  657. }
  658. $opts['comment'] = $comment;
  659. $opts['comment_warning'] = true;
  660. }
  661. // ZipDump, GZipDump, BZipDump - check function availability
  662. if ($system_path == 'ZipDump' || $system_path == 'GZipDump' || $system_path == 'BZipDump') {
  663. $comment = '';
  664. $funcs = array(
  665. 'ZipDump' => array('zip_open', 'gzcompress'),
  666. 'GZipDump' => array('gzopen', 'gzencode'),
  667. 'BZipDump' => array('bzopen', 'bzcompress'));
  668. if (!function_exists($funcs[$system_path][0])) {
  669. $comment = sprintf(__('import will not work, missing function (%s)'),
  670. $funcs[$system_path][0]);
  671. }
  672. if (!function_exists($funcs[$system_path][1])) {
  673. $comment .= ($comment ? '; ' : '') . sprintf(__('export will not work, missing function (%s)'),
  674. $funcs[$system_path][1]);
  675. }
  676. $opts['comment'] = $comment;
  677. $opts['comment_warning'] = true;
  678. }
  679. if ($system_path == 'SQLQuery/Validate' && !$GLOBALS['cfg']['SQLValidator']['use']) {
  680. $opts['comment'] = __('SQL Validator is disabled');
  681. $opts['comment_warning'] = true;
  682. }
  683. if ($system_path == 'SQLValidator/use') {
  684. if (!class_exists('SOAPClient')) {
  685. @include_once 'SOAP/Client.php';
  686. if (!class_exists('SOAP_Client')) {
  687. $opts['comment'] = __('SOAP extension not found');
  688. $opts['comment_warning'] = true;
  689. }
  690. }
  691. }
  692. if (!defined('PMA_SETUP')) {
  693. if (($system_path == 'MaxDbList' || $system_path == 'MaxTableList'
  694. || $system_path == 'QueryHistoryMax')) {
  695. $opts['comment'] = sprintf(__('maximum %s'), $GLOBALS['cfg'][$system_path]);
  696. }
  697. }
  698. }
  699. }
  700. ?>