phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] api/class.base.php, 1.1.1.1.2.30


From: nomail
Subject: [Phpgroupware-cvs] api/class.base.php, 1.1.1.1.2.30
Date: Thu, 20 May 2004 21:24:30 -0000

Update of /api
Modified Files:
        Branch: proposal-branch
          class.base.php

date: 2004/04/23 06:58:46;  author: jengo;  state: Exp;  lines: +73 -23

Log Message:
- Restored preferences to a working state
- Added _display_account_fullname(), which will display accounts in the users 
preference format
=====================================================================
No syntax errors detected in -
=====================================================================
Index: api/class.base.php
diff -u api/class.base.php:1.1.1.1.2.29 api/class.base.php:1.1.1.1.2.30
--- api/class.base.php:1.1.1.1.2.29     Sun Apr 18 08:05:26 2004
+++ api/class.base.php  Fri Apr 23 06:58:46 2004
@@ -98,9 +98,9 @@
                'discussion'   => 'This is used by all apps to create a generic 
configuration for there application',
                'params'       => array
                (
-                       'location'    => array('type'=>'string', 'default' => 
REQUIRED, 'desc' => 'Location for there config'),
-                       'form_submit' => array('type'=>'any',    'default' => 
NOTSET,   'desc' => 'Set if the user is submitting'),
-                       'new_config'  => array('type'=>'any',    'default' => 
NOTSET,   'desc' => 'Values submitted from the form')
+                       'location'    => array('type' => 'string', 'default' => 
REQUIRED, 'desc' => 'Location for there config'),
+                       'form_submit' => array('type' => 'any',    'default' => 
NOTSET,   'desc' => 'Set if the user is submitting'),
+                       'new_config'  => array('type' => 'any',    'default' => 
NOTSET,   'desc' => 'Values submitted from the form')
                )
        );
        
@@ -112,9 +112,9 @@
                'discussion'   => 'This is used by all apps to present 
preferences choices to users.',
                'params'       => array
                (
-                       'appname'     => array('type'=>'string', 'default' => 
REQUIRED, 'desc' => 'app to display prefs for'),
-                       'form_submit' => array('type'=>'any',    'default' => 
NOTSET,  'desc' => 'Set if the user is submitting'),
-                       'new_prefs'   => array('type'=>'any',    'default' => 
NOTSET,  'desc' => 'Values submitted from the form')
+                       'appname'     => array('type' => 'string', 'default' => 
REQUIRED, 'desc' => 'app to display prefs for'),
+                       'form_submit' => array('type' => 'any',    'default' => 
NOTSET,   'desc' => 'Set if the user is submitting'),
+                       'new_prefs'   => array('type' => 'any',    'default' => 
NOTSET,   'desc' => 'Values submitted from the form')
                )
        );
 
@@ -250,7 +250,8 @@
                        $account             = 
createObject('api_accounts',$_SESSION['phpgw_session']['session_lid']);
 
                        $history->account_id = $account->account_id;
-                       $new_data = array(
+                       $new_data = array
+                       (
                                'ip_address' => get_ip(),
                                'sessionid'  => session_id()
                        );
@@ -548,7 +549,7 @@
                {
                        $args = new safe_args();
                        $args->set('appname',REQUIRED,'string');
-                       $args->set('form_submit',NOTSET,'any');
+                       $args->set('form_submit',array('false','true'),'enum');
                        $args->set('new_prefs',NOTSET,'any');
                        $args = $args->get(func_get_args());
 
@@ -559,6 +560,8 @@
 
                        $GLOBALS['phpgw']->add_xsl('api.widgets');
 
+                       //html_print_r($GLOBALS['phpgw_data']['prefs']);
+
                        // FIXME: Add ACL check
                        if ($args['appname'] == 'api')
                        {
@@ -570,14 +573,14 @@
                                
$GLOBALS['phpgw']->prefs->load($GLOBALS['phpgw_data']['user']['id'],$args['appname']);
                        }
 
-                       if (!is_array($obj->prefs) && !count($obj->prefs))
+                       if (! is_array($obj->prefs) && ! count($obj->prefs))
                        {
                                $this->method_titles['start'] = lang('Home');
                                trigger_error(lang('Preferences not available 
or missing for this application'),E_USER_WARNING);
                                return array();
                        }
 
-                       if ($args['form_submit'])
+                       if ($args['form_submit'] == 'true')
                        {
                                // FIXME: This should use safe_args to verify
                                if (is_array($args['new_prefs']))
@@ -595,7 +598,7 @@
                                $GLOBALS['phpgw']->form_lock();
                        }
 
-                       $result['pref_widget'] = $obj->prefs;
+                       $result['pref_widget']  = $obj->prefs;
 
                        foreach ($result['pref_widget'] as $i => $widget)
                        {
@@ -632,15 +635,21 @@
                                                break;
                                }
                        }
+
+                       $result['pref_appname'] = $args['appname'];
+
                        return $result;
                }
 
-               var $prefs = array(
-                       0 => array(
+               var $prefs = array
+               (
+                       0 => array
+                       (
                                'type'   => 'selectbox',
                                'name'   => 'timezone',
                                'label'  => 'Timezone',
-                               'values' => array(
+                               'values' => array
+                               (
                                        0 => array(
                                                'value'    => '',
                                                'text'     => ''
@@ -2067,32 +2076,39 @@
                                        )
                                )
                        ),
-                       1 => array(
+                       1 => array
+                       (
                                'type'        => 'selectbox',
                                'name'        => 'time_format',
                                'label'       => 'Time format',
-                               'values' => array(
-                                       0 => array(
+                               'values' => array
+                               (
+                                       0 => array
+                                       (
                                                'value'    => '12',
                                                'text'     => '12 Hour'
                                        ),
-                                       1 => array(
+                                       1 => array
+                                       (
                                                'value'    => '24',
                                                'text'     => '24 Hour'
                                        ),
                                )
                        ),
-                       2 => array(
+                       2 => array
+                       (
                                'type'        => 'inputbox',
                                'name'        => 'maxmatchs',
                                'label'       => 'Number of records per page',
                                'value'       => '15'
                        ),
-                       3 => array(
+                       3 => array
+                       (
                                'type'        => 'selectbox',
                                'name'        => 'lang',
                                'label'       => 'Localization',
-                               'values' => array(
+                               'values' => array
+                               (
                                        // FIXME: These need to be updated, 
most are NOT correct values
                                        0 => array(
                                                'value'    => 'ar',
@@ -2244,7 +2260,41 @@
                                                'text'     => 'Turksih'
                                        )
                                )
-                       )
+                       ),
+                       4 => array
+                       (
+                               'type'        => 'selectbox',
+                               'name'        => 'account_display',
+                               'label'       => 'How do you like to display 
accounts',
+                               'values' => array
+                               (
+                                       0 => array
+                                       (
+                                               'value'    => 'firstname',
+                                               'text'     => 'Firstname 
Lastname'
+                                       ),
+                                       1 => array
+                                       (
+                                               'value'    => 'lastname',
+                                               'text'     => 'Lastname, 
Firstname'
+                                       ),
+                                       2 => array
+                                       (
+                                               'value'    => 'username',
+                                               'text'     => 'Username'
+                                       ),
+                                       3 => array
+                                       (
+                                               'value'    => 'firstall',
+                                               'text'     => 'Firstname 
Lastname [Username]'
+                                       ),
+                                       4 => array
+                                       (
+                                               'value'    => 'all',
+                                               'text'     => '[Username] 
Lastname, Firstname'
+                                       )
+                               )
+                       ),
                );
 
        }




reply via email to

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