phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: preferences preferences.php,1.13.2.8.2.6,1.13.2


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: preferences preferences.php,1.13.2.8.2.6,1.13.2.8.2.7
Date: Sun, 06 Apr 2003 06:00:42 -0400

Update of /cvsroot/phpgroupware/preferences
In directory subversions:/tmp/cvs-serv16073

Modified Files:
      Tag: Version-0_9_16-branch
        preferences.php 
Log Message:
fixed handling for prefixes, prefix was not uses for saveing the prefs


Index: preferences.php
===================================================================
RCS file: /cvsroot/phpgroupware/preferences/preferences.php,v
retrieving revision 1.13.2.8.2.6
retrieving revision 1.13.2.8.2.7
diff -C2 -r1.13.2.8.2.6 -r1.13.2.8.2.7
*** preferences.php     2 Apr 2003 17:57:51 -0000       1.13.2.8.2.6
--- preferences.php     6 Apr 2003 10:00:40 -0000       1.13.2.8.2.7
***************
*** 226,233 ****
        }
  
!       function process_array(&$_p, $array)
        {
                $_appname = check_app();
  
                while (is_array($array) && list($var,$value) = each($array))
                {
--- 226,243 ----
        }
  
!       function process_array(&$_p,$array,$prefix='')
        {
                $_appname = check_app();
  
+               $prefs = &$_p->data[$_appname];
+ 
+               if ($prefix != '')
+               {
+                       $prefix_arr = explode('/',$prefix);
+                       foreach ($prefix_arr as $pre)
+                       {
+                               $prefs = &$prefs[$pre];
+                       }
+               }
                while (is_array($array) && list($var,$value) = each($array))
                {
***************
*** 242,252 ****
                                        }
                                }
!                               $_p->add($_appname,$var,$value);
                        }
                        else
                        {
!                               unset($_p->data[$_appname][$var]);
                        }
                }
                $_p->save_repository(True);
        }
--- 252,264 ----
                                        }
                                }
!                               $prefs[$var] = $value;
                        }
                        else
                        {
!                               unset($prefs[$var]);
                        }
                }
+               echo "prefix='$prefix', prefs=<pre>"; 
print_r($_p->data[$_appname]);
+ 
                $_p->save_repository(True);
        }
***************
*** 268,272 ****
        function is_admin()
        {
!               if (HAS_ADMIN_RIGHTS == 1 && !isset($_GET['prefix']))   // tabs 
only without prefix
                {
                        return True;
--- 280,286 ----
        function is_admin()
        {
!               global $prefix;
! 
!               if (HAS_ADMIN_RIGHTS == 1 && empty($prefix))    // tabs only 
without prefix
                {
                        return True;
***************
*** 291,294 ****
--- 305,310 ----
        $session_data = 
$GLOBALS['phpgw']->session->appsession('session_data','preferences');
  
+       $prefix = get_var('prefix',array('GET'),$session_data['appname'] == 
$_GET['appname'] ? $session_data['prefix'] : '');
+       
        if (is_admin())
        {
***************
*** 307,314 ****
                $GLOBALS['type'] = 'user';
        }
!       $prefix = get_var('prefix',array('GET'),$session_data['prefix']);
!       
!       $show_help = "$session_data[show_help]" != '' ? 
$session_data['show_help'] : 
!               
intval($GLOBALS['phpgw_info']['user']['preferences']['common']['show_help']);
  
        if ($toggle_help = get_var('toggle_help','POST'))
--- 323,328 ----
                $GLOBALS['type'] = 'user';
        }
!       $show_help = "$session_data[show_help]" != '' && 
$session_data['appname'] == $_GET['appname'] ? 
!               $session_data['show_help'] : 
intval($GLOBALS['phpgw_info']['user']['preferences']['common']['show_help']);
  
        if ($toggle_help = get_var('toggle_help','POST'))
***************
*** 330,334 ****
                if ($GLOBALS['type'] == 'user' || !($GLOBALS['type']))
                {
!                       process_array($GLOBALS['phpgw']->preferences, $user);
                }
  
--- 344,348 ----
                if ($GLOBALS['type'] == 'user' || !($GLOBALS['type']))
                {
!                       
process_array($GLOBALS['phpgw']->preferences,$user,$prefix);
                }
  
***************
*** 363,367 ****
                'type'      => $GLOBALS['type'],        // save our state in 
the app-session
                'show_help' => $show_help,
!               'prefix'    => $prefix
        ));
  
--- 377,382 ----
                'type'      => $GLOBALS['type'],        // save our state in 
the app-session
                'show_help' => $show_help,
!               'prefix'    => $prefix,
!               'appname'   => $_GET['appname']         // we use this to reset 
prefix on appname-change
        ));
  
***************
*** 395,402 ****
                        $prefs = 
&$GLOBALS['phpgw']->preferences->data[check_app()];
                        // use prefix if given in the url, used for email 
extra-accounts
!                       if ($_GET['prefix'] != '')
                        {
!                               $prefix = explode('/',$_GET['prefix']);
!                               foreach ($prefix as $pre)
                                {
                                        $prefs = &$prefs[$pre];
--- 410,417 ----
                        $prefs = 
&$GLOBALS['phpgw']->preferences->data[check_app()];
                        // use prefix if given in the url, used for email 
extra-accounts
!                       if ($prefix != '')
                        {
!                               $prefix_arr = explode('/',$prefix);
!                               foreach ($prefix_arr as $pre)
                                {
                                        $prefs = &$prefs[$pre];





reply via email to

[Prev in Thread] Current Thread [Next in Thread]