public function isAjax() { if ($this->isAjax === null) { $this->isAjax = $this->_request->isXmlHttpRequest(); } return $this->isAjax; }
public function debugAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs) { //requires admin to use this tool $admin = $this->getDi()->authAdmin->getUser(); if (!$admin) { return; } //plugin is not configured if (!$this->getConfig('datalink_user') || !$this->getConfig('datalink_pass')) { Am_Controller::ajaxResponse(array('ok' => false, 'msg' => '<font color="red">Ecsuite plugin error: Datalink is not configured!</font>')); return; } $error = $this->sendTest(); if ($request->isXmlHttpRequest()) { if (empty($error)) { Am_Controller::ajaxResponse(array('ok' => true)); } else { Am_Controller::ajaxResponse(array('ok' => false, 'msg' => $error)); } } else { echo $error; } }