phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] email/inc class.html_widgets.inc.php class.msg_...


From: Dave Hall
Subject: [Phpgroupware-cvs] email/inc class.html_widgets.inc.php class.msg_...
Date: Mon, 25 Sep 2006 13:07:06 +0000

CVSROOT:        /cvsroot/phpgroupware
Module name:    email
Changes by:     Dave Hall <skwashd>     06/09/25 13:07:06

Modified files:
        inc            : class.html_widgets.inc.php 
                         class.msg_bootstrap.inc.php 
                         class.uipreferences.inc.php 
                         hook_settings.inc.php 

Log message:
        minor cleanups, app is still pretty fux0r atm, considering making it 
phplib only

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/email/inc/class.html_widgets.inc.php?cvsroot=phpgroupware&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/email/inc/class.msg_bootstrap.inc.php?cvsroot=phpgroupware&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/email/inc/class.uipreferences.inc.php?cvsroot=phpgroupware&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/email/inc/hook_settings.inc.php?cvsroot=phpgroupware&r1=1.6&r2=1.7

Patches:
Index: class.html_widgets.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.html_widgets.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- class.html_widgets.inc.php  11 May 2005 18:06:58 -0000      1.6
+++ class.html_widgets.inc.php  25 Sep 2006 13:07:06 -0000      1.7
@@ -7,7 +7,7 @@
        * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package email
-       * @version $Id: class.html_widgets.inc.php,v 1.6 2005/05/11 18:06:58 
powerstat Exp $
+       * @version $Id: class.html_widgets.inc.php,v 1.7 2006/09/25 13:07:06 
skwashd Exp $
        * @internal Based on AngleMail http://www.anglemail.org/
        */
 
