2003-10-16 11:36:46 +02:00
|
|
|
<?php
|
2005-04-06 13:05:57 +02:00
|
|
|
/**
|
2007-05-23 23:39:52 +02:00
|
|
|
* InfoLog - Admin-, Preferences- and SideboxMenu-Hooks
|
2005-04-06 13:05:57 +02:00
|
|
|
*
|
2007-05-23 23:39:52 +02:00
|
|
|
* @link http://www.egroupware.org
|
|
|
|
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
2005-04-06 13:05:57 +02:00
|
|
|
* @package infolog
|
2007-05-23 23:39:52 +02:00
|
|
|
* @copyright (c) 2003-6 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
2005-11-12 14:25:59 +01:00
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
2007-05-23 23:39:52 +02:00
|
|
|
* @version $Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class containing admin, preferences and sidebox-menus (used as hooks)
|
2005-04-06 13:05:57 +02:00
|
|
|
*/
|
2003-10-16 11:36:46 +02:00
|
|
|
class admin_prefs_sidebox_hooks
|
|
|
|
{
|
|
|
|
function all_hooks($args)
|
|
|
|
{
|
|
|
|
$appname = 'infolog';
|
|
|
|
$location = is_array($args) ? $args['location'] : $args;
|
|
|
|
//echo "<p>admin_prefs_sidebox_hooks::all_hooks(".print_r($args,True).") appname='$appname', location='$location'</p>\n";
|
|
|
|
|
|
|
|
if ($location == 'sidebox_menu')
|
|
|
|
{
|
|
|
|
$file = array(
|
2005-04-06 13:05:57 +02:00
|
|
|
'infolog list' => $GLOBALS['egw']->link('/index.php',array(
|
2003-11-17 17:51:38 +01:00
|
|
|
'menuaction' => 'infolog.uiinfolog.index' )),
|
2005-11-18 17:12:29 +01:00
|
|
|
array(
|
|
|
|
'text' => '<a class="textSidebox" href="'.htmlspecialchars($GLOBALS['egw']->link('/index.php',array(
|
|
|
|
'menuaction' => 'infolog.uiinfolog.edit',
|
|
|
|
))).'" target="_blank" onclick="window.open(this.href,this.target,\'dependent=yes,width=750,height=550,scrollbars=yes,status=yes\'); return false;">'.lang('Add').'</a>',
|
|
|
|
'no_lang' => true,
|
|
|
|
)
|
2003-10-16 11:36:46 +02:00
|
|
|
);
|
2005-04-06 13:05:57 +02:00
|
|
|
display_sidebox($appname,$GLOBALS['egw_info']['apps']['infolog']['title'].' '.lang('Menu'),$file);
|
2003-10-16 11:36:46 +02:00
|
|
|
}
|
|
|
|
|
2005-04-06 13:05:57 +02:00
|
|
|
if ($GLOBALS['egw_info']['user']['apps']['preferences'] && $location != 'admin')
|
2003-10-16 11:36:46 +02:00
|
|
|
{
|
|
|
|
$file = array(
|
2005-07-23 11:44:46 +02:00
|
|
|
'Preferences' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uisettings.index&appname='.$appname),
|
2005-04-06 13:05:57 +02:00
|
|
|
'Grant Access' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname),
|
|
|
|
'Edit Categories' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=' . $appname . '&cats_level=True&global_cats=True')
|
2003-10-16 11:36:46 +02:00
|
|
|
);
|
|
|
|
if ($location == 'preferences')
|
|
|
|
{
|
|
|
|
display_section($appname,$file);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
display_sidebox($appname,lang('Preferences'),$file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-04-06 13:05:57 +02:00
|
|
|
if ($GLOBALS['egw_info']['user']['apps']['admin'] && $location != 'preferences')
|
2003-10-16 11:36:46 +02:00
|
|
|
{
|
|
|
|
$file = Array(
|
2005-04-06 13:05:57 +02:00
|
|
|
'Site configuration' => $GLOBALS['egw']->link('/index.php',array(
|
2003-10-16 11:36:46 +02:00
|
|
|
'menuaction' => 'infolog.uiinfolog.admin' )),
|
2005-04-06 13:05:57 +02:00
|
|
|
'Global Categories' => $GLOBALS['egw']->link('/index.php',array(
|
2003-10-16 11:36:46 +02:00
|
|
|
'menuaction' => 'admin.uicategories.index',
|
|
|
|
'appname' => $appname,
|
|
|
|
'global_cats'=> True)),
|
2005-04-06 13:05:57 +02:00
|
|
|
'Custom fields, typ and status' => $GLOBALS['egw']->link('/index.php',array(
|
2003-10-16 11:36:46 +02:00
|
|
|
'menuaction' => 'infolog.uicustomfields.edit')),
|
2005-04-06 13:05:57 +02:00
|
|
|
'CSV-Import' => $GLOBALS['egw']->link('/infolog/csv_import.php')
|
2003-10-16 11:36:46 +02:00
|
|
|
);
|
|
|
|
if ($location == 'admin')
|
|
|
|
{
|
|
|
|
display_section($appname,$file);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
display_sidebox($appname,lang('Admin'),$file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|