Index: config.sample.inc.php
===================================================================
--- config.sample.inc.php	(revision 12659)
+++ config.sample.inc.php	(working copy)
@@ -41,6 +41,9 @@
 $cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
 $cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
 
+/* @zixan | config var for permanent storage feature */
+$cfg['Servers'][$i]['enable_userprefs'] = TRUE;
+
 /* User for advanced features */
 // $cfg['Servers'][$i]['controluser'] = 'pma';
 // $cfg['Servers'][$i]['controlpass'] = 'pmapass';
Index: lang/english-utf-8.inc.php
===================================================================
--- lang/english-utf-8.inc.php	(revision 12659)
+++ lang/english-utf-8.inc.php	(working copy)
@@ -1,6 +1,30 @@
 <?php
 /* $Id$ */
 
+// @ziaxn
+$strPermStorage = 'User Settings'; //Originally : Permanent Storage
+$strServerStorage = 'Permanent User Settings';
+
+//user interface headings
+$strUsrPrefSetting = 'User Setting';
+$strUsrPrefSubmit = 'Update Settings';
+
+//user interface settings names
+$strUsrPrefFontSize = 'Font Size';
+$strUsrPrefMaxRows = 'Maximum Rows';
+$strUsrPrefDefaultLang = 'Default Language';
+$strUsrPrefFullText = 'Full Text Table View';
+$strUsrPrefNavBarIconic = 'Navigation Bar Iconic';
+$strUsrPrefLoginCookieValidity = 'Login Cookie Validity';
+$strUsrPrefMaxTblList = 'Maximum Table List';
+$strUsrPrefMaxDbList = 'Maximum Database List';
+$strUsrPrefUseDbSearch = 'Use DB Search';
+$strUsrPrefLeftFrameLight = 'Left Frame Light';
+$strUsrPrefPropertiesNumCol = 'Properties Number Columns';
+$strUsrPrefPropertiesIconic = 'Properties Iconic';
+$strUsrPrefForeignKeyMaxLimit = 'Foreign Key Maximum Limit';
+$strUsrPrefNaviWidth = 'Navigation Width';
+
 $charset = 'utf-8';
 $text_dir = 'ltr'; // ('ltr' for left to right, 'rtl' for right to left)
 $number_thousands_separator = ',';
Index: libraries/config.default.php
===================================================================
--- libraries/config.default.php	(revision 12659)
+++ libraries/config.default.php	(working copy)
@@ -80,7 +80,6 @@
  */
 $cfg['blowfish_secret'] = '';
 
-
 /*******************************************************************************
  * Server(s) configuration
  *
@@ -145,6 +144,14 @@
 $cfg['Servers'][$i]['bs_temp_log_threshold'] = '';
 
 /**
+ * @zixan
+ * Enable/disable permanent storage feature
+ *
+ * @global bool $cfg['Servers'][$i]['enable_userprefs']
+ */
+$cfg['Servers'][$i]['enable_userprefs'] = TRUE;
+
+/**
  * Use compressed protocol for the MySQL connection (requires PHP >= 4.3.0)
  *
  * @global boolean $cfg['Servers'][$i]['compress']
@@ -351,7 +358,7 @@
  *
  * @global boolean $cfg['Servers'][$i]['AllowNoPassword']
  */
-$cfg['Servers'][$i]['AllowNoPassword'] = false;
+$cfg['Servers'][$i]['AllowNoPassword'] = true; /* does not have anything to do with my project; set it to true due to problem on local machine */
 
 /**
  * Host authentication order, leave blank to not use
@@ -808,7 +815,7 @@
  *
  * @global integer $cfg['MaxRows']
  */
