From 7b40e32a913d4c9994a0877e16c392e8cf2237d7 Mon Sep 17 00:00:00 2001 From: llaffont <llaffont@git-test.afi-sa.fr> Date: Sat, 7 Sep 2013 19:15:39 +0000 Subject: [PATCH] =?UTF-8?q?XHProf:=20g=C3=A9n=C3=A8re=20l'url=20de=20profi?= =?UTF-8?q?ling=20avec=20Zend=5FUrl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/ZendAfi/Controller/Plugin/XHProfile.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/ZendAfi/Controller/Plugin/XHProfile.php b/library/ZendAfi/Controller/Plugin/XHProfile.php index c67bdf5de32..c8a49146294 100644 --- a/library/ZendAfi/Controller/Plugin/XHProfile.php +++ b/library/ZendAfi/Controller/Plugin/XHProfile.php @@ -33,12 +33,15 @@ class ZendAfi_Controller_Plugin_XHProfile extends Zend_Controller_Plugin_Abstrac if (!Class_Users::isCurrentUserSuperAdmin()) return; - if (function_exists('xhprof_enable')) + if (function_exists('xhprof_enable')) { + $view=new ZendAfi_Controller_Action_Helper_View(); + Class_ScriptLoader::getInstance() ->addJQueryReady('$("<button>Profile</button>") - .attr("onclick", "window.open(window.location+\'?xhprof=1\', \'_blank\')") + .attr("onclick", "window.open(\''.$view->url(["xhprof" => 1]).'\', \'_blank\')") .attr("style", "position:absolute;top:0;right:0") .appendTo(\'body\')'); + } if (!$request->getParam('xhprof', false)) return; -- GitLab