From 019db13e3338c0bbfff40ecacb9cce3b054781b6 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 13 Sep 2013 13:51:33 +0000 Subject: [PATCH] Handle, infolog->add link in sidebox menu via app.js, instead of using inline script on infolog_hook --- infolog/inc/class.infolog_hooks.inc.php | 4 +--- infolog/js/app.js | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/infolog/inc/class.infolog_hooks.inc.php b/infolog/inc/class.infolog_hooks.inc.php index 30b790629a..e351fbb27f 100644 --- a/infolog/inc/class.infolog_hooks.inc.php +++ b/infolog/inc/class.infolog_hooks.inc.php @@ -98,9 +98,7 @@ class infolog_hooks $file = array( 'infolog list' => egw::link('/index.php',array( 'menuaction' => 'infolog.infolog_ui.index' )), - 'Add' => "javascript:egw_openWindowCentered2('".egw::link('/index.php',array( - 'menuaction' => 'infolog.infolog_ui.edit', - ),false)."','_blank',750,410,'yes');", + 'Add' => "javascript:app.infolog.add_from_hook()", ); display_sidebox($appname,$GLOBALS['egw_info']['apps']['infolog']['title'].' '.lang('Menu'),$file); } diff --git a/infolog/js/app.js b/infolog/js/app.js index 1ce884943c..897719f5bb 100644 --- a/infolog/js/app.js +++ b/infolog/js/app.js @@ -274,4 +274,12 @@ app.infolog = AppJS.extend( } } }, + + /** + * + */ + add_link_sidemenu: function() + { + egw_openWindowCentered2(egw().link('/index.php?menuaction=infolog.infolog_ui.edit',false),'_blank',750,410,'yes'); + }, });