Translated using Weblate (Hindi)
[phpmyadmin.git] / libraries / user_preferences.inc.php
blob8b3bc32b63cfd7bf39825d0fda5d98114ff9a124
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Common header for user preferences pages
6 * @package PhpMyAdmin
7 */
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')) {
15 exit;
17 // build user preferences menu
19 $form_param = isset($_GET['form']) ? $_GET['form'] : null;
20 $tabs_icons = array(
21 'Features' => 'b_tblops',
22 'Sql' => 'b_sql',
23 'Navi' => 'b_select',
24 'Main' => 'b_props',
25 'Import' => 'b_import',
26 'Export' => 'b_export');
28 $content = PhpMyAdmin\Util::getHtmlTab(
29 array(
30 'link' => 'prefs_manage.php',
31 'text' => __('Manage your settings')
33 ) . "\n";
34 /* Second authentication factor */
35 $content .= PhpMyAdmin\Util::getHtmlTab(
36 array(
37 'link' => 'prefs_twofactor.php',
38 'text' => __('Two-factor authentication')
40 ) . "\n";
41 $script_name = basename($GLOBALS['PMA_PHP_SELF']);
42 foreach (UserFormList::getAll() as $formset) {
43 $formset_class = UserFormList::get($formset);
44 $tab = array(
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))
50 . "\n";
52 echo PhpMyAdmin\Template::get('list/unordered')->render(
53 array(
54 'id' => 'topmenu2',
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']) {
70 $msg = __(
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();