phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] [18999] Fix the public / private visibility.


From: Caeies
Subject: [Phpgroupware-cvs] [18999] Fix the public / private visibility.
Date: Wed, 19 Nov 2008 18:03:39 +0000

Revision: 18999
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=18999
Author:   Caeies
Date:     2008-11-19 18:03:39 +0000 (Wed, 19 Nov 2008)

Log Message:
-----------
Fix the public / private visibility. Probably made some little mistakes but, 
please, thing and discuss on the dev list changes \!

Modified Paths:
--------------
    core/trunk/phpgwapi/inc/class.preferences.inc.php

Modified: core/trunk/phpgwapi/inc/class.preferences.inc.php
===================================================================
--- core/trunk/phpgwapi/inc/class.preferences.inc.php   2008-11-19 18:02:08 UTC 
(rev 18998)
+++ core/trunk/phpgwapi/inc/class.preferences.inc.php   2008-11-19 18:03:39 UTC 
(rev 18999)
@@ -110,7 +110,7 @@
                 * @param $use_standard_values should the standard values are 
used
                 * @return the parsed notify-msg
                 */
-               function parse_notify($msg, $values = '', $use_standard_values 
= true)
+               private function parse_notify($msg, $values = '', 
$use_standard_values = true)
                {
                        $vals = $values ? $values : array();
 
@@ -135,7 +135,7 @@
                 * @param $un_lang if true translate back
                 * @return the result
                 */
-               function lang_notify($msg,$vals=array(),$un_lang=False)
+               private function lang_notify($msg,$vals=array(),$un_lang=False)
                {
                        foreach($vals as $key => $val)
                        {
@@ -156,7 +156,7 @@
                 * define some standard substitues-values and use them on the 
prefs, if needed
                 *
                 */
-               function standard_substitutes()
+               private function standard_substitutes()
                {
                        if ( 
!isset($GLOBALS['phpgw_info']['server']['mail_suffix'])
                                        || 
!$GLOBALS['phpgw_info']['server']['mail_suffix'] )
@@ -171,12 +171,13 @@
                                $GLOBALS['phpgw']->translation->userlang = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
                        }
                        // we cant use phpgw_info/user/fullname, as it's not 
set when we run
-                       
$GLOBALS['phpgw']->accounts->get_account_name($this->account_id,$lid,$fname,$lname);
+                       //XXX Caeies nov08 Fixing the preference system, get 
the account object, and use it for our benefit
+                       $oAccount = 
$GLOBALS['phpgw']->accounts->get($this->account_id);
 
                        $this->values = array(  // standard notify replacements
-                                       'fullname'  => 
$GLOBALS['phpgw']->common->display_fullname('',$fname,$lname),
-                                       'firstname' => $fname,
-                                       'lastname'  => $lname,
+                                       'fullname'  => 
$GLOBALS['phpgw']->common->display_fullname('', $oAccount->firstname, 
$oAccount->lastname),
+                                       'firstname' => $oAccount->firstname,
+                                       'lastname'  => $oAccount->lastname,
                                        'domain'    => 
$GLOBALS['phpgw_info']['server']['mail_suffix'],
                                        'email'     => 
$this->email_address($this->account_id),
                                        'date'      => 
$GLOBALS['phpgw']->common->show_date('',$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'])
@@ -222,7 +223,7 @@
                 *
                 * @param $arr array to unquote (var-param!)
                 */
-               function unquote(&$arr)
+               public function unquote(&$arr)
                {
                        if (!is_array($arr))
                        {
@@ -248,7 +249,7 @@
                 * the function ready all 3 prefs user/default/forced and 
merges them to the effective ones
                 * private function should only be called from within this class
                 */
-               function read_repository()
+               protected function read_repository()
                {
                        
if($GLOBALS['phpgw']->acl->check('session_only_preferences',1,'preferences') && 
strlen($GLOBALS['phpgw']->session->appsession('session_prefs','initiated')))
                        {
@@ -354,7 +355,7 @@
                 * Example1: preferences->read();
                 * @return $data array containing user preferences
                 */
-               function read()
+               public function read()
                {
                        if (count($this->data) == 0)
                        {
@@ -374,7 +375,7 @@
                 * the effective prefs ($this->data) are updated to reflect the 
change
                 * @return the new effective prefs (even when forced or default 
prefs are set !)
                 */
-               function add($app_name,$var,$value = '##undef##',$type='user')
+               public function add($app_name,$var,$value = 
'##undef##',$type='user')
                {
                        //echo "<p>add('$app_name','$var','$value')</p>\n";
                        if ($value == '##undef##')
@@ -420,7 +421,7 @@
                 * the effektive prefs ($this->data) are updated to reflect the 
change
                 * @return the new effective prefs (even when forced or default 
prefs are deleted!)
                 */
-               function delete($app_name, $var = False,$type = 'user')
+               public function delete($app_name, $var = False,$type = 'user')
                {
                        //echo "<p>delete('$app_name','$var')</p>\n";
                        $set_via = array(
@@ -483,7 +484,7 @@
                 * @param $value value of the preference
                 * the function works on user and data, to be able to save the 
pref and to have imediate effect
                 */
-               function add_struct($app_name,$var,$value = '')
+               public function add_struct($app_name,$var,$value = '')
                {
                        /* eval is slow and dangerous
                           $code = '$this->data[$app_name]'.$var.' = $value;';
@@ -512,7 +513,7 @@
                 * @param $var array keys separated by '/', eg. 'ex_accounts/1'
                 * the function works on user and data, to be able to save the 
pref and to have imediate effect
                 */
-               function delete_struct($app_name, $var = '')
+               public function delete_struct($app_name, $var = '')
                {
                        /* eval is slow and dangerous
                           $code_1 = '$this->data[$app_name]'.$var.' = "";';
@@ -543,7 +544,7 @@
                 *
                 * @param $arr array to unquote (var-param!)
                 */
-               function quote(&$arr)
+               public function quote(&$arr)
                {
                        if (!is_array($arr))
                        {
@@ -570,7 +571,7 @@
                 * @param $type which prefs to update: user/default/forced 
                 * the user prefs for saveing are in $this->user not in 
$this->data, which are the effectiv prefs only
                 */
-               function save_repository($update_session_info = 
False,$type='user')
+               public function save_repository($update_session_info = 
False,$type='user')
                {
                        // Don't get the old values back from the cache on next 
load
                        $GLOBALS['phpgw']->session->clear_phpgw_info_cache();
@@ -644,7 +645,7 @@
                 *
                 * @param $account_id numerical id of account for which to 
create the prefs
                 */
-               function create_defaults($account_id)
+               public function create_defaults($account_id)
                {
                        return; // not longer needed, as the defaults are 
merged in on runtime
                        $this->db->query("select * from phpgw_preferences where 
preference_owner='-2'",__LINE__,__FILE__);
@@ -669,7 +670,7 @@
                 * 
                 * @param $data array of preferences
                 */
-               function update_data($data)
+               public function update_data($data)
                {
                        if(is_array($data))
                        {
@@ -686,11 +687,11 @@
                }
 
                /* legacy support */
-               function change($app_name,$var,$value = "")
+               private function change($app_name,$var,$value = "")
                {
                        return $this->add($app_name,$var,$value);
                }
-               function commit($update_session_info = True)
+               private function commit($update_session_info = True)
                {
                        //return $this->save_repository($update_session_info);
                }
@@ -776,7 +777,7 @@
                 * @author  Angles
                 * @access Private
                 */
-               function sub_get_mailsvr_port($prefs, $acctnum=0)
+               private function sub_get_mailsvr_port($prefs, $acctnum=0)
                {
                        $port_number = 0;
                        // first we try the port number supplied in preferences
@@ -833,7 +834,7 @@
                 * @param $accountid - as determined in and/or passed to 
"create_email_preferences"
                 * @access Private
                 */
-               function sub_default_userid($account_id='')
+               private function sub_default_userid($account_id='')
                {
                        $prefs_email_userid = 
$GLOBALS['phpgw']->accounts->id2lid($account_id, true);
 
@@ -861,7 +862,7 @@
                 * @param $accountid - as determined in and/or passed to 
"create_email_preferences"
                 * @access public
                 */
-               function email_address($account_id='')
+               public function email_address($account_id='')
                {
                        if ( isset($this->data['email']['address']) )
                        {
@@ -877,7 +878,7 @@
                        return $prefs_email_address;
                }
 
-               function sub_default_address($account_id='')
+               private function sub_default_address($account_id='')
                {
                        return $this->email_address($account_id);
                }
@@ -897,7 +898,7 @@
                 * a preference value for any particular preference item 
available to the user.
                 * @access Public
                 */
-               function create_email_preferences($accountid='', $acctnum=0)
+               public function create_email_preferences($accountid='', 
$acctnum=0)
                {
                        print_debug('class.preferences: 
create_email_preferences: ENTERING<br>', 'messageonly','api');
                        // we may need function "html_quotes_decode" from the 
mail_msg class






reply via email to

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