Translation update done using Pootle.
[phpmyadmin/crack.git] / libraries / user_preferences.inc.php
blob2aad2e63a9ee93634b023f205fe3bac392446fee
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 /* debug code
52 $arr = ConfigFile::getInstance()->getConfigArray();
53 $arr2 = array();
54 foreach ($arr as $k => $v) {
55 $arr2[] = "<b>$k</b> " . var_export($v, true);
57 $arr2 = implode(', ', $arr2);
58 $arr2 .= '<br />Blacklist: ' . (empty($cfg['UserprefsDisallow'])
59 ? '<i>empty</i>'
60 : implode(', ', $cfg['UserprefsDisallow']));
61 $msg = PMA_Message::notice('Settings: ' . $arr2);
62 $msg->display();
63 //*/
65 // warn about using session storage for settings
66 $cfgRelation = PMA_getRelationsParam();
67 if (!$cfgRelation['userconfigwork']) {
68 $msg = __('Your preferences will be saved for current session only. Storing them permanently requires %sphpMyAdmin configuration storage%s.');
69 $msg = PMA_sanitize(sprintf($msg, '[a@./Documentation.html#linked-tables@_blank]', '[/a]'));
70 PMA_Message::notice($msg)->display();