phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: admin/inc class.boapplications.inc.php,1.5,1.5.4


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: admin/inc class.boapplications.inc.php,1.5,1.5.4.1 class.uiapplications.inc.php,1.3.2.1.2.2,1.3.2.1.2.3 hook_admin.inc.php,1.26.2.1.2.1,1.26.2.1.2.2
Date: Sun, 27 Apr 2003 17:34:16 -0400

Update of /cvsroot/phpgroupware/admin/inc
In directory subversions:/tmp/cvs-serv6233

Modified Files:
      Tag: Version-0_9_16-branch
        class.boapplications.inc.php class.uiapplications.inc.php 
        hook_admin.inc.php 
Log Message:
new type of hooks via methodes instead of separate files:
- allows to parse arguments ot the hook and return content
- all access to the hook-table is now handled by the hook-class (for admin and 
setup too)
- all existing hooks continue to work of cause

Index: class.boapplications.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.boapplications.inc.php,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -C2 -r1.5 -r1.5.4.1
*** class.boapplications.inc.php        6 Jan 2002 05:56:19 -0000       1.5
--- class.boapplications.inc.php        27 Apr 2003 21:34:14 -0000      1.5.4.1
***************
*** 14,21 ****
        class boapplications
        {
-               var $public_functions = array(
-                       'register_all_hooks' => True
-               );
- 
                var $so;
  
--- 14,17 ----
***************
*** 58,96 ****
                {
                        return $this->so->delete($app_name);
-               }
- 
-               function register_hook($hook_app)
-               {
-                       return $this->so->register_hook($hook_app);
-               }
- 
-               function register_all_hooks()
-               {
-                       $SEP = filesystem_separator();
-                       $app_list = $this->get_list();
-                       $hooks = CreateObject('phpgwapi.hooks');
-                       while(list($app_name,$app) = each($app_list))
-                       {                       
-                               $f = PHPGW_SERVER_ROOT . $SEP . $app_name . 
$SEP . 'setup' . $SEP . 'setup.inc.php';
-                               if(@file_exists($f))
-                               {
-                                       include($f);
-                                       
while(is_array($setup_info[$app_name]['hooks']) && list(,$hook) = 
@each($setup_info[$app_name]['hooks']))
-                                       {
-                                               
if(address@hidden>found_hooks[$app_name][$hook])
-                                               {
-                                                       $this->register_hook(
-                                                               Array(
-                                                                       
'app_name'      => $app_name,
-                                                                       'hook'  
=> $hook
-                                                               )
-                                                       );
-                                               }
-                                       }
-                               }
-                       }
-                       Header('Location: 
'.$GLOBALS['phpgw']->link('/admin/index.php'));
-                       $GLOBALS['phpgw']->common->phpgw_exit();
- 
                }
        }
--- 54,57 ----

Index: class.uiapplications.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.uiapplications.inc.php,v
retrieving revision 1.3.2.1.2.2
retrieving revision 1.3.2.1.2.3
diff -C2 -r1.3.2.1.2.2 -r1.3.2.1.2.3
*** class.uiapplications.inc.php        6 Apr 2003 00:19:14 -0000       
1.3.2.1.2.2
--- class.uiapplications.inc.php        27 Apr 2003 21:34:14 -0000      
1.3.2.1.2.3
***************
*** 18,22 ****
                        'add'      => True,
                        'edit'     => True,
!                       'delete'   => True
                );
  
--- 18,23 ----
                        'add'      => True,
                        'edit'     => True,
!                       'delete'   => True,
!                       'register_all_hooks' => True
                );
  
***************
*** 350,353 ****
--- 351,365 ----
                                '<input type="hidden" name="app_name" value="'. 
urlencode($app_name) . '">');
                        
$GLOBALS['phpgw']->template->pparse('phpgw_body','body');
+               }
+               
+               function register_all_hooks()
+               {
+                       if (!is_object($GLOBALS['phpgw']->hooks))
+                       {
+                               $GLOBALS['phpgw']->hooks = 
CreateObject('phpgwapi.hooks');
+                       }
+                       $GLOBALS['phpgw']->hooks->register_all_hooks();
+                       
+                       $GLOBALS['phpgw']->redirect_link('/admin/index.php');
                }
        }

Index: hook_admin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/hook_admin.inc.php,v
retrieving revision 1.26.2.1.2.1
retrieving revision 1.26.2.1.2.2
diff -C2 -r1.26.2.1.2.1 -r1.26.2.1.2.2
*** hook_admin.inc.php  27 Mar 2003 11:14:39 -0000      1.26.2.1.2.1
--- hook_admin.inc.php  27 Apr 2003 21:34:14 -0000      1.26.2.1.2.2
***************
*** 64,68 ****
        if (! $GLOBALS['phpgw']->acl->check('appreg_access',1,'admin'))
        {
!               $file['Find and Register all Application Hooks'] = 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.boapplications.register_all_hooks');
        }
  
--- 64,68 ----
        if (! $GLOBALS['phpgw']->acl->check('appreg_access',1,'admin'))
        {
!               $file['Find and Register all Application Hooks'] = 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.register_all_hooks');
        }
  





reply via email to

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