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.4, 1.1.1.1.2.5 class.ms


From: Dan Kuykendall <address@hidden>
Subject: [Phpgroupware-cvs] api class.base.php, 1.1.1.1.2.4, 1.1.1.1.2.5 class.msgbox.php, 1.1.1.1.2.2, 1.1.1.1.2.3 class.phpgw.php, 1.1.1.1.2.9, 1.1.1.1.2.10 class.xmltool.php, 1.1.1.1.2.4, 1.1.1.1.2.5 starter.inc.php, 1.1.1.1.2.8, 1.1.1.1.2.9
Date: Tue, 28 Oct 2003 04:28:46 +0000

Update of /cvsroot/phpgroupware/api
In directory subversions:/tmp/cvs-serv14381/api

Modified Files:
      Tag: proposal-branch
        class.base.php class.msgbox.php class.phpgw.php 
        class.xmltool.php starter.inc.php 
Log Message:
modified loading structure to handle xmlrpc and other rpc services such as 
soap. Added xmlrpc support

Index: starter.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/starter.inc.php,v
retrieving revision 1.1.1.1.2.8
retrieving revision 1.1.1.1.2.9
diff -C2 -d -r1.1.1.1.2.8 -r1.1.1.1.2.9
*** starter.inc.php     27 Oct 2003 19:37:56 -0000      1.1.1.1.2.8
--- starter.inc.php     28 Oct 2003 04:28:44 -0000      1.1.1.1.2.9
***************
*** 45,48 ****
--- 45,57 ----
        magic_quotes_runtime(false);
  
+ 
+       
/****************************************************************************\
+       * Make sure we have a valid client type                                 
     *
+       
\****************************************************************************/
+       if(!isset($GLOBALS['phpgw_client']) || 
!preg_match("/^(browser|xmlrpc)$/i", $GLOBALS['phpgw_client'] ))
+       {
+               $GLOBALS['phpgw_client'] = 'browser';
+       }
+       
        
/****************************************************************************\
        * Load up the initial base environment                                  
     *
***************
*** 92,95 ****
--- 101,105 ----
        * for performance reasons.                                              
     *
        
\****************************************************************************/
+ 
        if($HTTP_GET_VARS['op'] == 'api.xslt.get')
        {
***************
*** 112,126 ****
        
        /* Start output xmltool object */
!       $GLOBALS['phpgw']->phpgw_output = createobject('api_xmltool');
        $GLOBALS['phpgw_xmldoc']        = 
createobject('api_xmltool',array('node_type'=>'node','name'=>'PHPGW'));
        $GLOBALS['phpgw_xml_apinode']   = 
createobject('api_xmltool',array('node_type'=>'node','name'=>'API'));
  
        
/****************************************************************************\
!       * Register op and then create the session, which will be anonymous if 
user   *
!       * is not yet logged in with something else                              
     *
        
\****************************************************************************/
!       reg_var('op', 'any', 'any','##NOVAL##');
!       $new_session = $GLOBALS['phpgw']->session = 
createobject('api_sessions');
  
  
        
/********************************************************************************\
--- 122,135 ----
        
        /* Start output xmltool object */
!       $GLOBALS['phpgw']->base_xml     = createobject('api_xmltool');
        $GLOBALS['phpgw_xmldoc']        = 
createobject('api_xmltool',array('node_type'=>'node','name'=>'PHPGW'));
        $GLOBALS['phpgw_xml_apinode']   = 
createobject('api_xmltool',array('node_type'=>'node','name'=>'API'));
  
        
/****************************************************************************\
!       * Register op, which is done by the rpc constructor                     
     *
        
\****************************************************************************/
!       $GLOBALS['phpgw']->rpc = createobject('api_rpc');
  
+       $new_session = $GLOBALS['phpgw']->session = 
createobject('api_sessions');
  
        
/********************************************************************************\
***************
*** 149,153 ****
        }
        $GLOBALS['phpgw']->db->Halt_On_Error='yes';
-               
  
        
/**********************************************************************************\
--- 158,161 ----
***************
*** 192,200 ****
        * Also remove the stuff we know is for api use only                     
   *
        
\**************************************************************************/
!       $inputs = array_merge($HTTP_SESSION_VARS['phpgw_session'], 
$HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS);
!       unset($inputs['phpgw_lid'], 
$inputs['PHPSESSID'],$inputs['session_lid'],$inputs['sid']);
!       unset($inputs['op'], $inputs['nextop'], $inputs['prevop']);
!       unset($inputs['phpgw_user'], $inputs['phpgw_pass']);
!       unset($inputs['fxsl'], $inputs['lang_cache']);
  
        
/**************************************************************************\
--- 200,204 ----
        * Also remove the stuff we know is for api use only                     
   *
        
\**************************************************************************/
!       $inputs = $GLOBALS['phpgw']->rpc->get_inputs();
  
        
/**************************************************************************\
***************
*** 204,207 ****
--- 208,212 ----
        /* notice that if critical stuff like config and main tables are 
missing it doesnt do acl checl */
        $result = array();
+ 
        if($GLOBALS['missing_critical'] || 
$GLOBALS['phpgw']->acl->check($methodname, 1))
        {
***************
*** 251,253 ****
        }
        /* Now send the result to the XML */
!       $GLOBALS['phpgw']->phpgw_op_out($result);
--- 256,258 ----
        }
        /* Now send the result to the XML */