-$cfg['MaxRows'] = 30;
+$cfg['MaxRows'] = 40;
 
 /**
  * default for 'ORDER BY' clause (valid values are 'ASC', 'DESC' or 'SMART' -ie
Index: libraries/db_perm.usr.pref.php
===================================================================
--- libraries/db_perm.usr.pref.php	(revision 0)
+++ libraries/db_perm.usr.pref.php	(revision 0)
@@ -0,0 +1,104 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * @zixan
+ * @version $Id: db_perm.usr.pref.php 2009-07-18 12:54:20Z zixan $
+ * @package phpMyAdmin
+ */
+
+ if (! defined('PHPMYADMIN')) {
+	exit;
+}
+
+/**
+ * @TODO Figure out why SQL queries do not give proper results
+ * @package phpMyAdmin
+ */
+class permUsrPref {
+
+	 /**
+     * @var string current setting name
+     */
+	var $col = '';
+	
+	/**
+     * @var string database name
+     */
+	var $pmadb = '';
+	
+	/**
+     * @var string link to connection server
+	 *
+	 * @TODO I belive I do not need to connection establish to server, as it has already been done. So, this means I need to figure out from where I can extract the link var
+     */
+	var $link = '';
+	
+	/**
+     * @var string currently logged in user
+     */
+	var $user = '';
+	
+	/**
+     * @var string user settings table name 
+     */
+	var $table = '';
+	
+	
+	/**
+	 * Constructor
+	 *
+	 */
+	function __construct()
+	{
+		$this->user = $GLOBALS['cfg']['Server']['user'];
+		$this->pmadb = $GLOBALS['cfg']['Server']['pmadb'];
+		$this->table = 'pma_perm_usr_pref';
+		
+		// $this->link = [Some global var, I guess.]
+		// Do I also need to use PMA_DBI_connect
+		PMA_DBI_select_db($this->pmadb);
+	}
+
+	/**
+	 * Retrieves value of a setting
+	 *
+	 * @uses    string  $this->col for setting name
+	 * @uses    string  $this->table for table name
+	 * @uses    string  $this->user for user name	 
+ 	 * @param   string  $setting_name current setting name
+	 * @return  mixed   setting value
+	 */
+	function fetchSettingValue($setting_name) 
+	{
+		$this->col = $setting_name;
+		$sql = "SELECT " . $this->col . 
+			   " FROM " . $this->table .
+			   " WHERE username='" . $this->user .
+			   "'";
+		return PMA_DBI_try_query($sql);
+	}
+
+	/**
+	 * Updates value of a setting
+	 *
+	 * @uses    string  $this->col for setting name
+	 * @uses    string  $this->table for table name
+	 * @uses    string  $this->user for user name
+	 * @param   mixed   $setting_value setting value
+ 	 * @param   string  $setting_name current setting name
+	 * @return  bool    returns true of false
+	 */
+	function updateSettingValue($setting_name, $setting_value) 
+	{
+		$this->col = $setting_name;
+		$sql = "UPDATE " . $this->table . 
+			   " SET " . $this->col . " = " . $setting_value .
+			   " WHERE username='" . $this->user .
+			   "'";
+		return (PMA_DBI_try_query($sql)) ? 1 : 0; 
+	}
+
+
+}
+
+?>
Index: libraries/server_links.inc.php
===================================================================
--- libraries/server_links.inc.php	(revision 12659)
+++ libraries/server_links.inc.php	(working copy)
@@ -30,7 +30,13 @@
     $sub_part = '';
 }
 
+/**
+ * @zixan
+ * Store true|false value of $cfg['Servers'][$i]['enable_userprefs'] in $isUsrPrefsEnabled
+ */
+$isUsrPrefsEnabled = $GLOBALS['cfg']['Server']['enable_userprefs'];
 
+
 /**
  * Displays tab links
  */
@@ -83,6 +89,13 @@
 $tabs['import']['link'] = 'server_import.php';
 $tabs['import']['text'] = $strImport;
 
+// @zixan 
+if ($isUsrPrefsEnabled) {
+	$tabs['permstorage']['icon'] = 's_permstorage.gif';
+	$tabs['permstorage']['link'] = 'server_perm_storage.php';
+	$tabs['permstorage']['text'] = $strPermStorage;
+}
+
 echo PMA_generate_html_tabs($tabs, array());
 unset($tabs);
 
Index: scripts/create_tables.sql
===================================================================
--- scripts/create_tables.sql	(revision 12659)
+++ scripts/create_tables.sql	(working copy)
@@ -172,3 +172,30 @@
 )
   ENGINE=MyISAM COMMENT='Table coordinates for Designer'
   DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
