Skip to content
Snippets Groups Projects
Commit f0bc1267 authored by efalcy's avatar efalcy
Browse files

sandbox #16325 inspector gadget : add param inspector_gadget to absolute url

parent 6878b221
Branches
Tags
5 merge requests!529Hotline 6.56,!512Master,!484Master,!476Sandbox #16325 inspector gadget,!470Sandbox #16325 inspector gadget
......@@ -24,8 +24,8 @@ class ZendAfi_Controller_Plugin_InspectorGadget extends Zend_Controller_Plugin_A
protected $_calls = [];
public function preDispatch(Zend_Controller_Request_Abstract $request) {
/*if (!$request->getParam('inspector_gadget', false))
return;*/
if (!$request->getParam('inspector_gadget', false))
return;
$this->beEnabled();
Class_WebService_SIGB_AbstractService::setLogger($this);
......@@ -43,7 +43,7 @@ class ZendAfi_Controller_Plugin_InspectorGadget extends Zend_Controller_Plugin_A
$html = '<ul>';
foreach($this->_calls as $call) {
$html .= sprintf('<li>%s, %s, %s</li>',
$html .= sprintf('<li><ul><li>%s</li>, <li>%s</li>, <li><textarea>%s</textarea></li></ul></li>',
$call->request, $call->response_code, $call->response_body);
}
......
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_AbsoluteUrl extends Zend_View_Helper_HtmlElement {
protected static $_do_not_add_base_url;
......@@ -26,10 +26,14 @@ class ZendAfi_View_Helper_AbsoluteUrl extends Zend_View_Helper_HtmlElement {
}
public function absoluteUrl($url_array_or_string = [], $name = null, $reset = false, $encode = true) {
$url = is_string($url_array_or_string)
? $url_array_or_string
: $this->view->url($url_array_or_string, $name, $reset, $encode);
if ($url = is_string($url_array_or_string))
$url=$url_array_or_string;
else {
$this->_request = Zend_Controller_Front::getInstance()->getRequest();
if ($this->_request->getParam('inspector_gadget'))
$url_array_or_string['inspector_gadget'] = '1';
$url=$this->view->url($url_array_or_string, $name, $reset, $encode);
}
if (preg_match('/http[s]?:\/\//', $url))
return $url;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment