source: contrib/resources/inc/class.resources_hooks.inc.php @ 3524

Revision 3524, 4.5 KB checked in by afernandes, 13 years ago (diff)

Ticket #1416 - Disponibilizado módulo de recursos para a comunidade

  • Property svn:executable set to *
Line 
1<?php
2/**
3 * eGroupWare - resources
4 * General hook object for resources
5 * It encapsulats all the diffent hook methods
6 *
7 * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
8 * @package resources
9 * @link http://www.egroupware.org
10 * @version $Id: class.resources_hooks.inc.php 19821 2005-11-14 18:16:56Z nelius_weiss $
11 */
12
13/**
14 * General hook object for resources
15 * It encapsulats all the diffent hook methods
16 * @package resources
17 */
18class resources_hooks
19{
20        function admin_prefs_sidebox($args)
21        {
22                $this->acl =& CreateObject('resources.bo_acl');
23               
24                $appname = 'resources';
25                $location = is_array($args) ? $args['location'] : $args;
26               
27                if ($location == 'sidebox_menu')
28                {
29                        $title = $GLOBALS['phpgw_info']['apps']['resources']['title'].' '.lang('Menu');
30                        $file[] = array(
31                                        'text' => lang('resources list'),
32                                        'no_lang' => true,
33                                        'link' => $GLOBALS['phpgw']->link('/index.php',array('menuaction' => 'resources.ui_resources.index' )),
34//                                      'icon' =>
35                        );
36                       
37                        if($this->acl->get_cats(phpgw_ACL_ADD))
38                        {
39                                $file[] = array(
40                                        'text' => '<a class="textSidebox" href="'.$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 'resources.ui_resources.edit')).
41                                                '" onclick="window.open(this.href,\'_blank\',\'dependent=yes,width=800,height=600,scrollbars=yes,status=yes\');
42                                                return false;">'.lang('add resource').'</a>',
43                                        'no_lang' => true,
44                                        'link' => false
45                                );
46                        }
47//                      $file[] = array(
48//                                      'text' => lang('planer'),
49//                                      'no_lang' => true,
50//                                      'link' => $GLOBALS['phpgw']->link('/index.php',array('menuaction' => 'resources.ui_calviews.planer' )),
51//                                      'icon' =>
52//                      );
53                        display_sidebox($appname,$title,$file);
54                }
55
56/*              if ($GLOBALS['phpgw_info']['user']['apps']['preferences'] && $location != 'admin')
57                {
58                        $file = array(
59                                'Preferences'     => $GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname),
60                                'Grant Access'    => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname),
61                                'Edit Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=' . $appname . '&cats_level=True&global_cats=True')
62                        );
63                        if ($location == 'preferences')
64                        {
65                                display_section($appname,$file);
66                        }
67                        else
68                        {
69                                display_sidebox($appname,lang('Preferences'),$file);
70                        }
71                }
72*/
73                if ($GLOBALS['phpgw_info']['user']['apps']['admin'] && $location != 'preferences')
74                {
75                        $file = Array(
76                                'Site configuration' => $GLOBALS['phpgw']->link('/index.php',array(
77                                        'menuaction' => 'resources.ui_resources.admin' )),
78                                'Global Categories'  => $GLOBALS['phpgw']->link('/index.php',array(
79                                        'menuaction' => 'admin.uicategories.index',
80                                        'appname'    => $appname,
81                                        'global_cats'=> true)),
82                                'Configure Access Permissions' => $GLOBALS['phpgw']->link('/index.php',
83                                        'menuaction=resources.ui_acl.acllist'),
84                                'Custom Fields'=>$GLOBALS['phpgw']->link('/index.php',
85                                        'menuaction=admin.customfields.edit&appname=resources'),
86//                              'CSV-Import'         => $GLOBALS['phpgw']->link('/infolog/csv_import.php')
87                        );
88                        if ($location == 'admin')
89                        {
90                                display_section($appname,$file);
91                        }
92                        else
93                        {
94                                display_sidebox($appname,lang('Admin'),$file);
95                        }
96                }
97        }
98       
99        function search_link($args)
100        {
101                return array(
102                        'query' => 'resources.bo_resources.link_query',
103                        'title' => 'resources.bo_resources.link_title',
104                        'view' => array(
105                                'menuaction' => 'resources.ui_resources.show'
106                        ),
107                        'view_id' => 'res_id',
108                        'view_popup' => '850x600',
109                        'add'        => array(
110                                'menuaction' => 'resources.ui_resources.edit',
111                        ),
112                        'add_app'    => 'link_app',
113                        'add_id'     => 'link_id',     
114                        'add_popup'  => '800x600',
115                );
116        }
117
118        function calendar_resources($args)
119        {
120                return array(   
121                        'widget' => 'resources_select',// widget to use for the selection of resources
122                        'info' => 'resources.bo_resources.get_calendar_info',// info method, returns array with id, type & name for a given id
123                        'max_quantity' => 'useable',// if set, key for max. quantity in array returned by info method
124                        'new_status' => 'resources.bo_resources.get_calendar_new_status',// method returning the status for new items, else 'U' is used
125                        'type' => 'r',// one char type-identifiy for this resources
126                        'icon' => 'calicon',//icon
127                        'participants_header' => lang('resources'), // header of participants from this type
128                        'cal_sidebox' => array(
129                                'menu_title' => lang('Select resources'),
130                                'file' => 'resources.ui_resources.get_calendar_sidebox'
131                        )
132                );
133        }
134}
135
136?>
Note: See TracBrowser for help on using the repository browser.