mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
implement topmenu hook
check if topmenu is enabled and then skip after navbar hook
This commit is contained in:
parent
b45b84fe55
commit
9467610549
@ -14,8 +14,12 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Check currentapp and API upgrade status */
|
||||
//if$GLOBALS['egw_info']['user']['preferences']['common']);
|
||||
//=
|
||||
//itemplate_set
|
||||
|
||||
if($GLOBALS['egw_info']['flags']['currentapp'] != 'home' &&
|
||||
if( $GLOBALS['egw_info']['user']['preferences']['common']['show_general_menu'] == 'sidebox' &&
|
||||
$GLOBALS['egw_info']['flags']['currentapp'] != 'home' &&
|
||||
$GLOBALS['egw_info']['flags']['currentapp'] != 'welcome' &&
|
||||
(isset($GLOBALS['egw_info']['server']['checkappversions']) &&
|
||||
$GLOBALS['egw_info']['server']['checkappversions']))
|
||||
@ -82,4 +86,4 @@ if($GLOBALS['egw_info']['flags']['currentapp'] != 'home' &&
|
||||
unset($_returnhtml);
|
||||
unset($_html);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
66
admin/inc/hook_topmenu_info.inc.php
Normal file
66
admin/inc/hook_topmenu_info.inc.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Admin *
|
||||
* http://www.egroupware.org *
|
||||
* This application written by Miles Lott <milos@groupwhere.org> *
|
||||
* This file is ported to the topmenu hook by Pim Snel pim@lingewoud.nl *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id: hook_after_navbar.inc.php 20071 2005-12-01 20:21:16Z ralfbecker $ */
|
||||
|
||||
/* Check currentapp and API upgrade status */
|
||||
if( (isset($GLOBALS['egw_info']['server']['checkappversions']) && $GLOBALS['egw_info']['server']['checkappversions']))
|
||||
{
|
||||
if((isset($GLOBALS['egw_info']['user']['apps']['admin']) &&
|
||||
$GLOBALS['egw_info']['user']['apps']['admin']) ||
|
||||
$GLOBALS['egw_info']['server']['checkappversions'] == 'All')
|
||||
{
|
||||
$_returnhtml = array();
|
||||
$app_name = $GLOBALS['egw_info']['flags']['currentapp'];
|
||||
$GLOBALS['egw']->db->query("SELECT app_name,app_version FROM egw_applications WHERE app_name='$app_name' OR app_name='phpgwapi'",__LINE__,__FILE__);
|
||||
while($GLOBALS['egw']->db->next_record())
|
||||
{
|
||||
$_db_version = $GLOBALS['egw']->db->f('app_version');
|
||||
$app_name = $GLOBALS['egw']->db->f('app_name');
|
||||
$_versionfile = $GLOBALS['egw']->common->get_app_dir($app_name) . '/setup/setup.inc.php';
|
||||
if(file_exists($_versionfile))
|
||||
{
|
||||
include($_versionfile);
|
||||
$_file_version = $setup_info[$app_name]['version'];
|
||||
unset($setup_info);
|
||||
|
||||
if(amorethanb($_file_version, $_db_version))
|
||||
{
|
||||
if($app_name == 'phpgwapi' )
|
||||
{
|
||||
$_returnhtml[$app_name] = lang('The API requires an upgrade');
|
||||
}
|
||||
else
|
||||
{
|
||||
$_returnhtml[$app_name] = lang('This application requires an upgrade') . ": \n <br />" . lang('Please run setup to become current') . '.' . "\n";
|
||||
}
|
||||
}
|
||||
unset($_file_version);
|
||||
}
|
||||
unset($_db_version);
|
||||
unset($_versionfile);
|
||||
}
|
||||
|
||||
if(count($_returnhtml)>0)
|
||||
{
|
||||
$icon_newmsg = $GLOBALS['egw']->common->image('admin','navbar18');
|
||||
//$link_inbox = $GLOBALS['egw']->link('/index.php','menuaction=messenger.uimessenger.inbox');
|
||||
$lang_msg = '<p style="text-align: center;">'.implode('<br />',$_returnhtml)."</p>\n";
|
||||
|
||||
$GLOBALS['egw']->framework->topmenu_info_icon('admin_new_msg',$icon_newmsg,'',true,$lang_msg);
|
||||
}
|
||||
|
||||
unset($_returnhtml);
|
||||
unset($_html);
|
||||
}
|
||||
}
|
@ -42,7 +42,8 @@
|
||||
'view_user' => 'admin.uiaccounts.edit_view_user_hook',
|
||||
'edit_user' => 'admin.uiaccounts.edit_view_user_hook',
|
||||
'group_manager' => 'admin.uiaccounts.edit_group_hook',
|
||||
'sidebox_menu'
|
||||
'sidebox_menu',
|
||||
'topmenu_info'
|
||||
);
|
||||
|
||||
/* Dependencies for this app to work */
|
||||
|
BIN
admin/templates/default/images/navbar18.png
Normal file
BIN
admin/templates/default/images/navbar18.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
Loading…
Reference in New Issue
Block a user