phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: infolog/inc class.bolink.inc.php,1.12,1.13 class


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: infolog/inc class.bolink.inc.php,1.12,1.13 class.uiinfolog.inc.php,1.64,1.65hook_projects_view.inc.php,1.4,1.5
Date: Sun, 27 Apr 2003 18:33:37 -0400

Update of /cvsroot/phpgroupware/infolog/inc
In directory subversions:/tmp/cvs-serv21664/inc

Modified Files:
        class.bolink.inc.php class.uiinfolog.inc.php 
        hook_projects_view.inc.php 
Log Message:
changes for new hooks

Index: class.bolink.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.bolink.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.bolink.inc.php        22 Feb 2003 12:23:54 -0000      1.12
--- class.bolink.inc.php        27 Apr 2003 22:33:35 -0000      1.13
***************
*** 28,32 ****
        class bolink extends solink
        {
!               var $app_register = array(              // this should be 
setup/extended by setup
                        'addressbook' => array(
                                'query' => 'addressbook_query',
--- 28,35 ----
        class bolink extends solink
        {
!               // other apps can participate in the linking by implementing a 
search_link hook, which
!               // has to return an array in the format of an app_register entry
!               //
!               var $app_register = array(
                        'addressbook' => array(
                                'query' => 'addressbook_query',
***************
*** 41,45 ****
                                'title' => 'projects_title',
                                'view' => array (
!                                       'menuaction' => 
'projects.uiprocject.view_project'
                                ),
                                'view_id' => 'project_id'
--- 44,48 ----
                                'title' => 'projects_title',
                                'view' => array (
!                                       'menuaction' => 
'projects.uiprojects.view_project'
                                ),
                                'view_id' => 'project_id'
***************
*** 77,81 ****
                function bolink( )
                {
!                       $this->solink( );                                       
                // call constructor of derived class
                        $this->public_functions += array(       // extend the 
public_functions of solink
                                'query' => True,
--- 80,84 ----
                function bolink( )
                {
!                       $this->solink( );                                       
// call constructor of derived class
                        $this->public_functions += array(       // extend the 
public_functions of solink
                                'query' => True,
***************
*** 94,97 ****
--- 97,115 ----
                        }
                        unset($config);
+                       
+                       // other apps can participate in the linking by 
implementing a search_link hook, which
+                       // has to return an array in the format of an 
app_register entry
+                       //
+                       $search_link_hooks = 
$GLOBALS['phpgw']->hooks->process('search_link');
+                       if (is_array($search_link_hooks))
+                       {
+                               foreach($search_link_hooks as $app => $data)
+                               {
+                                       if (is_array($data))
+                                       {
+                                               $this->app_register[$app] = 
$data;
+                                       }
+                               }
+                       }
                }
  
***************
*** 121,125 ****
                function link( 
$app1,&$id1,$app2,$id2='',$remark='',$owner=0,$lastmod=0 )
                {
!                       if ($this->debug)
                        {
                                echo 
"<p>bolink.link('$app1',$id1,'$app2',$id2,'$remark',$owner,$lastmod)</p>\n";
--- 139,143 ----
                function link( 
$app1,&$id1,$app2,$id2='',$remark='',$owner=0,$lastmod=0 )
                {
!                       //if ($this->debug)
                        {
                                echo 
"<p>bolink.link('$app1',$id1,'$app2',$id2,'$remark',$owner,$lastmod)</p>\n";
***************
*** 319,323 ****
                                if 
($GLOBALS['phpgw_info']['user']['apps'][$app])
                                {
!                                       $apps[$app] = lang($app);
                                }
                        }
--- 337,341 ----
                                if 
($GLOBALS['phpgw_info']['user']['apps'][$app])
                                {
!                                       $apps[$app] = 
$GLOBALS['phpgw_info']['apps'][$app]['title'];
                                }
                        }
***************
*** 446,451 ****
                        if (empty($app) || empty($id) || empty($filename) /* || 
!$this->bo->check_access($info_id,PHPGW_ACL_READ)*/)
                        {
!                               Header('Location: ' .  
$GLOBALS['phpgw']->link('/'));
!                               exit();
                        }
                        $browser = CreateObject('phpgwapi.browser');
--- 464,468 ----
                        if (empty($app) || empty($id) || empty($filename) /* || 
!$this->bo->check_access($info_id,PHPGW_ACL_READ)*/)
                        {
!                               $GLOBALS['phpgw']->redirect_link('/');
                        }
                        $browser = CreateObject('phpgwapi.browser');
***************
*** 457,467 ****
                        {
                                Header('Location: ' . $local);
-                               exit();
                        }
!                       $info = $this->info_attached($app,$id,$filename);
!                       $browser->content_header($filename,$info['mime_type']);
!                       echo $this->read_attached($app,$id,$filename);
!                       
!                       exit();
                }
  
--- 474,485 ----
                        {
                                Header('Location: ' . $local);
                        }
!                       else
!                       {
!                               $info = 
$this->info_attached($app,$id,$filename);
!                               
$browser->content_header($filename,$info['type']);
!                               echo $this->read_attached($app,$id,$filename);
!                       }
!                       $GLOBALS['phpgw']->common->phpgw_exit();
                }
  

Index: class.uiinfolog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.uiinfolog.inc.php,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -r1.64 -r1.65
*** class.uiinfolog.inc.php     22 Apr 2003 20:30:22 -0000      1.64
--- class.uiinfolog.inc.php     27 Apr 2003 22:33:35 -0000      1.65
***************
*** 21,27 ****
                        'edit'        => True,
                        'delete'      => True,
-                       'get_file'    => True,
-                       'add_file'    => True,
                        'admin'       => True,
                        'writeLangFile' => True
                );
--- 21,26 ----
                        'edit'        => True,
                        'delete'      => True,
[...1205 lines suppressed...]
+                               echo "<p>uiinfolog::hook_view("; 
print_r($args); echo "): app='$app', $view_id='$args[$view_id]', 
view='$view'</p>\n";
+                       }
+                       if (!isset($app) || !isset($args[$view_id]))
+                       {
+                               return False;
+                       }
+                       $save_app = 
$GLOBALS['phpgw_info']['flags']['currentapp']; 
+                       $GLOBALS['phpgw_info']['flags']['currentapp'] = 
'infolog'; 
+ 
+                       $GLOBALS['phpgw']->translation->add_app('infolog');
+ 
+                       $GLOBALS['phpgw_info']['etemplate']['hooked'] = True;
+                       $this->index(0,$app,$args[$view_id],array(
+                               'menuaction' => $view,
+                               $view_id     => $args[$view_id]
+                       ));
+                       $GLOBALS['phpgw_info']['flags']['currentapp'] = 
$save_app;
+                       unset($GLOBALS['phpgw_info']['etemplate']['hooked']);
+               } 
        }

Index: hook_projects_view.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/hook_projects_view.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** hook_projects_view.inc.php  23 Nov 2002 20:45:07 -0000      1.4
--- hook_projects_view.inc.php  27 Apr 2003 22:33:35 -0000      1.5
***************
*** 12,27 ****
        /* $Id$ */
  
!       global $phpgw_info,$phpgw;
!       $save_app = $phpgw_info['flags']['currentapp']; 
!       $phpgw_info['flags']['currentapp'] = 'infolog'; 
  
!       $phpgw->translation->add_app('infolog');
  
        $GLOBALS['phpgw_info']['etemplate']['hooked'] = True;
! 
        $infolog = CreateObject('infolog.uiinfolog');
!       $infolog->index(0,'calendar',$GLOBALS['project_id'],array(
                'menuaction' => 'projects.uiprojects.view',
!               'project_id' => $GLOBALS['project_id']
        ));
        $GLOBALS['phpgw_info']['flags']['currentapp'] = $save_app;
--- 12,27 ----
        /* $Id$ */
  
!       $save_app = $GLOBALS['phpgw_info']['flags']['currentapp']; 
!       $GLOBALS['phpgw_info']['flags']['currentapp'] = 'infolog'; 
  
!       $GLOBALS['phpgw']->translation->add_app('infolog');
  
        $GLOBALS['phpgw_info']['etemplate']['hooked'] = True;
!       $project_id = $_GET['project_id'];
! echo "<p>hook_projects: project_id='$project_id'</p>\n";
        $infolog = CreateObject('infolog.uiinfolog');
!       $infolog->index(0,'projects',$project_id,array(
                'menuaction' => 'projects.uiprojects.view',
!               'project_id' => $project_id
        ));
        $GLOBALS['phpgw_info']['flags']['currentapp'] = $save_app;





reply via email to

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