Merge remote-tracking branch 'origin/master'
[phpmyadmin/madhuracj.git] / libraries / user_preferences.inc.php
blob8295100e30b891cfadf845826128941bc2ff3a26
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' => 'ic_b_tblops',
24 'Sql_queries' => 'ic_b_sql',
25 'Left_frame' => 'ic_b_select',
26 'Main_frame' => 'ic_b_props',
27 'Import' => 'ic_b_import',
28 'Export' => 'ic_b_export');
29 echo '<ul id="topmenu2">';
30 echo PMA_generate_html_tab(
31 array(
32 'link' => 'prefs_manage.php',
33 'text' => __('Manage your settings')
35 ) . "\n";
36 echo '<li>&nbsp; &nbsp;</li>' . "\n";
37 $script_name = basename($GLOBALS['PMA_PHP_SELF']);
38 foreach (array_keys($forms) as $formset) {
39 $tab = array(
40 'link' => 'prefs_forms.php',
41 'text' => PMA_lang('Form_' . $formset),
42 'icon' => $tabs_icons[$formset],
43 'active' => ($script_name == 'prefs_forms.php' && $formset == $form_param));
44 echo PMA_generate_html_tab($tab, array('form' => $formset)) . "\n";
46 echo '</ul><div class="clearfloat"></div>';
48 // show "configuration saved" message and reload navigation frame if needed
49 if (!empty($_GET['saved'])) {
50 $message = PMA_Message::rawSuccess(__('Configuration has been saved'));
51 $message->display();
54 /* debug code
55 $arr = ConfigFile::getInstance()->getConfigArray();
56 $arr2 = array();
57 foreach ($arr as $k => $v) {
58 $arr2[] = "<b>$k</b> " . var_export($v, true);
60 $arr2 = implode(', ', $arr2);
61 $arr2 .= '<br />Blacklist: ' . (empty($cfg['UserprefsDisallow'])
62 ? '<i>empty</i>'
63 : implode(', ', $cfg['UserprefsDisallow']));
64 $msg = PMA_Message::notice('Settings: ' . $arr2);
65 $msg->display();
66 //*/
68 // warn about using session storage for settings
69 $cfgRelation = PMA_getRelationsParam();
70 if (! $cfgRelation['userconfigwork']) {
71 $msg = __('Your preferences will be saved for current session only. Storing them permanently requires %sphpMyAdmin configuration storage%s.');
72 $msg = PMA_sanitize(sprintf($msg, '[a@./Documentation.html#linked-tables@_blank]', '[/a]'));
73 PMA_Message::notice($msg)->display();