2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Common header for user preferences pages
8 use PhpMyAdmin\Config\Forms\User\UserFormList
;
9 use PhpMyAdmin\Message
;
10 use PhpMyAdmin\Relation
;
11 use PhpMyAdmin\Sanitize
;
12 use PhpMyAdmin\TwoFactor
;
14 if (!defined('PHPMYADMIN')) {
17 // build user preferences menu
19 $form_param = isset($_GET['form']) ?
$_GET['form'] : null;
21 'Features' => 'b_tblops',
25 'Import' => 'b_import',
26 'Export' => 'b_export');
28 $content = PhpMyAdmin\Util
::getHtmlTab(
30 'link' => 'prefs_manage.php',
31 'text' => __('Manage your settings')
34 /* Second authentication factor */
35 $content .= PhpMyAdmin\Util
::getHtmlTab(
37 'link' => 'prefs_twofactor.php',
38 'text' => __('Two-factor authentication')
41 $script_name = basename($GLOBALS['PMA_PHP_SELF']);
42 foreach (UserFormList
::getAll() as $formset) {
43 $formset_class = UserFormList
::get($formset);
45 'link' => 'prefs_forms.php',
46 'text' => $formset_class::getName(),
47 'icon' => $tabs_icons[$formset],
48 'active' => ($script_name == 'prefs_forms.php' && $formset == $form_param));
49 $content .= PhpMyAdmin\Util
::getHtmlTab($tab, array('form' => $formset))
52 echo PhpMyAdmin\Template
::get('list/unordered')->render(
55 'class' => 'user_prefs_tabs',
56 'content' => $content,
59 echo '<div class="clearfloat"></div>';
61 // show "configuration saved" message and reload navigation panel if needed
62 if (!empty($_GET['saved'])) {
63 Message
::rawSuccess(__('Configuration has been saved.'))->display();
66 // warn about using session storage for settings
67 $relation = new Relation();
68 $cfgRelation = $relation->getRelationsParam();
69 if (! $cfgRelation['userconfigwork']) {
71 'Your preferences will be saved for current session only. Storing them '
72 . 'permanently requires %sphpMyAdmin configuration storage%s.'
74 $msg = Sanitize
::sanitize(
75 sprintf($msg, '[doc@linked-tables]', '[/doc]')
77 Message
::notice($msg)->display();