READS should be before READ_*.
[phpmyadmin/dkf.git] / libraries / user_preferences.inc.php
blobe173d55b3652df4c11e82c8ed94372e2c105387e
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 if (!defined('PHPMYADMIN')) {
9 exit;
12 // show server tabs
13 require './libraries/server_links.inc.php';
15 // build user preferences menu
17 $form_param = filter_input(INPUT_GET, 'form');
18 if (!isset($forms[$form_param])) {
19 $forms_keys = array_keys($forms);
20 $form_param = array_shift($forms_keys);
22 $tabs_icons = array(
23 'Features' => 'b_tblops.png',
24 'Sql_queries' => 'b_sql.png',
25 'Left_frame' => 'b_select.png',
26 'Main_frame' => 'b_props.png',
27 'Import' => 'b_import.png',
28 'Export' => 'b_export.png');
29 echo '<ul id="topmenu2">';
30 echo PMA_generate_html_tab(array(
31 'link' => 'prefs_manage.php',
32 'text' => __('Manage your settings'))) . "\n";
33 echo '<li>&nbsp; &nbsp;</li>' . "\n";
34 $script_name = basename($GLOBALS['PMA_PHP_SELF']);
35 foreach (array_keys($forms) as $formset) {
36 $tab = array(
37 'link' => 'prefs_forms.php',
38 'text' => PMA_lang('Form_' . $formset),
39 'icon' => $tabs_icons[$formset],
40 'active' => ($script_name == 'prefs_forms.php' && $formset == $form_param));
41 echo PMA_generate_html_tab($tab, array('form' => $formset)) . "\n";
43 echo '</ul><div class="clearfloat"></div>';
45 // show "configuration saved" message and reload navigation frame if needed
46 if (!empty($_GET['saved'])) {
47 $message = PMA_Message::rawSuccess(__('Configuration has been saved'));
48 $message->display();
51 // warn about using session storage for settings
52 $cfgRelation = PMA_getRelationsParam();
53 if (!$cfgRelation['userconfigwork']) {
54 $msg = __('Your preferences will be saved for current session only. Storing them permanently requires %sphpMyAdmin configuration storage%s.');
55 $msg = PMA_sanitize(sprintf($msg, '[a@./Documentation.html#linked-tables@_blank]', '[/a]'));
56 PMA_Message::notice($msg)->display();