@@ -255,6 +255,7 @@
                */
                function get_href()
                {
+                       $target = '';
                        if ($this->href_target != '')
                        {
                                $target = ' target="'.$this->href_target.'"';

Index: class.msg_bootstrap.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.msg_bootstrap.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- class.msg_bootstrap.inc.php 30 Aug 2006 16:25:28 -0000      1.6
+++ class.msg_bootstrap.inc.php 25 Sep 2006 13:07:06 -0000      1.7
@@ -7,7 +7,7 @@
        * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package email
-       * @version $Id: class.msg_bootstrap.inc.php,v 1.6 2006/08/30 16:25:28 
skwashd Exp $
+       * @version $Id: class.msg_bootstrap.inc.php,v 1.7 2006/09/25 13:07:06 
skwashd Exp $
        * @internal Based on AngleMail http://www.anglemail.org/
        */
 
@@ -283,7 +283,7 @@
                        if (($args_array['do_login'] == True)
                        && (!$some_stream))
                        {
-                               
$GLOBALS['phpgw']->msg->login_error($GLOBALS['PHP_SELF'].', msg_bootstrap: 
ensure_mail_msg_exists(), called_by: '.$called_by);
+                               
$GLOBALS['phpgw']->msg->login_error($_SERVER['PHP_SELF'].', msg_bootstrap: 
ensure_mail_msg_exists(), called_by: '.$called_by);
                        }
                        // login error will halt this script execution
                        // else all is good to go and script continues... 

Index: class.uipreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.uipreferences.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- class.uipreferences.inc.php 11 May 2005 19:09:36 -0000      1.20
+++ class.uipreferences.inc.php 25 Sep 2006 13:07:06 -0000      1.21
@@ -6,10 +6,10 @@
        * @author Angelo (Angles) Puglisi <address@hidden>
        * @copyright Copyright (C) xxxx Mark Cushman
        * @copyright Copyright (C) 2001-2002 Angelo Tony Puglisi (Angles)
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @copyright Copyright (C) 2003-2006 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package email
-       * @version $Id: class.uipreferences.inc.php,v 1.20 2005/05/11 19:09:36 
powerstat Exp $
+       * @version $Id: class.uipreferences.inc.php,v 1.21 2006/09/25 13:07:06 
skwashd Exp $
        * @internal Based on AngleMail http://www.anglemail.org/
        * @internal Based on Aeromail http://the.cushman.net/
        */
@@ -22,11 +22,12 @@
        */              
        class uipreferences
        {
-               var $public_functions = array(
-                       'preferences' => True,
-                       'preferences_default_acct_zero' => True,
-                       'ex_accounts_edit' => True,
-                       'ex_accounts_list' => True
+               var $public_functions = array
+               (
+                       'preferences'           => true,
+                       'ex_accounts_edit'      => true,
+                       'ex_accounts_list'      => true,
+                       'preferences_default_acct_zero' => true
                );
 
                var $bo;
@@ -41,35 +42,34 @@
                function uipreferences()
                {
                        $this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
-                       $this->theme = $GLOBALS['phpgw_info']['theme'];
                        $this->bo = CreateObject('email.bopreferences');
                        $temp_prefs = 
$GLOBALS['phpgw']->preferences->create_email_preferences();
                        $this->prefs = $temp_prefs['email'];
                }
                
-               /*!
-               @function create_prefs_block
-               @abstract create 2 columns TR's (TableRows) from preference 
data as standardized in email 
-               bopreferences class vars ->std_prefs[]  and ->cust_prefs[], 
various HTML widgets supported
-               @param $feed_prefs : array : preference data as standardized in 
email bopreferences class 
-               vars ->std_prefs[]  and ->cust_prefs[]
-               @result : string : HTML data accumulated for parsed prefernce 
widget TR's
-               @discussion  email bopreferences class vars ->std_prefs[]  and 
->cust_prefs[], as filled by
-               email bopreferences->init_available_prefs(), represent a 
standardized preferences schema,
-               this function generates TR's from that data, using elements 
"id", "widget", "other_props", 
-               "lang_blurb", and "values" from that array structure. This 
function uses that data to fill 
-               a template block that contatains the requested widget and the 
appropriate data.
-               Available HTML widgets are:
-                       * textarea
-                       * textbox
-                       * passwordbox
-                       * combobox
-                       * checkbox
-               If prefs data "other_props" contains "hidden", as with password 
data, then the actual 
-               preference value is not shown and the "text blurb" is appended 
with "(hidden)".
-               Array can contain any number of preference "records", all 
generated TR's are cumulative.
-               @author Angles
-               @access Private
+               /**
+                * create 2 columns TR's (TableRows) from preference data as 
standardized in email 
+               *
+                * bopreferences class vars ->std_prefs[]  and ->cust_prefs[], 
various HTML widgets supported
+                * @param $feed_prefs : array : preference data as standardized 
in email bopreferences class 
+                * vars ->std_prefs[]  and ->cust_prefs[]
+                * @return : string : HTML data accumulated for parsed 
prefernce widget TR's
+                *  email bopreferences class vars ->std_prefs[]  and 
->cust_prefs[], as filled by
+                * email bopreferences->init_available_prefs(), represent a 
standardized preferences schema,
+                * this function generates TR's from that data, using elements 
"id", "widget", "other_props", 
+                * "lang_blurb", and "values" from that array structure. This 
function uses that data to fill 
+                * a template block that contatains the requested widget and 
the appropriate data.
+                * Available HTML widgets are:
+                *      * textarea
+                *      * textbox
+                *      * passwordbox
+                *      * combobox
+                *      * checkbox
+                * If prefs data "other_props" contains "hidden", as with 
password data, then the actual 
+                * preference value is not shown and the "text blurb" is 
appended with "(hidden)".
+                * Array can contain any number of preference "records", all 
generated TR's are cumulative.
+                * @author      Angles
+                * @access      Private
                */
                function create_prefs_block($feed_prefs='')
                {
@@ -148,7 +148,8 @@
                                $back_color = (($i + 1)/2 == floor(($i + 1)/2)) 
? $this->theme['row_off'] : $this->theme['row_on'];
                                $back_color_class = (($i + 1)/2 == floor(($i + 
1)/2)) ? 'row_off' : 'row_on';
                                
-                               $var = Array(
+                               $var = array
+                               (
                                        'back_color'    => $back_color,
                                        'back_color_class'      => 
$back_color_class,
                                        'lang_blurb'    => 
$this_item['lang_blurb'],
@@ -174,7 +175,7 @@
                                }
                                
                                // we don't want to show a hidden value
-                               if (!stristr($this_item['write_props'], 
'hidden'))
+                               if ( !isset($this_item['write_props']) || 
!stristr($this_item['write_props'], 'hidden'))
                                {
                                        if ($this->debug > 1) { echo ' * 
email.uipreferences.create_prefs_block: obtain $this_item_value, because 
"hidden" is not in $this_item[write_props]<br />'; }
                                        // "user strings" may have quotes and 
stuff that need to be encoded b4 we display it
@@ -186,6 +187,10 @@
                                        }
                                        else
                                        {
+                                               if ( 
!isset($actual_user_prefs[$this_item['id']]) )
+                                               {
+                                                        
$actual_user_prefs[$this_item['id']] = '';
+                                               }
                                                $this_item_value = 
$actual_user_prefs[$this_item['id']];
                                                if ($this->debug > 1) { echo ' 
* email.uipreferences.create_prefs_block: $this_item[type] NOT a "user string" 
, so NO htmlspecialchars_encode required: $this_item_value: 
[<code>'.$this_item_value.'</code>]<br />'; }
                                        }
@@ -247,6 +252,10 @@
                                        $x = 0;
                                        while ( list ($key,$prop) = each 
($this_item['values']))
                                        {
+                                               if ( 
!isset($combo_available[$key]) )
+                                               {
+                                                       $combo_available[$key] 
= '';
+                                               }
                                                $combobox_html .= 
                                                        '<option 
value="'.$key.'"'.$combo_available[$key].'>'.$prop.'</option>' ."\r\n";
                                                $x++;
@@ -293,12 +302,12 @@
                        return $return_block;
                }
                
-               /*!
-               @function preferences
-               @abstract call this function to display the typical UI html 
page for email preferences
-               @discussion  should obtain the desired account number the user 
wants to see prefs for, if possible
-               @author Angles
-               @access Public
+               /**
+                * call this function to display the typical UI html page for 
email preferences
+               *
+                *  should obtain the desired account number the user wants to 
see prefs for, if possible
+                * @author      Angles
+                * @access      Public
                */
                function preferences()
                {
@@ -324,14 +333,14 @@
                        }
                }
                
-               /*!
-               @function preferences_default_acct_zero
-               @abstract call this function to display the UI html page for 
email preferences for the Default Account
-               @discussion  This is ONLY FOR THE DEFAULT ACCOUNT for 2 reasons
-               1) the defaut account has slightly different prefs then the 
extra account, and
-               2) author too lazy to combine this function with 
ex_accounts_edit() like it should be
-               @author Angles, skeeter
-               @access Public
+               /**
+                * call this function to display the UI html page for email 
preferences for the Default Account
+               *
+                *  This is ONLY FOR THE DEFAULT ACCOUNT for 2 reasons
+                * 1) the defaut account has slightly different prefs then the 
extra account, and
+                * 2) author too lazy to combine this function with 
ex_accounts_edit() like it should be
+                * @author      Angles, skeeter
+                * @access      Public
                */
                function preferences_default_acct_zero()
                {
@@ -499,11 +508,11 @@
                        }
                }
                
-               /*!
-               @function ex_accounts_edit
-               @abstract call this function to display the typical UI html 
page Extra Email Accounts Preferences
-               @author Angles, skeeter
-               @access Public
+               /**
+                * call this function to display the typical UI html page Extra 
Email Accounts Preferences
+               *
+                * @author      Angles, skeeter
+                * @access      Public
                */
                function ex_accounts_edit()
                {
@@ -813,15 +822,14 @@
                        }
                        else
                        {
-                               $this->tpl->set_unknowns('comment');
-                               //$this->tpl->set_unknowns('remove');
+                               $this->tpl->set_unknowns('remove');
                                $data = array();
                                //$data['appname'] = lang('E-Mail');
                                //$data['function_msg'] = lang('E-Mail Extra 
Accounts List');
                                
$GLOBALS['phpgw_info']['flags']['email']['app_header'] = lang('E-Mail') . ': ' 
. lang('E-Mail Extra Accounts List');
-                               $data['email_page'] = 
$this->tpl->parse('out','T_prefs_ex_accounts');
+                               //$data['email_page'] = 
$this->tpl->parse('out','T_prefs_ex_accounts');
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('generic_out' => $data));
-                               $GLOBALS['phpgw']->xslttpl->pp();
+                               //$GLOBALS['phpgw']->xslttpl->pp();
                        }
                }
        }

Index: hook_settings.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/hook_settings.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- hook_settings.inc.php       11 May 2005 14:08:27 -0000      1.6
+++ hook_settings.inc.php       25 Sep 2006 13:07:06 -0000      1.7
@@ -6,15 +6,14 @@
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package email
        * @subpackage hooks
-       * @version $Id: hook_settings.inc.php,v 1.6 2005/05/11 14:08:27 
powerstat Exp $
+       * @version $Id: hook_settings.inc.php,v 1.7 2006/09/25 13:07:06 skwashd 
Exp $
        */
        
        list(,$acctnum) = explode('/',$_GET['prefix']);
        
        if ($acctnum)
        {
-               create_check_box('enable this email 
account','ex_account_enabled',
-                       'THIS PREF CURRENTLY DOES NOTHING<br />Users may have 
more than one email account. In the future it is anticipated that automatic 
actions may be performedon these accounts, such as automatic new mail checks, 
auto filtering, etc... Perhaps the user may want to disable an account so that 
these automatic actions do not occur for that account. This is one possible 
use.<br />Also, an admin may want to disable accounts from time to time.');
+               create_check_box('enable this email 
account','ex_account_enabled', 'Have this account available');
        }
        create_input_box('Account Name','account_name',
                'This is the name that appears in the account combobox. If for 
leave this blank, your accounts will be given a standard name like Account[1]: 
Jane Doe, where Jane Doe is the name you give below as "Your full name". If you 
want to give an account a special name you can fill this in. No matter what, 
this is for your use, your emails will still use "Your full name" as your FROM 
name for email messages. Note that "Your full name" for your email account 0 is 
the name you gave in the phpgroupware setup.');




reply via email to

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