!       $GLOBALS['phpgw']->rpc->handle_result($result);

Index: class.base.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/class.base.php,v
retrieving revision 1.1.1.1.2.4
retrieving revision 1.1.1.1.2.5
diff -C2 -d -r1.1.1.1.2.4 -r1.1.1.1.2.5
*** class.base.php      27 Oct 2003 18:54:14 -0000      1.1.1.1.2.4
--- class.base.php      28 Oct 2003 04:28:44 -0000      1.1.1.1.2.5
***************
*** 50,54 ****
                {
                        $GLOBALS['phpgw']->add_xsl('api.login');
!                       $GLOBALS['phpgw']->phpgw_out(False);
                }
  
--- 50,54 ----
                {
                        $GLOBALS['phpgw']->add_xsl('api.login');
!                       $GLOBALS['phpgw']->finish(False);
                }
  

Index: class.xmltool.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/class.xmltool.php,v
retrieving revision 1.1.1.1.2.4
retrieving revision 1.1.1.1.2.5
diff -C2 -d -r1.1.1.1.2.4 -r1.1.1.1.2.5
*** class.xmltool.php   27 Oct 2003 18:54:15 -0000      1.1.1.1.2.4
--- class.xmltool.php   28 Oct 2003 04:28:44 -0000      1.1.1.1.2.5
***************
*** 24,41 ****
        /* $Id$ */
  
!       function var2xml()
        {
-               $args = new safe_args();
-               $args->set('data', '##REQUIRED##', 'any');
-               $args->set('name', 'appcontent', 'any');
-               $args->set('is_root', False, 'any');
-               $args = $args->get(func_get_args(),__LINE__,__FILE__);
- 
                $doc = new api_xmltool('root','','');
!               if(!$args['is_root'])
                {
                        $this->show_xml_headers = False;
                }
!               return $doc->import_var($args['name'],$args['data'],True,True);
        }
  
--- 24,36 ----
        /* $Id$ */
  
!       function var2xml($data, $name = 'appcontent', $is_root = True)
        {
                $doc = new api_xmltool('root','','');
!               if(!$is_root)
                {
                        $this->show_xml_headers = False;
                }
!               $doc->import_var($name, $data, True, True);
!               return $doc->export_xml();
        }
  

Index: class.msgbox.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/class.msgbox.php,v
retrieving revision 1.1.1.1.2.2
retrieving revision 1.1.1.1.2.3
diff -C2 -d -r1.1.1.1.2.2 -r1.1.1.1.2.3
*** class.msgbox.php    26 Oct 2003 04:57:27 -0000      1.1.1.1.2.2
--- class.msgbox.php    28 Oct 2003 04:28:44 -0000      1.1.1.1.2.3
***************
*** 55,59 ****
                                        $this->data[] = array('text'=>$text, 
'line'=>$line, 'file'=>$file, 'type'=>$type);
                                        
$GLOBALS['phpgw']->add_xsl('api.phpgw_empty');
!                                       $GLOBALS['phpgw']->phpgw_out(False);
                                        break;
                                case 'debug':
--- 55,59 ----
                                        $this->data[] = array('text'=>$text, 
'line'=>$line, 'file'=>$file, 'type'=>$type);
                                        
$GLOBALS['phpgw']->add_xsl('api.phpgw_empty');
!                                       $GLOBALS['phpgw']->finish(False);
                                        break;
                                case 'debug':