+  
+  -- --------------------------------------------------------
+--
+-- Table structure for table `pma_perm_usr_pref`
+--
+CREATE TABLE IF NOT EXISTS `pma_perm_usr_pref` (
+`id` bigint(20) unsigned NOT NULL auto_increment,
+`username` varchar(64) NOT NULL default '',
+`fontSize` INT,
+`naviWidth` INT,
+`maxRows` INT,
+`foreignKeyMaxLimit` INT,
+`propertiesIconic` INT,
+`propertiesNumColumns` INT,
+`leftFrameLight` INT,
+`useDbSearch` INT,
+`maxDbList` INT,
+`maxTableList` INT,
+`fullText` INT,
+`loginCookieValidity` INT,
+`navBarIconic` INT,
+`defaultLang` INT,
+PRIMARY KEY  (`id`),
+KEY `username` (`username`)
+)
+ENGINE=MyISAM COMMENT='Permanent User Preferences for phpMyAdmin'
+DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
Index: server_perm_storage.php
===================================================================
--- server_perm_storage.php	(revision 0)
+++ server_perm_storage.php	(revision 0)
@@ -0,0 +1,337 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * @zixan
+ * @version $Id: server_perm_storage.php  2009-07-17 10:15:40 zixan $
+ * @package phpMyAdmin
+ */
+
+/**
+ * Common libraries
+ */
+require_once './libraries/common.inc.php';
+
+/**
+ * Does the common work
+ */
+require './libraries/server_common.inc.php';
+
+/*
+ * Include SQL driver class
+ */
+require './libraries/db_perm.usr.pref.php';
+
+/*
+ * Displays lang selection drop down meny
+ */
+require './libraries/display_select_lang.lib.php';
+
+/**
+ * Displays the links
+ */
+require './libraries/server_links.inc.php';
+
+/**
+ * @zixan
+ * Store true|false value of $cfg['Servers'][$i]['enable_userprefs'] in $isUsrPrefsEnabled
+ */
+$isUsrPrefsEnabled = $GLOBALS['cfg']['Server']['enable_userprefs'];
+
+/**
+ * Displays the sub-page heading
+ */
+
+error_reporting(E_ALL);
+
+echo '<h2>' . "\n"
+   . ($cfg['MainPageIconic'] ? '<img class="icon" src="' . $pmaThemeImage . 's_permstorage.gif" width="16" height="16" alt="" />' : '')
+   . '' . $strServerStorage . "\n"
+   . '</h2>' . "\n";
+   
+	/*
+	 * Creates a $pma_usr_prefs pointer 
+	 */
+	$pma_usr_prefs = new permUsrPref();
+	
+	/*
+	 * Fetch current settings from pmadb 
+	 */
+		
+	/* An extremely poor idea to do this!
+	$current_font_size				    = $pma_usr_prefs->fetchSettingValue('fontSize');
+	$current_navi_width 				= $pma_usr_prefs->fetchSettingValue('naviWidth');
+	$current_max_rows 					= $pma_usr_prefs->fetchSettingValue('maxRows');
+	$current_foreign_key_max_limit      = $pma_usr_prefs->fetchSettingValue('foreignKeyMaxLimit');
+	$current_properties_iconic		    = $pma_usr_prefs->fetchSettingValue('propertiesIconic');
+	$current_properties_num_columns 	= $pma_usr_prefs->fetchSettingValue('propertiesNumColumns');
+	$current_left_frame_light		    = $pma_usr_prefs->fetchSettingValue('leftFrameLight');
+	$current_use_db_search  		    = $pma_usr_prefs->fetchSettingValue('useDbSearch');
+	$current_max_db_List                = $pma_usr_prefs->fetchSettingValue('maxDbList');
+	$current_max_table_list             = $pma_usr_prefs->fetchSettingValue('maxTableList');
+	$current_full_text                  = $pma_usr_prefs->fetchSettingValue('fullText');
+	$current_login_cookie_validity      = $pma_usr_prefs->fetchSettingValue('loginCookieValidity');
+	$current_nav_bar_iconic 			= $pma_usr_prefs->fetchSettingValue('navBarIconic');
+	$current_default_lang 	   		    = $pma_usr_prefs->fetchSettingValue('defaultLang');
+	*/
+	
+echo <<<EOF
+
+	<script type="text/javascript">
+	
+  var x=document.getElementById("mySelect").selectedIndex;
+  alert(document.getElementsByTagName("option")[x].value);
+  
+  
+   var setting = document.getElementById('font_size');
+   var currentValue = '87%';
+   if (setting.
+	</script>
+EOF;
+	
+	if ($_POST['usr_prefs_in']) {
+		$max_rows = $_POST['max_rows'];
+		if (is_numeric($max_rows)) {
+			if ($max_rows > 0 && $max_rows < 101) {
+				    $pma_usr_prefs->updateSettingValue('max_rows', $max_rows);
+					// this is where new settings will  be applied in config files or somewher in pma codebase
+					// any suggestions?
+					} else {
+				echo '<p>Number entered is not in range.</p>';
+			}
+		} else {
+			echo '<p>Number entered is not numeric.</p>';
+		}
+	}
+	
+	 /**
+	 * @zixan
+	 * @NOTE This method was not working so I had to hard-code the drop down menus
+	 *
+	 * Dumps HTML drop down menu; originally created for max_rows
+	 * 
+	 * @uses    $i          starting number
+	 * @uses    $j          ending number
+	 * @uses    $k         	increments the loop by an arbitrary number
+	 * $return  string 		HTML drop down menu
+	 */
+	
+	function htmlDropDownMenu ($i = 0, $j = 10, $k = 5)
+	{	
+		for ($i; $i < $j; $i ++) {
+			$output += '<option value="' . $i . '">' . $i . '</option>';
+		}
+		return $output;
+	}
+	
+   /**
+	 * @zixan
+	 * Created this function dump HTML form as I thought may need to 
+	 * export it to some lower leval class after the completion of this project
+	 *
+	 * $return  string an interface to edit user settings
+	 */
+	function usrSettingForm()
+	{
+		
+		// @NOTE I first thought about using loops to output interface for each setting
+		//       , but this would have resulted in order of O(n) operations
+		
+		$output[0] =
+			
+			'<style type="text/css"> ' .
+			'.odd' .
+			'{' .
+			'background-color:#F5F5F5;' .
+			'}' .
+			'.odd td.center, .even td.center' .
+			'{' .
+			'text-align:center !important;' .
+			'}' .
+			'</style>' .
+			
+			'<form name="usrprefs" id="usrprefs" method="post" action="server_perm_storage.php">' .
+			'<fieldset class="options">' .
+			'<div style="text-align:center;margin:auto;">' .
+			PMA_generate_common_hidden_inputs('', '') . 
+			'<center>' .
+			'<table class="data" style="text-align:center;">' .
+			
+			'<tr>' .
+			'<th>&nbsp;</th>' .
+			'<th>' . $GLOBALS['strUsrPrefSetting'] . '</th>' .
+			'<th>&nbsp;</th>' .
+			'</tr>' .
+			'<tr class="even">' .
+			'<td>' . $GLOBALS['strUsrPrefFontSize'] . '</td>' . 
+			'<td class="center">' .
+			'<select name="font_size">' .
+			'<option id="font_size" ' . $font_size_selected . ' value="32%">32%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="42%">42%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="52%">52%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="62%">62%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="72%">72%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="77%">77%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="78%">78%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="79%">79%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="80%">80%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="81%">81%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="82%">82%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="83%">83%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="84%">84%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="85%">85%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="86%">86%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="87%">87%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="92%">92%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="102%">102%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="112%">112%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="122%">122%</option>' .
+			'<option id="font_size" ' . $font_size_selected . ' value="132%">132%</option>' .
+			'</select>' .
+			'</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .	
+			'<tr class="odd">' .
+			'<td>' . $GLOBALS['strUsrPrefMaxRows']  . '</td>' . 
+			'<td class="center">' .
+			'<select name="max_rows">' .
+			'<option ' . $max_rows_selected . ' value="10">10</option>' .
+			'<option ' . $max_rows_selected . ' value="20">20</option>' .
+			'<option ' . $max_rows_selected . ' value="30">30</option>' .
+			'<option ' . $max_rows_selected . ' value="40">40</option>' .
+			'<option ' . $max_rows_selected . ' value="50">50</option>' .
+			'<option ' . $max_rows_selected . ' value="60">60</option>' .
+			'<option ' . $max_rows_selected . ' value="70">70</option>' .
+			'<option ' . $max_rows_selected . ' value="80">80</option>' .
+			'<option ' . $max_rows_selected . ' value="90">90</option>' .
+			'<option ' . $max_rows_selected . ' value="100">100</option>' .
+			'</select>' .
+			'</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .
+			
+			'<tr class="even">' .
+			'<td>' . $GLOBALS['strUsrPrefDefaultLang'] . '</td>' . 
+			'<td>';
+		
+		/*
+			
+			'<select name="lang"  xml:lang="en" dir="ltr">';
+			
+		// following code obtained from ./libraries/display_select_lang.lib.php
+		// Written by Michal Cihar <michal@cihar.com> | cihar.com
+		
+		uasort($GLOBALS['available_languages'], 'PMA_language_cmp');
+		foreach ($GLOBALS['available_languages'] as $id => $tmplang) {
+			$lang_name = ucfirst(substr(strrchr($tmplang[0], '|'), 1));
+			// Include native name if non empty
+			if (!empty($tmplang[3])) {
+				$lang_name = $tmplang[3] . ' - '
+				. $lang_name;
+			}
+			//Is current one active?
+			if ($lang == $id) {
+				$selected = ' selected="selected"';
+			} else {
+				$selected = '';
+			}		
+
+			$output[1] = '<option value="' . $id . '"' . $selected . '>' . $lang_name . '</option>' . "\n";
+		
+		}
+		
+			'</select>' .
+		
+		*/
+		
+		$output[2] = 
+			'</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .
+			
+			'<tr class="odd">' .
+			'<td>' . $GLOBALS['strUsrPrefFullText'] . '</td>' . 
+			'<td>&nbsp;</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .
+			
+			'<tr class="even">' .
+			'<td>' . $GLOBALS['strUsrPrefNavBarIconic'] . '</td>' . 
+			'<td>&nbsp;</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .
+			
+			'<tr class="odd">' .
+			'<td>' . $GLOBALS['strUsrPrefLoginCookieValidity'] . '</td>' . 
+			'<td>&nbsp;</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .
+			
+			'<tr class="even">' .
+			'<td>' . $GLOBALS['strUsrPrefMaxTblList'] . '</td>' . 
+			'<td>&nbsp;</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .
+			
+			'<tr class="odd">' .
+			'<td>' . $GLOBALS['strUsrPrefMaxDbList'] . '</td>' . 
+			'<td>&nbsp;</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .
+			
+			'<tr class="even">' .
+			'<td>' . $GLOBALS['strUsrPrefUseDbSearch'] . '</td>' . 
+			'<td>&nbsp;</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .
+			
+			'<tr class="odd">' .
+			'<td>' . $GLOBALS['strUsrPrefLeftFrameLight'] . '</td>' . 
+			'<td>&nbsp;</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .
+			
+			'<tr class="even">' .
+			'<td>' . $GLOBALS['strUsrPrefPropertiesNumCol'] . '</td>' . 
+			'<td>&nbsp;</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .
+			
+			'<tr class="odd">' .
+			'<td>' . $GLOBALS['strUsrPrefPropertiesIconic'] . '</td>' . 
+			'<td>&nbsp;</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .
+			
+			'<tr class="even">' .
+			'<td>' . $GLOBALS['strUsrPrefForeignKeyMaxLimit'] . '</td>' . 
+			'<td>&nbsp;</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .
+			
+			'<tr class="odd">' .
+			'<td>' . $GLOBALS['strUsrPrefNaviWidth'] . '</td>' . 
+			'<td>&nbsp;</td>' .
+			'<td>&nbsp;</td>' .
+			'</tr>' .
+			
+			'</table>' .
+			'</center>' .
+			
+			'<div class="clearfloat"></div>' .
+			'</div>' .	
+			'</fieldset>' .
+			'<fieldset class="tblFooters">' .
+			'<input type="submit" value="' . $GLOBALS['strUsrPrefSubmit'] . '" name="usr_prefs_in" name="usr_prefs_in" />' .
+			'</fieldset>' .
+			'</form>'
+			;
+			
+		return $output[0].$output[1].$output[2];
+	}
+echo usrSettingForm();
+
+/**
+ * Displays the footer
+ */
+require './libraries/footer.inc.php';
+?>
Index: themes/original/img/s_permstorage.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: themes\original\img\s_permstorage.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

