2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Common header for user preferences pages
8 use PMA\libraries\Message
;
9 use PMA\libraries\Sanitize
;
11 if (!defined('PHPMYADMIN')) {
14 // build user preferences menu
16 $form_param = isset($_GET['form']) ?
$_GET['form'] : null;
17 if (! isset($forms[$form_param])) {
18 $forms_keys = array_keys($forms);
19 $form_param = array_shift($forms_keys);
22 'Features' => 'b_tblops.png',
23 'Sql_queries' => 'b_sql.png',
24 'Navi_panel' => 'b_select.png',
25 'Main_panel' => 'b_props.png',
26 'Import' => 'b_import.png',
27 'Export' => 'b_export.png');
29 $content = PMA\libraries\Util
::getHtmlTab(
31 'link' => 'prefs_manage.php',
32 'text' => __('Manage your settings')
35 $script_name = basename($GLOBALS['PMA_PHP_SELF']);
36 foreach (array_keys($forms) as $formset) {
38 'link' => 'prefs_forms.php',
39 'text' => PMA_lang('Form_' . $formset),
40 'icon' => $tabs_icons[$formset],
41 'active' => ($script_name == 'prefs_forms.php' && $formset == $form_param));
42 $content .= PMA\libraries\Util
::getHtmlTab($tab, array('form' => $formset))
45 echo PMA\libraries\Template
::get('list/unordered')->render(
48 'class' => 'user_prefs_tabs',
49 'content' => $content,
52 echo '<div class="clearfloat"></div>';
55 // show "configuration saved" message and reload navigation panel if needed
56 if (!empty($_GET['saved'])) {
57 Message
::rawSuccess(__('Configuration has been saved.'))->display();
61 $arr = $cf->getConfigArray();
63 foreach ($arr as $k => $v) {
64 $arr2[] = "<b>$k</b> " . var_export($v, true);
66 $arr2 = implode(', ', $arr2);
67 $arr2 .= '<br />Blacklist: ' . (empty($cfg['UserprefsDisallow'])
69 : implode(', ', $cfg['UserprefsDisallow']));
70 $msg = Message::notice('Settings: ' . $arr2);
74 // warn about using session storage for settings
75 $cfgRelation = PMA_getRelationsParam();
76 if (! $cfgRelation['userconfigwork']) {
78 'Your preferences will be saved for current session only. Storing them '
79 . 'permanently requires %sphpMyAdmin configuration storage%s.'
81 $msg = Sanitize
::sanitize(
82 sprintf($msg, '[doc@linked-tables]', '[/doc]')
84 Message
::notice($msg)->display();