From 94676105493a4bae2f3b72ab7d71cd31ab359ab5 Mon Sep 17 00:00:00 2001 From: Pim Snel Date: Tue, 23 Jan 2007 23:35:12 +0000 Subject: [PATCH] implement topmenu hook check if topmenu is enabled and then skip after navbar hook --- admin/inc/hook_after_navbar.inc.php | 8 ++- admin/inc/hook_topmenu_info.inc.php | 66 ++++++++++++++++++++ admin/setup/setup.inc.php | 3 +- admin/templates/default/images/navbar18.png | Bin 0 -> 3759 bytes 4 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 admin/inc/hook_topmenu_info.inc.php create mode 100644 admin/templates/default/images/navbar18.png diff --git a/admin/inc/hook_after_navbar.inc.php b/admin/inc/hook_after_navbar.inc.php index 54f1726dc5..96b5cacf22 100644 --- a/admin/inc/hook_after_navbar.inc.php +++ b/admin/inc/hook_after_navbar.inc.php @@ -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); } -} \ No newline at end of file +} diff --git a/admin/inc/hook_topmenu_info.inc.php b/admin/inc/hook_topmenu_info.inc.php new file mode 100644 index 0000000000..297ecdb89d --- /dev/null +++ b/admin/inc/hook_topmenu_info.inc.php @@ -0,0 +1,66 @@ + * +* 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
" . 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 = '

'.implode('
',$_returnhtml)."

\n"; + + $GLOBALS['egw']->framework->topmenu_info_icon('admin_new_msg',$icon_newmsg,'',true,$lang_msg); + } + + unset($_returnhtml); + unset($_html); + } +} diff --git a/admin/setup/setup.inc.php b/admin/setup/setup.inc.php index e5f4b650df..81938a5952 100755 --- a/admin/setup/setup.inc.php +++ b/admin/setup/setup.inc.php @@ -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 */ diff --git a/admin/templates/default/images/navbar18.png b/admin/templates/default/images/navbar18.png new file mode 100644 index 0000000000000000000000000000000000000000..c1f51360e12510926d0050f9c5ee05108d76bd87 GIT binary patch literal 3759 zcmV;g4p8xlP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;K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