***************
*** 71,75 ****
                                        {
                                                
$GLOBALS['phpgw']->add_xsl('api.phpgw_empty');
!                                               
$GLOBALS['phpgw']->phpgw_out(False);
                                        }
                                        break;
--- 71,75 ----
                                        {
                                                
$GLOBALS['phpgw']->add_xsl('api.phpgw_empty');
!                                               
$GLOBALS['phpgw']->finish(False);
                                        }
                                        break;

Index: class.phpgw.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/class.phpgw.php,v
retrieving revision 1.1.1.1.2.9
retrieving revision 1.1.1.1.2.10
diff -C2 -d -r1.1.1.1.2.9 -r1.1.1.1.2.10
*** class.phpgw.php     27 Oct 2003 18:54:15 -0000      1.1.1.1.2.9
--- class.phpgw.php     28 Oct 2003 04:28:44 -0000      1.1.1.1.2.10
***************
*** 33,36 ****
--- 33,37 ----
                var $session;
                var $db; 
+               var $rpc;
                var $auth;
                var $accounts;
***************
*** 41,51 ****
                var $lang;
  
!               var $phpgw_output;
                var $xsl_files = array();
                var $css_files = array();
                var $js_files  = array();
  
-               var $xslt_render;
-               var $xslt_render_force_server = False;
                var $base_classes_loaded = False;
  
--- 42,50 ----
                var $lang;
  
!               var $base_xml;
                var $xsl_files = array();
                var $css_files = array();
                var $js_files  = array();
  
                var $base_classes_loaded = False;
  
***************
*** 222,231 ****
  
                /*!
!               @function phpgw_out
!               @abstract This is a the primary function used for packaging 
everything up before sending anything out to the browser.
                @discussion This function collects everything to be packaged 
into the XML, and what needs to be send to the XSLT class.
                */
                
!               function phpgw_out()
                {
                        $args = new safe_args();
--- 221,230 ----
  
                /*!
!               @function finish
!               @abstract This is a the primary function used for adding the 
final stuff to the XML result. It then hands off to the rpc for the last step.
                @discussion This function collects everything to be packaged 
into the XML, and what needs to be send to the XSLT class.
                */
                
!               function finish()
                {
                        $args = new safe_args();
***************
*** 307,356 ****
                        
                        /* Add root node to the main doc object */
!                       $this->phpgw_output->add_node($GLOBALS['phpgw_xmldoc']);
!                       
!                       /* Start the XSLT class for it to be able to decide how 
to build the strings */
!                       $this->xslt_render = createobject('api_xslt');
!                       
!                       if($this->xslt_render_force_server)
!                       {
!                               $this->xslt_render->client_render = False;
!                       }
!                       
!                       $stylesheet_string = 
$this->xslt_render->setup_stylesheet($this->xsl_files);
!                       $this->phpgw_output->set_stylesheet($stylesheet_string);
! 
!                       /* Constructing the XML doc */
!                       $xml_result =  $this->phpgw_output->export_xml();
!                       
!                       /* Use the XSLT class to handle browser detection */
!                       /* and if needed, the rendering of the XML */
!                       $this->xslt_render->set_xml($xml_result);
! 
!                       /* Before we send output, save the session data */
!                       $this->session->save_data();
  
!                       /* Have XSLT class output as it determins as best */
!                       //echo '<pre>'; print_r($GLOBALS); echo '</pre>';
!                       echo $this->xslt_render->getOutput();
                        exit;
-               }
- 
-               /*!
-               @function phpgw_op_out
-               @abstract Takes the results of the operation, packs it up and 
then has phpgw_out handle the rest.
-               @param $app_data
-               */
-               function phpgw_op_out($app_data = '')
-               {                       
-                       $GLOBALS['phpgw_xmldoc']->add_node($app_data, 'APP');
-                       $this->phpgw_out();
-               }
- 
-               /*!
-               @function phpgw_final
-               @abstract Not used, but may be used as the registered shutdown 
function, and will redirect to phpgw_out
-               */
-               function phpgw_final()
-               {
                }
  
--- 306,314 ----
                        
                        /* Add root node to the main doc object */
!                       $this->base_xml->add_node($GLOBALS['phpgw_xmldoc']);
  
!                       /* Now pass back to the RPC for final packaging. */
!                       $this->rpc->sendtoclient();
                        exit;
                }
  





reply via email to

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