mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-20 21:50:49 +01:00
121 lines
3.9 KiB
PHP
121 lines
3.9 KiB
PHP
<?php
|
|
/**
|
|
* eGroupWare - resources
|
|
* General hook object for resources
|
|
* It encapsulats all the diffent hook methods
|
|
*
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
* @package resources
|
|
* @link http://www.egroupware.org
|
|
* @version $Id$
|
|
*/
|
|
|
|
/**
|
|
* General hook object for resources
|
|
* It encapsulats all the diffent hook methods
|
|
* @package resources
|
|
*/
|
|
class resources_hooks
|
|
{
|
|
function admin_prefs_sidebox($args)
|
|
{
|
|
$this->acl =& CreateObject('resources.bo_acl');
|
|
|
|
$appname = 'resources';
|
|
$location = is_array($args) ? $args['location'] : $args;
|
|
|
|
if ($location == 'sidebox_menu')
|
|
{
|
|
$title = $GLOBALS['egw_info']['apps']['resources']['title'].' '.lang('Menu');
|
|
$file = array(
|
|
'Resources list' => egw::link('/index.php',array('menuaction' => 'resources.ui_resources.index' )),
|
|
);
|
|
if($this->acl->get_cats(EGW_ACL_ADD))
|
|
{
|
|
$file['Add resource'] = "javascript:egw_openWindowCentered2('".egw::link('/index.php',array(
|
|
'menuaction' => 'resources.ui_resources.edit',
|
|
),false)."','_blank',800,600,'yes')";
|
|
}
|
|
display_sidebox($appname,$title,$file);
|
|
}
|
|
|
|
/* if ($GLOBALS['egw_info']['user']['apps']['preferences'] && $location != 'admin')
|
|
{
|
|
$file = array(
|
|
'Preferences' => egw::link('/preferences/preferences.php','appname='.$appname),
|
|
'Grant Access' => egw::link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname),
|
|
'Edit Categories' => egw::link('/index.php','menuaction=preferences.uicategories.index&cats_app=' . $appname . '&cats_level=True&global_cats=True')
|
|
);
|
|
if ($location == 'preferences')
|
|
{
|
|
display_section($appname,$file);
|
|
}
|
|
else
|
|
{
|
|
display_sidebox($appname,lang('Preferences'),$file);
|
|
}
|
|
}
|
|
*/
|
|
if ($GLOBALS['egw_info']['user']['apps']['admin'] && $location != 'preferences')
|
|
{
|
|
$file = Array(
|
|
'Global Categories' => egw::link('/index.php',array(
|
|
'menuaction' => 'admin.uicategories.index',
|
|
'appname' => $appname,
|
|
'global_cats'=> true)),
|
|
'Configure Access Permissions' => egw::link('/index.php',
|
|
'menuaction=resources.ui_acl.acllist'),
|
|
'Custom Fields'=>egw::link('/index.php',
|
|
'menuaction=admin.customfields.edit&appname=resources'),
|
|
);
|
|
if ($location == 'admin')
|
|
{
|
|
display_section($appname,$file);
|
|
}
|
|
else
|
|
{
|
|
display_sidebox($appname,lang('Admin'),$file);
|
|
}
|
|
}
|
|
}
|
|
|
|
function search_link($args)
|
|
{
|
|
return array(
|
|
'query' => 'resources.bo_resources.link_query',
|
|
'title' => 'resources.bo_resources.link_title',
|
|
'titles' => 'resources.bo_resources.link_titles',
|
|
'view' => array(
|
|
'menuaction' => 'resources.ui_resources.show'
|
|
),
|
|
'view_id' => 'res_id',
|
|
'view_popup' => '850x600',
|
|
'view_list' => 'resources.ui_resources.index',
|
|
'add' => array(
|
|
'menuaction' => 'resources.ui_resources.edit',
|
|
),
|
|
'add_app' => 'link_app',
|
|
'add_id' => 'link_id',
|
|
'add_popup' => '800x600',
|
|
'find_extra' => array('name_preg' => '/^(?(?=^.picture.jpg$)|.+)$/'), // remove pictures from regular attachment list
|
|
);
|
|
}
|
|
|
|
function calendar_resources($args)
|
|
{
|
|
return array(
|
|
'widget' => 'resources_select',// widget to use for the selection of resources
|
|
'info' => 'resources.bo_resources.get_calendar_info',// info method, returns array with id, type & name for a given id
|
|
'max_quantity' => 'useable',// if set, key for max. quantity in array returned by info method
|
|
'new_status' => 'resources.bo_resources.get_calendar_new_status',// method returning the status for new items, else 'U' is used
|
|
'type' => 'r',// one char type-identifiy for this resources
|
|
'icon' => 'calicon',//icon
|
|
'participants_header' => lang('resources'), // header of participants from this type
|
|
'cal_sidebox' => array(
|
|
'menu_title' => lang('Select resources'),
|
|
'file' => 'resources.ui_resources.get_calendar_sidebox'
|
|
)
|
|
);
|
|
}
|
|
}
|